fix "selected graph changed after recalculation"
This commit is contained in:
parent
f158381f5f
commit
c75aa594ea
1 changed files with 15 additions and 9 deletions
|
@ -101,6 +101,15 @@ public class MtGraphFragment extends BaseCard
|
|||
return R.layout.fragment_measurement_tool_graph;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateAdditionalInfo() {
|
||||
if (!isRouteCalculating()) {
|
||||
updateGraphData();
|
||||
refreshGraphTypesSelectionMenu();
|
||||
}
|
||||
updateDataView();
|
||||
}
|
||||
|
||||
private void refreshGraphTypesSelectionMenu() {
|
||||
rvGraphTypesMenu.removeAllViews();
|
||||
OsmandApplication app = getMyApplication();
|
||||
|
@ -112,7 +121,7 @@ public class MtGraphFragment extends BaseCard
|
|||
if (type.isCustom()) {
|
||||
item.setTitleColorId(activeColorId);
|
||||
}
|
||||
if (type.hasData() || type.canBeCalculated) {
|
||||
if (type.isAvailable()) {
|
||||
items.add(item);
|
||||
}
|
||||
}
|
||||
|
@ -134,13 +143,6 @@ public class MtGraphFragment extends BaseCard
|
|||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateAdditionalInfo() {
|
||||
updateGraphData();
|
||||
refreshGraphTypesSelectionMenu();
|
||||
updateDataView();
|
||||
}
|
||||
|
||||
private void setupVisibleGraphType(GraphType type) {
|
||||
visibleGraphType = type;
|
||||
updateDataView();
|
||||
|
@ -163,7 +165,7 @@ public class MtGraphFragment extends BaseCard
|
|||
}
|
||||
|
||||
private void updateDataView() {
|
||||
if (mtf.isProgressBarVisible()) {
|
||||
if (isRouteCalculating()) {
|
||||
showProgressMessage();
|
||||
} else if (visibleGraphType.hasData()) {
|
||||
showGraph();
|
||||
|
@ -358,6 +360,10 @@ public class MtGraphFragment extends BaseCard
|
|||
defaultRender, currentSearchRequest, defaultSearchRequest);
|
||||
}
|
||||
|
||||
private boolean isRouteCalculating() {
|
||||
return mtf.isProgressBarVisible();
|
||||
}
|
||||
|
||||
private static class GraphType {
|
||||
private String title;
|
||||
private boolean isCustom;
|
||||
|
|
Loading…
Reference in a new issue