Fix crash in GalleryFragment when menu button is double-tapped

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2022-10-19 16:25:24 +02:00
parent 9b3c8510a1
commit b4f8773d7b
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -61,6 +61,8 @@ import androidx.recyclerview.widget.RecyclerView;
*/
public class GalleryFragment extends OCFileListFragment implements GalleryFragmentBottomSheetActions {
private static final int MAX_ITEMS_PER_ROW = 10;
private static final String FRAGMENT_TAG_BOTTOM_SHEET = "data";
private boolean photoSearchQueryRunning = false;
private AsyncTask<Void, Void, GallerySearchTask.Result> photoSearchTask;
private long startDate;
@ -282,12 +284,18 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
// Handle item selection
if (item.getItemId() == R.id.action_three_dot_icon && !photoSearchQueryRunning
&& galleryFragmentBottomSheetDialog != null) {
galleryFragmentBottomSheetDialog.show(getChildFragmentManager(),"data" );
showBottomSheet();
return true;
}
return super.onOptionsItemSelected(item);
}
private void showBottomSheet() {
if (!galleryFragmentBottomSheetDialog.isVisible()) {
galleryFragmentBottomSheetDialog.show(getChildFragmentManager(), FRAGMENT_TAG_BOTTOM_SHEET);
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == SELECT_LOCATION_REQUEST_CODE && data != null) {