From d33efc37af5d7d13d0342d2de3922202289b7a8a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 19 Jun 2021 16:18:30 +0200 Subject: [PATCH] Android: Apply opacity setting to pressed buttons too --- .../overlay/InputOverlayDrawableButton.java | 1 + .../overlay/InputOverlayDrawableDpad.java | 2 ++ .../overlay/InputOverlayDrawableJoystick.java | 14 +++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableButton.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableButton.java index 41779c84b6..f9fde5c7e6 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableButton.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableButton.java @@ -117,6 +117,7 @@ public final class InputOverlayDrawableButton public void setOpacity(int value) { mDefaultStateBitmap.setAlpha(value); + mPressedStateBitmap.setAlpha(value); } public Rect getBounds() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableDpad.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableDpad.java index 3d422aeb8a..1af45c5ac3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableDpad.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableDpad.java @@ -186,6 +186,8 @@ public final class InputOverlayDrawableDpad public void setOpacity(int value) { mDefaultStateBitmap.setAlpha(value); + mPressedOneDirectionStateBitmap.setAlpha(value); + mPressedTwoDirectionsStateBitmap.setAlpha(value); } public Rect getBounds() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableJoystick.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableJoystick.java index a9917e8e07..83ed506356 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableJoystick.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayDrawableJoystick.java @@ -255,8 +255,20 @@ public final class InputOverlayDrawableJoystick public void setOpacity(int value) { mOpacity = value; + mDefaultStateInnerBitmap.setAlpha(value); - mOuterBitmap.setAlpha(value); + mPressedStateInnerBitmap.setAlpha(value); + + if (trackId == -1) + { + mOuterBitmap.setAlpha(value); + mBoundsBoxBitmap.setAlpha(0); + } + else + { + mOuterBitmap.setAlpha(0); + mBoundsBoxBitmap.setAlpha(value); + } } public Rect getBounds()