diff --git a/OsmAnd/res/layout/map_context_menu_fragment.xml b/OsmAnd/res/layout/map_context_menu_fragment.xml index 01473173a6..8586c1d72a 100644 --- a/OsmAnd/res/layout/map_context_menu_fragment.xml +++ b/OsmAnd/res/layout/map_context_menu_fragment.xml @@ -37,11 +37,11 @@ @@ -50,7 +50,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginTop="16dp" + android:layout_marginTop="15dp" android:layout_marginBottom="16dp" android:orientation="vertical"> @@ -71,7 +71,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="12dp" android:layout_marginRight="12dp" - android:layout_marginTop="3dp" + android:layout_marginTop="4dp" android:text="@string/other_location" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size"/> @@ -170,7 +170,8 @@ android:id="@+id/context_menu_bottom_view" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:background="?attr/ctx_menu_info_view_bg"> diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml index 43097f5c88..b744ac77db 100644 --- a/OsmAnd/res/values/attrs.xml +++ b/OsmAnd/res/values/attrs.xml @@ -12,6 +12,7 @@ + diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml index 22a4b13827..11b1c39563 100644 --- a/OsmAnd/res/values/colors.xml +++ b/OsmAnd/res/values/colors.xml @@ -58,6 +58,13 @@ #727272 #ccc + #eaeaea + #292f33 + #212121 + #b4c3cc + #d9d9d9 + #333b40 + #448AFF #eaeaea #F0F0F0 diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index bb32c32229..7045ca986d 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -69,6 +69,7 @@ @drawable/bg_map_context_menu_light @color/dashboard_divider_light @drawable/dashboard_button_light + @color/ctx_menu_info_view_bg_light @color/search_background_dark @drawable/ic_action_mode_back @style/WhiteActionMode @@ -164,6 +165,7 @@ @drawable/bg_map_context_menu_dark @color/dashboard_divider_dark @drawable/dashboard_button_dark + @color/ctx_menu_info_view_bg_dark @color/color_white @drawable/switch_ex_background_dark @color/switch_ex_button_text_dark diff --git a/OsmAnd/src/net/osmand/plus/IconsCache.java b/OsmAnd/src/net/osmand/plus/IconsCache.java index 842ceaa3e0..3aede0382d 100644 --- a/OsmAnd/src/net/osmand/plus/IconsCache.java +++ b/OsmAnd/src/net/osmand/plus/IconsCache.java @@ -22,7 +22,7 @@ public class IconsCache { d = app.getResources().getDrawable(resId).mutate(); d.clearColorFilter(); if (clrId != 0) { - d.setColorFilter(app.getResources().getColor(clrId), PorterDuff.Mode.MULTIPLY); + d.setColorFilter(app.getResources().getColor(clrId), PorterDuff.Mode.SRC_IN); } drawable.put(hash, d); } @@ -35,7 +35,7 @@ public class IconsCache { if(d == null) { d = app.getResources().getDrawable(resId).mutate(); d.clearColorFilter(); - d.setColorFilter(color, PorterDuff.Mode.MULTIPLY); + d.setColorFilter(color, PorterDuff.Mode.SRC_IN); drawable.put(hash, d); } return d; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index a75aab3e84..27b6123ea9 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -249,7 +249,7 @@ public class MapContextMenuFragment extends Fragment { iconLayout.setVisibility(View.GONE); } else { iconView.setImageDrawable(iconsCache.getIcon(iconId, - light ? R.color.icon_color : R.color.icon_color_light)); + light ? R.color.osmand_orange : R.color.osmand_orange_dark)); } // Text line 1 @@ -263,7 +263,7 @@ public class MapContextMenuFragment extends Fragment { // Close button final ImageView closeButtonView = (ImageView)view.findViewById(R.id.context_menu_close_btn_view); closeButtonView.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark, - light ? R.color.actionbar_dark_color : R.color.actionbar_light_color)); + light ? R.color.icon_color_light : R.color.dash_search_icon_dark)); closeButtonView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -275,7 +275,7 @@ public class MapContextMenuFragment extends Fragment { // Action buttons final ImageButton buttonNavigate = (ImageButton) view.findViewById(R.id.context_menu_route_button); buttonNavigate.setImageDrawable(iconsCache.getIcon(R.drawable.map_directions, - light ? R.color.actionbar_dark_color : R.color.actionbar_light_color)); + light ? R.color.icon_color : R.color.dash_search_icon_dark)); buttonNavigate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -285,7 +285,7 @@ public class MapContextMenuFragment extends Fragment { final ImageButton buttonFavorite = (ImageButton) view.findViewById(R.id.context_menu_fav_button); buttonFavorite.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_fav_dark, - light ? R.color.actionbar_dark_color : R.color.actionbar_light_color)); + light ? R.color.icon_color : R.color.dash_search_icon_dark)); buttonFavorite.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -295,7 +295,7 @@ public class MapContextMenuFragment extends Fragment { final ImageButton buttonShare = (ImageButton) view.findViewById(R.id.context_menu_share_button); buttonShare.setImageDrawable(iconsCache.getIcon(R.drawable.abc_ic_menu_share_mtrl_alpha, - light ? R.color.actionbar_dark_color : R.color.actionbar_light_color)); + light ? R.color.icon_color : R.color.dash_search_icon_dark)); buttonShare.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -305,7 +305,7 @@ public class MapContextMenuFragment extends Fragment { final ImageButton buttonMore = (ImageButton) view.findViewById(R.id.context_menu_more_button); buttonMore.setImageDrawable(iconsCache.getIcon(R.drawable.ic_overflow_menu_white, - light ? R.color.actionbar_dark_color : R.color.actionbar_light_color)); + light ? R.color.icon_color : R.color.dash_search_icon_dark)); buttonMore.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/sections/AmenityInfoMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/sections/AmenityInfoMenuBuilder.java index 1d83dc33ff..c01f31cc34 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/sections/AmenityInfoMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/sections/AmenityInfoMenuBuilder.java @@ -1,7 +1,6 @@ package net.osmand.plus.mapcontextmenu.sections; import android.content.res.Resources; -import android.util.Log; import android.util.TypedValue; import android.view.Gravity; import android.view.View; @@ -16,6 +15,7 @@ import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiType; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; +import net.osmand.util.Algorithms; import java.util.Map; @@ -31,7 +31,7 @@ public class AmenityInfoMenuBuilder extends MenuBuilder { } private void buildRow(View view, int iconId, String text) { - Resources.Theme theme = view.getContext().getTheme(); + boolean light = app.getSettings().isLightContent(); LinearLayout ll = new LinearLayout(view.getContext()); ll.setOrientation(LinearLayout.HORIZONTAL); @@ -64,16 +64,8 @@ public class AmenityInfoMenuBuilder extends MenuBuilder { ll.addView(llText); TextView textView = new TextView(view.getContext()); - -// TypedValue typedValueTextSize = new TypedValue(); -// theme.resolveAttribute(R.dimen.default_desc_text_size, typedValueTextSize, true); -// int textSize = typedValueTextSize.data; - textView.setTextSize(14); - -// TypedValue typedValueTextColor = new TypedValue(); -// theme.resolveAttribute(android.R.attr.textColorSecondary, typedValueTextColor, true); -// int textColor = typedValueTextColor.data; - //textView.setTextColor(textColor); + textView.setTextSize(18); // todo: create constant + textView.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_info_text_light : R.color.ctx_menu_info_text_dark)); textView.setText(text); //textView.setText("sdf dsaf fsdasdfg adsf asdsfd asdf sdf adsfg asdf sdfa sdf dsf agsfdgd fgsfd sdf asdf adg adf sdf asdf dfgdfsg sdfg adsf asdf asdf sdf SDF ASDF ADSF ASDF ASDF DAF SDAF dfg dsfg dfg sdfg rg rth sfghs dfgs dfgsdfg adfg dfg sdfg dfs "); @@ -91,10 +83,7 @@ public class AmenityInfoMenuBuilder extends MenuBuilder { llHorLineParams.gravity = Gravity.BOTTOM; horizontalLine.setLayoutParams(llHorLineParams); - TypedValue typedValueColor = new TypedValue(); - theme.resolveAttribute(R.attr.dashboard_divider, typedValueColor, true); - int color = typedValueColor.data; - horizontalLine.setBackgroundColor(color); + horizontalLine.setBackgroundColor(app.getResources().getColor(light ? R.color.ctx_menu_info_divider_light : R.color.ctx_menu_info_divider_dark)); ((LinearLayout)view).addView(horizontalLine); } @@ -135,11 +124,11 @@ public class AmenityInfoMenuBuilder extends MenuBuilder { if(pt instanceof PoiType && !((PoiType) pt).isText()) { vl = pt.getTranslation(); } else { - vl = /*pt.getTranslation() + ": " + */amenity.unzipContent(e.getValue()); + vl = pt.getTranslation() + ": " + amenity.unzipContent(e.getValue()); } } else { - vl = /*Algorithms.capitalizeFirstLetterAndLowercase(e.getKey()) + - ": " + */amenity.unzipContent(e.getValue()); + vl = Algorithms.capitalizeFirstLetterAndLowercase(e.getKey()) + + ": " + amenity.unzipContent(e.getValue()); } }