From bec14784af5ceef1f99d60e034981f1a7c1a2757 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 18 Feb 2013 11:00:10 -0800 Subject: Don't jump back to the top after moving items --- .../src/github/daneren2005/dsub/activity/DownloadActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'subsonic-android') diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java index 195d6001..f7ee55d3 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java @@ -36,6 +36,7 @@ import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; import android.os.Handler; +import android.os.Parcelable; import android.util.Log; import android.view.ContextMenu; import android.view.Display; @@ -816,9 +817,16 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi else emptyTextView.setText(R.string.download_empty); + // Save old position + Parcelable state = playlistView.onSaveInstanceState(); + // Set new items playlistView.setAdapter(new SongListAdapter(list)); + emptyTextView.setVisibility(list.isEmpty() ? View.VISIBLE : View.GONE); currentRevision = downloadService.getDownloadListUpdateRevision(); + + // Restore old position + playlistView.onRestoreInstanceState(state); switch (downloadService.getRepeatMode()) { case OFF: -- cgit v1.2.3