diff options
| author | JosJuice <josjuice@gmail.com> | 2022-12-27 16:29:01 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-03-07 17:39:30 +0100 |
| commit | c2779aef060137d9062cfd29babb3c43fc5fa2b5 (patch) | |
| tree | 421bbf1ba198ec00b5e7dfe9118da77e079d89c1 /Source/Android/app/src/main/res | |
| parent | 42943672bbbed6c18aa2bc85c41102a0616547f7 (diff) | |
Android: Add the advanced input mapping dialog
It's missing a lot of features from the PC version for now, like
buttons for inserting functions and the ability to see what the
expression evaluates to. I mostly just wanted to get something in
place so you can set up rumble.
Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
Diffstat (limited to 'Source/Android/app/src/main/res')
6 files changed, 206 insertions, 0 deletions
diff --git a/Source/Android/app/src/main/res/drawable/ic_more.xml b/Source/Android/app/src/main/res/drawable/ic_more.xml new file mode 100644 index 0000000000..429471329e --- /dev/null +++ b/Source/Android/app/src/main/res/drawable/ic_more.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportHeight="24" + android:viewportWidth="24"> + <path + android:fillColor="?attr/colorControlNormal" + android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" /> +</vector> diff --git a/Source/Android/app/src/main/res/layout-ldrtl/list_item_mapping.xml b/Source/Android/app/src/main/res/layout-ldrtl/list_item_mapping.xml new file mode 100644 index 0000000000..709a7cbcf0 --- /dev/null +++ b/Source/Android/app/src/main/res/layout-ldrtl/list_item_mapping.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout android:id="@+id/root" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:nextFocusLeft="@id/button_advanced_settings"> + + <TextView + android:id="@+id/text_setting_name" + style="@style/TextAppearance.MaterialComponents.Headline5" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginEnd="@dimen/spacing_large" + android:layout_marginStart="@dimen/spacing_large" + android:layout_marginTop="@dimen/spacing_large" + android:textSize="16sp" + android:textAlignment="viewStart" + android:layout_toStartOf="@+id/button_more_settings" + tools:text="Setting Name" /> + + <TextView + android:id="@+id/text_setting_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignStart="@+id/text_setting_name" + android:layout_below="@+id/text_setting_name" + android:layout_marginBottom="@dimen/spacing_large" + android:layout_marginEnd="@dimen/spacing_large" + android:layout_marginStart="@dimen/spacing_large" + android:layout_marginTop="@dimen/spacing_small" + android:layout_toStartOf="@+id/button_advanced_settings" + android:textAlignment="viewStart" + tools:text="@string/overclock_enable_description" /> + + <Button + android:id="@+id/button_advanced_settings" + style="?attr/materialIconButtonStyle" + android:contentDescription="@string/advanced_settings" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + android:layout_marginEnd="@dimen/spacing_small" + android:nextFocusRight="@id/root" + app:icon="@drawable/ic_more" + app:iconTint="?attr/colorOnPrimaryContainer" /> + +</RelativeLayout> diff --git a/Source/Android/app/src/main/res/layout/dialog_advanced_mapping.xml b/Source/Android/app/src/main/res/layout/dialog_advanced_mapping.xml new file mode 100644 index 0000000000..446851e8fa --- /dev/null +++ b/Source/Android/app/src/main/res/layout/dialog_advanced_mapping.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingHorizontal="@dimen/spacing_large" + android:paddingTop="@dimen/spacing_medlarge"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/list_control" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_above="@+id/expression" + android:layout_alignParentEnd="true" + android:layout_alignParentStart="true" + android:layout_below="@+id/device" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/device" + style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:hint="@string/input_device"> + + <com.google.android.material.textfield.MaterialAutoCompleteTextView + android:id="@+id/dropdown_device" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="none" /> + + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/expression" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + android:layout_alignParentStart="true" + android:hint="@string/input_expression"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/edit_expression" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="start" + android:importantForAutofill="no" + android:typeface="monospace" /> + + </com.google.android.material.textfield.TextInputLayout> + +</RelativeLayout> diff --git a/Source/Android/app/src/main/res/layout/list_item_advanced_mapping_control.xml b/Source/Android/app/src/main/res/layout/list_item_advanced_mapping_control.xml new file mode 100644 index 0000000000..b5ea979a09 --- /dev/null +++ b/Source/Android/app/src/main/res/layout/list_item_advanced_mapping_control.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="54dp" + android:background="?android:attr/selectableItemBackground" + android:focusable="true" + android:clickable="true"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/TextAppearance.MaterialComponents.Headline5" + tools:text="Button A" + android:layout_alignParentEnd="true" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginStart="@dimen/spacing_large" + android:layout_marginEnd="@dimen/spacing_large" + android:layout_marginTop="@dimen/spacing_large" + android:id="@+id/text_name" + android:textAlignment="viewStart" + android:textSize="16sp" /> + +</RelativeLayout> diff --git a/Source/Android/app/src/main/res/layout/list_item_mapping.xml b/Source/Android/app/src/main/res/layout/list_item_mapping.xml new file mode 100644 index 0000000000..de504d3187 --- /dev/null +++ b/Source/Android/app/src/main/res/layout/list_item_mapping.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout android:id="@+id/root" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:nextFocusRight="@id/button_advanced_settings"> + + <TextView + android:id="@+id/text_setting_name" + style="@style/TextAppearance.MaterialComponents.Headline5" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginEnd="@dimen/spacing_large" + android:layout_marginStart="@dimen/spacing_large" + android:layout_marginTop="@dimen/spacing_large" + android:textSize="16sp" + android:textAlignment="viewStart" + android:layout_toStartOf="@+id/button_advanced_settings" + tools:text="Setting Name" /> + + <TextView + android:id="@+id/text_setting_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignStart="@+id/text_setting_name" + android:layout_below="@+id/text_setting_name" + android:layout_marginBottom="@dimen/spacing_large" + android:layout_marginEnd="@dimen/spacing_large" + android:layout_marginStart="@dimen/spacing_large" + android:layout_marginTop="@dimen/spacing_small" + android:layout_toStartOf="@+id/button_advanced_settings" + android:textAlignment="viewStart" + tools:text="@string/overclock_enable_description" /> + + <Button + android:id="@+id/button_advanced_settings" + style="?attr/materialIconButtonStyle" + android:contentDescription="@string/advanced_settings" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + android:layout_marginEnd="@dimen/spacing_small" + android:nextFocusLeft="@id/root" + app:icon="@drawable/ic_more" + app:iconTint="?attr/colorOnPrimaryContainer" /> + +</RelativeLayout> diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 8d1a550962..f7036a0f94 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -50,6 +50,9 @@ <string name="input_binding">Input Binding</string> <string name="input_binding_description">Press or move an input to bind it to %1$s.</string> <string name="input_binding_no_device">You need to select a device first!</string> + <string name="input_configure_input">Configure Input</string> + <string name="input_configure_output">Configure Output</string> + <string name="input_expression">Expression</string> <!-- Main Preference Fragment --> <string name="settings">Settings</string> @@ -420,6 +423,7 @@ <string name="other">Other</string> <string name="continue_anyway">Continue Anyway</string> <string name="more_settings">More Settings</string> + <string name="advanced_settings">Advanced Settings</string> <!-- Game Grid Screen--> <string name="platform_gamecube">GameCube Games</string> |
