use of net.osmand.plus.track.fragments.TrackMenuFragment in project Osmand by osmandapp.
the class EditTrackGroupDialogFragment method createShowOnMapItem.
private BaseBottomSheetItem createShowOnMapItem(final SelectedGpxFile selectedGpxFile) {
boolean checked = !selectedGpxFile.isGroupHidden(group.getName());
final ApplicationMode mode = app.getSettings().getApplicationMode();
final BottomSheetItemWithCompoundButton[] showOnMapItem = new BottomSheetItemWithCompoundButton[1];
showOnMapItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder().setCompoundButtonColor(mode.getProfileColor(nightMode)).setChecked(checked).setTitle(getString(R.string.shared_string_show_on_map)).setCustomView(getCustomButtonView(app, mode, checked, nightMode)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean checked = !showOnMapItem[0].isChecked();
if (checked) {
selectedGpxFile.removeHiddenGroups(group.getName());
} else {
selectedGpxFile.addHiddenGroups(group.getName());
}
app.getSelectedGpxHelper().updateSelectedGpxFile(selectedGpxFile);
showOnMapItem[0].setChecked(checked);
updateCustomButtonView(app, mode, v, checked, nightMode);
FragmentActivity activity = getActivity();
if (activity instanceof MapActivity) {
((MapActivity) activity).refreshMap();
}
Fragment fragment = getTargetFragment();
if (fragment instanceof TrackMenuFragment) {
((TrackMenuFragment) fragment).updateContent();
}
}
}).create();
return showOnMapItem[0];
}
use of net.osmand.plus.track.fragments.TrackMenuFragment in project Osmand by osmandapp.
the class AddGpxPointBottomSheetHelper method onClose.
private void onClose() {
TrackMenuFragment fragment = mapActivity.getTrackMenuFragment();
if (fragment != null) {
fragment.updateContent();
fragment.show();
} else {
TrackMenuFragment.openTrack(mapActivity, new File(newGpxPoint.getGpx().path), null);
}
}
use of net.osmand.plus.track.fragments.TrackMenuFragment in project Osmand by osmandapp.
the class MapActivity method shouldHideTopControls.
public boolean shouldHideTopControls() {
boolean hideTopControls = !mapContextMenu.shouldShowTopControls();
TrackMenuFragment fragment = getTrackMenuFragment();
if (fragment != null) {
hideTopControls = hideTopControls || !fragment.shouldShowTopControls();
}
return hideTopControls;
}
use of net.osmand.plus.track.fragments.TrackMenuFragment in project Osmand by osmandapp.
the class UpdateGpxCategoryTask method onPostExecute.
@Override
protected void onPostExecute(Void aVoid) {
GPXFile gpxFile = group.getGpx();
if (gpxFile != null && wasUpdated) {
syncGpx(gpxFile);
}
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
FragmentActivity activity = activityRef.get();
if (activity instanceof MapActivity) {
MapActivity mapActivity = (MapActivity) activity;
TrackMenuFragment fragment = mapActivity.getTrackMenuFragment();
if (fragment != null) {
fragment.updateContent();
}
}
}
use of net.osmand.plus.track.fragments.TrackMenuFragment in project Osmand by osmandapp.
the class EditTrackGroupDialogFragment method onPointsDeleted.
@Override
public void onPointsDeleted() {
Fragment fragment = getTargetFragment();
if (fragment instanceof TrackMenuFragment) {
((TrackMenuFragment) fragment).updateContent();
}
dismiss();
}
Aggregations