Rename LatinKeyboardView to MainKeyboardView

Change-Id: I8f3123b8d727c7beb72e226f80c17794f89c8b60
main
Tadashi G. Takaoka 2012-07-23 10:27:14 +09:00
parent a4f762ff98
commit c8e45ddb03
21 changed files with 135 additions and 138 deletions

View File

@ -32,7 +32,7 @@
*;
}
-keep class com.android.inputmethod.keyboard.LatinKeyboardView {
-keep class com.android.inputmethod.keyboard.MainKeyboardView {
# Keep getter/setter methods for ObjectAnimator
int getLanguageOnSpacebarAnimAlpha();
void setLanguageOnSpacebarAnimAlpha(int);

View File

@ -56,7 +56,7 @@
style="?attr/suggestionsStripBackgroundStyle" />
</LinearLayout>
<com.android.inputmethod.keyboard.LatinKeyboardView
<com.android.inputmethod.keyboard.MainKeyboardView
android:id="@+id/keyboard_view"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"

View File

@ -32,7 +32,7 @@
<string name="config_default_keyboard_theme_index" translatable="false">5</string>
<integer name="config_max_more_keys_column">5</integer>
<!--
Configuration for LatinKeyboardView
Configuration for MainKeyboardView
-->
<dimen name="config_key_hysteresis_distance">40.0dp</dimen>
<bool name="config_sliding_key_input_enabled">false</bool>

View File

@ -30,7 +30,7 @@
<string name="config_default_keyboard_theme_index" translatable="false">5</string>
<integer name="config_max_more_keys_column">5</integer>
<!--
Configuration for LatinKeyboardView
Configuration for MainKeyboardView
-->
<bool name="config_sliding_key_input_enabled">false</bool>
<!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if

View File

@ -18,13 +18,10 @@
<declare-styleable name="KeyboardTheme">
<!-- Keyboard style -->
<attr name="keyboardStyle" format="reference" />
<!-- TODO: Get rid of latinKeyboardStyle -->
<!-- LatinKeyboard style -->
<attr name="latinKeyboardStyle" format="reference" />
<!-- KeyboardView style -->
<attr name="keyboardViewStyle" format="reference" />
<!-- LatinKeyboardView style -->
<attr name="latinKeyboardViewStyle" format="reference" />
<!-- MainKeyboardView style -->
<attr name="mainKeyboardViewStyle" format="reference" />
<!-- MoreKeysKeyboard style -->
<attr name="moreKeysKeyboardStyle" format="reference" />
<!-- MoreKeysKeyboardView style -->
@ -123,7 +120,7 @@
</attr>
</declare-styleable>
<declare-styleable name="LatinKeyboardView">
<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. -->

View File

@ -48,7 +48,7 @@
-->
<integer name="config_key_preview_linger_timeout">70</integer>
<!--
Configuration for LatinKeyboardView
Configuration for MainKeyboardView
-->
<dimen name="config_key_hysteresis_distance">8.0dp</dimen>
<integer name="config_touch_noise_threshold_time">40</integer>

View File

@ -67,7 +67,7 @@
<item name="shadowColor">#BB000000</item>
<item name="shadowRadius">2.75</item>
<item name="backgroundDimAlpha">128</item>
<!-- Common attributes of LatinKeyboardView -->
<!-- Common attributes of MainKeyboardView -->
<item name="keyHysteresisDistance">@dimen/config_key_hysteresis_distance</item>
<item name="touchNoiseThresholdTime">@integer/config_touch_noise_threshold_time</item>
<item name="touchNoiseThresholdDistance">@dimen/config_touch_noise_threshold_distance</item>
@ -84,7 +84,7 @@
<item name="altCodeKeyWhileTypingFadeinAnimator">@anim/alt_code_key_while_typing_fadein</item>
</style>
<style
name="LatinKeyboardView"
name="MainKeyboardView"
parent="KeyboardView">
<item name="autoCorrectionSpacebarLedEnabled">true</item>
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
@ -155,7 +155,7 @@
<item name="keyBackground">@drawable/btn_keyboard_key3</item>
</style>
<style
name="LatinKeyboardView.HighContrast"
name="MainKeyboardView.HighContrast"
parent="KeyboardView.HighContrast"
>
<item name="autoCorrectionSpacebarLedEnabled">true</item>
@ -190,7 +190,7 @@
<item name="shadowColor">#FFFFFFFF</item>
</style>
<style
name="LatinKeyboardView.Stone"
name="MainKeyboardView.Stone"
parent="KeyboardView.Stone"
>
<item name="autoCorrectionSpacebarLedEnabled">true</item>
@ -230,7 +230,7 @@
<item name="keyTextStyle">bold</item>
</style>
<style
name="LatinKeyboardView.Stone.Bold"
name="MainKeyboardView.Stone.Bold"
parent="KeyboardView.Stone.Bold"
>
<item name="autoCorrectionSpacebarLedEnabled">true</item>
@ -259,7 +259,7 @@
<item name="keyTextStyle">bold</item>
</style>
<style
name="LatinKeyboardView.Gingerbread"
name="MainKeyboardView.Gingerbread"
parent="KeyboardView.Gingerbread"
>
<item name="autoCorrectionSpacebarLedEnabled">true</item>
@ -316,7 +316,7 @@
<item name="shadowRadius">0.0</item>
</style>
<style
name="LatinKeyboardView.IceCreamSandwich"
name="MainKeyboardView.IceCreamSandwich"
parent="KeyboardView.IceCreamSandwich"
>
<item name="autoCorrectionSpacebarLedEnabled">false</item>

View File

@ -18,7 +18,7 @@
<style name="KeyboardTheme.HighContrast" parent="KeyboardIcons">
<item name="keyboardStyle">@style/Keyboard.HighContrast</item>
<item name="keyboardViewStyle">@style/KeyboardView.HighContrast</item>
<item name="latinKeyboardViewStyle">@style/LatinKeyboardView.HighContrast</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.HighContrast</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView</item>
<item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item>

View File

@ -18,7 +18,7 @@
<style name="KeyboardTheme" parent="KeyboardIcons">
<item name="keyboardStyle">@style/Keyboard</item>
<item name="keyboardViewStyle">@style/KeyboardView</item>
<item name="latinKeyboardViewStyle">@style/LatinKeyboardView</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView</item>
<item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item>

View File

@ -18,7 +18,7 @@
<style name="KeyboardTheme.Gingerbread" parent="KeyboardIcons">
<item name="keyboardStyle">@style/Keyboard.Gingerbread</item>
<item name="keyboardViewStyle">@style/KeyboardView.Gingerbread</item>
<item name="latinKeyboardViewStyle">@style/LatinKeyboardView.Gingerbread</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.Gingerbread</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Gingerbread</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Gingerbread</item>
<item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item>

View File

@ -18,7 +18,7 @@
<style name="KeyboardTheme.IceCreamSandwich" parent="KeyboardIcons.IceCreamSandwich">
<item name="keyboardStyle">@style/Keyboard.IceCreamSandwich</item>
<item name="keyboardViewStyle">@style/KeyboardView.IceCreamSandwich</item>
<item name="latinKeyboardViewStyle">@style/LatinKeyboardView.IceCreamSandwich</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.IceCreamSandwich</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.IceCreamSandwich</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.IceCreamSandwich</item>
<item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle.IceCreamSandwich</item>

View File

@ -18,7 +18,7 @@
<style name="KeyboardTheme.Stone.Bold" parent="KeyboardIcons.Black">
<item name="keyboardStyle">@style/Keyboard.Stone.Bold</item>
<item name="keyboardViewStyle">@style/KeyboardView.Stone.Bold</item>
<item name="latinKeyboardViewStyle">@style/LatinKeyboardView.Stone.Bold</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.Stone.Bold</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Stone</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Stone</item>
<item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item>

View File

@ -18,7 +18,7 @@
<style name="KeyboardTheme.Stone" parent="KeyboardIcons.Black">
<item name="keyboardStyle">@style/Keyboard.Stone</item>
<item name="keyboardViewStyle">@style/KeyboardView.Stone</item>
<item name="latinKeyboardViewStyle">@style/LatinKeyboardView.Stone</item>
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.Stone</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Stone</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Stone</item>
<item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item>

View File

@ -29,7 +29,7 @@ import android.view.ViewConfiguration;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.LatinKeyboardView;
import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.keyboard.PointerTracker;
import com.android.inputmethod.latin.R;
@ -37,7 +37,7 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
private static final AccessibleKeyboardViewProxy sInstance = new AccessibleKeyboardViewProxy();
private InputMethodService mInputMethod;
private LatinKeyboardView mView;
private MainKeyboardView mView;
private AccessibilityEntityProvider mAccessibilityNodeProvider;
private Key mLastHoverKey = null;
@ -70,7 +70,7 @@ public class AccessibleKeyboardViewProxy extends AccessibilityDelegateCompat {
*
* @param view The view to wrap.
*/
public void setView(LatinKeyboardView view) {
public void setView(MainKeyboardView view) {
if (view == null) {
// Ignore null views.
return;

View File

@ -71,7 +71,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
private boolean mForceNonDistinctMultitouch;
private InputView mCurrentInputView;
private LatinKeyboardView mKeyboardView;
private MainKeyboardView mKeyboardView;
private LatinIME mLatinIME;
private Resources mResources;
private SettingsValues mCurrentSettingsValues;
@ -268,7 +268,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}.
@Override
public void startDoubleTapTimer() {
final LatinKeyboardView keyboardView = getKeyboardView();
final MainKeyboardView keyboardView = getKeyboardView();
if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy();
timer.startDoubleTapTimer();
@ -278,7 +278,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}.
@Override
public void cancelDoubleTapTimer() {
final LatinKeyboardView keyboardView = getKeyboardView();
final MainKeyboardView keyboardView = getKeyboardView();
if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy();
timer.cancelDoubleTapTimer();
@ -288,7 +288,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}.
@Override
public boolean isInDoubleTapTimeout() {
final LatinKeyboardView keyboardView = getKeyboardView();
final MainKeyboardView keyboardView = getKeyboardView();
return (keyboardView != null)
? keyboardView.getTimerProxy().isInDoubleTapTimeout() : false;
}
@ -296,7 +296,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}.
@Override
public void startLongPressTimer(int code) {
final LatinKeyboardView keyboardView = getKeyboardView();
final MainKeyboardView keyboardView = getKeyboardView();
if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy();
timer.startLongPressTimer(code);
@ -306,7 +306,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}.
@Override
public void cancelLongPressTimer() {
final LatinKeyboardView keyboardView = getKeyboardView();
final MainKeyboardView keyboardView = getKeyboardView();
if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy();
timer.cancelLongPressTimer();
@ -346,7 +346,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
mState.onCodeInput(code, isSinglePointer(), mLatinIME.getCurrentAutoCapsState());
}
public LatinKeyboardView getKeyboardView() {
public MainKeyboardView getKeyboardView() {
return mKeyboardView;
}
@ -372,7 +372,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
}
}
mKeyboardView = (LatinKeyboardView) mCurrentInputView.findViewById(R.id.keyboard_view);
mKeyboardView = (MainKeyboardView) mCurrentInputView.findViewById(R.id.keyboard_view);
mKeyboardView.setKeyboardActionListener(mLatinIME);
if (mForceNonDistinctMultitouch) {
mKeyboardView.setDistinctMultitouch(false);

View File

@ -65,9 +65,9 @@ import java.util.WeakHashMap;
* @attr ref R.styleable#KeyboardView_verticalCorrection
* @attr ref R.styleable#KeyboardView_popupLayout
*/
public class LatinKeyboardView extends KeyboardView implements PointerTracker.KeyEventHandler,
public class MainKeyboardView extends KeyboardView implements PointerTracker.KeyEventHandler,
SuddenJumpingTouchEventHandler.ProcessMotionEvent {
private static final String TAG = LatinKeyboardView.class.getSimpleName();
private static final String TAG = MainKeyboardView.class.getSimpleName();
// TODO: Kill process when the usability study mode was changed.
private static final boolean ENABLE_USABILITY_STUDY_LOG = LatinImeLogger.sUsabilityStudy;
@ -119,7 +119,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
private final KeyTimerHandler mKeyTimerHandler;
private static class KeyTimerHandler extends StaticInnerHandlerWrapper<LatinKeyboardView>
private static class KeyTimerHandler extends StaticInnerHandlerWrapper<MainKeyboardView>
implements TimerProxy {
private static final int MSG_REPEAT_KEY = 1;
private static final int MSG_LONGPRESS_KEY = 2;
@ -128,14 +128,14 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
private final KeyTimerParams mParams;
public KeyTimerHandler(LatinKeyboardView outerInstance, KeyTimerParams params) {
public KeyTimerHandler(MainKeyboardView outerInstance, KeyTimerParams params) {
super(outerInstance);
mParams = params;
}
@Override
public void handleMessage(Message msg) {
final LatinKeyboardView keyboardView = getOuterInstance();
final MainKeyboardView keyboardView = getOuterInstance();
final PointerTracker tracker = (PointerTracker) msg.obj;
switch (msg.what) {
case MSG_REPEAT_KEY:
@ -249,7 +249,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
if (isTyping) {
return;
}
final LatinKeyboardView keyboardView = getOuterInstance();
final MainKeyboardView keyboardView = getOuterInstance();
cancelAndStartAnimators(keyboardView.mAltCodeKeyWhileTypingFadeinAnimator,
keyboardView.mAltCodeKeyWhileTypingFadeoutAnimator);
}
@ -299,13 +299,13 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
mTouchNoiseThresholdDistance = 0;
}
public PointerTrackerParams(TypedArray latinKeyboardViewAttr) {
mSlidingKeyInputEnabled = latinKeyboardViewAttr.getBoolean(
R.styleable.LatinKeyboardView_slidingKeyInputEnable, false);
mTouchNoiseThresholdTime = latinKeyboardViewAttr.getInt(
R.styleable.LatinKeyboardView_touchNoiseThresholdTime, 0);
mTouchNoiseThresholdDistance = latinKeyboardViewAttr.getDimension(
R.styleable.LatinKeyboardView_touchNoiseThresholdDistance, 0);
public PointerTrackerParams(TypedArray mainKeyboardViewAttr) {
mSlidingKeyInputEnabled = mainKeyboardViewAttr.getBoolean(
R.styleable.MainKeyboardView_slidingKeyInputEnable, false);
mTouchNoiseThresholdTime = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_touchNoiseThresholdTime, 0);
mTouchNoiseThresholdDistance = mainKeyboardViewAttr.getDimension(
R.styleable.MainKeyboardView_touchNoiseThresholdDistance, 0);
}
}
@ -316,25 +316,25 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
public final int mLongPressShiftKeyTimeout;
public final int mIgnoreAltCodeKeyTimeout;
public KeyTimerParams(TypedArray latinKeyboardViewAttr) {
mKeyRepeatStartTimeout = latinKeyboardViewAttr.getInt(
R.styleable.LatinKeyboardView_keyRepeatStartTimeout, 0);
mKeyRepeatInterval = latinKeyboardViewAttr.getInt(
R.styleable.LatinKeyboardView_keyRepeatInterval, 0);
mLongPressKeyTimeout = latinKeyboardViewAttr.getInt(
R.styleable.LatinKeyboardView_longPressKeyTimeout, 0);
mLongPressShiftKeyTimeout = latinKeyboardViewAttr.getInt(
R.styleable.LatinKeyboardView_longPressShiftKeyTimeout, 0);
mIgnoreAltCodeKeyTimeout = latinKeyboardViewAttr.getInt(
R.styleable.LatinKeyboardView_ignoreAltCodeKeyTimeout, 0);
public KeyTimerParams(TypedArray mainKeyboardViewAttr) {
mKeyRepeatStartTimeout = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_keyRepeatStartTimeout, 0);
mKeyRepeatInterval = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_keyRepeatInterval, 0);
mLongPressKeyTimeout = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_longPressKeyTimeout, 0);
mLongPressShiftKeyTimeout = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_longPressShiftKeyTimeout, 0);
mIgnoreAltCodeKeyTimeout = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_ignoreAltCodeKeyTimeout, 0);
}
}
public LatinKeyboardView(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.latinKeyboardViewStyle);
public MainKeyboardView(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.mainKeyboardViewStyle);
}
public LatinKeyboardView(Context context, AttributeSet attrs, int defStyle) {
public MainKeyboardView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mTouchScreenRegulator = new SuddenJumpingTouchEventHandler(getContext(), this);
@ -348,35 +348,35 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
PointerTracker.init(mHasDistinctMultitouch, needsPhantomSuddenMoveEventHack);
final TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.LatinKeyboardView, defStyle, R.style.LatinKeyboardView);
attrs, R.styleable.MainKeyboardView, defStyle, R.style.MainKeyboardView);
mAutoCorrectionSpacebarLedEnabled = a.getBoolean(
R.styleable.LatinKeyboardView_autoCorrectionSpacebarLedEnabled, false);
R.styleable.MainKeyboardView_autoCorrectionSpacebarLedEnabled, false);
mAutoCorrectionSpacebarLedIcon = a.getDrawable(
R.styleable.LatinKeyboardView_autoCorrectionSpacebarLedIcon);
mSpacebarTextRatio = a.getFraction(R.styleable.LatinKeyboardView_spacebarTextRatio,
R.styleable.MainKeyboardView_autoCorrectionSpacebarLedIcon);
mSpacebarTextRatio = a.getFraction(R.styleable.MainKeyboardView_spacebarTextRatio,
1000, 1000, 1) / 1000.0f;
mSpacebarTextColor = a.getColor(R.styleable.LatinKeyboardView_spacebarTextColor, 0);
mSpacebarTextColor = a.getColor(R.styleable.MainKeyboardView_spacebarTextColor, 0);
mSpacebarTextShadowColor = a.getColor(
R.styleable.LatinKeyboardView_spacebarTextShadowColor, 0);
R.styleable.MainKeyboardView_spacebarTextShadowColor, 0);
mLanguageOnSpacebarFinalAlpha = a.getInt(
R.styleable.LatinKeyboardView_languageOnSpacebarFinalAlpha,
R.styleable.MainKeyboardView_languageOnSpacebarFinalAlpha,
Constants.Color.ALPHA_OPAQUE);
final int languageOnSpacebarFadeoutAnimatorResId = a.getResourceId(
R.styleable.LatinKeyboardView_languageOnSpacebarFadeoutAnimator, 0);
R.styleable.MainKeyboardView_languageOnSpacebarFadeoutAnimator, 0);
final int altCodeKeyWhileTypingFadeoutAnimatorResId = a.getResourceId(
R.styleable.LatinKeyboardView_altCodeKeyWhileTypingFadeoutAnimator, 0);
R.styleable.MainKeyboardView_altCodeKeyWhileTypingFadeoutAnimator, 0);
final int altCodeKeyWhileTypingFadeinAnimatorResId = a.getResourceId(
R.styleable.LatinKeyboardView_altCodeKeyWhileTypingFadeinAnimator, 0);
R.styleable.MainKeyboardView_altCodeKeyWhileTypingFadeinAnimator, 0);
final KeyTimerParams keyTimerParams = new KeyTimerParams(a);
mPointerTrackerParams = new PointerTrackerParams(a);
final float keyHysteresisDistance = a.getDimension(
R.styleable.LatinKeyboardView_keyHysteresisDistance, 0);
R.styleable.MainKeyboardView_keyHysteresisDistance, 0);
mKeyDetector = new KeyDetector(keyHysteresisDistance);
mKeyTimerHandler = new KeyTimerHandler(this, keyTimerParams);
mConfigShowMoreKeysKeyboardAtTouchedPoint = a.getBoolean(
R.styleable.LatinKeyboardView_showMoreKeysKeyboardAtTouchedPoint, false);
R.styleable.MainKeyboardView_showMoreKeysKeyboardAtTouchedPoint, false);
a.recycle();
PointerTracker.setParameters(mPointerTrackerParams);
@ -471,7 +471,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
mSpacebarTextSize = keyHeight * mSpacebarTextRatio;
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinKeyboardView_setKeyboard(keyboard);
ResearchLogger.mainKeyboardView_setKeyboard(keyboard);
}
// This always needs to be set since the accessibility state can
@ -515,7 +515,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
// to properly show the splash screen, which requires that the window token of the
// KeyboardView be non-null.
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.getInstance().latinKeyboardView_onAttachedToWindow();
ResearchLogger.getInstance().mainKeyboardView_onAttachedToWindow();
}
}
@ -568,7 +568,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
*/
protected boolean onLongPress(Key parentKey, PointerTracker tracker) {
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinKeyboardView_onLongPress();
ResearchLogger.mainKeyboardView_onLongPress();
}
final int primaryCode = parentKey.mCode;
if (parentKey.hasEmbeddedMoreKey()) {
@ -719,7 +719,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
}
}
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinKeyboardView_processMotionEvent(me, action, eventTime, index, id,
ResearchLogger.mainKeyboardView_processMotionEvent(me, action, eventTime, index, id,
x, y);
}
@ -791,7 +791,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
+ pointerSize + "," + pointerPressure);
}
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinKeyboardView_processMotionEvent(me, action, eventTime,
ResearchLogger.mainKeyboardView_processMotionEvent(me, action, eventTime,
i, pointerId, px, py);
}
}

View File

@ -119,7 +119,7 @@ public class PointerTracker {
}
// Parameters for pointer handling.
private static LatinKeyboardView.PointerTrackerParams sParams;
private static MainKeyboardView.PointerTrackerParams sParams;
private static int sTouchNoiseThresholdDistanceSquared;
private static boolean sNeedsPhantomSuddenMoveEventHack;
@ -198,11 +198,11 @@ public class PointerTracker {
}
sNeedsPhantomSuddenMoveEventHack = needsPhantomSuddenMoveEventHack;
setParameters(LatinKeyboardView.PointerTrackerParams.DEFAULT);
setParameters(MainKeyboardView.PointerTrackerParams.DEFAULT);
updateGestureInputEnabledState(null, false /* gestureInputEnabled */);
}
public static void setParameters(LatinKeyboardView.PointerTrackerParams params) {
public static void setParameters(MainKeyboardView.PointerTrackerParams params) {
sParams = params;
sTouchNoiseThresholdDistanceSquared = (int)(
params.mTouchNoiseThresholdDistance * params.mTouchNoiseThresholdDistance);

View File

@ -70,7 +70,7 @@ public class SuddenJumpingTouchEventHandler {
* the sudden moves subside, a DOWN event is simulated for the second key.
* @param me the motion event
* @return true if the event was consumed, so that it doesn't continue to be handled by
* {@link LatinKeyboardView}.
* {@link MainKeyboardView}.
*/
private boolean handleSuddenJumping(MotionEvent me) {
if (!mNeedsSuddenJumpingHack)

View File

@ -67,7 +67,7 @@ import com.android.inputmethod.keyboard.KeyboardActionListener;
import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.LatinKeyboardView;
import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.latin.LocaleUtils.RunInLocale;
import com.android.inputmethod.latin.define.ProductionFlag;
import com.android.inputmethod.latin.suggestions.SuggestionsView;
@ -598,7 +598,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void onStartInputViewInternal(EditorInfo editorInfo, boolean restarting) {
super.onStartInputView(editorInfo, restarting);
final KeyboardSwitcher switcher = mKeyboardSwitcher;
LatinKeyboardView inputView = switcher.getKeyboardView();
MainKeyboardView inputView = switcher.getKeyboardView();
if (editorInfo == null) {
Log.e(TAG, "Null EditorInfo in onStartInputView()");
@ -889,7 +889,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void setSuggestionStripShownInternal(boolean shown, boolean needsInputViewShown) {
// TODO: Modify this if we support suggestions with hard keyboard
if (onEvaluateInputViewShown() && mSuggestionsContainer != null) {
final LatinKeyboardView keyboardView = mKeyboardSwitcher.getKeyboardView();
final MainKeyboardView keyboardView = mKeyboardSwitcher.getKeyboardView();
final boolean inputViewShown = (keyboardView != null) ? keyboardView.isShown() : false;
final boolean shouldShowSuggestions = shown
&& (needsInputViewShown ? inputViewShown : true);
@ -950,7 +950,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final int extraHeight = extractHeight + backingHeight + suggestionsHeight;
int touchY = extraHeight;
// Need to set touchable region only if input view is being shown
final LatinKeyboardView keyboardView = mKeyboardSwitcher.getKeyboardView();
final MainKeyboardView keyboardView = mKeyboardSwitcher.getKeyboardView();
if (keyboardView != null && keyboardView.isShown()) {
if (mSuggestionsContainer.getVisibility() == View.VISIBLE) {
touchY -= suggestionsHeight;
@ -1643,7 +1643,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void handleClose() {
commitTyped(LastComposedWord.NOT_A_SEPARATOR);
requestHideSelf(0);
LatinKeyboardView inputView = mKeyboardSwitcher.getKeyboardView();
MainKeyboardView inputView = mKeyboardSwitcher.getKeyboardView();
if (inputView != null)
inputView.closing();
}

View File

@ -27,11 +27,11 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.inputmethodservice.InputMethodService;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.inputmethodservice.InputMethodService;
import android.os.Build;
import android.os.IBinder;
import android.text.TextUtils;
@ -53,7 +53,7 @@ import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.LatinKeyboardView;
import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.LatinIME;
import com.android.inputmethod.latin.R;
@ -192,7 +192,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
}
public void latinKeyboardView_onAttachedToWindow() {
public void mainKeyboardView_onAttachedToWindow() {
maybeShowSplashScreen();
}
@ -552,9 +552,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
int height) {
// TODO: Reimplement using a keyboard background image specific to the ResearchLogger
// and remove this method.
// The check for LatinKeyboardView ensures that a red border is only placed around
// The check for MainKeyboardView ensures that a red border is only placed around
// the main keyboard, not every keyboard.
if (IS_SHOWING_INDICATOR && isAllowedToLog() && view instanceof LatinKeyboardView) {
if (IS_SHOWING_INDICATOR && isAllowedToLog() && view instanceof MainKeyboardView) {
final int savedColor = paint.getColor();
paint.setColor(Color.RED);
final Style savedStyle = paint.getStyle();
@ -876,11 +876,11 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
// Regular logging methods
private static final String[] EVENTKEYS_LATINKEYBOARDVIEW_PROCESSMOTIONEVENT = {
"LatinKeyboardViewProcessMotionEvent", "action", "eventTime", "id", "x", "y", "size",
private static final String[] EVENTKEYS_MAINKEYBOARDVIEW_PROCESSMOTIONEVENT = {
"MainKeyboardViewProcessMotionEvent", "action", "eventTime", "id", "x", "y", "size",
"pressure"
};
public static void latinKeyboardView_processMotionEvent(final MotionEvent me, final int action,
public static void mainKeyboardView_processMotionEvent(final MotionEvent me, final int action,
final long eventTime, final int index, final int id, final int x, final int y) {
if (me != null) {
final String actionString;
@ -900,7 +900,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
actionString, eventTime, id, x, y, size, pressure
};
getInstance().enqueuePotentiallyPrivateEvent(
EVENTKEYS_LATINKEYBOARDVIEW_PROCESSMOTIONEVENT, values);
EVENTKEYS_MAINKEYBOARDVIEW_PROCESSMOTIONEVENT, values);
}
}
@ -1129,20 +1129,20 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
EVENTKEYS_NULLVALUES);
}
private static final String[] EVENTKEYS_LATINKEYBOARDVIEW_ONLONGPRESS = {
"LatinKeyboardViewOnLongPress"
private static final String[] EVENTKEYS_MAINKEYBOARDVIEW_ONLONGPRESS = {
"MainKeyboardViewOnLongPress"
};
public static void latinKeyboardView_onLongPress() {
getInstance().enqueueEvent(EVENTKEYS_LATINKEYBOARDVIEW_ONLONGPRESS, EVENTKEYS_NULLVALUES);
public static void mainKeyboardView_onLongPress() {
getInstance().enqueueEvent(EVENTKEYS_MAINKEYBOARDVIEW_ONLONGPRESS, EVENTKEYS_NULLVALUES);
}
private static final String[] EVENTKEYS_LATINKEYBOARDVIEW_SETKEYBOARD = {
"LatinKeyboardViewSetKeyboard", "elementId", "locale", "orientation", "width",
private static final String[] EVENTKEYS_MAINKEYBOARDVIEW_SETKEYBOARD = {
"MainKeyboardViewSetKeyboard", "elementId", "locale", "orientation", "width",
"modeName", "action", "navigateNext", "navigatePrevious", "clobberSettingsKey",
"passwordInput", "shortcutKeyEnabled", "hasShortcutKey", "languageSwitchKeyEnabled",
"isMultiLine", "tw", "th", "keys"
};
public static void latinKeyboardView_setKeyboard(final Keyboard keyboard) {
public static void mainKeyboardView_setKeyboard(final Keyboard keyboard) {
if (keyboard != null) {
final KeyboardId kid = keyboard.mId;
final boolean isPasswordView = kid.passwordInput();
@ -1166,7 +1166,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
keyboard.mOccupiedHeight,
keyboard.mKeys
};
getInstance().enqueueEvent(EVENTKEYS_LATINKEYBOARDVIEW_SETKEYBOARD, values);
getInstance().enqueueEvent(EVENTKEYS_MAINKEYBOARDVIEW_SETKEYBOARD, values);
getInstance().setIsPasswordView(isPasswordView);
}
}

View File

@ -46,7 +46,7 @@ public class SpacebarTextTests extends AndroidTestCase {
public void testAllFullDisplayName() {
for (final InputMethodSubtype subtype : mSubtypesList) {
final String subtypeName = SubtypeLocale.getSubtypeDisplayName(subtype, mRes);
final String spacebarText = LatinKeyboardView.getFullDisplayName(subtype, mRes);
final String spacebarText = MainKeyboardView.getFullDisplayName(subtype, mRes);
final String languageName =
SubtypeLocale.getSubtypeLocaleDisplayName(subtype.getLocale());
if (SubtypeLocale.isNoLanguage(subtype)) {
@ -60,7 +60,7 @@ public class SpacebarTextTests extends AndroidTestCase {
public void testAllMiddleDisplayName() {
for (final InputMethodSubtype subtype : mSubtypesList) {
final String subtypeName = SubtypeLocale.getSubtypeDisplayName(subtype, mRes);
final String spacebarText = LatinKeyboardView.getMiddleDisplayName(subtype);
final String spacebarText = MainKeyboardView.getMiddleDisplayName(subtype);
if (SubtypeLocale.isNoLanguage(subtype)) {
assertEquals(subtypeName,
SubtypeLocale.getKeyboardLayoutSetName(subtype), spacebarText);
@ -76,7 +76,7 @@ public class SpacebarTextTests extends AndroidTestCase {
for (final InputMethodSubtype subtype : mSubtypesList) {
final String subtypeName = SubtypeLocale.getSubtypeDisplayName(subtype, mRes);
final Locale locale = SubtypeLocale.getSubtypeLocale(subtype);
final String spacebarText = LatinKeyboardView.getShortDisplayName(subtype);
final String spacebarText = MainKeyboardView.getShortDisplayName(subtype);
final String languageCode = StringUtils.toTitleCase(locale.getLanguage(), locale);
if (SubtypeLocale.isNoLanguage(subtype)) {
assertEquals(subtypeName, "", spacebarText);
@ -117,31 +117,31 @@ public class SpacebarTextTests extends AndroidTestCase {
context, SubtypeLocale.NO_LANGUAGE, "qwerty");
assertEquals("en_US", "English (US)",
LatinKeyboardView.getFullDisplayName(EN_US, mRes));
MainKeyboardView.getFullDisplayName(EN_US, mRes));
assertEquals("en_GB", "English (UK)",
LatinKeyboardView.getFullDisplayName(EN_GB, mRes));
MainKeyboardView.getFullDisplayName(EN_GB, mRes));
assertEquals("fr ", "Français",
LatinKeyboardView.getFullDisplayName(FR, mRes));
MainKeyboardView.getFullDisplayName(FR, mRes));
assertEquals("fr_CA", "Français (Canada)",
LatinKeyboardView.getFullDisplayName(FR_CA, mRes));
MainKeyboardView.getFullDisplayName(FR_CA, mRes));
assertEquals("de ", "Deutsch",
LatinKeyboardView.getFullDisplayName(DE, mRes));
MainKeyboardView.getFullDisplayName(DE, mRes));
assertEquals("zz ", "QWERTY",
LatinKeyboardView.getFullDisplayName(ZZ, mRes));
MainKeyboardView.getFullDisplayName(ZZ, mRes));
assertEquals("en_US", "English", LatinKeyboardView.getMiddleDisplayName(EN_US));
assertEquals("en_GB", "English", LatinKeyboardView.getMiddleDisplayName(EN_GB));
assertEquals("fr ", "Français", LatinKeyboardView.getMiddleDisplayName(FR));
assertEquals("fr_CA", "Français", LatinKeyboardView.getMiddleDisplayName(FR_CA));
assertEquals("de ", "Deutsch", LatinKeyboardView.getMiddleDisplayName(DE));
assertEquals("zz ", "QWERTY", LatinKeyboardView.getMiddleDisplayName(ZZ));
assertEquals("en_US", "English", MainKeyboardView.getMiddleDisplayName(EN_US));
assertEquals("en_GB", "English", MainKeyboardView.getMiddleDisplayName(EN_GB));
assertEquals("fr ", "Français", MainKeyboardView.getMiddleDisplayName(FR));
assertEquals("fr_CA", "Français", MainKeyboardView.getMiddleDisplayName(FR_CA));
assertEquals("de ", "Deutsch", MainKeyboardView.getMiddleDisplayName(DE));
assertEquals("zz ", "QWERTY", MainKeyboardView.getMiddleDisplayName(ZZ));
assertEquals("en_US", "En", LatinKeyboardView.getShortDisplayName(EN_US));
assertEquals("en_GB", "En", LatinKeyboardView.getShortDisplayName(EN_GB));
assertEquals("fr ", "Fr", LatinKeyboardView.getShortDisplayName(FR));
assertEquals("fr_CA", "Fr", LatinKeyboardView.getShortDisplayName(FR_CA));
assertEquals("de ", "De", LatinKeyboardView.getShortDisplayName(DE));
assertEquals("zz ", "", LatinKeyboardView.getShortDisplayName(ZZ));
assertEquals("en_US", "En", MainKeyboardView.getShortDisplayName(EN_US));
assertEquals("en_GB", "En", MainKeyboardView.getShortDisplayName(EN_GB));
assertEquals("fr ", "Fr", MainKeyboardView.getShortDisplayName(FR));
assertEquals("fr_CA", "Fr", MainKeyboardView.getShortDisplayName(FR_CA));
assertEquals("de ", "De", MainKeyboardView.getShortDisplayName(DE));
assertEquals("zz ", "", MainKeyboardView.getShortDisplayName(ZZ));
}
public void testAdditionalSubtype() {
@ -155,22 +155,22 @@ public class SpacebarTextTests extends AndroidTestCase {
SubtypeLocale.NO_LANGUAGE, "azerty", null);
assertEquals("fr qwertz", "Français (QWERTZ)",
LatinKeyboardView.getFullDisplayName(FR_QWERTZ, mRes));
MainKeyboardView.getFullDisplayName(FR_QWERTZ, mRes));
assertEquals("de qwerty", "Deutsch (QWERTY)",
LatinKeyboardView.getFullDisplayName(DE_QWERTY, mRes));
MainKeyboardView.getFullDisplayName(DE_QWERTY, mRes));
assertEquals("en_US azerty", "English (US) (AZERTY)",
LatinKeyboardView.getFullDisplayName(US_AZERTY, mRes));
MainKeyboardView.getFullDisplayName(US_AZERTY, mRes));
assertEquals("zz azerty", "AZERTY",
LatinKeyboardView.getFullDisplayName(ZZ_AZERTY, mRes));
MainKeyboardView.getFullDisplayName(ZZ_AZERTY, mRes));
assertEquals("fr qwertz", "Français", LatinKeyboardView.getMiddleDisplayName(FR_QWERTZ));
assertEquals("de qwerty", "Deutsch", LatinKeyboardView.getMiddleDisplayName(DE_QWERTY));
assertEquals("en_US azerty", "English", LatinKeyboardView.getMiddleDisplayName(US_AZERTY));
assertEquals("zz azerty", "AZERTY", LatinKeyboardView.getMiddleDisplayName(ZZ_AZERTY));
assertEquals("fr qwertz", "Français", MainKeyboardView.getMiddleDisplayName(FR_QWERTZ));
assertEquals("de qwerty", "Deutsch", MainKeyboardView.getMiddleDisplayName(DE_QWERTY));
assertEquals("en_US azerty", "English", MainKeyboardView.getMiddleDisplayName(US_AZERTY));
assertEquals("zz azerty", "AZERTY", MainKeyboardView.getMiddleDisplayName(ZZ_AZERTY));
assertEquals("fr qwertz", "Fr", LatinKeyboardView.getShortDisplayName(FR_QWERTZ));
assertEquals("de qwerty", "De", LatinKeyboardView.getShortDisplayName(DE_QWERTY));
assertEquals("en_US azerty", "En", LatinKeyboardView.getShortDisplayName(US_AZERTY));
assertEquals("zz azerty", "", LatinKeyboardView.getShortDisplayName(ZZ_AZERTY));
assertEquals("fr qwertz", "Fr", MainKeyboardView.getShortDisplayName(FR_QWERTZ));
assertEquals("de qwerty", "De", MainKeyboardView.getShortDisplayName(DE_QWERTY));
assertEquals("en_US azerty", "En", MainKeyboardView.getShortDisplayName(US_AZERTY));
assertEquals("zz azerty", "", MainKeyboardView.getShortDisplayName(ZZ_AZERTY));
}
}