Merge "Increase the horizontal gap between shift/delete and normal keys"

main
Tadashi G. Takaoka 2011-04-08 02:00:59 -07:00 committed by Android (Google) Code Review
commit 2c389c5b9e
15 changed files with 34 additions and 14 deletions

View File

@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key"

View File

@ -21,11 +21,11 @@
<com.android.inputmethod.keyboard.LatinKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
android:id="@+id/LatinkeyboardBaseView"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
android:background="@android:color/black"
latin:keyBackground="@drawable/btn_keyboard_key3"

View File

@ -25,8 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/keyboard_top_padding"
android:paddingBottom="@dimen/keyboard_bottom_padding"
android:padding="0dip"
android:background="@drawable/keyboard_dark_background"
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"

View File

@ -25,8 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/keyboard_top_padding"
android:paddingBottom="@dimen/keyboard_bottom_padding"
android:padding="0dip"
android:background="@drawable/keyboard_background_holo"
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb"

View File

@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key_stone"
@ -33,5 +34,5 @@
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:keyLetterStyle="bold"
latin:colorScheme="black"
latin:popupLayout="@layout/input_stone_popup"
latin:popupLayout="@layout/keyboard_popup_stone"
/>

View File

@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key_stone"
@ -32,5 +33,5 @@
latin:keyTextColorDisabled="#FF808080"
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:colorScheme="black"
latin:popupLayout="@layout/input_stone_popup"
latin:popupLayout="@layout/keyboard_popup_stone"
/>

View File

@ -36,6 +36,5 @@
latin:keyBackground="@drawable/btn_keyboard_key_stone"
latin:keyTextColor="@color/latinkeyboard_key_color_black"
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:popupLayout="@layout/input_stone_popup"
/>
</LinearLayout>

View File

@ -27,6 +27,7 @@
<dimen name="popup_key_height">0.270in</dimen>
<dimen name="keyboard_top_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_fading_edge_length">63dip</dimen>
<dimen name="spacebar_vertical_correction">2dip</dimen>

View File

@ -28,6 +28,7 @@
<dimen name="popup_key_height">13.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</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_label_text_size">20dip</dimen>

View File

@ -28,6 +28,7 @@
<dimen name="popup_key_height">10.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</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_key_horizontal_padding">12dip</dimen>
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->

View File

@ -28,6 +28,7 @@
<dimen name="popup_key_height">0.325in</dimen>
<dimen name="keyboard_top_padding">0.00in</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_holo">32dip</dimen>
<dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen>

View File

@ -26,8 +26,10 @@
>
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="15%p"
latin:keyWidth="13%p"
latin:keyEdgeFlags="left" />
<Spacer
latin:horizontalGap="2%p" />
<Key
latin:keyLabel="z"
latin:popupCharacters="@string/alternates_for_z" />
@ -46,9 +48,11 @@
latin:popupCharacters="@string/alternates_for_n" />
<Key
latin:keyLabel="m" />
<Spacer
latin:horizontalGap="2%p" />
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="15%p"
latin:keyWidth="13%p"
latin:keyEdgeFlags="right" />
</Row>
</merge>

View File

@ -165,7 +165,9 @@ public class Keyboard {
GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_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;
mDefaultHorizontalGap = 0;

View File

@ -122,6 +122,7 @@ public class KeyboardParser {
private final Keyboard mKeyboard;
private final Resources mResources;
private int mHorizontalEdgesPadding;
private int mCurrentX = 0;
private int mCurrentY = 0;
private int mMaxRowWidth = 0;
@ -132,6 +133,7 @@ public class KeyboardParser {
public KeyboardParser(Keyboard keyboard, Resources res) {
mKeyboard = keyboard;
mResources = res;
mHorizontalEdgesPadding = (int)res.getDimension(R.dimen.keyboard_horizontal_edges_padding);
}
public int getMaxRowWidth() {
@ -151,6 +153,7 @@ public class KeyboardParser {
final String tag = parser.getName();
if (TAG_KEYBOARD.equals(tag)) {
parseKeyboardAttributes(parser);
startKeyboard();
parseKeyboardContent(parser, mKeyboard.getKeys());
break;
} else {
@ -520,25 +523,32 @@ public class KeyboardParser {
throw new NonEmptyTag(tag, parser);
}
private void startKeyboard() {
mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_top_padding);
}
private void startRow(Row row) {
mCurrentX = 0;
setSpacer(mHorizontalEdgesPadding);
mCurrentRow = row;
}
private void endRow() {
if (mCurrentRow == null)
throw new InflateException("orphant end row tag");
setSpacer(mHorizontalEdgesPadding);
if (mCurrentX > mMaxRowWidth)
mMaxRowWidth = mCurrentX;
mCurrentY += mCurrentRow.mDefaultHeight;
mCurrentRow = null;
}
private void endKey(Key key) {
mCurrentX += key.mGap + key.mWidth;
if (mCurrentX > mMaxRowWidth)
mMaxRowWidth = mCurrentX;
}
private void endKeyboard(int defaultVerticalGap) {
mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_bottom_padding);
mTotalHeight = mCurrentY - defaultVerticalGap;
}

View File

@ -1056,7 +1056,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
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
// 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.