This commit is contained in:
androiddevkotlin 2021-03-01 15:48:07 +02:00
parent 1985928d60
commit 4c04c7ee19
2 changed files with 5 additions and 4 deletions

View file

@ -139,8 +139,9 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
public boolean onTouch(final View v, MotionEvent event) { public boolean onTouch(final View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) { if (event.getAction() == MotionEvent.ACTION_UP) {
FragmentManager fragmentManager = getFragmentManager(); FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) { SelectFavoriteCategoryBottomSheet dialogFragment = createSelectCategoryDialog();
SelectFavoriteCategoryBottomSheet.showInstance(getChildFragmentManager(), getTargetFragment()); if (fragmentManager != null && dialogFragment != null) {
dialogFragment.showInstance(getChildFragmentManager(), getTargetFragment());
} }
return true; return true;
} }
@ -178,7 +179,7 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
} }
@Nullable @Nullable
protected BottomSheetDialogFragment createSelectCategoryDialog() { protected SelectFavoriteCategoryBottomSheet createSelectCategoryDialog() {
PointEditor editor = getEditor(); PointEditor editor = getEditor();
if (editor != null) { if (editor != null) {
return SelectFavoriteCategoryBottomSheet.createInstance(editor.getFragmentTag()); return SelectFavoriteCategoryBottomSheet.createInstance(editor.getFragmentTag());

View file

@ -194,7 +194,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment implemen
public void onClick(View v) { public void onClick(View v) {
FragmentManager fragmentManager = getFragmentManager(); FragmentManager fragmentManager = getFragmentManager();
SelectFavoriteCategoryBottomSheet dialogFragment = createSelectCategoryDialog(); SelectFavoriteCategoryBottomSheet dialogFragment = createSelectCategoryDialog();
if (fragmentManager != null) { if (fragmentManager != null && dialogFragment != null) {
dialogFragment.showInstance(getChildFragmentManager(), getTargetFragment()); dialogFragment.showInstance(getChildFragmentManager(), getTargetFragment());
} }
} }