|
@@ -1190,6 +1190,8 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|
|
onlyOnDevice,
|
|
|
mLimitToMimeType
|
|
|
);
|
|
|
+
|
|
|
+ OCFile previousDirectory = mFile;
|
|
|
mFile = directory;
|
|
|
|
|
|
updateLayout();
|
|
@@ -1197,7 +1199,9 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|
|
mAdapter.setHighlightedItem(file);
|
|
|
int position = mAdapter.getItemPosition(file);
|
|
|
if (position == -1) {
|
|
|
- getRecyclerView().scrollToPosition(0);
|
|
|
+ if (previousDirectory == null || !previousDirectory.equals(directory)) {
|
|
|
+ getRecyclerView().scrollToPosition(0);
|
|
|
+ }
|
|
|
} else {
|
|
|
getRecyclerView().scrollToPosition(position);
|
|
|
}
|