I've read the Android developer info and a number of SO posts and RecyclerView articles. I'm still unclear as to whether I can use the:
recyclerView.setHasFixedSize(true);
method on my RecyclerView list. The size of my RecyclerView list will constantly change as CardView items are dynamically added and deleted over time. However, the size (height and length) of each CardViews is fixed. Please advise.
Yes, you can use
recyclerView.setHasFixedSize(true);
as long as height and width of recyclerview remains the same.
From Android Developer:
public void setHasFixedSize (boolean hasFixedSize)
RecyclerView can perform several optimizations if it can know in advance that changes in adapter content cannot change the size of the RecyclerView itself. If your use of RecyclerView falls into this category, set this to true. Parameters hasFixedSize true if adapter changes cannot affect the size of the RecyclerView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With