Change bottom view colors

This commit is contained in:
PavelRatushnyi 2017-12-13 23:21:19 +02:00
parent 2704ad7268
commit 24d6a51170
2 changed files with 13 additions and 10 deletions

View file

@ -338,12 +338,15 @@
<color name="ctx_menu_buttons_icon_color">#727272</color> <color name="ctx_menu_buttons_icon_color">#727272</color>
<color name="ctx_menu_bottom_buttons_text_color_light">#536dfe</color> <color name="ctx_menu_bottom_buttons_text_color_light">#536dfe</color>
<color name="ctx_menu_bottom_buttons_text_color_dark">#e69122</color> <color name="ctx_menu_bottom_buttons_text_color_dark">#e69122</color>
<color name="ctx_menu_bottom_view_bg_light">#fcfcfc</color> <color name="ctx_menu_bottom_view_bg_light">#ffffff</color>
<color name="ctx_menu_bottom_view_bg_dark">#17191a</color> <color name="ctx_menu_bottom_view_bg_dark">#536dfe</color>
<color name="ctx_menu_bottom_view_icon">#505050</color> <color name="ctx_menu_bottom_view_icon_light">#b3b3b3</color>
<color name="ctx_menu_bottom_view_icon_dark">#536dfe</color>
<color name="ctx_menu_bottom_view_text_color_light">#212121</color> <color name="ctx_menu_bottom_view_text_color_light">#212121</color>
<color name="ctx_menu_bottom_view_text_color_dark">#cccccc</color> <color name="ctx_menu_bottom_view_text_color_dark">#cccccc</color>
<color name="ctx_menu_amenity_opened_text_color">#5baf3f</color> <color name="ctx_menu_amenity_opened_text_color">#5baf3f</color>
<color name="ctx_menu_amenity_closed_text_color">#c66545</color> <color name="ctx_menu_amenity_closed_text_color">#c66545</color>
<color name="ctx_menu_bottom_view_divider_light">#d9d9d9</color>
<color name="ctx_menu_bottom_view_divider_dark">#333b40</color>
</resources> </resources>

View file

@ -516,7 +516,7 @@ public class MenuBuilder {
iconViewCollapse.setLayoutParams(llIconCollapseParams); iconViewCollapse.setLayoutParams(llIconCollapseParams);
iconViewCollapse.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconViewCollapse.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(collapsableView.getContenView().getVisibility() == View.GONE ? iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(collapsableView.getContenView().getVisibility() == View.GONE ?
R.drawable.ic_action_arrow_down : R.drawable.ic_action_arrow_up, R.color.ctx_menu_bottom_view_icon)); R.drawable.ic_action_arrow_down : R.drawable.ic_action_arrow_up, light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark));
llIconCollapse.addView(iconViewCollapse); llIconCollapse.addView(iconViewCollapse);
ll.setOnClickListener(new View.OnClickListener() { ll.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -524,17 +524,17 @@ public class MenuBuilder {
if (collapsableView.getContenView().getVisibility() == View.VISIBLE) { if (collapsableView.getContenView().getVisibility() == View.VISIBLE) {
collapsableView.setCollapsed(true); collapsableView.setCollapsed(true);
collapsableView.getContenView().setVisibility(View.GONE); collapsableView.getContenView().setVisibility(View.GONE);
iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_down, R.color.ctx_menu_bottom_view_icon)); iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_down, light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark));
} else { } else {
collapsableView.setCollapsed(false); collapsableView.setCollapsed(false);
collapsableView.getContenView().setVisibility(View.VISIBLE); collapsableView.getContenView().setVisibility(View.VISIBLE);
iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_up, R.color.ctx_menu_bottom_view_icon)); iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_up, light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark));
} }
} }
}); });
if (collapsableView.isCollapsed()) { if (collapsableView.isCollapsed()) {
collapsableView.getContenView().setVisibility(View.GONE); collapsableView.getContenView().setVisibility(View.GONE);
iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_down, R.color.ctx_menu_bottom_view_icon)); iconViewCollapse.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_down, light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark));
} }
baseView.addView(collapsableView.getContenView()); baseView.addView(collapsableView.getContenView());
} }
@ -616,7 +616,7 @@ public class MenuBuilder {
llHorLineParams.setMargins(dpToPx(64f), 0, 0, 0); llHorLineParams.setMargins(dpToPx(64f), 0, 0, 0);
} }
horizontalLine.setLayoutParams(llHorLineParams); horizontalLine.setLayoutParams(llHorLineParams);
horizontalLine.setBackgroundColor(app.getResources().getColor(light ? R.color.ctx_menu_info_divider_light : R.color.ctx_menu_info_divider_dark)); horizontalLine.setBackgroundColor(app.getResources().getColor(light ? R.color.ctx_menu_bottom_view_divider_light : R.color.ctx_menu_bottom_view_divider_dark));
((LinearLayout) view).addView(horizontalLine); ((LinearLayout) view).addView(horizontalLine);
} }
@ -643,13 +643,13 @@ public class MenuBuilder {
public Drawable getRowIcon(int iconId) { public Drawable getRowIcon(int iconId) {
IconsCache iconsCache = app.getIconsCache(); IconsCache iconsCache = app.getIconsCache();
return iconsCache.getIcon(iconId, R.color.ctx_menu_bottom_view_icon); return iconsCache.getIcon(iconId, light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark);
} }
public Drawable getRowIcon(Context ctx, String fileName) { public Drawable getRowIcon(Context ctx, String fileName) {
Drawable d = RenderingIcons.getBigIcon(ctx, fileName); Drawable d = RenderingIcons.getBigIcon(ctx, fileName);
if (d != null) { if (d != null) {
d.setColorFilter(app.getResources().getColor(R.color.ctx_menu_bottom_view_icon), PorterDuff.Mode.SRC_IN); d.setColorFilter(app.getResources().getColor(light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark), PorterDuff.Mode.SRC_IN);
return d; return d;
} else { } else {
return null; return null;