[android] Added red cross on banner

This commit is contained in:
Александр Зацепин 2018-10-02 18:56:06 +03:00 committed by Daria Volvenkova
parent d02ece7c63
commit 2c51aaffa3
3 changed files with 10 additions and 3 deletions

View file

@ -160,6 +160,5 @@
android:layout_alignParentEnd="true"
android:scaleType="centerCrop"
android:src="@drawable/ic_clear"
android:tint="?android:textColorSecondary"
android:background="?attr/bannerButtonBackgroundColor"/>
android:background="@color/red_cross_background"/>
</merge>

View file

@ -180,6 +180,7 @@
<color name="text_ads_color_night">#FFFFFBF2</color>
<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>
<!-- Rating colors -->
<color name="rating_excellent">#43A047</color>

View file

@ -159,9 +159,16 @@ final class BannerController
mAdChoicesLabel = mBannerView.findViewById(R.id.ad_choices_label);
mAdsRemovalIcon = mBannerView.findViewById(R.id.remove_btn);
mAdsRemovalIcon.setOnClickListener(this::handleAdsRemoval);
expandTouchArea();
}
private void expandTouchArea()
{
Resources res = mBannerView.getResources();
final int tapArea = res.getDimensionPixelSize(R.dimen.margin_quarter_plus);
UiUtils.expandTouchAreaForViews(tapArea, mAdChoices, mAdsRemovalIcon);
UiUtils.expandTouchAreaForViews(tapArea, mAdChoices);
int crossArea = res.getDimensionPixelSize(R.dimen.margin_base_plus);
UiUtils.expandTouchAreaForView(mAdsRemovalIcon, tapArea, crossArea, tapArea, crossArea);
}
private void handlePrivacyInfoUrl()