mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
[Custom controls] Fix control edit appear on play
This commit is contained in:
parent
746aeea4c5
commit
87809c5532
@ -664,7 +664,7 @@ public final class Tools
|
||||
}
|
||||
|
||||
|
||||
public static String read(InputStream is) throws Exception {
|
||||
public static String read(InputStream is) throws IOException {
|
||||
String out = "";
|
||||
int len;
|
||||
byte[] buf = new byte[512];
|
||||
@ -674,11 +674,11 @@ public final class Tools
|
||||
return out;
|
||||
}
|
||||
|
||||
public static String read(String path) throws Exception {
|
||||
public static String read(String path) throws IOException {
|
||||
return read(new FileInputStream(path));
|
||||
}
|
||||
|
||||
public static void write(String path, byte[] content) throws Exception
|
||||
public static void write(String path, byte[] content) throws IOException
|
||||
{
|
||||
File outPath = new File(path);
|
||||
outPath.getParentFile().mkdirs();
|
||||
@ -689,8 +689,7 @@ public final class Tools
|
||||
fos.close();
|
||||
}
|
||||
|
||||
public static void write(String path, String content) throws Exception
|
||||
{
|
||||
public static void write(String path, String content) throws IOException {
|
||||
write(path, content.getBytes());
|
||||
}
|
||||
|
||||
|
@ -147,35 +147,35 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mGestureDetector.onTouchEvent(event)) {
|
||||
mCanTriggerLongClick = true;
|
||||
onLongClick(this);
|
||||
}
|
||||
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
} else {
|
||||
if (mGestureDetector.onTouchEvent(event)) {
|
||||
mCanTriggerLongClick = true;
|
||||
downX = event.getX();
|
||||
downY = event.getY();
|
||||
break;
|
||||
onLongClick(this);
|
||||
}
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
mCanTriggerLongClick = false;
|
||||
moveX += event.getX() - downX;
|
||||
moveY += event.getY() - downY;
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mCanTriggerLongClick = true;
|
||||
downX = event.getX();
|
||||
downY = event.getY();
|
||||
break;
|
||||
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
setTranslationX(moveX);
|
||||
setTranslationY(moveY);
|
||||
}
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
mCanTriggerLongClick = false;
|
||||
moveX += event.getX() - downX;
|
||||
moveY += event.getY() - downY;
|
||||
|
||||
break;
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
setTranslationX(moveX);
|
||||
setTranslationY(moveY);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setModifiable(boolean z) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user