[android] Redesigned pp banner according Facebook requirements

This commit is contained in:
Александр Зацепин 2020-05-27 17:12:40 +03:00 committed by rmrfsudols
parent 7c4a6259a6
commit 0c972c171e
10 changed files with 51 additions and 83 deletions

View file

@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/placepage_banner_small_action_corner"/>
<solid android:color="@color/black_12"/>
<padding
android:left="@dimen/margin_half"
android:right="@dimen/margin_half"
android:top="@dimen/placepage_banner_button_margin_top"
android:bottom="@dimen/placepage_banner_button_margin_top"/>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/placepage_banner_small_action_corner" />
<solid android:color="@color/bg_banner_action_button_pressed" />
<padding android:bottom="@dimen/placepage_banner_button_margin_top" android:left="@dimen/margin_half" android:right="@dimen/margin_half" android:top="@dimen/placepage_banner_button_margin_top" />
</shape>
</item>
<item android:state_pressed="false">
<shape android:shape="rectangle">
<corners android:radius="@dimen/placepage_banner_small_action_corner" />
<solid android:color="@color/bg_banner_action_button" />
<padding android:bottom="@dimen/placepage_banner_button_margin_top" android:left="@dimen/margin_half" android:right="@dimen/margin_half" android:top="@dimen/placepage_banner_button_margin_top" />
</shape>
</item>
</selector>

View file

@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/placepage_banner_small_action_corner"/>
<solid android:color="@color/white_12"/>
<padding
android:left="@dimen/margin_half"
android:right="@dimen/margin_half"
android:top="@dimen/placepage_banner_button_margin_top"
android:bottom="@dimen/placepage_banner_button_margin_top"/>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/placepage_banner_small_action_corner" />
<solid android:color="@color/bg_banner_action_button_pressed_night" />
<padding android:bottom="@dimen/placepage_banner_button_margin_top" android:left="@dimen/margin_half" android:right="@dimen/margin_half" android:top="@dimen/placepage_banner_button_margin_top" />
</shape>
</item>
<item android:state_pressed="false">
<shape android:shape="rectangle">
<corners android:radius="@dimen/placepage_banner_small_action_corner" />
<solid android:color="@color/bg_banner_action_button_night" />
<padding android:bottom="@dimen/placepage_banner_button_margin_top" android:left="@dimen/margin_half" android:right="@dimen/margin_half" android:top="@dimen/placepage_banner_button_margin_top" />
</shape>
</item>
</selector>

View file

@ -4,14 +4,14 @@
<item android:state_pressed="true">
<shape
android:shape="rectangle">
<solid android:color="@color/black_24"/>
<solid android:color="@color/bg_banner_action_button_pressed"/>
<corners android:radius="@dimen/button_small_corner_radius"/>
</shape>
</item>
<item>
<item android:state_pressed="false">
<shape
android:shape="rectangle">
<solid android:color="@color/black_12"/>
<solid android:color="@color/bg_banner_action_button"/>
<corners android:radius="@dimen/button_small_corner_radius"/>
</shape>
</item>

View file

@ -4,14 +4,14 @@
<item android:state_pressed="true">
<shape
android:shape="rectangle">
<solid android:color="@color/white_24"/>
<solid android:color="@color/bg_banner_action_button_pressed_night"/>
<corners android:radius="@dimen/cardview_default_radius"/>
</shape>
</item>
<item>
<item android:state_pressed="false">
<shape
android:shape="rectangle">
<solid android:color="@color/white_12"/>
<solid android:color="@color/bg_banner_action_button_night"/>
<corners android:radius="@dimen/cardview_default_radius"/>
</shape>
</item>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape
android:shape="rectangle">
<solid android:color="@color/black_20"/>
<corners android:radius="@dimen/cardview_default_radius"/>
</shape>
</item>
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/black_8"/>
<corners android:radius="@dimen/cardview_default_radius"/>
</shape>
</item>
</selector>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape
android:shape="rectangle">
<solid android:color="@color/white_20"/>
<corners android:radius="@dimen/cardview_default_radius"/>
</shape>
</item>
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/white_8"/>
<corners android:radius="@dimen/cardview_default_radius"/>
</shape>
</item>
</selector>

View file

@ -9,17 +9,13 @@
android:layout_height="wrap_content"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_half_plus"
android:layout_marginEnd="@dimen/margin_half_plus"
android:textSize="@dimen/text_size_body_4"
android:textColor="?android:textColorSecondary"
android:textColor="@color/white_primary"
android:textAllCaps="true"
android:background="?adsActionBackground"
android:foreground="?clickableBackground"
android:visibility="gone"
tools:text="Заказать"
tools:visibility="visible"
@ -29,7 +25,6 @@
android:id="@+id/data_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/tv__action_small"
android:layout_toStartOf="@id/tv__action_small"
android:layout_marginLeft="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
@ -39,7 +34,6 @@
android:id="@+id/iv__banner_icon"
android:layout_width="@dimen/placepage_banner_icon_size"
android:layout_height="@dimen/placepage_banner_icon_size"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"
android:scaleType="centerCrop"
android:visibility="gone"
@ -51,14 +45,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/iv__banner_icon"
android:layout_toRightOf="@id/iv__banner_icon"
android:gravity="center_vertical">
<ImageView
android:id="@+id/ad_choices_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_ads_fb"
android:layout_marginRight="@dimen/margin_quarter"
android:layout_marginEnd="@dimen/margin_quarter"
android:visibility="gone"/>
<ImageView
@ -66,7 +58,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="?adChoicesIcon"
android:layout_marginRight="@dimen/margin_quarter"
android:layout_marginEnd="@dimen/margin_quarter"
android:visibility="gone"/>
<TextView
@ -88,13 +79,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?textBannerTitle"
android:maxLines="3"
android:ellipsize="end"
tools:text="Бесплатная курьерская доставка по России!\n\nКоллекции женской, мужской и детской одежды, обуви,
а также товары для дома и спорта. Цены."
tools:maxLines="5"
android:layout_below="@+id/banner_title"
android:layout_toRightOf="@+id/iv__banner_icon"
android:layout_toEndOf="@+id/iv__banner_icon"/>
</RelativeLayout>
<LinearLayout
@ -111,7 +102,6 @@
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"
android:paddingLeft="@dimen/margin_quarter"
android:paddingStart="@dimen/margin_quarter"
@ -119,9 +109,10 @@
android:paddingEnd="@dimen/margin_quarter"
android:minHeight="@dimen/placepage_banner_button_height"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:textColor="@color/white_primary"
android:textSize="14dp"
android:textAllCaps="true"
android:background="?bannerRemoveButtonBackground"
android:background="?bannerButtonBackground"
android:gravity="center"
android:visibility="visible"
android:text="@string/remove_ads"
@ -142,6 +133,7 @@
android:paddingEnd="@dimen/margin_quarter"
android:minHeight="@dimen/placepage_banner_button_height"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:textColor="@color/white_primary"
android:textSize="14dp"
android:textAllCaps="true"
android:background="?bannerButtonBackground"
@ -160,7 +152,6 @@
android:layout_width="@dimen/placepage_banner_remove_button_size"
android:layout_height="@dimen/placepage_banner_remove_button_size"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:scaleType="centerCrop"
android:src="@drawable/ic_clear"

View file

@ -179,8 +179,8 @@
<color name="bg_brand_opentable_pressed">#FFFC5965</color>
<!-- Banner colors -->
<color name="bg_banner_color">#FFFDFFE6</color>
<color name="bg_banner_color_night">#FF484C50</color>
<color name="bg_banner_color">#F2F5D4</color>
<color name="bg_banner_color_night">#FFFFFF</color>
<color name="text_banner_color">#28000000</color>
<color name="text_banner_color_night">#28FFFFFF</color>
<color name="text_ads_color">#FFFFFBF2</color>
@ -188,6 +188,10 @@
<color name="megafon_button">@color/bg_brand_partner19</color>
<color name="megafon_button_pressed">@color/bg_brand_partner19_pressed</color>
<color name="red_cross_background">#FFE53935</color>
<color name="bg_banner_action_button">#73AC6A</color>
<color name="bg_banner_action_button_pressed">#DE73AC6A</color>
<color name="bg_banner_action_button_night">#597380</color>
<color name="bg_banner_action_button_pressed_night">#DE597380</color>
<!-- Rating colors -->
<color name="rating_excellent">#43A047</color>

View file

@ -59,7 +59,6 @@
<attr name="bannerBackground" format="reference" />
<attr name="bannerButtonBackground" format="reference" />
<attr name="bannerButtonBackgroundColor" format="color" />
<attr name="bannerRemoveButtonBackground" format="reference" />
<attr name="adsBackground" format="reference" />
<attr name="adsText" format="color" />
<attr name="adsActionBackground" format="reference" />

View file

@ -94,11 +94,10 @@
<item name="bannerBackground">@drawable/bg_pp_banner</item>
<item name="bannerButtonBackground">@drawable/bg_pp_banner_large_button</item>
<item name="bannerButtonBackgroundColor">@color/black_12</item>
<item name="bannerRemoveButtonBackground">@drawable/bg_pp_banner_remove_button</item>
<item name="adsBackground">@drawable/bg_ads</item>
<item name="adsText">@color/text_ads_color</item>
<item name="adsActionBackground">@drawable/bg_ads_action</item>
<item name="textBannerTitle">@color/black_60</item>
<item name="textBannerTitle">@color/black_secondary</item>
<item name="steadyIconTint">@color/black_secondary</item>
<item name="steadyIconBackground">@drawable/bg_steady_icon</item>
@ -285,11 +284,10 @@
<item name="bannerBackground">@drawable/bg_pp_banner_night</item>
<item name="bannerButtonBackground">@drawable/bg_pp_banner_large_button_night</item>
<item name="bannerButtonBackgroundColor">@color/white_12</item>
<item name="bannerRemoveButtonBackground">@drawable/bg_pp_banner_remove_button_night</item>
<item name="adsBackground">@drawable/bg_ads_night</item>
<item name="adsText">@color/text_ads_color_night</item>
<item name="adsActionBackground">@drawable/bg_ads_action_night</item>
<item name="textBannerTitle">@color/white_60</item>
<item name="textBannerTitle">@color/bg_primary_night</item>
<item name="steadyIconTint">@color/white_secondary</item>
<item name="steadyIconBackground">@drawable/bg_steady_icon_night</item>