Tag: recyclerview

Android RecyclerView With SectionIndexer

Anyone know how to use SectionIndexer or a substitute with RecyclerView? SectionIndexer allows ListView to popup sections when fast scrolling.

Scale up Item in RecyclerView to overlaps 2 adjacent items Android

I’m using RecyclerView with GridLayoutManager. The goal I want to achieve is when I click on an item, It’ll scale up and overlaps the adjacent items. Just like the picture below (in Android TV) When the onClick event is triggered, I call v.animate().scaleX(1.2f).scaleY(1.2f).setDuration(500).start(); But the result is below: It can overlaps only items that has […]

RecyclerView autofit LayoutManager

I am using RecyclerView with StaggeredGridLayoutManager. I want this StaggeredGridLayoutManager or whichever LayoutManager occupy empty areas if there is. For instance if I set the spanCount=3 it must occupy all screen width even I have 2 items or 1 items. In StaggeredGridLayoutManager I can full span single row by : setFullSpan(true); but can’t span 2 […]

Differentiate between a Drag action and a Fling action in recyclerview

Recyclerview right now has 3 states. SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING, SCROLL_STATE_SETTLING An issue raised for the same to include a fling state.I cannot determine if anything was done regarding this. Is there a way to differentiate between a Drag and a Fling in recyclerview. EDIT: The requirement for such functionality: When the user flings,I want to be […]

RecyclerView Header under items in Android

I can’t find solution for such behaviour: It is that header of the RecyclerView is a little bit under items. Of course I guess that it is RecyclerView. How can I achieve that? EDIT What I have done is just adding decoration for recycler view. This is my simple decorator: public class HeaderItemDeceration extends RecyclerView.ItemDecoration […]

Drag and Drop RecyclerView Which is Populated from SQLiteDatabase

Info: I have a RecyclerView, and I populate it with the ArrayList dataList inside the ListAdapter class. I get the data for dataList from the SQLiteDatabase table: TABLE_USERdETAIL in the DbHelper class. I’m trying to implement drag and drop re-organisation into the RecyclerView by using the SimpleItemTouchHelperCallback class; however, although I am now able to […]

difference between android.support.v7.app.AlertController.RecycleListView and android.support.v7.widget.RecyclerView

I recently update my Android Studio and also SDK. In new Android Studio, there is android.support.v7.app.AlertController.RecycleListView. I am familiar with android.support.v7.RecyclerView, so I am a little bit confused that what is the difference between these two. If anyone can guide then it would be thankful.

Drag and Drop between two RecyclerView

Is it possible to have feature like drag and drop between two different RecyclerView? I found library for drag and drop within RecyclerView. Please help me to improve this functionality.

How do I unit test (with JUnit or mockito) recyclerview item clicks

I am currently trying to unit test recyclerview addonitemclick listner, with either junit or mockito. here’s my code: private void mypicadapter(TreeMap<Integer, List<Photos>> photosMap) { List<PhotoListItem> mItems = new ArrayList<>(); for (Integer albumId : photosMap.keySet()) { ListHeader header = new ListHeader(); header.setAlbumId(albumId); mItems.add(header); for (Photos photo : photosMap.get(albumId)) { mItems.add(photo); } pAdapter = new PhotoViewerListAdapter(MainActivity.this, mItems); […]

android studio: gradle dependency error

In the following build.gradle, I added the configuration section to avoid double inclusion of support libraries. Support libraries are used in the main project and in the dependent projects like facebook sdk. Without the configuration section, I get “UNEXPECTED TOP-LEVEL EXCEPTION”. Adding that configuration makes the error go away and the app all works fine. […]

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