lmw
2023-03-11 4df5bb59e5fe9f9d140e5610f7772dd8a05a28d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.beloo.widget.chipslayoutmanager;
 
import android.content.Context;
 
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
 
import com.beloo.widget.chipslayoutmanager.anchor.AnchorViewState;
 
public interface IScrollingController {
 
    RecyclerView.SmoothScroller createSmoothScroller(@NonNull Context context, int position, int timeMs, AnchorViewState anchor);
 
    boolean canScrollVertically();
 
    boolean canScrollHorizontally();
 
    /**
     * calculate offset of views while scrolling, layout items on new places
     */
    int scrollVerticallyBy(int d, RecyclerView.Recycler recycler, RecyclerView.State state);
 
    int scrollHorizontallyBy(int d, RecyclerView.Recycler recycler, RecyclerView.State state);
 
    /** changes may cause gaps on the UI, try to fix them */
    boolean normalizeGaps(RecyclerView.Recycler recycler, RecyclerView.State state);
 
    /** @see ChipsLayoutManager#computeVerticalScrollOffset(RecyclerView.State) */
    int computeVerticalScrollOffset(RecyclerView.State state);
 
    /** @see ChipsLayoutManager#computeVerticalScrollExtent(RecyclerView.State) */
    int computeVerticalScrollExtent(RecyclerView.State state);
 
    /** @see ChipsLayoutManager#computeVerticalScrollRange(RecyclerView.State) */
    int computeVerticalScrollRange(RecyclerView.State state);
 
    /** @see ChipsLayoutManager#computeHorizontalScrollOffset(RecyclerView.State) */
    int computeHorizontalScrollOffset(RecyclerView.State state);
 
    /** @see ChipsLayoutManager#computeHorizontalScrollExtent(RecyclerView.State) */
    int computeHorizontalScrollExtent(RecyclerView.State state);
 
    /** @see ChipsLayoutManager#computeHorizontalScrollRange(RecyclerView.State) */
    int computeHorizontalScrollRange(RecyclerView.State state);
}