From f75a8f8b58a7831d2c14eddd34466b3966761e09 Mon Sep 17 00:00:00 2001 From: cepprice Date: Tue, 23 Feb 2021 13:45:16 +0500 Subject: [PATCH] =?UTF-8?q?Easy=20repla=D1=81ement=20of=20color=20from=20@?= =?UTF-8?q?ColorRes=20to=20@ColorInt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/osmand/plus/OsmAndLocationSimulation.java | 2 +- OsmAnd/src/net/osmand/plus/UiUtilities.java | 2 +- .../osmand/plus/activities/MapActivityLayers.java | 2 +- .../plus/activities/actions/AppModeDialog.java | 14 +++++++------- .../plus/activities/actions/StartGPSStatus.java | 2 +- .../net/osmand/plus/dialogs/ConfigureMapMenu.java | 7 +++---- .../plus/mapillary/MapillaryFiltersFragment.java | 11 +++++------ .../plus/mapsource/InputZoomLevelsBottomSheet.java | 3 +-- .../measurementtool/MeasurementToolFragment.java | 2 +- .../osmand/plus/measurementtool/ProfileCard.java | 2 +- ...outeBetweenPointsBottomSheetDialogFragment.java | 2 +- .../SnapToRoadBottomSheetDialogFragment.java | 2 +- .../plus/monitoring/OsmandMonitoringPlugin.java | 2 +- .../plus/monitoring/TripRecordingBottomSheet.java | 3 +-- .../plus/onlinerouting/ui/OnlineRoutingCard.java | 2 +- .../src/net/osmand/plus/osmedit/OsmNotesMenu.java | 2 +- .../plus/poi/RearrangePoiFiltersFragment.java | 5 ++--- .../profiles/SelectCopyProfilesMenuAdapter.java | 5 ++--- .../plus/profiles/SelectProfileMenuAdapter.java | 5 ++--- .../plus/quickaction/QuickActionListFragment.java | 3 +-- .../plus/rastermaps/OsmandRasterMapsPlugin.java | 2 +- .../routepreparationmenu/RoutingOptionsHelper.java | 4 ++-- .../ShowAlongTheRouteBottomSheet.java | 4 ++-- .../plus/settings/backend/ApplicationMode.java | 9 +++++++++ .../bottomsheets/AnnouncementTimeBottomSheet.java | 2 +- .../RecalculateRouteInDeviationBottomSheet.java | 3 +-- .../bottomsheets/ResetProfilePrefsBottomSheet.java | 3 +-- .../settings/bottomsheets/WakeTimeBottomSheet.java | 3 +-- .../settings/fragments/GlobalSettingsFragment.java | 3 +-- .../settings/fragments/MainSettingsFragment.java | 5 ++--- .../fragments/RouteParametersFragment.java | 2 +- .../fragments/VehicleParametersFragment.java | 2 +- .../src/net/osmand/plus/srtmplugin/SRTMPlugin.java | 2 +- .../osmand/plus/srtmplugin/TerrainFragment.java | 6 ++---- .../osmand/plus/transport/TransportLinesMenu.java | 7 +++---- .../osmand/plus/views/layers/MapControlsLayer.java | 3 +-- .../plus/views/mapwidgets/MapWidgetRegistry.java | 5 ++--- 37 files changed, 67 insertions(+), 76 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java index 0b2683fcc6..2dbd4f6dd9 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java @@ -59,7 +59,7 @@ public class OsmAndLocationSimulation { boolean nightMode = app.getDaynightHelper().isNightModeForMapControls(); int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme; ApplicationMode appMode = app.getSettings().getApplicationMode(); - int selectedModeColor = ContextCompat.getColor(app, appMode.getIconColorInfo().getColor(nightMode)); + int selectedModeColor = appMode.getProfileColor(nightMode); AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(ma, themeRes)); builder.setTitle(R.string.animate_route); diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index aaa9d01f8b..269800c630 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -553,7 +553,7 @@ public class UiUtilities { switch (type) { case PROFILE_DEPENDENT: ApplicationMode appMode = app.getSettings().getApplicationMode(); - activeColor = ContextCompat.getColor(app, appMode.getIconColorInfo().getColor(nightMode)); + activeColor = appMode.getProfileColor(nightMode); break; case TOOLBAR: activeColor = Color.WHITE; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 442e2f41a1..ce2f1f95bf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -490,7 +490,7 @@ public class MapActivityLayers { OsmandApplication app = getApplication(); boolean nightMode = isNightMode(app); int themeRes = getThemeRes(app); - int selectedModeColor = ContextCompat.getColor(app, settings.getApplicationMode().getIconColorInfo().getColor(nightMode)); + int selectedModeColor = settings.getApplicationMode().getProfileColor(nightMode); DialogListItemAdapter dialogAdapter = DialogListItemAdapter.createSingleChoiceAdapter( items, nightMode, selectedItem, app, selectedModeColor, themeRes, new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java index 44222d5586..639bed2bdf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java @@ -120,13 +120,13 @@ public class AppModeDialog { final View selection = tb.findViewById(R.id.selection); ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon); if (checked) { - iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode))); + iv.setImageDrawable(ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode))); iv.setContentDescription(String.format("%s %s", mode.toHumanString(), ctx.getString(R.string.item_checked))); - selection.setBackgroundResource(mode.getIconColorInfo().getColor(nightMode)); + selection.setBackgroundColor(mode.getProfileColor(nightMode)); selection.setVisibility(View.VISIBLE); } else { if (useMapTheme) { - iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode))); + iv.setImageDrawable(ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode))); iv.setBackgroundResource(AndroidUtils.resolveAttribute(themedCtx, android.R.attr.selectableItemBackground)); } else { iv.setImageDrawable(ctx.getUIUtilities().getThemedIcon(mode.getIconRes())); @@ -171,7 +171,7 @@ public class AppModeDialog { final boolean checked = selected.contains(mode); ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon); ImageView selection = tb.findViewById(R.id.selection); - Drawable drawable = ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)); + Drawable drawable = ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode)); if (checked) { iv.setImageDrawable(drawable); iv.setContentDescription(String.format("%s %s", mode.toHumanString(), ctx.getString(R.string.item_checked))); @@ -184,7 +184,7 @@ public class AppModeDialog { } else { if (useMapTheme) { if (Build.VERSION.SDK_INT >= 21) { - Drawable active = ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)); + Drawable active = ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode)); drawable = AndroidUtils.createPressedStateListDrawable(drawable, active); } iv.setImageDrawable(drawable); @@ -195,7 +195,7 @@ public class AppModeDialog { AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.btn_border_pressed_trans_light, R.drawable.btn_border_pressed_trans_light); } } else { - iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode))); + iv.setImageDrawable(ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode))); } iv.setContentDescription(String.format("%s %s", mode.toHumanString(), ctx.getString(R.string.item_unchecked))); } @@ -232,7 +232,7 @@ public class AppModeDialog { int metricsY = (int) ctx.getResources().getDimension(R.dimen.route_info_modes_height); View tb = layoutInflater.inflate(layoutId, null); ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon); - iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(isNightMode(ctx, useMapTheme)))); + iv.setImageDrawable(ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(isNightMode(ctx, useMapTheme)))); iv.setContentDescription(mode.toHumanString()); // tb.setCompoundDrawablesWithIntrinsicBounds(null, ctx.getIconsCache().getIcon(mode.getIconId(), R.color.app_mode_icon_color), null, null); LayoutParams lp = new LinearLayout.LayoutParams(metricsX, metricsY); diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java b/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java index c8c9a70785..4728c0bce3 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java @@ -121,7 +121,7 @@ public class StartGPSStatus extends OsmAndAction { cb.setLayoutParams(lp); cb.setPadding(dp8, 0, 0, 0); int textColorPrimary = ContextCompat.getColor(activity, isNightMode() ? R.color.text_color_primary_dark : R.color.text_color_primary_light); - int selectedModeColor = ContextCompat.getColor(activity, getSettings().getApplicationMode().getIconColorInfo().getColor(isNightMode())); + int selectedModeColor = getSettings().getApplicationMode().getProfileColor(isNightMode()); cb.setTextColor(textColorPrimary); UiUtilities.setupCompoundButton(isNightMode(), selectedModeColor, cb); diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 5b8f38d2b9..1ae5e49e43 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -172,7 +172,7 @@ public class ConfigureMapMenu { final MapActivity activity, final int themeRes, final boolean nightMode) { final OsmandApplication app = activity.getMyApplication(); final OsmandSettings settings = app.getSettings(); - final int selectedProfileColorRes = settings.getApplicationMode().getIconColorInfo().getColor(nightMode); + final int selectedProfileColor = settings.getApplicationMode().getProfileColor(nightMode); MapLayerMenuListener l = new MapLayerMenuListener(activity, adapter); adapter.addItem(new ContextMenuItem.ItemBuilder() .setId(SHOW_CATEGORY_ID) @@ -217,7 +217,7 @@ public class ConfigureMapMenu { .setIcon(R.drawable.ic_action_transport_bus) .setSecondaryIcon(R.drawable.ic_action_additional_option) .setSelected(selected) - .setColor(selected ? selectedProfileColorRes : ContextMenuItem.INVALID_ID) + .setColor(selected ? selectedProfileColor : ContextMenuItem.INVALID_ID) .setListener(l).createItem()); selected = app.getSelectedGpxHelper().isShowingAnyGpxFiles(); @@ -267,8 +267,7 @@ public class ConfigureMapMenu { final int themeRes, final boolean nightMode) { final OsmandApplication app = activity.getMyApplication(); final OsmandSettings settings = app.getSettings(); - final int selectedProfileColorRes = settings.APPLICATION_MODE.get().getIconColorInfo().getColor(nightMode); - final int selectedProfileColor = ContextCompat.getColor(app, selectedProfileColorRes); + final int selectedProfileColor = settings.APPLICATION_MODE.get().getProfileColor(nightMode); adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_widget_map_rendering, activity) .setId(MAP_RENDERING_CATEGORY_ID) diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java index 6b03cd3a6a..3cf0398d87 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryFiltersFragment.java @@ -61,8 +61,7 @@ public class MapillaryFiltersFragment extends BaseOsmAndFragment { final int backgroundColor = ContextCompat.getColor(getActivity(), nightMode ? R.color.activity_background_color_dark : R.color.activity_background_color_light); final DateFormat dateFormat = SimpleDateFormat.getDateInstance(DateFormat.MEDIUM); - final int currentModeColorRes = getMyApplication().getSettings().getApplicationMode().getIconColorInfo().getColor(nightMode); - final int currentModeColor = ContextCompat.getColor(getActivity(), currentModeColorRes); + final int currentModeColor = getMyApplication().getSettings().getApplicationMode().getProfileColor(nightMode); final View view = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_mapillary_filters, null); view.findViewById(R.id.mapillary_filters_linear_layout).setBackgroundColor(backgroundColor); @@ -71,17 +70,17 @@ public class MapillaryFiltersFragment extends BaseOsmAndFragment { final View toggleRow = view.findViewById(R.id.toggle_row); final boolean selected = settings.SHOW_MAPILLARY.get(); final int toggleActionStringId = selected ? R.string.shared_string_on : R.string.shared_string_off; - int toggleIconColorId; + int toggleIconColor; int toggleIconId; if (selected) { toggleIconId = R.drawable.ic_action_view; - toggleIconColorId = currentModeColorRes; + toggleIconColor = currentModeColor; } else { toggleIconId = R.drawable.ic_action_hide; - toggleIconColorId = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light; + toggleIconColor = ContextCompat.getColor(getContext(), nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light); } ((AppCompatTextView) toggleRow.findViewById(R.id.toggle_row_title)).setText(toggleActionStringId); - final Drawable drawable = getIcon(toggleIconId, toggleIconColorId); + final Drawable drawable = getPaintedContentIcon(toggleIconId, toggleIconColor); ((AppCompatImageView) toggleRow.findViewById(R.id.toggle_row_icon)).setImageDrawable(drawable); final CompoundButton toggle = (CompoundButton) toggleRow.findViewById(R.id.toggle_row_toggle); toggle.setOnCheckedChangeListener(null); diff --git a/OsmAnd/src/net/osmand/plus/mapsource/InputZoomLevelsBottomSheet.java b/OsmAnd/src/net/osmand/plus/mapsource/InputZoomLevelsBottomSheet.java index fcf881c0eb..2d883e223c 100644 --- a/OsmAnd/src/net/osmand/plus/mapsource/InputZoomLevelsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/mapsource/InputZoomLevelsBottomSheet.java @@ -99,8 +99,7 @@ public class InputZoomLevelsBottomSheet extends MenuBottomSheetDialogFragment { final TextView maxZoomValue = sliderView.findViewById(R.id.zoom_value_max); maxZoomValue.setText(String.valueOf(maxZoom)); RangeSlider slider = sliderView.findViewById(R.id.zoom_slider); - int colorProfileRes = app.getSettings().getApplicationMode().getIconColorInfo().getColor(nightMode); - int colorProfile = ContextCompat.getColor(app, colorProfileRes); + int colorProfile = app.getSettings().getApplicationMode().getProfileColor(nightMode); UiUtilities.setupSlider(slider, nightMode, colorProfile, true); slider.setValueFrom(SLIDER_FROM); slider.setValueTo(SLIDER_TO); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index cc17d2ac9f..b78434dab9 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -1338,7 +1338,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route snapToRoadBtn.setVisibility(View.VISIBLE); profileWithConfig.setVisibility(View.GONE); } else { - icon = getIcon(appMode.getIconRes(), appMode.getIconColorInfo().getColor(nightMode)); + icon = getPaintedContentIcon(appMode.getIconRes(), appMode.getProfileColor(nightMode)); snapToRoadBtn.setVisibility(View.GONE); profileWithConfig.setVisibility(View.VISIBLE); } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/ProfileCard.java b/OsmAnd/src/net/osmand/plus/measurementtool/ProfileCard.java index 8fc3be3037..179ad54645 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/ProfileCard.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/ProfileCard.java @@ -49,7 +49,7 @@ public class ProfileCard extends BaseCard { for (int i = 0; i < modes.size(); i++) { ApplicationMode mode = modes.get(i); LinearLayout container = view.findViewById(R.id.content_container); - Drawable icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)); + Drawable icon = app.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode)); String title = mode.toHumanString(); View.OnClickListener onClickListener = new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java index 54bc3469be..12eff78327 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java @@ -117,7 +117,7 @@ public class RouteBetweenPointsBottomSheetDialogFragment extends BottomSheetBeha for (int i = 0; i < modes.size(); i++) { ApplicationMode mode = modes.get(i); if (!"public_transport".equals(mode.getRoutingProfile())) { - icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)); + icon = app.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode)); addProfileView(navigationType, onClickListener, i, icon, mode.toHumanString(), mode.equals(appMode)); } } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/SnapToRoadBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/SnapToRoadBottomSheetDialogFragment.java index 35f3bc47cd..082633a854 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/SnapToRoadBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/SnapToRoadBottomSheetDialogFragment.java @@ -106,7 +106,7 @@ public class SnapToRoadBottomSheetDialogFragment extends BottomSheetDialogFragme for (int i = 0; i < modes.size(); i++) { ApplicationMode mode = modes.get(i); - Drawable icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)); + Drawable icon = app.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(nightMode)); addProfileView(container, onClickListener, i, icon, mode.toHumanString()); } diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index 42bae2ab62..b5e557816d 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -544,7 +544,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin { ApplicationMode appMode = app.getSettings().getApplicationMode(); int textColorPrimary = ContextCompat.getColor(app, nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light); int textColorSecondary = ContextCompat.getColor(app, nightMode ? R.color.text_color_secondary_dark : R.color.text_color_secondary_light); - int selectedModeColor = ContextCompat.getColor(uiCtx, appMode.getIconColorInfo().getColor(nightMode)); + int selectedModeColor = appMode.getProfileColor(nightMode); LinearLayout ll = new LinearLayout(uiCtx); final int dp24 = AndroidUtils.dpToPx(uiCtx, 24f); final int dp8 = AndroidUtils.dpToPx(uiCtx, 8f); diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java index 178e662176..e4663b5609 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java @@ -115,8 +115,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { container = itemView.findViewById(R.id.always_ask_and_range_slider_container); RangeSlider intervalSlider = itemView.findViewById(R.id.interval_slider); intervalSlider.setValueTo(secondsLength + minutesLength - 1); - int currentModeColorRes = app.getSettings().getApplicationMode().getIconColorInfo().getColor(nightMode); - int currentModeColor = ContextCompat.getColor(app, currentModeColorRes); + int currentModeColor = app.getSettings().getApplicationMode().getProfileColor(nightMode); UiUtilities.setupSlider(intervalSlider, nightMode, currentModeColor, true); container.setVisibility(View.GONE); intervalSlider.addOnChangeListener(new RangeSlider.OnChangeListener() { diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingCard.java b/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingCard.java index 39951b4c2c..1a2be2b134 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingCard.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/ui/OnlineRoutingCard.java @@ -78,7 +78,7 @@ public class OnlineRoutingCard extends BaseCard { bottomDivider = view.findViewById(R.id.bottom_divider); button = view.findViewById(R.id.button); - int activeColor = ContextCompat.getColor(app, appMode.getIconColorInfo().getColor(nightMode)); + int activeColor = appMode.getProfileColor(nightMode); textFieldBoxes.setPrimaryColor(activeColor); textFieldBoxes.setGravityFloatingLabel(Gravity.START); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmNotesMenu.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmNotesMenu.java index 3c7c387a36..0279955801 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmNotesMenu.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmNotesMenu.java @@ -46,7 +46,7 @@ public class OsmNotesMenu { final boolean nightMode = isNightMode(app); final int themeRes = getThemeRes(app); - final int selectedModeColor = ContextCompat.getColor(app, settings.getApplicationMode().getIconColorInfo().getColor(nightMode)); + final int selectedModeColor = settings.getApplicationMode().getProfileColor(nightMode); final int osmNotesStringId = R.string.layer_osm_bugs; final int showZoomLevelStringId = R.string.show_from_zoom_level; diff --git a/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java b/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java index 8ddd677be2..55d8d350e1 100644 --- a/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java +++ b/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java @@ -310,13 +310,12 @@ public class RearrangePoiFiltersFragment extends DialogFragment implements Selec ImageView profileIcon = (ImageView) view.findViewById(R.id.profile_icon); if (profileIcon != null) { int iconRes = selectedAppMode.getIconRes(); - int iconColor = selectedAppMode.getIconColorInfo().getColor(nightMode); - profileIcon.setImageDrawable(uiUtilities.getPaintedIcon(iconRes, iconColor)); + profileIcon.setImageDrawable(uiUtilities.getPaintedIcon(iconRes, selectedAppMode.getProfileColor(nightMode))); } View profileButton = view.findViewById(R.id.profile_button); if (profileButton != null) { - int iconColor = getSelectedAppMode().getIconColorInfo().getColor(nightMode); + int iconColor = getSelectedAppMode().getProfileColor(nightMode); int bgColor = ContextCompat.getColor(app, nightMode ? R.color.divider_color_dark : R.color.active_buttons_and_links_text_light); int selectedColor = UiUtilities.getColorWithAlpha(iconColor, 0.3f); diff --git a/OsmAnd/src/net/osmand/plus/profiles/SelectCopyProfilesMenuAdapter.java b/OsmAnd/src/net/osmand/plus/profiles/SelectCopyProfilesMenuAdapter.java index efe1b00a2e..53dbef23bd 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/SelectCopyProfilesMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/profiles/SelectCopyProfilesMenuAdapter.java @@ -67,10 +67,9 @@ public class SelectCopyProfilesMenuAdapter extends AbstractProfileMenuAdapter