aboutsummaryrefslogtreecommitdiffstats
path: root/java/res
diff options
context:
space:
mode:
Diffstat (limited to 'java/res')
-rw-r--r--java/res/layout/additional_subtype_dialog.xml8
-rw-r--r--java/res/values-v19/spinner-style.xml28
-rw-r--r--java/res/values/spinner-style.xml28
-rw-r--r--java/res/xml-sw600dp/key_styles_common.xml4
-rw-r--r--java/res/xml/key_styles_common.xml3
-rw-r--r--java/res/xml/key_styles_settings.xml9
6 files changed, 63 insertions, 17 deletions
diff --git a/java/res/layout/additional_subtype_dialog.xml b/java/res/layout/additional_subtype_dialog.xml
index b7804f5df..2de7d07a8 100644
--- a/java/res/layout/additional_subtype_dialog.xml
+++ b/java/res/layout/additional_subtype_dialog.xml
@@ -38,7 +38,6 @@
android:text="@string/subtype_locale" />
<Spinner
android:id="@+id/subtype_locale_spinner"
- android:spinnerMode="dialog"
android:layout_width="0dp"
android:layout_weight="70"
android:layout_height="wrap_content"
@@ -47,7 +46,8 @@
android:layout_marginTop="8dip"
android:layout_gravity="fill_horizontal|center_vertical"
android:gravity="start|left"
- android:prompt="@string/subtype_locale" />
+ android:prompt="@string/subtype_locale"
+ style="@style/additionalSubtypeSpinnerStyle" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
@@ -63,7 +63,6 @@
android:text="@string/keyboard_layout_set" />
<Spinner
android:id="@+id/keyboard_layout_set_spinner"
- android:spinnerMode="dialog"
android:layout_width="0dp"
android:layout_weight="70"
android:layout_height="wrap_content"
@@ -72,6 +71,7 @@
android:layout_marginTop="8dip"
android:layout_gravity="fill_horizontal|center_vertical"
android:gravity="start|left"
- android:prompt="@string/keyboard_layout_set" />
+ android:prompt="@string/keyboard_layout_set"
+ style="@style/additionalSubtypeSpinnerStyle" />
</LinearLayout>
</LinearLayout>
diff --git a/java/res/values-v19/spinner-style.xml b/java/res/values-v19/spinner-style.xml
new file mode 100644
index 000000000..7de59edf3
--- /dev/null
+++ b/java/res/values-v19/spinner-style.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Until KitKat (API 19), {@link android.widget.Spinner} of dialog mode in a Dialog can't
+ handle orientation change correctly. Using dropdown mode avoids the issue.
+ This file overrides values/spinner-style.xml on KitKat and newer device. -->
+ <style name="additionalSubtypeSpinnerStyle">
+ <item name="android:spinnerMode">dialog</item>
+ </style>
+</resources>
diff --git a/java/res/values/spinner-style.xml b/java/res/values/spinner-style.xml
new file mode 100644
index 000000000..4043ad49c
--- /dev/null
+++ b/java/res/values/spinner-style.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Until KitKat (API 19), {@link android.widget.Spinner} of dialog mode in a Dialog can't
+ handle orientation change correctly. Using dropdown mode avoids the issue.
+ This file is overridden by values-v19/spinner-style.xml on KitKat and newer device. -->
+ <style name="additionalSubtypeSpinnerStyle">
+ <item name="android:spinnerMode">dropdown</item>
+ </style>
+</resources>
diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml
index 006cda370..ea8f29250 100644
--- a/java/res/xml-sw600dp/key_styles_common.xml
+++ b/java/res/xml-sw600dp/key_styles_common.xml
@@ -35,10 +35,6 @@
latin:keyLabelFlags="hasShiftedLetterHint" />
</default>
</switch>
- <!-- Base key style for the key which may have settings key as more keys. -->
- <key-style
- latin:styleName="baseSettingsMoreKeysStyle"
- latin:parentStyle="hasShiftedLetterHintStyle" />
<include
latin:keyboardLayout="@xml/key_styles_settings" />
<!-- Functional key styles -->
diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml
index b36ddf236..d85438d99 100644
--- a/java/res/xml/key_styles_common.xml
+++ b/java/res/xml/key_styles_common.xml
@@ -35,9 +35,6 @@
latin:keyLabelFlags="hasShiftedLetterHint" />
</default>
</switch>
- <!-- Base key style for the key which may have settings key as more keys. -->
- <key-style
- latin:styleName="baseSettingsMoreKeysStyle" />
<include
latin:keyboardLayout="@xml/key_styles_settings" />
<!-- Functional key styles -->
diff --git a/java/res/xml/key_styles_settings.xml b/java/res/xml/key_styles_settings.xml
index a504bed78..43ee601e6 100644
--- a/java/res/xml/key_styles_settings.xml
+++ b/java/res/xml/key_styles_settings.xml
@@ -21,16 +21,14 @@
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
- <!-- Base key style for the key which may have settings key as more keys. -->
- <!-- Kept as a separate file for cleaner overriding by an overlay. -->
+ <!-- Key style for the key which may have settings key as more keys. -->
<switch>
<case
latin:clobberSettingsKey="true"
>
<key-style
latin:styleName="settingsMoreKeysStyle"
- latin:backgroundType="functional"
- latin:parentStyle="baseSettingsMoreKeysStyle" />
+ latin:backgroundType="functional" />
</case>
<!-- clobberSettingsKey="false" -->
<default>
@@ -38,8 +36,7 @@
latin:styleName="settingsMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="!text/keyspec_settings"
- latin:backgroundType="functional"
- latin:parentStyle="baseSettingsMoreKeysStyle" />
+ latin:backgroundType="functional" />
</default>
</switch>
</merge>