Search in sources :

Example 1 with FBUserDataListener

use of com.example.c4q.capstone.utils.FBUserDataListener in project Grupp by tmoronta1208.

the class InvitedFriendsFragment method convertIdsToUsers.

public void convertIdsToUsers(ArrayList<String> invitedList) {
    friendsUserIDList = new ArrayList<>();
    friendsUserIDList.addAll(invitedList);
    Log.d("UserFriends Fragment", "convertIdsTousers");
    if (friendsUserIDList != null) {
        if (friendsUserIDList.size() != 0) {
            for (String s : friendsUserIDList) {
                userDataUtility.getPublicUser(s, new FBUserDataListener() {

                    @Override
                    public void getUid(String userID) {
                    }

                    @Override
                    public void getPublicUser(PublicUser publicUser) {
                        friendsUserList.add(publicUser);
                    }
                });
            }
            if (friendsUserList != null) {
                if (getActivity() != null) {
                    contactListAdapter = new ContactListAdapter(PublicUserDetails.class, R.layout.contact_item_view, ContactListViewHolder.class, contactsRef);
                    linearLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
                    recyclerView.setAdapter(contactListAdapter);
                    recyclerView.setLayoutManager(linearLayoutManager);
                    recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getContext()));
                }
            }
        }
    } else {
    }
}
Also used : SimpleDividerItemDecoration(com.example.c4q.capstone.utils.SimpleDividerItemDecoration) PublicUser(com.example.c4q.capstone.database.publicuserdata.PublicUser) ContactListAdapter(com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofilecontroller.ContactListAdapter) FBUserDataListener(com.example.c4q.capstone.utils.FBUserDataListener) PublicUserDetails(com.example.c4q.capstone.database.publicuserdata.PublicUserDetails) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ContactListViewHolder(com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofileviews.ContactListViewHolder)

Example 2 with FBUserDataListener

use of com.example.c4q.capstone.utils.FBUserDataListener in project Grupp by tmoronta1208.

the class ContactListFragment method loadFriendsList.

public void loadFriendsList(List<String> keyList) {
    Log.d("user friends frag", "loadFriendsFrag" + friendKeys.size());
    for (String s : friendKeys) {
        Log.d("Contacts", "loadFriendsFrag: friends key strings: " + s);
        fbUserDataUtility.getPublicUser(s, new FBUserDataListener() {

            @Override
            public void getUid(String userID) {
            }

            @Override
            public void getPublicUser(PublicUser publicUser) {
                friendsUserList.add(publicUser);
                contactListAdapter.notifyDataSetChanged();
                Log.d("CONTACTS", "loadFriendsList: friends name: " + publicUser.getFirst_name());
                Log.d("CONTACTS", "loadFriendsList: public user list size: " + friendsUserList.size());
            }
        });
    }
}
Also used : PublicUser(com.example.c4q.capstone.database.publicuserdata.PublicUser) FBUserDataListener(com.example.c4q.capstone.utils.FBUserDataListener)

Aggregations

PublicUser (com.example.c4q.capstone.database.publicuserdata.PublicUser)2 FBUserDataListener (com.example.c4q.capstone.utils.FBUserDataListener)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 PublicUserDetails (com.example.c4q.capstone.database.publicuserdata.PublicUserDetails)1 ContactListAdapter (com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofilecontroller.ContactListAdapter)1 ContactListViewHolder (com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofileviews.ContactListViewHolder)1 SimpleDividerItemDecoration (com.example.c4q.capstone.utils.SimpleDividerItemDecoration)1