christophesmet / android_maskable_layout

A library that easily allows you to mask layouts/viewgroups
Apache License 2.0
652 stars 145 forks source link

Low Performance when using MaskableLayout in RecyclerView item layout #14

Closed ptsiogas closed 7 years ago

ptsiogas commented 7 years ago

I am facing low performance and out of memory issues when i use MaskableLayout in RecyclerView item layout. Let's assume that there are 2 types of items (A & B). In my adapter i change the applied mask (setMask) according to the items type (A=A mask, B=B mask).

Is there a better way to handle that, because as far as i understand the masks keep invalidating causing me performance issues.

christophesmet commented 7 years ago

It should only invalidate once. Try setting setDrawingCacheEnabled(true); to false Or attach a cpu profile trace ? Thanks

christophesmet commented 7 years ago

I'm assuming the profiler showed that the maskable layout didn't invalidate more than it required. Closing.