summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-06-23 01:20:27 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-06-25 17:39:24 +0000
commiteb2da4b3a67154f4b6a1569c1623c223dadb5adc (patch)
tree955426a0f9b1abdc75e3ab1a0291aafb1947ab4b /android/src
parentc2cd2d79bfdc27adb8ac577b3c0f6d0504680e51 (diff)
downloadmullvadvpn-eb2da4b3a67154f4b6a1569c1623c223dadb5adc.tar.xz
mullvadvpn-eb2da4b3a67154f4b6a1569c1623c223dadb5adc.zip
Remove height callback from `NotificationBanner`
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/NotificationBanner.kt24
1 files changed, 0 insertions, 24 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/NotificationBanner.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/NotificationBanner.kt
index 1aeed5e5ca..efb27bc4d7 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/NotificationBanner.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/NotificationBanner.kt
@@ -5,7 +5,6 @@ import android.content.Intent
import android.graphics.drawable.Drawable
import android.net.Uri
import android.view.View
-import android.view.View.MeasureSpec
import android.widget.ImageView
import android.widget.TextView
import kotlin.properties.Delegates.observable
@@ -53,12 +52,6 @@ class NotificationBanner(
private val message: TextView = parentView.findViewById(R.id.notification_message)
private val icon: View = parentView.findViewById(R.id.notification_icon)
- private var height: Int by observable(0) { _, oldValue, newValue ->
- if (oldValue != newValue) {
- onHeightChange?.invoke(newValue)
- }
- }
-
private var updateJob: Job? = null
private var externalLink: ExternalLink? = null
@@ -93,10 +86,6 @@ class NotificationBanner(
}
)
- var onHeightChange by observable<((Int) -> Unit)?>(null) { _, _, newListener ->
- newListener?.invoke(height)
- }
-
var accountExpiry by observable<DateTime?>(null) { _, _, _ -> update() }
var keyState by observable<KeygenEvent?>(null) { _, _, _ -> update() }
var tunnelState by observable<TunnelState>(TunnelState.Disconnected()) { _, _, _ -> update() }
@@ -282,8 +271,6 @@ class NotificationBanner(
banner.setClickable(true)
icon.visibility = View.VISIBLE
}
-
- height = recalculateHeight()
}
private fun hide() {
@@ -294,15 +281,4 @@ class NotificationBanner(
}
}
}
-
- private fun recalculateHeight(): Int {
- banner.apply {
- val widthSpec = MeasureSpec.makeMeasureSpec(measuredWidth, MeasureSpec.AT_MOST)
- val heightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)
-
- measure(widthSpec, heightSpec)
-
- return measuredHeight
- }
- }
}