diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index c8f4c04c29..e671509c2a 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -35,6 +35,7 @@ import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.view.ContextThemeWrapper; import androidx.appcompat.widget.ListPopupWindow; import androidx.appcompat.widget.SwitchCompat; +import androidx.appcompat.widget.Toolbar; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.view.ViewCompat; @@ -510,6 +511,20 @@ public class UiUtilities { compoundButton.setBackgroundColor(Color.TRANSPARENT); } + public static void setupToolbarOverflowIcon(Toolbar toolbar, @DrawableRes int iconId, @ColorRes int colorId) { + Context ctx = toolbar.getContext(); + if (ctx != null) { + return; + } + Drawable icon = ContextCompat.getDrawable(ctx, iconId); + toolbar.setOverflowIcon(icon); + if (icon != null) { + int color = ContextCompat.getColor(ctx, colorId); + DrawableCompat.setTint(icon.mutate(), color); + toolbar.setOverflowIcon(icon); + } + } + public static ViewGroup createSliderView(@NonNull Context ctx, boolean nightMode) { return (ViewGroup) getInflater(ctx, nightMode).inflate(R.layout.slider, null, false); } diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index 3edcfbcece..f920f2dec2 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -600,8 +600,9 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(j); if (j + 1 >= max && optionsMenuAdapter.length() > max) { if (split == null) { + Drawable icOverflowMenu = getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white); split = menu.addSubMenu(0, 1, j + 1, R.string.shared_string_more_actions); - split.setIcon(R.drawable.ic_overflow_menu_white); + split.setIcon(icOverflowMenu); split.getItem(); MenuItemCompat.setShowAsAction(split.getItem(), MenuItemCompat.SHOW_AS_ACTION_ALWAYS); } diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java b/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java index ce708fc3ab..d6e0406904 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java @@ -8,6 +8,7 @@ import android.view.MenuItem; import android.view.View; import androidx.appcompat.app.ActionBar; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; @@ -45,7 +46,8 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa @Override protected void onCreate(Bundle savedInstanceState) { - getMyApplication().applyTheme(this); + OsmandApplication app = getMyApplication(); + app.applyTheme(this); super.onCreate(savedInstanceState); setContentView(R.layout.activity_livie_updates); @@ -69,6 +71,13 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa getLastUpdateDateTask = new GetLastUpdateDateTask(this); getLastUpdateDateTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } + + boolean nightMode = !app.getSettings().isLightContent(); + int normalTabColor = ContextCompat.getColor(app, + nightMode ? R.color.searchbar_tab_inactive_dark : R.color.searchbar_tab_inactive_light); + int selectedTabColor = ContextCompat.getColor(app, + nightMode ? R.color.text_color_tab_active_dark : R.color.text_color_tab_active_light); + tabLayout.setTabTextColors(normalTabColor, selectedTabColor); } @Override diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 60cf378a9b..be9d3f2e58 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -30,6 +30,7 @@ import net.osmand.AndroidUtils; import net.osmand.IndexConstants; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; +import net.osmand.plus.UiUtilities; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.TrackActivity; @@ -442,8 +443,9 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme @Override protected void setupToolbar(Toolbar toolbar) { super.setupToolbar(toolbar); - toolbar.setOverflowIcon(getIcon(R.drawable.ic_overflow_menu_white, R.color.icon_color_default_light)); + UiUtilities.setupToolbarOverflowIcon( + toolbar, R.drawable.ic_overflow_menu_white, R.color.icon_color_default_light); Menu menu = toolbar.getMenu(); MenuItem.OnMenuItemClickListener itemClickListener = new MenuItem.OnMenuItemClickListener() { @Override