Fix swipe trail disappearing on theme change

This commit is contained in:
Aleksandras Kostarevas 2024-04-22 00:45:46 -04:00
parent d62b733412
commit 43984a6a76
2 changed files with 18 additions and 10 deletions

View File

@ -95,6 +95,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
if (themeUpdated && mKeyboardView != null) {
((LatinIME)mLatinIMELegacy.getInputMethodService()).updateLegacyView(onCreateInputView(
displayContext, mIsHardwareAcceleratedDrawingEnabled));
mLatinIMELegacy.updateMainKeyboardViewSettings();
}
}

View File

@ -943,6 +943,22 @@ public class LatinIMELegacy implements KeyboardActionListener,
mHandler.postSwitchLanguage(newSubtype);
}
public void updateMainKeyboardViewSettings() {
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
SettingsValues currentSettingsValues = mSettings.getCurrent();
mainKeyboardView.setMainDictionaryAvailability(
mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary());
mainKeyboardView.setKeyPreviewPopupEnabled(currentSettingsValues.mKeyPreviewPopupOn,
currentSettingsValues.mKeyPreviewPopupDismissDelay);
mainKeyboardView.setSlidingKeyInputPreviewEnabled(
currentSettingsValues.mSlidingKeyInputPreviewEnabled);
mainKeyboardView.setGestureHandlingEnabledByUser(
currentSettingsValues.mGestureInputEnabled,
currentSettingsValues.mGestureTrailEnabled,
currentSettingsValues.mGestureFloatingPreviewTextEnabled);
}
@SuppressWarnings("deprecation")
void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restarting) {
mDictionaryFacilitator.onStartInput();
@ -1098,16 +1114,7 @@ public class LatinIMELegacy implements KeyboardActionListener,
mHandler.cancelUpdateSuggestionStrip();
mainKeyboardView.setMainDictionaryAvailability(
mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary());
mainKeyboardView.setKeyPreviewPopupEnabled(currentSettingsValues.mKeyPreviewPopupOn,
currentSettingsValues.mKeyPreviewPopupDismissDelay);
mainKeyboardView.setSlidingKeyInputPreviewEnabled(
currentSettingsValues.mSlidingKeyInputPreviewEnabled);
mainKeyboardView.setGestureHandlingEnabledByUser(
currentSettingsValues.mGestureInputEnabled,
currentSettingsValues.mGestureTrailEnabled,
currentSettingsValues.mGestureFloatingPreviewTextEnabled);
updateMainKeyboardViewSettings();
if (TRACE) Debug.startMethodTracing("/data/trace/latinime");
}