mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-15 18:59:12 +03:00
Make it harder to not find "initial sync" option in settings
Change-Id: Iff49485ebe036a14bf03e274791275d5ff27d864
This commit is contained in:
parent
987ca6dec4
commit
1eacd0cca3
6 changed files with 40 additions and 2 deletions
|
@ -210,4 +210,7 @@
|
|||
<string name="settings_enable_member_name_click">Clickable names</string>
|
||||
<string name="settings_enable_member_name_click_summary">Click on a username to mention them</string>
|
||||
|
||||
<string name="settings_initial_sync">Initial sync</string>
|
||||
<string name="settings_initial_sync_summary">Discard local data and reload from server</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -69,6 +69,7 @@ class VectorPreferences @Inject constructor(
|
|||
const val SETTINGS_EMAILS_AND_PHONE_NUMBERS_PREFERENCE_KEY = "SETTINGS_EMAILS_AND_PHONE_NUMBERS_PREFERENCE_KEY"
|
||||
|
||||
const val SETTINGS_CLEAR_CACHE_PREFERENCE_KEY = "SETTINGS_CLEAR_CACHE_PREFERENCE_KEY"
|
||||
const val SETTINGS_INIT_SYNC_PREFERENCE_KEY = "SETTINGS_INIT_SYNC_PREFERENCE_KEY"
|
||||
const val SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY = "SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY"
|
||||
const val SETTINGS_USER_SETTINGS_PREFERENCE_KEY = "SETTINGS_USER_SETTINGS_PREFERENCE_KEY"
|
||||
const val SETTINGS_CONTACT_PREFERENCE_KEYS = "SETTINGS_CONTACT_PREFERENCE_KEYS"
|
||||
|
|
|
@ -218,7 +218,11 @@ class VectorSettingsGeneralFragment :
|
|||
setContactsPreferences()
|
||||
|
||||
// clear cache
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CLEAR_CACHE_PREFERENCE_KEY)!!.let {
|
||||
listOf(
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CLEAR_CACHE_PREFERENCE_KEY),
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_INIT_SYNC_PREFERENCE_KEY)
|
||||
).forEach {
|
||||
it ?: return@forEach
|
||||
/*
|
||||
TODO
|
||||
MXSession.getApplicationSizeCaches(activity, object : SimpleApiCallback<Long>() {
|
||||
|
|
|
@ -27,6 +27,8 @@ import im.vector.app.core.utils.FirstThrottler
|
|||
import im.vector.app.core.utils.copyToClipboard
|
||||
import im.vector.app.core.utils.openAppSettingsPage
|
||||
import im.vector.app.core.utils.openUrlInChromeCustomTab
|
||||
import im.vector.app.features.MainActivity
|
||||
import im.vector.app.features.MainActivityArgs
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.version.VersionProvider
|
||||
import org.matrix.android.sdk.api.Matrix
|
||||
|
@ -97,6 +99,20 @@ class VectorSettingsHelpAboutFragment :
|
|||
// olm version
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_OLM_VERSION_PREFERENCE_KEY)!!
|
||||
.summary = session.cryptoService().getCryptoVersion(requireContext(), false)
|
||||
|
||||
// clear cache
|
||||
listOf(
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CLEAR_CACHE_PREFERENCE_KEY),
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_INIT_SYNC_PREFERENCE_KEY)
|
||||
).forEach {
|
||||
it ?: return@forEach
|
||||
it.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
displayLoadingView()
|
||||
MainActivity.restartApp(requireActivity(), MainActivityArgs(clearCache = true))
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -97,6 +97,11 @@
|
|||
android:key="SETTINGS_CLEAR_CACHE_PREFERENCE_KEY"
|
||||
android:title="@string/settings_clear_cache" />
|
||||
|
||||
<im.vector.app.core.preference.VectorPreference
|
||||
android:key="SETTINGS_INIT_SYNC_PREFERENCE_KEY"
|
||||
android:title="@string/settings_initial_sync"
|
||||
android:summary="@string/settings_initial_sync_summary"/>
|
||||
|
||||
</im.vector.app.core.preference.VectorPreferenceCategory>
|
||||
|
||||
<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/action_sign_out">
|
||||
|
|
|
@ -39,4 +39,13 @@
|
|||
|
||||
</im.vector.app.core.preference.VectorPreferenceCategory>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
||||
<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/settings_advanced">
|
||||
|
||||
<im.vector.app.core.preference.VectorPreference
|
||||
android:key="SETTINGS_INIT_SYNC_PREFERENCE_KEY"
|
||||
android:title="@string/settings_initial_sync"
|
||||
android:summary="@string/settings_initial_sync_summary"/>
|
||||
|
||||
</im.vector.app.core.preference.VectorPreferenceCategory>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
|
Loading…
Add table
Reference in a new issue