2020-01-31 18:37:45 +00: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.core.InfoKt" />
|
|
|
|
|
|
|
|
<import type="com.topjohnwu.magisk.ui.home.MagiskState" />
|
|
|
|
|
|
|
|
<variable
|
|
|
|
name="viewModel"
|
|
|
|
type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
|
|
|
|
|
|
|
|
</data>
|
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
|
|
style="@style/WidgetFoundation.Card"
|
2020-01-31 18:37:45 +00:00
|
|
|
android:layout_width="match_parent"
|
2020-02-12 03:46:29 +00:00
|
|
|
android:layout_height="wrap_content">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:paddingTop="@dimen/l_50"
|
|
|
|
android:paddingStart="@dimen/l1"
|
|
|
|
android:paddingEnd="@dimen/l1"
|
|
|
|
android:paddingBottom="@dimen/l1"
|
|
|
|
tools:layout_gravity="center">
|
|
|
|
|
|
|
|
<ImageView
|
|
|
|
android:id="@+id/home_manager_icon"
|
|
|
|
style="@style/WidgetFoundation.Icon.Primary"
|
|
|
|
android:padding="@dimen/l_50"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
|
app:srcCompat="@drawable/ic_manager" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/home_manager_title"
|
|
|
|
android:layout_width="0dp"
|
2020-01-31 18:37:45 +00:00
|
|
|
android:layout_height="wrap_content"
|
2020-02-12 03:46:29 +00:00
|
|
|
android:layout_marginStart="@dimen/l1"
|
|
|
|
android:text="@{viewModel.stateHideManagerName}"
|
|
|
|
android:textAppearance="@style/AppearanceFoundation.Title"
|
|
|
|
android:textColor="?colorPrimary"
|
|
|
|
app:layout_constraintBottom_toBottomOf="@+id/home_manager_icon"
|
|
|
|
app:layout_constraintEnd_toStartOf="@+id/home_manager_action"
|
|
|
|
app:layout_constraintStart_toEndOf="@+id/home_manager_icon"
|
|
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
|
tools:text="@string/manager" />
|
|
|
|
|
|
|
|
<FrameLayout
|
|
|
|
android:id="@+id/home_manager_action"
|
|
|
|
invisible="@{viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
|
2020-01-31 18:37:45 +00:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2020-02-12 03:46:29 +00:00
|
|
|
app:layout_constraintBottom_toBottomOf="@+id/home_manager_title"
|
|
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="@+id/home_manager_title">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<com.google.android.material.button.MaterialButton
|
|
|
|
style="@style/WidgetFoundation.Button"
|
|
|
|
gone="@{viewModel.stateManager != MagiskState.OBSOLETE}"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:onClick="@{() -> viewModel.onManagerPressed()}"
|
|
|
|
android:text="@string/update"
|
|
|
|
android:textAllCaps="false"
|
|
|
|
app:icon="@drawable/ic_update_md2" />
|
|
|
|
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
|
|
style="@style/WidgetFoundation.Button.Text"
|
|
|
|
gone="@{viewModel.stateManager == MagiskState.OBSOLETE}"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:onClick="@{() -> viewModel.onManagerPressed()}"
|
|
|
|
android:text="@string/install"
|
|
|
|
android:textAllCaps="false"
|
|
|
|
app:icon="@drawable/ic_install" />
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</FrameLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<androidx.constraintlayout.widget.Barrier
|
|
|
|
android:id="@+id/home_manager_title_barrier"
|
2020-01-31 18:37:45 +00:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2020-02-12 03:46:29 +00:00
|
|
|
app:barrierDirection="bottom"
|
|
|
|
app:constraint_referenced_ids="home_manager_action,home_manager_title,home_manager_icon" />
|
|
|
|
|
|
|
|
<HorizontalScrollView
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:fadingEdgeLength="@dimen/l1"
|
|
|
|
android:paddingTop="@dimen/l_50"
|
|
|
|
android:requiresFadingEdge="horizontal"
|
|
|
|
android:scrollbars="none"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_manager_title_barrier">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<LinearLayout
|
2020-01-31 18:37:45 +00:00
|
|
|
android:layout_width="wrap_content"
|
2020-02-12 03:46:29 +00:00
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:orientation="horizontal">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
|
|
style="@style/W.Home.Card.First"
|
2020-01-31 18:37:45 +00:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content">
|
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<View
|
|
|
|
style="@style/W.Home.Section"
|
|
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_manager_latest_version"
|
|
|
|
style="@style/W.Home.Item.Top"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="parent" >
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="@string/module_section_remote" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{viewModel.isConnected ? viewModel.stateManagerRemoteVersion : @string/not_available}"
|
|
|
|
tools:text="8.0.0 (123) (10)" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_manager_installed_version"
|
|
|
|
style="@style/W.Home.Item"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_manager_latest_version">
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="@string/installed" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{viewModel.stateManagerInstalledVersion}"
|
|
|
|
tools:text="8.0.0 (123) (10)" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_manager_internal_mode"
|
|
|
|
style="@style/W.Home.Item"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_manager_installed_version">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="@string/status" />
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{InfoKt.isRunningAsStub ? @string/home_status_stub : @string/home_status_normal}"
|
|
|
|
tools:text="Normal" />
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</LinearLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/home_manager_internal_connection"
|
|
|
|
style="@style/W.Home.Item.Bottom"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintTop_toBottomOf="@+id/home_manager_internal_mode">
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<TextView
|
|
|
|
style="@style/W.Home.ItemContent"
|
|
|
|
android:text="@string/home_package" />
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<TextView
|
|
|
|
android:id="@+id/home_manager_extra_connection_value"
|
|
|
|
style="@style/W.Home.ItemContent.Right"
|
|
|
|
android:text="@{viewModel.statePackageName}"
|
|
|
|
tools:text="com.topjohnwu.magisk" />
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</LinearLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
<ProgressBar
|
|
|
|
style="@style/WidgetFoundation.ProgressBar"
|
|
|
|
gone="@{viewModel.stateManagerProgress == 0 || viewModel.stateManagerProgress == 100}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_gravity="bottom"
|
|
|
|
android:max="100"
|
|
|
|
android:progress="@{viewModel.stateManagerProgress}" />
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</com.google.android.material.card.MaterialCardView>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</LinearLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</HorizontalScrollView>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-12 03:46:29 +00:00
|
|
|
</com.google.android.material.card.MaterialCardView>
|
2020-01-31 18:37:45 +00:00
|
|
|
|
2020-02-10 01:03:05 +00:00
|
|
|
</layout>
|