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