From d23bbb91c229dc4d2387a9e3a49299ca9a9f36e6 Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Tue, 30 Jul 2024 19:32:18 +0200 Subject: [PATCH] Fix lint Signed-off-by: mueller-ma --- .../main/java/org/openhab/habdroid/ui/WidgetAdapter.kt | 10 ++++++---- .../org/openhab/habdroid/ui/widget/WidgetImageView.kt | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt index d71beec566..f72f2659ef 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt @@ -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())) { diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt b/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt index 1286d3be1a..e043298d20 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt @@ -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")