remember scrolling position
This commit is contained in:
parent
1bb44eb172
commit
f9082f8932
@ -714,6 +714,7 @@ public class LibraryActivity
|
||||
.setMessage(delete_message)
|
||||
.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
mPagerAdapter.maintainState(); // remember current scrolling position
|
||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_DELETE, intent));
|
||||
}
|
||||
})
|
||||
|
@ -447,6 +447,18 @@ public class LibraryPagerAdapter
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forcefully updates mSavedPositions by storing the current
|
||||
* state and passing it back into restoreState()
|
||||
* This ensures that the nest MSG_COMMIT_QUERY will
|
||||
* keep the current scrolling position
|
||||
*/
|
||||
public void maintainState()
|
||||
{
|
||||
Parcelable state = saveState();
|
||||
restoreState(state, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text to be displayed in the first row of the artist, album, and
|
||||
* song lists.
|
||||
|
Loading…
x
Reference in New Issue
Block a user