aboutsummaryrefslogtreecommitdiff
path: root/library/src/main/res
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-11 13:25:16 -0700
committerAllan Wang <me@allanwang.ca>2017-06-11 13:25:16 -0700
commit37714d62238efb754a689e6bbcadd8d8f934f704 (patch)
treedada0b9cbef51473e31c74f595fd916f77edcfa6 /library/src/main/res
parentb7a493facf1152bc1de872e39cbc299640127bf4 (diff)
downloadkau-37714d62238efb754a689e6bbcadd8d8f934f704.tar.gz
kau-37714d62238efb754a689e6bbcadd8d8f934f704.tar.bz2
kau-37714d62238efb754a689e6bbcadd8d8f934f704.zip
Switch to ConstraintLayout
Diffstat (limited to 'library/src/main/res')
-rw-r--r--library/src/main/res/layout/kau_preference.xml82
-rw-r--r--library/src/main/res/values/strings.xml1
2 files changed, 50 insertions, 33 deletions
diff --git a/library/src/main/res/layout/kau_preference.xml b/library/src/main/res/layout/kau_preference.xml
index 265015a..5123b27 100644
--- a/library/src/main/res/layout/kau_preference.xml
+++ b/library/src/main/res/layout/kau_preference.xml
@@ -1,68 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:baselineAligned="false"
android:clipToPadding="false"
- android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:orientation="horizontal"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingStart="?android:attr/listPreferredItemPaddingStart">
- <LinearLayout
- android:id="@+id/kau_pref_icon_frame"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="-4dp"
- android:gravity="start|center_vertical"
- android:minWidth="60dp"
- android:orientation="horizontal"
- android:paddingBottom="4dp"
- android:paddingEnd="12dp"
- android:paddingTop="4dp">
+ <android.support.constraint.ConstraintLayout
+ android:id="@+id/kau_pref_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<ImageView
android:id="@+id/kau_pref_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginBottom="4dp"
+ android:layout_marginTop="4dp"
+ android:contentDescription="@string/kau_pref_icon"
android:maxHeight="48dp"
- android:maxWidth="48dp" />
- </LinearLayout>
+ android:maxWidth="48dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.5"
+ tools:layout_editor_absoluteX="0dp" />
- <RelativeLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:paddingBottom="16dp"
- android:paddingTop="16dp">
+ <LinearLayout
+ android:id="@+id/kau_pref_inner_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_marginStart="16dp"
+ android:gravity="center_vertical|end"
+ android:orientation="horizontal"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.5"
+ tools:layout_editor_absoluteX="1dp" />
<TextView
android:id="@+id/kau_pref_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorPrimary"
- android:textAppearance="?android:attr/textAppearanceListItem" />
+ app:layout_constraintBottom_toTopOf="@+id/kau_pref_desc"
+ app:layout_constraintEnd_toStartOf="@id/kau_pref_inner_frame"
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintStart_toEndOf="@id/kau_pref_icon"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_goneMarginBottom="16dp"
+ tools:layout_editor_absoluteX="-175dp" />
<TextView
- android:id="@+id/kau_pref_desc"
+ android:id="@id/kau_pref_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignStart="@id/kau_pref_title"
- android:layout_below="@id/kau_pref_title"
+ android:layout_marginBottom="16dp"
android:ellipsize="end"
android:maxLines="10"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
- android:textColor="?android:attr/textColorSecondary" />
-
- </RelativeLayout>
+ android:textColor="?android:attr/textColorSecondary"
+ android:visibility="gone"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/kau_pref_inner_frame"
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintStart_toEndOf="@id/kau_pref_icon"
+ app:layout_constraintTop_toBottomOf="@+id/kau_pref_title"
+ tools:layout_editor_absoluteX="-175dp" />
- <LinearLayout android:id="@+id/kau_pref_inner_frame"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="end|center_vertical"
- android:paddingLeft="16dp"
- android:orientation="vertical" />
+ </android.support.constraint.ConstraintLayout>
</LinearLayout> \ No newline at end of file
diff --git a/library/src/main/res/values/strings.xml b/library/src/main/res/values/strings.xml
index 10a73b9..ed939fa 100644
--- a/library/src/main/res/values/strings.xml
+++ b/library/src/main/res/values/strings.xml
@@ -14,4 +14,5 @@
<string name="kau_md_color_palette">Color Palette</string>
<string name="kau_kpref_title_placeholder">Title Placeholder</string>
+ <string name="kau_pref_icon">Pref Icon</string>
</resources>