Skip to content

Commit 5b136d1

Browse files
committed
Handle missing ColorSeekBar background
1 parent 3697c05 commit 5b136d1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • andcolorpicker/src/main/java/codes/side/andcolorpicker/view/picker

andcolorpicker/src/main/java/codes/side/andcolorpicker/view/picker/ColorSeekBar.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ abstract class ColorSeekBar<C : Color> @JvmOverloads constructor(
109109
*/
110110
private fun setupBackground() {
111111
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
112-
background = background.mutate()
113-
.also {
112+
background?.let { originalBackground ->
113+
background = originalBackground.mutate().also {
114114
if (it is RippleDrawable) {
115115
// TODO: Set ripple size for pre-M too
116116
// TODO: Make ripple size configurable?
@@ -120,6 +120,7 @@ abstract class ColorSeekBar<C : Color> @JvmOverloads constructor(
120120
}
121121
}
122122
}
123+
}
123124
}
124125
}
125126

0 commit comments

Comments
 (0)