mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 07:23:03 +00:00
Show number of processors
This commit is contained in:
parent
c98683818b
commit
35311118ab
3 changed files with 20 additions and 3 deletions
|
@ -57,6 +57,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
private SwitchCompat swCrashReports;
|
||||
private SwitchCompat swDebug;
|
||||
|
||||
private TextView tvProcessors;
|
||||
private TextView tvMemoryClass;
|
||||
private TextView tvLastCleanup;
|
||||
private TextView tvUuid;
|
||||
|
@ -93,6 +94,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
swCrashReports = view.findViewById(R.id.swCrashReports);
|
||||
swDebug = view.findViewById(R.id.swDebug);
|
||||
|
||||
tvProcessors = view.findViewById(R.id.tvProcessors);
|
||||
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
|
||||
tvLastCleanup = view.findViewById(R.id.tvLastCleanup);
|
||||
tvUuid = view.findViewById(R.id.tvUuid);
|
||||
|
@ -261,6 +263,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
swCrashReports.setChecked(prefs.getBoolean("crash_reports", 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);
|
||||
int class_mb = am.getMemoryClass();
|
||||
tvMemoryClass.setText(getString(R.string.title_advanced_memory_class, class_mb + " MB"));
|
||||
|
|
|
@ -190,17 +190,29 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/swDebug" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMemoryClass"
|
||||
android:id="@+id/tvProcessors"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_processors"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
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/tvDebugHint" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvProcessors" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLastCleanup"
|
||||
|
@ -232,7 +244,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="
|
||||
tvMemoryClass,tvLastCleanup,tvUuid" />
|
||||
tvProcessors,tvMemoryClass,tvLastCleanup,tvUuid" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -236,6 +236,7 @@
|
|||
<string name="title_advanced_updates">Check for updates</string>
|
||||
<string name="title_advanced_crash_reports">Send error reports</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_last_cleanup" translatable="false">Last cleanup: %1$s</string>
|
||||
|
||||
|
|
Loading…
Reference in a new issue