@@ -87,10 +87,10 @@ public class ColorPickerView extends FrameLayout implements LifecycleObserver {
87
87
private ActionMode actionMode = ActionMode .ALWAYS ;
88
88
89
89
@ FloatRange (from = 0.0 , to = 1.0 )
90
- private float alpha_selector = 1.0f ;
90
+ private float selector_alpha = 1.0f ;
91
91
92
92
@ FloatRange (from = 0.0 , to = 1.0 )
93
- private float alpha_flag = 1.0f ;
93
+ private float flag_alpha = 1.0f ;
94
94
95
95
@ Px private int selectorSize = 0 ;
96
96
@@ -135,16 +135,16 @@ private void getAttrs(AttributeSet attrs) {
135
135
this .selectorDrawable = AppCompatResources .getDrawable (getContext (), resourceId );
136
136
}
137
137
}
138
- if (a .hasValue (R .styleable .ColorPickerView_alpha_selector )) {
139
- this .alpha_selector =
140
- a .getFloat (R .styleable .ColorPickerView_alpha_selector , alpha_selector );
138
+ if (a .hasValue (R .styleable .ColorPickerView_selector_alpha )) {
139
+ this .selector_alpha =
140
+ a .getFloat (R .styleable .ColorPickerView_selector_alpha , selector_alpha );
141
141
}
142
142
if (a .hasValue (R .styleable .ColorPickerView_selector_size )) {
143
143
this .selectorSize =
144
144
a .getDimensionPixelSize (R .styleable .ColorPickerView_selector_size , selectorSize );
145
145
}
146
- if (a .hasValue (R .styleable .ColorPickerView_alpha_flag )) {
147
- this .alpha_flag = a .getFloat (R .styleable .ColorPickerView_alpha_flag , alpha_flag );
146
+ if (a .hasValue (R .styleable .ColorPickerView_flag_alpha )) {
147
+ this .flag_alpha = a .getFloat (R .styleable .ColorPickerView_flag_alpha , flag_alpha );
148
148
}
149
149
if (a .hasValue (R .styleable .ColorPickerView_actionMode )) {
150
150
int actionMode = a .getInteger (R .styleable .ColorPickerView_actionMode , 0 );
@@ -193,7 +193,7 @@ private void onCreate() {
193
193
}
194
194
selectorParam .gravity = Gravity .CENTER ;
195
195
addView (selector , selectorParam );
196
- selector .setAlpha (alpha_selector );
196
+ selector .setAlpha (selector_alpha );
197
197
198
198
getViewTreeObserver ()
199
199
.addOnGlobalLayoutListener (
@@ -260,8 +260,8 @@ protected void onCreateByBuilder(Builder builder) {
260
260
261
261
this .paletteDrawable = builder .paletteDrawable ;
262
262
this .selectorDrawable = builder .selectorDrawable ;
263
- this .alpha_selector = builder .alpha_selector ;
264
- this .alpha_flag = builder .alpha_flag ;
263
+ this .selector_alpha = builder .alpha_selector ;
264
+ this .flag_alpha = builder .alpha_flag ;
265
265
this .selectorSize = builder .selectorSize ;
266
266
this .debounceDuration = builder .debounceDuration ;
267
267
onCreate ();
@@ -429,10 +429,10 @@ public void fireColorListener(@ColorInt int color, final boolean fromUser) {
429
429
if (VISIBLE_FLAG ) {
430
430
VISIBLE_FLAG = false ;
431
431
if (this .selector != null ) {
432
- this .selector .setAlpha (alpha_selector );
432
+ this .selector .setAlpha (selector_alpha );
433
433
}
434
434
if (this .flagView != null ) {
435
- this .flagView .setAlpha (alpha_flag );
435
+ this .flagView .setAlpha (flag_alpha );
436
436
}
437
437
}
438
438
}
@@ -548,7 +548,7 @@ public void setFlagView(@NonNull FlagView flagView) {
548
548
flagView .gone ();
549
549
addView (flagView );
550
550
this .flagView = flagView ;
551
- flagView .setAlpha (alpha_flag );
551
+ flagView .setAlpha (flag_alpha );
552
552
}
553
553
554
554
/**
@@ -775,11 +775,11 @@ public void setPaletteDrawable(Drawable drawable) {
775
775
if (!VISIBLE_FLAG ) {
776
776
VISIBLE_FLAG = true ;
777
777
if (selector != null ) {
778
- alpha_selector = selector .getAlpha ();
778
+ selector_alpha = selector .getAlpha ();
779
779
selector .setAlpha (0.0f );
780
780
}
781
781
if (flagView != null ) {
782
- alpha_flag = flagView .getAlpha ();
782
+ flag_alpha = flagView .getAlpha ();
783
783
flagView .setAlpha (0.0f );
784
784
}
785
785
}
0 commit comments