summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-06-05 11:22:12 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-06-14 14:31:17 +0000
commit1b9b23c0a3900daa07c055b7663b1880900165ba (patch)
tree3c7a7df4ec189b7344127e396e25e56df732428a /android/src
parent04a1fcd1edf97159c920e7daf744e924a9cba34b (diff)
downloadmullvadvpn-1b9b23c0a3900daa07c055b7663b1880900165ba.tar.xz
mullvadvpn-1b9b23c0a3900daa07c055b7663b1880900165ba.zip
Add close button to Settings fragment
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/SettingsFragment.kt12
-rw-r--r--android/src/main/res/layout/settings.xml11
2 files changed, 21 insertions, 2 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/SettingsFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/SettingsFragment.kt
index e9ee40ee36..daaf0ad32e 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/SettingsFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/SettingsFragment.kt
@@ -4,12 +4,22 @@ import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
+import android.view.View
import android.view.ViewGroup
+import android.widget.ImageButton
class SettingsFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
- ) = inflater.inflate(R.layout.settings, container, false)
+ ): View {
+ val view = inflater.inflate(R.layout.settings, container, false)
+
+ view.findViewById<ImageButton>(R.id.close).setOnClickListener {
+ activity?.onBackPressed()
+ }
+
+ return view
+ }
}
diff --git a/android/src/main/res/layout/settings.xml b/android/src/main/res/layout/settings.xml
index 5285c9b893..da8782caab 100644
--- a/android/src/main/res/layout/settings.xml
+++ b/android/src/main/res/layout/settings.xml
@@ -7,10 +7,19 @@
android:gravity="left"
android:elevation="1dp"
>
+ <ImageButton android:id="@+id/close"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_marginTop="12dp"
+ android:layout_marginLeft="12dp"
+ android:layout_marginBottom="12dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:src="@drawable/icon_close"
+ />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="52dp"
+ android:layout_marginTop="4dp"
android:layout_marginLeft="24dp"
android:layout_marginBottom="24dp"
android:textColor="@color/white"