CircleRecyclerView
介绍:
一个可以显示圆弧,缩放效果且可以无限循环的RecyclerView。
运行效果:
使用说明:
mCircleRecyclerView = (CircleRecyclerView) view.findViewById(R.id.circle_rv);
mCircleRecyclerView.setLayoutManager(mLayoutManager);
mCircleRecyclerView.setViewMode(mItemViewMode); // T implements ItemViewMode, after setLayoutManager(manager)
mCircleRecyclerView.setNeedCenterForce(true); // when SCROLL_STATE_IDLE == state, nearly center itemview scroll to center
mCircleRecyclerView.setNeedLoop(true); // default is true
// if setCenterForce(true), can set this callback
mCircleRecyclerView.setOnCenterItemClickListener(new CircleRecyclerView.OnCenterItemClickListener() {
@Override
public void onCenterItemClick(View v) {
Toast.makeText(getContext(), "Center Clicked", Toast.LENGTH_SHORT).show();
}
});
如果loop为 true, RecyclerView.Adapter需要这样做:
@Override
public void onBindViewHolder(VH holder, int position) {
positionData = mDataList.get(position % mDataList.size());
}
@Override
public int getItemCount() {
return Integer.MAX_VALUE;
}
已下载
0