summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConnectFragment.kt9
-rw-r--r--android/src/main/res/layout/connect.xml10
2 files changed, 9 insertions, 10 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConnectFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConnectFragment.kt
index 4c2d498baf..b1a4f6f2cb 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConnectFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConnectFragment.kt
@@ -13,6 +13,7 @@ import net.mullvad.mullvadvpn.ui.notification.TunnelStateNotification
import net.mullvad.mullvadvpn.ui.notification.VersionInfoNotification
import net.mullvad.mullvadvpn.ui.widget.HeaderBar
import net.mullvad.mullvadvpn.ui.widget.NotificationBanner
+import net.mullvad.mullvadvpn.ui.widget.SwitchLocationButton
import org.joda.time.DateTime
val KEY_IS_TUNNEL_INFO_EXPANDED = "is_tunnel_info_expanded"
@@ -68,8 +69,9 @@ class ConnectFragment : ServiceDependentFragment(OnNoService.GoToLaunchScreen) {
onDisconnect = { connectionProxy.disconnect() }
}
- switchLocationButton = SwitchLocationButton(view, resources)
- switchLocationButton.onClick = { openSwitchLocationScreen() }
+ switchLocationButton = view.findViewById<SwitchLocationButton>(R.id.switch_location).apply {
+ onClick = { openSwitchLocationScreen() }
+ }
return view
}
@@ -122,7 +124,6 @@ class ConnectFragment : ServiceDependentFragment(OnNoService.GoToLaunchScreen) {
override fun onSafelyDestroyView() {
notificationBanner.onDestroy()
- switchLocationButton.onDestroy()
}
override fun onSafelySaveInstanceState(state: Bundle) {
@@ -136,7 +137,7 @@ class ConnectFragment : ServiceDependentFragment(OnNoService.GoToLaunchScreen) {
status.setState(realState)
actionButton.tunnelState = uiState
- switchLocationButton.state = uiState
+ switchLocationButton.tunnelState = uiState
}
private fun openSwitchLocationScreen() {
diff --git a/android/src/main/res/layout/connect.xml b/android/src/main/res/layout/connect.xml
index a7887e5076..7fd06fd4bc 100644
--- a/android/src/main/res/layout/connect.xml
+++ b/android/src/main/res/layout/connect.xml
@@ -121,12 +121,10 @@
android:paddingHorizontal="@dimen/side_margin"
android:paddingTop="@dimen/button_separation"
android:paddingBottom="@dimen/screen_vertical_margin">
- <Button android:id="@+id/switch_location"
- android:layout_marginBottom="@dimen/button_separation"
- android:paddingHorizontal="9dp"
- android:text="@string/switch_location"
- android:drawableRight="@drawable/icon_chevron"
- style="@style/White20Button" />
+ <net.mullvad.mullvadvpn.ui.widget.SwitchLocationButton android:id="@+id/switch_location"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/button_separation" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">