Merge branch 'gpx_improvements' into sasha_pasha_branch

This commit is contained in:
PavelRatushny 2017-08-08 12:20:11 +03:00
commit a796efc5c3

View file

@ -139,6 +139,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
private RotatedTileBox rotatedTileBox;
private Bitmap mapBitmap;
private Bitmap mapTrackBitmap;
private boolean chartClicked;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@ -1073,6 +1074,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
@Override
public Object instantiateItem(ViewGroup container, int position) {
chartClicked = false;
GPXTabItemType tabType = tabTypes[position];
View view = null;
switch (tabType) {
@ -1091,6 +1093,13 @@ public class TrackSegmentFragment extends OsmAndListFragment {
if (gpxItem != null) {
GPXTrackAnalysis analysis = gpxItem.analysis;
final LineChart chart = (LineChart) view.findViewById(R.id.chart);
chart.setHighlightPerDragEnabled(false);
chart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!chartClicked) {
chartClicked = true;
chart.setHighlightPerDragEnabled(true);
chart.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
@ -1190,6 +1199,9 @@ public class TrackSegmentFragment extends OsmAndListFragment {
}
}
});
}
}
});
IconsCache ic = app.getIconsCache();
switch (tabType) {