Files
Magisk/app/src/main/res/layout/item_hide_process_md2.xml
Viktor De Pasquale 9952387356 Updated layouts to fit new widget that should visually represent a switch
The switch is not actually a switch, but a representation of internal state, the layouts continue to accept touch events as beforehand.
2020-02-11 10:42:05 -08:00

58 lines
2.3 KiB
XML

<?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>
<variable
name="item"
type="com.topjohnwu.magisk.model.entity.recycler.HideProcessItem" />
<variable
name="viewModel"
type="com.topjohnwu.magisk.ui.hide.HideViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:alpha="@{item.isHidden() ? 1f : .7f}"
android:background="?selectableItemBackground"
android:onClick="@{() -> item.toggle(viewModel)}">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginTop="@dimen/l_75"
android:layout_marginEnd="@dimen/l1"
android:layout_marginBottom="@dimen/l_75"
android:singleLine="true"
android:text="@{item.item.name}"
android:textAppearance="@style/AppearanceFoundation.Caption.Variant"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/hide_process_checkbox"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="com.topjohnwu.magisk" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/hide_process_checkbox"
style="@style/WidgetFoundation.Image.Small"
isSelected="@{item.isHidden}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/l_50"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/bg_checkbox"
app:srcCompat="@drawable/ic_checkbox" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>