implement some APIs needed for OctoDroid

This commit is contained in:
Julian Winkler
2024-03-29 23:56:28 +01:00
parent 0352a307b9
commit 2f4cd3917f
36 changed files with 329 additions and 25 deletions

View File

@@ -62,13 +62,18 @@ public class Dialog implements Window.Callback, DialogInterface {
public void show() {
System.out.println("showing the Dialog " + this);
new Handler(Looper.getMainLooper()).post(new Runnable() {
Runnable action = new Runnable() {
@Override
public void run() {
onCreate(null);
nativeShow(nativePtr);
}
});
};
if(Looper.myLooper() == Looper.getMainLooper()) {
action.run();
} else {
new Handler(Looper.getMainLooper()).post(action);
}
}
public boolean isShowing() {
@@ -142,4 +147,9 @@ public class Dialog implements Window.Callback, DialogInterface {
System.out.println("hiding the Dialog " + this);
nativeClose(nativePtr);
}
@Override
public void cancel() {
dismiss();
}
}