Add a new theme for Gingerbread

bug: 2959293

Change-Id: I8aef19a7485ffd5639a177aee21103b3a1e04cf2
main
satok 2010-09-01 15:45:20 +09:00
parent c7c6203f33
commit 31adfa78e2
7 changed files with 130 additions and 9 deletions

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 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">
<!-- Toggle keys. Use checkable/checked state. -->
<item android:state_checkable="true" android:state_checked="true"
android:state_pressed="true"
android:drawable="@drawable/btn_keyboard_key_dark_pressed_on" />
<item android:state_checkable="true" android:state_pressed="true"
android:drawable="@drawable/btn_keyboard_key_dark_pressed_off" />
<item android:state_checkable="true" android:state_checked="true"
android:drawable="@drawable/btn_keyboard_key_dark_normal_on" />
<item android:state_checkable="true"
android:drawable="@drawable/btn_keyboard_key_dark_normal_off" />
<!-- Normal keys -->
<item android:state_pressed="true"
android:drawable="@drawable/btn_keyboard_key_light_pressed" />
<item android:drawable="@drawable/btn_keyboard_key_light_normal" />
</selector>

View File

@ -0,0 +1,33 @@
<?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.
*/
-->
<com.android.inputmethod.latin.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:background="@drawable/keyboard_dark_background"
android:textStyle="bold"
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
latin:keyTextStyle="bold"
/>

View File

@ -0,0 +1,48 @@
<?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"
>
<com.android.inputmethod.latin.LatinKeyboardBaseView
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:background="@drawable/keyboard_dark_background"
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
latin:popupLayout="@layout/input_gingerbread_popup"
/>
<ImageButton android:id="@+id/closeButton"
android:background="@android:color/transparent"
android:src="@drawable/btn_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:clickable="true"
/>
</LinearLayout>

View File

@ -18,9 +18,9 @@
*/ */
--> -->
<resources> <resources>
<color name="candidate_normal">#FF000000</color> <color name="candidate_normal">#FFFFFFFF</color>
<color name="candidate_recommended">#FFE35900</color> <color name="candidate_recommended">#FFF07020</color>
<color name="candidate_other">#ff808080</color> <color name="candidate_other">#ffB05010</color>
<color name="latinkeyboard_transparent">#00000000</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>

View File

@ -337,17 +337,20 @@
<!-- Description for enabling to send user statistics to Google. --> <!-- Description for enabling to send user statistics to Google. -->
<string name="prefs_description_log">Help improve this input method editor by automatically sending usage statistics and crash reports to Google.</string> <string name="prefs_description_log">Help improve this input method editor by automatically sending usage statistics and crash reports to Google.</string>
<!-- Description for keyboard theme switcher -->
<string name="keyboard_layout">Keyboard Theme</string> <string name="keyboard_layout">Keyboard Theme</string>
<string name="layout_basic" translatable="false">Basic</string> <string name="layout_basic" translatable="false">Basic</string>
<string name="layout_high_contrast" translatable="false">Basic (High Contrast)</string> <string name="layout_high_contrast" translatable="false">Basic (High Contrast)</string>
<string name="layout_stone_bold" translatable="false">Default (bold)</string> <string name="layout_stone_bold" translatable="false">Stone (bold)</string>
<string name="layout_stone_normal" translatable="false">Default (normal)</string> <string name="layout_stone_normal" translatable="false">Stone (normal)</string>
<string name="layout_gingerbread" translatable="false">Gingerbread</string>
<string-array name="keyboard_layout_modes" translatable="false"> <string-array name="keyboard_layout_modes" translatable="false">
<item>@string/layout_basic</item> <item>@string/layout_basic</item>
<item>@string/layout_high_contrast</item> <item>@string/layout_high_contrast</item>
<item>@string/layout_stone_normal</item> <item>@string/layout_stone_normal</item>
<item>@string/layout_stone_bold</item> <item>@string/layout_stone_bold</item>
<item>@string/layout_gingerbread</item>
</string-array> </string-array>
<string-array name="keyboard_layout_modes_values" translatable="false"> <string-array name="keyboard_layout_modes_values" translatable="false">
@ -355,6 +358,7 @@
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
<item>3</item> <item>3</item>
<item>4</item>
</string-array> </string-array>
<string name="subtype_mode_keyboard">keyboard</string> <string name="subtype_mode_keyboard">keyboard</string>

View File

@ -67,7 +67,7 @@
android:persistent="true" android:persistent="true"
android:entryValues="@array/keyboard_layout_modes_values" android:entryValues="@array/keyboard_layout_modes_values"
android:entries="@array/keyboard_layout_modes" android:entries="@array/keyboard_layout_modes"
android:defaultValue="3" android:defaultValue="4"
/> />
<PreferenceScreen <PreferenceScreen

View File

@ -44,11 +44,11 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
public static final int KEYBOARDMODE_IM = R.id.mode_im; public static final int KEYBOARDMODE_IM = R.id.mode_im;
public static final int KEYBOARDMODE_WEB = R.id.mode_webentry; public static final int KEYBOARDMODE_WEB = R.id.mode_webentry;
public static final String DEFAULT_LAYOUT_ID = "3"; public static final String DEFAULT_LAYOUT_ID = "4";
public static final String PREF_KEYBOARD_LAYOUT = "keyboard_layout"; public static final String PREF_KEYBOARD_LAYOUT = "keyboard_layout";
private static final int[] THEMES = new int [] { private static final int[] THEMES = new int [] {
R.layout.input_basic, R.layout.input_basic_highcontrast, R.layout.input_stone_normal, R.layout.input_basic, R.layout.input_basic_highcontrast, R.layout.input_stone_normal,
R.layout.input_stone_bold}; R.layout.input_stone_bold, R.layout.input_gingerbread};
// Ids for each characters' color in the keyboard // Ids for each characters' color in the keyboard
private static final int CHAR_THEME_COLOR_WHITE = 0; private static final int CHAR_THEME_COLOR_WHITE = 0;