Settings: rename "developer mode" to "advanced settings"

This commit is contained in:
Benoit Marty 2020-01-06 10:32:36 +01:00
parent 1bd85082c3
commit a00f51a264
6 changed files with 40 additions and 41 deletions

View file

@ -86,7 +86,7 @@ class RageShake @Inject constructor(private val activity: AppCompatActivity,
}
private fun openSettings() {
navigator.openSettings(activity, VectorSettingsActivity.EXTRA_DIRECT_ACCESS_DEVELOPER)
navigator.openSettings(activity, VectorSettingsActivity.EXTRA_DIRECT_ACCESS_ADVANCED_SETTINGS)
}
companion object {

View file

@ -55,8 +55,8 @@ class VectorSettingsActivity : VectorBaseActivity(),
if (isFirstCreation()) {
// display the fragment
when (intent.getIntExtra(EXTRA_DIRECT_ACCESS, EXTRA_DIRECT_ACCESS_ROOT)) {
EXTRA_DIRECT_ACCESS_DEVELOPER ->
replaceFragment(R.id.vector_settings_page, VectorSettingsDeveloperModeFragment::class.java, null, FRAGMENT_TAG)
EXTRA_DIRECT_ACCESS_ADVANCED_SETTINGS ->
replaceFragment(R.id.vector_settings_page, VectorSettingsAdvancedSettingsFragment::class.java, null, FRAGMENT_TAG)
else ->
replaceFragment(R.id.vector_settings_page, VectorSettingsRootFragment::class.java, null, FRAGMENT_TAG)
}
@ -122,7 +122,7 @@ class VectorSettingsActivity : VectorBaseActivity(),
private const val EXTRA_DIRECT_ACCESS = "EXTRA_DIRECT_ACCESS"
const val EXTRA_DIRECT_ACCESS_ROOT = 0
const val EXTRA_DIRECT_ACCESS_DEVELOPER = 1
const val EXTRA_DIRECT_ACCESS_ADVANCED_SETTINGS = 1
private const val FRAGMENT_TAG = "VectorSettingsPreferencesFragment"
}

View file

@ -23,10 +23,10 @@ import im.vector.riotx.core.platform.VectorBaseActivity
import im.vector.riotx.core.preference.VectorSwitchPreference
import im.vector.riotx.features.rageshake.RageShake
class VectorSettingsDeveloperModeFragment : VectorSettingsBaseFragment() {
class VectorSettingsAdvancedSettingsFragment : VectorSettingsBaseFragment() {
override var titleRes = R.string.settings_developer_mode
override val preferenceXmlRes = R.xml.vector_settings_developer_mode
override var titleRes = R.string.settings_advanced_settings
override val preferenceXmlRes = R.xml.vector_settings_advanced_settings
private var rageshake: RageShake? = null

View file

@ -7,6 +7,7 @@
<string name="settings_show_devices_list">See all my devices</string>
<string name="settings_advanced_settings">Advanced settings</string>
<string name="settings_developer_mode">Developer mode</string>
<string name="settings_developer_mode_summary">The developer mode activates hidden features and may also make the application less stable. For developers only!</string>
<string name="settings_rageshake">Rageshake</string>

View file

@ -2,25 +2,6 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<im.vector.riotx.core.preference.VectorPreferenceCategory
android:key="SETTINGS_RAGE_SHAKE_CATEGORY_KEY"
android:title="@string/settings_rageshake">
<im.vector.riotx.core.preference.VectorSwitchPreference
android:key="SETTINGS_USE_RAGE_SHAKE_KEY"
android:title="@string/send_bug_report_rage_shake" />
<androidx.preference.SeekBarPreference
android:defaultValue="13"
android:dependency="SETTINGS_USE_RAGE_SHAKE_KEY"
android:key="SETTINGS_RAGE_SHAKE_DETECTION_THRESHOLD_KEY"
android:max="15"
android:summary="@string/settings_rageshake_detection_threshold_summary"
android:title="@string/settings_rageshake_detection_threshold"
app:min="11" />
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_developer_mode">
<im.vector.riotx.core.preference.VectorSwitchPreference
@ -44,9 +25,28 @@
<!-- TODO Display unsupported events -->
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory
android:dependency="SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY"
android:title="@string/settings_notifications">
android:key="SETTINGS_RAGE_SHAKE_CATEGORY_KEY"
android:title="@string/settings_rageshake">
<im.vector.riotx.core.preference.VectorSwitchPreference
android:key="SETTINGS_USE_RAGE_SHAKE_KEY"
android:title="@string/send_bug_report_rage_shake" />
<androidx.preference.SeekBarPreference
android:defaultValue="13"
android:dependency="SETTINGS_USE_RAGE_SHAKE_KEY"
android:key="SETTINGS_RAGE_SHAKE_DETECTION_THRESHOLD_KEY"
android:max="15"
android:summary="@string/settings_rageshake_detection_threshold_summary"
android:title="@string/settings_rageshake_detection_threshold"
app:min="11" />
</im.vector.riotx.core.preference.VectorPreferenceCategory>
<im.vector.riotx.core.preference.VectorPreferenceCategory android:title="@string/settings_notifications">
<im.vector.riotx.core.preference.VectorPreference
android:persistent="false"
@ -60,6 +60,4 @@
</im.vector.riotx.core.preference.VectorPreferenceCategory>
</im.vector.riotx.core.preference.VectorPreferenceCategory>
</androidx.preference.PreferenceScreen>

View file

@ -47,8 +47,8 @@
<im.vector.riotx.core.preference.VectorPreference
android:icon="@drawable/ic_settings_root_general"
android:title="@string/settings_developer_mode"
app:fragment="im.vector.riotx.features.settings.VectorSettingsDeveloperModeFragment" />
android:title="@string/settings_advanced_settings"
app:fragment="im.vector.riotx.features.settings.VectorSettingsAdvancedSettingsFragment" />
<im.vector.riotx.core.preference.VectorPreference
android:icon="@drawable/ic_settings_root_help_about"