Tag: recyclerview

Stop AppBarLayout scrolling off screen when NestedScrollView is empty

I have a fairly typical List functionality using a CoordinatorLayout, AppBarLayout, SwipeRefreshLayout and RecyclerView – When the RecyclerView has enough content to scroll, the page seems fine. When the RecyclerView is empty or doesn’t have enough content to scroll however, the behavior is that the AppBarLayout children with app:layout_scrollFlags=”scroll|enterAlwaysCollapsed” will continue to scroll – which […]

Android: RecyclerView within vertical viewpager

I want to implement a recyclerview within a vertical viewpager. My current layout looks like the following VerticalViewpager – Fragment1 – ImageView – Fragment2 – RecyclerView If I swipe from Fragment1 to Fragment2 everything works fine. I am able to scroll within the recyclerview up and down. The problem occurs if I try to swipe/scroll […]

RecyclerView inside SwipeRefreshLayout inside NestedScrollViewLayout cannot scroll

I have an activity with collapsing toolbar and a nested scroll view with a FrameLayout that I place the fragments in it. Initially, I place in it a FragmentA with a CardView . Works great. When I click a button though I replace that FragmentB with another one containing a RecyclerView . When I add […]

RecyclerView styling at theme level

I’m trying to implement generic style parameters for RecyclerView at theme levels. As in contrast to ListView, I used something like this: Defined a style: <style name=”StyleListView” parent=”Widget.AppCompat.ListView”> <item name=”android:requiresFadingEdge”>vertical</item> <item name=”android:fadingEdgeLength”>10dp</item> <item name=”android:scrollbars”>vertical</item> </style> and later used in my custom theme: <item name=”android:listViewStyle”>@style/StyleListView</item> This works perfectly fine for ListView. However, I’m unable to reflect […]

android java onClick Could not execute method of the activity

This is my first time working with the recyclerview and I am getting some errors about android:onClick=”addItem” here is what I get when I try to add a line of text to my recyclerview. I usually use my phone to test my apps. java.lang.IllegalStateException: Could not execute method of the activity at android.view.View$1.onClick(View.java:4012) at android.view.View.performClick(View.java:4761) […]

Android -RecyclerView in kitkat

since the RecyclerView src is in android.support.v7.widget.RecyclerView can i use the recyclerView in kit kat and jelly bean as long as i reference this package from the support library (or google play services)?

Shared element transition don't have the expected behaviour

I implemented the shared element transition between from an image in a RecyclerView to an image in a new Fragment. The RecyclerView is hosted in a fragment hosted by an Activity and the target fragment is hosted inside another Activity. When I click on my image, the transition is happening like expected and I get […]

GridLayoutManager – column width wrap its own largest child

I got a RecyclerView inside an HorizontalScrollView and I want it to use a GridLayoutManager. This is ok but one thing still bother me, the width of every columns are the same (based on the largest cell width I suppose?). Isn’t it possible to wrap width of columns to match the largest cell of this […]

update recyclerview contents fail in the bottom sheet

I want to change the list contents in a bottom sheet view though click event, but I only got empty sheet. Here is a demo modified from BottomSheetSample(github.com/niravkalola/BottomSheetSample). mainActivity.java package com.nkdroid.bottomsheetsample; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.BottomSheetDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.Button; import java.util.ArrayList; import java.util.List; […]

Recyclerview inside nested scroll view loading all datas instead of calling one by one image when scroll

In my application, I’m using tabHost Activiy.In the tabhost first tab,I’m using TabActivity,I’m loading more than 500 images. Using Nested SCroll view: I have used nested scroll view inside recyclerview.When loading the home page, it is loading all 500 images initially, then showing the home page.So that it cause memory out of error. Without using […]

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