[Android] AudioBrowserFragment: save tab position in onPause

Edward Wang git at videolan.org
Thu Dec 27 01:00:00 CET 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Wed Dec 26 18:57:32 2012 -0500| [e8f0e8d162ee71745e7381aeb2c5eef91f280dec] | committer: Edward Wang

AudioBrowserFragment: save tab position in onPause

Close #7957

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=e8f0e8d162ee71745e7381aeb2c5eef91f280dec
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java      |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 8878a52..7f0720f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -70,6 +70,7 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
     public final static String TAG = "VLC/AudioBrowserFragment";
 
     private FlingViewGroup mFlingViewGroup;
+    private int mFlingViewPosition = 0;
 
     private HorizontalScrollView mHeader;
     private AudioServiceController mAudioController;
@@ -161,12 +162,16 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
     @Override
     public void onPause() {
         super.onPause();
+        mFlingViewPosition = mFlingViewGroup.getPosition();
         mMediaLibrary.removeUpdateHandler(mHandler);
     }
 
     @Override
     public void onResume() {
         super.onResume();
+        headerScrollTab(mFlingViewPosition);
+        headerHighlightTab(mFlingViewGroup.getPosition(), mFlingViewPosition);
+        mFlingViewGroup.setPosition(mFlingViewPosition);
         mMediaLibrary.addUpdateHandler(mHandler);
     }
 



More information about the Android mailing list