-
Notifications
You must be signed in to change notification settings - Fork 66
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
RecyclerView dummy items #10
Comments
Yes, you can show placeholder items for upcoming RecyclerView items by using either SkeletonLayoutUtils.applySkeleton(recyclerView, layoutResId, itemCount) in Java or the extension recyclerView.applySkeleton(layoutResId, itemCount) in Kotlin which will both return a Skeleton. To toggle the placeholder items, simply call showSkeleton() or showOriginal() on the Skeleton. |
Hi @Faltenreich , I tried to apply it to the activity's recyclerview but it gives me this. I am using the latest version and currently in Kotlin. This is how I use the extension function.
What am I missing here? |
I do not fully understand the problem yet. Could you please share more information:
|
Should be set as a skeleton of this: As shown in the previous image, it only displays square skeletons.
I'm using the latest, v2.0.0 .
Adapter
|
SkeletonLayout masks every View (except ViewGroups) independently from its content. So the disappearing play icon is as intended as the whole ImageView gets masked. At this moment the library does not support excluding specific Views from the masking process (there is an open issue for that feature: #6). The square dimensions of the masked View may be caused by setting adjustViewBounds to true. The Drawable of your ImageView seems square, so the dimensions of the ImageView are adjusted to be square as well. Since SkeletonLayout masks only Views (and not ViewGroups), only the square ImageViews are being masked. Try adjusting the properties of the ImageView or adding another non-square View to the ViewGroup. |
Yes. It's what I really need to do. I tested it by setting a fixed size to the ImageView and it worked. Thanks! |
Is it possible to show skeleton with initial items above RecyclerView without the need to create dummy items?
The text was updated successfully, but these errors were encountered: