34
34
import com .pranavpandey .android .dynamic .support .dialog .DynamicDialog ;
35
35
import com .pranavpandey .android .dynamic .support .listener .DynamicColorListener ;
36
36
import com .pranavpandey .android .dynamic .support .picker .color .DynamicColorShape ;
37
- import com .pranavpandey .android .dynamic .support .picker .color .view .DynamicColorView ;
38
37
import com .pranavpandey .android .dynamic .support .picker .color .dialog .DynamicColorDialog ;
39
- import com .pranavpandey .android .dynamic .support .popup .DynamicPopup ;
38
+ import com .pranavpandey .android .dynamic .support .picker .color .view .DynamicColorView ;
39
+ import com .pranavpandey .android .dynamic .support .popup .DynamicSimplePopup ;
40
40
import com .pranavpandey .android .dynamic .support .setting .base .DynamicColorPreference ;
41
41
import com .pranavpandey .android .dynamic .support .theme .DynamicTheme ;
42
42
import com .pranavpandey .android .dynamic .support .theme .task .WallpaperColorsTask ;
43
43
import com .pranavpandey .android .dynamic .support .util .DynamicPickerUtils ;
44
- import com .pranavpandey .android .dynamic .support .view .DynamicHeader ;
45
44
import com .pranavpandey .android .dynamic .theme .DynamicPalette ;
46
45
import com .pranavpandey .android .dynamic .theme .Theme ;
47
46
import com .pranavpandey .android .dynamic .util .DynamicColorUtils ;
52
51
import java .util .Map ;
53
52
54
53
/**
55
- * A {@link PopupWindow} to display a grid of colors.
56
- * <p>It will be used internally by the
57
- * {@link DynamicColorPreference}
58
- * but can be used by the other views also.
54
+ * A {@link DynamicSimplePopup} to display a grid of colors.
55
+ * <p>It will be used internally by the {@link DynamicColorPreference} but can be used by
56
+ * the other views also.
59
57
*/
60
- public class DynamicColorPopup extends DynamicPopup {
61
-
62
- /**
63
- * Title used by this popup.
64
- */
65
- private CharSequence mTitle ;
58
+ public class DynamicColorPopup extends DynamicSimplePopup {
66
59
67
60
/**
68
61
* Color entries used by this popup.
@@ -121,11 +114,6 @@ public class DynamicColorPopup extends DynamicPopup {
121
114
*/
122
115
private WallpaperColorsTask mWallpaperColorsTask ;
123
116
124
- /**
125
- * Header view for this popup.
126
- */
127
- private View mHeaderView ;
128
-
129
117
/**
130
118
* Content view for this popup.
131
119
*/
@@ -145,7 +133,8 @@ public class DynamicColorPopup extends DynamicPopup {
145
133
*/
146
134
public DynamicColorPopup (@ NonNull View anchor , @ NonNull Integer [] entries ,
147
135
@ NonNull DynamicColorListener dynamicColorListener ) {
148
- this .mAnchor = anchor ;
136
+ super (anchor );
137
+
149
138
this .mEntries = entries ;
150
139
this .mDynamicColorListener = dynamicColorListener ;
151
140
this .mDefaultColor = Theme .Color .UNKNOWN ;
@@ -164,14 +153,6 @@ public DynamicColorPopup(@NonNull View anchor, @NonNull Integer[] entries,
164
153
165
154
this .mRecentColor = DynamicPickerUtils .getRecentColor ();
166
155
167
- if (getTitle () != null ) {
168
- mHeaderView = new DynamicHeader (getAnchor ().getContext ());
169
- ((DynamicHeader ) mHeaderView ).setColorType (Theme .ColorType .PRIMARY );
170
- ((DynamicHeader ) mHeaderView ).setContrastWithColorType (Theme .ColorType .SURFACE );
171
- ((DynamicHeader ) mHeaderView ).setTitle (mTitle );
172
- ((DynamicHeader ) mHeaderView ).setFillSpace (true );
173
- }
174
-
175
156
final GridView gridView = mView .findViewById (R .id .ads_color_picker_presets );
176
157
final ProgressBar progressBar = mView .findViewById (R .id .ads_color_picker_progress_bar );
177
158
final View divider = mView .findViewById (R .id .ads_color_picker_divider );
@@ -387,11 +368,6 @@ public void onClick(View view) {
387
368
});
388
369
}
389
370
390
- @ Override
391
- protected @ Nullable View getHeaderView () {
392
- return mHeaderView ;
393
- }
394
-
395
371
@ Override
396
372
protected @ Nullable View getView () {
397
373
return mView ;
@@ -402,24 +378,6 @@ public void onClick(View view) {
402
378
return mFooterView ;
403
379
}
404
380
405
- /**
406
- * Get the title used by this popup.
407
- *
408
- * @return The title used by this popup.
409
- */
410
- public @ Nullable CharSequence getTitle () {
411
- return mTitle ;
412
- }
413
-
414
- /**
415
- * Set the title used by this popup.
416
- *
417
- * @param title The title to be set.
418
- */
419
- public void setTitle (@ Nullable CharSequence title ) {
420
- this .mTitle = title ;
421
- }
422
-
423
381
/**
424
382
* Get the color entries used by this popup.
425
383
*
0 commit comments