Tag: recyclerview

RecyclerView laggy scrolling

I am loading 400×200 images in RecyclerView, but scrolling is laggy on 2k devices. I am using Picasso for loading images from resource. As you can see in the demo images are blurry on 2k screen, but if I load higher resolution images the situation gets worse. How to fix this, I am not even […]

RecyclerView.getChild(index) shows null when list is scrolled (index gets messed up)

I’ve been using SwipeableRecyclerView for my android application for enabling swipes for my recyclerView. RecyclerView contains a list of cardViews. I was trying to implement undo functionality for cards which will get deleted when swipe to left (first swipe shows undo, next swipe triggers delete) I am trying the following code (partially working I guess) […]

Android: how can I insert a RecyclerView inside CardView?

The activity I am talking about must show a RecyclerView populated by CardViews as items. My goal is to show in every CardView a RecyclerView in its turn. Here my Activity’s basic xml: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.ConjActivity” > <android.support.v7.widget.RecyclerView android:id=”@+id/conjCardList” android:layout_width=”match_parent” android:layout_height=”match_parent” android:clickable=”false” /> </LinearLayout> And here is the layout […]

Why does OnClickListener on a ViewHolder don't work?

I’m trying to implement a way to handle item selection on a RecyclerView. I personally don’t like the way suggested in some answers on SO of passing through gestures, and I thought that implementing an OnClickListener, as suggested here and here, was waaay cleaner. The fact is that… this pattern doesn’t actually work! I’m really […]

OnLongItemClick in RecyclerView

I am starting to use RecyclerView in Android. Things work fine until I implement touch listener for my adapter. From this topic: https://stackoverflow.com/a/26826692/2923403 I can implement the listener for childview correctly. However, I would like to implement both OnItemClick and OnItemLongClick, then problem appear. They are always fired at the same time. OnItemClick first and […]

How to implement multi-select in RecyclerView?

ListView had a multiple choice mode, what should I use for implementing the same using RecyclerView? How to handle onItemCheckedStateChanged? I checked this, But i couldn’t make out much out of this. Any code snippet or a sample project implementing the same would be great. Thanks in advance.

“LayoutManager is already attached to a RecyclerView” error

I am trying to have multiple RecyclerViews in a layout but I get the following error: “LayoutManager is already attached to a RecyclerView” The Java code is: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_squad, container, false); Activity parentActivity = getActivity(); final […]

android recyclerview doesn't display items

I want to show these items inside my recyclerview but it doesn’t show at all and I can’t see the error. Maybe you guys can help me out. MainActivity.java RecyclerView recyclerView = (RecyclerView)findViewById(R.id.rec); List<MenuData> list = new ArrayList<>(); recyclerView.setHasFixedSize(true); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); recyclerView.setLayoutManager(linearLayoutManager); MenuRecAdapter menuRecAdapter = new MenuRecAdapter(list); recyclerView.setAdapter(menuRecAdapter); RecyclerView adapter: public […]

RecyclerView scrolling on insert

I am trying to use RecyclerView to create a chat application. I am using a LinearLayoutManager with setReverseLayout(true). When I am scrolled all the way to the bottom (which is the dataset start = newest message) and a new message is inserted into the dataset, the item appears at the bottom of the list as […]

Spacing Issue while creating bus layout in recycler view Gridlayout manager

I’m using recycler view with GirdLayout Manager for creating bus layout my problem is with spacing I’m populating data according to row column This is how I’m getting layout This is how i want my layout to be: i want the item at row 3 and column 2 beside sleeper seat at row 2 column […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.