summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Mazel <mazelm@gmail.com>2016-09-14 02:23:30 +0200
committerjan iversen <jani@documentfoundation.org>2016-10-14 06:33:06 +0000
commite15a59963c744e7494fe2a1e7db5bc42f196ffa6 (patch)
treecabacd22cd47ce12ad97ce3a6a2c0fad5102be09
parent324b091ddbbdc41e57226662d5dfb17cdca90935 (diff)
Settings redesigned based on material design guidelines
Change-Id: I19feb32ba782c3841dc492f9f88fb907b937cec0 Reviewed-on: https://gerrit.libreoffice.org/28886 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
-rw-r--r--android/sdremote/mobile/src/main/res/layout/preference_item.xml39
-rw-r--r--android/sdremote/mobile/src/main/res/values/dimens.xml1
-rw-r--r--android/sdremote/mobile/src/main/res/xml/preferences.xml15
3 files changed, 49 insertions, 6 deletions
diff --git a/android/sdremote/mobile/src/main/res/layout/preference_item.xml b/android/sdremote/mobile/src/main/res/layout/preference_item.xml
new file mode 100644
index 0000000..733cb5d
--- /dev/null
+++ b/android/sdremote/mobile/src/main/res/layout/preference_item.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingLeft="@dimen/padding_horizontal_list_item"
+ android:paddingRight="@dimen/padding_horizontal_list_item"
+ android:paddingTop="@dimen/padding_vertical_list_item"
+ android:paddingBottom="@dimen/padding_vertical_list_item"
+ android:background="?android:attr/selectableItemBackground"
+ android:clickable="true"
+ >
+
+ <RelativeLayout
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@android:id/title"
+ android:textAppearance="@android:style/TextAppearance.Small" />
+ </RelativeLayout>
+
+ <LinearLayout android:id="@android:id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:orientation="vertical" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/sdremote/mobile/src/main/res/values/dimens.xml b/android/sdremote/mobile/src/main/res/values/dimens.xml
index 7c6458e..36d0436 100644
--- a/android/sdremote/mobile/src/main/res/values/dimens.xml
+++ b/android/sdremote/mobile/src/main/res/values/dimens.xml
@@ -46,6 +46,7 @@
<dimen name="padding_vertical_edit">16dp</dimen>
<dimen name="padding_vertical_progress_message">8dp</dimen>
<dimen name="padding_vertical_learn_more">4dp</dimen>
+ <dimen name="padding_vertical_list_item">16dp</dimen>
<dimen name="margin_vertical_action_bar_divider">12dp</dimen>
<dimen name="margin_slide">8dp</dimen>
diff --git a/android/sdremote/mobile/src/main/res/xml/preferences.xml b/android/sdremote/mobile/src/main/res/xml/preferences.xml
index 84f10d1..4d20053 100644
--- a/android/sdremote/mobile/src/main/res/xml/preferences.xml
+++ b/android/sdremote/mobile/src/main/res/xml/preferences.xml
@@ -18,22 +18,25 @@
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <android.support.v7.preference.CheckBoxPreference
+ <android.support.v7.preference.SwitchPreferenceCompat
android:key="volume_keys_actions"
android:defaultValue="true"
android:title="@string/preferences_volume_keys_actions_title"
- android:summary="@string/preferences_volume_keys_actions_summary"/>
+ android:summary="@string/preferences_volume_keys_actions_summary"
+ android:layout="@layout/preference_item"/>
- <android.support.v7.preference.CheckBoxPreference
+ <android.support.v7.preference.SwitchPreferenceCompat
android:key="keep_screen_on"
android:defaultValue="true"
android:title="@string/preferences_keep_screen_on_title"
- android:summary="@string/preferences_keep_screen_on_summary"/>
+ android:summary="@string/preferences_keep_screen_on_summary"
+ android:layout="@layout/preference_item"/>
- <android.support.v7.preference.CheckBoxPreference
+ <android.support.v7.preference.SwitchPreferenceCompat
android:key="quiet_mode"
android:defaultValue="false"
android:title="@string/preferences_quiet_mode_title"
- android:summary="@string/preferences_quiet_mode_summary"/>
+ android:summary="@string/preferences_quiet_mode_summary"
+ android:layout="@layout/preference_item"/>
</android.support.v7.preference.PreferenceScreen> \ No newline at end of file