summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-07-31 12:56:00 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-07-31 13:46:34 +0000
commit03190e2e20f5e9bb6765d5b4c002dfa671d210a7 (patch)
treed26eb956eacff3d3940faeaf2446f02628e15e16
parent5af0fead3760a839c6dce6936a90fa7678b7ed10 (diff)
downloadmullvadvpn-03190e2e20f5e9bb6765d5b4c002dfa671d210a7.tar.xz
mullvadvpn-03190e2e20f5e9bb6765d5b4c002dfa671d210a7.zip
Show notification icon when external link is set
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt10
1 files changed, 10 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt
index 8834ce7ab5..5ab496122a 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt
@@ -1,5 +1,6 @@
package net.mullvad.mullvadvpn
+import android.net.Uri
import android.widget.TextView
import android.view.View
@@ -12,7 +13,9 @@ class NotificationBanner(val parentView: View) {
private val banner: View = parentView.findViewById(R.id.notification_banner)
private val title: TextView = parentView.findViewById(R.id.notification_title)
private val message: TextView = parentView.findViewById(R.id.notification_message)
+ private val icon: View = parentView.findViewById(R.id.notification_icon)
+ private var externalLink: Uri? = null
private var visible = false
var keyState: KeygenEvent? = null
@@ -28,6 +31,7 @@ class NotificationBanner(val parentView: View) {
}
private fun update() {
+ externalLink = null
updateBasedOnKeyState() || updateBasedOnTunnelState()
}
@@ -96,6 +100,12 @@ class NotificationBanner(val parentView: View) {
message.setText(messageText)
message.visibility = View.VISIBLE
}
+
+ if (externalLink == null) {
+ icon.visibility = View.GONE
+ } else {
+ icon.visibility = View.VISIBLE
+ }
}
private fun hide() {