diff options
author | Andrew Dolgov <[email protected]> | 2015-02-12 14:06:17 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-02-12 14:06:17 +0300 |
commit | 4d016aee20e82e8d6d5efff7e47c8a53d2c45b69 (patch) | |
tree | 2991aa84a86a2d5eea662b64f613c73ae9e2741d /org.fox.ttrss/src | |
parent | c3a80f1be4a1fe84e0f468aaaa519d7d86e50a3f (diff) |
fix image pager enter transition
Diffstat (limited to 'org.fox.ttrss/src')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java | 12 |
1 files 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) { |