From 70ab587d78b66ee9703c8664d02dab2c15ab343d Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 28 Dec 2018 07:47:51 +0000 Subject: [PATCH] Moved update check option to general --- .../eu/faircode/email/FragmentOptions.java | 22 +++++++-------- app/src/main/res/layout/fragment_options.xml | 28 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index 3cc6f1430e..c6ef3d848e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -52,6 +52,7 @@ import static android.app.Activity.RESULT_OK; public class FragmentOptions extends FragmentEx implements SharedPreferences.OnSharedPreferenceChangeListener { private SwitchCompat swEnabled; + private SwitchCompat swUpdates; private SwitchCompat swMetered; private Spinner spDownload; @@ -75,7 +76,6 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS private SwitchCompat swConfirm; private SwitchCompat swSender; - private SwitchCompat swUpdates; private SwitchCompat swDebug; private Group grpNotification; @@ -90,6 +90,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS // Get controls swEnabled = view.findViewById(R.id.swEnabled); + swUpdates = view.findViewById(R.id.swUpdates); swMetered = view.findViewById(R.id.swMetered); spDownload = view.findViewById(R.id.spDownload); @@ -113,7 +114,6 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS swConfirm = view.findViewById(R.id.swConfirm); swSender = view.findViewById(R.id.swSender); - swUpdates = view.findViewById(R.id.swUpdates); swDebug = view.findViewById(R.id.swDebug); grpNotification = view.findViewById(R.id.grpNotification); @@ -131,6 +131,15 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS } }); + swUpdates.setChecked(prefs.getBoolean("updates", true)); + swUpdates.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("updates", checked).apply(); + } + }); + swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE); + swMetered.setChecked(prefs.getBoolean("metered", true)); swMetered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override @@ -325,15 +334,6 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS } }); - swUpdates.setChecked(prefs.getBoolean("updates", true)); - swUpdates.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("updates", checked).apply(); - } - }); - swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE); - swDebug.setChecked(prefs.getBoolean("debug", false)); swDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override diff --git a/app/src/main/res/layout/fragment_options.xml b/app/src/main/res/layout/fragment_options.xml index 2c4ae896bd..47098c2ba8 100644 --- a/app/src/main/res/layout/fragment_options.xml +++ b/app/src/main/res/layout/fragment_options.xml @@ -56,6 +56,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swEnabled" /> + + + app:layout_constraintTop_toBottomOf="@id/swUpdates" /> - -