<NME> MapDistanceDrawerCommons.java
<BEF> package cgeo.geocaching.maps;

/*
 * Manages the distance views
 *
 * Standard view is: (at the top of the map view)
 * target           distance1
 *                  distance2
 *                  distance3
 *
 * - target is only used when in target navigation (opened via cache/waypoint popup)
 * - distance1, distance2, distance will be filled with straight distance, routed distance,
 *   individual route length (depending on settings and current data)
 * - By tapping on any of the distance fields either straight or routed distance can be supersized.
 *   It gets removed from the three distance fields and displayed in a larger font:
 *
 * target           distance1
    private final TextView distance2InfoView;
    private final TextView distance2View;
    private final TextView routeDistanceView;
    private final TextView distanceSupersizeView;
    private boolean bothViewsNeeded = false;

import cgeo.geocaching.location.Units;
import cgeo.geocaching.maps.routing.RoutingMode;
import cgeo.geocaching.settings.Settings;
        distance2InfoView = root.findViewById(R.id.distance2info);
        distance2View = root.findViewById(R.id.distance2);
        routeDistanceView = root.findViewById(R.id.routeDistance);
        distanceSupersizeView = root.findViewById(R.id.distanceSupersize);

        distance1InfoView.setOnClickListener(v -> swap());
    private static final String STRAIGHT_LINE_SYMBOL = Character.toString((char) 0x007C);
    private static final String WAVY_LINE_SYMBOL = Character.toString((char) 0x2307);

    private final TextView distance1View;
    private final TextView distance1ViewSupersize;
    }

    public void drawDistance(final boolean showBothDistances, final float distance, final float realDistance) {
        bothViewsNeeded = showBothDistances && realDistance != 0.0f && distance != realDistance;
        final int supersize = Settings.getSupersizeDistance() % (bothViewsNeeded ? 3 : 2);

        distanceSupersizeView.setVisibility(supersize > 0 ? View.VISIBLE : View.GONE);
        if (bothViewsNeeded) {
            updateDisplay(supersize == 1, distance1InfoView, STRAIGHT_LINE_SYMBOL, distance1View, Units.getDistanceFromKilometers(distance));
            updateDisplay(supersize == 2, distance2InfoView, WAVY_LINE_SYMBOL, distance2View, Units.getDistanceFromKilometers(realDistance));
        } else {
            updateDisplay(supersize > 0, distance1InfoView, "", distance1View, Units.getDistanceFromKilometers(realDistance != 0.0f && distance != realDistance ? realDistance : distance));
        }
    }

    private void updateDisplay(final boolean showAsSupersize, final TextView infoView, final String info, final TextView distanceView, final String distance) {
        infoView.setVisibility(showAsSupersize || StringUtils.isEmpty(info) ? View.GONE : View.VISIBLE);
        distanceView.setVisibility(showAsSupersize ? View.GONE : View.VISIBLE);
        if (showAsSupersize) {
            distanceSupersizeView.setText(StringUtils.isNotEmpty(info) ? info + " " + distance : distance);
        } else {
            infoView.setText(info);
            distanceView.setText(distance);
        }
    }

    public void drawRouteDistance(final float routeDistance) {
        routeDistanceView.setVisibility(routeDistance != 0.0f ? View.VISIBLE : View.GONE);
        if (routeDistance != 0.0f) {
            routeDistanceView.setText(Units.getDistanceFromKilometers(routeDistance));
        }
    }


        // collect data to be displayed
        if (bothViewsNeeded) {
            if (supersize == 1) {
                superValue = STRAIGHT_LINE_SYMBOL + " " + Units.getDistanceFromKilometers(distance);
                values[current++] = WAVY_LINE_SYMBOL + " " + Units.getDistanceFromKilometers(realDistance);
            } else if (supersize == 2) {
                values[current++] = STRAIGHT_LINE_SYMBOL + " " + Units.getDistanceFromKilometers(distance);
                superValue = WAVY_LINE_SYMBOL + " " + Units.getDistanceFromKilometers(realDistance);
            } else {
                values[current++] = STRAIGHT_LINE_SYMBOL + " " + Units.getDistanceFromKilometers(distance);
                values[current++] = WAVY_LINE_SYMBOL + " " + Units.getDistanceFromKilometers(realDistance);
            }
        } else if (distance != 0.0f) {
            if (supersize > 0) {
                superValue = Units.getDistanceFromKilometers(showRealDistance ? realDistance : distance);
            } else {
                values[current++] = Units.getDistanceFromKilometers(showRealDistance ? realDistance : distance);
            }
        }
        if (routeDistance != 0.0f) {
            values[current] = Units.getDistanceFromKilometers(routeDistance);
        }

        // adjust visibility and fill views
        if (targetView != null) {
            final boolean targetIsSet = StringUtils.isNotBlank(targetView.getText());
            targetView.setVisibility(supersize > 0 || !targetIsSet ? View.GONE : View.VISIBLE);
            targetViewSupersize.setVisibility(supersize > 0 && targetIsSet ? View.VISIBLE : View.GONE);
            targetViewSupersize.setText(targetView.getText());
        }
        if (supersize > 0) {
            distanceSupersizeView.setVisibility(View.VISIBLE);
            distanceSupersizeView.setText(superValue);
            distance1View.setVisibility(View.GONE);
            distance1ViewSupersize.setVisibility(StringUtils.isNotBlank(values[0]) ? View.VISIBLE : View.GONE);
            distance1ViewSupersize.setText(values[0]);
            distance2View.setVisibility(View.GONE);
            distance2ViewSupersize.setVisibility(StringUtils.isNotBlank(values[1]) ? View.VISIBLE : View.GONE);
            distance2ViewSupersize.setText(values[1]);
            distance3View.setVisibility(View.GONE);
        } else {
            distanceSupersizeView.setVisibility(View.GONE);
            distance1View.setVisibility(StringUtils.isNotBlank(values[0]) ? View.VISIBLE : View.GONE);
            distance1View.setText(values[0]);
            distance1ViewSupersize.setVisibility(View.GONE);
            distance2View.setVisibility(StringUtils.isNotBlank(values[1]) ? View.VISIBLE : View.GONE);
            distance2View.setText(values[1]);
            distance2ViewSupersize.setVisibility(View.GONE);
            distance3View.setVisibility(StringUtils.isNotBlank(values[2]) ? View.VISIBLE : View.GONE);
            distance3View.setText(values[2]);
        }
    }

    public void drawRouteDistance(final float routeDistance) {
        this.routeDistance = routeDistance;
        drawDistance(showBothDistances, distance, realDistance);
    }

    private void swap() {
        final int supersize = (Settings.getSupersizeDistance() + 1) % (bothViewsNeeded ? 3 : 2);
        Settings.setSupersizeDistance(supersize);
    }
}

<MSG> Merge branch 'release'

<DFF> @@ -18,6 +18,7 @@ public class MapDistanceDrawerCommons {
     private final TextView distance2InfoView;
     private final TextView distance2View;
     private final TextView routeDistanceView;
+    private final TextView routeDistanceViewSupersize;
     private final TextView distanceSupersizeView;
     private boolean bothViewsNeeded = false;
 
@@ -27,6 +28,7 @@ public class MapDistanceDrawerCommons {
         distance2InfoView = root.findViewById(R.id.distance2info);
         distance2View = root.findViewById(R.id.distance2);
         routeDistanceView = root.findViewById(R.id.routeDistance);
+        routeDistanceViewSupersize = root.findViewById(R.id.routeDistanceSupersize);
         distanceSupersizeView = root.findViewById(R.id.distanceSupersize);
 
         distance1InfoView.setOnClickListener(v -> swap());
@@ -38,33 +40,40 @@ public class MapDistanceDrawerCommons {
     }
 
     public void drawDistance(final boolean showBothDistances, final float distance, final float realDistance) {
-        bothViewsNeeded = showBothDistances && realDistance != 0.0f && distance != realDistance;
+        final boolean showRealDistance = realDistance != 0.0f && distance != realDistance;
+        bothViewsNeeded = showBothDistances && showRealDistance;
         final int supersize = Settings.getSupersizeDistance() % (bothViewsNeeded ? 3 : 2);
 
         distanceSupersizeView.setVisibility(supersize > 0 ? View.VISIBLE : View.GONE);
         if (bothViewsNeeded) {
-            updateDisplay(supersize == 1, distance1InfoView, STRAIGHT_LINE_SYMBOL, distance1View, Units.getDistanceFromKilometers(distance));
-            updateDisplay(supersize == 2, distance2InfoView, WAVY_LINE_SYMBOL, distance2View, Units.getDistanceFromKilometers(realDistance));
+            updateDisplay(supersize == 1, distance1InfoView, STRAIGHT_LINE_SYMBOL, distance1View, distance);
+            updateDisplay(supersize == 2, distance2InfoView, WAVY_LINE_SYMBOL, distance2View, realDistance);
         } else {
-            updateDisplay(supersize > 0, distance1InfoView, "", distance1View, Units.getDistanceFromKilometers(realDistance != 0.0f && distance != realDistance ? realDistance : distance));
+            updateDisplay(supersize > 0, distance1InfoView, "", distance1View, showRealDistance ? realDistance : distance);
         }
     }
 
-    private void updateDisplay(final boolean showAsSupersize, final TextView infoView, final String info, final TextView distanceView, final String distance) {
-        infoView.setVisibility(showAsSupersize || StringUtils.isEmpty(info) ? View.GONE : View.VISIBLE);
-        distanceView.setVisibility(showAsSupersize ? View.GONE : View.VISIBLE);
+    private void updateDisplay(final boolean showAsSupersize, final TextView infoView, final String info, final TextView distanceView, final float distance) {
+        final String distanceString = Units.getDistanceFromKilometers(distance);
+        final boolean zeroDistance = distance == 0.0f;
+
+        infoView.setVisibility(showAsSupersize || zeroDistance || StringUtils.isEmpty(info) ? View.GONE : View.VISIBLE);
+        distanceView.setVisibility(showAsSupersize || zeroDistance ? View.GONE : View.VISIBLE);
         if (showAsSupersize) {
-            distanceSupersizeView.setText(StringUtils.isNotEmpty(info) ? info + " " + distance : distance);
-        } else {
+            distanceSupersizeView.setText(StringUtils.isNotEmpty(info) ? info + " " + distanceString : distanceString);
+        } else if (!zeroDistance) {
             infoView.setText(info);
-            distanceView.setText(distance);
+            distanceView.setText(distanceString);
         }
     }
 
     public void drawRouteDistance(final float routeDistance) {
-        routeDistanceView.setVisibility(routeDistance != 0.0f ? View.VISIBLE : View.GONE);
+        routeDistanceView.setVisibility(View.GONE);
+        routeDistanceViewSupersize.setVisibility(View.GONE);
         if (routeDistance != 0.0f) {
-            routeDistanceView.setText(Units.getDistanceFromKilometers(routeDistance));
+            final TextView view = bothViewsNeeded && Settings.getSupersizeDistance() > 0 ? routeDistanceViewSupersize : routeDistanceView;
+            view.setVisibility(View.VISIBLE);
+            view.setText(Units.getDistanceFromKilometers(routeDistance));
         }
     }
 

Merge branch 'release'