oleksandrbalan / pagecurl

This library allows to create an effect of turning pages, which can be used in book reader applications, custom on-boarding screens or elsewhere.
Apache License 2.0
345 stars 32 forks source link

animation fluency #16

Closed choristery closed 1 year ago

choristery commented 1 year ago

Hi, when I use pagecurl, it seems that the animation freezes on some devices because of the complex content. Do you have any good suggestions for this?

oleksandrbalan commented 1 year ago

Hi 👋

On which API levels do you register freezing? There are two different shadow implementations for API levels before 28 and after 28.

Before API 28 there is no way do draw shadow with hardware acceleration. See: https://github.com/oleksandrbalan/pagecurl/blob/main/pagecurl/src/main/kotlin/eu/wewox/pagecurl/page/CurlDraw.kt#L216-L222

Thus it tries to draw a shadow to the image and then draw it on the canvas, which is far from being efficient 🙈

choristery commented 1 year ago

API levels is 33

oleksandrbalan commented 1 year ago

Uff, weird 😬

Could you please try to disable shadows by setting either alpha or radius to 0, to check if it is due to shadow or something else?