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
api-impl: misc additions for Oeffi
This commit is contained in:
@@ -378,6 +378,10 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public boolean showDialog(int id, Bundle args) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void removeDialog(int id) {
|
||||
Dialog dialog = dialogs.remove(id);
|
||||
if (dialog != null)
|
||||
@@ -388,9 +392,9 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (window != null) {
|
||||
if (window != null && window.native_window != 0) {
|
||||
nativeFinish(getWindow().native_window);
|
||||
window = null;
|
||||
window.native_window = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -575,4 +579,5 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
||||
public Uri getReferrer() { return null; }
|
||||
public void setDefaultKeyMode(int flag) {}
|
||||
public void registerForContextMenu(View view) {}
|
||||
public boolean isInMultiWindowMode() { return true; }
|
||||
}
|
||||
|
||||
@@ -78,4 +78,6 @@ public class ActivityManager {
|
||||
throws SecurityException {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public int getLargeMemoryClass() {return getMemoryClass();}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ public class AlertDialog extends Dialog implements DialogInterface {
|
||||
dialog = new AlertDialog(context);
|
||||
}
|
||||
|
||||
public Builder(Context context, int themeResId) {
|
||||
dialog = new AlertDialog(context, themeResId);
|
||||
}
|
||||
|
||||
public AlertDialog.Builder setPositiveButton(int textId, DialogInterface.OnClickListener listener) {
|
||||
return setPositiveButton(dialog.getContext().getText(textId), listener);
|
||||
}
|
||||
@@ -92,6 +96,10 @@ public class AlertDialog extends Dialog implements DialogInterface {
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlertDialog.Builder setItems(int itemsId, final DialogInterface.OnClickListener listener) {
|
||||
return setItems(dialog.getContext().getResources().getTextArray(itemsId), listener);
|
||||
}
|
||||
|
||||
public Builder setOnCancelListener(OnCancelListener onCancelListener) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -13,4 +13,8 @@ public class ProgressDialog extends AlertDialog {
|
||||
}
|
||||
|
||||
public void setIndeterminate(boolean indeterminate) {}
|
||||
|
||||
public static ProgressDialog show(Context context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable, OnCancelListener cancelListener) {
|
||||
return new ProgressDialog(context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user