Magisk/app/src/main/res/layout/fragment_install_md2.xml

332 lines
15 KiB
XML
Raw Normal View History

2019-10-22 16:29:01 +02:00
<?xml version="1.0" encoding="utf-8"?>
2019-10-22 20:46:09 +02:00
<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">
2019-10-22 16:29:01 +02:00
<data>
2020-08-24 09:19:08 +02:00
<import type="com.topjohnwu.magisk.core.Info" />
<import type="com.topjohnwu.magisk.core.Config" />
2020-08-24 09:19:08 +02:00
2019-10-22 16:29:01 +02:00
<variable
name="viewModel"
2020-01-12 17:43:09 +01:00
type="com.topjohnwu.magisk.ui.install.InstallViewModel" />
2019-10-22 16:29:01 +02:00
</data>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
2019-10-22 20:46:09 +02:00
android:clipToPadding="false"
android:fillViewport="true"
android:paddingTop="@dimen/internal_action_bar_size"
android:paddingBottom="@dimen/l2"
app:fitsSystemWindowsInsets="top|bottom"
2019-10-22 20:46:09 +02:00
tools:paddingTop="24dp">
2019-10-22 16:29:01 +02:00
<FrameLayout
2019-10-22 16:29:01 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content">
2019-10-22 20:46:09 +02:00
<LinearLayout
goneUnless="@{viewModel.loaded &amp;&amp; viewModel.progress &lt;= 0}"
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingTop="@dimen/l_50">
2019-10-22 20:46:09 +02:00
<com.google.android.material.card.MaterialCardView
2020-09-17 11:27:43 +02:00
style="@style/WidgetFoundation.Card"
gone="@{viewModel.skipOptions}"
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:focusable="false">
2019-10-22 20:46:09 +02:00
<LinearLayout
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
2019-10-22 20:46:09 +02:00
2020-08-24 09:19:08 +02:00
<LinearLayout
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2020-08-24 09:19:08 +02:00
android:orientation="horizontal">
<ImageView
style="@style/WidgetFoundation.Icon"
isSelected="@{viewModel.step > 0}"
android:layout_marginStart="@dimen/l_25"
app:srcCompat="@drawable/ic_check_circle_md2" />
<TextView
android:layout_width="0dp"
2020-08-24 09:19:08 +02:00
android:layout_height="match_parent"
android:layout_marginStart="@dimen/l1"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/install_options_title"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textStyle="bold" />
<Button
style="@style/WidgetFoundation.Button.Text"
gone="@{viewModel.step != 0}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.step(1)}"
2020-08-24 09:19:08 +02:00
android:text="@string/install_next" />
2020-08-24 09:19:08 +02:00
</LinearLayout>
2020-08-24 09:19:08 +02:00
<LinearLayout
gone="@{viewModel.step != 0}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2020-08-24 09:19:08 +02:00
android:layout_marginStart="@dimen/l1"
android:layout_marginTop="@dimen/l_50"
android:layout_marginEnd="@dimen/l1"
android:layout_marginBottom="@dimen/l_50"
android:orientation="vertical"
android:paddingStart="3dp"
android:paddingEnd="3dp"
2020-08-24 09:19:08 +02:00
tools:layout_gravity="center">
2019-10-22 20:46:09 +02:00
2020-08-24 09:19:08 +02:00
<CheckBox
style="@style/WidgetFoundation.Checkbox"
gone="@{Info.isSAR}"
2020-08-27 14:46:41 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="@={Config.keepVerity}"
2020-08-24 09:19:08 +02:00
android:text="@string/keep_dm_verity"
tools:checked="true" />
<CheckBox
style="@style/WidgetFoundation.Checkbox"
2020-09-28 13:45:56 +02:00
goneUnless="@{Info.isFDE}"
2020-08-27 14:46:41 +02:00
android:layout_width="match_parent"
2020-08-24 09:19:08 +02:00
android:layout_height="wrap_content"
android:checked="@={Config.keepEnc}"
2020-08-24 09:19:08 +02:00
android:text="@string/keep_force_encryption"
app:tint="?colorPrimary" />
<CheckBox
style="@style/WidgetFoundation.Checkbox"
gone="@{Info.ramdisk}"
2020-08-27 14:46:41 +02:00
android:layout_width="match_parent"
2020-08-24 09:19:08 +02:00
android:layout_height="wrap_content"
android:checked="@={Config.recovery}"
2020-08-24 09:19:08 +02:00
android:text="@string/recovery_mode"
app:tint="?colorPrimary" />
2019-10-22 20:46:09 +02:00
2020-08-24 09:19:08 +02:00
</LinearLayout>
2019-10-22 20:46:09 +02:00
</LinearLayout>
2019-10-22 20:46:09 +02:00
</com.google.android.material.card.MaterialCardView>
2019-10-22 20:46:09 +02:00
<com.google.android.material.card.MaterialCardView
2020-09-17 11:27:43 +02:00
style="@style/WidgetFoundation.Card"
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginTop="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:focusable="false">
2019-10-22 20:46:09 +02:00
<LinearLayout
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
2020-08-24 09:19:08 +02:00
<LinearLayout
android:layout_width="match_parent"
2019-10-22 20:46:09 +02:00
android:layout_height="wrap_content"
2020-08-24 09:19:08 +02:00
android:orientation="horizontal">
<ImageView
style="@style/WidgetFoundation.Icon"
isSelected="@{viewModel.step > 1}"
android:layout_marginStart="@dimen/l_25"
app:srcCompat="@drawable/ic_check_circle_md2" />
<TextView
android:layout_width="0dp"
2020-08-24 09:19:08 +02:00
android:layout_height="match_parent"
android:layout_marginStart="@dimen/l1"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/install_method_title"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textStyle="bold" />
<Button
style="@style/WidgetFoundation.Button.Text"
gone="@{viewModel.step != 1}"
isEnabled="@{viewModel.method == @id/method_patch ? viewModel.data != null : viewModel.method != -1}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.install()}"
android:text="@string/install_start"
app:icon="@drawable/ic_forth_md2"
app:iconGravity="textEnd" />
2020-08-24 09:19:08 +02:00
</LinearLayout>
<RadioGroup
2019-10-22 20:46:09 +02:00
gone="@{viewModel.step != 1}"
android:layout_width="match_parent"
2019-10-22 20:46:09 +02:00
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginTop="@dimen/l_50"
android:layout_marginEnd="@dimen/l1"
android:layout_marginBottom="@dimen/l_50"
android:checkedButton="@={viewModel.method}"
android:paddingStart="3dp"
android:paddingEnd="3dp">
2020-08-24 09:19:08 +02:00
<RadioButton
android:id="@+id/method_download"
style="@style/WidgetFoundation.RadioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/download_zip_only"
tools:checked="true" />
2020-08-24 09:19:08 +02:00
<RadioButton
android:id="@+id/method_patch"
style="@style/WidgetFoundation.RadioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/select_patch_file" />
2020-08-24 09:19:08 +02:00
<RadioButton
android:id="@+id/method_direct"
style="@style/WidgetFoundation.RadioButton"
gone="@{!viewModel.rooted}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/direct_install" />
2020-08-24 09:19:08 +02:00
<RadioButton
android:id="@+id/method_inactive_slot"
style="@style/WidgetFoundation.RadioButton"
2021-01-18 22:32:10 +01:00
gone="@{viewModel.noSecondSlot}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/install_inactive_slot" />
</RadioGroup>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
2020-09-17 11:27:43 +02:00
style="@style/WidgetFoundation.Card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2020-09-23 13:43:13 +02:00
android:layout_marginTop="@dimen/l1"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:focusable="false">
<TextView
2020-07-10 13:19:18 +02:00
android:id="@+id/release_notes"
markdownText="@{viewModel.notes}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:textAppearance="@style/AppearanceFoundation.Caption"
2020-08-14 11:00:06 +02:00
android:visibility="gone"
tools:maxLines="5"
2020-09-17 11:27:43 +02:00
tools:text="@tools:sample/lorem/random"
tools:visibility="visible" />
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
2019-10-22 20:46:09 +02:00
<LinearLayout
goneUnless="@{viewModel.loading}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:gravity="center"
android:orientation="vertical">
2019-10-22 20:46:09 +02:00
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
2020-09-23 22:44:44 +02:00
android:text="@string/loading"
android:textAppearance="@style/AppearanceFoundation.Title" />
2019-10-22 20:46:09 +02:00
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1">
2019-10-22 20:46:09 +02:00
<ProgressBar
style="@style/WidgetFoundation.ProgressBar"
invisible="@{viewModel.progress &lt;= 0}"
android:layout_width="100dp"
android:layout_gravity="center"
android:progress="@{viewModel.progress}" />
2019-10-22 20:46:09 +02:00
<ProgressBar
style="@style/WidgetFoundation.ProgressBar.Indeterminate"
invisibleUnless="@{viewModel.progress &lt;= 0}"
android:layout_width="100dp"
android:layout_gravity="center" />
2019-10-22 20:46:09 +02:00
</FrameLayout>
2019-10-22 20:46:09 +02:00
</LinearLayout>
2019-10-22 20:46:09 +02:00
<LinearLayout
goneUnless="@{viewModel.loaded &amp;&amp; viewModel.progress >= 100}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/download_complete"
android:textAppearance="@style/AppearanceFoundation.Title" />
</LinearLayout>
<LinearLayout
goneUnless="@{viewModel.loadFailed}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/download_file_error"
android:textAppearance="@style/AppearanceFoundation.Title" />
</LinearLayout>
</FrameLayout>
2019-10-22 16:29:01 +02:00
</androidx.core.widget.NestedScrollView>
2020-01-12 17:43:09 +01:00
</layout>