roubachof / Sharpnado.Shadows

Add as many custom shadows (Color, Offset, Blur, Neumorphism) as you like to any Xamarin.Forms view (Android, iOS, UWP).
MIT License
329 stars 24 forks source link

Very bad performance on Android #28

Closed Tarekka closed 3 years ago

Tarekka commented 3 years ago

Platform (please complete the following information):

Describe the bug Really bad performance when using shadows. I used one same immutable shadow defined in App.xaml resources, for 5 frames in a page, the UI freezes for ~4 seconds to load the page. iOS works perfectly. Even with only one shadow object, it hangs a little to load the page.

To Reproduce Steps to reproduce the behavior:

  1. Create a view
  2. Create an immutable shade like in the readme.
  3. Apply the shade to some views
roubachof commented 3 years ago

Well you should be doing something wrong. Maybe have a look to the sample which scroll smoothly with more than 20 different shadows displayed. Of course can't do anything without a repro. Also did you use the latest version ?

Huaba93 commented 3 years ago

Same problem here. I am using just one shadow and the entire page takes 1-2 MINUTES to render.

I will provide more infos soon

roubachof commented 3 years ago

Also, did you read : https://github.com/roubachof/Sharpnado.Shadows/blob/master/README.md#animating-shadows ?

Huaba93 commented 3 years ago

@roubachof I think I was a little too hasty. atm I don't think shadows are causing my problems. It's more a forms 5 + AndroidX issue. i am still investigating

roubachof commented 3 years ago

yup always start by removing shadows and see if the issue is still there x)

Huaba93 commented 3 years ago

@roubachof for me there is no problem with shadows ;)

Tarekka commented 3 years ago

@roubachof , thanks for your response. I actually tried it in another one of my apps and it works perfectly. But in this app it takes time for some reason.

Any suggestions? I'm using the latest version by the way, and I'm not animating anything. Here's my example code:

App.xaml: `