Add first settings UI for nav button configuration
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="22dp" />
|
||||
<solid android:color="@color/settings_card_fill" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/settings_card_stroke" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/settings_window_gradient_end"
|
||||
android:startColor="@color/settings_window_gradient_start" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<solid android:color="@color/settings_spinner_fill" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/settings_spinner_stroke" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="14dp" />
|
||||
<solid android:color="@color/settings_spinner_popup_fill" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/settings_spinner_popup_stroke" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/settings_test_overlay" />
|
||||
</shape>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/screen_padding"
|
||||
android:paddingTop="@dimen/screen_padding"
|
||||
android:paddingEnd="@dimen/screen_padding"
|
||||
android:paddingBottom="@dimen/screen_padding_large">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_title"
|
||||
android:textColor="@color/settings_text_primary"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:lineSpacingExtra="3dp"
|
||||
android:text="@string/settings_summary"
|
||||
android:textColor="@color/settings_text_secondary"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_sections_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<View
|
||||
android:id="@+id/test_hold_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:background="@drawable/bg_test_hold_overlay"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_button_section"
|
||||
android:elevation="2dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="18dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/section_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/settings_text_primary"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:text="@string/press_action_label"
|
||||
android:textColor="@color/settings_label_text"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/press_action_spinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_spinner_field"
|
||||
android:dropDownWidth="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:popupBackground="@drawable/bg_spinner_popup" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/long_press_action_label"
|
||||
android:textColor="@color/settings_label_text"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/long_press_action_spinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_spinner_field"
|
||||
android:dropDownWidth="match_parent"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:popupBackground="@drawable/bg_spinner_popup" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/long_press_duration_label"
|
||||
android:textColor="@color/settings_label_text"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/minus_button"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:minWidth="48dp"
|
||||
android:text="@string/minus_button_label"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="22sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/long_press_duration_input"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="number"
|
||||
android:maxLength="5"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/settings_input_text"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/plus_button"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:minWidth="48dp"
|
||||
android:text="@string/plus_button_label"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:minWidth="160dp"
|
||||
android:text="@string/test_button_label"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="48dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/settings_text_primary"
|
||||
android:textSize="16sp" />
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/settings_text_primary"
|
||||
android:textSize="16sp" />
|
||||
@@ -0,0 +1,17 @@
|
||||
<resources>
|
||||
<color name="settings_text_primary">#EAF2FF</color>
|
||||
<color name="settings_text_secondary">#C4D0E1</color>
|
||||
<color name="settings_text_tertiary">#9EB0C5</color>
|
||||
<color name="settings_label_text">#B2C1D3</color>
|
||||
<color name="settings_input_text">#F3F7FF</color>
|
||||
|
||||
<color name="settings_window_gradient_start">#0F1722</color>
|
||||
<color name="settings_window_gradient_end">#1B2433</color>
|
||||
<color name="settings_card_fill">#CC162231</color>
|
||||
<color name="settings_card_stroke">#4B8FAED1</color>
|
||||
<color name="settings_spinner_fill">#223346</color>
|
||||
<color name="settings_spinner_stroke">#5F8AAAC7</color>
|
||||
<color name="settings_spinner_popup_fill">#1A2635</color>
|
||||
<color name="settings_spinner_popup_stroke">#7098B6D3</color>
|
||||
<color name="settings_test_overlay">#2EDAE8FF</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
<resources>
|
||||
<color name="settings_text_primary">#102135</color>
|
||||
<color name="settings_text_secondary">#4F5F73</color>
|
||||
<color name="settings_text_tertiary">#64768A</color>
|
||||
<color name="settings_label_text">#506174</color>
|
||||
<color name="settings_input_text">#102135</color>
|
||||
|
||||
<color name="settings_window_gradient_start">#EAF6FF</color>
|
||||
<color name="settings_window_gradient_end">#FFF4EC</color>
|
||||
<color name="settings_card_fill">#F2FFFFFF</color>
|
||||
<color name="settings_card_stroke">#1F27425C</color>
|
||||
<color name="settings_spinner_fill">#F9FCFF</color>
|
||||
<color name="settings_spinner_stroke">#33536A82</color>
|
||||
<color name="settings_spinner_popup_fill">#FFFFFFFF</color>
|
||||
<color name="settings_spinner_popup_stroke">#264E657D</color>
|
||||
<color name="settings_test_overlay">#70FFFFFF</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
<dimen name="screen_padding">20dp</dimen>
|
||||
<dimen name="screen_padding_large">28dp</dimen>
|
||||
<dimen name="section_spacing">16dp</dimen>
|
||||
</resources>
|
||||
@@ -1,4 +1,18 @@
|
||||
<resources>
|
||||
<string name="app_name">NavButtons</string>
|
||||
<string name="xposed_desc">Kill foreground app on "Back" button long-press.</string>
|
||||
<string name="xposed_desc">Customize navigation button press and long-press actions.</string>
|
||||
<string name="settings_title">Nav Button Settings</string>
|
||||
<string name="settings_summary">Choose what each navigation button should do on press and long press, then tune how long a long press should feel.</string>
|
||||
<string name="button_back">Back Button</string>
|
||||
<string name="button_home">Home Button</string>
|
||||
<string name="button_recents">Recents Button</string>
|
||||
<string name="press_action_label">When pressed</string>
|
||||
<string name="long_press_action_label">When long-pressed</string>
|
||||
<string name="long_press_duration_label">Long-press duration (ms)</string>
|
||||
<string name="action_stock">Stock</string>
|
||||
<string name="action_kill_foreground_app">Kill foreground app</string>
|
||||
<string name="action_none">None</string>
|
||||
<string name="minus_button_label">-</string>
|
||||
<string name="plus_button_label">+</string>
|
||||
<string name="test_button_label">Duration test (hold)</string>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<resources>
|
||||
<style name="Theme.NavButtons" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="android:windowBackground">@drawable/bg_settings_window</item>
|
||||
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user