Remove unused device form factor values

Change-Id: I1ed88b842a3d45e5460dd387bfad4276c844096a
This commit is contained in:
Tadashi G. Takaoka 2013-05-07 18:52:22 +09:00
parent 84ac8f31fb
commit 9d71a6c968
6 changed files with 5 additions and 32 deletions

View file

@ -19,8 +19,6 @@
--> -->
<resources> <resources>
<!-- Device form factor. This value must be aligned with {@link KeyboardId.FORM_FACTOR_TABLET7} -->
<integer name="config_device_form_factor">1</integer>
<bool name="config_enable_show_voice_key_option">false</bool> <bool name="config_enable_show_voice_key_option">false</bool>
<bool name="config_enable_show_option_of_key_preview_popup">false</bool> <bool name="config_enable_show_option_of_key_preview_popup">false</bool>
<bool name="config_enable_bigram_suggestions_option">false</bool> <bool name="config_enable_bigram_suggestions_option">false</bool>

View file

@ -19,8 +19,6 @@
--> -->
<resources> <resources>
<!-- Device form factor. This value must be aligned with {@link KeyboardId.FORM_FACTOR_TABLET10} -->
<integer name="config_device_form_factor">2</integer>
<bool name="config_enable_show_voice_key_option">false</bool> <bool name="config_enable_show_voice_key_option">false</bool>
<bool name="config_enable_show_option_of_key_preview_popup">false</bool> <bool name="config_enable_show_option_of_key_preview_popup">false</bool>
<bool name="config_enable_bigram_suggestions_option">false</bool> <bool name="config_enable_bigram_suggestions_option">false</bool>

View file

@ -19,8 +19,6 @@
--> -->
<resources> <resources>
<!-- Device form factor. This value must be aligned with {@link KeyboardId.FORM_FACTOR_PHONE} -->
<integer name="config_device_form_factor">0</integer>
<bool name="config_use_fullscreen_mode">false</bool> <bool name="config_use_fullscreen_mode">false</bool>
<bool name="config_enable_show_voice_key_option">true</bool> <bool name="config_enable_show_voice_key_option">true</bool>
<bool name="config_enable_show_option_of_key_preview_popup">true</bool> <bool name="config_enable_show_option_of_key_preview_popup">true</bool>

View file

@ -56,13 +56,8 @@ public final class KeyboardId {
public static final int ELEMENT_PHONE_SYMBOLS = 8; public static final int ELEMENT_PHONE_SYMBOLS = 8;
public static final int ELEMENT_NUMBER = 9; public static final int ELEMENT_NUMBER = 9;
public static final int FORM_FACTOR_PHONE = 0;
public static final int FORM_FACTOR_TABLET7 = 1;
public static final int FORM_FACTOR_TABLET10 = 2;
public final InputMethodSubtype mSubtype; public final InputMethodSubtype mSubtype;
public final Locale mLocale; public final Locale mLocale;
public final int mDeviceFormFactor;
// TODO: Remove this member. It is used only for logging purpose. // TODO: Remove this member. It is used only for logging purpose.
public final int mOrientation; public final int mOrientation;
public final int mWidth; public final int mWidth;
@ -82,7 +77,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 = SubtypeLocale.getSubtypeLocale(mSubtype); mLocale = SubtypeLocale.getSubtypeLocale(mSubtype);
mDeviceFormFactor = params.mDeviceFormFactor;
mOrientation = params.mOrientation; mOrientation = params.mOrientation;
mWidth = params.mKeyboardWidth; mWidth = params.mKeyboardWidth;
mHeight = params.mKeyboardHeight; mHeight = params.mKeyboardHeight;
@ -107,7 +101,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.mDeviceFormFactor,
id.mOrientation, id.mOrientation,
id.mElementId, id.mElementId,
id.mMode, id.mMode,
@ -130,8 +123,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.mDeviceFormFactor == mDeviceFormFactor return other.mOrientation == mOrientation
&& other.mOrientation == mOrientation
&& other.mElementId == mElementId && other.mElementId == mElementId
&& other.mMode == mMode && other.mMode == mMode
&& other.mWidth == mWidth && other.mWidth == mWidth
@ -195,11 +187,11 @@ public final class KeyboardId {
public String toString() { public String toString() {
final String orientation = (mOrientation == Configuration.ORIENTATION_PORTRAIT) final String orientation = (mOrientation == Configuration.ORIENTATION_PORTRAIT)
? "port" : "land"; ? "port" : "land";
return String.format("[%s %s:%s %s-%s:%dx%d %s %s %s%s%s%s%s%s%s%s%s]", return String.format("[%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),
deviceFormFactor(mDeviceFormFactor), orientation, mWidth, mHeight, orientation, mWidth, mHeight,
modeName(mMode), modeName(mMode),
imeAction(), imeAction(),
(navigateNext() ? "navigateNext" : ""), (navigateNext() ? "navigateNext" : ""),
@ -238,15 +230,6 @@ public final class KeyboardId {
} }
} }
public static String deviceFormFactor(final int deviceFormFactor) {
switch (deviceFormFactor) {
case FORM_FACTOR_PHONE: return "phone";
case FORM_FACTOR_TABLET7: return "tablet7";
case FORM_FACTOR_TABLET10: return "tablet10";
default: return null;
}
}
public static String modeName(final int mode) { public static String modeName(final int mode) {
switch (mode) { switch (mode) {
case MODE_TEXT: return "text"; case MODE_TEXT: return "text";

View file

@ -106,7 +106,6 @@ public final class KeyboardLayoutSet {
boolean mNoSettingsKey; boolean mNoSettingsKey;
boolean mLanguageSwitchKeyEnabled; boolean mLanguageSwitchKeyEnabled;
InputMethodSubtype mSubtype; InputMethodSubtype mSubtype;
int mDeviceFormFactor;
int mOrientation; int mOrientation;
int mKeyboardWidth; int mKeyboardWidth;
int mKeyboardHeight; int mKeyboardHeight;
@ -217,10 +216,8 @@ public final class KeyboardLayoutSet {
mPackageName, NO_SETTINGS_KEY, mEditorInfo); mPackageName, NO_SETTINGS_KEY, mEditorInfo);
} }
public Builder setScreenGeometry(final int deviceFormFactor, final int widthPixels, public Builder setScreenGeometry(final int widthPixels, final int heightPixels) {
final int heightPixels) {
final Params params = mParams; final Params params = mParams;
params.mDeviceFormFactor = deviceFormFactor;
params.mOrientation = (heightPixels > widthPixels) params.mOrientation = (heightPixels > widthPixels)
? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE; ? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE;
setDefaultKeyboardSize(widthPixels, heightPixels); setDefaultKeyboardSize(widthPixels, heightPixels);

View file

@ -142,8 +142,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
mThemeContext, editorInfo); mThemeContext, editorInfo);
final Resources res = mThemeContext.getResources(); final Resources res = mThemeContext.getResources();
final DisplayMetrics dm = res.getDisplayMetrics(); final DisplayMetrics dm = res.getDisplayMetrics();
builder.setScreenGeometry(res.getInteger(R.integer.config_device_form_factor), builder.setScreenGeometry(dm.widthPixels, dm.heightPixels);
dm.widthPixels, dm.heightPixels);
builder.setSubtype(mSubtypeSwitcher.getCurrentSubtype()); builder.setSubtype(mSubtypeSwitcher.getCurrentSubtype());
builder.setOptions( builder.setOptions(
settingsValues.isVoiceKeyEnabled(editorInfo), settingsValues.isVoiceKeyEnabled(editorInfo),