summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-06-04 17:32:05 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-06-05 15:06:02 +0000
commit4b358d5341851a4c0f3b8003e2e64ff03d30a451 (patch)
treef779337a6abab5a6af449a55b656c3b9f05eb638 /android
parent1d81213a7c02daf22832f510a7ac32d6e465613c (diff)
downloadmullvadvpn-4b358d5341851a4c0f3b8003e2e64ff03d30a451.tar.xz
mullvadvpn-4b358d5341851a4c0f3b8003e2e64ff03d30a451.zip
Mark support screen secure when showing email
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ProblemReportFragment.kt22
1 files changed, 21 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ProblemReportFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ProblemReportFragment.kt
index 0cf2c61c84..69da3542c5 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ProblemReportFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ProblemReportFragment.kt
@@ -13,6 +13,7 @@ import android.widget.EditText
import android.widget.ScrollView
import android.widget.TextView
import android.widget.ViewSwitcher
+import kotlin.properties.Delegates.observable
import kotlinx.coroutines.CompletableDeferred
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.dataproxy.MullvadProblemReport
@@ -21,6 +22,17 @@ import net.mullvad.mullvadvpn.util.JobTracker
class ProblemReportFragment : Fragment() {
private val jobTracker = JobTracker()
+ private var showingEmail by observable(false) { _, oldValue, newValue ->
+ if (oldValue != newValue) {
+ if (newValue == true) {
+ parentActivity.enterSecureScreen(this)
+ } else {
+ parentActivity.leaveSecureScreen(this)
+ }
+ }
+ }
+
+ private lateinit var parentActivity: MainActivity
private lateinit var problemReport: MullvadProblemReport
private lateinit var bodyContainer: ViewSwitcher
@@ -46,7 +58,7 @@ class ProblemReportFragment : Fragment() {
override fun onAttach(context: Context) {
super.onAttach(context)
- val parentActivity = context as MainActivity
+ parentActivity = context as MainActivity
problemReport = parentActivity.problemReport
problemReport.collect()
@@ -118,6 +130,12 @@ class ProblemReportFragment : Fragment() {
super.onDestroyView()
}
+ override fun onDetach() {
+ showingEmail = false
+
+ super.onDetach()
+ }
+
private suspend fun sendReport(shouldConfirmNoEmail: Boolean) {
val userEmail = userEmailInput.text.trim().toString()
@@ -194,6 +212,8 @@ class ProblemReportFragment : Fragment() {
responseMessageLabel.visibility = View.VISIBLE
responseEmailLabel.visibility = View.VISIBLE
responseEmailLabel.text = userEmail
+
+ showingEmail = true
}
sendStatusLabel.setText(R.string.sent)