Skip to content

Commit 854155f

Browse files
committed
fix: Crosshair area adjustment not working #196
1 parent c6be05a commit 854155f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/xtr/keymapper/editor/component/Crosshair.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import android.annotation.SuppressLint;
44
import android.content.Context;
55
import android.os.Build;
6+
import android.os.Handler;
7+
import android.os.Looper;
68
import android.view.MotionEvent;
79
import android.view.View;
810
import android.view.ViewGroup;
@@ -74,15 +76,15 @@ private void onExpandButtonClicked(View view) {
7476
profile.mouseAimConfig.height = 0;
7577
if (which == 0) {
7678
profile.mouseAimConfig.limitedBounds = true;
77-
new ResizableArea();
79+
// Delay for 100ms to skip layout changes
80+
new Handler(Looper.getMainLooper()).postDelayed(ResizableArea::new, 100);
7881
} else {
7982
profile.mouseAimConfig.limitedBounds = false;
8083
}
8184
});
8285
AlertDialog dialog = builder.create();
8386
if(getCallback().isOverlayOpen()) dialog.getWindow().setType(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY : WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
8487
dialog.show();
85-
8688
}
8789

8890
private MovableFloatingActionKey addLeftClick(float x, float y) {

0 commit comments

Comments
 (0)