Loading java/res/drawable/transparent.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** ** Copyright 2011, 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. */ --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="@android:color/transparent" /> <size android:width="50dp" android:height="40dp" /> </shape> java/res/values/keyboard-icons-ics.xml +3 −3 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ <item name="iconNum0Key">@drawable/sym_keyboard_num0</item> <!-- <item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked_holo</item> --> <item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked</item> <item name="iconPreviewSpaceKey">@drawable/sym_keyboard_space_holo</item> <item name="iconPreviewSpaceKey">@drawable/transparent</item> <!-- <item name="iconPreviewTabKey">@drawable/sym_keyboard_tab_holo</item> --> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> <!-- <item name="iconPreviewSettingsKey">@drawable/sym_keyboard_settings_holo</item> --> Loading @@ -72,7 +72,7 @@ <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> <item name="spacebarArrowLeftIcon">@drawable/sym_keyboard_language_arrows_left</item> <item name="spacebarArrowRightIcon">@drawable/sym_keyboard_language_arrows_right</item> <item name="spacebarArrowPreviewLeftIcon">@drawable/sym_keyboard_feedback_language_arrows_left</item> <item name="spacebarArrowPreviewRightIcon">@drawable/sym_keyboard_feedback_language_arrows_right</item> <!-- <item name="spacebarArrowPreviewLeftIcon">@drawable/sym_keyboard_feedback_language_arrows_left</item> --> <!-- <item name="spacebarArrowPreviewRightIcon">@drawable/sym_keyboard_feedback_language_arrows_right</item> --> </style> </resources> java/src/com/android/inputmethod/keyboard/KeyboardView.java +7 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Key preview private boolean mInForeground; private TextView mPreviewText; private Drawable mPreviewBackground; private float mPreviewTextRatio; private int mPreviewTextSize; private boolean mShowKeyPreviewPopup = true; Loading Loading @@ -357,6 +358,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { if (previewLayout != 0) { mPreviewText = (TextView) LayoutInflater.from(context).inflate(previewLayout, null); mPreviewBackground = mPreviewText.getBackground(); mPreviewTextRatio = getRatio(res, R.fraction.key_preview_text_ratio); } else { mShowKeyPreviewPopup = false; Loading Loading @@ -982,6 +984,11 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { previewIcon != null ? previewIcon : key.getIcon()); previewText.setText(null); } if (key.mCode == Keyboard.CODE_SPACE) { previewText.setBackgroundColor(Color.TRANSPARENT); } else { previewText.setBackgroundDrawable(mPreviewBackground); } // Set the preview background state previewText.getBackground().setState( key.mPopupCharacters != null ? LONG_PRESSABLE_STATE_SET : EMPTY_STATE_SET); Loading java/src/com/android/inputmethod/keyboard/internal/SlidingLocaleDrawable.java +9 −7 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class SlidingLocaleDrawable extends Drawable { public SlidingLocaleDrawable(Context context, Drawable background, int width, int height) { mBackground = background; Keyboard.setDefaultBounds(mBackground); Keyboard.setDefaultBounds(background); mWidth = width; mHeight = height; final TextPaint textPaint = new TextPaint(); Loading @@ -68,7 +68,7 @@ public class SlidingLocaleDrawable extends Drawable { textPaint.setTextAlign(Align.CENTER); textPaint.setAntiAlias(true); mTextPaint = textPaint; mMiddleX = (mWidth - mBackground.getIntrinsicWidth()) / 2; mMiddleX = (background != null) ? (mWidth - mBackground.getIntrinsicWidth()) / 2 : 0; final TypedArray a = context.obtainStyledAttributes( null, R.styleable.LatinKeyboard, R.attr.latinKeyboardStyle, R.style.LatinKeyboard); Loading Loading @@ -119,12 +119,14 @@ public class SlidingLocaleDrawable extends Drawable { canvas.drawText(mNextLanguage, diff - width / 2, baseline, paint); canvas.drawText(mPrevLanguage, diff + width + width / 2, baseline, paint); if (lArrow != null && rArrow != null) { Keyboard.setDefaultBounds(lArrow); rArrow.setBounds(width - rArrow.getIntrinsicWidth(), 0, width, rArrow.getIntrinsicHeight()); lArrow.draw(canvas); rArrow.draw(canvas); } } if (mBackground != null) { canvas.translate(mMiddleX, 0); mBackground.draw(canvas); Loading Loading
java/res/drawable/transparent.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** ** Copyright 2011, 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. */ --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="@android:color/transparent" /> <size android:width="50dp" android:height="40dp" /> </shape>
java/res/values/keyboard-icons-ics.xml +3 −3 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ <item name="iconNum0Key">@drawable/sym_keyboard_num0</item> <!-- <item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked_holo</item> --> <item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked</item> <item name="iconPreviewSpaceKey">@drawable/sym_keyboard_space_holo</item> <item name="iconPreviewSpaceKey">@drawable/transparent</item> <!-- <item name="iconPreviewTabKey">@drawable/sym_keyboard_tab_holo</item> --> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> <!-- <item name="iconPreviewSettingsKey">@drawable/sym_keyboard_settings_holo</item> --> Loading @@ -72,7 +72,7 @@ <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> <item name="spacebarArrowLeftIcon">@drawable/sym_keyboard_language_arrows_left</item> <item name="spacebarArrowRightIcon">@drawable/sym_keyboard_language_arrows_right</item> <item name="spacebarArrowPreviewLeftIcon">@drawable/sym_keyboard_feedback_language_arrows_left</item> <item name="spacebarArrowPreviewRightIcon">@drawable/sym_keyboard_feedback_language_arrows_right</item> <!-- <item name="spacebarArrowPreviewLeftIcon">@drawable/sym_keyboard_feedback_language_arrows_left</item> --> <!-- <item name="spacebarArrowPreviewRightIcon">@drawable/sym_keyboard_feedback_language_arrows_right</item> --> </style> </resources>
java/src/com/android/inputmethod/keyboard/KeyboardView.java +7 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Key preview private boolean mInForeground; private TextView mPreviewText; private Drawable mPreviewBackground; private float mPreviewTextRatio; private int mPreviewTextSize; private boolean mShowKeyPreviewPopup = true; Loading Loading @@ -357,6 +358,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { if (previewLayout != 0) { mPreviewText = (TextView) LayoutInflater.from(context).inflate(previewLayout, null); mPreviewBackground = mPreviewText.getBackground(); mPreviewTextRatio = getRatio(res, R.fraction.key_preview_text_ratio); } else { mShowKeyPreviewPopup = false; Loading Loading @@ -982,6 +984,11 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { previewIcon != null ? previewIcon : key.getIcon()); previewText.setText(null); } if (key.mCode == Keyboard.CODE_SPACE) { previewText.setBackgroundColor(Color.TRANSPARENT); } else { previewText.setBackgroundDrawable(mPreviewBackground); } // Set the preview background state previewText.getBackground().setState( key.mPopupCharacters != null ? LONG_PRESSABLE_STATE_SET : EMPTY_STATE_SET); Loading
java/src/com/android/inputmethod/keyboard/internal/SlidingLocaleDrawable.java +9 −7 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class SlidingLocaleDrawable extends Drawable { public SlidingLocaleDrawable(Context context, Drawable background, int width, int height) { mBackground = background; Keyboard.setDefaultBounds(mBackground); Keyboard.setDefaultBounds(background); mWidth = width; mHeight = height; final TextPaint textPaint = new TextPaint(); Loading @@ -68,7 +68,7 @@ public class SlidingLocaleDrawable extends Drawable { textPaint.setTextAlign(Align.CENTER); textPaint.setAntiAlias(true); mTextPaint = textPaint; mMiddleX = (mWidth - mBackground.getIntrinsicWidth()) / 2; mMiddleX = (background != null) ? (mWidth - mBackground.getIntrinsicWidth()) / 2 : 0; final TypedArray a = context.obtainStyledAttributes( null, R.styleable.LatinKeyboard, R.attr.latinKeyboardStyle, R.style.LatinKeyboard); Loading Loading @@ -119,12 +119,14 @@ public class SlidingLocaleDrawable extends Drawable { canvas.drawText(mNextLanguage, diff - width / 2, baseline, paint); canvas.drawText(mPrevLanguage, diff + width + width / 2, baseline, paint); if (lArrow != null && rArrow != null) { Keyboard.setDefaultBounds(lArrow); rArrow.setBounds(width - rArrow.getIntrinsicWidth(), 0, width, rArrow.getIntrinsicHeight()); lArrow.draw(canvas); rArrow.draw(canvas); } } if (mBackground != null) { canvas.translate(mMiddleX, 0); mBackground.draw(canvas); Loading