Android: Add analog touchscreen controls
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="194.89dp"
|
||||
android:height="194.89dp"
|
||||
android:viewportWidth="194.89"
|
||||
android:viewportHeight="194.89">
|
||||
<path
|
||||
android:pathData="M194.89,97.445A97.445,97.445 0,0 1,97.445 194.89,97.445 97.445,0 0,1 0,97.445 97.445,97.445 0,0 1,97.445 0,97.445 97.445,0 0,1 194.89,97.445Z"
|
||||
android:strokeAlpha="0.50645"
|
||||
android:fillColor="#1a1a1a"
|
||||
android:fillAlpha="0.504414"/>
|
||||
<path
|
||||
android:pathData="M178.82,97.445A81.381,81.381 0,0 1,97.439 178.826,81.381 81.381,0 0,1 16.058,97.445 81.381,81.381 0,0 1,97.439 16.064,81.381 81.381,0 0,1 178.82,97.445Z"
|
||||
android:strokeAlpha="0.50645"
|
||||
android:fillColor="#333333"
|
||||
android:fillAlpha="0.504414"/>
|
||||
<path
|
||||
android:pathData="M159.05,97.445A61.609,61.609 0,0 1,97.441 159.054,61.609 61.609,0 0,1 35.832,97.445 61.609,61.609 0,0 1,97.441 35.836,61.609 61.609,0 0,1 159.05,97.445Z"
|
||||
android:strokeAlpha="0.50645"
|
||||
android:fillColor="#1a1a1a"
|
||||
android:fillAlpha="0.504414"/>
|
||||
</vector>
|
||||
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="191.756dp"
|
||||
android:height="191.756dp"
|
||||
android:viewportWidth="191.756"
|
||||
android:viewportHeight="191.756">
|
||||
<path
|
||||
android:pathData="M191.756,95.878A95.878,95.878 0,0 1,95.878 191.756,95.878 95.878,0 0,1 0,95.878 95.878,95.878 0,0 1,95.878 0,95.878 95.878,0 0,1 191.756,95.878Z"
|
||||
android:strokeAlpha="0.8"
|
||||
android:fillColor="#666666"
|
||||
android:fillAlpha="0.796784"/>
|
||||
</vector>
|
||||
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="191.756dp"
|
||||
android:height="191.756dp"
|
||||
android:viewportWidth="191.756"
|
||||
android:viewportHeight="191.756">
|
||||
<path
|
||||
android:pathData="M191.756,95.878A95.878,95.878 0,0 1,95.878 191.756,95.878 95.878,0 0,1 0,95.878 95.878,95.878 0,0 1,95.878 0,95.878 95.878,0 0,1 191.756,95.878Z"
|
||||
android:strokeAlpha="0.50645"
|
||||
android:fillColor="#666666"
|
||||
android:fillAlpha="0.504414"/>
|
||||
</vector>
|
||||
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_r2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_marginBottom="280dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_r2_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_r2_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_r1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_marginBottom="220dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_r1_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_r1_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_l1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginBottom="220dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_l1_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_l1_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_l2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginBottom="280dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_l2_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_l2_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_start"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_start_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_start_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_select"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_select_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_select_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_cross"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_cross_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_cross_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_square"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_square_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_square_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_triangle"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:layout_marginBottom="130dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_triangle_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_triangle_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_circle"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_circle_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_circle_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerAxisView
|
||||
android:id="@+id/controller_axis_left"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_r2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_marginBottom="260dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_r2_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_r2_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_r1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="60dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_r1_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_r1_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_l1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_l1_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_l1_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_l2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginBottom="260dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_l2_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_l2_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_start"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_start_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_start_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_select"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_select_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_select_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_cross"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_cross_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_cross_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_square"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_square_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_square_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_triangle"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:layout_marginBottom="130dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_triangle_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_triangle_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_circle"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_circle_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_circle_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerAxisView
|
||||
android:id="@+id/controller_axis_left"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerAxisView
|
||||
android:id="@+id/controller_axis_right"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="300dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_left"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="300dp"
|
||||
android:paddingTop="50dp"
|
||||
android:paddingBottom="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_left_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_left_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_down"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="300dp"
|
||||
android:paddingStart="50dp"
|
||||
android:paddingEnd="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_down_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_down_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_right"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginBottom="300dp"
|
||||
android:paddingTop="50dp"
|
||||
android:paddingBottom="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_right_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_right_button" />
|
||||
|
||||
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
|
||||
android:id="@+id/controller_button_up"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="400dp"
|
||||
android:paddingStart="50dp"
|
||||
android:paddingEnd="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pressedDrawable="@drawable/ic_controller_up_button_pressed"
|
||||
app:unpressedDrawable="@drawable/ic_controller_up_button" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -136,7 +136,7 @@
|
||||
<item>Reset</item>
|
||||
<item>Cheats</item>
|
||||
<item>Change Disc</item>
|
||||
<item>Toggle Touch Controller</item>
|
||||
<item>Change Touchscreen Controller</item>
|
||||
<item>Settings</item>
|
||||
<item>Quit</item>
|
||||
</string-array>
|
||||
@ -164,4 +164,16 @@
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
</string-array>
|
||||
<string-array name="settings_touchscreen_controller_view_entries">
|
||||
<item>None</item>
|
||||
<item>Digital Pad</item>
|
||||
<item>Single Analog Pad</item>
|
||||
<item>Dual Analog Pad</item>
|
||||
</string-array>
|
||||
<string-array name="settings_touchscreen_controller_view_values">
|
||||
<item>none</item>
|
||||
<item>digital</item>
|
||||
<item>analog_stick</item>
|
||||
<item>analog_sticks</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@ -271,10 +271,13 @@
|
||||
app:title="Enable Analog Mode On Reset"
|
||||
app:defaultValue="false"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
app:key="Controller1/EnableTouchscreenController"
|
||||
app:title="Display Touchscreen Controller"
|
||||
app:defaultValue="true"
|
||||
<ListPreference
|
||||
app:key="Controller1/TouchscreenControllerView"
|
||||
app:title="Touchscreen Controller View"
|
||||
app:entries="@array/settings_touchscreen_controller_view_entries"
|
||||
app:entryValues="@array/settings_touchscreen_controller_view_values"
|
||||
app:defaultValue="digital"
|
||||
app:useSimpleSummaryProvider="true"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user