|
|
@ -38,7 +38,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), |
|
|
|
preferenceScreen.removePreference(it) |
|
|
|
preferenceScreen.removePreference(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
upPreferenceSummary("barElevation", AppConfig.elevation.toString()) |
|
|
|
upPreferenceSummary(PreferKey.barElevation, AppConfig.elevation.toString()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
@ -133,7 +133,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), |
|
|
|
override fun onPreferenceTreeClick(preference: Preference?): Boolean { |
|
|
|
override fun onPreferenceTreeClick(preference: Preference?): Boolean { |
|
|
|
when (preference?.key) { |
|
|
|
when (preference?.key) { |
|
|
|
"defaultTheme" -> changeTheme() |
|
|
|
"defaultTheme" -> changeTheme() |
|
|
|
"barElevation" -> NumberPickerDialog(requireContext()) |
|
|
|
PreferKey.barElevation -> NumberPickerDialog(requireContext()) |
|
|
|
.setTitle(getString(R.string.bar_elevation)) |
|
|
|
.setTitle(getString(R.string.bar_elevation)) |
|
|
|
.setMaxValue(32) |
|
|
|
.setMaxValue(32) |
|
|
|
.setMinValue(0) |
|
|
|
.setMinValue(0) |
|
|
@ -231,7 +231,8 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), |
|
|
|
private fun upPreferenceSummary(preferenceKey: String, value: String?) { |
|
|
|
private fun upPreferenceSummary(preferenceKey: String, value: String?) { |
|
|
|
val preference = findPreference<Preference>(preferenceKey) ?: return |
|
|
|
val preference = findPreference<Preference>(preferenceKey) ?: return |
|
|
|
when (preferenceKey) { |
|
|
|
when (preferenceKey) { |
|
|
|
"barElevation" -> preference.summary = getString(R.string.bar_elevation_s, value) |
|
|
|
PreferKey.barElevation -> preference.summary = |
|
|
|
|
|
|
|
getString(R.string.bar_elevation_s, value) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |