Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/93913


Change subject: Add custom animation when navigating to a new page
......................................................................

Add custom animation when navigating to a new page

Old pages slide out to the right, new ones slide out from the
left. Works when going back too.

Change-Id: I9b6eb07dc1456db6bbc7a10aa0717782fbead0ed
---
A wikipedia/res/anim/slide_in_left.xml
A wikipedia/res/anim/slide_out_right.xml
M wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java
3 files changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/13/93913/1

diff --git a/wikipedia/res/anim/slide_in_left.xml 
b/wikipedia/res/anim/slide_in_left.xml
new file mode 100644
index 0000000..0f4af66
--- /dev/null
+++ b/wikipedia/res/anim/slide_in_left.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set>
+    <translate xmlns:android="http://schemas.android.com/apk/res/android";
+               android:fromXDelta="-100%"
+               android:toXDelta="0"
+               android:interpolator="@android:anim/decelerate_interpolator"
+               android:duration="500"/>
+</set>
diff --git a/wikipedia/res/anim/slide_out_right.xml 
b/wikipedia/res/anim/slide_out_right.xml
new file mode 100644
index 0000000..459bb69
--- /dev/null
+++ b/wikipedia/res/anim/slide_out_right.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set>
+    <translate xmlns:android="http://schemas.android.com/apk/res/android";
+               android:fromXDelta="0"
+               android:toXDelta="+100%"
+               android:interpolator="@android:anim/accelerate_interpolator"
+               android:duration="500"/>
+</set>
diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java 
b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java
index 9f30cd8..e181350 100644
--- a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java
+++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java
@@ -39,6 +39,7 @@
     private void displayNewPage(PageTitle title) {
         PageViewFragment pageFragment = new PageViewFragment(title);
         getSupportFragmentManager().beginTransaction()
+                .setCustomAnimations(R.anim.slide_in_left, 
R.anim.slide_out_right, R.anim.slide_in_left, R.anim.slide_out_right)
                 .replace(R.id.content_frame, pageFragment)
                 .addToBackStack(null)
                 .commit();

-- 
To view, visit https://gerrit.wikimedia.org/r/93913
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b6eb07dc1456db6bbc7a10aa0717782fbead0ed
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to