Search in sources :

Example 6 with DividerItemDecoration

use of me.zhanghai.android.douya.ui.DividerItemDecoration in project Douya by DreaminginCodeZH.

the class BaseItemDataAdapter method createPhotoListHolder.

protected PhotoListHolder createPhotoListHolder(ViewGroup parent) {
    PhotoListHolder holder = new PhotoListHolder(ViewUtils.inflate(R.layout.item_fragment_photo_list, parent));
    holder.photoList.setHasFixedSize(true);
    holder.photoList.setLayoutManager(new LinearLayoutManager(parent.getContext(), LinearLayoutManager.HORIZONTAL, false));
    holder.photoList.addItemDecoration(new DividerItemDecoration(DividerItemDecoration.HORIZONTAL, R.drawable.transparent_divider_vertical_4dp, holder.photoList.getContext()));
    holder.photoList.setAdapter(new HorizontalImageAdapter());
    return holder;
}
Also used : HorizontalImageAdapter(me.zhanghai.android.douya.ui.HorizontalImageAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DividerItemDecoration(me.zhanghai.android.douya.ui.DividerItemDecoration)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)6 DividerItemDecoration (me.zhanghai.android.douya.ui.DividerItemDecoration)6 HorizontalImageAdapter (me.zhanghai.android.douya.ui.HorizontalImageAdapter)2 OnHorizontalScrollListener (me.zhanghai.android.douya.ui.OnHorizontalScrollListener)2 HorizontalUploadImageAdapter (me.zhanghai.android.douya.ui.HorizontalUploadImageAdapter)1