Search in sources :

Example 16 with Builder

use of android.app.AlertDialog.Builder in project Conversations by siacs.

the class XmppActivity method warnMutalPresenceSubscription.

private void warnMutalPresenceSubscription(final Conversation conversation, final OnPresenceSelected listener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(conversation.getContact().getJid().toString());
    builder.setMessage(R.string.without_mutual_presence_updates);
    builder.setNegativeButton(R.string.cancel, null);
    builder.setPositiveButton(R.string.ignore, new OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            conversation.setNextCounterpart(null);
            if (listener != null) {
                listener.onPresenceSelected();
            }
        }
    });
    builder.create().show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) Builder(android.app.AlertDialog.Builder) Builder(android.app.AlertDialog.Builder) OnClickListener(android.content.DialogInterface.OnClickListener) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 17 with Builder

use of android.app.AlertDialog.Builder in project Conversations by siacs.

the class EditAccountActivity method showPassword.

private void showPassword() {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    View view = getLayoutInflater().inflate(R.layout.dialog_show_password, null);
    TextView password = (TextView) view.findViewById(R.id.password);
    password.setText(mAccount.getPassword());
    builder.setTitle(R.string.password);
    builder.setView(view);
    builder.setPositiveButton(R.string.cancel, null);
    builder.create().show();
}
Also used : AlertDialog(android.app.AlertDialog) Builder(android.app.AlertDialog.Builder) Builder(android.app.AlertDialog.Builder) TextView(android.widget.TextView) AutoCompleteTextView(android.widget.AutoCompleteTextView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 18 with Builder

use of android.app.AlertDialog.Builder in project platform_frameworks_base by android.

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 19 with Builder

use of android.app.AlertDialog.Builder in project facebook-api-android-maven by avianey.

the class Util method showAlert.

/**
     * Display a simple alert dialog with the given text and title.
     *
     * @param context
     *          Android context in which the dialog should be displayed
     * @param title
     *          Alert dialog title
     * @param text
     *          Alert dialog message
     */
@Deprecated
public static void showAlert(Context context, String title, String text) {
    Builder alertBuilder = new Builder(context);
    alertBuilder.setTitle(title);
    alertBuilder.setMessage(text);
    alertBuilder.create().show();
}
Also used : Builder(android.app.AlertDialog.Builder)

Example 20 with Builder

use of android.app.AlertDialog.Builder in project android_frameworks_base by DirtyUnicorns.

the class ResolverTargetActionsDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final int itemRes = args.getBoolean(PINNED_KEY, false) ? R.array.resolver_target_actions_unpin : R.array.resolver_target_actions_pin;
    return new Builder(getContext()).setCancelable(true).setItems(itemRes, this).setTitle(args.getCharSequence(TITLE_KEY)).create();
}
Also used : Bundle(android.os.Bundle) Builder(android.app.AlertDialog.Builder)

Aggregations

Builder (android.app.AlertDialog.Builder)70 DialogInterface (android.content.DialogInterface)49 AlertDialog (android.app.AlertDialog)32 OnClickListener (android.content.DialogInterface.OnClickListener)18 Intent (android.content.Intent)17 View (android.view.View)15 TextView (android.widget.TextView)13 OnClickListener (android.view.View.OnClickListener)11 SuppressLint (android.annotation.SuppressLint)9 Bundle (android.os.Bundle)9 ArrayList (java.util.ArrayList)9 ImageView (android.widget.ImageView)8 ImageButton (android.widget.ImageButton)7 RelativeLayout (android.widget.RelativeLayout)7 Point (android.graphics.Point)6 List (java.util.List)6 TileInfo (com.android.systemui.qs.customize.TileQueryHelper.TileInfo)5 ExpandableListView (android.widget.ExpandableListView)4 LinearLayout (android.widget.LinearLayout)4 ListView (android.widget.ListView)4