Skip to content

Commit

Permalink
refactor: remove unnecessary condition checking
Browse files Browse the repository at this point in the history
  • Loading branch information
goofyz committed Apr 17, 2024
1 parent b7b86c5 commit b3bfde6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/src/main/java/com/osfans/trime/data/theme/ColorManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,7 @@ object ColorManager {
): Drawable? {
val value = getColorValue(key)
if (value is Drawable) {
if (alpha < 255) {
value.alpha = MathUtils.clamp(alpha, 0, 255)
}
value.alpha = MathUtils.clamp(alpha, 0, 255)
return value
}

Expand All @@ -365,9 +363,7 @@ object ColorManager {
gradient.setStroke(borderPx, stroke)
}
}
if (alpha < 255) {
gradient.alpha = MathUtils.clamp(alpha, 0, 255)
}
gradient.alpha = MathUtils.clamp(alpha, 0, 255)
return gradient
}
return null
Expand Down

0 comments on commit b3bfde6

Please sign in to comment.