[custom controls: special buttons] fix it

This commit is contained in:
khanhduytran0 2020-11-28 05:44:33 +07:00
parent 6fc9420c20
commit c1358f5f1d
3 changed files with 7 additions and 5 deletions

View File

@ -197,12 +197,11 @@ public class BaseMainActivity extends LoggableActivity {
// toggleGui(null);
this.drawerLayout.closeDrawers();
/*
mKeyHandlerView = findViewById(R.id.main_key_handler);
mKeyHandlerView.setSingleLine(false);
mKeyHandlerView.clearFocus();
mKeyHandlerView.setVisibility(View.GONE);
*/
AndroidLWJGLKeycode.isBackspaceAfterChar = true; // mVersionInfo.minimumLauncherVersion >= 18;
placeMouseAt(CallbackBridge.windowWidth / 2, CallbackBridge.windowHeight / 2);

View File

@ -86,7 +86,10 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
// A non-special button or inside custom controls screen so skip listener
} else if (properties.specialButtonListener instanceof View.OnClickListener) {
setOnClickListener((View.OnClickListener) properties.specialButtonListener);
setOnLongClickListener(null);
setOnTouchListener(null);
} else if (properties.specialButtonListener instanceof View.OnTouchListener) {
setOnLongClickListener(null);
setOnTouchListener((View.OnTouchListener) properties.specialButtonListener);
} else {
throw new IllegalArgumentException("Field " + ControlData.class.getName() + ".specialButtonListener must be View.OnClickListener or View.OnTouchListener, but is " + properties.specialButtonListener.getClass().getName());

View File

@ -17,12 +17,12 @@
android:id="@+id/main_control_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--
<net.kdt.pojavlaunch.CapturedEditText
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/main_key_handler"/>
-->
<net.kdt.pojavlaunch.MinecraftGLView
android:id="@+id/main_game_render_view"
android:layout_width="fill_parent"