I am using Horizontal recyclerview inside NestedScrollView. when i want to scroll faster inside horizontal scroll view it fling go to above of the view. and recyclerview not much smooth.
- Note: when I load gif image then it happen but when jpg image load never go to above of the view. but not smooth any time as expected.
All recyclerview data bind
RecyclerViewDataAdapter adapter = new RecyclerViewDataAdapter(getActivity(), allSampleData);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(mLayoutManager);
mLayoutManager.setAutoMeasureEnabled(true);
recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();
recyclerView.setHasFixedSize(true);
recyclerView.setNestedScrollingEnabled(false);
Section data initialize
SectionListDataAdapter itemListDataAdapter = new SectionListDataAdapter(mContext, singleSectionItems, sectionName,itemRowHolder.previewImage);
itemRowHolder.recycler_view_list.setHasFixedSize(true);
itemRowHolder.recycler_view_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
itemRowHolder.recycler_view_list.setAdapter(new AlphaInAnimationAdapter(itemListDataAdapter));
itemRowHolder.recycler_view_list.setNestedScrollingEnabled(false);
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="0dp" />
Image load
Glide.with(MyApplication.applicationContext) // replace with 'this' if it's in activity
.load(previewUrl.replaceAll(" ", "%20"))
.listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
holder.progressBar.setVisibility(View.GONE);
return false;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, com.bumptech.glide.load.DataSource dataSource, boolean isFirstResource) {
holder.progressBar.setVisibility(View.GONE);
return false;
}
})
.into(holder.itemImage);