Android: Merge dpad into one button

This commit is contained in:
Connor McLaughlin
2021-04-03 13:42:04 +10:00
parent acff275f6b
commit 17707525dc
4 changed files with 250 additions and 99 deletions

View File

@@ -147,57 +147,14 @@
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"
<com.github.stenzek.duckstation.TouchscreenControllerDPadView
android:id="@+id/controller_dpad"
android:layout_width="150dp"
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" />
app:layout_constraintStart_toStartOf="parent" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_fast_forward"

View File

@@ -29,31 +29,14 @@
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_right"
android:layout_width="50dp"
android:layout_height="150dp"
android:layout_marginStart="120dp"
android:layout_marginBottom="30dp"
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"
<com.github.stenzek.duckstation.TouchscreenControllerDPadView
android:id="@+id/controller_dpad"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_height="150dp"
android:layout_marginStart="20dp"
android:layout_marginBottom="130dp"
android:paddingStart="50dp"
android:paddingEnd="50dp"
android:layout_marginBottom="30dp"
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" />
app:layout_constraintStart_toStartOf="parent" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_l1"
@@ -77,32 +60,6 @@
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_left"
android:layout_width="50dp"
android:layout_height="150dp"
android:layout_marginStart="20dp"
android:layout_marginBottom="30dp"
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="30dp"
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_start"
android:layout_width="40dp"