@Override
    public View onCreateView(@NonNull final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
        final Dialog dialog = requireDialog();
        final boolean noTitle = dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

        final View v = inflater.inflate(R.layout.coordinates_input_dialog, container, false);
        binding = CoordinatesInputDialogBinding.bind(v);

        // change input lines border color depending on "any child has focus" state
        binding.input.latLonFrame.getViewTreeObserver().addOnGlobalFocusChangeListener((oldFocus, newFocus) -> binding.input.latLonFrame.setBackgroundResource(binding.input.latLonFrame.findFocus() != null ? R.drawable.textinputlayout_bcg_active : R.drawable.textinputlayout_bcg_default));

        if (!noTitle) {
            dialog.setTitle(R.string.cache_coordinates);
        } else {
            final Toolbar toolbar = binding.actionbar.toolbar;
            toolbar.setTitle(R.string.cache_coordinates);
            toolbar.inflateMenu(R.menu.menu_ok_cancel);
            toolbar.setOnMenuItemClickListener(item -> {
                if (item.getItemId() == R.id.menu_item_save) {
                    saveAndFinishDialog();
                } else {
                    dismiss();
                }
                return true;
            });
        }

        final Spinner spinner = binding.input.spinnerCoordinateFormats;
        final ArrayAdapter<CharSequence> adapter =
                ArrayAdapter.createFromResource(requireActivity(),
                        R.array.waypoint_coordinate_formats,
                        android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
        spinner.setSelection(Settings.getCoordInputFormat().ordinal());
        spinner.setOnItemSelectedListener(new CoordinateFormatListener());

        eLatFrame = binding.input.latitudeFrame;
        bLat = binding.input.latitudeBundle.hemisphere;
        eLat = binding.input.latitude;
        eLatDeg = binding.input.latitudeBundle.EditTextLatDeg;
        eLatMin = binding.input.latitudeBundle.EditTextLatMin;
        eLatSec = binding.input.latitudeBundle.EditTextLatSec;
        eLatSub = binding.input.latitudeBundle.EditTextLatSecFrac;
        tLatSep1 = binding.input.latitudeBundle.LatSeparator1;
        tLatSep2 = binding.input.latitudeBundle.LatSeparator2;
        tLatSep3 = binding.input.latitudeBundle.LatSeparator3;

        eLonFrame = binding.input.longitudeFrame;
        bLon = binding.input.longitudeBundle.hemisphere;
        eLon = binding.input.longitude;
        eLonDeg = binding.input.longitudeBundle.EditTextLatDeg;
        eLonMin = binding.input.longitudeBundle.EditTextLatMin;
        eLonSec = binding.input.longitudeBundle.EditTextLatSec;
        eLonSub = binding.input.longitudeBundle.EditTextLatSecFrac;
        tLonSep1 = binding.input.longitudeBundle.LatSeparator1;
        tLonSep2 = binding.input.longitudeBundle.LatSeparator2;
        tLonSep3 = binding.input.longitudeBundle.LatSeparator3;

        orderedInputs = Arrays.asList(eLatDeg, eLatMin, eLatSec, eLatSub, eLonDeg, eLonMin, eLonSec, eLonSub);

        for (final EditText editText : orderedInputs) {
            editText.addTextChangedListener(new SwitchToNextFieldWatcher(editText));
            editText.setOnFocusChangeListener(new PadZerosOnFocusLostListener());
            EditUtils.disableSuggestions(editText);
        }

        bLat.setOnClickListener(new ButtonClickListener());
        bLon.setOnClickListener(new ButtonClickListener());

        binding.current.setOnClickListener(new CurrentListener());

        if (cacheCoords != null) {
            binding.cache.setOnClickListener(new CacheListener());
        } else {
            binding.cache.setVisibility(View.GONE);
        }

        if (inputData.getGeocode() != null && ((CoordinateUpdate) requireActivity()).supportsCalculatedCoordinates()) {
            binding.calculateGlobal.setVisibility(View.VISIBLE);
            binding.calculateGlobal.setOnClickListener(vv -> {
                inputData.setGeopoint(gp);
                final CalculatedCoordinate cc = new CalculatedCoordinate();
                cc.setType(
                        CalculatedCoordinateType.values()[binding.input.spinnerCoordinateFormats.getSelectedItemPosition()]);

                //try to set patterns from GUI
                final Pair<String, String> patternsFromGui = getLatLonPatternFromGui();
                cc.setLatitudePattern(patternsFromGui.first);
                cc.setLongitudePattern(patternsFromGui.second);

                inputData.setCalculatedCoordinate(cc);
                CoordinatesCalculateGlobalDialog.show(myContext.getSupportFragmentManager(), inputData);
                dismiss();
            });
        }

        if (supportsNullCoordinates()) {
            binding.clear.setOnClickListener(new ClearCoordinatesListener());
            binding.clear.setVisibility(View.VISIBLE);
        }

        if (hasClipboardCoordinates()) {
            binding.clipboard.setOnClickListener(new ClipboardListener());
            binding.clipboard.setVisibility(View.VISIBLE);
        }

        if (noTitle) {
            binding.done.setVisibility(View.GONE);
        } else {
            binding.done.setOnClickListener(view -> saveAndFinishDialog());
        }

        return binding.getRoot();
    }
Provides a dialog to enter coordinates in different formats.
Usage:
1. open the coordinate selection dialog: call CoordinatesInputDialog.show(getSupportFragmentManager(), null, null);
2. in your activity implement CoordinatesInputDialog.CoordinateUpdate, closing the dialog calls public void updateCoordinates(@NonNull final Geopoint gp)
main/src/main/java/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java