|
@@ -5,7 +5,7 @@
|
|
* @author TSI-mc
|
|
* @author TSI-mc
|
|
* Copyright (C) 2019 Tobias Kaminsky
|
|
* Copyright (C) 2019 Tobias Kaminsky
|
|
* Copyright (C) 2019 Nextcloud GmbH
|
|
* Copyright (C) 2019 Nextcloud GmbH
|
|
- * Copyright (C) 2022 TSI-mc
|
|
|
|
|
|
+ * Copyright (C) 2023 TSI-mc
|
|
*
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* it under the terms of the GNU General Public License as published by
|
|
@@ -70,7 +70,6 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
|
private GalleryAdapter mAdapter;
|
|
private GalleryAdapter mAdapter;
|
|
|
|
|
|
private static final int SELECT_LOCATION_REQUEST_CODE = 212;
|
|
private static final int SELECT_LOCATION_REQUEST_CODE = 212;
|
|
- private OCFile remoteFile;
|
|
|
|
private GalleryFragmentBottomSheetDialog galleryFragmentBottomSheetDialog;
|
|
private GalleryFragmentBottomSheetDialog galleryFragmentBottomSheetDialog;
|
|
|
|
|
|
@Inject FileDataStorageManager fileDataStorageManager;
|
|
@Inject FileDataStorageManager fileDataStorageManager;
|
|
@@ -121,8 +120,6 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
View v = super.onCreateView(inflater, container, savedInstanceState);
|
|
View v = super.onCreateView(inflater, container, savedInstanceState);
|
|
|
|
|
|
- remoteFile = fileDataStorageManager.getDefaultRootPath();
|
|
|
|
-
|
|
|
|
getRecyclerView().addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
getRecyclerView().addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
@Override
|
|
@Override
|
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
|
@@ -289,7 +286,7 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
|
if (requestCode == SELECT_LOCATION_REQUEST_CODE && data != null) {
|
|
if (requestCode == SELECT_LOCATION_REQUEST_CODE && data != null) {
|
|
OCFile chosenFolder = data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER);
|
|
OCFile chosenFolder = data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER);
|
|
if (chosenFolder != null) {
|
|
if (chosenFolder != null) {
|
|
- remoteFile = chosenFolder;
|
|
|
|
|
|
+ preferences.setLastSelectedMediaFolder(chosenFolder.getRemotePath());
|
|
searchAndDisplayAfterChangingFolder();
|
|
searchAndDisplayAfterChangingFolder();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -372,7 +369,7 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
|
}
|
|
}
|
|
|
|
|
|
public void showAllGalleryItems() {
|
|
public void showAllGalleryItems() {
|
|
- mAdapter.showAllGalleryItems(remoteFile.getRemotePath(),
|
|
|
|
|
|
+ mAdapter.showAllGalleryItems(preferences.getLastSelectedMediaFolder(),
|
|
galleryFragmentBottomSheetDialog.getCurrMediaState(),
|
|
galleryFragmentBottomSheetDialog.getCurrMediaState(),
|
|
this);
|
|
this);
|
|
|
|
|