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

296 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>
<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="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}"
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/l1">
2019-10-22 20:46:09 +02:00
<com.google.android.material.card.MaterialCardView
style="@style/WidgetFoundation.Card.Variant"
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"
app:strokeWidth="@{viewModel.step != 0 ? 0f : @dimen/l_125}">
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
<androidx.constraintlayout.widget.ConstraintLayout
2019-10-22 20:46:09 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeightSmall">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/install_step_options_icon"
style="@style/WidgetFoundation.Icon"
isSelected="@{viewModel.step > 0}"
android:layout_marginStart="@dimen/l_25"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_check_circle_md2" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/install_step_options_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:gravity="start"
android:text="@string/install_options_title"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/install_step_options_button"
app:layout_constraintStart_toEndOf="@+id/install_step_options_icon"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/install_step_options_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)}"
android:text="@string/install_next"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
gone="@{viewModel.step != 0}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2019-11-01 19:15:05 +01:00
android:paddingStart="3dp"
android:paddingEnd="3dp">
2019-10-22 20:46:09 +02:00
<include
layout="@layout/include_install_options"
android:layout_width="match_parent"
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" />
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
</com.google.android.material.card.MaterialCardView>
2019-10-22 20:46:09 +02:00
<com.google.android.material.card.MaterialCardView
style="@style/WidgetFoundation.Card.Variant"
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"
app:strokeWidth="@{viewModel.step != 1 ? 0f : @dimen/l_125}">
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">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
2019-10-22 20:46:09 +02:00
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeightSmall">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/install_step_method_icon"
style="@style/WidgetFoundation.Icon"
isSelected="@{viewModel.step > 1}"
android:layout_marginStart="@dimen/l_25"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_check_circle_md2" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/install_step_method_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:gravity="start"
android:text="@string/install_method_title"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/install_step_method_button"
app:layout_constraintStart_toEndOf="@+id/install_step_method_icon"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/install_step_method_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.step(2)}"
android:text="@string/install_next"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<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">
<com.google.android.material.radiobutton.MaterialRadioButton
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" />
<com.google.android.material.radiobutton.MaterialRadioButton
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" />
<com.google.android.material.radiobutton.MaterialRadioButton
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" />
<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/method_inactive_slot"
style="@style/WidgetFoundation.RadioButton"
2020-02-28 19:30:53 +01:00
gone="@{!viewModel.isRooted || !viewModel.isAB}"
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.button.MaterialButton
style="@style/WidgetFoundation.Button.Text"
gone="@{viewModel.step != 2}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_margin="@dimen/l1"
android:onClick="@{() -> viewModel.install()}"
android:text="@string/install_start"
app:icon="@drawable/ic_forth_md2"
app:iconGravity="textEnd" />
2019-10-22 20:46:09 +02:00
</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
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/safetynet_attest_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">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/download_complete"
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>