Remove unused auto correction led for spacebar feature
Change-Id: Ie1544bd0d28684d9b7887fddff37b224ed4f8201main
parent
c007e8863c
commit
2ddaf9543d
Binary file not shown.
Before Width: | Height: | Size: 322 B |
Binary file not shown.
Before Width: | Height: | Size: 201 B |
Binary file not shown.
Before Width: | Height: | Size: 381 B |
|
@ -72,8 +72,6 @@
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<declare-styleable name="MainKeyboardView">
|
<declare-styleable name="MainKeyboardView">
|
||||||
<attr name="autoCorrectionSpacebarLedEnabled" format="boolean" />
|
|
||||||
<attr name="autoCorrectionSpacebarLedIcon" format="reference" />
|
|
||||||
<!-- Size of the text for spacebar language label, in the proportion of key height. -->
|
<!-- Size of the text for spacebar language label, in the proportion of key height. -->
|
||||||
<attr name="languageOnSpacebarTextRatio" format="fraction" />
|
<attr name="languageOnSpacebarTextRatio" format="fraction" />
|
||||||
<attr name="languageOnSpacebarTextColor" format="color" />
|
<attr name="languageOnSpacebarTextColor" format="color" />
|
||||||
|
|
|
@ -71,8 +71,6 @@
|
||||||
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item>
|
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item>
|
||||||
<item name="gestureTrailColor">@color/highlight_color_ics</item>
|
<item name="gestureTrailColor">@color/highlight_color_ics</item>
|
||||||
<item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_ics</item>
|
<item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_ics</item>
|
||||||
<item name="autoCorrectionSpacebarLedEnabled">false</item>
|
|
||||||
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item>
|
|
||||||
<item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item>
|
<item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item>
|
||||||
<item name="languageOnSpacebarTextShadowRadius">1.0</item>
|
<item name="languageOnSpacebarTextShadowRadius">1.0</item>
|
||||||
<item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
|
<item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
|
||||||
|
|
|
@ -71,8 +71,6 @@
|
||||||
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item>
|
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item>
|
||||||
<item name="gestureTrailColor">@color/highlight_color_klp</item>
|
<item name="gestureTrailColor">@color/highlight_color_klp</item>
|
||||||
<item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_klp</item>
|
<item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_klp</item>
|
||||||
<item name="autoCorrectionSpacebarLedEnabled">false</item>
|
|
||||||
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item>
|
|
||||||
<item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item>
|
<item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item>
|
||||||
<item name="languageOnSpacebarTextShadowRadius">1.0</item>
|
<item name="languageOnSpacebarTextShadowRadius">1.0</item>
|
||||||
<item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
|
<item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item>
|
||||||
|
|
|
@ -71,8 +71,6 @@
|
||||||
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item>
|
<item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item>
|
||||||
<item name="gestureTrailColor">@color/highlight_color_lxx</item>
|
<item name="gestureTrailColor">@color/highlight_color_lxx</item>
|
||||||
<item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_lxx</item>
|
<item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_lxx</item>
|
||||||
<item name="autoCorrectionSpacebarLedEnabled">false</item>
|
|
||||||
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item>
|
|
||||||
<item name="languageOnSpacebarTextColor">@color/key_text_inactive_color_lxx</item>
|
<item name="languageOnSpacebarTextColor">@color/key_text_inactive_color_lxx</item>
|
||||||
<!-- A negative value to disable text shadow layer. -->
|
<!-- A negative value to disable text shadow layer. -->
|
||||||
<item name="languageOnSpacebarTextShadowRadius">-1.0</item>
|
<item name="languageOnSpacebarTextShadowRadius">-1.0</item>
|
||||||
|
|
|
@ -61,10 +61,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
private final KeyboardTextsSet mKeyboardTextsSet = new KeyboardTextsSet();
|
private final KeyboardTextsSet mKeyboardTextsSet = new KeyboardTextsSet();
|
||||||
private SettingsValues mCurrentSettingsValues;
|
private SettingsValues mCurrentSettingsValues;
|
||||||
|
|
||||||
/** mIsAutoCorrectionActive indicates that auto corrected word will be input instead of
|
|
||||||
* what user actually typed. */
|
|
||||||
private boolean mIsAutoCorrectionActive;
|
|
||||||
|
|
||||||
private KeyboardTheme mKeyboardTheme;
|
private KeyboardTheme mKeyboardTheme;
|
||||||
private Context mThemeContext;
|
private Context mThemeContext;
|
||||||
|
|
||||||
|
@ -142,12 +138,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFinishInputView() {
|
|
||||||
mIsAutoCorrectionActive = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onHideWindow() {
|
public void onHideWindow() {
|
||||||
mIsAutoCorrectionActive = false;
|
|
||||||
if (mKeyboardView != null) {
|
if (mKeyboardView != null) {
|
||||||
mKeyboardView.onHideWindow();
|
mKeyboardView.onHideWindow();
|
||||||
}
|
}
|
||||||
|
@ -168,7 +159,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
mCurrentSettingsValues.mKeyPreviewShowUpDuration,
|
mCurrentSettingsValues.mKeyPreviewShowUpDuration,
|
||||||
mCurrentSettingsValues.mKeyPreviewDismissEndScale,
|
mCurrentSettingsValues.mKeyPreviewDismissEndScale,
|
||||||
mCurrentSettingsValues.mKeyPreviewDismissDuration);
|
mCurrentSettingsValues.mKeyPreviewDismissDuration);
|
||||||
keyboardView.updateAutoCorrectionState(mIsAutoCorrectionActive);
|
|
||||||
keyboardView.updateShortcutKey(mSubtypeSwitcher.isShortcutImeReady());
|
keyboardView.updateShortcutKey(mSubtypeSwitcher.isShortcutImeReady());
|
||||||
final boolean subtypeChanged = (oldKeyboard == null)
|
final boolean subtypeChanged = (oldKeyboard == null)
|
||||||
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
|
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
|
||||||
|
@ -367,15 +357,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAutoCorrectionStateChanged(final boolean isAutoCorrection) {
|
|
||||||
if (mIsAutoCorrectionActive != isAutoCorrection) {
|
|
||||||
mIsAutoCorrectionActive = isAutoCorrection;
|
|
||||||
if (mKeyboardView != null) {
|
|
||||||
mKeyboardView.updateAutoCorrectionState(isAutoCorrection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getKeyboardShiftMode() {
|
public int getKeyboardShiftMode() {
|
||||||
final Keyboard keyboard = getKeyboard();
|
final Keyboard keyboard = getKeyboard();
|
||||||
if (keyboard == null) {
|
if (keyboard == null) {
|
||||||
|
|
|
@ -70,8 +70,6 @@ import java.util.WeakHashMap;
|
||||||
/**
|
/**
|
||||||
* A view that is responsible for detecting key presses and touch movements.
|
* A view that is responsible for detecting key presses and touch movements.
|
||||||
*
|
*
|
||||||
* @attr ref R.styleable#MainKeyboardView_autoCorrectionSpacebarLedEnabled
|
|
||||||
* @attr ref R.styleable#MainKeyboardView_autoCorrectionSpacebarLedIcon
|
|
||||||
* @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextRatio
|
* @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextRatio
|
||||||
* @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextColor
|
* @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextColor
|
||||||
* @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextShadowRadius
|
* @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextShadowRadius
|
||||||
|
@ -133,11 +131,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
private static final float LANGUAGE_ON_SPACEBAR_TEXT_SHADOW_RADIUS_DISABLED = -1.0f;
|
private static final float LANGUAGE_ON_SPACEBAR_TEXT_SHADOW_RADIUS_DISABLED = -1.0f;
|
||||||
// The minimum x-scale to fit the language name on spacebar.
|
// The minimum x-scale to fit the language name on spacebar.
|
||||||
private static final float MINIMUM_XSCALE_OF_LANGUAGE_NAME = 0.8f;
|
private static final float MINIMUM_XSCALE_OF_LANGUAGE_NAME = 0.8f;
|
||||||
// Stuff to draw auto correction LED on spacebar.
|
|
||||||
private boolean mAutoCorrectionSpacebarLedOn;
|
|
||||||
private final boolean mAutoCorrectionSpacebarLedEnabled;
|
|
||||||
private final Drawable mAutoCorrectionSpacebarLedIcon;
|
|
||||||
private static final int SPACE_LED_LENGTH_PERCENT = 80;
|
|
||||||
|
|
||||||
// Stuff to draw altCodeWhileTyping keys.
|
// Stuff to draw altCodeWhileTyping keys.
|
||||||
private final ObjectAnimator mAltCodeKeyWhileTypingFadeoutAnimator;
|
private final ObjectAnimator mAltCodeKeyWhileTypingFadeoutAnimator;
|
||||||
|
@ -221,10 +214,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
R.styleable.MainKeyboardView_backgroundDimAlpha, 0);
|
R.styleable.MainKeyboardView_backgroundDimAlpha, 0);
|
||||||
mBackgroundDimAlphaPaint.setColor(Color.BLACK);
|
mBackgroundDimAlphaPaint.setColor(Color.BLACK);
|
||||||
mBackgroundDimAlphaPaint.setAlpha(backgroundDimAlpha);
|
mBackgroundDimAlphaPaint.setAlpha(backgroundDimAlpha);
|
||||||
mAutoCorrectionSpacebarLedEnabled = mainKeyboardViewAttr.getBoolean(
|
|
||||||
R.styleable.MainKeyboardView_autoCorrectionSpacebarLedEnabled, false);
|
|
||||||
mAutoCorrectionSpacebarLedIcon = mainKeyboardViewAttr.getDrawable(
|
|
||||||
R.styleable.MainKeyboardView_autoCorrectionSpacebarLedIcon);
|
|
||||||
mLanguageOnSpacebarTextRatio = mainKeyboardViewAttr.getFraction(
|
mLanguageOnSpacebarTextRatio = mainKeyboardViewAttr.getFraction(
|
||||||
R.styleable.MainKeyboardView_languageOnSpacebarTextRatio, 1, 1, 1.0f);
|
R.styleable.MainKeyboardView_languageOnSpacebarTextRatio, 1, 1, 1.0f);
|
||||||
mLanguageOnSpacebarTextColor = mainKeyboardViewAttr.getColor(
|
mLanguageOnSpacebarTextColor = mainKeyboardViewAttr.getColor(
|
||||||
|
@ -834,14 +823,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
invalidateKey(mSpaceKey);
|
invalidateKey(mSpaceKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAutoCorrectionState(final boolean isAutoCorrection) {
|
|
||||||
if (!mAutoCorrectionSpacebarLedEnabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mAutoCorrectionSpacebarLedOn = isAutoCorrection;
|
|
||||||
invalidateKey(mSpaceKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dimEntireKeyboard(final boolean dimmed) {
|
private void dimEntireKeyboard(final boolean dimmed) {
|
||||||
final boolean needsRedrawing = mNeedsToDimEntireKeyboard != dimmed;
|
final boolean needsRedrawing = mNeedsToDimEntireKeyboard != dimmed;
|
||||||
mNeedsToDimEntireKeyboard = dimmed;
|
mNeedsToDimEntireKeyboard = dimmed;
|
||||||
|
@ -946,13 +927,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the spacebar icon at the bottom
|
// Draw the spacebar icon at the bottom
|
||||||
if (mAutoCorrectionSpacebarLedOn) {
|
if (mSpacebarIcon != null) {
|
||||||
final int iconWidth = width * SPACE_LED_LENGTH_PERCENT / 100;
|
|
||||||
final int iconHeight = mAutoCorrectionSpacebarLedIcon.getIntrinsicHeight();
|
|
||||||
int x = (width - iconWidth) / 2;
|
|
||||||
int y = height - iconHeight;
|
|
||||||
drawIcon(canvas, mAutoCorrectionSpacebarLedIcon, x, y, iconWidth, iconHeight);
|
|
||||||
} else if (mSpacebarIcon != null) {
|
|
||||||
final int iconWidth = mSpacebarIcon.getIntrinsicWidth();
|
final int iconWidth = mSpacebarIcon.getIntrinsicWidth();
|
||||||
final int iconHeight = mSpacebarIcon.getIntrinsicHeight();
|
final int iconHeight = mSpacebarIcon.getIntrinsicHeight();
|
||||||
int x = (width - iconWidth) / 2;
|
int x = (width - iconWidth) / 2;
|
||||||
|
|
|
@ -905,7 +905,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
private void onFinishInputViewInternal(final boolean finishingInput) {
|
private void onFinishInputViewInternal(final boolean finishingInput) {
|
||||||
super.onFinishInputView(finishingInput);
|
super.onFinishInputView(finishingInput);
|
||||||
mKeyboardSwitcher.onFinishInputView();
|
|
||||||
mKeyboardSwitcher.deallocateMemory();
|
mKeyboardSwitcher.deallocateMemory();
|
||||||
// Remove pending messages related to update suggestions
|
// Remove pending messages related to update suggestions
|
||||||
mHandler.cancelUpdateSuggestionStrip();
|
mHandler.cancelUpdateSuggestionStrip();
|
||||||
|
@ -1388,7 +1387,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
if (!hasSuggestionStripView()) {
|
if (!hasSuggestionStripView()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mKeyboardSwitcher.onAutoCorrectionStateChanged(suggestedWords.mWillAutoCorrect);
|
|
||||||
if (!onEvaluateInputViewShown()) {
|
if (!onEvaluateInputViewShown()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue