You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Added fair amount of settings implemented from the UI side
Updated dialog to create recycler as it behaves better than regular listview
This commit is contained in:
@@ -93,6 +93,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constrainedHeight="true"
|
||||
android:layout_marginTop="@dimen/l_50"
|
||||
app:layout_constraintBottom_toTopOf="@+id/dialog_base_space"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/dialog_base_start"
|
||||
app:layout_constraintRight_toRightOf="@+id/dialog_base_end"
|
||||
@@ -108,7 +109,6 @@
|
||||
gone="@{data.message.length == 0}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/l_50"
|
||||
android:gravity="center"
|
||||
android:text="@{data.message}"
|
||||
android:textAppearance="@style/AppearanceFoundation.Body"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="com.topjohnwu.magisk.view.MagiskDialog.DialogItem" />
|
||||
|
||||
<variable
|
||||
name="listener"
|
||||
type="com.topjohnwu.magisk.view.MagiskDialog.ActualOnDialogClickListener" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:onClick="@{() -> listener.onClick(item.position)}"
|
||||
android:paddingStart="@dimen/l1"
|
||||
android:paddingTop="@dimen/l_75"
|
||||
android:paddingEnd="@dimen/l1"
|
||||
android:paddingBottom="@dimen/l_75"
|
||||
android:text="@{item.item}"
|
||||
android:textAppearance="@style/AppearanceFoundation.Body"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
|
||||
</layout>
|
||||
@@ -19,7 +19,7 @@
|
||||
style="@style/WidgetFoundation.Card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{(view) -> callback.onItemPressed(view, item)}"
|
||||
android:onClick="@{(view) -> item.onPressed(view, callback)}"
|
||||
tools:layout_gravity="center">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -57,6 +57,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="@{item.icon == 0 ? (int) @dimen/l1 : 0}"
|
||||
android:paddingTop="@dimen/l1"
|
||||
android:paddingBottom="@dimen/l1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/selector_divider"
|
||||
@@ -69,7 +70,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@{item.icon == 0 ? (int) @dimen/l1 : 0}"
|
||||
android:gravity="start"
|
||||
android:text="@{item.title}"
|
||||
android:textAppearance="@style/AppearanceFoundation.Body"
|
||||
@@ -91,18 +91,23 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/selector_divider"
|
||||
gone="@{item.selectedEntry == null}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1.25dp"
|
||||
android:background="?colorOnSurfaceVariant"
|
||||
android:layout_height="1dp"
|
||||
android:background="?colorSurface"
|
||||
app:layout_constraintTop_toBottomOf="@+id/selector_text" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/selector_selection"
|
||||
gone="@{item.selectedEntry == null}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/l1"
|
||||
android:textAppearance="@style/AppearanceFoundation.Caption.Variant"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="@dimen/l1"
|
||||
android:layout_marginTop="@dimen/l_75"
|
||||
android:layout_marginEnd="@dimen/l1"
|
||||
android:layout_marginBottom="@dimen/l_75"
|
||||
android:text="@{item.selectedEntry}"
|
||||
android:textAppearance="@style/AppearanceFoundation.Tiny.Variant"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/selector_text"
|
||||
app:layout_constraintTop_toBottomOf="@+id/selector_divider"
|
||||
|
||||
Reference in New Issue
Block a user