Search in sources :

Example 1 with SimpleDividerItemDecoration

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

the class CreateEventInviteFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_create_event_invite, container, false);
    recyclerView = (RecyclerView) rootView.findViewById(R.id.invite_recycler_view);
    // friendsAdapter = new FriendsAdapter(friendsUserList,eventPresenter, getActivity().getApplicationContext());
    linearLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
    recyclerView.setAdapter(contactListAdapter);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getContext()));
    getFriendUsers();
    return rootView;
}
Also used : SimpleDividerItemDecoration(com.example.c4q.capstone.utils.SimpleDividerItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 2 with SimpleDividerItemDecoration

use of com.example.c4q.capstone.utils.SimpleDividerItemDecoration 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 3 with SimpleDividerItemDecoration

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

the class ContactListFragment method onCreateView.

/* public static ContactListFragment newInstance(String title) {
        ContactListFragment fragment = new ContactListFragment();
        Bundle args = new Bundle();
        args.putString("title", title);
        fragment.setArguments(args);
        return fragment;
    }*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    view = inflater.inflate(R.layout.fragment_contactlist, container, false);
    searchView = view.findViewById(R.id.search_bar_cl);
    searchView.setHint("Name, #Grupptag, Email");
    searchView.setHintTextColor(getActivity().getResources().getColor(R.color.hintcolor));
    String currentUserId = CurrentUser.getInstance().getUserID();
    DatabaseReference contactsRef = FirebaseDatabase.getInstance().getReference().child(USER_CONTACTS).child(currentUserId);
    recyclerView = view.findViewById(R.id.contact_list_rec);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager linearLayout = new LinearLayoutManager(view.getContext());
    contactListAdapter = new ContactListAdapter(PublicUserDetails.class, R.layout.contact_item_view, ContactListViewHolder.class, contactsRef);
    /**
     *ajoxe:
     * after modifying the adapter, set the list as friendsUserList
     * contactListAdapter = new ContactListAdapter(friendsUserList, getContext());
     */
    recyclerView.setAdapter(contactListAdapter);
    recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getContext()));
    recyclerView.setLayoutManager(linearLayout);
    return view;
}
Also used : SimpleDividerItemDecoration(com.example.c4q.capstone.utils.SimpleDividerItemDecoration) ContactListAdapter(com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofilecontroller.ContactListAdapter) DatabaseReference(com.google.firebase.database.DatabaseReference) 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 4 with SimpleDividerItemDecoration

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

the class VenueFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    rootView = inflater.inflate(R.layout.fragment_venue, container, false);
    venueRecyclerView = rootView.findViewById(R.id.venue_recycler_view);
    linearLayoutManager = new LinearLayoutManager(context);
    linearLayoutManager.setStackFromEnd(true);
    linearLayoutManager.setReverseLayout(true);
    venueRecyclerView.setAdapter(firebaseRecyclerAdapter);
    venueRecyclerView.setLayoutManager(linearLayoutManager);
    venueRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(getContext()));
    venueName = (TextView) rootView.findViewById(R.id.venue_name_textview);
    venueAddress = (TextView) rootView.findViewById(R.id.venue_address_textview);
    venueVoteCount = (TextView) rootView.findViewById(R.id.venue_vote_textview);
    venuePhoto = (ImageView) rootView.findViewById(R.id.venue_photo_image_view);
    getEventData();
    return rootView;
}
Also used : SimpleDividerItemDecoration(com.example.c4q.capstone.utils.SimpleDividerItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 5 with SimpleDividerItemDecoration

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

the class UPEventsFragment method onCreateView.

/* public static UPEventsFragment newInstance(String title) {
        UPEventsFragment fragment = new UPEventsFragment();
        Bundle args = new Bundle();
        args.putString("title", title);
        fragment.setArguments(args);
        return fragment;
    }*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    view = inflater.inflate(R.layout.fragment_events, container, false);
    String currentUserID = CurrentUser.getInstance().getUserID();
    rootRef = FirebaseDatabase.getInstance().getReference();
    eventsRef = rootRef.child(USER_EVENTS_LIST).child(currentUserID);
    recyclerView = view.findViewById(R.id.events_rec);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager linearLayout = new LinearLayoutManager(view.getContext());
    linearLayout.setStackFromEnd(true);
    linearLayout.setReverseLayout(true);
    recyclerView.setLayoutManager(linearLayout);
    eventsAdapter = new EventsAdapter(Events.class, R.layout.events_item_view, EventsViewHolder.class, eventsRef);
    recyclerView.setAdapter(eventsAdapter);
    recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getContext()));
    return view;
}
Also used : SimpleDividerItemDecoration(com.example.c4q.capstone.utils.SimpleDividerItemDecoration) Events(com.example.c4q.capstone.database.events.Events) EventsViewHolder(com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofileviews.EventsViewHolder) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) EventsAdapter(com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofilecontroller.EventsAdapter)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 SimpleDividerItemDecoration (com.example.c4q.capstone.utils.SimpleDividerItemDecoration)6 PublicUserDetails (com.example.c4q.capstone.database.publicuserdata.PublicUserDetails)2 ContactListAdapter (com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofilecontroller.ContactListAdapter)2 ContactListViewHolder (com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofileviews.ContactListViewHolder)2 Events (com.example.c4q.capstone.database.events.Events)1 PublicUser (com.example.c4q.capstone.database.publicuserdata.PublicUser)1 EventsAdapter (com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofilecontroller.EventsAdapter)1 EventsViewHolder (com.example.c4q.capstone.userinterface.user.userprofilefragments.userprofileviews.EventsViewHolder)1 FBUserDataListener (com.example.c4q.capstone.utils.FBUserDataListener)1 DatabaseReference (com.google.firebase.database.DatabaseReference)1