EudyContreras / Skeleton-Bones

Library for dynamically generating skeleton loader drawables for Layouts and Views
MIT License
151 stars 15 forks source link

Creating SkeletonDrawable from code is not working properly #25

Closed whyurunnin closed 3 years ago

whyurunnin commented 3 years ago

I'm trying to use your lib without databindings with just SkeletonDrawable class. It works, but for some reason it creates skeleton without animation, just bones. And also it doesn't ingnore views which I pass through withIgnoredBones(). So I have a question: what am I doing wrong? Here is my code, it runs in onViewCreated() of my fragment.

SkeletonDrawable.create(contentCl, true)
            .builder()
            .setAnimateRestoreBounds(true)
            .setAllowSavedState(true)
            .withIgnoredBones(R.id.cancelIv)
            .withShimmerBuilder {
                setInterpolator(AccelerateInterpolator())
                setSpeedMultiplier(1F)
                setSharedInterpolator(true)
                setThickness(120.dp)
                setThickness(10.dp)
                setTilt(-0.2f)
            }
EudyContreras commented 3 years ago

@whyurunnin Hey I would suggest checking out the latest demos, they do not use data-binding, if the examples are not enough we can look further into it. Have you tried starting/enabling, setting the amount of shimmer rays you want to animate etc ?