Skip to content

Commit 1c0d3c2

Browse files
committed
Split initialzing arrowDrawable and arrowColor
1 parent 9b35196 commit 1c0d3c2

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

  • balloon/src/main/java/com/skydoves/balloon

balloon/src/main/java/com/skydoves/balloon/Balloon.kt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,11 @@ class Balloon(
138138
}
139139
layoutParams = params
140140
alpha = builder.alpha
141-
when {
142-
builder.arrowDrawable != null -> {
143-
setImageDrawable(builder.arrowDrawable)
144-
}
145-
builder.arrowColor != NO_INT_VALUE -> {
146-
ImageViewCompat.setImageTintList(this, ColorStateList.valueOf(builder.arrowColor))
147-
}
148-
else -> {
149-
ImageViewCompat.setImageTintList(this, ColorStateList.valueOf(builder.backgroundColor))
150-
}
141+
builder.arrowDrawable?.let { setImageDrawable(it) }
142+
if (builder.arrowColor != NO_INT_VALUE) {
143+
ImageViewCompat.setImageTintList(this, ColorStateList.valueOf(builder.arrowColor))
144+
} else {
145+
ImageViewCompat.setImageTintList(this, ColorStateList.valueOf(builder.backgroundColor))
151146
}
152147
}
153148
}

0 commit comments

Comments
 (0)