small fixes
This commit is contained in:
parent
07280935c0
commit
82fa75db1d
2 changed files with 10 additions and 16 deletions
|
@ -329,7 +329,14 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl
|
|||
}
|
||||
});
|
||||
|
||||
graphsAdapter = new GPXItemPagerAdapter(app, null, null, nightMode, this, true);
|
||||
TrackDisplayHelper displayHelper = new TrackDisplayHelper(app);
|
||||
GPXFile gpxFile = getGPXFile();
|
||||
File file = new File(gpxFile.path);
|
||||
displayHelper.setFile(file);
|
||||
displayHelper.setGpxDataItem(app.getGpxDbHelper().getItem(file));
|
||||
displayHelper.setGpx(gpxFile);
|
||||
|
||||
graphsAdapter = new GPXItemPagerAdapter(app, null, displayHelper, nightMode, this, true);
|
||||
graphsAdapter.setChartHMargin(getResources().getDimensionPixelSize(R.dimen.content_padding));
|
||||
|
||||
pager.setAdapter(graphsAdapter);
|
||||
|
|
|
@ -102,32 +102,19 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
|
|||
|
||||
public GPXItemPagerAdapter(@NonNull OsmandApplication app,
|
||||
@Nullable GpxDisplayItem gpxItem,
|
||||
@Nullable TrackDisplayHelper displayHelper,
|
||||
@NonNull TrackDisplayHelper displayHelper,
|
||||
boolean nightMode,
|
||||
@NonNull SegmentActionsListener actionsListener,
|
||||
boolean onlyGraphs) {
|
||||
super();
|
||||
this.app = app;
|
||||
this.gpxItem = gpxItem;
|
||||
this.displayHelper = displayHelper;
|
||||
this.nightMode = nightMode;
|
||||
this.actionsListener = actionsListener;
|
||||
this.onlyGraphs = onlyGraphs;
|
||||
iconsCache = app.getUIUtilities();
|
||||
|
||||
if (displayHelper == null) {
|
||||
this.displayHelper = new TrackDisplayHelper(app);
|
||||
SelectedGpxFile currentTrack = app.getSavingTrackHelper().getCurrentTrack();
|
||||
GPXFile gpxFile = currentTrack.getGpxFile();
|
||||
if (currentTrack.isShowCurrentTrack()) {
|
||||
File file = new File(gpxFile.path);
|
||||
this.displayHelper.setFile(file);
|
||||
this.displayHelper.setGpxDataItem(app.getGpxDbHelper().getItem(file));
|
||||
}
|
||||
this.displayHelper.setGpx(gpxFile);
|
||||
} else {
|
||||
this.displayHelper = displayHelper;
|
||||
}
|
||||
|
||||
updateAnalysis();
|
||||
fetchTabTypes();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue