|
|
@ -162,7 +162,7 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure out sync engine checkboxes are up-to-date and disabled if currently syncing
|
|
|
|
// Make sure out sync engine checkboxes are up-to-date and disabled if currently syncing
|
|
|
|
updateSyncEngineStates()
|
|
|
|
updateSyncEngineStates()
|
|
|
|
setCwtsDisabledWhileSyncing(accountManager.isSyncActive())
|
|
|
|
setDisabledWhileSyncing(accountManager.isSyncActive())
|
|
|
|
|
|
|
|
|
|
|
|
val historyNameKey = getPreferenceKey(R.string.pref_key_sync_history)
|
|
|
|
val historyNameKey = getPreferenceKey(R.string.pref_key_sync_history)
|
|
|
|
findPreference<CheckBoxPreference>(historyNameKey)?.apply {
|
|
|
|
findPreference<CheckBoxPreference>(historyNameKey)?.apply {
|
|
|
@ -317,10 +317,14 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun setCwtsDisabledWhileSyncing(isSyncing: Boolean) {
|
|
|
|
private fun setDisabledWhileSyncing(isSyncing: Boolean) {
|
|
|
|
findPreference<PreferenceCategory>(
|
|
|
|
findPreference<PreferenceCategory>(
|
|
|
|
getPreferenceKey(R.string.preferences_sync_category)
|
|
|
|
getPreferenceKey(R.string.preferences_sync_category)
|
|
|
|
)?.isEnabled = !isSyncing
|
|
|
|
)?.isEnabled = !isSyncing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
findPreference<EditTextPreference>(
|
|
|
|
|
|
|
|
getPreferenceKey(R.string.pref_key_sync_device_name)
|
|
|
|
|
|
|
|
)?.isEnabled = !isSyncing
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private val syncStatusObserver = object : SyncStatusObserver {
|
|
|
|
private val syncStatusObserver = object : SyncStatusObserver {
|
|
|
@ -330,7 +334,7 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|
|
|
view?.announceForAccessibility(getString(R.string.sync_syncing_in_progress))
|
|
|
|
view?.announceForAccessibility(getString(R.string.sync_syncing_in_progress))
|
|
|
|
pref?.title = getString(R.string.sync_syncing_in_progress)
|
|
|
|
pref?.title = getString(R.string.sync_syncing_in_progress)
|
|
|
|
pref?.isEnabled = false
|
|
|
|
pref?.isEnabled = false
|
|
|
|
setCwtsDisabledWhileSyncing(true)
|
|
|
|
setDisabledWhileSyncing(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -347,7 +351,7 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Make sure out sync engine checkboxes are up-to-date.
|
|
|
|
// Make sure out sync engine checkboxes are up-to-date.
|
|
|
|
updateSyncEngineStates()
|
|
|
|
updateSyncEngineStates()
|
|
|
|
setCwtsDisabledWhileSyncing(false)
|
|
|
|
setDisabledWhileSyncing(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|