Search in sources :

Example 1 with RefDialogItem

use of com.github.pockethub.android.ui.item.dialog.RefDialogItem in project PocketHub by pockethub.

the class RefDialogFragment method onCreateDialog.

@NonNull
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    int selected = getArguments().getInt(ARG_SELECTED_CHOICE);
    GroupAdapter adapter = new GroupAdapter();
    for (GitReference ref : getChoices()) {
        adapter.add(new RefDialogItem(ref, selected));
    }
    adapter.setOnItemClickListener(this);
    return createDialogBuilder().adapter(adapter, null).negativeText(R.string.cancel).build();
}
Also used : RefDialogItem(com.github.pockethub.android.ui.item.dialog.RefDialogItem) GroupAdapter(com.xwray.groupie.GroupAdapter) GitReference(com.meisolsson.githubsdk.model.git.GitReference) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)1 RefDialogItem (com.github.pockethub.android.ui.item.dialog.RefDialogItem)1 GitReference (com.meisolsson.githubsdk.model.git.GitReference)1 GroupAdapter (com.xwray.groupie.GroupAdapter)1