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

113 lines
4.8 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
style="@style/WidgetFoundation.Card.Variant"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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:layout_width="match_parent"
2019-11-04 16:45:54 +01:00
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
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"
android:src="@{item.item.info.icon}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0"
tools:src="@drawable/ic_magisk" />
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"
android:text="@{item.item.info.name}"
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"
gone="@{item.item.info.info.packageName.empty}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@{item.item.info.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"
2020-08-10 07:05:07 -07:00
android:layout_width="wrap_content"
android:layout_height="wrap_content"
2019-11-04 16:45:54 +01:00
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
2020-08-10 07:05:07 -07:00
state="@={item.hiddenState}"/>
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}"
items="@{item.items}"
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"
android:layout_width="match_parent"
android:layout_gravity="top"
android:progress="@{item.itemsCheckedPercent}" />
</com.google.android.material.card.MaterialCardView>
2020-01-13 00:43:09 +08:00
</layout>