android: 0.30.0 game activity

still no text input, at least it's not crashing

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-01-28 15:23:02 -08:00
parent b33346a25d
commit da9b2bcd46
5 changed files with 88 additions and 211 deletions

View File

@@ -23,6 +23,7 @@ public class MainActivity extends GameActivity {
protected void onCreate(Bundle savedInstanceState) {
// Shrink view so it does not get covered by insets.
/*
View content = getWindow().getDecorView().findViewById(android.R.id.content);
ViewCompat.setOnApplyWindowInsetsListener(content, (v, windowInsets) -> {
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
@@ -38,6 +39,7 @@ public class MainActivity extends GameActivity {
});
WindowCompat.setDecorFitsSystemWindows(getWindow(), true);
*/
super.onCreate(savedInstanceState);
}
@@ -46,9 +48,11 @@ public class MainActivity extends GameActivity {
public boolean onTouchEvent(MotionEvent event) {
// Offset the location so it fits the view with margins caused by insets.
/*
int[] location = new int[2];
findViewById(android.R.id.content).getLocationOnScreen(location);
event.offsetLocation(-location[0], -location[1]);
*/
return super.onTouchEvent(event);
}
}