mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 09:39:25 -04:00
Fix: Remove usage of deprecated Handler constructor
This commit is contained in:
parent
33ec184108
commit
63e822325c
@ -44,7 +44,6 @@ import org.lwjgl.glfw.CallbackBridge;
|
||||
* Class dealing with showing minecraft surface and taking inputs to dispatch them to minecraft
|
||||
*/
|
||||
public class MinecraftGLSurface extends View implements GrabListener{
|
||||
Handler uiThreadHandler = new Handler();
|
||||
/* Gamepad object for gamepad inputs, instantiated on need */
|
||||
private Gamepad mGamepad = null;
|
||||
/* Pointer Debug textview, used to show info about the pointer state */
|
||||
@ -647,7 +646,7 @@ public class MinecraftGLSurface extends View implements GrabListener{
|
||||
|
||||
@Override
|
||||
public void onGrabState(boolean isGrabbing) {
|
||||
uiThreadHandler.post(()->updateGrabState(isGrabbing));
|
||||
post(()->updateGrabState(isGrabbing));
|
||||
}
|
||||
|
||||
private void updateGrabState(boolean isGrabbing) {
|
||||
|
@ -33,7 +33,6 @@ public class Touchpad extends FrameLayout implements GrabListener{
|
||||
private final ImageView mMousePointerImageView = new ImageView(getContext());
|
||||
/* Detect a classic android Tap */
|
||||
private final GestureDetector mSingleTapDetector = new GestureDetector(getContext(), new SingleTapConfirm());
|
||||
private final Handler uiThreadHandler = new Handler();
|
||||
/* Resolution scaler option, allow downsizing a window */
|
||||
private final float mScaleFactor = DEFAULT_PREF.getInt("resolutionRatio",100)/100f;
|
||||
/* Current pointer ID to move the mouse */
|
||||
@ -181,7 +180,7 @@ public class Touchpad extends FrameLayout implements GrabListener{
|
||||
|
||||
@Override
|
||||
public void onGrabState(boolean isGrabbing) {
|
||||
uiThreadHandler.post(()->updateGrabState(isGrabbing));
|
||||
post(()->updateGrabState(isGrabbing));
|
||||
}
|
||||
private void updateGrabState(boolean isGrabbing) {
|
||||
if(!isGrabbing) {
|
||||
|
@ -7,6 +7,7 @@ import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
@ -28,7 +29,7 @@ import net.kdt.pojavlaunch.progresskeeper.TaskCountListener;
|
||||
*/
|
||||
public class ProgressService extends Service implements TaskCountListener {
|
||||
|
||||
private final Handler mainThreadHandler = new Handler();
|
||||
private final Handler mainThreadHandler = new Handler(Looper.getMainLooper());
|
||||
private NotificationManagerCompat notificationManagerCompat;
|
||||
|
||||
/** Simple wrapper to start the service */
|
||||
|
Loading…
x
Reference in New Issue
Block a user