From 02da17f726d93fb3340d2a4a12e6be8333d7fed7 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Mon, 16 Nov 2020 17:25:02 +0200 Subject: [PATCH] Small refactoring of icon receiving and setup shareIcon to white color in all themes --- .../plus/search/QuickSearchDialogFragment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java index 3c55261668..9badea394e 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java @@ -259,6 +259,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final MapActivity mapActivity = getMapActivity(); + final UiUtilities iconsCache = app.getUIUtilities(); final View view = inflater.inflate(R.layout.search_dialog_fragment, container, false); toolbarController = new QuickSearchToolbarController(); @@ -325,9 +326,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC buttonToolbarView = view.findViewById(R.id.button_toolbar_layout); buttonToolbarImage = (ImageView) view.findViewById(R.id.buttonToolbarImage); - buttonToolbarImage.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_marker_dark)); + buttonToolbarImage.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_marker_dark)); buttonToolbarFilter = (ImageButton) view.findViewById(R.id.filterButton); - buttonToolbarFilter.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_filter)); + buttonToolbarFilter.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_filter)); buttonToolbarFilter.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -474,7 +475,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC if (!app.getSettings().isLightContent()) { toolbar.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.app_bar_color_dark)); } - Drawable icBack = app.getUIUtilities().getThemedIcon(AndroidUtils.getNavigationIconResId(app)); + Drawable icBack = iconsCache.getThemedIcon(AndroidUtils.getNavigationIconResId(app)); toolbar.setNavigationIcon(icBack); toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up); toolbar.setNavigationOnClickListener( @@ -489,7 +490,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC ); toolbarEdit = (Toolbar) view.findViewById(R.id.toolbar_edit); - toolbarEdit.setNavigationIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_remove_dark)); + toolbarEdit.setNavigationIcon(iconsCache.getIcon(R.drawable.ic_action_remove_dark)); toolbarEdit.setNavigationContentDescription(R.string.shared_string_cancel); toolbarEdit.setNavigationOnClickListener( new OnClickListener() { @@ -501,8 +502,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC ); titleEdit = (TextView) view.findViewById(R.id.titleEdit); - Drawable shareIcon = app.getUIUtilities().getIcon(R.drawable.ic_action_gshare_dark, - nightMode ? R.color.text_color_secondary_dark : R.color.text_color_secondary_light); + Drawable shareIcon = iconsCache.getIcon(R.drawable.ic_action_gshare_dark, R.color.color_white); shareIcon = AndroidUtils.getDrawableForDirection(app, shareIcon); ImageView shareButton = (ImageView) view.findViewById(R.id.shareButton); shareButton.setImageDrawable(shareIcon); @@ -644,7 +644,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC progressBar = (ProgressBar) view.findViewById(R.id.searchProgressBar); clearButton = (ImageButton) view.findViewById(R.id.clearButton); - clearButton.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark)); + clearButton.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_remove_dark)); clearButton.setOnClickListener( new OnClickListener() { @Override