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

211 lines
9.4 KiB
XML
Raw Normal View History

<?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"
android:layout_width="match_parent"
2020-02-11 19:46:29 -08:00
android:layout_height="wrap_content">
2020-02-11 19:46:29 -08:00
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/l_50"
2020-02-11 19:46:29 -08:00
android:paddingStart="@dimen/l1"
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-08-09 02:32:13 -07:00
app:layout_constraintEnd_toStartOf="@+id/home_magisk_action"
2020-02-11 19:46:29 -08:00
app:layout_constraintStart_toEndOf="@+id/home_magisk_icon"
app:layout_constraintTop_toTopOf="@+id/home_magisk_icon" />
<FrameLayout
android:id="@+id/home_magisk_action"
invisible="@{viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/home_magisk_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/home_magisk_title">
<Button
2020-02-11 19:46:29 -08:00
style="@style/WidgetFoundation.Button"
gone="@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.onMagiskPressed()}"
android:text="@string/update"
android:textAllCaps="false"
app:icon="@drawable/ic_update_md2" />
<Button
2020-02-11 19:46:29 -08:00
style="@style/WidgetFoundation.Button.Text"
gone="@{viewModel.stateMagisk == MagiskState.OBSOLETE}"
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" />
2020-02-11 19:46:29 -08:00
</FrameLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/home_magisk_title_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2020-02-11 19:46:29 -08:00
app:barrierDirection="bottom"
2020-02-27 01:43:00 -08:00
tools:constraint_referenced_ids="home_magisk_action,home_magisk_title,home_magisk_icon" />
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
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"
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"
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-08 23:40:44 -07:00
style="@style/W.Home.Item.Bottom"
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"
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-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
android:id="@+id/home_device_details_recovery"
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"
android:text="Ramdisk" />
<TextView
style="@style/W.Home.ItemContent.Right"
android:text="@{Info.ramdisk ? @string/yes : @string/no }"
tools:text="Yes" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
2020-02-12 13:26:10 -08:00
2020-02-11 19:46:29 -08:00
</LinearLayout>
2020-02-11 19:46:29 -08:00
</HorizontalScrollView>
2020-02-11 19:46:29 -08:00
</androidx.constraintlayout.widget.ConstraintLayout>
2020-02-11 19:46:29 -08:00
</com.google.android.material.card.MaterialCardView>
2020-02-09 17:03:05 -08:00
</layout>