mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 09:07:48 -04:00
Another attempt to get PRI and SEC button un-editable on play.
This commit is contained in:
parent
3a30915a51
commit
0de61e64bc
@ -14,7 +14,7 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
||||
private ControlData mProperties;
|
||||
private SelectionEndHandleView mHandleView;
|
||||
|
||||
private boolean mCanModify = false;
|
||||
private boolean mModifiable = false;
|
||||
private boolean mCanTriggerLongClick = true;
|
||||
|
||||
private int mMods;
|
||||
@ -106,7 +106,7 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View p1) {
|
||||
if (mCanTriggerLongClick) {
|
||||
if (mCanTriggerLongClick && mModifiable) {
|
||||
if (mHandleView.isShowing()) {
|
||||
mHandleView.hide();
|
||||
} else {
|
||||
@ -124,7 +124,7 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
||||
private float downX, downY;
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
if (!mCanModify) {
|
||||
if (!mModifiable) {
|
||||
mCanTriggerLongClick = false;
|
||||
|
||||
if (mProperties.keycode >= 0) {
|
||||
@ -178,6 +178,6 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
||||
}
|
||||
|
||||
public void setModifiable(boolean z) {
|
||||
mCanModify = z;
|
||||
mModifiable = z;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import java.io.*;
|
||||
|
||||
public class ControlLayout extends FrameLayout
|
||||
{
|
||||
private boolean mCanModify;
|
||||
private boolean mModifiable;
|
||||
private CustomControls mLayout;
|
||||
private CustomControlsActivity mActivity;
|
||||
private boolean mControlVisible = false;
|
||||
@ -61,7 +61,7 @@ public class ControlLayout extends FrameLayout
|
||||
|
||||
private void addControlView(ControlData controlButton) {
|
||||
final ControlButton view = new ControlButton(getContext(), controlButton);
|
||||
view.setModifiable(mCanModify);
|
||||
view.setModifiable(mModifiable);
|
||||
addView(view);
|
||||
|
||||
setModified(true);
|
||||
@ -85,7 +85,7 @@ public class ControlLayout extends FrameLayout
|
||||
}
|
||||
|
||||
public void toggleControlVisible() {
|
||||
if (mCanModify) return; // Not using on custom controls activity
|
||||
if (mModifiable) return; // Not using on custom controls activity
|
||||
|
||||
mControlVisible = !mControlVisible;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
@ -97,7 +97,7 @@ public class ControlLayout extends FrameLayout
|
||||
}
|
||||
|
||||
public void setModifiable(boolean z) {
|
||||
mCanModify = z;
|
||||
mModifiable = z;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View v = getChildAt(i);
|
||||
if (v instanceof ControlButton) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user