am 25402fd5: am 724db044: Deallocate gesture trail bitmap when unneeded further

* commit '25402fd5309891884a843528d47f6b4646341a3f':
  Deallocate gesture trail bitmap when unneeded further
main
Ken Wakasa 2013-08-09 15:53:29 -07:00 committed by Android Git Automerger
commit 4a2f6a2216
3 changed files with 14 additions and 10 deletions

View File

@ -838,10 +838,10 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
mSlidingKeyInputPreview.dismissSlidingKeyInputPreview();
}
public void setGesturePreviewMode(final boolean drawsGestureTrail,
final boolean drawsGestureFloatingPreviewText) {
mGestureFloatingPreviewText.setPreviewEnabled(drawsGestureFloatingPreviewText);
mGestureTrailsPreview.setPreviewEnabled(drawsGestureTrail);
private void setGesturePreviewMode(final boolean isGestureTrailEnabled,
final boolean isGestureFloatingPreviewTextEnabled) {
mGestureFloatingPreviewText.setPreviewEnabled(isGestureFloatingPreviewTextEnabled);
mGestureTrailsPreview.setPreviewEnabled(isGestureTrailEnabled);
}
public void showGestureFloatingPreviewText(final SuggestedWords suggestedWords) {
@ -869,8 +869,12 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
PointerTracker.setMainDictionaryAvailability(mainDictionaryAvailable);
}
public void setGestureHandlingEnabledByUser(final boolean gestureHandlingEnabledByUser) {
PointerTracker.setGestureHandlingEnabledByUser(gestureHandlingEnabledByUser);
public void setGestureHandlingEnabledByUser(final boolean isGestureHandlingEnabledByUser,
final boolean isGestureTrailEnabled,
final boolean isGestureFloatingPreviewTextEnabled) {
PointerTracker.setGestureHandlingEnabledByUser(isGestureHandlingEnabledByUser);
setGesturePreviewMode(isGestureHandlingEnabledByUser && isGestureTrailEnabled,
isGestureHandlingEnabledByUser && isGestureFloatingPreviewTextEnabled);
}
@Override

View File

@ -852,8 +852,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mainKeyboardView.setSlidingKeyInputPreviewEnabled(
currentSettingsValues.mSlidingKeyInputPreviewEnabled);
mainKeyboardView.setGestureHandlingEnabledByUser(
currentSettingsValues.mGestureInputEnabled);
mainKeyboardView.setGesturePreviewMode(currentSettingsValues.mGesturePreviewTrailEnabled,
currentSettingsValues.mGestureInputEnabled,
currentSettingsValues.mGestureTrailEnabled,
currentSettingsValues.mGestureFloatingPreviewTextEnabled);
// If we have a user dictionary addition in progress, we should check now if we should

View File

@ -71,7 +71,7 @@ public final class SettingsValues {
// Use bigrams to predict the next word when there is no input for it yet
public final boolean mBigramPredictionEnabled;
public final boolean mGestureInputEnabled;
public final boolean mGesturePreviewTrailEnabled;
public final boolean mGestureTrailEnabled;
public final boolean mGestureFloatingPreviewTextEnabled;
public final boolean mSlidingKeyInputPreviewEnabled;
public final int mKeyLongpressTimeout;
@ -157,7 +157,7 @@ public final class SettingsValues {
mVoiceKeyEnabled = mVoiceMode != null && !mVoiceMode.equals(voiceModeOff);
mVoiceKeyOnMain = mVoiceMode != null && mVoiceMode.equals(voiceModeMain);
mGestureInputEnabled = Settings.readGestureInputEnabled(prefs, res);
mGesturePreviewTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true);
mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true);
mGestureFloatingPreviewTextEnabled = prefs.getBoolean(
Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
mCorrectionEnabled = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect;