ethanhua / Skeleton

A library provides an easy way to show skeleton loading view like Facebook and Alipay
3.68k stars 457 forks source link

Skeleton recyclerview #18

Closed alahammad closed 5 years ago

alahammad commented 6 years ago

Hello,

Thanks for your library it's very handful, i have issue when implement it using the following code : Skeleton.bind(recyclerview) .adapter(adapter) .shimmer(true) .angle(20) .frozen(true) .duration(1200) .count(10) .load(R.layout.account_skeleton_row) .show()

the row in recyclerview doesn't full the screen width, can check this issue.

Thanks,

ajayqualwebs commented 6 years ago

Width depends on your layout width please check once, because I am using the same library and It's working properly.

alahammad commented 6 years ago

@ajayqualwebs in your sample code try to modify RecyclerViewActivity to this :

PersonAdapter adapter = new PersonAdapter(); final SkeletonScreen skeletonScreen = Skeleton.bind(recyclerView) .adapter(adapter) .load(R.layout.item_skeleton_person) .shimmer(true) .show();

then you will notice the issue

frankenten13 commented 6 years ago

Same issue, and add this View to ConstraintLayout to fix it

    <View
        android:layout_width="0dp"
        android:layout_height="1px"
        android:background="#dfdfdf"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintLeft_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
Nik2505 commented 5 years ago

I am facing same issue for RecyclerView

My RecyclerView is top parent root with CoordinatorLayout

skeletonScreenRecyclerview = Skeleton.bind(recyclerView)
                    .adapter(mAdapter)
                    .shimmer(true)
                    .angle(15)
                    .frozen(false)
                    .duration(800)
                    .count(10)
                    .color(R.color.extra_transparent)
                    .load(R.layout.row_skeleton_design_contact_office_view)
                    .show(); //default count is 10 

It is not working while skeleton but it is working when my adapter items set and in design preview, tools:listitem for skeleton showing me full screen width.

ethanhua commented 5 years ago

make sure the item skeleton layout width is match_parent