From 01fcffe8c9880ceee2cd057466acc94ff0679855 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 18 Mar 2019 13:09:34 +0000 Subject: [PATCH] Show search local option on supported Android versions only --- app/src/main/java/eu/faircode/email/FragmentOptions.java | 5 ++++- app/src/main/res/layout/fragment_options.xml | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index 8d42ebacac..42e6011698 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -107,6 +107,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O private SwitchCompat swUpdates; private SwitchCompat swDebug; + private Group grpSearchLocal; private Group grpNotification; static String[] OPTIONS_RESTART = new String[]{ @@ -182,6 +183,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O swUpdates = view.findViewById(R.id.swUpdates); swDebug = view.findViewById(R.id.swDebug); + grpSearchLocal = view.findViewById(R.id.grpSearchLocal); grpNotification = view.findViewById(R.id.grpNotification); // Wire controls @@ -613,7 +615,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE); swDebug.setChecked(prefs.getBoolean("debug", false)); - grpNotification.setVisibility(BuildConfig.DEBUG || Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O ? View.VISIBLE : View.GONE); + grpSearchLocal.setVisibility(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M ? View.GONE : View.VISIBLE); + grpNotification.setVisibility(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O ? View.VISIBLE : View.GONE); } private String formatHour(int minutes) { diff --git a/app/src/main/res/layout/fragment_options.xml b/app/src/main/res/layout/fragment_options.xml index b9588d3af7..e6919807b9 100644 --- a/app/src/main/res/layout/fragment_options.xml +++ b/app/src/main/res/layout/fragment_options.xml @@ -815,6 +815,12 @@ app:layout_constraintTop_toBottomOf="@id/swUpdates" app:switchPadding="12dp" /> + +