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