summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-01-24 21:10:19 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-02-10 15:40:36 +0000
commit1bea844509c93a0f2ec5e6feefd84d39adefca5a (patch)
tree69efc0509cd56a2c375fe9706a73d70c022668c2
parentc0f01c4f2e3787f01b0564a13248de8837fe7c89 (diff)
downloadmullvadvpn-1bea844509c93a0f2ec5e6feefd84d39adefca5a.tar.xz
mullvadvpn-1bea844509c93a0f2ec5e6feefd84d39adefca5a.zip
Create `PreferencesFragment`
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/PreferencesFragment.kt14
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SettingsFragment.kt6
-rw-r--r--android/src/main/res/layout/preferences.xml73
-rw-r--r--android/src/main/res/values/strings.xml5
4 files changed, 97 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/PreferencesFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/PreferencesFragment.kt
new file mode 100644
index 0000000000..07095051aa
--- /dev/null
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/PreferencesFragment.kt
@@ -0,0 +1,14 @@
+package net.mullvad.mullvadvpn.ui
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import net.mullvad.mullvadvpn.R
+
+class PreferencesFragment : ServiceDependentFragment(OnNoService.GoBack) {
+ override fun onSafelyCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ) = inflater.inflate(R.layout.preferences, container, false)
+}
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SettingsFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SettingsFragment.kt
index 448f0fcf8f..154339b10a 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SettingsFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SettingsFragment.kt
@@ -70,7 +70,11 @@ class SettingsFragment : ServiceAwareFragment() {
}
}
- preferencesMenu = view.findViewById<View>(R.id.preferences)
+ preferencesMenu = view.findViewById<View>(R.id.preferences).apply {
+ setOnClickListener {
+ openSubFragment(PreferencesFragment())
+ }
+ }
wireguardKeysMenu = view.findViewById<View>(R.id.wireguard_keys).apply {
setOnClickListener {
diff --git a/android/src/main/res/layout/preferences.xml b/android/src/main/res/layout/preferences.xml
new file mode 100644
index 0000000000..38089ce7e4
--- /dev/null
+++ b/android/src/main/res/layout/preferences.xml
@@ -0,0 +1,73 @@
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/darkBlue"
+ android:orientation="vertical"
+ android:gravity="left"
+ android:elevation="2dp"
+ >
+ <LinearLayout android:id="@+id/back"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:padding="12dp"
+ android:orientation="horizontal"
+ android:gravity="center_vertical | left"
+ android:clickable="true"
+ android:background="?android:attr/selectableItemBackground"
+ >
+ <ImageView
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_marginRight="8dp"
+ android:src="@drawable/icon_back"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/white60"
+ android:textSize="13sp"
+ android:textStyle="bold"
+ android:text="@string/settings"
+ />
+ </LinearLayout>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dp"
+ android:layout_marginLeft="24dp"
+ android:textColor="@color/white"
+ android:textSize="32sp"
+ android:textStyle="bold"
+ android:text="@string/settings_preferences"
+ />
+ <LinearLayout android:id="@+id/allow_lan"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="24dp"
+ android:paddingHorizontal="16dp"
+ android:background="@drawable/cell_button_background"
+ android:gravity="center"
+ >
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:paddingHorizontal="8dp"
+ android:paddingVertical="17dp"
+ android:textColor="@color/white"
+ android:textSize="20sp"
+ android:textStyle="bold"
+ android:text="@string/local_network_sharing"
+ />
+ </LinearLayout>
+ <TextView android:id="@+id/allow_lan_footer"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dp"
+ android:paddingHorizontal="24dp"
+ android:textColor="@color/white60"
+ android:textSize="13sp"
+ android:text="@string/allow_lan_footer"
+ />
+</LinearLayout>
diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml
index f0d5ae8161..0a87ff3736 100644
--- a/android/src/main/res/values/strings.xml
+++ b/android/src/main/res/values/strings.xml
@@ -41,6 +41,11 @@
<string name="paid_until">Paid until</string>
<string name="log_out">Log out</string>
+ <string name="local_network_sharing">Local network sharing</string>
+ <string name="allow_lan_footer">
+ Allows access to other devices on the same network for sharing, printing etc.
+ </string>
+
<string name="problem_report_description">
To help you more effectively, your app\'s log file will be attached to this message. Your
data will remain secure and private, as it is anonymised before being sent over an encrypted