You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use view.createSkeleton().showSkeleton() but if I do that I got exception
Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:3936)
at android.view.ViewGroup.addView(ViewGroup.java:3786)
at android.view.ViewGroup.addView(ViewGroup.java:3727)
at android.view.ViewGroup.addView(ViewGroup.java:3700)
at com.faltenreich.skeletonlayout.SkeletonLayout.<init>(SkeletonLayout.kt:84)
at com.faltenreich.skeletonlayout.SkeletonLayout.<init>(SkeletonLayout.kt:33)
at com.faltenreich.skeletonlayout.SkeletonLayoutUtils.createSkeleton(SkeletonExtensions.kt:31)
at com.faltenreich.skeletonlayout.SkeletonLayoutUtils.createSkeleton$default(SkeletonExtensions.kt:30)
at pl.senordeveloper.skeletonview.MainActivity.onCreate(MainActivity.kt:14)
My layout is a textView inside ContraintLayout/FrameLayout and I am creating a skeleton in onCreate method (but this also fails if I do postDelayed or in onResume).
I can create a skeleton successfully if I wrap mentioned textview inside xml with SkeletonLayout so I guess I can expect createSkeleton to work in similar fashion (create a wrapper around existing view).
The question is: am I misusing this utility function?
The text was updated successfully, but these errors were encountered:
There is indeed a problem when injecting a SkeletonLayout programmatically into a layout. As you have correctly assumed, the Skeleton serves as a wrapper around the original Views. So in the case of an injected View, we have to replace the original (to be masked) View with a SkeletonLayout which then contains the original View with all of its children.
I am currently working on a bugfix and expect a solution in version 2.0.1 later this day. Thanks again and have a nice day!
I want to use view.createSkeleton().showSkeleton() but if I do that I got exception
My layout is a textView inside ContraintLayout/FrameLayout and I am creating a skeleton in onCreate method (but this also fails if I do postDelayed or in onResume).
I can create a skeleton successfully if I wrap mentioned textview inside xml with SkeletonLayout so I guess I can expect createSkeleton to work in similar fashion (create a wrapper around existing view).
The question is: am I misusing this utility function?
The text was updated successfully, but these errors were encountered: