File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
java/com/dingmouren/smaple/paletteimageview Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 14
14
```
15
15
16
16
##### 1.参数的控制
17
- ![ image ] ( https://github.com/DingMouRen/PaletteImageView/raw/master/screenshot/demo1.gif )
18
- ![ image ] ( https://github.com/DingMouRen/PaletteImageView/raw/master/screenshot/demo2.gif )
19
- ![ image] ( https://github.com/DingMouRen/PaletteImageView/raw/master/screenshot/demo3.gif )
17
+ 圆角半径|阴影半径|阴影偏移量
18
+ ---|---|---
19
+ ![ image] ( https://github.com/DingMouRen/PaletteImageView/raw/master/screenshot/demo1.gif ) | ![ image ] ( https://github.com/DingMouRen/PaletteImageView/raw/master/screenshot/demo2.gif ) | ![ image ] ( https://github.com/DingMouRen/PaletteImageView/raw/master/screenshot/ demo3.gif)
20
20
21
21
##### 2.阴影颜色默认是图片的主色调
22
22
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public ViewHolder(View itemView) {
68
68
mLinearLayout = (LinearLayout )itemView . findViewById (R .id .linear );
69
69
title = (TextView )itemView . findViewById (R .id .tv1 );
70
70
content = (TextView ) itemView .findViewById (R .id .tv2 );
71
- // initListener();
71
+ initListener ();
72
72
}
73
73
74
74
private void initListener () {
@@ -94,10 +94,11 @@ public void onComplete(PaletteImageView paletteImageView) {
94
94
if (arry == null ) list .remove (arry );
95
95
}
96
96
int [] arry = list .get (new Random ().nextInt (list .size ()-1 ));
97
-
98
- title .setTextColor (arry [1 ]);
99
- content .setTextColor (arry [0 ]);
100
- mLinearLayout .setBackgroundColor (arry [2 ]);
97
+ if (arry != null ) {
98
+ title .setTextColor (arry [1 ]);
99
+ content .setTextColor (arry [0 ]);
100
+ mLinearLayout .setBackgroundColor (arry [2 ]);
101
+ }
101
102
}
102
103
103
104
@ Override
Original file line number Diff line number Diff line change 12
12
android : id =" @+id/palette"
13
13
android : layout_width =" match_parent"
14
14
android : layout_height =" wrap_content"
15
- app : palettePadding =" 20dp"
16
- app : paletteOffsetX =" 15dp"
17
- app : paletteOffsetY =" 15dp"
15
+ app : palettePadding =" 0dp"
18
16
/>
19
17
<LinearLayout
20
18
android : id =" @+id/linear"
21
19
android : layout_width =" match_parent"
22
20
android : layout_height =" wrap_content"
23
21
android : orientation =" vertical"
24
- android : visibility =" gone "
22
+ android : visibility =" visible "
25
23
>
26
24
<TextView
27
25
android : id =" @+id/tv1"
You can’t perform that action at this time.
0 commit comments