|
@@ -122,7 +122,6 @@ import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.annotation.StringRes;
|
|
|
import androidx.appcompat.app.ActionBar;
|
|
|
-import androidx.core.util.ObjectsCompat;
|
|
|
import androidx.drawerlayout.widget.DrawerLayout;
|
|
|
import androidx.fragment.app.FragmentActivity;
|
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
@@ -1192,7 +1191,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|
|
mLimitToMimeType
|
|
|
);
|
|
|
|
|
|
- boolean changedDirectory = !ObjectsCompat.equals(mFile, directory);
|
|
|
+ OCFile previousDirectory = mFile;
|
|
|
mFile = directory;
|
|
|
|
|
|
updateLayout();
|
|
@@ -1200,7 +1199,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|
|
mAdapter.setHighlightedItem(file);
|
|
|
int position = mAdapter.getItemPosition(file);
|
|
|
if (position == -1) {
|
|
|
- if (changedDirectory) {
|
|
|
+ if (previousDirectory == null || !previousDirectory.equals(directory)) {
|
|
|
getRecyclerView().scrollToPosition(0);
|
|
|
}
|
|
|
} else {
|