Show number of processors

pull/156/head
M66B 6 years ago
parent c98683818b
commit 35311118ab

@ -57,6 +57,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swCrashReports; private SwitchCompat swCrashReports;
private SwitchCompat swDebug; private SwitchCompat swDebug;
private TextView tvProcessors;
private TextView tvMemoryClass; private TextView tvMemoryClass;
private TextView tvLastCleanup; private TextView tvLastCleanup;
private TextView tvUuid; private TextView tvUuid;
@ -93,6 +94,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swCrashReports = view.findViewById(R.id.swCrashReports); swCrashReports = view.findViewById(R.id.swCrashReports);
swDebug = view.findViewById(R.id.swDebug); swDebug = view.findViewById(R.id.swDebug);
tvProcessors = view.findViewById(R.id.tvProcessors);
tvMemoryClass = view.findViewById(R.id.tvMemoryClass); tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
tvLastCleanup = view.findViewById(R.id.tvLastCleanup); tvLastCleanup = view.findViewById(R.id.tvLastCleanup);
tvUuid = view.findViewById(R.id.tvUuid); tvUuid = view.findViewById(R.id.tvUuid);
@ -261,6 +263,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swCrashReports.setChecked(prefs.getBoolean("crash_reports", false)); swCrashReports.setChecked(prefs.getBoolean("crash_reports", false));
swDebug.setChecked(prefs.getBoolean("debug", false)); swDebug.setChecked(prefs.getBoolean("debug", false));
tvProcessors.setText(getString(R.string.title_advanced_processors, Runtime.getRuntime().availableProcessors()));
ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE); ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
int class_mb = am.getMemoryClass(); int class_mb = am.getMemoryClass();
tvMemoryClass.setText(getString(R.string.title_advanced_memory_class, class_mb + " MB")); tvMemoryClass.setText(getString(R.string.title_advanced_memory_class, class_mb + " MB"));

@ -190,18 +190,30 @@
app:layout_constraintTop_toBottomOf="@id/swDebug" /> app:layout_constraintTop_toBottomOf="@id/swDebug" />
<TextView <TextView
android:id="@+id/tvMemoryClass" android:id="@+id/tvProcessors"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginEnd="48dp" android:layout_marginEnd="48dp"
android:text="@string/title_advanced_memory_class" android:text="@string/title_advanced_processors"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic" android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint" /> app:layout_constraintTop_toBottomOf="@id/tvDebugHint" />
<TextView
android:id="@+id/tvMemoryClass"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_memory_class"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvProcessors" />
<TextView <TextView
android:id="@+id/tvLastCleanup" android:id="@+id/tvLastCleanup"
android:layout_width="0dp" android:layout_width="0dp"
@ -232,7 +244,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids=" app:constraint_referenced_ids="
tvMemoryClass,tvLastCleanup,tvUuid" /> tvProcessors,tvMemoryClass,tvLastCleanup,tvUuid" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -236,6 +236,7 @@
<string name="title_advanced_updates">Check for updates</string> <string name="title_advanced_updates">Check for updates</string>
<string name="title_advanced_crash_reports">Send error reports</string> <string name="title_advanced_crash_reports">Send error reports</string>
<string name="title_advanced_debug">Debug mode</string> <string name="title_advanced_debug">Debug mode</string>
<string name="title_advanced_processors" translatable="false">Processores: %1$d</string>
<string name="title_advanced_memory_class" translatable="false">Memory class: %1$s</string> <string name="title_advanced_memory_class" translatable="false">Memory class: %1$s</string>
<string name="title_advanced_last_cleanup" translatable="false">Last cleanup: %1$s</string> <string name="title_advanced_last_cleanup" translatable="false">Last cleanup: %1$s</string>

Loading…
Cancel
Save