Merge pull request #3006 from pachecosf/fixed-losing-media-data
Fixed losing media data on rotation
This commit is contained in:
commit
de7a05f77c
|
@ -235,6 +235,8 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||||
StorageUtils.checkStorageAvailability(this);
|
StorageUtils.checkStorageAvailability(this);
|
||||||
|
|
||||||
getWindow().setFormat(PixelFormat.TRANSPARENT);
|
getWindow().setFormat(PixelFormat.TRANSPARENT);
|
||||||
|
setupGUI();
|
||||||
|
loadMediaInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -278,8 +280,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||||
controller.release();
|
controller.release();
|
||||||
}
|
}
|
||||||
controller = newPlaybackController();
|
controller = newPlaybackController();
|
||||||
setupGUI();
|
|
||||||
loadMediaInfo();
|
|
||||||
onPositionObserverUpdate();
|
onPositionObserverUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,6 +278,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
|
||||||
butCastDisconnect = findViewById(R.id.butCastDisconnect);
|
butCastDisconnect = findViewById(R.id.butCastDisconnect);
|
||||||
|
|
||||||
pager = findViewById(R.id.pager);
|
pager = findViewById(R.id.pager);
|
||||||
|
pager.setOffscreenPageLimit(3);
|
||||||
pagerAdapter = new MediaplayerInfoPagerAdapter(getSupportFragmentManager(), media);
|
pagerAdapter = new MediaplayerInfoPagerAdapter(getSupportFragmentManager(), media);
|
||||||
pagerAdapter.setController(controller);
|
pagerAdapter.setController(controller);
|
||||||
pager.setAdapter(pagerAdapter);
|
pager.setAdapter(pagerAdapter);
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class CoverFragment extends Fragment implements MediaplayerInfoContentFra
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
setRetainInstance(true);
|
||||||
root = inflater.inflate(R.layout.cover_fragment, container, false);
|
root = inflater.inflate(R.layout.cover_fragment, container, false);
|
||||||
txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle);
|
txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle);
|
||||||
txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);
|
txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);
|
||||||
|
|
Loading…
Reference in New Issue