forked from upstream-mirrors/OpenTracks
In marker detail page, add a label "Since last Statistics Marker".
In the marker detail page, on resume, update the waypoint in case it is returning from marker edit page.
This commit is contained in:
@@ -44,6 +44,10 @@ public class MarkerDetailActivity extends AbstractMyTracksActivity {
|
||||
private long markerId;
|
||||
private Waypoint waypoint;
|
||||
|
||||
private TextView name;
|
||||
private View waypointSection;
|
||||
private View statisticsSection;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
@@ -55,19 +59,21 @@ public class MarkerDetailActivity extends AbstractMyTracksActivity {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
name = (TextView) findViewById(R.id.marker_detail_name);
|
||||
waypointSection = findViewById(R.id.marker_detail_waypoint_section);
|
||||
statisticsSection = findViewById(R.id.marker_detail_statistics_section);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
waypoint = MyTracksProviderUtils.Factory.get(this).getWaypoint(markerId);
|
||||
if (waypoint == null) {
|
||||
Log.d(TAG, "waypoint is null");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
TextView name = (TextView) findViewById(R.id.marker_detail_name);
|
||||
name.setText(getString(R.string.marker_detail_name, waypoint.getName()));
|
||||
View waypointSection = findViewById(R.id.marker_detail_waypoint_section);
|
||||
View statisticsSection = findViewById(R.id.marker_detail_statistics_section);
|
||||
|
||||
if (waypoint.getType() == Waypoint.TYPE_WAYPOINT) {
|
||||
waypointSection.setVisibility(View.VISIBLE);
|
||||
statisticsSection.setVisibility(View.GONE);
|
||||
@@ -83,7 +89,7 @@ public class MarkerDetailActivity extends AbstractMyTracksActivity {
|
||||
StatsUtils.setLocationValues(this, waypoint.getLocation(), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.marker_detail, menu);
|
||||
|
||||
Reference in New Issue
Block a user