diff --git a/OsmAnd/src/net/osmand/plus/track/TrackAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackAppearanceFragment.java index 4834a43b0e..4f7c1b0150 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackAppearanceFragment.java @@ -174,6 +174,13 @@ public class TrackAppearanceFragment extends ContextMenuScrollFragment implement if (view != null) { trackIcon = view.findViewById(R.id.track_icon); + view.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + openMenuHeaderOnly(); + } + }); + if (isPortrait()) { updateCardsLayout(); } diff --git a/OsmAnd/src/net/osmand/plus/track/TrackColoringCard.java b/OsmAnd/src/net/osmand/plus/track/TrackColoringCard.java index 7d102c44fa..ff21fa3f18 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackColoringCard.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackColoringCard.java @@ -23,6 +23,9 @@ import com.google.android.material.internal.FlowLayout; import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; +import net.osmand.plus.GPXDatabase; +import net.osmand.plus.GPXDatabase.GpxDataItem; +import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; @@ -247,6 +250,9 @@ public class TrackColoringCard extends BaseCard implements ColorPickerListener { private void updateHeader() { AndroidUiHelper.updateVisibility(view.findViewById(R.id.icon), false); + View headerView = view.findViewById(R.id.header_view); + headerView.setBackgroundDrawable(null); + TextView titleView = view.findViewById(R.id.title); titleView.setText(R.string.select_color); @@ -282,9 +288,25 @@ public class TrackColoringCard extends BaseCard implements ColorPickerListener { } } saveCustomColors(); + saveCustomColorsToTracks(prevColor, newColor); updateContent(); } + private void saveCustomColorsToTracks(int prevColor, int newColor) { + List gpxDataItems = app.getGpxDbHelper().getItems(); + for (GPXDatabase.GpxDataItem dataItem : gpxDataItems) { + if (prevColor == dataItem.getColor()) { + app.getGpxDbHelper().updateColor(dataItem, newColor); + } + } + List files = app.getSelectedGpxHelper().getSelectedGPXFiles(); + for (SelectedGpxFile selectedGpxFile : files) { + if (prevColor == selectedGpxFile.getGpxFile().getColor(0)) { + selectedGpxFile.getGpxFile().setColor(newColor); + } + } + } + private void saveCustomColors() { List colorNames = new ArrayList<>(); for (Integer color : customColors) { diff --git a/OsmAnd/src/net/osmand/plus/track/TrackWidthCard.java b/OsmAnd/src/net/osmand/plus/track/TrackWidthCard.java index 7dc668e3d6..81208971bb 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackWidthCard.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackWidthCard.java @@ -99,6 +99,9 @@ public class TrackWidthCard extends BaseCard { private void updateHeader() { AndroidUiHelper.updateVisibility(view.findViewById(R.id.icon), false); + View headerView = view.findViewById(R.id.header_view); + headerView.setBackgroundDrawable(null); + TextView titleView = view.findViewById(R.id.title); titleView.setText(R.string.select_track_width);