You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement some APIs needed for OctoDroid
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user