mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Only compare directories if necessary
Signed-off-by: Unpublished <unpublished@gmx.net>
This commit is contained in:
parent
e517451d94
commit
8c06097596
1 changed files with 2 additions and 3 deletions
|
@ -122,7 +122,6 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.StringRes;
|
import androidx.annotation.StringRes;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.core.util.ObjectsCompat;
|
|
||||||
import androidx.drawerlayout.widget.DrawerLayout;
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
@ -1192,7 +1191,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
||||||
mLimitToMimeType
|
mLimitToMimeType
|
||||||
);
|
);
|
||||||
|
|
||||||
boolean changedDirectory = !ObjectsCompat.equals(mFile, directory);
|
OCFile previousDirectory = mFile;
|
||||||
mFile = directory;
|
mFile = directory;
|
||||||
|
|
||||||
updateLayout();
|
updateLayout();
|
||||||
|
@ -1200,7 +1199,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
||||||
mAdapter.setHighlightedItem(file);
|
mAdapter.setHighlightedItem(file);
|
||||||
int position = mAdapter.getItemPosition(file);
|
int position = mAdapter.getItemPosition(file);
|
||||||
if (position == -1) {
|
if (position == -1) {
|
||||||
if (changedDirectory) {
|
if (previousDirectory == null || !previousDirectory.equals(directory)) {
|
||||||
getRecyclerView().scrollToPosition(0);
|
getRecyclerView().scrollToPosition(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue