Search in sources :

Example 1 with RoomListAdapter

use of net.iGap.adapter.RoomListAdapter in project iGap-Android by KianIranian-STDG.

the class MainFragment method initRecyclerView.

private void initRecyclerView(Context context) {
    recyclerView = new RecyclerView(context);
    recyclerView.setItemAnimator(null);
    recyclerView.setItemViewCacheSize(0);
    recyclerView.setLayoutManager(layoutManager = new LinearLayoutManager(context));
    recyclerView.setAdapter(roomListAdapter = new RoomListAdapter(getRoomController().getLiveRoomList(), avatarHandler, selectedRoom));
    LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
    layoutManager.scrollToPositionWithOffset(firstVisibleItemPosition, firstVisibleItemPositionOffset);
}
Also used : RoomListAdapter(net.iGap.adapter.RoomListAdapter) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 RoomListAdapter (net.iGap.adapter.RoomListAdapter)1