Merge "Increase the horizontal gap between shift/delete and normal keys"
commit
2c389c5b9e
|
@ -25,6 +25,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="0dip"
|
||||||
android:background="@drawable/keyboard_background"
|
android:background="@drawable/keyboard_background"
|
||||||
|
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key"
|
latin:keyBackground="@drawable/btn_keyboard_key"
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
<com.android.inputmethod.keyboard.LatinKeyboardView
|
<com.android.inputmethod.keyboard.LatinKeyboardView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||||
|
|
||||||
android:id="@+id/LatinkeyboardBaseView"
|
android:id="@+id/LatinkeyboardBaseView"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="0dip"
|
||||||
android:background="@android:color/black"
|
android:background="@android:color/black"
|
||||||
|
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key3"
|
latin:keyBackground="@drawable/btn_keyboard_key3"
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/keyboard_top_padding"
|
android:padding="0dip"
|
||||||
android:paddingBottom="@dimen/keyboard_bottom_padding"
|
|
||||||
android:background="@drawable/keyboard_dark_background"
|
android:background="@drawable/keyboard_dark_background"
|
||||||
|
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
|
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/keyboard_top_padding"
|
android:padding="0dip"
|
||||||
android:paddingBottom="@dimen/keyboard_bottom_padding"
|
|
||||||
android:background="@drawable/keyboard_background_holo"
|
android:background="@drawable/keyboard_background_holo"
|
||||||
|
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb"
|
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="0dip"
|
||||||
android:background="@drawable/keyboard_background"
|
android:background="@drawable/keyboard_background"
|
||||||
|
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key_stone"
|
latin:keyBackground="@drawable/btn_keyboard_key_stone"
|
||||||
|
@ -33,5 +34,5 @@
|
||||||
latin:shadowColor="@color/latinkeyboard_key_color_white"
|
latin:shadowColor="@color/latinkeyboard_key_color_white"
|
||||||
latin:keyLetterStyle="bold"
|
latin:keyLetterStyle="bold"
|
||||||
latin:colorScheme="black"
|
latin:colorScheme="black"
|
||||||
latin:popupLayout="@layout/input_stone_popup"
|
latin:popupLayout="@layout/keyboard_popup_stone"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="0dip"
|
||||||
android:background="@drawable/keyboard_background"
|
android:background="@drawable/keyboard_background"
|
||||||
|
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key_stone"
|
latin:keyBackground="@drawable/btn_keyboard_key_stone"
|
||||||
|
@ -32,5 +33,5 @@
|
||||||
latin:keyTextColorDisabled="#FF808080"
|
latin:keyTextColorDisabled="#FF808080"
|
||||||
latin:shadowColor="@color/latinkeyboard_key_color_white"
|
latin:shadowColor="@color/latinkeyboard_key_color_white"
|
||||||
latin:colorScheme="black"
|
latin:colorScheme="black"
|
||||||
latin:popupLayout="@layout/input_stone_popup"
|
latin:popupLayout="@layout/keyboard_popup_stone"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -36,6 +36,5 @@
|
||||||
latin:keyBackground="@drawable/btn_keyboard_key_stone"
|
latin:keyBackground="@drawable/btn_keyboard_key_stone"
|
||||||
latin:keyTextColor="@color/latinkeyboard_key_color_black"
|
latin:keyTextColor="@color/latinkeyboard_key_color_black"
|
||||||
latin:shadowColor="@color/latinkeyboard_key_color_white"
|
latin:shadowColor="@color/latinkeyboard_key_color_white"
|
||||||
latin:popupLayout="@layout/input_stone_popup"
|
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -27,6 +27,7 @@
|
||||||
<dimen name="popup_key_height">0.270in</dimen>
|
<dimen name="popup_key_height">0.270in</dimen>
|
||||||
<dimen name="keyboard_top_padding">0.0in</dimen>
|
<dimen name="keyboard_top_padding">0.0in</dimen>
|
||||||
<dimen name="keyboard_bottom_padding">0.0in</dimen>
|
<dimen name="keyboard_bottom_padding">0.0in</dimen>
|
||||||
|
<dimen name="keyboard_horizontal_edges_padding">0.0in</dimen>
|
||||||
<dimen name="candidate_strip_height">38dip</dimen>
|
<dimen name="candidate_strip_height">38dip</dimen>
|
||||||
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
|
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
|
||||||
<dimen name="spacebar_vertical_correction">2dip</dimen>
|
<dimen name="spacebar_vertical_correction">2dip</dimen>
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<dimen name="popup_key_height">13.0mm</dimen>
|
<dimen name="popup_key_height">13.0mm</dimen>
|
||||||
<dimen name="keyboard_top_padding">1.1mm</dimen>
|
<dimen name="keyboard_top_padding">1.1mm</dimen>
|
||||||
<dimen name="keyboard_bottom_padding">0.0mm</dimen>
|
<dimen name="keyboard_bottom_padding">0.0mm</dimen>
|
||||||
|
<dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
|
||||||
|
|
||||||
<dimen name="key_letter_size">28dip</dimen>
|
<dimen name="key_letter_size">28dip</dimen>
|
||||||
<dimen name="key_label_text_size">20dip</dimen>
|
<dimen name="key_label_text_size">20dip</dimen>
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<dimen name="popup_key_height">10.0mm</dimen>
|
<dimen name="popup_key_height">10.0mm</dimen>
|
||||||
<dimen name="keyboard_top_padding">1.1mm</dimen>
|
<dimen name="keyboard_top_padding">1.1mm</dimen>
|
||||||
<dimen name="keyboard_bottom_padding">0.0mm</dimen>
|
<dimen name="keyboard_bottom_padding">0.0mm</dimen>
|
||||||
|
<dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
|
||||||
<dimen name="mini_keyboard_horizontal_padding_holo">40dip</dimen>
|
<dimen name="mini_keyboard_horizontal_padding_holo">40dip</dimen>
|
||||||
<dimen name="mini_keyboard_key_horizontal_padding">12dip</dimen>
|
<dimen name="mini_keyboard_key_horizontal_padding">12dip</dimen>
|
||||||
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
|
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<dimen name="popup_key_height">0.325in</dimen>
|
<dimen name="popup_key_height">0.325in</dimen>
|
||||||
<dimen name="keyboard_top_padding">0.00in</dimen>
|
<dimen name="keyboard_top_padding">0.00in</dimen>
|
||||||
<dimen name="keyboard_bottom_padding">0.06in</dimen>
|
<dimen name="keyboard_bottom_padding">0.06in</dimen>
|
||||||
|
<dimen name="keyboard_horizontal_edges_padding">0.0in</dimen>
|
||||||
<dimen name="mini_keyboard_horizontal_padding">16dip</dimen>
|
<dimen name="mini_keyboard_horizontal_padding">16dip</dimen>
|
||||||
<dimen name="mini_keyboard_horizontal_padding_holo">32dip</dimen>
|
<dimen name="mini_keyboard_horizontal_padding_holo">32dip</dimen>
|
||||||
<dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen>
|
<dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen>
|
||||||
|
|
|
@ -26,8 +26,10 @@
|
||||||
>
|
>
|
||||||
<Key
|
<Key
|
||||||
latin:keyStyle="shiftKeyStyle"
|
latin:keyStyle="shiftKeyStyle"
|
||||||
latin:keyWidth="15%p"
|
latin:keyWidth="13%p"
|
||||||
latin:keyEdgeFlags="left" />
|
latin:keyEdgeFlags="left" />
|
||||||
|
<Spacer
|
||||||
|
latin:horizontalGap="2%p" />
|
||||||
<Key
|
<Key
|
||||||
latin:keyLabel="z"
|
latin:keyLabel="z"
|
||||||
latin:popupCharacters="@string/alternates_for_z" />
|
latin:popupCharacters="@string/alternates_for_z" />
|
||||||
|
@ -46,9 +48,11 @@
|
||||||
latin:popupCharacters="@string/alternates_for_n" />
|
latin:popupCharacters="@string/alternates_for_n" />
|
||||||
<Key
|
<Key
|
||||||
latin:keyLabel="m" />
|
latin:keyLabel="m" />
|
||||||
|
<Spacer
|
||||||
|
latin:horizontalGap="2%p" />
|
||||||
<Key
|
<Key
|
||||||
latin:keyStyle="deleteKeyStyle"
|
latin:keyStyle="deleteKeyStyle"
|
||||||
latin:keyWidth="15%p"
|
latin:keyWidth="13%p"
|
||||||
latin:keyEdgeFlags="right" />
|
latin:keyEdgeFlags="right" />
|
||||||
</Row>
|
</Row>
|
||||||
</merge>
|
</merge>
|
||||||
|
|
|
@ -165,7 +165,9 @@ public class Keyboard {
|
||||||
GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
|
GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
|
||||||
GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
|
GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
|
||||||
|
|
||||||
mDisplayWidth = width;
|
final int horizontalEdgesPadding = (int)res.getDimension(
|
||||||
|
R.dimen.keyboard_horizontal_edges_padding);
|
||||||
|
mDisplayWidth = width - horizontalEdgesPadding * 2;
|
||||||
mDisplayHeight = height;
|
mDisplayHeight = height;
|
||||||
|
|
||||||
mDefaultHorizontalGap = 0;
|
mDefaultHorizontalGap = 0;
|
||||||
|
|
|
@ -122,6 +122,7 @@ public class KeyboardParser {
|
||||||
private final Keyboard mKeyboard;
|
private final Keyboard mKeyboard;
|
||||||
private final Resources mResources;
|
private final Resources mResources;
|
||||||
|
|
||||||
|
private int mHorizontalEdgesPadding;
|
||||||
private int mCurrentX = 0;
|
private int mCurrentX = 0;
|
||||||
private int mCurrentY = 0;
|
private int mCurrentY = 0;
|
||||||
private int mMaxRowWidth = 0;
|
private int mMaxRowWidth = 0;
|
||||||
|
@ -132,6 +133,7 @@ public class KeyboardParser {
|
||||||
public KeyboardParser(Keyboard keyboard, Resources res) {
|
public KeyboardParser(Keyboard keyboard, Resources res) {
|
||||||
mKeyboard = keyboard;
|
mKeyboard = keyboard;
|
||||||
mResources = res;
|
mResources = res;
|
||||||
|
mHorizontalEdgesPadding = (int)res.getDimension(R.dimen.keyboard_horizontal_edges_padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxRowWidth() {
|
public int getMaxRowWidth() {
|
||||||
|
@ -151,6 +153,7 @@ public class KeyboardParser {
|
||||||
final String tag = parser.getName();
|
final String tag = parser.getName();
|
||||||
if (TAG_KEYBOARD.equals(tag)) {
|
if (TAG_KEYBOARD.equals(tag)) {
|
||||||
parseKeyboardAttributes(parser);
|
parseKeyboardAttributes(parser);
|
||||||
|
startKeyboard();
|
||||||
parseKeyboardContent(parser, mKeyboard.getKeys());
|
parseKeyboardContent(parser, mKeyboard.getKeys());
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
@ -520,25 +523,32 @@ public class KeyboardParser {
|
||||||
throw new NonEmptyTag(tag, parser);
|
throw new NonEmptyTag(tag, parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startKeyboard() {
|
||||||
|
mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_top_padding);
|
||||||
|
}
|
||||||
|
|
||||||
private void startRow(Row row) {
|
private void startRow(Row row) {
|
||||||
mCurrentX = 0;
|
mCurrentX = 0;
|
||||||
|
setSpacer(mHorizontalEdgesPadding);
|
||||||
mCurrentRow = row;
|
mCurrentRow = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void endRow() {
|
private void endRow() {
|
||||||
if (mCurrentRow == null)
|
if (mCurrentRow == null)
|
||||||
throw new InflateException("orphant end row tag");
|
throw new InflateException("orphant end row tag");
|
||||||
|
setSpacer(mHorizontalEdgesPadding);
|
||||||
|
if (mCurrentX > mMaxRowWidth)
|
||||||
|
mMaxRowWidth = mCurrentX;
|
||||||
mCurrentY += mCurrentRow.mDefaultHeight;
|
mCurrentY += mCurrentRow.mDefaultHeight;
|
||||||
mCurrentRow = null;
|
mCurrentRow = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void endKey(Key key) {
|
private void endKey(Key key) {
|
||||||
mCurrentX += key.mGap + key.mWidth;
|
mCurrentX += key.mGap + key.mWidth;
|
||||||
if (mCurrentX > mMaxRowWidth)
|
|
||||||
mMaxRowWidth = mCurrentX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void endKeyboard(int defaultVerticalGap) {
|
private void endKeyboard(int defaultVerticalGap) {
|
||||||
|
mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_bottom_padding);
|
||||||
mTotalHeight = mCurrentY - defaultVerticalGap;
|
mTotalHeight = mCurrentY - defaultVerticalGap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1056,7 +1056,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
|
||||||
mKeyboardActionListener.onCodeInput(Keyboard.CODE_CAPSLOCK, null, 0, 0);
|
mKeyboardActionListener.onCodeInput(Keyboard.CODE_CAPSLOCK, null, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDoubleTapShiftKey(PointerTracker tracker) {
|
private void onDoubleTapShiftKey(@SuppressWarnings("unused") PointerTracker tracker) {
|
||||||
// When shift key is double tapped, the first tap is correctly processed as usual tap. And
|
// When shift key is double tapped, the first tap is correctly processed as usual tap. And
|
||||||
// the second tap is treated as this double tap event, so that we need not mark tracker
|
// the second tap is treated as this double tap event, so that we need not mark tracker
|
||||||
// calling setAlreadyProcessed() nor remove the tracker from mPointerQueueueue.
|
// calling setAlreadyProcessed() nor remove the tracker from mPointerQueueueue.
|
||||||
|
|
Loading…
Reference in New Issue