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

120 lines
5.1 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>
2019-11-04 16:45:54 +01:00
<import type="com.topjohnwu.magisk.R" />
<variable
name="item"
type="com.topjohnwu.magisk.ui.hide.HideItem" />
<variable
name="viewModel"
2020-01-13 00:43:09 +08:00
type="com.topjohnwu.magisk.ui.hide.HideViewModel" />
</data>
<com.google.android.material.card.MaterialCardView
2020-09-17 02:27:43 -07:00
style="@style/WidgetFoundation.Card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
tools:layout_gravity="center"
tools:layout_marginBottom="@dimen/l1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
2019-11-04 16:45:54 +01:00
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/hide_expand"
android:layout_width="match_parent"
2019-11-04 16:45:54 +01:00
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:nextFocusRight="@id/hide_expand_icon"
2020-08-10 07:05:07 -07:00
android:onClick="@{item::toggleExpand}">
2019-11-04 16:45:54 +01:00
2020-08-10 07:05:07 -07:00
<ImageView
2019-11-04 16:45:54 +01:00
android:id="@+id/hide_icon"
style="@style/WidgetFoundation.Image"
2019-11-04 16:45:54 +01:00
android:layout_margin="@dimen/l1"
2020-08-26 04:23:43 -07:00
android:src="@{item.info.iconImage}"
2019-11-04 16:45:54 +01:00
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0"
2020-08-26 04:23:43 -07:00
tools:src="@drawable/ic_launcher" />
2019-11-04 16:45:54 +01:00
2020-08-10 07:05:07 -07:00
<TextView
2019-11-04 16:45:54 +01:00
android:id="@+id/hide_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:ellipsize="middle"
android:singleLine="true"
2020-08-26 04:23:43 -07:00
android:text="@{item.info.label}"
android:textAppearance="@style/AppearanceFoundation.Body"
2019-11-04 16:45:54 +01:00
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/hide_package"
app:layout_constraintEnd_toStartOf="@+id/hide_expand_icon"
app:layout_constraintStart_toEndOf="@+id/hide_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@string/app_name" />
2020-08-10 07:05:07 -07:00
<TextView
2019-11-04 16:45:54 +01:00
android:id="@+id/hide_package"
android:layout_width="0dp"
android:layout_height="wrap_content"
2020-08-26 04:23:43 -07:00
android:text="@{item.info.packageName}"
android:textAppearance="@style/AppearanceFoundation.Caption.Variant"
2019-11-04 16:45:54 +01:00
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/hide_name"
app:layout_constraintStart_toStartOf="@+id/hide_name"
app:layout_constraintTop_toBottomOf="@+id/hide_name"
tools:text="com.topjohnwu.magisk" />
2020-08-10 07:05:07 -07:00
<com.topjohnwu.widget.IndeterminateCheckBox
2019-11-04 16:45:54 +01:00
android:id="@+id/hide_expand_icon"
state="@={item.hiddenState}"
2020-08-27 05:46:41 -07:00
android:layout_width="0dp"
2020-08-10 07:05:07 -07:00
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/l1"
2020-08-27 05:46:41 -07:00
android:minWidth="0dp"
android:minHeight="0dp"
android:nextFocusLeft="@id/hide_expand"
2019-11-04 16:45:54 +01:00
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
2019-11-04 16:45:54 +01:00
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
2019-11-04 16:45:54 +01:00
goneUnless="@{item.isExpanded}"
itemBinding="@{viewModel.itemInternalBinding}"
2020-08-26 04:23:43 -07:00
items="@{item.processes}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
2019-11-04 16:45:54 +01:00
android:background="?colorSurfaceVariant"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
2019-11-04 16:45:54 +01:00
tools:itemCount="2"
tools:listitem="@layout/item_hide_process_md2" />
</LinearLayout>
<ProgressBar
style="@style/WidgetFoundation.ProgressBar"
gone="@{item.checkedPercent == 0}"
android:layout_width="match_parent"
android:layout_gravity="top"
2020-08-26 04:23:43 -07:00
android:progress="@{item.checkedPercent}" />
</com.google.android.material.card.MaterialCardView>
2020-01-13 00:43:09 +08:00
</layout>