diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-01-23 12:30:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-23 12:30:44 +0100 |
commit | de7a05f77c93b10be0dbb5e8b1dcf2b6cb431efd (patch) | |
tree | 538c40645fa2c12c1c1e48a26a994fd2f9eac548 | |
parent | 6c2e9afad4db461ff0b52ca46a0e80ad988f0731 (diff) | |
parent | 6753df01b53d448438dd7f2c35dc1c3e8b36351a (diff) | |
download | AntennaPod-de7a05f77c93b10be0dbb5e8b1dcf2b6cb431efd.zip |
Merge pull request #3006 from pachecosf/fixed-losing-media-data
Fixed losing media data on rotation
3 files changed, 4 insertions, 2 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 98dfeebef..ab4f40da4 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -235,6 +235,8 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements StorageUtils.checkStorageAvailability(this); getWindow().setFormat(PixelFormat.TRANSPARENT); + setupGUI(); + loadMediaInfo(); } @Override @@ -278,8 +280,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements controller.release(); } controller = newPlaybackController(); - setupGUI(); - loadMediaInfo(); onPositionObserverUpdate(); } 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 a2389dabd..3db00edc9 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java @@ -278,6 +278,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem butCastDisconnect = findViewById(R.id.butCastDisconnect); pager = findViewById(R.id.pager); + pager.setOffscreenPageLimit(3); pagerAdapter = new MediaplayerInfoPagerAdapter(getSupportFragmentManager(), media); pagerAdapter.setController(controller); pager.setAdapter(pagerAdapter); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 5a061c7e6..ef65a5755 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -48,6 +48,7 @@ public class CoverFragment extends Fragment implements MediaplayerInfoContentFra @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + setRetainInstance(true); root = inflater.inflate(R.layout.cover_fragment, container, false); txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle); txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle); |