Niharika Arora
1 min readJul 13, 2021

--

Hey, Thank you for the explanation. Actually, we both are somewhere talking about the same thing. How I understood is it is about fixing something, not just match parent but even if we give a particular height/width , then also it applies :-)

Let me tell how Android has described this :

"RecyclerView can perform several optimizations if it can know in advance that RecyclerView's size is not affected by the adapter contents. RecyclerView can still change its size based on other factors (e.g. its parent's size) but this size calculation cannot depend on the size of its children or the contents of its adapter (except the number of items in the adapter).

If your use of RecyclerView falls into this category, set this to true. It will allow RecyclerView to avoid invalidating the whole layout when its adapter contents change."

So the only thing which is related to this flag is if we already can somehow achieve, means adapter changes cannot affect the size of the RecyclerView, then only this property will work.

I hope this may help. Also, I really liked the way you explained and grabbed the depth of this flag. Not many people know it :-)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Niharika Arora
Niharika Arora

Written by Niharika Arora

Googler since 2021 | Ex- Google Developer Expert, Android | Visit : https://thedroidlady.com/ to know more.

No responses yet

Write a response