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
46
47
48
49
package com.beloo.widget.chipslayoutmanager.cache;
 
import android.graphics.Rect;
import android.os.Parcelable;
import android.util.Pair;
import android.view.View;
 
import androidx.annotation.Nullable;
 
import java.util.List;
 
public interface IViewCacheStorage {
 
    boolean isPositionEndsRow(int position);
 
    boolean isPositionStartsRow(int position);
 
    void setCachingEnabled(boolean isEnabled);
 
    boolean isCachingEnabled();
 
    int getStartOfRow(int endRow);
 
    void storeRow(List<Pair<Rect, View>> row);
 
    boolean isInCache(int position);
 
    /** purge whole cache*/
    void purge();
 
    /** all cache to selected position will be purged
     * @param position the end position, exclusive */
    void purgeCacheToPosition(int position);
 
    @Nullable
    /** @return null if cache empty*/
    Integer getLastCachePosition();
 
    boolean isCacheEmpty();
 
    /** all cache from selected position will be purged
     * @param position the start position, inclusive */
    void purgeCacheFromPosition(int position);
 
    /** onSaveInstanceState cache storage content to {@link Parcelable}*/
    Parcelable onSaveInstanceState();
 
    void onRestoreInstanceState(@Nullable Parcelable parcelable);
}