mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-27 10:27:31 +00:00
99 lines
4.2 KiB
XML
99 lines
4.2 KiB
XML
![]() |
<?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>
|
||
|
|
||
|
<import type="com.topjohnwu.magisk.R" />
|
||
|
|
||
|
<variable
|
||
|
name="item"
|
||
|
type="com.topjohnwu.magisk.redesign.settings.SettingsItem.Toggle" />
|
||
|
|
||
|
<variable
|
||
|
name="callback"
|
||
|
type="com.topjohnwu.magisk.redesign.settings.SettingsItem.Callback" />
|
||
|
|
||
|
</data>
|
||
|
|
||
|
<com.google.android.material.card.MaterialCardView
|
||
|
style="@style/WidgetFoundation.Card"
|
||
|
android:layout_width="match_parent"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:onClick="@{(view) -> item.onPressed(view, callback)}"
|
||
|
tools:layout_gravity="center">
|
||
|
|
||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||
|
android:layout_width="match_parent"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:minHeight="?listPreferredItemHeightSmall"
|
||
|
android:orientation="vertical">
|
||
|
|
||
|
<androidx.appcompat.widget.AppCompatImageView
|
||
|
android:id="@+id/toggle_icon"
|
||
|
style="@style/WidgetFoundation.Icon"
|
||
|
gone="@{item.icon == 0}"
|
||
|
android:background="@null"
|
||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||
|
app:layout_constraintStart_toStartOf="parent"
|
||
|
app:layout_constraintTop_toTopOf="parent"
|
||
|
app:srcCompat="@{item.icon}"
|
||
|
tools:srcCompat="@drawable/ic_fingerprint" />
|
||
|
|
||
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||
|
android:id="@+id/toggle_indicator"
|
||
|
style="@style/WidgetFoundation.Switch"
|
||
|
onTouch="@{(view, event) -> item.onTouched(view, callback, event)}"
|
||
|
android:layout_width="wrap_content"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:layout_marginEnd="@dimen/l_25"
|
||
|
android:checked="@{item.value}"
|
||
|
android:text=""
|
||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||
|
app:layout_constraintEnd_toEndOf="parent"
|
||
|
app:layout_constraintTop_toTopOf="parent" />
|
||
|
|
||
|
<LinearLayout
|
||
|
android:layout_width="0dp"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:layout_marginStart="@{item.icon == 0 ? (int) @dimen/l1 : 0}"
|
||
|
android:layout_marginEnd="@dimen/l_50"
|
||
|
android:gravity="center_vertical"
|
||
|
android:orientation="vertical"
|
||
|
android:paddingTop="@dimen/l1"
|
||
|
android:paddingBottom="@dimen/l1"
|
||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||
|
app:layout_constraintEnd_toStartOf="@+id/toggle_indicator"
|
||
|
app:layout_constraintStart_toEndOf="@+id/toggle_icon"
|
||
|
app:layout_constraintTop_toTopOf="parent">
|
||
|
|
||
|
<androidx.appcompat.widget.AppCompatTextView
|
||
|
android:id="@+id/toggle_title"
|
||
|
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" />
|
||
|
|
||
|
<androidx.appcompat.widget.AppCompatTextView
|
||
|
android:id="@+id/toggle_description"
|
||
|
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>
|
||
|
|
||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||
|
|
||
|
</com.google.android.material.card.MaterialCardView>
|
||
|
|
||
|
</layout>
|