mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-21 06:39:09 +00:00
fix some bugs resulting in bad colors after entering ColorsScreen
This commit is contained in:
parent
72ca12d52e
commit
fad6c7b758
3 changed files with 16 additions and 17 deletions
|
@ -655,6 +655,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
prefs.unregisterOnSharedPreferenceChangeListener(mSuggestionStripView);
|
prefs.unregisterOnSharedPreferenceChangeListener(mSuggestionStripView);
|
||||||
if (mClipboardHistoryView != null)
|
if (mClipboardHistoryView != null)
|
||||||
prefs.unregisterOnSharedPreferenceChangeListener(mClipboardHistoryView);
|
prefs.unregisterOnSharedPreferenceChangeListener(mClipboardHistoryView);
|
||||||
|
if (mThemeNeedsReload) // necessary in some cases (e.g. theme switch) when mThemeNeedsReload is set before first keyboard load
|
||||||
|
Settings.getInstance().loadSettings(displayContext, Settings.getValues().mLocale, Settings.getValues().mInputAttributes);
|
||||||
|
|
||||||
updateKeyboardThemeAndContextThemeWrapper(displayContext, KeyboardTheme.getKeyboardTheme(displayContext));
|
updateKeyboardThemeAndContextThemeWrapper(displayContext, KeyboardTheme.getKeyboardTheme(displayContext));
|
||||||
mCurrentInputView = (InputView)LayoutInflater.from(mThemeContext).inflate(R.layout.input_view, null);
|
mCurrentInputView = (InputView)LayoutInflater.from(mThemeContext).inflate(R.layout.input_view, null);
|
||||||
|
|
|
@ -342,16 +342,16 @@ private constructor(val themeId: Int, @JvmField val mStyleId: Int) {
|
||||||
DefaultColors(
|
DefaultColors(
|
||||||
themeStyle,
|
themeStyle,
|
||||||
hasBorders,
|
hasBorders,
|
||||||
determineUserColor(colors, context, COLOR_ACCENT, false),
|
determineUserColor(colors, context, COLOR_ACCENT, isNight),
|
||||||
determineUserColor(colors, context, COLOR_BACKGROUND, false),
|
determineUserColor(colors, context, COLOR_BACKGROUND, isNight),
|
||||||
determineUserColor(colors, context, COLOR_KEYS, false),
|
determineUserColor(colors, context, COLOR_KEYS, isNight),
|
||||||
determineUserColor(colors, context, COLOR_FUNCTIONAL_KEYS, false),
|
determineUserColor(colors, context, COLOR_FUNCTIONAL_KEYS, isNight),
|
||||||
determineUserColor(colors, context, COLOR_SPACEBAR, false),
|
determineUserColor(colors, context, COLOR_SPACEBAR, isNight),
|
||||||
determineUserColor(colors, context, COLOR_TEXT, false),
|
determineUserColor(colors, context, COLOR_TEXT, isNight),
|
||||||
determineUserColor(colors, context, COLOR_HINT_TEXT, false),
|
determineUserColor(colors, context, COLOR_HINT_TEXT, isNight),
|
||||||
determineUserColor(colors, context, COLOR_SUGGESTION_TEXT, false),
|
determineUserColor(colors, context, COLOR_SUGGESTION_TEXT, isNight),
|
||||||
determineUserColor(colors, context, COLOR_SPACEBAR_TEXT, false),
|
determineUserColor(colors, context, COLOR_SPACEBAR_TEXT, isNight),
|
||||||
determineUserColor(colors, context, COLOR_GESTURE, false),
|
determineUserColor(colors, context, COLOR_GESTURE, isNight),
|
||||||
backgroundImage,
|
backgroundImage,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,11 +156,8 @@ class SettingsActivity : ComponentActivity(), SharedPreferences.OnSharedPreferen
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
|
setForceTheme(null, null)
|
||||||
paused = true
|
paused = true
|
||||||
if (forceNight != null || forceTheme != null)
|
|
||||||
KeyboardSwitcher.getInstance().setThemeNeedsReload()
|
|
||||||
forceNight = false
|
|
||||||
forceTheme = null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@ -170,11 +167,11 @@ class SettingsActivity : ComponentActivity(), SharedPreferences.OnSharedPreferen
|
||||||
|
|
||||||
fun setForceTheme(theme: String?, night: Boolean?) {
|
fun setForceTheme(theme: String?, night: Boolean?) {
|
||||||
if (paused) return
|
if (paused) return
|
||||||
if (forceTheme != theme || forceNight != night) {
|
if (forceTheme == theme && forceNight == night)
|
||||||
KeyboardSwitcher.getInstance().setThemeNeedsReload()
|
return
|
||||||
}
|
|
||||||
forceTheme = theme
|
forceTheme = theme
|
||||||
forceNight = night
|
forceNight = night
|
||||||
|
KeyboardSwitcher.getInstance().setThemeNeedsReload()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findCrashReports(): List<File> {
|
private fun findCrashReports(): List<File> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue