2019-11-27 19:47:20 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<layout 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">
|
|
|
|
|
|
|
|
<data>
|
|
|
|
|
|
|
|
<variable
|
|
|
|
name="item"
|
2020-08-19 02:05:23 -07:00
|
|
|
type="com.topjohnwu.magisk.ui.settings.BaseSettingsItem" />
|
2019-11-27 19:47:20 +01:00
|
|
|
|
|
|
|
<variable
|
|
|
|
name="callback"
|
2020-08-19 02:05:23 -07:00
|
|
|
type="com.topjohnwu.magisk.ui.settings.BaseSettingsItem.Callback" />
|
2019-11-27 19:47:20 +01:00
|
|
|
|
|
|
|
</data>
|
|
|
|
|
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
|
|
style="@style/WidgetFoundation.Card"
|
2019-11-29 20:07:33 +01:00
|
|
|
isEnabled="@{item.enabled}"
|
2019-11-29 21:04:32 +01:00
|
|
|
android:layout_width="match_parent"
|
2019-11-27 19:47:20 +01:00
|
|
|
android:layout_height="wrap_content"
|
2019-11-29 21:04:32 +01:00
|
|
|
android:alpha="@{item.enabled ? 1f : .5f}"
|
2019-11-27 19:47:20 +01:00
|
|
|
android:onClick="@{(view) -> item.onPressed(view, callback)}"
|
|
|
|
tools:layout_gravity="center">
|
|
|
|
|
2020-08-11 03:30:00 -07:00
|
|
|
<LinearLayout
|
2019-11-27 19:47:20 +01:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
2020-08-11 03:30:00 -07:00
|
|
|
android:orientation="horizontal"
|
|
|
|
android:gravity="center_vertical"
|
|
|
|
android:paddingStart="@{item.icon == 0 ? @dimen/l1 : 0}"
|
|
|
|
android:paddingEnd="@dimen/l1">
|
2019-11-27 19:47:20 +01:00
|
|
|
|
2020-08-11 00:54:19 -07:00
|
|
|
<ImageView
|
2020-08-11 03:30:00 -07:00
|
|
|
android:id="@+id/icon"
|
2019-11-27 19:47:20 +01:00
|
|
|
style="@style/WidgetFoundation.Icon"
|
|
|
|
gone="@{item.icon == 0}"
|
|
|
|
android:background="@null"
|
|
|
|
app:srcCompat="@{item.icon}"
|
|
|
|
tools:srcCompat="@drawable/ic_fingerprint" />
|
|
|
|
|
|
|
|
<LinearLayout
|
2020-08-11 03:30:00 -07:00
|
|
|
android:layout_weight="1"
|
2019-11-27 19:47:20 +01:00
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:gravity="center_vertical"
|
|
|
|
android:orientation="vertical"
|
|
|
|
android:paddingTop="@dimen/l1"
|
2020-08-11 03:30:00 -07:00
|
|
|
android:paddingBottom="@dimen/l1">
|
2019-11-27 19:47:20 +01:00
|
|
|
|
2020-08-11 00:54:19 -07:00
|
|
|
<TextView
|
2019-11-27 19:47:20 +01:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_gravity="center"
|
|
|
|
android:gravity="start"
|
|
|
|
android:text="@{item.title}"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Body"
|
|
|
|
android:textStyle="bold"
|
|
|
|
tools:lines="1"
|
|
|
|
tools:text="@tools:sample/lorem/random" />
|
|
|
|
|
2020-08-11 00:54:19 -07:00
|
|
|
<TextView
|
2019-11-27 19:47:20 +01:00
|
|
|
gone="@{item.description.empty}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:text="@{item.description}"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Tiny.Variant"
|
|
|
|
tools:lines="2"
|
|
|
|
tools:text="@tools:sample/lorem/random" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
2020-08-11 03:30:00 -07:00
|
|
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
|
|
|
android:id="@+id/selector_indicator"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:checked="@{item.checked}"
|
|
|
|
android:onCheckedChanged="@{(v, c) -> item.onToggle(v, callback, c)}"
|
|
|
|
goneUnless="@{item.showSwitch}"
|
|
|
|
isEnabled="@{item.enabled}"/>
|
|
|
|
|
|
|
|
</LinearLayout>
|
2019-11-27 19:47:20 +01:00
|
|
|
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
|
2020-08-11 00:54:19 -07:00
|
|
|
</layout>
|