mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-27 06:41:15 +00:00
Uncheck disabled settings.
This commit is contained in:
parent
de99288d0d
commit
236541a915
1 changed files with 9 additions and 3 deletions
|
@ -221,11 +221,17 @@ public class SettingsFragment extends PreferenceFragment
|
||||||
if (preference.equals(mSyncOnlyCharging) || preference.equals(mSyncOnlyWifi)) {
|
if (preference.equals(mSyncOnlyCharging) || preference.equals(mSyncOnlyWifi)) {
|
||||||
mSyncthingService.updateState();
|
mSyncthingService.updateState();
|
||||||
} else if (preference.equals(mAlwaysRunInBackground)) {
|
} else if (preference.equals(mAlwaysRunInBackground)) {
|
||||||
preference.setSummary(((Boolean) o)
|
boolean value = (Boolean) o;
|
||||||
|
preference.setSummary((value)
|
||||||
? R.string.always_run_in_background_enabled
|
? R.string.always_run_in_background_enabled
|
||||||
: R.string.always_run_in_background_disabled);
|
: R.string.always_run_in_background_disabled);
|
||||||
mSyncOnlyCharging.setEnabled((Boolean) o);
|
mSyncOnlyCharging.setEnabled(value);
|
||||||
mSyncOnlyWifi.setEnabled((Boolean) o);
|
mSyncOnlyWifi.setEnabled(value);
|
||||||
|
// Uncheck items when disabled, so it is clear they have no effect.
|
||||||
|
if (!value) {
|
||||||
|
mSyncOnlyCharging.setChecked(false);
|
||||||
|
mSyncOnlyWifi.setChecked(false);
|
||||||
|
}
|
||||||
} else if (preference.equals(mUseRoot)) {
|
} else if (preference.equals(mUseRoot)) {
|
||||||
if (!(Boolean) o)
|
if (!(Boolean) o)
|
||||||
new Thread(new ChownFilesRunnable()).start();
|
new Thread(new ChownFilesRunnable()).start();
|
||||||
|
|
Loading…
Reference in a new issue