diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-07-10 22:31:24 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-07-10 22:31:24 +0200 |
commit | d79dd76d9a44c3b6cc57d5d946652aa8b01cbf56 (patch) | |
tree | acdcec7f8622269170ddd75953be363587277aeb /src/de/podfetcher | |
parent | 2e3bd8e881717708f2a85a4d60f16b6af6e1d226 (diff) | |
download | AntennaPod-d79dd76d9a44c3b6cc57d5d946652aa8b01cbf56.zip |
Improved orientation change handling
Diffstat (limited to 'src/de/podfetcher')
-rw-r--r-- | src/de/podfetcher/activity/MediaplayerActivity.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/de/podfetcher/activity/MediaplayerActivity.java b/src/de/podfetcher/activity/MediaplayerActivity.java index 0afbce1c9..134ca7204 100644 --- a/src/de/podfetcher/activity/MediaplayerActivity.java +++ b/src/de/podfetcher/activity/MediaplayerActivity.java @@ -145,11 +145,6 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements if (positionObserver != null) { positionObserver.cancel(true); } - if (orientation == Configuration.ORIENTATION_LANDSCAPE) { - setContentView(R.layout.mediaplayer_activity); - } else { - setContentView(R.layout.mediaplayer_activity); - } setupGUI(); handleStatus(); @@ -177,9 +172,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements orientation = getResources().getConfiguration().orientation; manager = FeedManager.getInstance(); getWindow().setFormat(PixelFormat.TRANSPARENT); - this.setContentView(R.layout.mediaplayer_activity); - setupGUI(); bindToService(); } @@ -327,6 +320,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements } private void setupGUI() { + setContentView(R.layout.mediaplayer_activity); sbPosition = (SeekBar) findViewById(R.id.sbPosition); txtvPosition = (TextView) findViewById(R.id.txtvPosition); txtvLength = (TextView) findViewById(R.id.txtvLength); @@ -503,6 +497,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements if ((requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE && orientation == Configuration.ORIENTATION_LANDSCAPE) || (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT && orientation == Configuration.ORIENTATION_PORTRAIT)) { Log.d(TAG, "Orientation correct"); + setupGUI(); handleStatus(); } else { Log.d(TAG, @@ -671,7 +666,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements } public static class MediaPlayerPagerAdapter extends - FragmentStatePagerAdapter { + FragmentPagerAdapter { private int numItems; private MediaplayerActivity activity; @@ -725,7 +720,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements @Override public int getItemPosition(Object object) { - return POSITION_NONE; + return POSITION_UNCHANGED; } } |