aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNauval Rizky <enuma.alrizky@gmail.com>2021-09-06 00:01:04 +0700
committernebrassy <nebras30@gmail.com>2022-06-12 16:30:57 +0200
commite3d1ff048d4b54e2f32d4f6265e9dec593df5a7e (patch)
tree5ca69408ce67634ad1598618a4be1b333a5a69f4
parent0c45fa408fcdd966e37caafdb3779ac01f35e743 (diff)
vayu: parts: Improve FooterPreference layout
By disabling the title and make maxlines longer than usual, this should match Settings look-and-feel now. Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com> Signed-off-by: David Setiawan <fryevia@foxmail.com> Change-Id: Ic317f4b6f128a96d017d79bde3bd39546eb93523
-rw-r--r--parts/res/layout/preference_footer.xml63
-rw-r--r--parts/res/xml/clear_speaker_settings.xml3
-rw-r--r--parts/res/xml/lcd_features_settings.xml3
3 files changed, 67 insertions, 2 deletions
diff --git a/parts/res/layout/preference_footer.xml b/parts/res/layout/preference_footer.xml
new file mode 100644
index 0000000..0e71618
--- /dev/null
+++ b/parts/res/layout/preference_footer.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 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.
+-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="6dp"
+ android:gravity="center_vertical"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="0dp"
+ android:layout_height="0dp" />
+
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="20"
+ android:paddingStart="56dp"
+ android:paddingTop="8dp"
+ android:paddingEnd="8dp"
+ android:paddingBottom="5dp"
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ <LinearLayout
+ android:id="@+id/icon_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minWidth="56dp"
+ android:layout_alignParentStart="true"
+ android:gravity="start|top"
+ android:orientation="horizontal"
+ android:paddingStart="0dp"
+ android:paddingEnd="12dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="4dp">
+
+ <ImageView
+ android:id="@android:id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
+</RelativeLayout>
diff --git a/parts/res/xml/clear_speaker_settings.xml b/parts/res/xml/clear_speaker_settings.xml
index eb7ce77..de4e273 100644
--- a/parts/res/xml/clear_speaker_settings.xml
+++ b/parts/res/xml/clear_speaker_settings.xml
@@ -12,6 +12,7 @@
<com.android.settingslib.widget.FooterPreference
android:key="footer_preference"
android:title="@string/clear_speaker_description"
- android:selectable="false" />
+ android:selectable="false"
+ android:layout="@layout/preference_footer" />
</PreferenceScreen>
diff --git a/parts/res/xml/lcd_features_settings.xml b/parts/res/xml/lcd_features_settings.xml
index 473c4aa..db28848 100644
--- a/parts/res/xml/lcd_features_settings.xml
+++ b/parts/res/xml/lcd_features_settings.xml
@@ -35,6 +35,7 @@
<com.android.settingslib.widget.FooterPreference
android:key="lcd_features_footer"
android:title="@string/lcd_features_info"
- android:selectable="false" />
+ android:selectable="false"
+ android:layout="@layout/preference_footer" />
</PreferenceScreen>