mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-29 14:38:45 +03:00
Use const to define banner background alpha
This commit is contained in:
parent
d62cf70b8c
commit
47960c0dfd
1 changed files with 3 additions and 1 deletions
|
@ -26,6 +26,8 @@ import androidx.core.view.updateLayoutParams
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.databinding.ViewLocationLiveEndedBannerBinding
|
import im.vector.app.databinding.ViewLocationLiveEndedBannerBinding
|
||||||
|
|
||||||
|
private const val BACKGROUND_ALPHA = 0.75f
|
||||||
|
|
||||||
class LocationLiveEndedBannerView @JvmOverloads constructor(
|
class LocationLiveEndedBannerView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
|
@ -51,7 +53,7 @@ class LocationLiveEndedBannerView @JvmOverloads constructor(
|
||||||
|
|
||||||
private fun setBackgroundAlpha(typedArray: TypedArray) {
|
private fun setBackgroundAlpha(typedArray: TypedArray) {
|
||||||
val withAlpha = typedArray.getBoolean(R.styleable.LocationLiveEndedBannerView_locLiveEndedBkgWithAlpha, false)
|
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) {
|
private fun setIconMarginStart(typedArray: TypedArray) {
|
||||||
|
|
Loading…
Reference in a new issue