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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations