Search in sources :

Example 71 with AlertDialog

use of android.app.AlertDialog in project android_frameworks_base by crdroidandroid.

the class KeyguardSecurityContainer method showDialog.

private void showDialog(String title, String message) {
    final AlertDialog dialog = new AlertDialog.Builder(mContext).setTitle(title).setMessage(message).setCancelable(false).setNeutralButton(R.string.ok, null).create();
    if (!(mContext instanceof Activity)) {
        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    }
    dialog.show();
}
Also used : AlertDialog(android.app.AlertDialog) Activity(android.app.Activity)

Example 72 with AlertDialog

use of android.app.AlertDialog in project android_frameworks_base by crdroidandroid.

the class KeyguardSecurityContainer method showCountdownWipeDialog.

private void showCountdownWipeDialog(int attempts) {
    int msgId = R.string.kg_failed_attempts_now_wiping;
    switch(mSecurityModel.getSecurityMode()) {
        case PIN:
            msgId = R.string.kg_failed_pin_attempts_now_wiping;
            break;
        case Password:
            msgId = R.string.kg_failed_password_attempts_now_wiping;
            break;
        case Pattern:
            msgId = R.string.kg_failed_pattern_attempts_now_wiping;
            break;
    }
    if (mWipeConfirmListener == null) {
        mWipeConfirmListener = new WipeConfirmListener();
    }
    final AlertDialog dialog = new AlertDialog.Builder(mContext).setMessage(mContext.getString(msgId, attempts)).setNegativeButton(// reuse public Yes/No
    com.android.internal.R.string.gpsVerifYes, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int which) {
            showWipeConfirmDialog();
        }
    }).setPositiveButton(com.android.internal.R.string.gpsVerifNo, mWipeConfirmListener).setCancelable(false).create();
    if (!(mContext instanceof Activity)) {
        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    }
    dialog.show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) Activity(android.app.Activity)

Example 73 with AlertDialog

use of android.app.AlertDialog in project android_frameworks_base by crdroidandroid.

the class TileAdapter method showAccessibilityDialog.

private void showAccessibilityDialog(final int position, final View v) {
    final TileInfo info = mTiles.get(position);
    CharSequence[] options = new CharSequence[] { mContext.getString(R.string.accessibility_qs_edit_move_tile, info.state.label), mContext.getString(R.string.accessibility_qs_edit_remove_tile, info.state.label) };
    AlertDialog dialog = new Builder(mContext).setItems(options, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            if (which == 0) {
                startAccessibleDrag(position);
            } else {
                move(position, info.isSystem ? mEditIndex : mTileDividerIndex, v);
                notifyItemChanged(mTileDividerIndex);
                notifyDataSetChanged();
            }
        }
    }).setNegativeButton(android.R.string.cancel, null).create();
    SystemUIDialog.setShowForAllUsers(dialog, true);
    SystemUIDialog.applyFlags(dialog);
    dialog.show();
}
Also used : AlertDialog(android.app.AlertDialog) TileInfo(com.android.systemui.qs.customize.TileQueryHelper.TileInfo) DialogInterface(android.content.DialogInterface) Builder(android.app.AlertDialog.Builder)

Example 74 with AlertDialog

use of android.app.AlertDialog in project android_frameworks_base by crdroidandroid.

the class MainActivity method showDialog.

private void showDialog(String message) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage(message).setTitle("OSU");
    builder.setOnCancelListener(new DialogInterface.OnCancelListener() {

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            dialogInterface.cancel();
            finish();
        }
    });
    AlertDialog dialog = builder.create();
    dialog.show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) TaskStackBuilder(android.app.TaskStackBuilder)

Example 75 with AlertDialog

use of android.app.AlertDialog in project android_frameworks_base by crdroidandroid.

the class KeyguardSecurityContainer method showWipeConfirmDialog.

private void showWipeConfirmDialog() {
    final AlertDialog dialog = new AlertDialog.Builder(mContext).setMessage(R.string.kg_failed_attempts_now_wiping_confirm).setNegativeButton(com.android.internal.R.string.gpsVerifYes, mWipeConfirmListener).setPositiveButton(com.android.internal.R.string.gpsVerifNo, mWipeConfirmListener).setCancelable(false).create();
    if (!(mContext instanceof Activity)) {
        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    }
    dialog.show();
}
Also used : AlertDialog(android.app.AlertDialog) Activity(android.app.Activity)

Aggregations

AlertDialog (android.app.AlertDialog)1029 DialogInterface (android.content.DialogInterface)573 View (android.view.View)278 TextView (android.widget.TextView)213 Intent (android.content.Intent)172 EditText (android.widget.EditText)160 Test (org.junit.Test)148 ShadowAlertDialog (org.robolectric.shadows.ShadowAlertDialog)111 Context (android.content.Context)96 ListView (android.widget.ListView)87 ImageView (android.widget.ImageView)86 LayoutInflater (android.view.LayoutInflater)80 Button (android.widget.Button)78 AdapterView (android.widget.AdapterView)72 Activity (android.app.Activity)66 SuppressLint (android.annotation.SuppressLint)61 Bundle (android.os.Bundle)56 OnClickListener (android.content.DialogInterface.OnClickListener)54 ArrayList (java.util.ArrayList)50 Dialog (android.app.Dialog)46