diff options
-rw-r--r-- | java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png | bin | 0 -> 1003 bytes | |||
-rw-r--r-- | java/res/drawable/btn_candidate_holo.xml | 27 | ||||
-rw-r--r-- | java/res/layout-xlarge/candidate.xml | 60 | ||||
-rw-r--r-- | java/res/layout-xlarge/candidate_preview.xml | 29 | ||||
-rw-r--r-- | java/res/layout-xlarge/candidates.xml | 45 | ||||
-rw-r--r-- | java/res/values-xlarge-land/dimens.xml | 12 | ||||
-rw-r--r-- | java/res/values-xlarge/dimens.xml | 6 | ||||
-rw-r--r-- | java/res/values/dimens.xml | 2 | ||||
-rw-r--r-- | java/res/xml/method.xml | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardView.java | 5 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/CandidateView.java | 1 |
11 files changed, 183 insertions, 6 deletions
diff --git a/java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png b/java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png Binary files differnew file mode 100644 index 000000000..bb58f00d0 --- /dev/null +++ b/java/res/drawable-mdpi/keyboard_suggest_strip_holo.9.png diff --git a/java/res/drawable/btn_candidate_holo.xml b/java/res/drawable/btn_candidate_holo.xml new file mode 100644 index 000000000..66cd2460b --- /dev/null +++ b/java/res/drawable/btn_candidate_holo.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<selector + xmlns:android="http://schemas.android.com/apk/res/android" +> + <item + android:state_pressed="true" + android:drawable="@drawable/btn_keyboard_key_popup_selected_holo" /> +</selector> diff --git a/java/res/layout-xlarge/candidate.xml b/java/res/layout-xlarge/candidate.xml new file mode 100644 index 000000000..74532a1e2 --- /dev/null +++ b/java/res/layout-xlarge/candidate.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="@dimen/candidate_strip_height" + android:orientation="horizontal" + android:paddingRight="@dimen/candidate_padding" +> + <ImageView + android:id="@+id/candidate_divider" + android:layout_width="wrap_content" + android:layout_height="@dimen/candidate_strip_height" + android:visibility="gone" + android:focusable="false" + android:clickable="false" + android:src="@drawable/keyboard_suggest_strip_divider" + android:gravity="center_vertical|center_horizontal" /> + <Button + android:id="@+id/candidate_word" + android:layout_width="wrap_content" + android:layout_height="@dimen/candidate_strip_height" + android:minWidth="@dimen/candidate_min_width" + android:textSize="@dimen/candidate_text_size" + android:textColor="@color/candidate_normal" + android:background="@drawable/btn_candidate_holo" + android:focusable="true" + android:clickable="true" + android:gravity="center_vertical|center_horizontal" + android:paddingLeft="@dimen/candidate_padding" /> + <TextView + android:id="@+id/candidate_debug_info" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" + android:textSize="10dip" + android:textColor="#ff808080" + android:focusable="false" + android:clickable="false" + android:gravity="bottom" + android:paddingLeft="4dip" /> +</LinearLayout> diff --git a/java/res/layout-xlarge/candidate_preview.xml b/java/res/layout-xlarge/candidate_preview.xml new file mode 100644 index 000000000..61d5f8e7b --- /dev/null +++ b/java/res/layout-xlarge/candidate_preview.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="18sp" + android:textColor="?android:attr/textColorPrimaryInverse" + android:minWidth="32dip" + android:gravity="center" + android:background="@drawable/keyboard_popup_panel_background_holo" /> diff --git a/java/res/layout-xlarge/candidates.xml b/java/res/layout-xlarge/candidates.xml new file mode 100644 index 000000000..e2ddb84b1 --- /dev/null +++ b/java/res/layout-xlarge/candidates.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="@dimen/candidate_strip_height" + android:background="@drawable/keyboard_suggest_strip_holo" + android:paddingRight="@dimen/candidate_strip_padding" + android:paddingLeft="@dimen/candidate_strip_padding" +> + <HorizontalScrollView + android:id="@+id/candidates_scroll_view" + android:layout_width="wrap_content" + android:layout_height="@dimen/candidate_strip_height" + android:fadingEdge="horizontal" + android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length" + android:scrollbars="none" + > + <com.android.inputmethod.latin.CandidateView + android:id="@+id/candidates" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="@dimen/candidate_strip_height" + android:background="@drawable/keyboard_suggest_strip_holo" /> + </HorizontalScrollView> +</LinearLayout> diff --git a/java/res/values-xlarge-land/dimens.xml b/java/res/values-xlarge-land/dimens.xml index 5b9d50abc..8737caef6 100644 --- a/java/res/values-xlarge-land/dimens.xml +++ b/java/res/values-xlarge-land/dimens.xml @@ -19,6 +19,18 @@ --> <resources> + <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> + <dimen name="keyboardHeight">58.0mm</dimen> + <!-- key_height + key_bottom_gap = popup_key_height --> + <!-- <dimen name="key_height">14.5mm</dimen> --> + <dimen name="key_bottom_gap">0.0mm</dimen> + <dimen name="key_horizontal_gap">0.0mm</dimen> + <dimen name="popup_key_height">13.0mm</dimen> + <dimen name="keyboard_top_padding">0.0mm</dimen> + <dimen name="keyboard_bottom_padding">0.0mm</dimen> + <!-- key_height x 1.0 --> + <dimen name="key_preview_height">13.0mm</dimen> + <dimen name="key_letter_size">28dip</dimen> <dimen name="key_label_text_size">20dip</dimen> <!-- left or right padding of label alignment --> diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml index 07d5f09bd..7969b7672 100644 --- a/java/res/values-xlarge/dimens.xml +++ b/java/res/values-xlarge/dimens.xml @@ -20,12 +20,12 @@ <resources> <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> - <dimen name="keyboardHeight">58.0mm</dimen> + <dimen name="keyboardHeight">48.0mm</dimen> <!-- key_height + key_bottom_gap = popup_key_height --> -<!-- <dimen name="key_height">14.5mm</dimen>--> + <!-- <dimen name="key_height">14.5mm</dimen> --> <dimen name="key_bottom_gap">0.0mm</dimen> <dimen name="key_horizontal_gap">0.0mm</dimen> - <dimen name="popup_key_height">13.0mm</dimen> + <dimen name="popup_key_height">10.0mm</dimen> <dimen name="keyboard_top_padding">0.0mm</dimen> <dimen name="keyboard_bottom_padding">0.0mm</dimen> <!-- key_height x 1.0 --> diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 41d638440..cf2019ff8 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -22,7 +22,7 @@ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> <dimen name="keyboardHeight">1.265in</dimen> <!-- key_height + key_bottom_gap = popup_key_height --> -<!-- <dimen name="key_height">0.290in</dimen>--> + <!-- <dimen name="key_height">0.290in</dimen> --> <dimen name="key_bottom_gap">0.035in</dimen> <dimen name="key_horizontal_gap">0.000in</dimen> <dimen name="popup_key_height">0.325in</dimen> diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index a38182197..482b35f4c 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -29,7 +29,7 @@ android:isDefault="@bool/im_is_default"> <!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default subtype.--> - <subtype android:icon="@drawable/ic_subtype_keyboard_en_us" + <subtype android:icon="@drawable/ic_subtype_keyboard_en_gb" android:label="@string/subtype_mode_en_US_keyboard" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 70267a7ff..4a3a58b94 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -174,7 +174,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // This map caches key label text height in pixel as value and key label text size as map key. private final HashMap<Integer, Integer> mTextHeightCache = new HashMap<Integer, Integer>(); // Distance from horizontal center of the key, proportional to key label text height and width. - private final float KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER = 0.55f; + private final float KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER = 0.45f; private final float KEY_LABEL_VERTICAL_PADDING_FACTOR = 1.60f; private final String KEY_LABEL_REFERENCE_CHAR = "H"; private final int KEY_LABEL_OPTION_ALIGN_LEFT = 1; @@ -727,6 +727,9 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { final float centerY = (key.mHeight + padding.top - padding.bottom) / 2; baseline = centerY + labelCharHeight * KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER; + if (DEBUG_SHOW_ALIGN) + drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000, + new Paint()); } // Horizontal label text alignment final int positionX; diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 784077a76..3f47ea370 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -282,6 +282,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo return; final TextView previewText = mPreviewText; + previewText.setTextColor(mColorNormal); previewText.setText(word); previewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); |