mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Fix crash in GalleryFragment when menu button is double-tapped
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
9b3c8510a1
commit
b4f8773d7b
1 changed files with 9 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue