Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] kotlin – Some elements are not seen in the nested recyclerview after doing smooth scroll to position 0

Posted on November 11, 2022 By

Solution 1 :

From official docs:

Recycled view pools allow multiple RecyclerViews to share a common pool of scrap views. This can be useful if you have multiple RecyclerViews with adapters that use the same view types, for example if you have several data sets with the same kinds of item views displayed by a ViewPager.

By default, 5 ViewHolders are retained in the pool for a particular viewType. If you want to change that count, it may be done this way:

recyclerView.getRecycledViewPool()
            .setMaxRecycledViews(SOME_VIEW_TYPE, POOL_CAPACITY);

Solution 2 :

I just removed

layout.recycleChildrenOnDetach = true

and work perfectly

Problem :

I have a recyclerview inside another recycler view, but when I apply the method to the parent to go to a certain child, some recyclerview of those children are not seen, but the rest of the child is seen. The internal recyclerview is as follows.

                val layout = GridLayoutManager(itemView.context, 2)
                layout.recycleChildrenOnDetach = true
                layoutManager = layout

                val mAdapter = Adapter(onChildItemClick)

                adapter = mAdapter
                mAdapter.oldList = datesModelObject.list

                isNestedScrollingEnabled = false
                setHasFixedSize(true)

                
             setRecycledViewPool(RecyclerView.RecycledViewPool())
READ  [FIXED] agora.io - Agora Video Call[Android] one to one private video call is not establishing group call is establishing
Powered by Inline Related Posts
Android Tags:android-recyclerview, kotlin, scrollto

Post navigation

Previous Post: [FIXED] android – Overlapping items in RelativeLayout with ImageView and TextView
Next Post: [FIXED] android – Unable to instantiate application com.company.app.MainApplication: java.lang.ClassNotFoundException React Native Expo

Related Posts

[FIXED] Best way to release and reinitialize exoplayer in RecyclerView Android
[FIXED] android – Twilio – How to get VideoTracks of the users that are already in a chat room? Android
[FIXED] android – Wanted to fetch api after getting true value from observable emitter in RxJava Android
[FIXED] android – BroadcastReceiver not firing from NotificationManager Android
[FIXED] java – How to store ArrayList into sharedPreferences in Android Android
[FIXED] android – How to replace fragment outside of bottom sheet by clicking button inside of bottom sheet? Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Which is stronger 19 gauge or 23 gauge?
  • Does BMW still use GM transmissions?
  • Is primary or secondary market research better?
  • What does it mean when ADT says low battery?
  • Can a baby sleep on a regular mattress?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme