2017-01-24 14:19:28 +08:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2019-04-26 21:23:25 +02:00
|
|
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
2018-12-27 17:28:06 +08:00
|
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
2019-04-26 21:23:25 +02:00
|
|
|
xmlns:tools="http://schemas.android.com/tools">
|
|
|
|
|
|
|
|
<data>
|
|
|
|
|
|
|
|
<variable
|
|
|
|
name="viewModel"
|
2020-03-30 23:53:11 -07:00
|
|
|
type="com.topjohnwu.magisk.ui.surequest.SuRequestViewModel" />
|
2019-04-26 21:23:25 +02:00
|
|
|
|
|
|
|
</data>
|
2017-01-24 14:19:28 +08:00
|
|
|
|
2020-02-01 16:55:22 +01:00
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
|
|
style="@style/WidgetFoundation.Card.Elevated"
|
2017-01-25 01:01:12 +08:00
|
|
|
android:layout_width="wrap_content"
|
2017-01-24 14:19:28 +08:00
|
|
|
android:layout_height="wrap_content"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:layout_gravity="center">
|
2017-01-24 14:19:28 +08:00
|
|
|
|
|
|
|
<LinearLayout
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/su_popup"
|
2017-01-24 14:19:28 +08:00
|
|
|
android:layout_width="wrap_content"
|
2017-01-25 01:01:12 +08:00
|
|
|
android:layout_height="wrap_content"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:minWidth="350dp"
|
|
|
|
android:orientation="vertical">
|
2019-04-26 21:23:25 +02:00
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
<TextView
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/request_title"
|
2017-01-25 01:01:12 +08:00
|
|
|
android:layout_width="wrap_content"
|
2017-01-24 14:19:28 +08:00
|
|
|
android:layout_height="wrap_content"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:layout_gravity="center_horizontal"
|
|
|
|
android:layout_marginTop="@dimen/l1"
|
|
|
|
android:layout_marginBottom="@dimen/l_50"
|
|
|
|
android:gravity="center_horizontal"
|
|
|
|
android:text="@string/su_request_title"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Title" />
|
2017-01-24 14:19:28 +08:00
|
|
|
|
2020-02-01 16:55:22 +01:00
|
|
|
<LinearLayout
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_gravity="center_horizontal"
|
|
|
|
android:layout_marginTop="@dimen/l_50"
|
|
|
|
android:layout_marginBottom="@dimen/l_50"
|
|
|
|
android:orientation="horizontal"
|
|
|
|
android:paddingStart="10dp"
|
|
|
|
android:paddingEnd="10dp">
|
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
<ImageView
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/app_icon"
|
|
|
|
style="@style/WidgetFoundation.Icon"
|
|
|
|
android:layout_gravity="center_vertical"
|
|
|
|
android:layout_marginStart="@dimen/l_50"
|
|
|
|
android:layout_marginEnd="@dimen/l1"
|
|
|
|
android:layout_weight="0"
|
|
|
|
android:padding="0dp"
|
|
|
|
android:src="@{viewModel.icon}"
|
|
|
|
app:tint="@null"
|
|
|
|
tools:src="@drawable/ic_delete_md2" />
|
|
|
|
|
|
|
|
<LinearLayout
|
2019-04-26 21:23:25 +02:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:layout_gravity="center_vertical"
|
|
|
|
android:layout_weight="1"
|
|
|
|
android:gravity="center_vertical"
|
|
|
|
android:orientation="vertical">
|
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
<TextView
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/app_name"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:ellipsize="end"
|
|
|
|
android:maxWidth="300dp"
|
|
|
|
android:maxLines="1"
|
|
|
|
android:minWidth="200dp"
|
|
|
|
android:text="@{viewModel.title}"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Body"
|
|
|
|
android:textStyle="bold"
|
|
|
|
tools:text="Magisk" />
|
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
<TextView
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/package_name"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:ellipsize="end"
|
|
|
|
android:maxWidth="300dp"
|
|
|
|
android:maxLines="1"
|
|
|
|
android:minWidth="200dp"
|
|
|
|
android:text="@{viewModel.packageName}"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Caption.Variant"
|
|
|
|
tools:text="com.topjohnwu.magisk" />
|
|
|
|
</LinearLayout>
|
2019-04-26 21:23:25 +02:00
|
|
|
</LinearLayout>
|
2017-01-24 14:19:28 +08:00
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
<Spinner
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/timeout"
|
|
|
|
onTouch="@{() -> viewModel.spinnerTouched()}"
|
|
|
|
android:layout_width="wrap_content"
|
2019-04-26 21:23:25 +02:00
|
|
|
android:layout_height="wrap_content"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:layout_gravity="center_horizontal"
|
2020-06-19 03:52:25 -07:00
|
|
|
android:enabled="@{viewModel.grantEnabled}"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:adapter="@{viewModel.adapter}"
|
|
|
|
android:selection="@={viewModel.selectedItemPosition}" />
|
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
<TextView
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/warning"
|
|
|
|
android:layout_width="wrap_content"
|
2019-04-26 21:23:25 +02:00
|
|
|
android:layout_height="wrap_content"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:layout_gravity="center_horizontal"
|
|
|
|
android:layout_margin="@dimen/l1"
|
|
|
|
android:gravity="center"
|
|
|
|
android:text="@{viewModel.warningText}"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Body"
|
|
|
|
android:textColor="?colorError"
|
|
|
|
android:textStyle="bold"
|
|
|
|
tools:text="@string/su_warning" />
|
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
style="?android:buttonBarStyle"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent"
|
|
|
|
android:gravity="bottom"
|
|
|
|
android:orientation="horizontal"
|
|
|
|
android:paddingStart="@dimen/l2"
|
|
|
|
android:paddingEnd="@dimen/l2">
|
|
|
|
|
2020-08-19 02:45:14 -07:00
|
|
|
<Button
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/deny_btn"
|
|
|
|
style="@style/WidgetFoundation.Button.Text"
|
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_weight="1"
|
|
|
|
android:onClick="@{() -> viewModel.denyPressed()}"
|
|
|
|
android:text="@{viewModel.denyText}"
|
|
|
|
android:textColor="?colorOnSurfaceVariant"
|
|
|
|
tools:text="@string/deny" />
|
|
|
|
|
2020-08-19 02:45:14 -07:00
|
|
|
<Button
|
2020-02-01 16:55:22 +01:00
|
|
|
android:id="@+id/grant_btn"
|
|
|
|
style="@style/WidgetFoundation.Button.Text"
|
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_weight="1"
|
|
|
|
android:onClick="@{() -> viewModel.grantPressed()}"
|
2020-02-12 05:45:10 +00:00
|
|
|
android:enabled="@{viewModel.grantEnabled}"
|
2020-02-01 16:55:22 +01:00
|
|
|
android:text="@string/grant" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
2019-04-26 21:23:25 +02:00
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
2020-02-01 16:55:22 +01:00
|
|
|
</com.google.android.material.card.MaterialCardView>
|
2017-01-24 14:19:28 +08:00
|
|
|
|
2019-11-14 05:42:39 -05:00
|
|
|
</layout>
|