use of de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder in project StreetComplete by westnordost.
the class AddOpeningHoursAdapter method openSetWeekdaysDialog.
private void openSetWeekdaysDialog(final Weekdays weekdays, final WeekdaysPickedListener callback) {
final boolean[] selection = weekdays.getSelection();
AlertDialog dlg = new AlertDialogBuilder(context).setTitle(R.string.quest_openingHours_chooseWeekdaysTitle).setMultiChoiceItems(Weekdays.getNames(context.getResources()), selection, (dialog, which, isChecked) -> updateDialogOkButtonEnablement((AlertDialog) dialog, selection)).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, (dialog, which) -> callback.onWeekdaysPicked(new Weekdays(selection))).show();
updateDialogOkButtonEnablement(dlg, selection);
}
use of de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder in project StreetComplete by westnordost.
the class AddOpeningHoursForm method showInputCommentDialog.
private void showInputCommentDialog() {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.quest_opening_hours_comment, null);
final EditText editText = view.findViewById(R.id.commentInput);
new AlertDialogBuilder(getContext()).setTitle(R.string.quest_openingHours_comment_title).setView(view).setPositiveButton(android.R.string.ok, (dialog, which) -> {
String txt = editText.getText().toString().replaceAll("\"", "").trim();
if (txt.isEmpty()) {
new AlertDialogBuilder(getContext()).setMessage(R.string.quest_openingHours_emptyAnswer).setPositiveButton(R.string.ok, null).show();
return;
}
Bundle answer = new Bundle();
answer.putString(OPENING_HOURS, "\"" + txt + "\"");
applyImmediateAnswer(answer);
}).setNegativeButton(android.R.string.cancel, null).show();
}
use of de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder in project StreetComplete by westnordost.
the class AddOpeningHoursForm method showConfirm24_7Dialog.
private void showConfirm24_7Dialog() {
new AlertDialogBuilder(getActivity()).setMessage(R.string.quest_openingHours_24_7_confirmation).setPositiveButton(android.R.string.yes, (dialog, which) -> {
Bundle answer = new Bundle();
answer.putString(OPENING_HOURS, "24/7");
applyImmediateAnswer(answer);
}).setNegativeButton(android.R.string.no, null).show();
}
use of de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder in project StreetComplete by westnordost.
the class AddRoadNameForm method confirmNoStreetName.
private void confirmNoStreetName() {
new AlertDialogBuilder(getActivity()).setTitle(R.string.quest_name_answer_noName_confirmation_title).setMessage(R.string.quest_streetName_answer_noName_confirmation_description).setPositiveButton(R.string.quest_name_noName_confirmation_positive, (dialog, which) -> {
Bundle data = new Bundle();
data.putBoolean(NO_NAME, true);
applyImmediateAnswer(data);
}).setNegativeButton(R.string.quest_generic_confirmation_no, null).show();
}
use of de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder in project StreetComplete by westnordost.
the class AddRoadNameForm method showKeyboardInfo.
private void showKeyboardInfo() {
new AlertDialogBuilder(getActivity()).setTitle(R.string.quest_streetName_cantType_title).setMessage(R.string.quest_streetName_cantType_description).setPositiveButton(R.string.quest_streetName_cantType_open_settings, (dialog, which) -> startActivity(new Intent(Settings.ACTION_SETTINGS))).setNeutralButton(R.string.quest_streetName_cantType_open_store, (dialog, which) -> {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_APP_MARKET);
startActivity(intent);
}).setNegativeButton(android.R.string.cancel, null).show();
}
Aggregations