summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-03-15 11:02:48 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-03-18 17:03:54 +0000
commit6b721524bb91e4078d725b4a23aaa6e9e3ac91c2 (patch)
tree5f4536ed9cdc7ee631249f94f2097ee46a861636
parent7a88f1d0f6b938a2a1782187dfd0da93c61578f1 (diff)
downloadmullvadvpn-6b721524bb91e4078d725b4a23aaa6e9e3ac91c2.tar.xz
mullvadvpn-6b721524bb91e4078d725b4a23aaa6e9e3ac91c2.zip
Animate "Select location" screen transition
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt6
-rw-r--r--android/src/main/res/anim/do_nothing.xml8
-rw-r--r--android/src/main/res/anim/fragment_enter_from_bottom.xml8
-rw-r--r--android/src/main/res/anim/fragment_exit_to_bottom.xml8
-rw-r--r--android/src/main/res/layout/select_location.xml1
5 files changed, 31 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 0b6a091fe5..bbe43ede29 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ConnectFragment.kt
@@ -75,6 +75,12 @@ class ConnectFragment : Fragment() {
private fun openSwitchLocationScreen() {
fragmentManager?.beginTransaction()?.apply {
+ setCustomAnimations(
+ R.anim.fragment_enter_from_bottom,
+ R.anim.do_nothing,
+ R.anim.do_nothing,
+ R.anim.fragment_exit_to_bottom
+ )
replace(R.id.main_fragment, SelectLocationFragment())
addToBackStack(null)
commit()
diff --git a/android/src/main/res/anim/do_nothing.xml b/android/src/main/res/anim/do_nothing.xml
new file mode 100644
index 0000000000..6c552b6d11
--- /dev/null
+++ b/android/src/main/res/anim/do_nothing.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate
+ android:fromYDelta="0"
+ android:toYDelta="0"
+ android:duration="450"
+ />
+</set>
diff --git a/android/src/main/res/anim/fragment_enter_from_bottom.xml b/android/src/main/res/anim/fragment_enter_from_bottom.xml
new file mode 100644
index 0000000000..60a84de5e5
--- /dev/null
+++ b/android/src/main/res/anim/fragment_enter_from_bottom.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate
+ android:fromYDelta="100%p"
+ android:toYDelta="0"
+ android:duration="450"
+ />
+</set>
diff --git a/android/src/main/res/anim/fragment_exit_to_bottom.xml b/android/src/main/res/anim/fragment_exit_to_bottom.xml
new file mode 100644
index 0000000000..7f7aa49258
--- /dev/null
+++ b/android/src/main/res/anim/fragment_exit_to_bottom.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate
+ android:fromYDelta="0"
+ android:toYDelta="100%p"
+ android:duration="450"
+ />
+</set>
diff --git a/android/src/main/res/layout/select_location.xml b/android/src/main/res/layout/select_location.xml
index 2f3af769b2..0835c36dc3 100644
--- a/android/src/main/res/layout/select_location.xml
+++ b/android/src/main/res/layout/select_location.xml
@@ -6,6 +6,7 @@
android:background="@color/darkBlue"
android:orientation="vertical"
android:gravity="left"
+ android:elevation="1dp"
>
<ImageButton android:id="@+id/close"
android:layout_width="wrap_content"