mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
This changes the visibility of some methods, removes unnecessary abstractions and fixes static import of GroupId constant.
33 lines
989 B
Java
33 lines
989 B
Java
package org.briarproject.android.contactselection;
|
|
|
|
import android.content.Context;
|
|
|
|
import org.briarproject.android.contact.BaseContactListAdapter;
|
|
import org.briarproject.android.contact.ContactItemViewHolder;
|
|
import org.briarproject.api.contact.ContactId;
|
|
import org.briarproject.api.nullsafety.NotNullByDefault;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
|
|
@NotNullByDefault
|
|
public abstract class BaseContactSelectorAdapter<I extends SelectableContactItem, H extends ContactItemViewHolder<I>>
|
|
extends BaseContactListAdapter<I, H> {
|
|
|
|
public BaseContactSelectorAdapter(Context context, Class<I> c,
|
|
OnContactClickListener<I> listener) {
|
|
super(context, c, listener);
|
|
}
|
|
|
|
public Collection<ContactId> getSelectedContactIds() {
|
|
Collection<ContactId> selected = new ArrayList<>();
|
|
|
|
for (int i = 0; i < items.size(); i++) {
|
|
SelectableContactItem item = items.get(i);
|
|
if (item.isSelected()) selected.add(item.getContact().getId());
|
|
}
|
|
return selected;
|
|
}
|
|
|
|
}
|