Android: Apply opacity setting to pressed buttons too

This commit is contained in:
JosJuice 2021-06-19 16:18:30 +02:00
parent 3e1a25ead0
commit d33efc37af
3 changed files with 16 additions and 1 deletions

View File

@ -117,6 +117,7 @@ public final class InputOverlayDrawableButton
public void setOpacity(int value)
{
mDefaultStateBitmap.setAlpha(value);
mPressedStateBitmap.setAlpha(value);
}
public Rect getBounds()

View File

@ -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()

View File

@ -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()