From 29ff343f77365e8a11a9b26a0e16a9dc5b7d72d7 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Mon, 25 Oct 2010 18:34:19 +0900 Subject: Remove LatinKeyboardBaseView.isShifted() and setShifted() for refactoring Change-Id: I9a1106b679a9ffb3ae959d90377eef096e5af842 --- .../inputmethod/latin/LatinKeyboardBaseView.java | 35 ++++------------------ 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java') diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index 2bf70bf82..b2635ad9c 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -638,34 +638,6 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx return mHasDistinctMultitouch; } - /** - * Sets the state of the shift key of the keyboard, if any. - * @param shifted whether or not to enable the state of the shift key - * @return true if the shift key state changed, false if there was no change - */ - public boolean setShifted(boolean shifted) { - if (mKeyboard != null) { - if (mKeyboard.setShifted(shifted)) { - // The whole keyboard probably needs to be redrawn - invalidateAllKeys(); - return true; - } - } - return false; - } - - /** - * Returns the state of the shift key of the keyboard, if any. - * @return true if the shift is in a pressed state, false otherwise. If there is - * no shift key on the keyboard or there is no keyboard attached, it returns false. - */ - public boolean isShifted() { - if (mKeyboard != null) { - return mKeyboard.isShifted(); - } - return false; - } - /** * Enables or disables the key feedback popup. This is a popup that shows a magnified * version of the depressed key. By default the preview is enabled. @@ -1247,7 +1219,12 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx mMiniKeyboardOriginX = adjustedX + container.getPaddingLeft() - mWindowOffset[0]; mMiniKeyboardOriginY = y + container.getPaddingTop() - mWindowOffset[1]; mMiniKeyboard.setPopupOffset(adjustedX, y); - mMiniKeyboard.setShifted(isShifted()); + // TODO: change the below line to use getLatinKeyboard() instead of getKeyboard() + BaseKeyboard baseMiniKeyboard = mMiniKeyboard.getKeyboard(); + if (baseMiniKeyboard != null && baseMiniKeyboard.setShifted(mKeyboard == null + ? false : mKeyboard.isShifted())) { + mMiniKeyboard.invalidateAllKeys(); + } // Mini keyboard needs no pop-up key preview displayed. mMiniKeyboard.setPreviewEnabled(false); mMiniKeyboardPopup.setContentView(container); -- cgit v1.2.3-83-g751a