summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/danoeh/antennapod/activity
diff options
context:
space:
mode:
authorMartin Fietz <Martin.Fietz@gmail.com>2018-01-03 18:52:11 +0100
committerGitHub <noreply@github.com>2018-01-03 18:52:11 +0100
commit68754684b71685b10bc46aba336b2d90819e19d5 (patch)
tree190f60adfde1b41eba46ec7b87562278875e79f7 /app/src/main/java/de/danoeh/antennapod/activity
parent79d2b068acbc6804727c423de838d32d5d03e817 (diff)
parent30c7ca5437cf65dc74ebfdd60a44d89da2bfaf79 (diff)
downloadAntennaPod-68754684b71685b10bc46aba336b2d90819e19d5.zip
Merge pull request #2457 from ByteHamster/sharedElement
Shared element transition
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/activity')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java9
2 files changed, 20 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
index 21a0fa66f..b0cbd355b 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
@@ -11,6 +11,7 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
+import android.support.v4.app.ActivityOptionsCompat;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.Menu;
@@ -368,7 +369,16 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(intent);
+
+ View cover = findViewById(R.id.imgvCover);
+ if (cover != null && Build.VERSION.SDK_INT >= 16) {
+ ActivityOptionsCompat options = ActivityOptionsCompat.
+ makeSceneTransitionAnimation(MediaplayerActivity.this,
+ cover, "coverTransition");
+ startActivity(intent, options.toBundle());
+ } else {
+ startActivity(intent);
+ }
return true;
} else {
if (media != null) {
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
index b3cda69d3..cc7d83e0c 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
@@ -6,6 +6,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
+import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.Snackbar;
@@ -113,6 +114,12 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
}
@Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ supportPostponeEnterTransition();
+ }
+
+ @Override
protected void onStop() {
super.onStop();
Log.d(TAG, "onStop()");
@@ -277,6 +284,8 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
pageIndicator.setViewPager(pager);
loadLastFragment();
pager.onSaveInstanceState();
+
+ navList.post(this::supportStartPostponedEnterTransition);
}
@Override