api-impl: misc additions for Oeffi

This commit is contained in:
Julian Winkler
2024-11-22 18:02:54 +01:00
committed by Mis012
parent 7626992241
commit f53ad02e6f
32 changed files with 265 additions and 15 deletions

View File

@@ -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; }
}

View File

@@ -78,4 +78,6 @@ public class ActivityManager {
throws SecurityException {
return new ArrayList<>();
}
public int getLargeMemoryClass() {return getMemoryClass();}
}

View File

@@ -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;
}

View File

@@ -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);
}
}