mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
app/internal/wm: [Android] make GioView delegate methods public
GioActivity is final to avoid the brittle base class problem. However, to permit replacement of GioActivity the GioView delegate methods must be public. While here fix a function signature, rename lowMemory to onLowMemory and make it static. Also move view specific setup to GioView, simplifying the host activity further. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -3,12 +3,8 @@
|
||||
package org.gioui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.content.res.Configuration;
|
||||
|
||||
public final class GioActivity extends Activity {
|
||||
private GioView view;
|
||||
@@ -16,13 +12,8 @@ public final class GioActivity extends Activity {
|
||||
@Override public void onCreate(Bundle state) {
|
||||
super.onCreate(state);
|
||||
|
||||
Window w = getWindow();
|
||||
|
||||
this.view = new GioView(this);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
this.view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
}
|
||||
this.view.setLayoutParams(new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT));
|
||||
|
||||
setContentView(view);
|
||||
}
|
||||
|
||||
@@ -48,7 +39,7 @@ public final class GioActivity extends Activity {
|
||||
|
||||
@Override public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
view.lowMemory();
|
||||
GioView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override public void onBackPressed() {
|
||||
|
||||
Reference in New Issue
Block a user