Add separator to preferences

This commit is contained in:
Moez Bhatti
2017-12-17 16:38:38 -05:00
parent 75f5a7b813
commit 9db72e7c0a
2 changed files with 35 additions and 21 deletions
@@ -26,6 +26,7 @@ class PreferenceView @JvmOverloads constructor(context: Context, attrs: Attribut
init {
View.inflate(context, R.layout.preference_view, this)
setBackgroundResource(R.drawable.ripple)
orientation = VERTICAL
context.obtainStyledAttributes(attrs, R.styleable.PreferenceView)?.run {
title = getString(R.styleable.PreferenceView_title)
+34 -21
View File
@@ -3,36 +3,49 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical"
tools:parentTag="com.moez.QKSMS.presentation.common.widget.PreferenceView">
<LinearLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.moez.QKSMS.presentation.common.widget.QkTextView
android:id="@+id/titleView"
style="@style/TextPrimary"
android:layout_width="match_parent"
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
tools:text="Default SMS App" />
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<com.moez.QKSMS.presentation.common.widget.QkTextView
android:id="@+id/summaryView"
style="@style/TextSecondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="QKSMS is your default SMS app" />
<com.moez.QKSMS.presentation.common.widget.QkTextView
android:id="@+id/titleView"
style="@style/TextPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Default SMS App" />
<com.moez.QKSMS.presentation.common.widget.QkTextView
android:id="@+id/summaryView"
style="@style/TextSecondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="QKSMS is your default SMS app" />
</LinearLayout>
<FrameLayout
android:id="@+id/widgetFrame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="16dp" />
</LinearLayout>
<FrameLayout
android:id="@+id/widgetFrame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="16dp" />
<com.moez.QKSMS.presentation.common.widget.Separator
android:layout_width="match_parent"
android:layout_height="1dp" />
</merge>