mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 10:35:26 +00:00
Cleanup install screen layout
This commit is contained in:
parent
65f88e4ae2
commit
ccde8b73a2
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
|
<import type="com.topjohnwu.magisk.core.Info" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewModel"
|
name="viewModel"
|
||||||
type="com.topjohnwu.magisk.ui.install.InstallViewModel" />
|
type="com.topjohnwu.magisk.ui.install.InstallViewModel" />
|
||||||
@ -45,66 +47,81 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="?listPreferredItemHeightSmall">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/install_step_options_icon"
|
|
||||||
style="@style/WidgetFoundation.Icon"
|
style="@style/WidgetFoundation.Icon"
|
||||||
isSelected="@{viewModel.step > 0}"
|
isSelected="@{viewModel.step > 0}"
|
||||||
android:layout_marginStart="@dimen/l_25"
|
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" />
|
app:srcCompat="@drawable/ic_check_circle_md2" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/install_step_options_title"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="@dimen/l1"
|
android:layout_marginStart="@dimen/l1"
|
||||||
android:gravity="start"
|
|
||||||
android:text="@string/install_options_title"
|
android:text="@string/install_options_title"
|
||||||
android:textAppearance="@style/AppearanceFoundation.Body"
|
android:textAppearance="@style/AppearanceFoundation.Body"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:gravity="center_vertical"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/install_step_options_button"
|
android:layout_weight="1"/>
|
||||||
app:layout_constraintStart_toEndOf="@+id/install_step_options_icon"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/install_step_options_button"
|
|
||||||
style="@style/WidgetFoundation.Button.Text"
|
style="@style/WidgetFoundation.Button.Text"
|
||||||
gone="@{viewModel.step != 0}"
|
gone="@{viewModel.step != 0}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:onClick="@{() -> viewModel.step(1)}"
|
android:onClick="@{() -> viewModel.step(1)}"
|
||||||
android:text="@string/install_next"
|
android:text="@string/install_next" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
gone="@{viewModel.step != 0}"
|
gone="@{viewModel.step != 0}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
android:paddingStart="3dp"
|
android:paddingStart="3dp"
|
||||||
android:paddingEnd="3dp">
|
android:paddingEnd="3dp"
|
||||||
|
android:layout_marginStart="@dimen/l1"
|
||||||
|
android:layout_marginTop="@dimen/l_50"
|
||||||
|
android:layout_marginEnd="@dimen/l1"
|
||||||
|
android:layout_marginBottom="@dimen/l_50"
|
||||||
|
tools:layout_gravity="center">
|
||||||
|
|
||||||
<include
|
<CheckBox
|
||||||
layout="@layout/include_install_options"
|
style="@style/WidgetFoundation.Checkbox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/l1"
|
android:layout_gravity="start|center_vertical"
|
||||||
android:layout_marginTop="@dimen/l_50"
|
android:checked="@={Info.keepVerity}"
|
||||||
android:layout_marginEnd="@dimen/l1"
|
android:gravity="center"
|
||||||
android:layout_marginBottom="@dimen/l_50" />
|
android:text="@string/keep_dm_verity"
|
||||||
|
tools:checked="true" />
|
||||||
|
|
||||||
</FrameLayout>
|
<CheckBox
|
||||||
|
style="@style/WidgetFoundation.Checkbox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:checked="@={Info.keepEnc}"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/keep_force_encryption"
|
||||||
|
app:tint="?colorPrimary" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
style="@style/WidgetFoundation.Checkbox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:checked="@={Info.recovery}"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/recovery_mode"
|
||||||
|
app:tint="?colorPrimary" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -124,49 +141,37 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="?listPreferredItemHeightSmall">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/install_step_method_icon"
|
|
||||||
style="@style/WidgetFoundation.Icon"
|
style="@style/WidgetFoundation.Icon"
|
||||||
isSelected="@{viewModel.step > 1}"
|
isSelected="@{viewModel.step > 1}"
|
||||||
android:layout_marginStart="@dimen/l_25"
|
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" />
|
app:srcCompat="@drawable/ic_check_circle_md2" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/install_step_method_title"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="@dimen/l1"
|
android:layout_marginStart="@dimen/l1"
|
||||||
android:gravity="start"
|
|
||||||
android:text="@string/install_method_title"
|
android:text="@string/install_method_title"
|
||||||
android:textAppearance="@style/AppearanceFoundation.Body"
|
android:textAppearance="@style/AppearanceFoundation.Body"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:gravity="center_vertical"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/install_step_method_button"
|
android:layout_weight="1"/>
|
||||||
app:layout_constraintStart_toEndOf="@+id/install_step_method_icon"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/install_step_method_button"
|
|
||||||
style="@style/WidgetFoundation.Button.Text"
|
style="@style/WidgetFoundation.Button.Text"
|
||||||
gone="@{viewModel.step != 1}"
|
gone="@{viewModel.step != 1}"
|
||||||
isEnabled="@{viewModel.method == @id/method_patch ? viewModel.data != null : viewModel.method != -1}"
|
isEnabled="@{viewModel.method == @id/method_patch ? viewModel.data != null : viewModel.method != -1}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:onClick="@{() -> viewModel.step(2)}"
|
android:onClick="@{() -> viewModel.step(2)}"
|
||||||
android:text="@string/install_next"
|
android:text="@string/install_next" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
gone="@{viewModel.step != 1}"
|
gone="@{viewModel.step != 1}"
|
||||||
@ -180,7 +185,7 @@
|
|||||||
android:paddingStart="3dp"
|
android:paddingStart="3dp"
|
||||||
android:paddingEnd="3dp">
|
android:paddingEnd="3dp">
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<RadioButton
|
||||||
android:id="@+id/method_download"
|
android:id="@+id/method_download"
|
||||||
style="@style/WidgetFoundation.RadioButton"
|
style="@style/WidgetFoundation.RadioButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -188,14 +193,14 @@
|
|||||||
android:text="@string/download_zip_only"
|
android:text="@string/download_zip_only"
|
||||||
tools:checked="true" />
|
tools:checked="true" />
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<RadioButton
|
||||||
android:id="@+id/method_patch"
|
android:id="@+id/method_patch"
|
||||||
style="@style/WidgetFoundation.RadioButton"
|
style="@style/WidgetFoundation.RadioButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/select_patch_file" />
|
android:text="@string/select_patch_file" />
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<RadioButton
|
||||||
android:id="@+id/method_direct"
|
android:id="@+id/method_direct"
|
||||||
style="@style/WidgetFoundation.RadioButton"
|
style="@style/WidgetFoundation.RadioButton"
|
||||||
gone="@{!viewModel.rooted}"
|
gone="@{!viewModel.rooted}"
|
||||||
@ -203,7 +208,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/direct_install" />
|
android:text="@string/direct_install" />
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<RadioButton
|
||||||
android:id="@+id/method_inactive_slot"
|
android:id="@+id/method_inactive_slot"
|
||||||
style="@style/WidgetFoundation.RadioButton"
|
style="@style/WidgetFoundation.RadioButton"
|
||||||
gone="@{!viewModel.isRooted || !viewModel.isAB}"
|
gone="@{!viewModel.isRooted || !viewModel.isAB}"
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
<?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.core.Info" />
|
|
||||||
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:clipToPadding="false">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
tools:layout_gravity="center">
|
|
||||||
|
|
||||||
<com.google.android.material.checkbox.MaterialCheckBox
|
|
||||||
style="@style/WidgetFoundation.Checkbox"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:checked="@={Info.keepVerity}"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/keep_dm_verity"
|
|
||||||
tools:checked="true" />
|
|
||||||
|
|
||||||
<com.google.android.material.checkbox.MaterialCheckBox
|
|
||||||
style="@style/WidgetFoundation.Checkbox"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:checked="@={Info.keepEnc}"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/keep_force_encryption"
|
|
||||||
app:tint="?colorPrimary" />
|
|
||||||
|
|
||||||
<com.google.android.material.checkbox.MaterialCheckBox
|
|
||||||
style="@style/WidgetFoundation.Checkbox"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:checked="@={Info.recovery}"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/recovery_mode"
|
|
||||||
app:tint="?colorPrimary" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
|
|
||||||
</layout>
|
|
@ -174,7 +174,6 @@
|
|||||||
<item name="android:paddingStart">@dimen/l1</item>
|
<item name="android:paddingStart">@dimen/l1</item>
|
||||||
<item name="android:paddingEnd">@dimen/l1</item>
|
<item name="android:paddingEnd">@dimen/l1</item>
|
||||||
<item name="tint">?colorPrimary</item>
|
<item name="tint">?colorPrimary</item>
|
||||||
<item name="buttonCompat">@drawable/ic_compound_checkbox</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="WidgetFoundation.RadioButton" parent="Widget.AppCompat.CompoundButton.RadioButton">
|
<style name="WidgetFoundation.RadioButton" parent="Widget.AppCompat.CompoundButton.RadioButton">
|
||||||
@ -183,7 +182,6 @@
|
|||||||
<item name="android:paddingStart">@dimen/l1</item>
|
<item name="android:paddingStart">@dimen/l1</item>
|
||||||
<item name="android:paddingEnd">@dimen/l1</item>
|
<item name="android:paddingEnd">@dimen/l1</item>
|
||||||
<item name="tint">?colorPrimary</item>
|
<item name="tint">?colorPrimary</item>
|
||||||
<item name="buttonCompat">@drawable/ic_compound_checkbox</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="WidgetFoundation.ProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal">
|
<style name="WidgetFoundation.ProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal">
|
||||||
|
Loading…
Reference in New Issue
Block a user