mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 15:02:48 +00:00
fix #298
This commit is contained in:
parent
296f37c829
commit
30201f91ba
2 changed files with 6 additions and 4 deletions
|
@ -86,11 +86,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
|
|
||||||
public void updateKeyboardTheme(@NonNull Context displayContext) {
|
public void updateKeyboardTheme(@NonNull Context displayContext) {
|
||||||
final boolean themeUpdated = updateKeyboardThemeAndContextThemeWrapper(
|
final boolean themeUpdated = updateKeyboardThemeAndContextThemeWrapper(
|
||||||
displayContext, KeyboardTheme.getKeyboardTheme(displayContext /* context */));
|
displayContext, KeyboardTheme.getKeyboardTheme(displayContext));
|
||||||
if (themeUpdated && mKeyboardView != null) {
|
if (themeUpdated) {
|
||||||
Settings settings = Settings.getInstance();
|
Settings settings = Settings.getInstance();
|
||||||
settings.loadSettings(displayContext, settings.getCurrent().mLocale, settings.getCurrent().mInputAttributes);
|
settings.loadSettings(displayContext, settings.getCurrent().mLocale, settings.getCurrent().mInputAttributes);
|
||||||
mLatinIME.setInputView(onCreateInputView(displayContext, mIsHardwareAcceleratedDrawingEnabled));
|
if (mKeyboardView != null)
|
||||||
|
mLatinIME.setInputView(onCreateInputView(displayContext, mIsHardwareAcceleratedDrawingEnabled));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,6 +103,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
final KeyboardTheme keyboardTheme) {
|
final KeyboardTheme keyboardTheme) {
|
||||||
final boolean nightModeChanged = (mCurrentUiMode & Configuration.UI_MODE_NIGHT_MASK)
|
final boolean nightModeChanged = (mCurrentUiMode & Configuration.UI_MODE_NIGHT_MASK)
|
||||||
!= (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK);
|
!= (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK);
|
||||||
|
Log.d(TAG, "old ui mode "+ mCurrentUiMode+", new ui mode "+context.getResources().getConfiguration().uiMode);
|
||||||
if (mThemeContext == null || !keyboardTheme.equals(mKeyboardTheme) || nightModeChanged
|
if (mThemeContext == null || !keyboardTheme.equals(mKeyboardTheme) || nightModeChanged
|
||||||
|| !mThemeContext.getResources().equals(context.getResources())
|
|| !mThemeContext.getResources().equals(context.getResources())
|
||||||
|| Settings.getInstance().getCurrent().mColors.haveColorsChanged(context)) {
|
|| Settings.getInstance().getCurrent().mColors.haveColorsChanged(context)) {
|
||||||
|
|
|
@ -815,7 +815,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeInterface() {
|
public void onInitializeInterface() {
|
||||||
mDisplayContext = getDisplayContext();
|
mDisplayContext = getDisplayContext();
|
||||||
Log.d(TAG, "onInitializeInterface -> possibly configuration changed");
|
Log.d(TAG, "onInitializeInterface");
|
||||||
mKeyboardSwitcher.updateKeyboardTheme(mDisplayContext);
|
mKeyboardSwitcher.updateKeyboardTheme(mDisplayContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue