Giter Site home page Giter Site logo

Comments (7)

kizitonwose avatar kizitonwose commented on May 5, 2024 1

This issue is fixed in the fix-crash branch but has not been released yet.
You can get the fix using: implementation 'com.github.kizitonwose:CalendarView:7da609173c' until version 0.2.5 is released.

from calendar.

kizitonwose avatar kizitonwose commented on May 5, 2024

It seems you are using an older version of the library as this issue has already been fixed. See #29.

Can you confirm that you are on the latest version of the library? Otherwise, update to the latest version and see if the issue persists.

from calendar.

federicomiralles avatar federicomiralles commented on May 5, 2024

@kizitonwose I'm using the latest version:
implementation 'com.github.kizitonwose:CalendarView:0.2.4'
Cheers,

Federico

from calendar.

federicomiralles avatar federicomiralles commented on May 5, 2024

Looks like the problem isn't related to the Don't keep activities configuration, but when it's used inside a viewpager within a fragment.
My current layout hierarchy is like follows:
activity layout -> viewpager -> fragment layout -> calendar view
Swiping back and forth between the pages (in my case the calendar in the third page) several times triggers the exception...

from calendar.

federicomiralles avatar federicomiralles commented on May 5, 2024

As workaround I ended up setting a fixed height for the calendarView (instead using wrap_content) to overcome the TypeCastException.
Not the best solution but at least it doesn't crash...

from calendar.

kizitonwose avatar kizitonwose commented on May 5, 2024

Version 0.2.5 is released. You can now revert to implementation 'com.github.kizitonwose:CalendarView:0.2.5'

from calendar.

raymondbarrinuevo avatar raymondbarrinuevo commented on May 5, 2024

hi @kizitonwose

I am still having this issue. I am using this version implementation 'com.github.kizitonwose:CalendarView:0.3.2'

Fatal Exception: kotlin.TypeCastException: null cannot be cast to non-null type com.kizitonwose.calendarview.ui.DayBinder<com.kizitonwose.calendarview.ui.ViewContainer>
at com.kizitonwose.calendarview.ui.CalendarAdapter.onCreateViewHolder(CalendarAdapter.kt:134)
at com.kizitonwose.calendarview.ui.CalendarAdapter.onCreateViewHolder(CalendarAdapter.kt:29)
at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:7078)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6235)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at androidx.drawerlayout.widget.DrawerLayout.onLayout(DrawerLayout.java:1231)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:1067)
at android.view.View.layout(View.java:22415)
at android.view.ViewGroup.layout(ViewGroup.java:6594)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3427)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2894)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1942)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8595)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:988)
at android.view.Choreographer.doCallbacks(Choreographer.java:765)
at android.view.Choreographer.doFrame(Choreographer.java:700)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

from calendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.