thellmund / Android-Week-View

Display highly customizable calendar views in your Android app
Apache License 2.0
188 stars 98 forks source link

ANR after zooming week view #247

Closed HuuNguyen312 closed 3 years ago

HuuNguyen312 commented 3 years ago

Describe the bug ANR after zooming week view

To Reproduce Steps to reproduce the behavior:

  1. Create an event with a duration <10 minutes
  2. Zoom in/out
  3. ANR
MatijaSokol commented 3 years ago

I have same problem. When trying to zoom in/zoom out multiple times, ANR dialog opens. Also, like @HuuNguyen312, this bug happens when events in calendar are not very long (I reproduce this bug with tasks duration of 10 and 20 minutes).

From Logcat: Background concurrent copying GC freed 177266(7MB) AllocSpace objects, 0(0B) LOS objects, 41% free, 8MB/14MB, paused 567us total 102.436ms

This message is showing until application is forced closed.

Here is app screenshot when trying to zoom in/zoom out. calendar

thellmund commented 3 years ago

I can’t reproduce the issue on my device. What emulator or device are you using?

MatijaSokol commented 3 years ago

I reproduce bug with both Samsung Galaxy S7 Edge and Xiaomi Redmi 6. Also, my colleague reproduced bug with newer Samsung.

Can you try inserting >10 short tasks that are visible at the same time and zoom in/zoom out for some time?

HuuNguyen312 commented 3 years ago

I reproduce this bug with all devices of my company: Samsung S10+, Note 8, Note 20, Xiaomi, Oppo, Nokia, etc

thellmund commented 3 years ago

Can you give some more information such as the OS version and your WeekView configuration?

I’m still having trouble reproducing this on both a Pixel and on emulators.

MatijaSokol commented 3 years ago

Samsung Galaxy S7 Edge: Android 8 Xiaomi Redmi 6: Android 10

In my app, WeekView is inside Fragment (using NavComponents). My adapter is extending WeekViewSimpleAdapterJodaTime. Here is WeekView configuration from XML:

image

thellmund commented 3 years ago

Ok, able to reproduce it now. I pushed a fix in c6a460ca735f1b37cc8369fa532f900bb35fe8ab and will create a new release soon.

thellmund commented 3 years ago

Release is out. Closing this now, but let me know if anything else doesn’t work as expected.