2020-01-31 19:37:45 +01: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>
|
|
|
|
|
|
|
|
<import type="com.topjohnwu.magisk.core.Info" />
|
|
|
|
|
|
|
|
<import type="com.topjohnwu.magisk.ui.home.MagiskState" />
|
|
|
|
|
|
|
|
<variable
|
|
|
|
name="viewModel"
|
|
|
|
type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
|
|
|
|
|
|
|
|
</data>
|
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
|
|
style="@style/WidgetFoundation.Card"
|
2020-01-31 19:37:45 +01:00
|
|
|
android:layout_width="match_parent"
|
2020-09-21 13:27:29 +03:00
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:focusable="false">
|
2020-01-31 19:37:45 +01:00
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
2020-01-31 19:37:45 +01:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
2020-02-11 19:46:29 -08:00
|
|
|
android:paddingStart="@dimen/l1"
|
2020-09-21 13:27:29 +03:00
|
|
|
android:paddingTop="@dimen/l_50"
|
2020-01-31 19:37:45 +01:00
|
|
|
android:paddingEnd="@dimen/l1"
|
2020-09-08 23:40:44 -07:00
|
|
|
android:paddingBottom="@dimen/l_50"
|
2020-02-11 19:46:29 -08:00
|
|
|
tools:layout_gravity="center">
|
|
|
|
|
|
|
|
<ImageView
|
|
|
|
android:id="@+id/home_magisk_icon"
|
|
|
|
style="@style/WidgetFoundation.Icon.Primary"
|
|
|
|
android:padding="@dimen/l_25"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
|
app:srcCompat="@drawable/ic_magisk_outline" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/home_magisk_title"
|
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_marginStart="@dimen/l1"
|
|
|
|
android:text="@string/magisk"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Title"
|
|
|
|
android:textColor="?colorPrimary"
|
|
|
|
app:layout_constraintBottom_toBottomOf="@+id/home_magisk_icon"
|
2020-09-16 23:55:50 -07:00
|
|
|
app:layout_constraintEnd_toStartOf="@+id/home_magisk_button"
|
2020-02-11 19:46:29 -08:00
|
|
|
app:layout_constraintStart_toEndOf="@+id/home_magisk_icon"
|
|
|
|
app:layout_constraintTop_toTopOf="@+id/home_magisk_icon" />
|
|
|
|
|
2020-09-16 23:55:50 -07:00
|
|
|
<Button
|
|
|
|
android:id="@+id/home_magisk_button"
|
|
|
|
style="@style/WidgetFoundation.Button"
|
|
|
|
invisible="@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
|
2020-09-24 03:16:43 -07:00
|
|
|
android:enabled="@{viewModel.stateManager != MagiskState.OBSOLETE}"
|
2020-02-11 19:46:29 -08:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2020-09-16 23:55:50 -07:00
|
|
|
android:onClick="@{() -> viewModel.onMagiskPressed()}"
|
|
|
|
android:text="@string/update"
|
|
|
|
android:textAllCaps="false"
|
|
|
|
app:icon="@drawable/ic_update_md2"
|
2020-02-11 19:46:29 -08:00
|
|
|
app:layout_constraintBottom_toBottomOf="@+id/home_magisk_title"
|
|
|
|
app:layout_constraintEnd_toEndOf="parent"
|
2020-09-16 23:55:50 -07:00
|
|
|
app:layout_constraintTop_toTopOf="@+id/home_magisk_title"/>
|
2020-02-11 19:46:29 -08:00
|
|
|
|
2020-09-16 23:55:50 -07:00
|
|
|
<Button
|
|
|
|
style="@style/WidgetFoundation.Button.Text"
|
|
|
|
invisible="@{viewModel.stateMagisk == MagiskState.OBSOLETE}"
|
2020-09-24 03:16:43 -07:00
|
|
|
android:enabled="@{viewModel.stateManager != MagiskState.OBSOLETE}"
|
2020-09-16 23:55:50 -07:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:onClick="@{() -> viewModel.onMagiskPressed()}"
|
|
|
|
android:text="@string/install"
|
|
|
|
android:textAllCaps="false"
|
|
|
|
app:icon="@drawable/ic_install"
|
|
|
|
app:layout_constraintBottom_toBottomOf="@+id/home_magisk_title"
|
|
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="@+id/home_magisk_title"/>
|
2020-02-11 19:46:29 -08:00
|
|
|
|
|
|
|
<androidx.constraintlayout.widget.Barrier
|
|
|
|
android:id="@+id/home_magisk_title_barrier"
|
2020-01-31 19:37:45 +01:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2020-02-11 19:46:29 -08:00
|
|
|
app:barrierDirection="bottom"
|
2020-09-16 23:55:50 -07:00
|
|
|
tools:constraint_referenced_ids="home_magisk_button,home_magisk_title,home_magisk_icon" />
|
2020-01-31 19:37:45 +01:00
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
<HorizontalScrollView
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:fadingEdgeLength="@dimen/l1"
|
|
|
|
android:requiresFadingEdge="horizontal"
|
|
|
|
android:scrollbars="none"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_magisk_title_barrier">
|
|
|
|
|
|
|
|
<LinearLayout
|
2020-02-01 13:56:56 +01:00
|
|
|
android:layout_width="wrap_content"
|
2020-02-11 19:46:29 -08:00
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:orientation="horizontal">
|
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
2020-02-12 13:26:10 -08:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content">
|
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_magisk_latest_version"
|
|
|
|
style="@style/W.Home.Item.Top"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
2020-09-21 13:27:29 +03:00
|
|
|
app:layout_constraintTop_toTopOf="parent">
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
2020-02-29 14:49:06 -08:00
|
|
|
android:text="@string/home_latest_version" />
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
2020-08-31 03:56:36 +08:00
|
|
|
android:text="@{viewModel.loadFailed ? @string/not_available : viewModel.magiskRemoteVersion }"
|
2020-02-27 01:43:00 -08:00
|
|
|
tools:text="20.1 (12345)" />
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
</LinearLayout>
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_magisk_installed_version"
|
2020-09-23 04:40:44 -07:00
|
|
|
style="@style/W.Home.Item"
|
2020-02-27 01:43:00 -08:00
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_magisk_latest_version">
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
2020-02-29 14:49:06 -08:00
|
|
|
android:text="@string/home_installed_version" />
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
2020-07-12 03:17:50 -07:00
|
|
|
android:text="@{Info.env.isActive ? viewModel.magiskInstalledVersion : @string/not_available}"
|
2020-02-27 01:43:00 -08:00
|
|
|
tools:text="20.1 (12345)" />
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
</LinearLayout>
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-09-23 04:40:44 -07:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_device_details_recovery"
|
|
|
|
style="@style/W.Home.Item.Bottom"
|
|
|
|
app:layout_constraintStart_toStartOf="@+id/home_magisk_installed_version"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_magisk_installed_version">
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="Ramdisk" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{Info.ramdisk ? @string/yes : @string/no }"
|
|
|
|
tools:text="Yes" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
2020-02-27 01:43:00 -08:00
|
|
|
<androidx.constraintlayout.widget.Barrier
|
|
|
|
android:id="@+id/home_magisk_barrier"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
app:barrierDirection="end"
|
2020-09-08 23:40:44 -07:00
|
|
|
tools:constraint_referenced_ids="home_magisk_latest_version,home_magisk_installed_version"/>
|
2020-02-27 01:43:00 -08:00
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_device_details_ab"
|
|
|
|
style="@style/W.Home.Item.Top"
|
|
|
|
app:layout_constraintStart_toStartOf="@id/home_magisk_barrier"
|
|
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="A/B" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{Info.isAB ? @string/yes : @string/no}"
|
|
|
|
tools:text="Yes" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_device_details_sar"
|
|
|
|
style="@style/W.Home.Item"
|
|
|
|
app:layout_constraintStart_toStartOf="@+id/home_device_details_ab"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_device_details_ab">
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="SAR" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{Info.isSAR ? @string/yes : @string/no}"
|
|
|
|
tools:text="Yes" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
|
|
|
<LinearLayout
|
2020-09-23 04:40:44 -07:00
|
|
|
android:id="@+id/home_device_details_crypto"
|
2020-02-27 01:43:00 -08:00
|
|
|
style="@style/W.Home.Item.Bottom"
|
|
|
|
app:layout_constraintStart_toStartOf="@+id/home_device_details_sar"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_device_details_sar">
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
2020-09-23 04:40:44 -07:00
|
|
|
android:text="Crypto" />
|
2020-02-27 01:43:00 -08:00
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
2020-09-28 04:45:56 -07:00
|
|
|
android:text="@{Info.cryptoText}"
|
2020-09-23 04:40:44 -07:00
|
|
|
tools:text="N/A" />
|
2020-02-27 01:43:00 -08:00
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
2020-02-12 13:26:10 -08:00
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
</LinearLayout>
|
2020-02-01 13:56:56 +01:00
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
</HorizontalScrollView>
|
2020-01-31 19:37:45 +01:00
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
2020-01-31 19:37:45 +01:00
|
|
|
|
2020-02-11 19:46:29 -08:00
|
|
|
</com.google.android.material.card.MaterialCardView>
|
2020-01-31 19:37:45 +01:00
|
|
|
|
2020-02-09 17:03:05 -08:00
|
|
|
</layout>
|