mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 01:27:18 -04:00
Fix resolution resetting when launcher goes in the background
This commit is contained in:
parent
df3a908df0
commit
24d10d395c
@ -698,13 +698,14 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSurfaceTextureUpdated(SurfaceTexture texture) {
|
public void onSurfaceTextureUpdated(SurfaceTexture texture) {
|
||||||
|
texture.setDefaultBufferSize(CallbackBridge.windowWidth,CallbackBridge.windowHeight);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Tools.showError(this, e, true);
|
Tools.showError(this, e, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
|
@ -10,7 +10,7 @@ import net.kdt.pojavlaunch.customcontrols.handleview.*;
|
|||||||
import net.kdt.pojavlaunch.*;
|
import net.kdt.pojavlaunch.*;
|
||||||
import org.lwjgl.glfw.*;
|
import org.lwjgl.glfw.*;
|
||||||
|
|
||||||
public class ControlButton extends Button implements OnLongClickListener, OnTouchListener
|
public class ControlButton extends androidx.appcompat.widget.AppCompatButton implements OnLongClickListener
|
||||||
{
|
{
|
||||||
private Paint mRectPaint;
|
private Paint mRectPaint;
|
||||||
|
|
||||||
@ -35,7 +35,6 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
|||||||
|
|
||||||
setBackgroundResource(R.drawable.control_button);
|
setBackgroundResource(R.drawable.control_button);
|
||||||
setOnLongClickListener(this);
|
setOnLongClickListener(this);
|
||||||
setOnTouchListener(this);
|
|
||||||
|
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
setModified(false);
|
setModified(false);
|
||||||
@ -184,12 +183,11 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
|||||||
private float moveX, moveY;
|
private float moveX, moveY;
|
||||||
private float downX, downY;
|
private float downX, downY;
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View view, MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
if (!mModifiable) {
|
if (!mModifiable) {
|
||||||
mCanTriggerLongClick = false;
|
mCanTriggerLongClick = false;
|
||||||
if (mProperties.keycode >= 0) {
|
if (mProperties.keycode >= 0) {
|
||||||
if (!mProperties.isToggle) {
|
if (!mProperties.isToggle) {
|
||||||
boolean isDown;
|
|
||||||
switch (event.getActionMasked()) {
|
switch (event.getActionMasked()) {
|
||||||
case MotionEvent.ACTION_DOWN: // 0
|
case MotionEvent.ACTION_DOWN: // 0
|
||||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user