small refactoring

This commit is contained in:
Nazar-Kutz 2020-10-12 10:33:46 +03:00
parent 6941d45516
commit 3c2bda87ce
3 changed files with 10 additions and 9 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -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;