mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 00:29:50 -04:00
Fix toggle state not being rounded
This commit is contained in:
parent
801eec319d
commit
27f3ee55ba
@ -25,14 +25,10 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
|
||||
private boolean mCanTriggerLongClick = true;
|
||||
|
||||
private boolean mChecked = false;
|
||||
|
||||
private float mScaleAt;
|
||||
|
||||
public ControlButton(ControlLayout layout, ControlData properties) {
|
||||
super(layout.getContext());
|
||||
setPadding(4, 4, 4, 4);
|
||||
|
||||
mScaleAt = layout.mLayout.scaledAt;
|
||||
|
||||
mGestureDetector = new GestureDetector(getContext(), new SingleTapConfirm());
|
||||
|
||||
@ -146,7 +142,7 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
if (mChecked) {
|
||||
canvas.drawRect(0, getHeight() - 10 * mScaleAt, getWidth(), getHeight(), mRectPaint);
|
||||
canvas.drawRoundRect(0, 0, getWidth(), getHeight(), mProperties.cornerRadius, mProperties.cornerRadius, mRectPaint);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user