From 47960c0dfd11c5bc93876aacbe4942f91e261d78 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Wed, 27 Jul 2022 10:29:14 +0200 Subject: [PATCH] Use const to define banner background alpha --- .../app/features/location/live/LocationLiveEndedBannerView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt b/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt index e2b4936f6e..7a2671d800 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt @@ -26,6 +26,8 @@ import androidx.core.view.updateLayoutParams import im.vector.app.R import im.vector.app.databinding.ViewLocationLiveEndedBannerBinding +private const val BACKGROUND_ALPHA = 0.75f + class LocationLiveEndedBannerView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, @@ -51,7 +53,7 @@ class LocationLiveEndedBannerView @JvmOverloads constructor( private fun setBackgroundAlpha(typedArray: TypedArray) { val withAlpha = typedArray.getBoolean(R.styleable.LocationLiveEndedBannerView_locLiveEndedBkgWithAlpha, false) - binding.locationLiveEndedBannerBackground.alpha = if (withAlpha) 0.75f else 1f + binding.locationLiveEndedBannerBackground.alpha = if (withAlpha) BACKGROUND_ALPHA else 1f } private fun setIconMarginStart(typedArray: TypedArray) {