Initial: initial commit
This commit is contained in:
64
design/src/main/res/layout/adapter_app.xml
Normal file
64
design/src/main/res/layout/adapter_app.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<data>
|
||||
<variable
|
||||
name="app"
|
||||
type="com.github.kr328.clash.design.model.AppInfo" />
|
||||
<variable
|
||||
name="selected"
|
||||
type="boolean" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:minHeight="@dimen/item_min_height"
|
||||
android:paddingEnd="@dimen/item_tailing_margin">
|
||||
|
||||
<View
|
||||
android:id="@+id/icon_view"
|
||||
android:layout_width="@dimen/item_header_component_size"
|
||||
android:layout_height="@dimen/item_header_component_size"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginHorizontal="@dimen/item_header_margin"
|
||||
android:background="@{app.icon}"
|
||||
android:clickable="false"
|
||||
android:focusable="false" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@id/switch_view"
|
||||
android:layout_toEndOf="@id/icon_view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{app.label}"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/item_text_margin"
|
||||
android:text="@{app.packageName}"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/switch_view"
|
||||
android:layout_width="@dimen/item_tailing_component_size"
|
||||
android:layout_height="@dimen/item_tailing_component_size"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:checked="@{selected}"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center_horizontal|end" />
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user