mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-05-24 09:54:43 -04:00
UI now scaled correctly; Fix compile errors on SDK 26; Ignore download LWJGL 3
This commit is contained in:
@@ -41,16 +41,20 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
}
|
||||
|
||||
private static int getInternalId(String type, String name) {
|
||||
for (Class perType : com.android.internal.R.class.getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
try {
|
||||
for (Class perType : Class.forName("com.android.internal.R").getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// If unable to find in com.android.internal.R, go find in android.R
|
||||
|
||||
@@ -74,16 +74,20 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
||||
}
|
||||
|
||||
private int getInternalId(String type, String name) {
|
||||
for (Class perType : com.android.internal.R.class.getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
try {
|
||||
for (Class perType : Class.forName("com.android.internal.R").getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
libItem.name.startsWith("com.mojang:realms") ||
|
||||
libItem.name.startsWith("net.java.jinput") ||
|
||||
libItem.name.startsWith("net.minecraft.launchwrapper") ||
|
||||
libItem.name.startsWith("org.lwjgl.lwjgl:lwjgl") ||
|
||||
libItem.name.startsWith("org.lwjgl") ||
|
||||
libItem.name.startsWith("tv.twitch")
|
||||
) { // Black list
|
||||
publishProgress("1", "Ignored " + libItem.name);
|
||||
|
||||
@@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
private int fingerStillThreshold = 8;
|
||||
private int initialX;
|
||||
private int initialY;
|
||||
private boolean mIsResuming = false;
|
||||
private static final int MSG_LEFT_MOUSE_BUTTON_CHECK = 1028;
|
||||
private static final int MSG_DROP_ITEM_BUTTON_CHECK = 1029;
|
||||
private static boolean triggeredLeftMouseButton = false;
|
||||
@@ -614,7 +615,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
glSurfaceView.setOnHoverListener(new View.OnHoverListener(){
|
||||
@Override
|
||||
public boolean onHover(View p1, MotionEvent p2) {
|
||||
if (!AndroidDisplay.grab && isResumed()) {
|
||||
if (!AndroidDisplay.grab && mIsResuming) {
|
||||
return glTouchListener.onTouch(p1, p2);
|
||||
}
|
||||
return true;
|
||||
@@ -724,6 +725,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mIsResuming = true;
|
||||
glSurfaceView.requestRender();
|
||||
}
|
||||
|
||||
@@ -743,6 +745,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
if (AndroidDisplay.grab){
|
||||
sendKeyPress(Keyboard.KEY_ESCAPE);
|
||||
}
|
||||
mIsResuming = false;
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@@ -1070,10 +1073,12 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
|
||||
private void openLogOutput() {
|
||||
contentLog.setVisibility(View.VISIBLE);
|
||||
mIsResuming = false;
|
||||
}
|
||||
|
||||
public void closeLogOutput(View view) {
|
||||
contentLog.setVisibility(View.GONE);
|
||||
mIsResuming = true;
|
||||
}
|
||||
/*
|
||||
private void openCanvasOutput() {
|
||||
|
||||
Reference in New Issue
Block a user