mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 14:02:49 +00:00
Fix AppearancePreferencesFragment title after locale changed
root cause: the `_prefTitle` is saved in `CharSequence` solution: we only able to store `CharSequence` since `Preference.getTitleRes` is removed in AndroidX. As a workaround, we update the title again on Fragment.onStart()
This commit is contained in:
parent
dee881bc05
commit
802d449bfb
1 changed files with 4 additions and 0 deletions
|
@ -10,6 +10,7 @@ import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
|
||||||
import com.beemdevelopment.aegis.R;
|
import com.beemdevelopment.aegis.R;
|
||||||
|
import com.beemdevelopment.aegis.ui.fragments.preferences.AppearancePreferencesFragment;
|
||||||
import com.beemdevelopment.aegis.ui.fragments.preferences.MainPreferencesFragment;
|
import com.beemdevelopment.aegis.ui.fragments.preferences.MainPreferencesFragment;
|
||||||
import com.beemdevelopment.aegis.ui.fragments.preferences.PreferencesFragment;
|
import com.beemdevelopment.aegis.ui.fragments.preferences.PreferencesFragment;
|
||||||
|
|
||||||
|
@ -128,6 +129,9 @@ public class PreferencesActivity extends AegisActivity implements
|
||||||
public void onFragmentStarted(@NonNull FragmentManager fm, @NonNull Fragment f) {
|
public void onFragmentStarted(@NonNull FragmentManager fm, @NonNull Fragment f) {
|
||||||
if (f instanceof MainPreferencesFragment) {
|
if (f instanceof MainPreferencesFragment) {
|
||||||
setTitle(R.string.action_settings);
|
setTitle(R.string.action_settings);
|
||||||
|
} else if (f instanceof AppearancePreferencesFragment) {
|
||||||
|
_prefTitle = getString(R.string.pref_section_appearance_title);
|
||||||
|
setTitle(_prefTitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue