diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-03-13 20:18:28 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-03-15 19:18:52 +0000 |
| commit | 71cd3876cfc4018c73c9813334d64bf87801e944 (patch) | |
| tree | 8ad6a1372c8a6b3fa1afb563ff8ac8c7a5e66a97 /android | |
| parent | 614ff99d121f3e09d3b5bfeed3757e2be0c1c20f (diff) | |
| download | mullvadvpn-71cd3876cfc4018c73c9813334d64bf87801e944.tar.xz mullvadvpn-71cd3876cfc4018c73c9813334d64bf87801e944.zip | |
Handle cancelling the connection attempt
Diffstat (limited to 'android')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt index c516c99981..5737e057cc 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt @@ -28,6 +28,7 @@ class ConnectFragment : Fragment() { actionButton = ConnectActionButton(view) actionButton.onConnect = { connect() } + actionButton.onCancel = { cancel() } return view } @@ -43,4 +44,16 @@ class ConnectFragment : Fragment() { status.setTextColor(context!!.getColor(R.color.white)) status.setText(R.string.creating_secure_connection) } + + private fun cancel() { + actionButton.state = ConnectionState.Disconnected + + connectingSpinner.visibility = View.INVISIBLE + notificationBanner.visibility = View.GONE + + headerBar.setBackgroundColor(context!!.getColor(R.color.red)) + + status.setTextColor(context!!.getColor(R.color.red)) + status.setText(R.string.unsecured_connection) + } } |
