diff --git a/android/res/drawable/bg_ads.xml b/android/res/drawable/bg_ads.xml index bac68d632f..f4e7c76292 100644 --- a/android/res/drawable/bg_ads.xml +++ b/android/res/drawable/bg_ads.xml @@ -1,7 +1,7 @@ - + - + - + - + - - - - + + + + + + + + + + + + + + diff --git a/android/res/drawable/bg_pp_banner_large_button_night.xml b/android/res/drawable/bg_pp_banner_large_button_night.xml index 7146cf7281..fb3ac51b75 100644 --- a/android/res/drawable/bg_pp_banner_large_button_night.xml +++ b/android/res/drawable/bg_pp_banner_large_button_night.xml @@ -1,7 +1,18 @@ - - - - + + + + + + + + + + + + + + diff --git a/android/res/drawable/bg_pp_banner_remove_button.xml b/android/res/drawable/bg_pp_banner_remove_button.xml new file mode 100644 index 0000000000..fd61da1311 --- /dev/null +++ b/android/res/drawable/bg_pp_banner_remove_button.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/android/res/drawable/bg_pp_banner_remove_button_night.xml b/android/res/drawable/bg_pp_banner_remove_button_night.xml new file mode 100644 index 0000000000..5adc85a80e --- /dev/null +++ b/android/res/drawable/bg_pp_banner_remove_button_night.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/android/res/layout/place_page_banner_content.xml b/android/res/layout/place_page_banner_content.xml index f882dcb243..d1f7ea1f33 100644 --- a/android/res/layout/place_page_banner_content.xml +++ b/android/res/layout/place_page_banner_content.xml @@ -97,25 +97,52 @@ android:layout_toRightOf="@+id/iv__banner_icon" android:layout_toEndOf="@+id/iv__banner_icon"/> - + android:layout_below="@id/data_frame"> + + + #14000000 #1C000000 #1E000000 + #33000000 #3D000000 #61000000 #99000000 @@ -33,6 +34,7 @@ #14FFFFFF #1CFFFFFF #1EFFFFFF + #33FFFFFF #3DFFFFFF #61FFFFFF #99FFFFFF @@ -169,13 +171,8 @@ #FF484C50 #28000000 #28FFFFFF - @color/black_12 - @color/white_12 #FFFFFBF2 #FFFFFBF2 - #FF888A82 - #FFD9D2C3 - #FF71736C @color/bg_brand_partner19 @color/bg_brand_partner19_pressed diff --git a/android/res/values/themes-attrs.xml b/android/res/values/themes-attrs.xml index 065dfae698..3627aa912c 100644 --- a/android/res/values/themes-attrs.xml +++ b/android/res/values/themes-attrs.xml @@ -74,6 +74,7 @@ + diff --git a/android/res/values/themes-base.xml b/android/res/values/themes-base.xml index f8bff4a499..748366b693 100644 --- a/android/res/values/themes-base.xml +++ b/android/res/values/themes-base.xml @@ -92,7 +92,8 @@ @color/text_banner_color @drawable/bg_pp_banner @drawable/bg_pp_banner_large_button - @color/bg_banner_button + @color/black_12 + @drawable/bg_pp_banner_remove_button @drawable/bg_ads @color/text_ads_color @drawable/bg_ads_action @@ -228,7 +229,8 @@ @color/text_banner_color_night @drawable/bg_pp_banner_night @drawable/bg_pp_banner_large_button_night - @color/bg_banner_button_night + @color/white_12 + @drawable/bg_pp_banner_remove_button_night @drawable/bg_ads_night @color/text_ads_color_night @drawable/bg_ads_action_night diff --git a/android/src/com/mapswithme/maps/widget/placepage/BannerController.java b/android/src/com/mapswithme/maps/widget/placepage/BannerController.java index 9eb8c1d7c7..c8f7bb000b 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BannerController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BannerController.java @@ -88,6 +88,9 @@ final class BannerController private TextView mActionSmall; @SuppressWarnings("NullableProblems") @NonNull + private View mActionContainer; + @SuppressWarnings("NullableProblems") + @NonNull private TextView mActionLarge; @SuppressWarnings("NullableProblems") @NonNull @@ -136,7 +139,10 @@ final class BannerController mTitle = mBannerView.findViewById(R.id.tv__banner_title); mMessage = mBannerView.findViewById(R.id.tv__banner_message); mActionSmall = mBannerView.findViewById(R.id.tv__action_small); - mActionLarge = mBannerView.findViewById(R.id.tv__action_large); + mActionContainer = mBannerView.findViewById(R.id.action_container); + mActionLarge = mActionContainer.findViewById(R.id.tv__action_large); + View actionRemove = mActionContainer.findViewById(R.id.tv__action_remove); + actionRemove.setOnClickListener(v -> handleAdsRemoval()); mAdChoices = mBannerView.findViewById(R.id.ad_choices_icon); mAdChoices.setOnClickListener(v -> handlePrivacyInfoUrl()); mAdChoicesLabel = mBannerView.findViewById(R.id.ad_choices_label); @@ -182,18 +188,18 @@ final class BannerController if ((mAdsLoader.isAdLoading() || hasErrorOccurred()) && mCurrentAd == null) { - UiUtils.hide(mIcon, mTitle, mMessage, mActionSmall, mActionLarge, mAdChoices, mAdChoicesLabel, - mAdRemovalButton); + UiUtils.hide(mIcon, mTitle, mMessage, mActionSmall, mActionContainer, mAdChoices, + mAdChoicesLabel, mAdRemovalButton); } else if (mCurrentAd != null) { UiUtils.showIf(mCurrentAd.getType().showAdChoiceIcon(), mAdChoices); - UiUtils.show(mIcon, mTitle, mMessage, mActionSmall, mActionLarge, mAdChoicesLabel, + UiUtils.show(mIcon, mTitle, mMessage, mActionSmall, mActionContainer, mAdChoicesLabel, mAdRemovalButton); if (mOpened) UiUtils.hide(mActionSmall); else - UiUtils.hide(mActionLarge, mIcon); + UiUtils.hide(mActionContainer, mIcon); } } @@ -351,17 +357,16 @@ final class BannerController private void animateActionButton() { - View view = mOpened ? mBannerView.findViewById(R.id.tv__action_large) - : mBannerView.findViewById(R.id.tv__action_small); + View view = mOpened ? mActionLarge : mActionSmall; ObjectAnimator animator; if (mOpened) { Context context = mBannerView.getContext(); Resources res = context.getResources(); - int colorFrom = ThemeUtils.isNightTheme() ? res.getColor(R.color.banner_action_btn_start_anim_night) - : res.getColor(R.color.bg_banner_button); - int colorTo = ThemeUtils.isNightTheme() ? res.getColor(R.color.banner_action_btn_end_anim_night) - : res.getColor(R.color.banner_action_btn_end_anim); + int colorFrom = ThemeUtils.isNightTheme() ? res.getColor(R.color.white_12) + : res.getColor(R.color.black_12); + int colorTo = ThemeUtils.isNightTheme() ? res.getColor(R.color.white_24) + : res.getColor(R.color.black_24); animator = ObjectAnimator.ofObject(view, "backgroundColor", new ArgbEvaluator(), colorFrom, colorTo, colorFrom); }