lmw
2025-04-24 718f31c92e2029d05260810435a2c70cef6e6ce5
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
package com.ypx.imagepicker.views;
 
import android.graphics.Color;
 
import com.ypx.imagepicker.ImagePicker;
import com.ypx.imagepicker.R;
 
/**
 * Time: 2019/11/13 15:54
 * Author:ypx
 * Description:选择器ui样式配置类
 */
public class PickerUiConfig {
 
    /**
     * 文件夹列表从上往下弹入
     */
    public static final int DIRECTION_TOP = 1;
 
    /**
     * 文件夹列表从底部往上弹入
     */
    public static final int DIRECTION_BOTTOM = 2;
 
    //全局相关属性
    private int pickerBackgroundColor = Color.BLACK;
    private int previewBackgroundColor = Color.BLACK;
    private int singleCropBackgroundColor = Color.BLACK;
    private int folderListOpenDirection = DIRECTION_TOP;
    private int folderListOpenMaxMargin = 0;
    private boolean isShowStatusBar;
    private int statusBarColor;
    private int videoPauseIconID;
 
    //小红书剪裁相关属性
    private int cropViewBackgroundColor = Color.BLACK;
    private int fullIconID;
    private int fitIconID;
    private int gapIconID;
    private int FillIconID;
 
    //选择器ui提供类
    private PickerUiProvider pickerUiProvider;
 
    /**
     * 主题色
     */
    private int themeColor;
 
    public PickerUiProvider getPickerUiProvider() {
        if (pickerUiProvider == null) {
            return new PickerUiProvider();
        }
        return pickerUiProvider;
    }
 
    public void setPickerUiProvider(PickerUiProvider pickerUiProvider) {
        this.pickerUiProvider = pickerUiProvider;
    }
 
    public int getPickerBackgroundColor() {
        if (pickerBackgroundColor == 0) {
            return Color.WHITE;
        }
        return pickerBackgroundColor;
    }
 
    public int getSingleCropBackgroundColor() {
        return singleCropBackgroundColor;
    }
 
    public void setSingleCropBackgroundColor(int singleCropBackgroundColor) {
        this.singleCropBackgroundColor = singleCropBackgroundColor;
    }
 
    public void setPickerBackgroundColor(int pickerBackgroundColor) {
        this.pickerBackgroundColor = pickerBackgroundColor;
    }
 
    public int getPreviewBackgroundColor() {
        return previewBackgroundColor;
    }
 
    public void setPreviewBackgroundColor(int previewBackgroundColor) {
        this.previewBackgroundColor = previewBackgroundColor;
    }
 
    public int getFolderListOpenDirection() {
        return folderListOpenDirection;
    }
 
    public void setFolderListOpenDirection(int folderListOpenDirection) {
        this.folderListOpenDirection = folderListOpenDirection;
    }
 
    public boolean isShowFromBottom() {
        return folderListOpenDirection == DIRECTION_BOTTOM;
    }
 
    public boolean isShowStatusBar() {
        return isShowStatusBar;
    }
 
    public void setShowStatusBar(boolean showStatusBar) {
        isShowStatusBar = showStatusBar;
    }
 
    public int getStatusBarColor() {
        return statusBarColor;
    }
 
    public void setStatusBarColor(int statusBarColor) {
        this.statusBarColor = statusBarColor;
    }
 
    public int getFolderListOpenMaxMargin() {
        return folderListOpenMaxMargin;
    }
 
    public void setFolderListOpenMaxMargin(int folderListOpenMaxHeight) {
        this.folderListOpenMaxMargin = folderListOpenMaxHeight;
    }
 
    public int getCropViewBackgroundColor() {
        if (cropViewBackgroundColor == 0) {
            return Color.BLACK;
        }
        return cropViewBackgroundColor;
    }
 
    public void setCropViewBackgroundColor(int cropViewBackgroundColor) {
        this.cropViewBackgroundColor = cropViewBackgroundColor;
    }
 
    public int getFullIconID() {
        if (fullIconID == 0) {
            fullIconID = R.mipmap.picker_icon_full;
        }
        return fullIconID;
    }
 
    public void setFullIconID(int fullIconID) {
        this.fullIconID = fullIconID;
    }
 
    public int getFitIconID() {
        if (fitIconID == 0) {
            fitIconID = R.mipmap.picker_icon_fit;
        }
        return fitIconID;
    }
 
    public void setFitIconID(int fitIconID) {
        this.fitIconID = fitIconID;
    }
 
    public int getGapIconID() {
        if (gapIconID == 0) {
            gapIconID = R.mipmap.picker_icon_haswhite;
        }
        return gapIconID;
    }
 
    public void setGapIconID(int gapIconID) {
        this.gapIconID = gapIconID;
    }
 
    public int getFillIconID() {
        if (FillIconID == 0) {
            FillIconID = R.mipmap.picker_icon_fill;
        }
        return FillIconID;
    }
 
    public void setFillIconID(int fillIconID) {
        FillIconID = fillIconID;
    }
 
    public int getVideoPauseIconID() {
        if (videoPauseIconID == 0) {
            videoPauseIconID = R.mipmap.picker_icon_video;
        }
        return videoPauseIconID;
    }
 
    public void setVideoPauseIconID(int videoPauseIconID) {
        this.videoPauseIconID = videoPauseIconID;
    }
 
    public int getThemeColor() {
        return themeColor;
    }
 
    public void setThemeColor(int themeColor) {
        this.themeColor = themeColor;
        ImagePicker.setThemeColor(themeColor);
    }
}