Skip to content

Commit

Permalink
Do not hide measurements in Ruler
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynovikov committed Dec 21, 2023
1 parent f89f860 commit 8f6f4d1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/src/main/java/mobi/maptrek/fragments/Ruler.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,9 @@ public void onDestroy() {
}

private void updateTrackMeasurements() {
if (mRoute.length() > 1) {
mMeasurementsView.setVisibility(View.VISIBLE);
mDistanceView.setText(StringFormatter.distanceHP(mRoute.distance));
mSizeView.setText(getResources().getQuantityString(R.plurals.numberOfSegments, mRoute.length() - 1, mRoute.length() - 1));
} else {
mMeasurementsView.setVisibility(View.INVISIBLE);
}
int length = Math.max(mRoute.length() - 1, 0);
mDistanceView.setText(StringFormatter.distanceHP(mRoute.distance));
mSizeView.setText(getResources().getQuantityString(R.plurals.numberOfSegments, length, length));
}

@Override
Expand Down

0 comments on commit 8f6f4d1

Please sign in to comment.