Show search local option on supported Android versions only

This commit is contained in:
M66B 2019-03-18 13:09:34 +00:00
parent 4e600c8bad
commit 01fcffe8c9
2 changed files with 10 additions and 1 deletions

View File

@ -107,6 +107,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swUpdates; private SwitchCompat swUpdates;
private SwitchCompat swDebug; private SwitchCompat swDebug;
private Group grpSearchLocal;
private Group grpNotification; private Group grpNotification;
static String[] OPTIONS_RESTART = new String[]{ static String[] OPTIONS_RESTART = new String[]{
@ -182,6 +183,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swUpdates = view.findViewById(R.id.swUpdates); swUpdates = view.findViewById(R.id.swUpdates);
swDebug = view.findViewById(R.id.swDebug); swDebug = view.findViewById(R.id.swDebug);
grpSearchLocal = view.findViewById(R.id.grpSearchLocal);
grpNotification = view.findViewById(R.id.grpNotification); grpNotification = view.findViewById(R.id.grpNotification);
// Wire controls // Wire controls
@ -613,7 +615,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE); swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE);
swDebug.setChecked(prefs.getBoolean("debug", false)); 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) { private String formatHour(int minutes) {

View File

@ -815,6 +815,12 @@
app:layout_constraintTop_toBottomOf="@id/swUpdates" app:layout_constraintTop_toBottomOf="@id/swUpdates"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpSearchLocal"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="swSearchLocal,tvSearchLocalHint" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpNotification" android:id="@+id/grpNotification"
android:layout_width="0dp" android:layout_width="0dp"