aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/res/xml
diff options
context:
space:
mode:
authorRyan Hansberry <hansberry@google.com>2015-09-17 11:48:30 -0700
committerRyan Hansberry <hansberry@google.com>2015-09-17 11:48:30 -0700
commitf8a77f6d7ee4e8093525a9c5da4bb80fa41a1e72 (patch)
tree62f466b63477651d74b97155a13cd34bc3d70ff5 /app/src/main/res/xml
parent3de02e7a17b930500c3203f6b19c473d837d2572 (diff)
downloadconnectbot-f8a77f6d7ee4e8093525a9c5da4bb80fa41a1e72.tar.gz
connectbot-f8a77f6d7ee4e8093525a9c5da4bb80fa41a1e72.tar.bz2
connectbot-f8a77f6d7ee4e8093525a9c5da4bb80fa41a1e72.zip
Make APIv14 and above use SwitchPreference, and below use custom SwitchCompatPreference.
Created API-v14-and-above preferences.xml and host_prefs.xml files (under xml-v14/) in order to do so. This unfortunately for the most part duplicates preferences.xml and host_prefs.xml. This method is an effective workaround for the visual glitch encountered earlier, as recorded here: https://github.com/connectbot/connectbot/pull/205#issuecomment-140547689
Diffstat (limited to 'app/src/main/res/xml')
-rw-r--r--app/src/main/res/xml/host_prefs.xml27
-rw-r--r--app/src/main/res/xml/preferences.xml39
2 files changed, 21 insertions, 45 deletions
diff --git a/app/src/main/res/xml/host_prefs.xml b/app/src/main/res/xml/host_prefs.xml
index 5e85d60..c21f980 100644
--- a/app/src/main/res/xml/host_prefs.xml
+++ b/app/src/main/res/xml/host_prefs.xml
@@ -40,13 +40,6 @@
android:singleLine="true"
/>
-<!--
- <CheckBoxPreference
- android:key="usekeys"
- android:title="Use SSH keys"
- />
--->
-
<ListPreference
android:key="pubkeyid"
android:title="@string/hostpref_pubkeyid_title"
@@ -66,30 +59,26 @@
android:title="@string/hostpref_postlogin_title"
android:summary="@string/hostpref_postlogin_summary"
/>
-
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+
+ <org.connectbot.SwitchCompatPreference
android:key="compression"
android:title="@string/hostpref_compression_title"
android:summary="@string/hostpref_compression_summary"
/>
-
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+
+ <org.connectbot.SwitchCompatPreference
android:key="wantsession"
android:title="@string/hostpref_wantsession_title"
android:summary="@string/hostpref_wantsession_summary"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="stayconnected"
android:title="@string/hostpref_stayconnected_title"
android:summary="@string/hostpref_stayconnected_summary"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="quickdisconnect"
android:title="@string/hostpref_quickdisconnect_title"
android:summary="@string/hostpref_quickdisconnect_summary"
@@ -108,10 +97,10 @@
android:title="@string/hostpref_encoding_title"
android:summary="@string/hostpref_encoding_summary"
/>
-
+
<PreferenceCategory
android:title="@string/hostpref_connection_category">
-
+
<EditTextPreference
android:key="username"
android:title="@string/hostpref_username_title"
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index ecddd71..a0baf8a 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -20,24 +20,21 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="memkeys"
android:title="@string/pref_memkeys_title"
android:summary="@string/pref_memkeys_summary"
android:defaultValue="true"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="connPersist"
android:title="@string/pref_conn_persist_title"
android:summary="@string/pref_conn_persist_summary"
android:defaultValue="true"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="wifilock"
android:title="@string/pref_wifilock_title"
android:summary="@string/pref_wifilock_summary"
@@ -78,32 +75,28 @@
android:defaultValue="Default"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="titlebarhide"
android:title="@string/pref_titlebarhide_title"
android:summary="@string/pref_titlebarhide_summary"
android:defaultValue="false"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="fullscreen"
android:title="@string/pref_fullscreen_title"
android:summary="@string/pref_fullscreen_summary"
android:defaultValue="false"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="volumefont"
android:title="@string/pref_volumefont_title"
android:summary="@string/pref_volumefont_summary"
android:defaultValue="true"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="keepalive"
android:title="@string/pref_keepalive_title"
android:summary="@string/pref_keepalive_summary"
@@ -114,16 +107,14 @@
<PreferenceCategory
android:title="@string/pref_keyboard_category">
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="shiftfkeys"
android:title="@string/pref_shiftfkeys_title"
android:summary="@string/pref_shiftfkeys_summary"
android:defaultValue="false"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="ctrlfkeys"
android:title="@string/pref_ctrlfkeys_title"
android:summary="@string/pref_ctrlfkeys_summary"
@@ -157,8 +148,7 @@
android:defaultValue="Ctrl+A then Space"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="bumpyarrows"
android:title="@string/pref_bumpyarrows_title"
android:summary="@string/pref_bumpyarrows_summary"
@@ -169,8 +159,7 @@
<PreferenceCategory
android:title="@string/pref_bell_category">
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="bell"
android:title="@string/pref_bell_title"
android:defaultValue="true"
@@ -181,15 +170,13 @@
android:title="@string/pref_bell_volume_title"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="bellVibrate"
android:title="@string/pref_bell_vibrate_title"
android:defaultValue="true"
/>
- <CheckBoxPreference
- android:widgetLayout="@layout/switch_compat_preference_layout"
+ <org.connectbot.SwitchCompatPreference
android:key="bellNotification"
android:title="@string/pref_bell_notification_title"
android:summary="@string/pref_bell_notification_summary"