summaryrefslogtreecommitdiffhomepage
path: root/android/src/main/kotlin
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-06-20 13:41:58 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-06-24 11:35:22 +0000
commit987ebb56645a6104b757429ac8cb8ca68f70f232 (patch)
tree3be177bffe825113b34bf3fc6c5b22fa4d678797 /android/src/main/kotlin
parenta7790d30ee9602fa729bb406d9abc0db10d93e53 (diff)
downloadmullvadvpn-987ebb56645a6104b757429ac8cb8ca68f70f232.tar.xz
mullvadvpn-987ebb56645a6104b757429ac8cb8ca68f70f232.zip
Add "Edit message" button
Diffstat (limited to 'android/src/main/kotlin')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ProblemReportFragment.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ProblemReportFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ProblemReportFragment.kt
index fa389517ea..33b2c36e6b 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ProblemReportFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ProblemReportFragment.kt
@@ -38,6 +38,7 @@ class ProblemReportFragment : Fragment() {
private lateinit var responseMessageLabel: TextView
private lateinit var responseEmailLabel: TextView
+ private lateinit var editMessageButton: Button
private lateinit var tryAgainButton: Button
private var sendReportJob: Job? = null
@@ -76,6 +77,7 @@ class ProblemReportFragment : Fragment() {
responseMessageLabel = view.findViewById<TextView>(R.id.response_message)
responseEmailLabel = view.findViewById<TextView>(R.id.response_email)
+ editMessageButton = view.findViewById<Button>(R.id.edit_message_button)
tryAgainButton = view.findViewById<Button>(R.id.try_again_button)
sendButton.setOnClickListener {
@@ -83,6 +85,10 @@ class ProblemReportFragment : Fragment() {
sendReportJob = sendReport()
}
+ editMessageButton.setOnClickListener {
+ showForm()
+ }
+
tryAgainButton.setOnClickListener {
sendReportJob = sendReport()
}
@@ -113,6 +119,10 @@ class ProblemReportFragment : Fragment() {
}
}
+ private fun showForm() {
+ bodyContainer.displayedChild = 0
+ }
+
private fun showSendingScreen() {
bodyContainer.displayedChild = 1
@@ -127,6 +137,7 @@ class ProblemReportFragment : Fragment() {
sendStatusLabel.setText(R.string.sending)
+ editMessageButton.visibility = View.GONE
tryAgainButton.visibility = View.GONE
}
@@ -157,6 +168,7 @@ class ProblemReportFragment : Fragment() {
sendStatusLabel.setText(R.string.failed_to_send)
sendDetailsLabel.setText(R.string.failed_to_send_details)
+ editMessageButton.visibility = View.VISIBLE
tryAgainButton.visibility = View.VISIBLE
}