Tag: recyclerview

How do I use a GridLayoutAnimation in a RecyclerView?

I’m trying to replace my GridView with the new RecyclerView (using GridLayoutManager) but it seems like it doesn’t cope well with gridLayoutAnimation (ClassCastException: LayoutAnimationController$AnimationParameters cannot be cast to GridLayoutAnimationController$AnimationParameters). It works with a regular layout animation, but because it’s a grid, it takes too long to complete on tablets. What I’m trying to accomplish is […]

can i create a nestedScroll Layout like this?

I think it can be achieved by NestedScrollingChild NestedScrollingParent. But I can’t really understand them.Who can help me out! Product manager insists on the design. The ScrollView contains a LinearLayout ,a “TabLayout” and a ViewPager. The ViewPager contains 2 fragment contains RecyclerView or just only 2 RecyclerView. When the ScrollView scroll to Bottom , the […]

Recycler view not scrolling properly after implementing swipe to refresh layout

Prior to the implementation of the Swipe to refresh view, the recycler view was working smoothly but not whenever I try to scroll the recycler view downwards the swipe to refresh interferes and hinders the scroll movement. Here is the screenshot of the issue : (Notice the swipe to refresh layout comes while the recycler […]

Best practice to asynchronously delete a ListView/RecyclerView item

I have a ListView with a CursorLoader. The user can open ListView items (open another Fragment) or delete items. All database actions occur asynchronously and usually it takes a fraction of a second. But technically the user could delete an item and then open the item before the deletion callback and cause and error. What’s […]

Why Glide blink the item ImageView when notifydatasetchanged

I am using Glide 3.7.0 with RecyclerView. The item view always blinks when refreshing (calling notifyDataSetChanged). Here is my code: Glide .with(context) .load(filepath) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .dontAnimate() .into(imageview); When I use no cache, the ImageView has a null Bitmap when notifyDataSetChanged method is called and Glide hasn’t finished loading the bitmap. If I use the code […]

NestedScrollView and Horizontal RecyclerView Smooth Scrolling

I have a single vertical nestedscrollview that contains a bunch of recyclerview with a horizontal layoutmanager setup. The idea is pretty similar to how the new google play store looks. I’m able to make it functional but it isn’t smooth at all. Here are the problems: 1) The horizontal recyclerview item fails to intercept the […]

SwipeRefreshLayout is hidden on empty RecyclerView

I have a Fragment with a SwipeRefreshLayout and then RecyclerView as child. When the Fragment is committed, it starts talking to a server in order to retrieve some data and populate a CustomAdapter which will serve the RecyclerView. The user can refresh the content by swiping down or pressing a button on the ActionBar. In […]

SwipeRefreshLayout no animation on fragment creation

I’m using android.support.v4.widget.SwipeRefreshLayout with android.support.v7.widget.RecyclerView. On fragment view creation I need to show SwipeRefreshLayout animation. But when I call setRefreshing(true) nothing happens. But when I refresh data animation changes. I suppose that the animation isn’t showing without child inside SwipeRefreshLayout. How to show this animation in the best way?

RecyclerView not displaying

I have a RecyclerView that’s not displaying any items. Initially it’s empty, but later I add items and call notifyDatasetChanged(). getItemCount() gets called and returns 25, onBindViewHolder gets called 3 times and sets up the view correctly. public AlbumListAdapter(FacebookActivity activity, long pageId, OnItemClickListener listener){ this.listener = listener; this.inflater = LayoutInflater.from(activity); this.service = new PagedGraphService<Album>(String.format(“https://graph.facebook.com/%d/albums”, pageId), […]

How to add Android Support v7 libraries in eclipse?

How do I add Android Support v7 libraries in eclipse? For example how do I add CardView to an eclipse android project? Note: This was a self answer question, so no need to waste your time making an answer. Of course, if you have anything to add, please do.

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