This commit is contained in:
Helium314 2023-12-31 09:40:31 +01:00
parent 296f37c829
commit 30201f91ba
2 changed files with 6 additions and 4 deletions

View file

@ -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)) {

View file

@ -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);
}