From 35311118abdc9b91c545ee637cd88e4bf8572755 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 15 Jun 2019 21:25:49 +0200 Subject: [PATCH] Show number of processors --- .../eu/faircode/email/FragmentOptionsMisc.java | 4 ++++ .../main/res/layout/fragment_options_misc.xml | 18 +++++++++++++++--- app/src/main/res/values/strings.xml | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 0c4abcf63c..871a60631e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -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")); diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 7c8b545275..0f52c8fc02 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -190,18 +190,30 @@ app:layout_constraintTop_toBottomOf="@id/swDebug" /> + + + tvProcessors,tvMemoryClass,tvLastCleanup,tvUuid" /> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1db0f54694..fc12fd387b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -236,6 +236,7 @@ Check for updates Send error reports Debug mode + Processores: %1$d Memory class: %1$s Last cleanup: %1$s