From 4d016aee20e82e8d6d5efff7e47c8a53d2c45b69 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 12 Feb 2015 14:06:17 +0300 Subject: [PATCH] fix image pager enter transition --- .../org/fox/ttrss/ArticleImagesPagerActivity.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java index d92aeefa..01a6a324 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java @@ -9,6 +9,7 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; +import android.support.v4.app.ActivityCompat; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewPager; @@ -127,8 +128,9 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur } }); - if (position == 0) + if (position == 0) { ViewCompat.setTransitionName(imgView, "TRANSITION:ARTICLE_IMAGES_PAGER"); + } registerForContextMenu(imgView); @@ -171,6 +173,10 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur ((ViewPager) container).addView(view, 0); + if (position == 0) { + ActivityCompat.startPostponedEnterTransition(ArticleImagesPagerActivity.this); + } + return view; } @@ -234,6 +240,8 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur @Override public void onCreate(Bundle savedInstanceState) { + ActivityCompat.postponeEnterTransition(this); + // we use that before parent onCreate so let's init locally m_prefs = PreferenceManager .getDefaultSharedPreferences(getApplicationContext()); @@ -363,7 +371,7 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur switch (item.getItemId()) { case android.R.id.home: - finish(); + onBackPressed(); return true; case R.id.article_img_open: if (url != null) {