mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 12:38:00 +01:00
save the directory activities scroll state too
This commit is contained in:
parent
399f9ee066
commit
e206fa92ca
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,7 @@ import android.graphics.Color;
|
|||
import android.media.MediaScannerConnection;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.Snackbar;
|
||||
|
@ -55,6 +56,7 @@ public class MainActivity extends AppCompatActivity
|
|||
private boolean isSnackbarShown;
|
||||
private List<String> toBeDeleted;
|
||||
private ActionMode actionMode;
|
||||
private Parcelable state;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -86,12 +88,16 @@ public class MainActivity extends AppCompatActivity
|
|||
protected void onResume() {
|
||||
super.onResume();
|
||||
tryloadGallery();
|
||||
if (state != null && gridView != null)
|
||||
gridView.onRestoreInstanceState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
deleteDirs();
|
||||
if (gridView != null)
|
||||
state = gridView.onSaveInstanceState();
|
||||
}
|
||||
|
||||
private void tryloadGallery() {
|
||||
|
|
Loading…
Reference in a new issue