mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 06:52:57 +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) {
|
||||
final boolean themeUpdated = updateKeyboardThemeAndContextThemeWrapper(
|
||||
displayContext, KeyboardTheme.getKeyboardTheme(displayContext /* context */));
|
||||
if (themeUpdated && mKeyboardView != null) {
|
||||
displayContext, KeyboardTheme.getKeyboardTheme(displayContext));
|
||||
if (themeUpdated) {
|
||||
Settings settings = Settings.getInstance();
|
||||
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 boolean nightModeChanged = (mCurrentUiMode & 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
|
||||
|| !mThemeContext.getResources().equals(context.getResources())
|
||||
|| Settings.getInstance().getCurrent().mColors.haveColorsChanged(context)) {
|
||||
|
|
|
@ -815,7 +815,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
@Override
|
||||
public void onInitializeInterface() {
|
||||
mDisplayContext = getDisplayContext();
|
||||
Log.d(TAG, "onInitializeInterface -> possibly configuration changed");
|
||||
Log.d(TAG, "onInitializeInterface");
|
||||
mKeyboardSwitcher.updateKeyboardTheme(mDisplayContext);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue