|
23 | 23 | import android.view.ViewConfiguration; |
24 | 24 | import android.view.ViewTreeObserver; |
25 | 25 |
|
26 | | -import androidx.annotation.ColorInt; |
27 | | -import androidx.annotation.RequiresApi; |
28 | | -import androidx.annotation.StyleableRes; |
29 | | -import androidx.core.text.TextUtilsCompat; |
30 | | -import androidx.core.view.ViewCompat; |
31 | | - |
32 | 26 | import com.ruffian.library.widget.R; |
33 | 27 | import com.ruffian.library.widget.clip.ClipHelper; |
34 | 28 | import com.ruffian.library.widget.clip.ClipPathManager; |
|
38 | 32 |
|
39 | 33 | import java.util.Locale; |
40 | 34 |
|
| 35 | +import androidx.annotation.ColorInt; |
| 36 | +import androidx.annotation.RequiresApi; |
| 37 | +import androidx.annotation.StyleableRes; |
| 38 | +import androidx.core.text.TextUtilsCompat; |
| 39 | +import androidx.core.view.ViewCompat; |
| 40 | + |
41 | 41 |
|
42 | 42 | /** |
43 | 43 | * BaseHelper |
@@ -374,27 +374,27 @@ private void setupDefaultValue(boolean init) { |
374 | 374 | if (mBackgroundColorNormalArray != null && mBackgroundColorNormalArray.length > 0) { |
375 | 375 | mBackgroundNormal = setColors(mBackgroundNormal, mBackgroundColorNormalArray); |
376 | 376 | } else { |
377 | | - mBackgroundNormal.setColor(mBackgroundColorNormal); |
| 377 | + mBackgroundNormal = setColors(mBackgroundNormal, new int[]{mBackgroundColorNormal, mBackgroundColorNormal}); |
378 | 378 | } |
379 | 379 | if (mBackgroundColorPressedArray != null && mBackgroundColorPressedArray.length > 0) { |
380 | 380 | mBackgroundPressed = setColors(mBackgroundPressed, mBackgroundColorPressedArray); |
381 | 381 | } else { |
382 | | - mBackgroundPressed.setColor(mBackgroundColorPressed); |
| 382 | + mBackgroundPressed = setColors(mBackgroundPressed, new int[]{mBackgroundColorPressed, mBackgroundColorPressed}); |
383 | 383 | } |
384 | 384 | if (mBackgroundColorUnableArray != null && mBackgroundColorUnableArray.length > 0) { |
385 | 385 | mBackgroundUnable = setColors(mBackgroundUnable, mBackgroundColorUnableArray); |
386 | 386 | } else { |
387 | | - mBackgroundUnable.setColor(mBackgroundColorUnable); |
| 387 | + mBackgroundUnable = setColors(mBackgroundUnable, new int[]{mBackgroundColorUnable, mBackgroundColorUnable}); |
388 | 388 | } |
389 | 389 | if (mBackgroundColorCheckedArray != null && mBackgroundColorCheckedArray.length > 0) { |
390 | 390 | mBackgroundChecked = setColors(mBackgroundChecked, mBackgroundColorCheckedArray); |
391 | 391 | } else { |
392 | | - mBackgroundChecked.setColor(mBackgroundColorChecked); |
| 392 | + mBackgroundChecked = setColors(mBackgroundChecked, new int[]{mBackgroundColorChecked, mBackgroundColorChecked}); |
393 | 393 | } |
394 | 394 | if (mBackgroundColorSelectedArray != null && mBackgroundColorSelectedArray.length > 0) { |
395 | 395 | mBackgroundSelected = setColors(mBackgroundSelected, mBackgroundColorSelectedArray); |
396 | 396 | } else { |
397 | | - mBackgroundSelected.setColor(mBackgroundColorSelected); |
| 397 | + mBackgroundSelected = setColors(mBackgroundSelected, new int[]{mBackgroundColorSelected, mBackgroundColorSelected}); |
398 | 398 | } |
399 | 399 |
|
400 | 400 | //设置边框默认值 |
|
0 commit comments