Merge branch 'split_interval_screen' of ssh://github.com/osmandapp/Osmand into split_interval_screen

This commit is contained in:
PavelRatushny 2017-07-10 12:54:59 +03:00
commit 0c7bbdd259
5 changed files with 16 additions and 8 deletions

View file

@ -309,7 +309,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:background="@null" android:background="@null"
android:text="@string/range" android:text="@string/range_min_max"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/default_split_segments_sub" /> android:textSize="@dimen/default_split_segments_sub" />

View file

@ -275,7 +275,7 @@ public class GPXUtilities {
public double minElevation = 99999; public double minElevation = 99999;
public double maxElevation = -100; public double maxElevation = -100;
public float minSpeed = 0; public float minSpeed = Float.MAX_VALUE;
public float maxSpeed = 0; public float maxSpeed = 0;
public float avgSpeed; public float avgSpeed;
@ -521,11 +521,8 @@ public class GPXUtilities {
if (speed > 0) { if (speed > 0) {
totalSpeedSum += speed; totalSpeedSum += speed;
if (minSpeed == 0) { // android.util.Log.d(GPXUtilities.class.getSimpleName(), "metricEnd: " + s.metricEnd + " speed: " + speed);
minSpeed = speed;
} else {
minSpeed = Math.min(speed, minSpeed); minSpeed = Math.min(speed, minSpeed);
}
maxSpeed = Math.max(speed, maxSpeed); maxSpeed = Math.max(speed, maxSpeed);
speedCount++; speedCount++;
} }

View file

@ -48,6 +48,10 @@ public class TrackActivity extends TabActivity {
private List<GpxDisplayGroup> originalGroups = new ArrayList<>(); private List<GpxDisplayGroup> originalGroups = new ArrayList<>();
private boolean stopped = false; private boolean stopped = false;
public PagerSlidingTabStrip getSlidingTabLayout() {
return slidingTabLayout;
}
@Override @Override
public void onCreate(Bundle icicle) { public void onCreate(Bundle icicle) {
((OsmandApplication) getApplication()).applyTheme(this); ((OsmandApplication) getApplication()).applyTheme(this);
@ -234,6 +238,9 @@ public class TrackActivity extends TabActivity {
((TrackSegmentFragment) frag).updateSplitView(); ((TrackSegmentFragment) frag).updateSplitView();
} }
} }
if (isHavingWayPoints() || isHavingRoutePoints()) {
getSlidingTabLayout().setVisibility(View.VISIBLE);
}
getSupportFragmentManager().popBackStack(); getSupportFragmentManager().popBackStack();
return true; return true;
} }
@ -264,6 +271,9 @@ public class TrackActivity extends TabActivity {
((TrackSegmentFragment) frag).updateSplitView(); ((TrackSegmentFragment) frag).updateSplitView();
} }
} }
if (isHavingWayPoints() || isHavingRoutePoints()) {
getSlidingTabLayout().setVisibility(View.VISIBLE);
}
getSupportFragmentManager().popBackStack(); getSupportFragmentManager().popBackStack();
return; return;
} }

View file

@ -544,7 +544,7 @@ public class SplitSegmentFragment extends OsmAndListFragment {
String maxSpeed = OsmAndFormatter.getFormattedSpeed(analysis.maxSpeed, app); String maxSpeed = OsmAndFormatter.getFormattedSpeed(analysis.maxSpeed, app);
String minSpeed = OsmAndFormatter.getFormattedSpeed(analysis.minSpeed, app); String minSpeed = OsmAndFormatter.getFormattedSpeed(analysis.minSpeed, app);
String max_min_speed = maxSpeed.substring(0, maxSpeed.indexOf(" ")).concat("/").concat(minSpeed.substring(0, minSpeed.indexOf(" "))); String max_min_speed = maxSpeed.substring(0, maxSpeed.indexOf(" ")).concat("/").concat(minSpeed);
if (minSpeed.substring(0, minSpeed.indexOf(" ")).equals("0") || minSpeed.substring(0, minSpeed.indexOf(" ")).equals("0.0")) { if (minSpeed.substring(0, minSpeed.indexOf(" ")).equals("0") || minSpeed.substring(0, minSpeed.indexOf(" ")).equals("0.0")) {
(convertView.findViewById(R.id.max_speed_value)) (convertView.findViewById(R.id.max_speed_value))
.setVisibility(View.VISIBLE); .setVisibility(View.VISIBLE);

View file

@ -1472,6 +1472,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
} }
void openSplitIntervalScreen() { void openSplitIntervalScreen() {
getMyActivity().getSlidingTabLayout().setVisibility(View.GONE);
getMyActivity().getSupportFragmentManager() getMyActivity().getSupportFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.track_activity_layout, new SplitSegmentFragment()) .replace(R.id.track_activity_layout, new SplitSegmentFragment())