private void reconfigureGui() {
        // Force a refresh of location and direction when data is available.
        final LocationDataProvider locationDataProvider = LocationDataProvider.getInstance();

        // reset the visibility of the compass toggle button if the device does not support it.
        if (locationDataProvider.hasCompassCapabilities()) {
            binding.useCompass.setChecked(Settings.isUseCompass());
            binding.useCompass.setOnClickListener(view -> {
                Settings.setUseCompass(((ToggleButton) view).isChecked());
                findViewById(R.id.device_orientation_mode).setVisibility(locationDataProvider.hasCompassCapabilities() && binding.useCompass.isChecked() ? View.VISIBLE : View.GONE);
            });
        } else {
            binding.useCompass.setVisibility(View.GONE);
        }
        deviceOrientationMode.setTextView(findViewById(R.id.device_orientation_mode)).set(Settings.getDeviceOrientationMode());
        findViewById(R.id.device_orientation_mode).setVisibility(locationDataProvider.hasCompassCapabilities() && binding.useCompass.isChecked() ? View.VISIBLE : View.GONE);
    }
refresh GUI elements which can be changed e.g. after a new configuration was issued (e.g. turning from portrait into landscape and vice versa
main/src/main/java/cgeo/geocaching/CompassActivity.java