mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Refactor ContactListAdapter to be reusable for other use cases.
This commit introduces an abstract `BaseContactListAdapter` which provides most of the adapter logic. The original `ContactListAdapter` extends it to show date and online status of the contacts. The new `ContactChooserAdapter` which is used for introductions extends the `ContactListAdapter` and adds logic for graying out contacts from different identities than the currently used one. A new `ContactSelectorAdapter` extends the `BaseContactListAdapter` and allows to select multiple contacts. It offers a method to return a collection of all selected `ContactId`s. This commit also sneaks in an animation when the 'Share Forum' button is clicked. Closes #292
This commit is contained in:
@@ -47,7 +47,7 @@ public class ContactChooserFragment extends BaseFragment {
|
||||
public final static String TAG = "ContactChooserFragment";
|
||||
private IntroductionActivity introductionActivity;
|
||||
private BriarRecyclerView list;
|
||||
private ContactListAdapter adapter;
|
||||
private ContactChooserAdapter adapter;
|
||||
private int contactId;
|
||||
|
||||
private static final Logger LOG =
|
||||
@@ -111,8 +111,7 @@ public class ContactChooserFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
};
|
||||
adapter =
|
||||
new ContactListAdapter(getActivity(), onItemClickListener, true);
|
||||
adapter = new ContactChooserAdapter(getActivity(), onItemClickListener);
|
||||
|
||||
list = (BriarRecyclerView) contentView.findViewById(R.id.contactList);
|
||||
list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
Reference in New Issue
Block a user