Search in sources :

Example 16 with Builder

use of android.support.v7.app.AlertDialog.Builder in project Timber by naman14.

the class Timber4 method updateRepeatState.

@Override
public void updateRepeatState() {
    if (repeat != null && getActivity() != null) {
        MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.REPEAT).setSizeDp(30);
        if (MusicPlayer.getRepeatMode() == 0) {
            builder.setColor(Color.WHITE);
        } else
            builder.setColor(accentColor);
        repeat.setImageDrawable(builder.build());
        repeat.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                MusicPlayer.cycleRepeat();
                updateRepeatState();
                updateShuffleState();
            }
        });
    }
}
Also used : ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 17 with Builder

use of android.support.v7.app.AlertDialog.Builder in project Timber by naman14.

the class Timber5 method updateRepeatState.

@Override
public void updateRepeatState() {
    if (repeat != null && getActivity() != null) {
        MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.REPEAT).setSizeDp(30);
        if (MusicPlayer.getRepeatMode() == 0) {
            builder.setColor(Color.WHITE);
        } else
            builder.setColor(accentColor);
        repeat.setImageDrawable(builder.build());
        repeat.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                MusicPlayer.cycleRepeat();
                updateRepeatState();
                updateShuffleState();
            }
        });
    }
}
Also used : ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 18 with Builder

use of android.support.v7.app.AlertDialog.Builder in project android by owncloud.

the class RenameFileDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mTargetFile = getArguments().getParcelable(ARG_TARGET_FILE);
    // Inflate the layout for the dialog
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View v = inflater.inflate(R.layout.edit_box_dialog, null);
    // Setup layout 
    String currentName = mTargetFile.getFileName();
    EditText inputText = ((EditText) v.findViewById(R.id.user_input));
    inputText.setText(currentName);
    int selectionStart = 0;
    int extensionStart = mTargetFile.isFolder() ? -1 : currentName.lastIndexOf(".");
    int selectionEnd = (extensionStart >= 0) ? extensionStart : currentName.length();
    if (selectionStart >= 0 && selectionEnd >= 0) {
        inputText.setSelection(Math.min(selectionStart, selectionEnd), Math.max(selectionStart, selectionEnd));
    }
    inputText.requestFocus();
    // Build the dialog  
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(v).setPositiveButton(R.string.common_ok, this).setNegativeButton(R.string.common_cancel, this).setTitle(R.string.rename_dialog_title);
    Dialog d = builder.create();
    d.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    return d;
}
Also used : EditText(android.widget.EditText) AlertDialog(android.support.v7.app.AlertDialog) Dialog(android.app.Dialog) AlertDialog(android.support.v7.app.AlertDialog) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 19 with Builder

use of android.support.v7.app.AlertDialog.Builder in project android by owncloud.

the class CreateFolderDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mParentFolder = getArguments().getParcelable(ARG_PARENT_FOLDER);
    // Inflate the layout for the dialog
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View v = inflater.inflate(R.layout.edit_box_dialog, null);
    // Setup layout 
    EditText inputText = ((EditText) v.findViewById(R.id.user_input));
    inputText.setText("");
    inputText.requestFocus();
    // Build the dialog  
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(v).setPositiveButton(R.string.common_ok, this).setNegativeButton(R.string.common_cancel, this).setTitle(R.string.uploader_info_dirname);
    Dialog d = builder.create();
    d.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    return d;
}
Also used : EditText(android.widget.EditText) AlertDialog(android.support.v7.app.AlertDialog) Dialog(android.app.Dialog) AlertDialog(android.support.v7.app.AlertDialog) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 20 with Builder

use of android.support.v7.app.AlertDialog.Builder in project react-native-image-picker by marcshilling.

the class PermissionUtils method explainingDialog.

@Nullable
public static AlertDialog explainingDialog(@NonNull final ImagePickerModule module, @NonNull final ReadableMap options, @NonNull final OnExplainingPermissionCallback callback) {
    if (module.getContext() == null) {
        return null;
    }
    final ReadableMap permissionDenied = options.getMap("permissionDenied");
    final String title = permissionDenied.getString("title");
    final String text = permissionDenied.getString("text");
    final String btnReTryTitle = permissionDenied.getString("reTryTitle");
    final String btnOkTitle = permissionDenied.getString("okTitle");
    final WeakReference<ImagePickerModule> reference = new WeakReference<>(module);
    final Activity activity = module.getActivity();
    if (activity == null) {
        return null;
    }
    AlertDialog.Builder builder = new AlertDialog.Builder(activity, module.getDialogThemeId());
    builder.setTitle(title).setMessage(text).setCancelable(false).setNegativeButton(btnOkTitle, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(final DialogInterface dialogInterface, int i) {
            callback.onCancel(reference, dialogInterface);
        }
    }).setPositiveButton(btnReTryTitle, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            callback.onReTry(reference, dialogInterface);
        }
    });
    return builder.create();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) DialogInterface(android.content.DialogInterface) ImagePickerModule(com.imagepicker.ImagePickerModule) Activity(android.app.Activity) WeakReference(java.lang.ref.WeakReference) ReadableMap(com.facebook.react.bridge.ReadableMap) Nullable(android.support.annotation.Nullable)

Aggregations

AlertDialog (android.support.v7.app.AlertDialog)114 DialogInterface (android.content.DialogInterface)76 View (android.view.View)67 TextView (android.widget.TextView)48 Intent (android.content.Intent)36 RecyclerView (android.support.v7.widget.RecyclerView)27 ListView (android.widget.ListView)23 Dialog (android.app.Dialog)22 LayoutInflater (android.view.LayoutInflater)20 ImageView (android.widget.ImageView)20 EditText (android.widget.EditText)18 SuppressLint (android.annotation.SuppressLint)17 Context (android.content.Context)17 Bundle (android.os.Bundle)15 NonNull (android.support.annotation.NonNull)14 Button (android.widget.Button)13 ArrayList (java.util.ArrayList)12 BrowserDialog (acr.browser.lightning.dialog.BrowserDialog)10 OnClickListener (android.content.DialogInterface.OnClickListener)10 ScrollView (android.widget.ScrollView)10