Tag: recyclerview

RecyclerView in CoordinatorLayout loses its top padding after orientation changes

I am using Support Design Library rev. 23.0.1 (and 22.2.1 as well). The problem is after activity orientation changes if RecyclerView (placed in fragment) has been scrolled, it loses its top padding which is probably equal to StatusBar Height + AppBar Height (as you see on a picture). See this sample video for details Here […]

Android – How to stop images reloading in Recyclerview when scrolling

I was creating an app for loading images from internet in cards. I am using Recyclerview for listing purpose. For downloading images, I have tried Picasso, universal-image-downloader and other custom methods but everywhere I have this problem: Whenever I scroll down and up the images in imageview are getting reloaded. I have even kept a […]

Removing focus indicator from RecycleView in Android

I have an app using RecyclerView, and on the tablet I get a light blue background showing. Particularly on Jelly Bean devices and in the emulator. I’ve tried to remove it by marking my RecyclerView as android:focusable=”false” I know it’s the focus indicator since on the emulator if I hit the tab key it goes […]

Toolbar not hiding on RecyclerView scroll

I’m trying to make the Toolbar in my app hide and show based on the RecyclerView‘s scrolling. This gif shows what I’m trying to achieve. I’m following this tutorial and not getting the results I’m looking for. Here is my activity’s layout: <android.support.design.widget.CoordinatorLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/coordinatorLayout” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.MainActivity” android:fitsSystemWindows=”true”> <android.support.v4.widget.DrawerLayout android:id=”@+id/drawer” android:layout_width=”match_parent” android:layout_height=”match_parent” android:elevation=”7dp”> […]

Why do the list elements not swap?

I have a RecyclerView and have implemented an onMove command called onItemMove. I’m using onItemMove to try and get the list elements to swap position when dragged around, but the list elements just hover over each, they don’t swap. How can I correct this? Note 1: onItemDismiss works fine; it swipes the item away and […]

RecyclerView refreshes items only when scrolling down and up

I am making a simple recyclerview with Movie items. When I try adding new items they won’t display in the recyclerview right away. For some reason I have to scroll down so the first item is gone, and then up again for the new item to be displayed (it’s added at index 0). The adapter: […]

Recyclerview onBindViewHolder called for all items when inside LinearLayout with weights

I recently updated from support library recyclerview-v7:23.1.1 to recyclerview-v7:25.1.0. My Layout contains 2 recylerviews splitted 50% on the screen. The xml code is as follows: <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”horizontal”> <android.support.v7.widget.RecyclerView android:id=”@+id/recyclerView1″ android:layout_width=”0dp” android:layout_height=”match_parent” android:layout_weight=”1″ android:scrollbars=”none”/> <android.support.v4.widget.Space android:layout_width=”@dimen/two_dp” android:layout_height=”match_parent” android:background=”@color/dark_gray”/> <android.support.v7.widget.RecyclerView android:id=”@+id/recyclerView2″ android:layout_width=”0dp” android:layout_height=”match_parent” android:layout_weight=”1″ android:scrollbars=”none”/> </LinearLayout> Now onBindViewHolder is called for all list items instead […]

RecyclerView hides Actionbar when SoftKeyboard is opened

I have the following Layout <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:id=”@+id/container”> <com.example.SendMessageLayout android:id=”@+id/chatMessageLayout” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_alignParentBottom=”true” /> <View android:id=”@+id/separator” android:layout_width=”match_parent” android:layout_height=”0dp” android:layout_above=”@id/chatMessageLayout” android:background=”@color/seperator_line_inpost” /> <android.support.v4.widget.SwipeRefreshLayout android:id=”@+id/swipe_container” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_alignParentTop=”true” android:layout_above=”@id/separator” > <android.support.v7.widget.RecyclerView android:id=”@+id/recycleView” style=”@style/BeepMeListView” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_above=”@+id/chatMessageLayout” android:layout_alignParentTop=”true” android:transcriptMode=”alwaysScroll” /> </android.support.v4.widget.SwipeRefreshLayout> </RelativeLayout> While SendMessageLayout is just a layout with EditText and a Button. […]

Animated population of RecyclerView

I have a RecyclerView stuffed with a collection of CardView. My code is essentially the code on this official article, and works fine, so there is no need to post my code here. Is on there. It’s looks like the following: +——————————+ | +————+ +————+ | | | card 1 | | | | | […]

RecyclerView: Highlight selected item

I have implemented a RecyclerView and I have set it up to use CAB. But how can I highlight the selected items? If a certain position I checked I stored in a SparseBooleanArray. My first thought was to store the specific View containg all the elements in my ViewHolder and then in onBindViewHolder set the […]

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