am 7de0331a: Merge "Remove orientation member from KeyboardId"
* commit '7de0331a19bbe07a2689d7b49ae9a798a9451c2c': Remove orientation member from KeyboardIdmain
commit
145ac75c0d
|
@ -58,8 +58,6 @@ public final class KeyboardId {
|
||||||
|
|
||||||
public final InputMethodSubtype mSubtype;
|
public final InputMethodSubtype mSubtype;
|
||||||
public final Locale mLocale;
|
public final Locale mLocale;
|
||||||
// TODO: Remove this member. It is used only for logging purpose.
|
|
||||||
public final int mOrientation;
|
|
||||||
public final int mWidth;
|
public final int mWidth;
|
||||||
public final int mHeight;
|
public final int mHeight;
|
||||||
public final int mMode;
|
public final int mMode;
|
||||||
|
@ -77,7 +75,6 @@ public final class KeyboardId {
|
||||||
public KeyboardId(final int elementId, final KeyboardLayoutSet.Params params) {
|
public KeyboardId(final int elementId, final KeyboardLayoutSet.Params params) {
|
||||||
mSubtype = params.mSubtype;
|
mSubtype = params.mSubtype;
|
||||||
mLocale = SubtypeLocaleUtils.getSubtypeLocale(mSubtype);
|
mLocale = SubtypeLocaleUtils.getSubtypeLocale(mSubtype);
|
||||||
mOrientation = params.mOrientation;
|
|
||||||
mWidth = params.mKeyboardWidth;
|
mWidth = params.mKeyboardWidth;
|
||||||
mHeight = params.mKeyboardHeight;
|
mHeight = params.mKeyboardHeight;
|
||||||
mMode = params.mMode;
|
mMode = params.mMode;
|
||||||
|
@ -101,7 +98,6 @@ public final class KeyboardId {
|
||||||
|
|
||||||
private static int computeHashCode(final KeyboardId id) {
|
private static int computeHashCode(final KeyboardId id) {
|
||||||
return Arrays.hashCode(new Object[] {
|
return Arrays.hashCode(new Object[] {
|
||||||
id.mOrientation,
|
|
||||||
id.mElementId,
|
id.mElementId,
|
||||||
id.mMode,
|
id.mMode,
|
||||||
id.mWidth,
|
id.mWidth,
|
||||||
|
@ -123,8 +119,7 @@ public final class KeyboardId {
|
||||||
private boolean equals(final KeyboardId other) {
|
private boolean equals(final KeyboardId other) {
|
||||||
if (other == this)
|
if (other == this)
|
||||||
return true;
|
return true;
|
||||||
return other.mOrientation == mOrientation
|
return other.mElementId == mElementId
|
||||||
&& other.mElementId == mElementId
|
|
||||||
&& other.mMode == mMode
|
&& other.mMode == mMode
|
||||||
&& other.mWidth == mWidth
|
&& other.mWidth == mWidth
|
||||||
&& other.mHeight == mHeight
|
&& other.mHeight == mHeight
|
||||||
|
@ -185,13 +180,10 @@ public final class KeyboardId {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final String orientation = (mOrientation == Configuration.ORIENTATION_PORTRAIT)
|
return String.format(Locale.ROOT, "[%s %s:%s %dx%d %s %s %s%s%s%s%s%s%s%s%s]",
|
||||||
? "port" : "land";
|
|
||||||
return String.format(Locale.ROOT, "[%s %s:%s %s:%dx%d %s %s %s%s%s%s%s%s%s%s%s]",
|
|
||||||
elementIdToName(mElementId),
|
elementIdToName(mElementId),
|
||||||
mLocale,
|
mLocale, mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET),
|
||||||
mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET),
|
mWidth, mHeight,
|
||||||
orientation, mWidth, mHeight,
|
|
||||||
modeName(mMode),
|
modeName(mMode),
|
||||||
imeAction(),
|
imeAction(),
|
||||||
(navigateNext() ? "navigateNext" : ""),
|
(navigateNext() ? "navigateNext" : ""),
|
||||||
|
|
|
@ -119,7 +119,6 @@ public final class KeyboardLayoutSet {
|
||||||
boolean mLanguageSwitchKeyEnabled;
|
boolean mLanguageSwitchKeyEnabled;
|
||||||
InputMethodSubtype mSubtype;
|
InputMethodSubtype mSubtype;
|
||||||
boolean mIsSpellChecker;
|
boolean mIsSpellChecker;
|
||||||
int mOrientation;
|
|
||||||
int mKeyboardWidth;
|
int mKeyboardWidth;
|
||||||
int mKeyboardHeight;
|
int mKeyboardHeight;
|
||||||
// Sparse array of KeyboardLayoutSet element parameters indexed by element's id.
|
// Sparse array of KeyboardLayoutSet element parameters indexed by element's id.
|
||||||
|
@ -242,9 +241,6 @@ public final class KeyboardLayoutSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setScreenGeometry(final int widthPixels, final int heightPixels) {
|
public Builder setScreenGeometry(final int widthPixels, final int heightPixels) {
|
||||||
final Params params = mParams;
|
|
||||||
params.mOrientation = (heightPixels > widthPixels)
|
|
||||||
? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE;
|
|
||||||
setDefaultKeyboardSize(widthPixels, heightPixels);
|
setDefaultKeyboardSize(widthPixels, heightPixels);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -317,8 +313,6 @@ public final class KeyboardLayoutSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyboardLayoutSet build() {
|
public KeyboardLayoutSet build() {
|
||||||
if (mParams.mOrientation == Configuration.ORIENTATION_UNDEFINED)
|
|
||||||
throw new RuntimeException("Screen geometry is not specified");
|
|
||||||
if (mParams.mSubtype == null)
|
if (mParams.mSubtype == null)
|
||||||
throw new RuntimeException("KeyboardLayoutSet subtype is not specified");
|
throw new RuntimeException("KeyboardLayoutSet subtype is not specified");
|
||||||
final String packageName = mResources.getResourcePackageName(
|
final String packageName = mResources.getResourcePackageName(
|
||||||
|
|
|
@ -615,7 +615,8 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
|
final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
|
||||||
mSpacebarTextSize = keyHeight * mSpacebarTextRatio;
|
mSpacebarTextSize = keyHeight * mSpacebarTextRatio;
|
||||||
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
||||||
ResearchLogger.mainKeyboardView_setKeyboard(keyboard);
|
final int orientation = getContext().getResources().getConfiguration().orientation;
|
||||||
|
ResearchLogger.mainKeyboardView_setKeyboard(keyboard, orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This always needs to be set since the accessibility state can
|
// This always needs to be set since the accessibility state can
|
||||||
|
|
|
@ -1414,7 +1414,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
"navigatePrevious", "clobberSettingsKey", "passwordInput", "shortcutKeyEnabled",
|
"navigatePrevious", "clobberSettingsKey", "passwordInput", "shortcutKeyEnabled",
|
||||||
"hasShortcutKey", "languageSwitchKeyEnabled", "isMultiLine", "tw", "th",
|
"hasShortcutKey", "languageSwitchKeyEnabled", "isMultiLine", "tw", "th",
|
||||||
"keys");
|
"keys");
|
||||||
public static void mainKeyboardView_setKeyboard(final Keyboard keyboard) {
|
public static void mainKeyboardView_setKeyboard(final Keyboard keyboard,
|
||||||
|
final int orientation) {
|
||||||
final KeyboardId kid = keyboard.mId;
|
final KeyboardId kid = keyboard.mId;
|
||||||
final boolean isPasswordView = kid.passwordInput();
|
final boolean isPasswordView = kid.passwordInput();
|
||||||
final ResearchLogger researchLogger = getInstance();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
|
@ -1422,7 +1423,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
researchLogger.enqueueEvent(LOGSTATEMENT_MAINKEYBOARDVIEW_SETKEYBOARD,
|
researchLogger.enqueueEvent(LOGSTATEMENT_MAINKEYBOARDVIEW_SETKEYBOARD,
|
||||||
KeyboardId.elementIdToName(kid.mElementId),
|
KeyboardId.elementIdToName(kid.mElementId),
|
||||||
kid.mLocale + ":" + kid.mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET),
|
kid.mLocale + ":" + kid.mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET),
|
||||||
kid.mOrientation, kid.mWidth, KeyboardId.modeName(kid.mMode), kid.imeAction(),
|
orientation, kid.mWidth, KeyboardId.modeName(kid.mMode), kid.imeAction(),
|
||||||
kid.navigateNext(), kid.navigatePrevious(), kid.mClobberSettingsKey,
|
kid.navigateNext(), kid.navigatePrevious(), kid.mClobberSettingsKey,
|
||||||
isPasswordView, kid.mShortcutKeyEnabled, kid.mHasShortcutKey,
|
isPasswordView, kid.mShortcutKeyEnabled, kid.mHasShortcutKey,
|
||||||
kid.mLanguageSwitchKeyEnabled, kid.isMultiLine(), keyboard.mOccupiedWidth,
|
kid.mLanguageSwitchKeyEnabled, kid.isMultiLine(), keyboard.mOccupiedWidth,
|
||||||
|
|
Loading…
Reference in New Issue