Initial: initial commit

This commit is contained in:
kr328
2021-05-15 00:51:08 +08:00
commit 07e8afa69a
483 changed files with 26328 additions and 0 deletions

View 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>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/item_padding_vertical"
android:paddingStart="@dimen/item_header_margin"
android:paddingEnd="@dimen/item_tailing_margin">
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/delete_view"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<ImageView
android:id="@+id/delete_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:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/delete"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_close" />
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/item_padding_vertical"
android:paddingStart="@dimen/item_header_margin"
android:paddingEnd="@dimen/item_tailing_margin">
<TextView
android:id="@+id/key_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/delete_view"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:id="@+id/value_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/key_view"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/delete_view"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
<ImageView
android:id="@+id/delete_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:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/delete"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_close" />
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="file"
type="com.github.kr328.clash.design.model.File" />
<variable
name="currentTime"
type="com.github.kr328.clash.design.ui.ObservableCurrentTime" />
<variable
name="open"
type="android.view.View.OnClickListener" />
<variable
name="more"
type="android.view.View.OnClickListener" />
<import type="com.github.kr328.clash.design.util.I18nKt" />
<import type="com.github.kr328.clash.design.util.IntervalKt" />
<import type="android.view.View" />
</data>
<RelativeLayout
android:id="@+id/root_view"
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:nextFocusRight="@id/menu_view"
android:onClick="@{open}">
<View
android:id="@+id/icon_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_centerVertical="true"
android:layout_marginHorizontal="@dimen/item_header_margin"
android:background="@{file.directory ? @drawable/ic_outline_folder : @drawable/ic_outline_article}"
android:backgroundTint="?attr/colorControlNormal"
android:gravity="center" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/elapsed_view"
android:layout_toEndOf="@id/icon_view"
android:orientation="vertical"
android:paddingVertical="@dimen/item_padding_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{file.name}"
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="@{file.directory ? null : I18nKt.toBytesString(file.size)}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:visibility="@{file.directory ? View.GONE : View.VISIBLE}" />
</LinearLayout>
<TextView
android:id="@+id/elapsed_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/item_midden_margin"
android:layout_toStartOf="@id/menu_view"
android:text="@{file.directory ? null : IntervalKt.elapsedIntervalString(currentTime.value - file.lastModified, context)}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Tooltip"
android:visibility="@{file.directory ? View.GONE : View.VISIBLE}" />
<View
android:layout_width="@dimen/divider_size"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/menu_view"
android:background="?attr/colorControlHighlight"
android:minHeight="@{@dimen/item_tailing_component_size * 1.5f}" />
<FrameLayout
android:id="@+id/menu_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:nextFocusLeft="@id/root_view"
android:onClick="@{more}">
<View
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_margin="@dimen/item_tailing_margin"
android:background="@drawable/ic_baseline_more_vert" />
</FrameLayout>
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="message"
type="com.github.kr328.clash.core.model.LogMessage" />
<import type="com.github.kr328.clash.design.util.I18nKt" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingHorizontal="@dimen/logcat_padding_horizontal"
android:paddingVertical="@dimen/logcat_padding_vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:text="@{message.level.name()}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
android:textColor="?colorControlActivated" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:text="@{I18nKt.format(message.time, context, false, true)}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
android:textColor="?colorControlActivated" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:text="@{message.message}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="profile"
type="com.github.kr328.clash.service.model.Profile" />
<variable
name="currentTime"
type="com.github.kr328.clash.design.ui.ObservableCurrentTime" />
<variable
name="clicked"
type="android.view.View.OnClickListener" />
<variable
name="menu"
type="android.view.View.OnClickListener" />
<import type="com.github.kr328.clash.design.util.I18nKt" />
<import type="com.github.kr328.clash.design.util.IntervalKt" />
</data>
<RelativeLayout
android:id="@+id/root_view"
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:nextFocusRight="@id/menu_view"
android:onClick="@{clicked}">
<RadioButton
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:checked="@{profile.active}"
android:clickable="false"
android:focusable="false"
android:gravity="center" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/elapsed_view"
android:layout_toEndOf="@id/icon_view"
android:orientation="vertical"
android:paddingVertical="@dimen/item_padding_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{profile.name}"
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="@{profile.pending ? @string/format_type_unsaved(I18nKt.toString(profile.type, context)) : I18nKt.toString(profile.type, context)}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
<TextView
android:id="@+id/elapsed_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/item_midden_margin"
android:layout_toStartOf="@id/menu_view"
android:text="@{IntervalKt.elapsedIntervalString(currentTime.value - profile.updatedAt, context)}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Tooltip" />
<View
android:layout_width="@dimen/divider_size"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/menu_view"
android:background="?attr/colorControlHighlight"
android:minHeight="@{@dimen/item_tailing_component_size * 1.5f}" />
<FrameLayout
android:id="@+id/menu_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:nextFocusLeft="@id/root_view"
android:onClick="@{menu}">
<View
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_margin="@dimen/item_tailing_margin"
android:background="@drawable/ic_baseline_more_vert" />
</FrameLayout>
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="provider"
type="com.github.kr328.clash.design.model.ProfileProvider" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="@dimen/item_padding_vertical">
<View
android:layout_width="@dimen/item_header_component_size"
android:layout_height="@dimen/item_header_component_size"
android:layout_marginHorizontal="@dimen/item_header_margin"
android:background="@{provider.icon}" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{provider.name}"
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="@{provider.summary}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="provider"
type="com.github.kr328.clash.core.model.Provider" />
<variable
name="state"
type="com.github.kr328.clash.design.model.ProviderState" />
<variable
name="currentTime"
type="com.github.kr328.clash.design.ui.ObservableCurrentTime" />
<variable
name="update"
type="android.view.View.OnClickListener" />
<import type="com.github.kr328.clash.design.util.I18nKt" />
<import type="com.github.kr328.clash.design.util.IntervalKt" />
<import type="android.view.View" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/item_min_height"
android:paddingStart="@dimen/item_header_margin"
android:paddingEnd="0dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/elapsed_view"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{provider.name}"
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="@{I18nKt.type(provider, context)}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
<TextView
android:id="@+id/elapsed_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/item_midden_margin"
android:layout_toStartOf="@id/end_view"
android:text="@{IntervalKt.elapsedIntervalString(currentTime.value - state.updatedAt, context)}" />
<View
android:layout_width="@dimen/divider_size"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/end_view"
android:background="?attr/colorControlHighlight"
android:minHeight="@{@dimen/item_tailing_component_size * 1.5f}" />
<FrameLayout
android:id="@+id/end_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="?attr/selectableItemBackground"
android:clickable="@{!state.updating}"
android:focusable="@{!state.updating}"
android:nextFocusLeft="@id/root_view"
android:onClick="@{update}">
<ImageView
android:id="@+id/update_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="center"
android:layout_margin="@dimen/item_tailing_margin"
android:contentDescription="@string/more"
android:src="@drawable/ic_baseline_swap_vert"
android:visibility="@{state.updating ? View.GONE : View.VISIBLE}" />
<ProgressBar
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="center"
android:layout_margin="@dimen/item_tailing_margin"
android:visibility="@{state.updating ? View.VISIBLE : View.GONE}" />
</FrameLayout>
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="appInfo"
type="com.github.kr328.clash.design.model.AppInfo" />
<variable
name="selected"
type="boolean" />
<import type="android.view.View" />
</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:paddingVertical="@dimen/item_padding_vertical">
<View
android:id="@+id/icon_view"
android:layout_width="@dimen/item_header_component_size"
android:layout_height="@dimen/item_header_component_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginHorizontal="@dimen/item_header_margin"
android:background="@{appInfo.icon}" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/selected_view"
android:layout_toEndOf="@id/icon_view"
android:orientation="vertical">
<TextView
android:id="@+id/label_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{appInfo.label}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:id="@+id/package_name_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:text="@{appInfo.packageName}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:visibility="@{appInfo.packageName.length() == 0 ? View.GONE : View.VISIBLE}" />
</LinearLayout>
<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/selected_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:layout_marginHorizontal="@dimen/item_tailing_margin"
android:checked="@{selected}"
android:clickable="false"
android:focusable="false"
android:gravity="center" />
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="@dimen/toolbar_height"
android:orientation="horizontal">
<ImageView
android:id="@+id/activity_bar_close_view"
android:layout_width="@dimen/item_header_component_size"
android:layout_height="@dimen/item_header_component_size"
android:layout_marginHorizontal="@dimen/item_header_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:paddingHorizontal="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_arrow_back" />
<TextView
android:id="@+id/activity_bar_title_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6" />
</LinearLayout>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="insets"
type="com.github.kr328.clash.design.ui.Insets" />
</data>
<com.github.kr328.clash.design.view.AppRecyclerView
android:id="@+id/recycler_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="@{(float) insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{insets.bottom}" />
</layout>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="@dimen/item_min_height"
android:orientation="horizontal"
android:paddingVertical="@dimen/item_padding_vertical">
<View
android:id="@+id/icon_view"
android:layout_width="@dimen/item_header_component_size"
android:layout_height="@dimen/item_header_component_size"
android:layout_marginHorizontal="@dimen/item_header_margin" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:id="@+id/subtext_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="@dimen/item_min_height"
android:orientation="horizontal"
android:paddingVertical="@dimen/item_padding_vertical">
<View
android:id="@+id/icon_view"
android:layout_width="@dimen/item_header_component_size"
android:layout_height="@dimen/item_header_component_size"
android:layout_marginHorizontal="@dimen/item_header_margin" />
<FrameLayout
android:id="@+id/action_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/title_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption" />
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:layout_marginEnd="@dimen/item_tailing_component_size"
android:ellipsize="start"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/divider_size"
android:background="?attr/colorControlNormal" />
</LinearLayout>
<ImageView
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="bottom|end"
android:layout_marginBottom="@dimen/divider_size"
android:contentDescription="@string/edit"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_edit" />
</FrameLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="@dimen/large_item_padding_vertical">
<View
android:id="@+id/icon_view"
android:layout_width="@dimen/large_item_header_component_size"
android:layout_height="@dimen/large_item_header_component_size"
android:layout_marginHorizontal="@dimen/large_item_header_margin_horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/large_item_tailing_margin_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:id="@+id/subtext_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/large_item_text_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="versionName"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="@dimen/dialog_padding">
<View
android:layout_width="@dimen/about_icon_size"
android:layout_height="@dimen/about_icon_size"
android:background="@drawable/ic_clash"
android:backgroundTint="?attr/colorLogo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/about_text_margin"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/application_name"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:text="@{versionName}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,70 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.AccessControlDesign" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<include
android:id="@+id/main_list"
layout="@layout/common_recycler_list"
app:insets="@{self.surface.insets}" />
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/search_view" />
<ImageView
android:id="@+id/search_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/item_tailing_margin"
android:layout_toStartOf="@id/menu_view"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/search"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_search" />
<ImageView
android:id="@+id/menu_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:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/more"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_more_vert" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.AppCrashedDesign" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<com.github.kr328.clash.design.view.ObservableScrollView
android:id="@+id/scroll_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="@{(float) self.surface.insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{self.surface.insets.bottom}">
<TextView
android:id="@+id/logs_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.5"
android:paddingHorizontal="@dimen/logcat_padding_horizontal"
android:paddingVertical="@dimen/logcat_padding_vertical"
android:textIsSelectable="true" />
</com.github.kr328.clash.design.view.ObservableScrollView>
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}"
android:paddingEnd="@dimen/item_tailing_margin">
<include layout="@layout/common_activity_bar" />
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,68 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.FilesDesign" />
<variable
name="currentInBaseDir"
type="boolean" />
<variable
name="configurationEditable"
type="boolean" />
<import type="android.view.View" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<include
android:id="@+id/main_list"
layout="@layout/common_recycler_list"
app:insets="@{self.surface.insets}" />
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/new_view" />
<ImageView
android:id="@+id/new_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:layout_gravity="end|center_vertical"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/_new"
android:focusable="true"
android:onClick="@{() -> self.requestNew()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_add"
android:visibility="@{currentInBaseDir ? View.GONE : View.VISIBLE}" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.LogcatDesign" />
<variable
name="streaming"
type="boolean" />
<import type="android.view.View" />
<import type="com.github.kr328.clash.design.LogcatDesign.Request" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<com.github.kr328.clash.design.view.AppRecyclerView
android:id="@+id/recycler_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="@{(float) self.surface.insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{self.surface.insets.bottom}" />
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/action_layout" />
<FrameLayout
android:id="@+id/action_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="@{streaming ? View.GONE : View.VISIBLE}">
<ImageView
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/delete"
android:focusable="true"
android:onClick="@{() -> self.requests.offer(Request.Delete)}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_delete" />
<ImageView
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/export"
android:focusable="true"
android:onClick="@{() -> self.requests.offer(Request.Export)}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_publish" />
</LinearLayout>
<ImageView
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="end"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:onClick="@{() -> self.requests.offer(Request.Close)}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_stop"
android:visibility="@{streaming ? View.VISIBLE : View.GONE}" />
</FrameLayout>
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,89 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.LogsDesign" />
<import type="com.github.kr328.clash.design.LogsDesign.Request" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/delete_view" />
<ImageView
android:id="@+id/delete_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:layout_gravity="end|center_vertical"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/delete_all_logs"
android:focusable="true"
android:onClick="@{() -> self.requests.offer(Request.DeleteAll.INSTANCE)}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_clear_all" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
<com.github.kr328.clash.design.view.ActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> self.requests.offer(Request.StartLogcat.INSTANCE)}"
app:icon="@drawable/ic_baseline_adb"
app:subtext="@string/tap_to_start"
app:text="@string/clash_logcat" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorControlHighlight" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/item_padding_vertical"
android:paddingStart="@{@dimen/item_header_component_size + @dimen/item_header_margin * 2}"
android:paddingEnd="@dimen/item_tailing_margin"
android:text="@string/history"
android:textColor="?attr/colorControlActivated" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="@{self.surface.insets.bottom}" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,154 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.MainDesign" />
<variable
name="clashRunning"
type="boolean" />
<variable
name="forwarded"
type="String" />
<variable
name="mode"
type="String" />
<variable
name="profileName"
type="String" />
<variable
name="colorClashStarted"
type="int" />
<variable
name="colorClashStopped"
type="int" />
<variable
name="hasProviders"
type="boolean" />
<import type="android.view.View" />
<import type="com.github.kr328.clash.design.MainDesign.Request" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingHorizontal="@dimen/main_padding_horizontal"
android:paddingTop="@{self.surface.insets.top}"
android:paddingBottom="@{self.surface.insets.bottom}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="@dimen/main_top_banner_height"
android:orientation="horizontal">
<FrameLayout
android:layout_width="@dimen/large_item_header_layout_size"
android:layout_height="@dimen/large_item_header_layout_size">
<View
android:layout_width="@dimen/main_logo_size"
android:layout_height="@dimen/main_logo_size"
android:layout_gravity="center"
android:background="@drawable/ic_clash"
android:backgroundTint="?attr/colorLogo" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/launch_name"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6" />
</LinearLayout>
<com.github.kr328.clash.design.view.LargeActionCard
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_card_margin_vertical"
android:onClick="@{() -> self.request(Request.ToggleStatus)}"
android:theme="@style/AppThemeDark"
app:cardBackgroundColor="@{clashRunning ? colorClashStarted : colorClashStopped}"
app:icon="@{clashRunning ? @drawable/ic_outline_check_circle : @drawable/ic_outline_not_interested}"
app:subtext="@{clashRunning ? @string/format_traffic_forwarded(forwarded) : @string/tap_to_start}"
app:text="@{clashRunning ? @string/running : @string/stopped}" />
<com.github.kr328.clash.design.view.LargeActionCard
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_card_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenProxy)}"
android:visibility="@{clashRunning ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_apps"
app:subtext="@{mode}"
app:text="@string/proxy" />
<com.github.kr328.clash.design.view.LargeActionCard
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_card_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenProfiles)}"
app:icon="@drawable/ic_baseline_view_list"
app:subtext="@{profileName != null ? @string/format_profile_activated(profileName) : @string/not_selected}"
app:text="@string/profile" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginVertical="@dimen/main_label_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenProviders)}"
android:visibility="@{clashRunning &amp;&amp; hasProviders ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_swap_vertical_circle"
app:text="@string/providers" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_label_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenLogs)}"
app:icon="@drawable/ic_baseline_assignment"
app:text="@string/logs" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_label_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenSettings)}"
app:icon="@drawable/ic_baseline_settings"
app:text="@string/settings" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_label_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenHelp)}"
app:icon="@drawable/ic_baseline_help_center"
app:text="@string/help" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/main_label_margin_vertical"
android:onClick="@{() -> self.request(Request.OpenAbout)}"
app:icon="@drawable/ic_baseline_info"
app:text="@string/about" />
</LinearLayout>
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,31 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.NewProfileDesign" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<include
android:id="@+id/main_list"
layout="@layout/common_recycler_list"
app:insets="@{self.surface.insets}" />
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}"
android:paddingEnd="@dimen/item_tailing_margin">
<include layout="@layout/common_activity_bar" />
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,84 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.ProfilesDesign" />
<import type="android.view.View" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<include
android:id="@+id/main_list"
layout="@layout/common_recycler_list"
app:insets="@{self.surface.insets}" />
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/update_layout" />
<FrameLayout
android:id="@+id/update_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/add_view">
<ImageView
android:id="@+id/update_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="end|center_vertical"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/_new"
android:focusable="true"
android:onClick="@{() -> self.requestUpdateAll()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_sync"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="@+id/add_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:layout_gravity="end|center_vertical"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/_new"
android:focusable="true"
android:onClick="@{() -> self.requestCreate()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_add" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,151 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.PropertiesDesign" />
<variable
name="profile"
type="com.github.kr328.clash.service.model.Profile" />
<variable
name="processing"
type="boolean" />
<import type="com.github.kr328.clash.service.model.Profile.Type" />
<import type="android.view.View" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<com.github.kr328.clash.design.view.ObservableScrollView
android:id="@+id/scroll_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@{(float) self.surface.insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{self.surface.insets.bottom}">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="@dimen/item_padding_vertical">
<View
android:layout_width="@dimen/tips_icon_size"
android:layout_height="@dimen/tips_icon_size"
android:layout_marginHorizontal="@dimen/tips_icon_margin"
android:background="@drawable/ic_outline_info" />
<TextView
android:id="@+id/tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/item_tailing_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
<com.github.kr328.clash.design.view.ActionTextField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/properties_element_margin_vertical"
android:onClick="@{() -> self.inputName()}"
app:icon="@drawable/ic_outline_label"
app:placeholder="@string/profile_name"
app:text="@{profile.name}"
app:title="@string/name" />
<com.github.kr328.clash.design.view.ActionTextField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/properties_element_margin_vertical"
android:onClick="@{() -> self.inputUrl()}"
app:enabled="@{profile.type != Type.File}"
app:icon="@drawable/ic_outline_inbox"
app:placeholder="@string/accept_http_content"
app:text="@{profile.source}"
app:title="@string/url" />
<com.github.kr328.clash.design.view.ActionTextField
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/properties_element_margin_vertical"
android:onClick="@{() -> self.inputInterval()}"
app:enabled="@{profile.type != Type.File}"
app:icon="@drawable/ic_outline_update"
app:placeholder="@string/at_least_15_minutes"
app:text="@{profile.interval == 0 ? @string/disabled : @string/format_minutes(profile.interval / 1000 / 60)}"
app:title="@string/auto_update" />
<com.github.kr328.clash.design.view.ActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/properties_element_margin_vertical"
android:onClick="@{() -> self.requestBrowseFiles()}"
app:icon="@drawable/ic_outline_folder"
app:subtext="@string/browse_configuration_providers"
app:text="@string/browse_files" />
</LinearLayout>
</com.github.kr328.clash.design.view.ObservableScrollView>
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/action_layout" />
<FrameLayout
android:id="@+id/action_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/item_tailing_margin">
<ProgressBar
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:indeterminate="true"
android:visibility="@{processing ? View.VISIBLE : View.GONE}" />
<ImageView
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="end|center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/save"
android:focusable="true"
android:onClick="@{() -> self.requestCommit()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_save"
android:visibility="@{processing ? View.GONE : View.VISIBLE}" />
</FrameLayout>
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,59 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.ProvidersDesign" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<include
android:id="@+id/main_list"
layout="@layout/common_recycler_list"
app:insets="@{self.surface.insets}" />
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/update_view" />
<ImageView
android:id="@+id/update_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:layout_gravity="end|center_vertical"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/update_all"
android:focusable="true"
android:onClick="@{() -> self.requestUpdateAll()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_sync" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,134 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.ProxyDesign" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<TextView
android:id="@+id/empty_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/proxy_empty_tips"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
android:visibility="gone" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/pages_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/url_test_layout" />
<FrameLayout
android:id="@+id/url_test_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/item_tailing_margin"
android:layout_toStartOf="@id/menu_view">
<ImageView
android:id="@+id/url_test_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_gravity="center"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/delay_test"
android:focusable="true"
android:onClick="@{() -> self.requestUrlTesting()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_flash_on" />
<ProgressBar
android:id="@+id/url_test_progress_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="@+id/menu_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:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/more"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_more_vert" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout_view"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_layout_height"
android:alpha="0.96"
android:background="?android:windowBackground"
app:tabBackground="@android:color/transparent"
app:tabMode="scrollable" />
<View
android:id="@+id/elevation_view"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_size"
android:alpha="0.96"
android:background="?android:windowBackground"
android:elevation="@dimen/tab_layout_elevation" />
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:paddingBottom="@{self.surface.insets.bottom}">
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/url_test_float_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/item_tailing_margin"
android:contentDescription="@string/delay_test"
android:onClick="@{() -> self.requestUrlTesting()}"
android:src="@drawable/ic_baseline_flash_on" />
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,66 @@
<?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">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.SettingsDesign" />
<import type="com.github.kr328.clash.design.SettingsDesign.Request" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<com.github.kr328.clash.design.view.ObservableScrollView
android:id="@+id/scroll_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@{(float) self.surface.insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{self.surface.insets.bottom}">
<com.github.kr328.clash.design.view.ActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> self.request(Request.StartApp)}"
app:icon="@drawable/ic_baseline_settings"
app:text="@string/app" />
<com.github.kr328.clash.design.view.ActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> self.request(Request.StartNetwork)}"
app:icon="@drawable/ic_baseline_dns"
app:text="@string/network" />
<com.github.kr328.clash.design.view.ActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> self.request(Request.StartOverride)}"
app:icon="@drawable/ic_baseline_extension"
app:text="@string/override" />
</LinearLayout>
</com.github.kr328.clash.design.view.ObservableScrollView>
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}"
android:paddingEnd="@dimen/item_tailing_margin">
<include layout="@layout/common_activity_bar" />
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="surface"
type="com.github.kr328.clash.design.ui.Surface" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{surface.insets.start}"
android:paddingEnd="@{surface.insets.end}">
<com.github.kr328.clash.design.view.ObservableScrollView
android:id="@+id/scroll_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{(float) surface.insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{surface.insets.bottom}" />
</com.github.kr328.clash.design.view.ObservableScrollView>
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{surface.insets.top}"
android:paddingEnd="@dimen/item_tailing_margin">
<include layout="@layout/common_activity_bar" />
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="self"
type="com.github.kr328.clash.design.OverrideSettingsDesign" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{self.surface.insets.start}"
android:paddingEnd="@{self.surface.insets.end}">
<com.github.kr328.clash.design.view.ObservableScrollView
android:id="@+id/scroll_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{(float) self.surface.insets.top + @dimen/toolbar_height}"
android:paddingBottom="@{self.surface.insets.bottom}" />
</com.github.kr328.clash.design.view.ObservableScrollView>
<com.github.kr328.clash.design.view.ActivityBarLayout
android:id="@+id/activity_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@{self.surface.insets.top}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/item_tailing_margin">
<include
layout="@layout/common_activity_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/clear_view" />
<ImageView
android:id="@+id/clear_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:layout_gravity="end|center_vertical"
android:layout_marginStart="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/reset"
android:focusable="true"
android:onClick="@{() -> self.requestClear()}"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_replay" />
</RelativeLayout>
</com.github.kr328.clash.design.view.ActivityBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="@dimen/dialog_padding"
android:paddingTop="@dimen/dialog_padding"
android:paddingBottom="@dimen/dialog_button_margin">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/key">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/key_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:hint="@string/value">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/value_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:minHeight="@dimen/item_min_height"
android:orientation="vertical"
android:padding="@dimen/dialog_padding">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,65 @@
<?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">
<data>
<variable
name="master"
type="com.github.kr328.clash.design.FilesDesign" />
<variable
name="self"
type="android.app.Dialog" />
<variable
name="file"
type="com.github.kr328.clash.design.model.File" />
<variable
name="currentInBase"
type="boolean" />
<variable
name="configurationEditable"
type="boolean" />
<import type="android.view.View" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="@{() -> master.requestImport(self, file)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:visibility="@{!file.isDirectory &amp;&amp; (!currentInBase || configurationEditable) ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_get_app"
app:text="@string/import_" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="@{() -> master.requestExport(self, file)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:visibility="@{!file.isDirectory &amp;&amp; file.size > 0 ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_publish"
app:text="@string/export" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="@{() -> master.requestRename(self, file)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:visibility="@{!currentInBase ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_edit"
app:text="@string/rename" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="@{() -> master.requestDelete(self, file)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:theme="@style/ThemeOverlay.ControlColorError"
android:visibility="@{!currentInBase ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_outline_delete"
app:text="@string/delete" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="surface"
type="com.github.kr328.clash.design.ui.Surface" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@{surface.insets.start}"
android:paddingTop="@{surface.insets.top}"
android:paddingEnd="@{surface.insets.end}"
android:paddingBottom="@{surface.insets.bottom}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/preference_fullscreen_button_padding">
<TextView
android:id="@+id/title_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/new_view"
android:layout_alignBottom="@id/new_view"
android:layout_alignParentStart="true"
android:layout_marginHorizontal="@dimen/item_header_margin"
android:layout_toStartOf="@id/new_view"
android:gravity="center_vertical"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6" />
<ImageView
android:id="@+id/new_view"
android:layout_width="@dimen/item_tailing_component_size"
android:layout_height="@dimen/item_tailing_component_size"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/item_tailing_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/_new"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_add" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ok_view"
android:layout_below="@id/title_view" />
<Button
android:id="@+id/reset_view"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/dialog_button_margin"
android:text="@string/reset" />
<View
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toStartOf="@id/cancel_view"
android:layout_toEndOf="@id/reset_view" />
<Button
android:id="@+id/cancel_view"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toStartOf="@id/ok_view"
android:text="@string/cancel" />
<Button
android:id="@+id/ok_view"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/dialog_button_margin"
android:text="@string/ok" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

View File

@@ -0,0 +1,59 @@
<?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">
<data>
<variable
name="master"
type="com.github.kr328.clash.design.ProfilesDesign" />
<variable
name="self"
type="android.app.Dialog" />
<variable
name="profile"
type="com.github.kr328.clash.service.model.Profile" />
<import type="com.github.kr328.clash.service.model.Profile.Type" />
<import type="android.view.View" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> master.requestUpdate(self, profile)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:visibility="@{profile.imported &amp;&amp; profile.type != Type.File ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_update"
app:text="@string/update" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> master.requestEdit(self, profile)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
app:icon="@drawable/ic_baseline_edit"
app:text="@string/edit" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> master.requestDuplicate(self, profile)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:visibility="@{profile.imported ? View.VISIBLE : View.GONE}"
app:icon="@drawable/ic_baseline_content_copy"
app:text="@string/duplicate" />
<com.github.kr328.clash.design.view.LargeActionLabel
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> master.requestDelete(self, profile)}"
android:padding="@dimen/bottom_sheet_menu_items_padding"
android:theme="@style/ThemeOverlay.ControlColorError"
app:icon="@drawable/ic_outline_delete"
app:text="@string/delete" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="surface"
type="com.github.kr328.clash.design.ui.Surface" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="@{surface.insets.start}"
android:paddingTop="@{surface.insets.top}"
android:paddingEnd="@{surface.insets.end}"
android:paddingBottom="@{surface.insets.bottom}">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingEnd="@dimen/item_tailing_margin">
<ImageView
android:id="@+id/close_view"
android:layout_width="@dimen/item_header_component_size"
android:layout_height="@dimen/item_header_component_size"
android:layout_margin="@dimen/item_header_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/close"
android:focusable="true"
android:padding="@dimen/toolbar_image_action_padding"
android:src="@drawable/ic_baseline_close" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/keyword_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/keyword"
android:singleLine="true" />
</LinearLayout>
<com.github.kr328.clash.design.view.AppRecyclerView
android:id="@+id/main_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="@dimen/dialog_padding" />
</LinearLayout>
</layout>

View File

@@ -0,0 +1,24 @@
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dialog_padding"
android:paddingTop="@dimen/dialog_padding"
android:paddingBottom="@dimen/dialog_button_margin">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_field"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/item_padding_vertical"
android:paddingStart="@{@dimen/item_header_component_size + @dimen/item_header_margin * 2}"
android:paddingEnd="@dimen/item_tailing_margin"
android:textColor="?attr/colorControlActivated" />
</layout>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="@dimen/item_min_height"
android:orientation="horizontal"
android:paddingVertical="@dimen/item_padding_vertical"
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_marginHorizontal="@dimen/item_header_margin" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:id="@+id/summary_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<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: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:id="@+id/title_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
<TextView
android:id="@+id/summary_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/item_text_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="false"
android:focusable="false" />
</RelativeLayout>
</layout>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="@dimen/item_padding_vertical">
<View
android:layout_width="@dimen/tips_icon_size"
android:layout_height="@dimen/tips_icon_size"
android:layout_marginHorizontal="@dimen/tips_icon_margin"
android:background="@drawable/ic_outline_info" />
<TextView
android:id="@+id/tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/item_tailing_margin"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
</layout>