avast / android-styled-dialogs

Backport of Material dialogs with easy-to-use API based on DialogFragment
Apache License 2.0
2.15k stars 450 forks source link

ListDialogFragment OnClickListener API #100

Closed marcoRS closed 9 years ago

marcoRS commented 9 years ago

I'm having trouble figuring out how to set up a item click listener using a ListDialogFragment. From looking at the code I don't immediately see it.

Is there plans to support a similar API like an AlertDialogBuilder? I'm referring to the following:

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
      builder.setNegativeButton(android.R.string.cancel, null)
      .setItems(R.array.items, new OnClickListener() {
             public void onClick(DialogInterface dialog, int which) {
               // react to item selected. 
            }
    });
davidvavra commented 9 years ago

Please have a look in the demo app. We can't use similar API to AlertDialog, because we use DialogFragments.