Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues supporting CardView #26

Open
Aaub opened this issue Oct 19, 2020 · 1 comment
Open

Issues supporting CardView #26

Aaub opened this issue Oct 19, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Aaub
Copy link

Aaub commented Oct 19, 2020

Hello,

I create an issues because I noticed 2 things using the lib with CardView. First is my app crash as soon as I try to apply createSkeleton()onto a CardView. CardView actually extend ViewGroup so it means that it would be possible to apply such a method. I tried to put breakpoints everywhere but I was not able to find exactly what is happening. Here is the stackTrace :

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.jobteaser.jobteaser, PID: 30464
    java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to androidx.constraintlayout.widget.ConstraintLayout$LayoutParams
        at androidx.constraintlayout.widget.ConstraintLayout.getTargetWidget(ConstraintLayout.java:1144)
        at androidx.constraintlayout.widget.ConstraintLayout.setChildrenConstraints(ConstraintLayout.java:1028)
        at androidx.constraintlayout.widget.ConstraintLayout.updateHierarchy(ConstraintLayout.java:803)
        at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1561)
        at android.view.View.measure(View.java:24604)
        at androidx.core.widget.NestedScrollView.measureChildWithMargins(NestedScrollView.java:1562)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at androidx.core.widget.NestedScrollView.onMeasure(NestedScrollView.java:584)
        at android.view.View.measure(View.java:24604)
        at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onMeasure(SwipeRefreshLayout.java:641)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6885)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:24604)
        at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1414)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.widget.ScrollView.onMeasure(ScrollView.java:452)
        at android.view.View.measure(View.java:24604)
        at androidx.constraintlayout.widget.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
        at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6885)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6885)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6885)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6885)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6885)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:767)
        at android.view.View.measure(View.java:24604)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3089)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1911)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2203)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1799)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7772)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058)
        at android.view.Choreographer.doCallbacks(Choreographer.java:865)
        at android.view.Choreographer.doFrame(Choreographer.java:800)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:224)
        at android.app.ActivityThread.main(ActivityThread.java:7520)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

The other thing I noticed is when I applySkeleton()onto a RecycleView with items based on a CardView, all the CardView style does not appear when the shimmer is playing. I loose the elevation and the cornerRadius which lead to flat my items.

I have not seen any issue going in that direction.

Thank you in advance for your help

Alex

@iam-mrinmoy
Copy link

iam-mrinmoy commented Nov 16, 2020

it doesn't crash on my code but what i find out that this library doesn't support cardview .
this might help you #13

@Faltenreich Faltenreich added the bug Something isn't working label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants