1
0
Fork 0
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:
Felix Ableitner 2015-07-03 16:28:59 +02:00
parent de99288d0d
commit 236541a915

View file

@ -221,11 +221,17 @@ public class SettingsFragment extends PreferenceFragment
if (preference.equals(mSyncOnlyCharging) || preference.equals(mSyncOnlyWifi)) {
mSyncthingService.updateState();
} 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_disabled);
mSyncOnlyCharging.setEnabled((Boolean) o);
mSyncOnlyWifi.setEnabled((Boolean) o);
mSyncOnlyCharging.setEnabled(value);
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)) {
if (!(Boolean) o)
new Thread(new ChownFilesRunnable()).start();