mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 17:15:40 -04:00
Attempt fix the v.mouse not shown after grab=false
This commit is contained in:
parent
ec9c490c12
commit
12ebe828fd
@ -69,6 +69,7 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
public boolean hiddenTextIgnoreUpdate = true;
|
public boolean hiddenTextIgnoreUpdate = true;
|
||||||
public String hiddenTextContents = initText;
|
public String hiddenTextContents = initText;
|
||||||
|
|
||||||
|
private boolean isVirtualMouseEnabled;
|
||||||
private LinearLayout touchPad;
|
private LinearLayout touchPad;
|
||||||
private ImageView mousePointer;
|
private ImageView mousePointer;
|
||||||
//private EditText hiddenEditor;
|
//private EditText hiddenEditor;
|
||||||
@ -239,14 +240,12 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (!CallbackBridge.isGrabbing() && lastEnabled) {
|
if (!CallbackBridge.isGrabbing() && isVirtualMouseEnabled) {
|
||||||
touchPad.setVisibility(View.VISIBLE);
|
touchPad.setVisibility(View.VISIBLE);
|
||||||
placeMouseAt(displayMetrics.widthPixels / 2, displayMetrics.heightPixels / 2);
|
placeMouseAt(displayMetrics.widthPixels / 2, displayMetrics.heightPixels / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CallbackBridge.isGrabbing()) {
|
if (CallbackBridge.isGrabbing() && touchPad.getVisibility() != View.GONE) {
|
||||||
lastEnabled = touchPad.getVisibility() == View.VISIBLE;
|
|
||||||
} else if (touchPad.getVisibility() != View.GONE) {
|
|
||||||
touchPad.setVisibility(View.GONE);
|
touchPad.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -271,7 +270,7 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
// } catch (Throwable th) {}
|
// } catch (Throwable th) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}, "VirtualMouseGrabThread").start();
|
||||||
|
|
||||||
|
|
||||||
if (isAndroid8OrHigher()) {
|
if (isAndroid8OrHigher()) {
|
||||||
@ -1066,9 +1065,9 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
public void toggleMouse(View view) {
|
public void toggleMouse(View view) {
|
||||||
if (CallbackBridge.isGrabbing()) return;
|
if (CallbackBridge.isGrabbing()) return;
|
||||||
|
|
||||||
boolean isVis = touchPad.getVisibility() == View.VISIBLE;
|
isVirtualMouseEnabled = !isVirtualMouseEnabled;
|
||||||
touchPad.setVisibility(isVis ? View.GONE : View.VISIBLE);
|
touchPad.setVisibility(isVirtualMouseEnabled ? View.VISIBLE : View.GONE);
|
||||||
((Button) view).setText(isVis ? R.string.control_mouseoff: R.string.control_mouseon);
|
((Button) view).setText(isVirtualMouseEnabled ? R.string.control_mouseon: R.string.control_mouseoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dialogForceClose(Context ctx) {
|
public static void dialogForceClose(Context ctx) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user