use of net.sourceforge.opencamera.MainActivity in project OpenCamera by ageback.
the class PopupView method showInfoDialog.
private void showInfoDialog(int title_id, int info_id, final String info_preference_key) {
final MainActivity main_activity = (MainActivity) this.getContext();
AlertDialog.Builder alertDialog = new AlertDialog.Builder(PopupView.this.getContext());
alertDialog.setTitle(title_id);
alertDialog.setMessage(info_id);
alertDialog.setPositiveButton(android.R.string.ok, null);
alertDialog.setNegativeButton(R.string.dont_show_again, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (MyDebug.LOG)
Log.d(TAG, "user clicked dont_show_again for info dialog");
final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(main_activity);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(info_preference_key, true);
editor.apply();
}
});
main_activity.showPreview(false);
main_activity.setWindowFlagsForSettings();
AlertDialog alert = alertDialog.create();
// AlertDialog.Builder.setOnDismissListener() requires API level 17, so do it this way instead
alert.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface arg0) {
if (MyDebug.LOG)
Log.d(TAG, "info dialog dismissed");
main_activity.setWindowFlagsForCamera();
main_activity.showPreview(true);
}
});
main_activity.showAlert(alert);
}
use of net.sourceforge.opencamera.MainActivity in project OpenCamera by ageback.
the class PopupView method addButtonOptionsToPopup.
private void addButtonOptionsToPopup(List<String> supported_options, int icons_id, int values_id, String prefix_string, String current_value, String test_key, final ButtonOptionsPopupListener listener) {
if (MyDebug.LOG)
Log.d(TAG, "addButtonOptionsToPopup");
MainActivity main_activity = (MainActivity) this.getContext();
createButtonOptions(this, this.getContext(), total_width_dp, main_activity.getMainUI().getTestUIButtonsMap(), supported_options, icons_id, values_id, prefix_string, true, current_value, test_key, listener);
}
Aggregations