mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
9ad492e93b
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>
50 lines
924 B
Java
50 lines
924 B
Java
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
package org.gioui;
|
|
|
|
import android.app.Activity;
|
|
import android.os.Bundle;
|
|
import android.content.res.Configuration;
|
|
|
|
public final class GioActivity extends Activity {
|
|
private GioView view;
|
|
|
|
@Override public void onCreate(Bundle state) {
|
|
super.onCreate(state);
|
|
|
|
this.view = new GioView(this);
|
|
|
|
setContentView(view);
|
|
}
|
|
|
|
@Override public void onDestroy() {
|
|
view.destroy();
|
|
super.onDestroy();
|
|
}
|
|
|
|
@Override public void onStart() {
|
|
super.onStart();
|
|
view.start();
|
|
}
|
|
|
|
@Override public void onStop() {
|
|
view.stop();
|
|
super.onStop();
|
|
}
|
|
|
|
@Override public void onConfigurationChanged(Configuration c) {
|
|
super.onConfigurationChanged(c);
|
|
view.configurationChanged();
|
|
}
|
|
|
|
@Override public void onLowMemory() {
|
|
super.onLowMemory();
|
|
GioView.onLowMemory();
|
|
}
|
|
|
|
@Override public void onBackPressed() {
|
|
if (!view.backPressed())
|
|
super.onBackPressed();
|
|
}
|
|
}
|