Java Code Examples for com.grarak.kerneladiutor.utils.Utils#confirmDialog()

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#confirmDialog() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BackupFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void restoreDialog(final RootFile file, final Backup.PARTITION partition_type, final boolean restoring) {
    Utils.confirmDialog(null, getString(R.string.overwrite_question, Backup.getPartition(partition_type)), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            new AsyncTask < Void, Void, Void > () {
                private MaterialDialog progressDialog;

                @Override
                protected void onPreExecute() {
                    super.onPreExecute();
                    progressDialog = new MaterialDialog.Builder(getActivity())
                        .content(restoring ? R.string.restoring : R.string.flashing)
                        .progress(true, 0)
                        .canceledOnTouchOutside(false)
                        .show();
                }

                @Override
                protected Void doInBackground(Void...params) {
                    Backup.restore(file, partition_type);
                    return null;
                }

                @Override
                protected void onPostExecute(Void aVoid) {
                    super.onPostExecute(aVoid);
                    progressDialog.dismiss();
                }
            }.execute();
        }
    }, getActivity());
}
 
Example 2
Source File: BackupFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void deleteDialog(final RootFile file) {
    Utils.confirmDialog(null, getString(R.string.delete_question, file.getName()), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            file.delete();
            getHandler().post(new Runnable() {
                @Override
                public void run() {
                    create();
                }
            });
        }
    }, getActivity());
}
 
Example 3
Source File: BuildpropFragment.java    From KA27 with Apache License 2.0 5 votes vote down vote up
private void deleteDialog(final String key, final String value) {
    Utils.confirmDialog(null, getString(R.string.delete_question, key + " = " + value), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            delete(getActivity(), key.trim());
        }
    }, getActivity());
}
 
Example 4
Source File: BackupFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void deleteDialog(final RootFile file) {
    Utils.confirmDialog(null, getString(R.string.delete_question, file.getName()), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            file.delete();
            getHandler().post(new Runnable() {
                @Override
                public void run() {
                    create();
                }
            });
        }
    }, getActivity());
}
 
Example 5
Source File: BuildpropFragment.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
private void deleteDialog(final String key, final String value) {
    Utils.confirmDialog(null, getString(R.string.delete_question, key), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            delete(key.trim());
        }
    }, getActivity());
}