Closed rezazarchi closed 3 years ago
I can’t reproduce the crash on my emulator. Can you send a screen recording?
oh sorry. this issue not happens when system language is English. I changed system language to Persian (or Arabic) and all layouts directions got RTL then repeat the scenario and crash happened.
https://user-images.githubusercontent.com/8654398/121335000-71832c80-c92f-11eb-9020-51a9a7d6658c.mp4
Thanks for the screen recording! I'll fix the issues in RTL mode before the next release.
Hey @rezazarchi, I pushed a quick fix. I did a bit of testing and things seem fine now, but let me know if anything else is still not working as expected.
thanks but it seems that it hasn't fixed yet. I tested latest commits on master on Emulator with Android 11 and app crashed again on all pages.
--------- beginning of crash
2021-06-20 09:37:52.655 7317-7317/com.alamkanak.weekview E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.alamkanak.weekview, PID: 7317
java.lang.IllegalArgumentException: Cannot coerce value to an empty range: maximum -5636.6665 is less than minimum 2373.3333.
at kotlin.ranges.RangesKt___RangesKt.coerceIn(_Ranges.kt:1131)
at com.alamkanak.weekview.ViewState.scrollToFirstDayOfWeek(ViewState.kt:341)
at com.alamkanak.weekview.ViewState.updateViewState(ViewState.kt:541)
at com.alamkanak.weekview.ViewState.update(ViewState.kt:524)
at com.alamkanak.weekview.WeekView.updateViewState(WeekView.kt:134)
at com.alamkanak.weekview.WeekView.onDraw(WeekView.kt:120)
at android.view.View.draw(View.java:22350)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22353)
at com.android.internal.policy.DecorView.draw(DecorView.java:806)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4101)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3828)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3099)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:731)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
https://user-images.githubusercontent.com/8654398/122662798-1234e000-d1ab-11eb-8b3e-d06eb1c84787.mp4
Are you certain this is using the latest version on master? I tested it with the Force RTL mode
developer option and with an RTL language, and both are working fine.
I tested again on Android 11 both Force-RTL and Persian language have this problem. branch: master HEAD commit: 48b4d4b639243c0a22e2f0fb6b65b396c376ddcf
Describe the bug app crash when i want to go next 3 days or previous days (or weeks) in WithFragment
To Reproduce Steps to reproduce the behavior:
Additional context
Logcat