control fling speed for recycler view

后端 未结 5 530
野的像风
野的像风 2021-02-07 18:02

I have a RecyclerView in which i have an image ,a few TextViews and 2 ImageButtons. I have 7-8 such rows to display in my Activity

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 18:38

    RecyclerView is great in that it is super modular. you can set your custom scroller to the LayoutMananger

    You can use https://github.com/apptik/MultiView/tree/master/scrollers

    Example:

    RecyclerView.SmoothScroller smoothScroller = new FlexiSmoothScroller(getContext())
                                .setMillisecondsPerInchSearchingTarget(100f));
    smoothScroller.setTargetPosition(targetPos);
    recyclerView.getLayoutManager().startSmoothScroll(smoothScroller);
    

    you can check more examples at: https://github.com/apptik/MultiView/blob/master/app/src/main/java/io/apptik/multiview/ScrollersFragment.java

提交回复
热议问题