Make placeholder info visible when import GPX file.
This commit is contained in:
parent
4ec09c61d3
commit
542d07ec56
|
|
@ -401,6 +401,11 @@ public class MainActivity extends AppCompatActivity implements IOrientationConsu
|
|||
}
|
||||
addMarker(new GeoPoint(loc.getLatitude(), loc.getLongitude(), loc.getAltitude()), isFound);
|
||||
}
|
||||
if (!serviceGps.getListGeoPointTraceur().isEmpty()) {
|
||||
updateDistance(getTextTraceur());
|
||||
} else if (!serviceGps.getListGeoPointDog().isEmpty()) {
|
||||
updateDistance(getTextDog());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -567,8 +572,19 @@ public class MainActivity extends AppCompatActivity implements IOrientationConsu
|
|||
private void updateDistance() {
|
||||
String text = null;
|
||||
if (serviceGps.isTraceurActivated()) {
|
||||
text = String.format("Distance: %,dm\t\t\t\t\t\t\t\tObjets: %d", ((int) distance), serviceGps.getListGeoPointObjects().size());
|
||||
text = getTextTraceur();
|
||||
} else if (serviceGps.isDogActivated()) {
|
||||
text = getTextDog();
|
||||
}
|
||||
updateDistance(text);
|
||||
}
|
||||
|
||||
private String getTextTraceur() {
|
||||
return String.format("Distance: %,dm\t\t\t\t\t\t\t\tObjets: %d", ((int) distance), serviceGps.getListGeoPointObjects().size());
|
||||
}
|
||||
|
||||
private String getTextDog() {
|
||||
String text = "";
|
||||
MyLocation firstLoc = serviceGps.getListGeoPointDog().getFirstLocation();
|
||||
MyLocation lastLoc = serviceGps.getListGeoPointDog().getLastLocation();
|
||||
if (firstLoc != null) {
|
||||
|
|
@ -589,8 +605,10 @@ public class MainActivity extends AppCompatActivity implements IOrientationConsu
|
|||
}
|
||||
text += "\t\t\t\t\t\t\t\tObjets: "+nbFoundObject+"/"+serviceGps.getListGeoPointObjects().size();
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private void updateDistance(String text) {
|
||||
if (text != null) {
|
||||
this.textViewCurrentLocation.setText(text);
|
||||
this.textViewCurrentLocation.setVisibility(View.VISIBLE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue