Search in sources :

Example 1 with AssigneeDialogItem

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

the class AssigneeDialogFragment method onCreateDialog.

@NonNull
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    int selected = getArguments().getInt(ARG_SELECTED_CHOICE);
    GroupAdapter adapter = new GroupAdapter();
    for (User user : getChoices()) {
        adapter.add(new AssigneeDialogItem(avatars, user, selected));
    }
    adapter.setOnItemClickListener(this);
    return createDialogBuilder().adapter(adapter, null).negativeText(R.string.cancel).neutralText(R.string.clear).onNeutral((dialog, which) -> onResult(RESULT_OK)).build();
}
Also used : Bundle(android.os.Bundle) NonNull(androidx.annotation.NonNull) RESULT_OK(android.app.Activity.RESULT_OK) Dialog(android.app.Dialog) GroupAdapter(com.xwray.groupie.GroupAdapter) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) User(com.meisolsson.githubsdk.model.User) BaseActivity(com.github.pockethub.android.ui.base.BaseActivity) Item(com.xwray.groupie.Item) SingleChoiceDialogFragment(com.github.pockethub.android.ui.SingleChoiceDialogFragment) AssigneeDialogItem(com.github.pockethub.android.ui.item.dialog.AssigneeDialogItem) View(android.view.View) R(com.github.pockethub.android.R) AvatarLoader(com.github.pockethub.android.util.AvatarLoader) User(com.meisolsson.githubsdk.model.User) GroupAdapter(com.xwray.groupie.GroupAdapter) AssigneeDialogItem(com.github.pockethub.android.ui.item.dialog.AssigneeDialogItem) NonNull(androidx.annotation.NonNull)

Aggregations

RESULT_OK (android.app.Activity.RESULT_OK)1 Dialog (android.app.Dialog)1 Bundle (android.os.Bundle)1 View (android.view.View)1 NonNull (androidx.annotation.NonNull)1 R (com.github.pockethub.android.R)1 SingleChoiceDialogFragment (com.github.pockethub.android.ui.SingleChoiceDialogFragment)1 BaseActivity (com.github.pockethub.android.ui.base.BaseActivity)1 AssigneeDialogItem (com.github.pockethub.android.ui.item.dialog.AssigneeDialogItem)1 AvatarLoader (com.github.pockethub.android.util.AvatarLoader)1 User (com.meisolsson.githubsdk.model.User)1 GroupAdapter (com.xwray.groupie.GroupAdapter)1 Item (com.xwray.groupie.Item)1 ArrayList (java.util.ArrayList)1 Inject (javax.inject.Inject)1