[ads][android] mastercard-sberbank banner layout

This commit is contained in:
Arsentiy Milchakov 2020-08-07 14:58:49 +03:00 committed by Aleksandr Zatsepin
parent 873af89e81
commit d604d5c9de
11 changed files with 255 additions and 88 deletions

View file

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="111dp"
android:height="32dp"
android:viewportWidth="111"
android:viewportHeight="32">
<path
android:pathData="M92.015,3.424H77.943V28.568H92.015V3.424Z"
android:fillColor="#F26122"/>
<path
android:pathData="M78.836,15.996C78.836,11.11 81.115,6.445 85.001,3.424C78.032,-2.04 67.891,-0.84 62.441,6.134C56.991,13.109 58.108,23.104 65.077,28.568C70.929,33.144 79.104,33.144 84.957,28.568C81.07,25.547 78.791,20.883 78.836,15.996Z"
android:fillColor="#EA1D25"/>
<path
android:pathData="M111,15.996C111,24.837 103.808,31.989 94.918,31.989C91.299,31.989 87.814,30.789 85,28.568C91.969,23.104 93.175,13.064 87.725,6.134C86.921,5.112 86.028,4.224 85,3.424C91.969,-2.04 102.11,-0.84 107.605,6.134C109.794,8.933 111,12.398 111,15.996Z"
android:fillColor="#F69E1E"/>
<path
android:pathData="M109.438,25.903V25.37H109.661V25.282H109.125V25.37H109.348V25.903H109.438ZM110.465,25.903V25.281H110.331L110.153,25.726L109.974,25.281H109.795V25.903H109.884V25.414L110.063,25.814H110.197L110.376,25.414V25.903H110.465Z"
android:fillColor="#F69E1E"/>
<path
android:strokeWidth="1"
android:pathData="M46,3L46,29"
android:strokeAlpha="0.12"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
<path
android:pathData="M32,15.35C32,24.545 24.837,32 16.001,32C7.163,32 0,24.545 0,15.35C0,14.976 0.014,14.606 0.037,14.239L9.725,20.037L30.243,7.757C31.366,10.034 32,12.615 32,15.35ZM9.724,15.849L0.705,10.45C0.528,11.048 0.384,11.661 0.272,12.286L9.724,17.944L29.361,6.189C29.037,5.68 28.689,5.189 28.315,4.721L9.724,15.849ZM27.097,3.357C26.653,2.912 26.184,2.494 25.693,2.103L9.724,11.661L2.101,7.097C1.813,7.622 1.552,8.165 1.319,8.723L9.724,13.754L27.097,3.357ZM9.724,9.567L24.076,0.975C23.477,0.609 22.854,0.283 22.207,0L9.724,7.473L4.166,4.145C3.77,4.599 3.398,5.075 3.051,5.57L9.724,9.567Z"
android:fillColor="#259738"/>
</vector>

View file

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="83dp"
android:height="24dp"
android:viewportWidth="83"
android:viewportHeight="24">
<path
android:pathData="M68.6265,2.5679H58.1313V21.4258H68.6265V2.5679Z"
android:fillColor="#F26122"/>
<path
android:pathData="M58.7973,11.9972C58.7973,8.3322 60.4964,4.8339 63.3951,2.5683C58.1977,-1.5299 50.6343,-0.6302 46.5696,4.6006C42.5048,9.8315 43.3377,17.328 48.5354,21.4262C52.9,24.8579 58.9971,24.8579 63.362,21.4262C60.463,19.1605 58.7638,15.6623 58.7973,11.9972Z"
android:fillColor="#EA1D25"/>
<path
android:pathData="M82.7855,11.9972C82.7855,18.6274 77.4213,23.9916 70.7911,23.9916C68.0923,23.9916 65.4934,23.0919 63.3945,21.4262C68.592,17.328 69.4917,9.7984 65.4269,4.6006C64.8273,3.8343 64.1609,3.1679 63.3945,2.5683C68.592,-1.5299 76.1553,-0.6302 80.2535,4.6006C81.8858,6.6999 82.7855,9.2984 82.7855,11.9972Z"
android:fillColor="#F69E1E"/>
<path
android:pathData="M81.6205,19.4275V19.0278H81.7869V18.9613H81.3872V19.0278H81.5537V19.4275H81.6205ZM82.3868,19.4275V18.9609H82.2869L82.1536,19.2942L82.0202,18.9609H81.8869V19.4275H81.9534V19.0609L82.0867,19.3607H82.1867L82.32,19.0609V19.4275H82.3868Z"
android:fillColor="#F69E1E"/>
<path
android:strokeWidth="1"
android:pathData="M34.5,2L34.5,22"
android:strokeAlpha="0.12"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
<path
android:pathData="M24,11.5128C24,18.4091 18.6274,24 12.0004,24C5.3726,24 0,18.4091 0,11.5128C0,11.2321 0.0105,10.9542 0.0281,10.6791L7.2937,15.0277L22.6823,5.8176C23.5248,7.5252 24,9.4614 24,11.5128ZM7.2929,11.8866L0.5288,7.8379C0.3962,8.2858 0.2881,8.7456 0.2038,9.2146L7.2929,13.4581L22.0209,4.642C21.7775,4.2599 21.5166,3.8915 21.2364,3.5405L7.2929,11.8866ZM20.3228,2.5176C19.9899,2.1839 19.6376,1.8703 19.2696,1.5769L7.2929,8.7456L1.5759,5.3231C1.3598,5.7162 1.1639,6.1239 0.9891,6.5426L7.2929,10.3152L20.3228,2.5176ZM7.2929,7.1751L18.0573,0.7313C17.6076,0.4571 17.1402,0.2121 16.6553,0L7.2929,5.6046L3.1246,3.109C2.8277,3.4491 2.5484,3.8065 2.2884,4.1776L7.2929,7.1751Z"
android:fillColor="#259738"/>
</vector>

View file

@ -97,46 +97,20 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<LinearLayout
android:id="@+id/banner"
android:layout_marginTop="@dimen/margin_half"
<include
android:layout_width="@dimen/square_block_size"
android:orientation="vertical"
android:visibility="gone"
android:gravity="center"
android:layout_height="wrap_content"
tools:visibility="gone">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:gravity="center"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?android:textColorPrimary"/>
<Button
android:id="@+id/banner_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingBottom="@dimen/margin_quarter_plus"
android:layout_marginTop="@dimen/margin_base"
android:fontFamily="@string/robotoMedium"
android:textAllCaps="false"
android:textSize="@dimen/text_size_body_3"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/white_primary"
android:lines="1"
tools:targetApi="jelly_bean"/>
</LinearLayout>
android:layout_marginTop="@dimen/margin_half"
layout="@layout/onmap_downloader_banner"
android:visibility="gone">
</include>
<include
android:layout_width="@dimen/square_block_size"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_quarter"
layout="@layout/onmap_downloader_banner_big_logo"
android:visibility="gone">
</include>
<LinearLayout
android:id="@+id/catalog_call_to_action_container"
android:orientation="vertical"

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/onmap_downloader_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:gravity="center"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?android:textColorPrimary" />
<Button
android:id="@+id/banner_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:fontFamily="@string/robotoMedium"
android:lines="1"
android:paddingStart="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingEnd="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingBottom="@dimen/margin_quarter_plus"
android:textAllCaps="false"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_3" />
</LinearLayout>

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/onmap_downloader_banner_big_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/ic_logo_mastercard_sberbank" />
<TextView
android:id="@id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:gravity="center"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?android:textColorPrimary"
tools:text="Some dummy text, Some dummy text" />
<Button
android:id="@+id/banner_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:fontFamily="@string/robotoMedium"
android:lines="1"
android:paddingStart="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingEnd="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingBottom="@dimen/margin_quarter_plus"
android:textAllCaps="false"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_3" />
</LinearLayout>

View file

@ -72,49 +72,20 @@
android:layout_marginTop="@dimen/margin_half_plus"
android:layout_height="@dimen/divider_height"
android:background="?android:listDivider"/>
<LinearLayout
android:id="@+id/banner"
android:layout_marginTop="@dimen/margin_half"
android:orientation="vertical"
android:visibility="gone"
<include
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"/>
<TextView
android:id="@id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?android:textColorPrimary"/>
</LinearLayout>
<Button
android:id="@+id/banner_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingBottom="@dimen/margin_quarter_plus"
android:layout_marginTop="@dimen/margin_base"
android:fontFamily="@string/robotoMedium"
android:textAllCaps="false"
android:textSize="@dimen/text_size_body_3"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/white_primary"
tools:targetApi="jelly_bean"/>
</LinearLayout>
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
layout="@layout/onmap_downloader_banner"
android:visibility="gone">
</include>
<include
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
layout="@layout/onmap_downloader_banner_big_logo"
android:visibility="gone">
</include>
<LinearLayout
android:id="@+id/catalog_call_to_action_container"
android:layout_marginTop="@dimen/margin_base_plus_quarter"

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/onmap_downloader_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_half" />
<TextView
android:id="@id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?android:textColorPrimary" />
</LinearLayout>
<Button
android:id="@+id/banner_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:fontFamily="@string/robotoMedium"
android:paddingStart="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingEnd="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingBottom="@dimen/margin_quarter_plus"
android:textAllCaps="false"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_3" />
</LinearLayout>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/onmap_downloader_banner_big_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/ic_logo_mastercard_sberbank" />
<TextView
android:id="@id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_double_plus"
android:gravity="center"
android:textAppearance="@style/MwmTextAppearance.Body4"
android:textColor="?android:textColorPrimary"
tools:text="Some dummy text, Some dummy text" />
<Button
android:id="@+id/banner_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:fontFamily="@string/robotoMedium"
android:paddingStart="@dimen/margin_half"
android:paddingLeft="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingEnd="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingBottom="@dimen/margin_quarter_plus"
android:textAllCaps="false"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_3" />
</LinearLayout>

View file

@ -232,6 +232,7 @@
<color name="tinkoff_button">#FFDD2D</color>
<color name="mts_button">#E30611</color>
<color name="skyeng_button">#4287DF</color>
<color name="mastercard_sberbank_button">#009A37</color>
<color name="city_color">#9B24B2</color>
<color name="city_color_night">#9867FC</color>
<color name="outdoor_color_night">#93BF39</color>

View file

@ -70,12 +70,11 @@ enum DownloaderBannerType implements StatisticValueConverter<String>
return Statistics.ParamValue.MAPSME_GUIDES;
}
},
// Dummy resources, will be changed when layout will be done
MASTERCARD_SBERBANK(new DownloaderBannerConfigStrategyPartner(R.drawable.ic_logo_skyeng,
R.string.skyeng_map_downloader_title,
R.string.skyeng_map_downloader_cta_button,
MASTERCARD_SBERBANK(new DownloaderBannerConfigStrategyPartner(R.drawable.ic_logo_mastercard_sberbank,
R.string.sberbank_map_downloader_title,
R.string.sberbank_map_downloader_cta_button,
R.color.white_primary,
R.color.skyeng_button))
R.color.mastercard_sberbank_button))
{
@NonNull
@Override

View file

@ -295,9 +295,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
mCatalogCallToActionContainer = mFrame.findViewById(R.id.catalog_call_to_action_container);
downloadGuidesBtn.setOnClickListener(new CatalogCallToActionListener());
mPromoContentDivider = mFrame.findViewById(R.id.onmap_downloader_divider);
mBannerContainer = mFrame.findViewById(R.id.banner);
// Dummy will be changed with correct view id.
mBannerContainerBigLogo = mFrame.findViewById(R.id.banner);
mBannerContainer = mFrame.findViewById(R.id.onmap_downloader_banner);
mBannerContainerBigLogo = mFrame.findViewById(R.id.onmap_downloader_banner_big_logo);
}
private void updateBannerVisibility()