summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-03-14 20:29:06 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-03-18 17:03:53 +0000
commit5cf10e54db6ed5d02a1df657513f6dab1dd2f546 (patch)
treeb48f6a6e28cb780664ec2478f111aa70fe64a653 /android
parent59c0aa07d7208805fa46743e4d73b19cdd95ad1c (diff)
downloadmullvadvpn-5cf10e54db6ed5d02a1df657513f6dab1dd2f546.tar.xz
mullvadvpn-5cf10e54db6ed5d02a1df657513f6dab1dd2f546.zip
Create initial empty "Select location" screen
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt13
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/SelectLocationFragment.kt17
-rw-r--r--android/src/main/res/drawable/icon_close.xml14
-rw-r--r--android/src/main/res/layout/connect.xml2
-rw-r--r--android/src/main/res/layout/select_location.xml35
-rw-r--r--android/src/main/res/values/strings.xml6
6 files changed, 86 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt
index c38321dfc9..0b6a091fe5 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt
@@ -6,6 +6,7 @@ import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.widget.Button
class ConnectFragment : Fragment() {
private lateinit var actionButton: ConnectActionButton
@@ -38,6 +39,10 @@ class ConnectFragment : Fragment() {
): View {
val view = inflater.inflate(R.layout.connect, container, false)
+ view.findViewById<Button>(R.id.switch_location).setOnClickListener {
+ openSwitchLocationScreen()
+ }
+
headerBar = HeaderBar(view, context!!)
notificationBanner = NotificationBanner(view)
status = ConnectionStatus(view, context!!)
@@ -67,4 +72,12 @@ class ConnectFragment : Fragment() {
private fun connected() {
state = ConnectionState.Connected
}
+
+ private fun openSwitchLocationScreen() {
+ fragmentManager?.beginTransaction()?.apply {
+ replace(R.id.main_fragment, SelectLocationFragment())
+ addToBackStack(null)
+ commit()
+ }
+ }
}
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/SelectLocationFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/SelectLocationFragment.kt
new file mode 100644
index 0000000000..f0c74fed05
--- /dev/null
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/SelectLocationFragment.kt
@@ -0,0 +1,17 @@
+package net.mullvad.mullvadvpn
+
+import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class SelectLocationFragment : Fragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ return inflater.inflate(R.layout.select_location, container, false)
+ }
+}
diff --git a/android/src/main/res/drawable/icon_close.xml b/android/src/main/res/drawable/icon_close.xml
new file mode 100644
index 0000000000..7cab786403
--- /dev/null
+++ b/android/src/main/res/drawable/icon_close.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0"
+ >
+ <group>
+ <path android:fillColor="#99FFFFFF"
+ android:pathData="M12,24 C5.37312,24 -3.2900871e-16,18.62688 -7.34788079e-16,12 C-1.14056745e-15,5.37312 5.37312,0 12,0 C18.62688,0 24,5.37312 24,12 C24,18.62688 18.62688,24 12,24 Z M13.5,12 L17.2947612,8.20523878 C17.6857559,7.81424414 17.6838785,7.18387854 17.293923,6.79392296 L17.206077,6.70607704 C16.8181114,6.31811142 16.1842538,6.31574616 15.7947612,6.70523878 L12,10.5 L8.20523878,6.70523878 C7.81574616,6.31574616 7.18188858,6.31811142 6.79392296,6.70607704 L6.70607704,6.79392296 C6.31612146,7.18387854 6.31424414,7.81424414 6.70523878,8.20523878 L10.5,12 L6.70523878,15.7947612 C6.31424414,16.1857559 6.31612146,16.8161215 6.70607704,17.206077 L6.79392296,17.293923 C7.18188858,17.6818886 7.81574616,17.6842538 8.20523878,17.2947612 L12,13.5 L15.7947612,17.2947612 C16.1842538,17.6842538 16.8181114,17.6818886 17.206077,17.293923 L17.293923,17.206077 C17.6838785,16.8161215 17.6857559,16.1857559 17.2947612,15.7947612 L13.5,12 L13.5,12 Z"
+ />
+ </group>
+</vector>
diff --git a/android/src/main/res/layout/connect.xml b/android/src/main/res/layout/connect.xml
index 8163a9a297..19f9cb177e 100644
--- a/android/src/main/res/layout/connect.xml
+++ b/android/src/main/res/layout/connect.xml
@@ -136,7 +136,7 @@
android:orientation="vertical"
android:padding="24dp"
>
- <Button
+ <Button android:id="@+id/switch_location"
android:layout_marginVertical="16dp"
android:text="@string/switch_location"
android:drawableRight="@drawable/icon_chevron"
diff --git a/android/src/main/res/layout/select_location.xml b/android/src/main/res/layout/select_location.xml
new file mode 100644
index 0000000000..551e76183b
--- /dev/null
+++ b/android/src/main/res/layout/select_location.xml
@@ -0,0 +1,35 @@
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/main_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/darkBlue"
+ android:orientation="vertical"
+ android:gravity="left"
+ >
+ <ImageButton
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="12dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:src="@drawable/icon_close"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginVertical="4dp"
+ android:layout_marginHorizontal="24dp"
+ android:textColor="@color/white"
+ android:textSize="32sp"
+ android:textStyle="bold"
+ android:text="@string/select_location"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginHorizontal="24dp"
+ android:textColor="@color/white60"
+ android:textSize="13sp"
+ android:text="@string/select_location_description"
+ />
+</LinearLayout>
diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml
index b8d1cdb654..24f8c9867e 100644
--- a/android/src/main/res/values/strings.xml
+++ b/android/src/main/res/values/strings.xml
@@ -19,4 +19,10 @@
<string name="cancel">Cancel</string>
<string name="disconnect">Disconnect</string>
<string name="switch_location">Switch location</string>
+
+ <string name="select_location">Select location</string>
+ <string name="select_location_description">
+ While connected, your real location is masked with a private and secure location in the
+ selected region
+ </string>
</resources>