mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-12 01:21:09 -07:00
Implement grab listening and use it for Android native mouse grab and Touchpad
This commit is contained in:
parent
5d2f61c2db
commit
c0e4d45ff3
6 changed files with 92 additions and 43 deletions
|
|
@ -81,6 +81,8 @@ public class MainActivity extends BaseActivity {
|
|||
MCOptionUtils.load(Tools.getGameDirPath(minecraftProfile));
|
||||
GameService.startService(this);
|
||||
initLayout(R.layout.activity_basemain);
|
||||
CallbackBridge.addGrabListener(touchpad);
|
||||
CallbackBridge.addGrabListener(minecraftGLView);
|
||||
|
||||
// Enabling this on TextureView results in a broken white result
|
||||
if(PREF_USE_ALTERNATE_SURFACE)
|
||||
|
|
@ -260,6 +262,13 @@ public class MainActivity extends BaseActivity {
|
|||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallbackBridge.removeGrabListener(touchpad);
|
||||
CallbackBridge.removeGrabListener(minecraftGLView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue