Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: mueller-ma <[email protected]>
  • Loading branch information
mueller-ma committed Jul 30, 2024
1 parent 201d492 commit d23bbb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,12 @@ class WidgetAdapter(

// Make sure images fit into the content frame by scaling
// them at max 90% of the available height
imageView.setMaxHeight(when {
initData.parent.height > 0 -> (0.9f * initData.parent.height).roundToInt()
else -> Integer.MAX_VALUE
})
imageView.setMaxHeight(
when {
initData.parent.height > 0 -> (0.9f * initData.parent.height).roundToInt()
else -> Integer.MAX_VALUE
}
)
imageView.setImageScalingType(prefs.getImageWidgetScalingType())

if (value != null && value.matches("data:image/.*;base64,.*".toRegex())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ class WidgetImageView(context: Context, attrs: AttributeSet?, private val imageV

init {
addView(imageView, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
imageView.loadProgressCallback = { loading -> when (loading) {
true -> showSkeleton()
false -> showOriginal()
} }
imageView.loadProgressCallback = { loading ->
when (loading) {
true -> showSkeleton()
false -> showOriginal()
}
}
}

@SuppressLint("CustomViewStyleable")
Expand Down

0 comments on commit d23bbb9

Please sign in to comment.