Search in sources :

Example 21 with AlertDialogBuilder

use of de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder in project StreetComplete by westnordost.

the class AddRoadSurfaceForm method onClickOk.

@Override
protected void onClickOk() {
    final Bundle answer = new Bundle();
    Item surface = getSelectedItem();
    if (surface != null) {
        answer.putString(SURFACE, surface.value);
        if (surface.isGroup()) {
            new AlertDialogBuilder(getContext()).setMessage(R.string.quest_surface_generic_surface_confirmation).setNegativeButton(R.string.quest_generic_confirmation_no, null).setPositiveButton(R.string.quest_generic_confirmation_yes, (dialog, which) -> applyFormAnswer(answer)).show();
            return;
        }
    }
    applyFormAnswer(answer);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) Arrays(java.util.Arrays) Bundle(android.os.Bundle) GroupedImageSelectAdapter(de.westnordost.streetcomplete.view.GroupedImageSelectAdapter) AlertDialogBuilder(de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder) LayoutInflater(android.view.LayoutInflater) ViewGroup(android.view.ViewGroup) Item(de.westnordost.streetcomplete.view.Item) RecyclerView(android.support.v7.widget.RecyclerView) R(de.westnordost.streetcomplete.R) AbstractQuestFormAnswerFragment(de.westnordost.streetcomplete.quests.AbstractQuestFormAnswerFragment) View(android.view.View) Button(android.widget.Button) Item(de.westnordost.streetcomplete.view.Item) AlertDialogBuilder(de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder) Bundle(android.os.Bundle)

Aggregations

AlertDialogBuilder (de.westnordost.streetcomplete.view.dialogs.AlertDialogBuilder)21 Bundle (android.os.Bundle)11 View (android.view.View)11 R (de.westnordost.streetcomplete.R)8 AlertDialog (android.support.v7.app.AlertDialog)6 LayoutInflater (android.view.LayoutInflater)6 ArrayList (java.util.ArrayList)6 Intent (android.content.Intent)5 RecyclerView (android.support.v7.widget.RecyclerView)5 ImageView (android.widget.ImageView)5 Inject (javax.inject.Inject)5 Context (android.content.Context)4 Toast (android.widget.Toast)4 Arrays (java.util.Arrays)4 List (java.util.List)4 DialogInterface (android.content.DialogInterface)3 ViewGroup (android.view.ViewGroup)3 TextView (android.widget.TextView)3 Activity (android.app.Activity)2 BroadcastReceiver (android.content.BroadcastReceiver)2