2019-10-30 20:58:42 +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>
|
|
|
|
|
2019-11-04 15:45:54 +00:00
|
|
|
<import type="com.topjohnwu.magisk.R" />
|
|
|
|
|
2019-10-30 20:58:42 +00:00
|
|
|
<variable
|
|
|
|
name="item"
|
|
|
|
type="com.topjohnwu.magisk.model.entity.recycler.HideItem" />
|
|
|
|
|
|
|
|
<variable
|
|
|
|
name="viewModel"
|
|
|
|
type="com.topjohnwu.magisk.redesign.hide.HideViewModel" />
|
|
|
|
|
|
|
|
</data>
|
|
|
|
|
|
|
|
<com.google.android.material.card.MaterialCardView
|
2019-12-02 17:53:55 +00:00
|
|
|
style="@style/WidgetFoundation.Card.Variant"
|
2019-10-30 20:58:42 +00:00
|
|
|
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 15:45:54 +00:00
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
2019-10-30 20:58:42 +00:00
|
|
|
android:layout_width="match_parent"
|
2019-11-04 15:45:54 +00:00
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:background="?selectableItemBackground"
|
|
|
|
android:onClick="@{(v) -> item.toggle(v)}">
|
|
|
|
|
|
|
|
<androidx.appcompat.widget.AppCompatImageView
|
|
|
|
android:id="@+id/hide_icon"
|
2019-11-22 18:29:53 +00:00
|
|
|
style="@style/WidgetFoundation.Image"
|
2019-11-04 15:45:54 +00:00
|
|
|
android:layout_margin="@dimen/l1"
|
|
|
|
android:alpha="@{item.isExpanded ? 0.1f : 1f}"
|
|
|
|
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" />
|
|
|
|
|
|
|
|
<androidx.appcompat.widget.AppCompatImageView
|
|
|
|
android:id="@+id/hide_action"
|
2019-11-22 18:29:53 +00:00
|
|
|
style="@style/WidgetFoundation.Image"
|
2019-11-04 16:40:13 +00:00
|
|
|
isSelected="@{item.itemsCheckedPercent == 100}"
|
2019-11-04 15:45:54 +00:00
|
|
|
goneUnless="@{item.isExpanded}"
|
|
|
|
android:layout_margin="@dimen/l1"
|
|
|
|
android:background="?selectableItemBackgroundBorderless"
|
|
|
|
android:onClick="@{() -> item.toggle(viewModel)}"
|
|
|
|
android:padding="@dimen/l_25"
|
|
|
|
app:layout_constraintBottom_toBottomOf="@+id/hide_icon"
|
|
|
|
app:layout_constraintEnd_toEndOf="@+id/hide_icon"
|
|
|
|
app:layout_constraintStart_toStartOf="@+id/hide_icon"
|
|
|
|
app:layout_constraintTop_toTopOf="@+id/hide_icon"
|
2019-11-04 16:40:13 +00:00
|
|
|
app:srcCompat="@drawable/ic_hide_select_md2" />
|
2019-11-04 15:45:54 +00:00
|
|
|
|
|
|
|
<androidx.appcompat.widget.AppCompatTextView
|
|
|
|
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}"
|
2019-11-22 18:29:53 +00:00
|
|
|
android:textAppearance="@style/AppearanceFoundation.Body"
|
2019-11-04 15:45:54 +00: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" />
|
|
|
|
|
|
|
|
<androidx.appcompat.widget.AppCompatTextView
|
|
|
|
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}"
|
2019-11-22 18:29:53 +00:00
|
|
|
android:textAppearance="@style/AppearanceFoundation.Caption.Variant"
|
2019-11-04 15:45:54 +00: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" />
|
|
|
|
|
|
|
|
<androidx.appcompat.widget.AppCompatImageView
|
|
|
|
android:id="@+id/hide_expand_icon"
|
2019-11-22 18:29:53 +00:00
|
|
|
style="@style/WidgetFoundation.Icon"
|
2019-11-04 15:45:54 +00:00
|
|
|
invisible="@{item.item.processes.empty}"
|
|
|
|
srcCompat="@{item.isExpanded ? R.drawable.ic_close : R.drawable.ic_back_md2}"
|
|
|
|
android:background="@null"
|
|
|
|
android:rotation="180"
|
|
|
|
android:rotationX="@{item.isExpanded ? 180 : 0}"
|
|
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
|
tools:srcCompat="@drawable/ic_back_md2" />
|
|
|
|
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
2019-10-30 20:58:42 +00:00
|
|
|
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
2019-11-04 15:45:54 +00:00
|
|
|
goneUnless="@{item.isExpanded}"
|
2019-10-30 20:58:42 +00:00
|
|
|
itemBinding="@{viewModel.itemInternalBinding}"
|
|
|
|
items="@{item.items}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
2019-11-04 15:45:54 +00:00
|
|
|
android:background="?colorSurfaceVariant"
|
2019-10-30 20:58:42 +00:00
|
|
|
android:orientation="vertical"
|
|
|
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
2019-11-04 15:45:54 +00:00
|
|
|
tools:itemCount="2"
|
2019-10-30 20:58:42 +00:00
|
|
|
tools:listitem="@layout/item_hide_process_md2" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
|
|
|
<ProgressBar
|
2019-11-22 18:29:53 +00:00
|
|
|
style="@style/WidgetFoundation.ProgressBar"
|
2019-10-30 20:58:42 +00:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_gravity="top"
|
2019-11-12 16:23:27 +00:00
|
|
|
android:progress="@{item.itemsCheckedPercent}" />
|
2019-10-30 20:58:42 +00:00
|
|
|
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|
|
|
|
|
|
|
|
</layout>
|