Fix popup key preview on tablet

This change temporally enable popup key preview option on
tablet. (config_enable_show_popup_on_keypress_option).

Bug: 3286117
Change-Id: Iabbac5a333460e1ed2f8d05ba82f4bae81854b85
main
Tadashi G. Takaoka 2011-04-06 13:54:37 +09:00
parent 3b24b2bde7
commit da4bfbbbb3
16 changed files with 39 additions and 75 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -16,6 +16,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_long_pressable="true" <item android:state_long_pressable="true"
android:drawable="@drawable/keyboard_key_feedback_more_background" /> android:drawable="@drawable/keyboard_key_feedback_more_background_holo" />
<item android:drawable="@drawable/keyboard_key_feedback_background_holo" /> <item android:drawable="@drawable/keyboard_key_feedback_background_holo" />
</selector> </selector>

View File

@ -1,41 +0,0 @@
<?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="wrap_content"
android:orientation="horizontal"
android:background="@drawable/keyboard_popup_panel_background_holo"
android:paddingLeft="40dip"
android:paddingRight="40dip"
>
<com.android.inputmethod.keyboard.KeyboardView
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
android:id="@+id/KeyboardView"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/latinkeyboard_transparent"
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup"
latin:keyHysteresisDistance="0dip"
latin:verticalCorrection="@dimen/mini_keyboard_vertical_correction"
/>
</LinearLayout>

View File

@ -31,6 +31,8 @@
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb" latin:keyBackground="@drawable/btn_keyboard_key_honeycomb"
latin:keyPreviewLayout="@layout/key_preview_honeycomb" latin:keyPreviewLayout="@layout/key_preview_honeycomb"
latin:keyPreviewHeight="@dimen/key_preview_height_holo"
latin:keyPreviewOffset="@dimen/key_preview_offset_holo"
latin:popupLayout="@layout/keyboard_popup_honeycomb" latin:popupLayout="@layout/keyboard_popup_honeycomb"
latin:keyTextColorDisabled="#FF63666D" latin:keyTextColorDisabled="#FF63666D"
latin:keyLetterStyle="bold" latin:keyLetterStyle="bold"

View File

@ -23,7 +23,7 @@
android:layout_height="80sp" android:layout_height="80sp"
android:textSize="40sp" android:textSize="40sp"
android:textColor="@color/latinkeyboard_key_color_white" android:textColor="@color/latinkeyboard_key_color_white"
android:minWidth="24dip" android:minWidth="32dip"
android:gravity="center" android:gravity="center"
android:background="@drawable/keyboard_key_feedback_honeycomb" android:background="@drawable/keyboard_key_feedback_honeycomb"
/> />

View File

@ -19,20 +19,19 @@
--> -->
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/keyboard_popup_panel_background" android:background="@drawable/keyboard_popup_panel_background"
android:paddingLeft="16dip" android:paddingLeft="@dimen/mini_keyboard_horizontal_padding"
android:paddingRight="16dip" android:paddingRight="@dimen/mini_keyboard_horizontal_padding"
> >
<com.android.inputmethod.keyboard.KeyboardView <com.android.inputmethod.keyboard.KeyboardView
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/KeyboardView" android:id="@+id/KeyboardView"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/latinkeyboard_transparent"
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread_popup" latin:keyBackground="@drawable/btn_keyboard_key_gingerbread_popup"
latin:keyHysteresisDistance="0dip" latin:keyHysteresisDistance="0dip"

View File

@ -19,20 +19,19 @@
--> -->
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@drawable/keyboard_popup_panel_background_holo" android:background="@drawable/keyboard_popup_panel_background_holo"
android:paddingLeft="24dip" android:paddingLeft="@dimen/mini_keyboard_horizontal_padding_holo"
android:paddingRight="24dip" android:paddingRight="@dimen/mini_keyboard_horizontal_padding_holo"
> >
<com.android.inputmethod.keyboard.KeyboardView <com.android.inputmethod.keyboard.KeyboardView
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/KeyboardView" android:id="@+id/KeyboardView"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/latinkeyboard_transparent"
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup" latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup"
latin:keyHysteresisDistance="0dip" latin:keyHysteresisDistance="0dip"

View File

@ -19,7 +19,7 @@
--> -->
<resources> <resources>
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=14.5mm -->
<dimen name="keyboardHeight">58.0mm</dimen> <dimen name="keyboardHeight">58.0mm</dimen>
<!-- key_height + key_bottom_gap = popup_key_height --> <!-- key_height + key_bottom_gap = popup_key_height -->
<!-- <dimen name="key_height">14.5mm</dimen> --> <!-- <dimen name="key_height">14.5mm</dimen> -->
@ -28,12 +28,13 @@
<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>
<!-- key_height x 1.0 -->
<dimen name="key_preview_height">13.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>
<!-- left or right padding of label alignment --> <!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">18dip</dimen> <dimen name="key_label_horizontal_alignment_padding">18dip</dimen>
<dimen name="key_preview_height_holo">26.5mm</dimen>
<dimen name="key_preview_offset_holo">7.5mm</dimen>
<dimen name="candidate_strip_padding">40.0mm</dimen> <dimen name="candidate_strip_padding">40.0mm</dimen>
</resources> </resources>

View File

@ -22,7 +22,8 @@
<bool name="config_enable_show_settings_key_option">false</bool> <bool name="config_enable_show_settings_key_option">false</bool>
<bool name="config_enable_show_subtype_settings">false</bool> <bool name="config_enable_show_subtype_settings">false</bool>
<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_popup_on_keypress_option">false</bool> <!-- TODO: This configuration value is temporary set true to check popup preview behavior. -->
<bool name="config_enable_show_popup_on_keypress_option">true</bool>
<bool name="config_enable_show_recorrection_option">false</bool> <bool name="config_enable_show_recorrection_option">false</bool>
<bool name="config_enable_quick_fixes_option">false</bool> <bool name="config_enable_quick_fixes_option">false</bool>
<bool name="config_enable_bigram_suggestions_option">false</bool> <bool name="config_enable_bigram_suggestions_option">false</bool>

View File

@ -19,7 +19,7 @@
--> -->
<resources> <resources>
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=12mm -->
<dimen name="keyboardHeight">48.0mm</dimen> <dimen name="keyboardHeight">48.0mm</dimen>
<!-- key_height + key_bottom_gap = popup_key_height --> <!-- key_height + key_bottom_gap = popup_key_height -->
<!-- <dimen name="key_height">14.5mm</dimen> --> <!-- <dimen name="key_height">14.5mm</dimen> -->
@ -28,8 +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>
<!-- key_height x 1.0 --> <dimen name="mini_keyboard_horizontal_padding_holo">40dip</dimen>
<dimen name="key_preview_height">13.0mm</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. -->
<!-- popup_key_height x 1.2 --> <!-- popup_key_height x 1.2 -->
@ -39,9 +38,11 @@
<dimen name="key_letter_size">26dip</dimen> <dimen name="key_letter_size">26dip</dimen>
<dimen name="key_label_text_size">16dip</dimen> <dimen name="key_label_text_size">16dip</dimen>
<dimen name="key_preview_text_size_large">24dip</dimen>
<!-- left or right padding of label alignment --> <!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">6dip</dimen> <dimen name="key_label_horizontal_alignment_padding">6dip</dimen>
<dimen name="key_preview_text_size_large">24dip</dimen>
<dimen name="key_preview_height_holo">23.0mm</dimen>
<dimen name="key_preview_offset_holo">8.0mm</dimen>
<dimen name="candidate_strip_height">46dip</dimen> <dimen name="candidate_strip_height">46dip</dimen>
<dimen name="candidate_strip_padding">15.0mm</dimen> <dimen name="candidate_strip_padding">15.0mm</dimen>

View File

@ -21,7 +21,6 @@
<color name="candidate_normal">#FFFFFFFF</color> <color name="candidate_normal">#FFFFFFFF</color>
<color name="candidate_recommended">#FFFCAE00</color> <color name="candidate_recommended">#FFFCAE00</color>
<color name="candidate_other">#FFFCAE00</color> <color name="candidate_other">#FFFCAE00</color>
<color name="latinkeyboard_transparent">#00000000</color>
<color name="latinkeyboard_bar_language_shadow_white">#80000000</color> <color name="latinkeyboard_bar_language_shadow_white">#80000000</color>
<color name="latinkeyboard_bar_language_shadow_black">#80FFFFFF</color> <color name="latinkeyboard_bar_language_shadow_black">#80FFFFFF</color>
<color name="latinkeyboard_bar_language_text">#FFC0C0C0</color> <color name="latinkeyboard_bar_language_text">#FFC0C0C0</color>

View File

@ -19,7 +19,7 @@
--> -->
<resources> <resources>
<!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=0.290in -->
<dimen name="keyboardHeight">1.265in</dimen> <dimen name="keyboardHeight">1.265in</dimen>
<!-- key_height + key_bottom_gap = popup_key_height --> <!-- key_height + key_bottom_gap = popup_key_height -->
<!-- <dimen name="key_height">0.290in</dimen> --> <!-- <dimen name="key_height">0.290in</dimen> -->
@ -28,25 +28,28 @@
<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>
<!-- key_preview_text_size_large x 2 --> <dimen name="mini_keyboard_horizontal_padding">16dip</dimen>
<dimen name="key_preview_height">80sp</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>
<!-- 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. -->
<!-- popup_key_height x 1.2 --> <!-- popup_key_height x 1.2 -->
<dimen name="mini_keyboard_slide_allowance">0.390in</dimen> <dimen name="mini_keyboard_slide_allowance">0.390in</dimen>
<!-- popup_key_height x -1.0 --> <!-- popup_key_height x -1.0 -->
<dimen name="mini_keyboard_vertical_correction">-0.325in</dimen> <dimen name="mini_keyboard_vertical_correction">-0.325in</dimen>
<dimen name="key_letter_size">0.13in</dimen>
<dimen name="key_label_text_size">0.083in</dimen>
<dimen name="key_preview_text_size_large">40sp</dimen>
<!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">0.13in</dimen>
<dimen name="key_preview_offset">0.000in</dimen>
<!-- We use "inch", not "dip" because this value tries dealing with physical distance related <!-- We use "inch", not "dip" because this value tries dealing with physical distance related
to user's finger. --> to user's finger. -->
<dimen name="keyboard_vertical_correction">-0.05in</dimen> <dimen name="keyboard_vertical_correction">-0.05in</dimen>
<dimen name="key_letter_size">0.13in</dimen>
<dimen name="key_label_text_size">0.083in</dimen>
<!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">0.13in</dimen>
<dimen name="key_preview_height">80sp</dimen>
<dimen name="key_preview_offset">0.000in</dimen>
<dimen name="key_preview_text_size_large">36sp</dimen>
<dimen name="key_preview_height_holo">130sp</dimen>
<dimen name="key_preview_offset_holo">0.193in</dimen>
<dimen name="candidate_strip_height">42dip</dimen> <dimen name="candidate_strip_height">42dip</dimen>
<dimen name="candidate_strip_fading_edge_length">63dip</dimen> <dimen name="candidate_strip_fading_edge_length">63dip</dimen>
<dimen name="candidate_strip_padding">0dip</dimen> <dimen name="candidate_strip_padding">0dip</dimen>

View File

@ -37,7 +37,6 @@ import android.graphics.drawable.Drawable;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.os.SystemClock; import android.os.SystemClock;
import android.provider.Settings;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
@ -378,6 +377,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
} }
mPreviewPopup.setTouchable(false); mPreviewPopup.setTouchable(false);
mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation); mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
mPreviewPopup.setClippingEnabled(false);
mDelayBeforePreview = res.getInteger(R.integer.config_delay_before_preview); mDelayBeforePreview = res.getInteger(R.integer.config_delay_before_preview);
mDelayAfterPreview = res.getInteger(R.integer.config_delay_after_preview); mDelayAfterPreview = res.getInteger(R.integer.config_delay_after_preview);
mKeyLabelHorizontalPadding = (int)res.getDimension( mKeyLabelHorizontalPadding = (int)res.getDimension(

View File

@ -229,7 +229,7 @@ public class LatinKeyboard extends Keyboard {
final Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); final Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(buffer); final Canvas canvas = new Canvas(buffer);
final Resources res = mContext.getResources(); final Resources res = mContext.getResources();
canvas.drawColor(res.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR); canvas.drawColor(res.getColor(android.R.color.transparent), PorterDuff.Mode.CLEAR);
SubtypeSwitcher subtypeSwitcher = SubtypeSwitcher.getInstance(); SubtypeSwitcher subtypeSwitcher = SubtypeSwitcher.getInstance();
// If application locales are explicitly selected. // If application locales are explicitly selected.

View File

@ -63,7 +63,7 @@ public class SlidingLocaleDrawable extends Drawable {
mHeight = height; mHeight = height;
final TextPaint textPaint = new TextPaint(); final TextPaint textPaint = new TextPaint();
textPaint.setTextSize(getTextSizeFromTheme(android.R.style.TextAppearance_Medium, 18)); textPaint.setTextSize(getTextSizeFromTheme(android.R.style.TextAppearance_Medium, 18));
textPaint.setColor(R.color.latinkeyboard_transparent); textPaint.setColor(android.R.color.transparent);
textPaint.setTextAlign(Align.CENTER); textPaint.setTextAlign(Align.CENTER);
textPaint.setAlpha(LatinKeyboard.OPACITY_FULLY_OPAQUE); textPaint.setAlpha(LatinKeyboard.OPACITY_FULLY_OPAQUE);
textPaint.setAntiAlias(true); textPaint.setAntiAlias(true);