From 3c2bda87ce9ef0ee60a4a24dadb5aec5b9830d24 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Mon, 12 Oct 2020 10:33:46 +0300 Subject: [PATCH] small refactoring --- .../measurementtool/MeasurementToolFragment.java | 15 ++++++++++----- .../plus/measurementtool/MtGraphFragment.java | 2 -- .../plus/measurementtool/MtPointsFragment.java | 2 -- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index d5c21d8c07..a927ca884e 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -157,14 +157,18 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route } private enum AdditionalInfoType { - POINTS(MtPointsFragment.TAG), - GRAPH(MtGraphFragment.TAG); + POINTS(MtPointsFragment.class.getName()), + GRAPH(MtGraphFragment.class.getName()); AdditionalInfoType(String fragmentName) { this.fragmentName = fragmentName; } - String fragmentName; + final String fragmentName; + + public String getFragmentName() { + return fragmentName; + } } private void setEditingCtx(MeasurementEditingContext editingCtx) { @@ -237,6 +241,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route public void hideProgressBar() { ((ProgressBar) mainView.findViewById(R.id.snap_to_road_progress_bar)).setVisibility(View.GONE); progressBarVisible = false; + updateAdditionalInfoView(); } @Override @@ -526,7 +531,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route } else { return; } - setAdditionalInfoFragment(type.fragmentName); + setAdditionalInfoFragment(type.getFragmentName()); } } @@ -1513,7 +1518,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route for (AdditionalInfoType type : AdditionalInfoType.values()) { try { FragmentManager fm = getChildFragmentManager(); - Fragment fragment = fm.findFragmentByTag(type.fragmentName); + Fragment fragment = fm.findFragmentByTag(type.getFragmentName()); if (fragment != null) { return fragment; } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MtGraphFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MtGraphFragment.java index 7b35b6dce1..72cc761c84 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MtGraphFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MtGraphFragment.java @@ -48,8 +48,6 @@ import java.util.Map; public class MtGraphFragment extends Fragment implements MeasurementToolFragment.OnUpdateAdditionalInfoListener { - public static final String TAG = MtGraphFragment.class.getName(); - private static String GRAPH_DATA_GPX_FILE_NAME = "graph_data_tmp"; private View commonGraphContainer; diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MtPointsFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MtPointsFragment.java index 9ee46b3648..086ab6c322 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MtPointsFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MtPointsFragment.java @@ -21,8 +21,6 @@ import net.osmand.plus.views.controls.ReorderItemTouchHelperCallback; public class MtPointsFragment extends Fragment implements MeasurementToolFragment.OnUpdateAdditionalInfoListener { - public static final String TAG = MtPointsFragment.class.getName(); - private boolean nightMode; private MeasurementToolAdapter adapter; private MeasurementEditingContext editingCtx;