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

196 lines
8.5 KiB
XML
Raw Normal View History

2019-10-03 17:31:45 +02:00
<?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>
2020-08-09 02:32:13 -07:00
<import type="com.topjohnwu.magisk.core.Info" />
<import type="com.topjohnwu.magisk.ui.home.MagiskState" />
<import type="com.topjohnwu.magisk.ui.home.DeveloperItem"/>
2020-08-09 06:52:02 -07:00
2019-10-03 17:31:45 +02:00
<variable
name="viewModel"
2020-01-13 00:43:09 +08:00
type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
2019-10-03 17:31:45 +02:00
</data>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
2019-11-25 17:25:49 +01:00
android:fillViewport="true"
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l3}"
2019-10-03 17:31:45 +02:00
tools:layout_marginTop="24dp">
<LinearLayout
android:layout_width="match_parent"
2019-11-25 17:25:49 +01:00
android:layout_height="match_parent"
android:clipToPadding="false"
2019-10-26 20:59:30 +02:00
android:orientation="vertical"
android:paddingTop="@dimen/l1">
2019-10-03 17:31:45 +02:00
<Button
android:layout_gravity="center"
style="@style/WidgetFoundation.Button"
2020-02-28 11:53:25 -08:00
gone="@{!viewModel.showTest}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.onTestPressed()}"
android:text="TEST"
android:textAllCaps="false"
tools:visibility="gone"/>
<com.google.android.material.card.MaterialCardView
2019-11-25 17:54:04 +01:00
style="@style/WidgetFoundation.Card.Primary"
goneUnless="@{viewModel.noticeVisible}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:layout_marginBottom="@dimen/l1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
2020-02-11 19:46:29 -08:00
<TextView
android:id="@+id/home_notice_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="@dimen/l1"
android:text="@string/home_notice_content"
android:textAppearance="@style/AppearanceFoundation.Caption.OnPrimary"
app:layout_constraintEnd_toStartOf="@+id/home_notice_hide"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/home_notice_hide"
style="@style/WidgetFoundation.Button.Text.OnPrimary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.hideNotice()}"
2020-02-10 01:43:28 -08:00
android:text="@string/hide"
android:textAllCaps="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<include
android:id="@+id/home_magisk_wrapper"
layout="@layout/include_home_magisk"
viewModel="@{viewModel}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2020-02-11 19:46:29 -08:00
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
app:layout_constraintTop_toBottomOf="@+id/home_device_wrapper" />
<include
android:id="@+id/home_manager_wrapper"
layout="@layout/include_home_manager"
viewModel="@{viewModel}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2020-02-11 19:46:29 -08:00
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:layout_marginTop="@dimen/l1"
app:layout_constraintTop_toBottomOf="@+id/home_magisk_wrapper" />
2019-10-03 17:31:45 +02:00
2020-08-09 04:39:12 -07:00
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/l1"
2020-08-31 03:56:36 +08:00
gone="@{!viewModel.showSafetyNet &amp;&amp; !viewModel.showUninstall}" />
2020-08-09 04:39:12 -07:00
<Button
2020-08-09 02:32:13 -07:00
style="@style/WidgetFoundation.Button.Outlined"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/home_check_safetynet"
android:textAllCaps="false"
android:textSize="12sp"
android:onClick="@{() -> viewModel.onSafetyNetPressed()}"
2020-08-31 03:56:36 +08:00
gone="@{!viewModel.showSafetyNet}"
2020-08-09 02:32:13 -07:00
app:cornerRadius="@dimen/r1"
app:icon="@drawable/ic_safetynet_md2" />
<Button
2020-08-09 02:32:13 -07:00
style="@style/WidgetFoundation.Button.Outlined.Error"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/uninstall_magisk_title"
android:textAllCaps="false"
android:textSize="12sp"
android:onClick="@{() -> viewModel.onDeletePressed()}"
2020-08-09 04:39:12 -07:00
gone="@{!viewModel.showUninstall}"
2020-08-09 02:32:13 -07:00
app:cornerRadius="@dimen/r1"
app:icon="@drawable/ic_delete_md2" />
2019-11-25 17:25:49 +01:00
<com.google.android.material.card.MaterialCardView
2019-12-02 18:39:22 +01:00
style="@style/WidgetFoundation.Card"
2019-10-03 17:31:45 +02:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2019-11-25 17:25:49 +01:00
android:layout_gravity="bottom"
android:layout_margin="@dimen/l1">
2019-11-25 17:25:49 +01:00
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/l1">
2020-02-11 19:46:29 -08:00
<TextView
2019-11-25 17:25:49 +01:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:text="@string/home_support_title"
2019-12-02 18:39:22 +01:00
android:textAppearance="@style/AppearanceFoundation.Title" />
2019-11-25 17:25:49 +01:00
2020-02-11 19:46:29 -08:00
<TextView
2019-11-25 17:25:49 +01:00
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:text="@string/home_support_content"
2019-12-02 18:39:22 +01:00
android:textAppearance="@style/AppearanceFoundation.Caption.Variant" />
2019-11-25 17:25:49 +01:00
2020-08-09 06:52:02 -07:00
<include
layout="@layout/item_developer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l_50"
viewModel="@{viewModel}"
item="@{DeveloperItem.Main.INSTANCE}" />
<include
layout="@layout/item_developer"
android:layout_width="wrap_content"
2019-11-25 17:25:49 +01:00
android:layout_height="wrap_content"
2020-08-09 06:52:02 -07:00
android:layout_marginTop="@dimen/l_50"
viewModel="@{viewModel}"
item="@{DeveloperItem.App.INSTANCE}" />
2019-11-25 17:25:49 +01:00
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
2019-10-03 17:31:45 +02:00
</LinearLayout>
</androidx.core.widget.NestedScrollView>
2020-01-12 16:07:30 +08:00
</layout>