forked from organicmaps/organicmaps
[ads][android] mastercard-sberbank banner with dummies for ui is added
This commit is contained in:
parent
11464dc78e
commit
873af89e81
4 changed files with 27 additions and 4 deletions
|
@ -69,6 +69,20 @@ 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,
|
||||
R.color.white_primary,
|
||||
R.color.skyeng_button))
|
||||
{
|
||||
@NonNull
|
||||
@Override
|
||||
public String toStatisticValue()
|
||||
{
|
||||
return Statistics.ParamValue.MASTERCARD_SBERBANK;
|
||||
}
|
||||
};
|
||||
|
||||
@NonNull
|
||||
|
|
|
@ -34,6 +34,7 @@ public final class DownloaderPromoBanner
|
|||
case 6: return DownloaderBannerType.MTS;
|
||||
case 7: return DownloaderBannerType.SKYENG;
|
||||
case 8: return DownloaderBannerType.BOOKMARK_CATALOG;
|
||||
case 9: return DownloaderBannerType.MASTERCARD_SBERBANK;
|
||||
default: throw new AssertionError("Incorrect core banner type: " + coreValue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
|||
@NonNull
|
||||
private final View mBannerContainer;
|
||||
@NonNull
|
||||
private final View mBannerContainerBigLogo;
|
||||
@NonNull
|
||||
private final View mPromoContentDivider;
|
||||
|
||||
private int mStorageSubscriptionSlot;
|
||||
|
@ -294,6 +296,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
|||
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);
|
||||
}
|
||||
|
||||
private void updateBannerVisibility()
|
||||
|
@ -306,18 +310,21 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
|||
|
||||
if (!isMapDownloading(mCurrentCountry) || !isPromoFound)
|
||||
{
|
||||
UiUtils.hide(mPromoContentDivider, mBannerContainer, mCatalogCallToActionContainer);
|
||||
UiUtils.hide(mPromoContentDivider, mBannerContainer, mBannerContainerBigLogo,
|
||||
mCatalogCallToActionContainer);
|
||||
return;
|
||||
}
|
||||
UiUtils.show(mPromoContentDivider);
|
||||
|
||||
boolean hasCatalogPromo = mPromoBanner.getType() == DownloaderBannerType.BOOKMARK_CATALOG;
|
||||
boolean hasBigLogo = mPromoBanner.getType() == DownloaderBannerType.MASTERCARD_SBERBANK;
|
||||
|
||||
View bannerView = hasCatalogPromo ? mCatalogCallToActionContainer : mBannerContainer;
|
||||
View bannerView = hasCatalogPromo ? mCatalogCallToActionContainer
|
||||
: hasBigLogo ? mBannerContainerBigLogo : mBannerContainer;
|
||||
mPromoBanner.getType().getViewConfigStrategy().configureView(bannerView, R.id.icon, R.id.text,
|
||||
R.id.banner_button);
|
||||
UiUtils.showIf(!hasCatalogPromo, mBannerContainer);
|
||||
UiUtils.showIf(hasCatalogPromo, mCatalogCallToActionContainer);
|
||||
UiUtils.hide(mCatalogCallToActionContainer, mBannerContainerBigLogo, mBannerContainer);
|
||||
UiUtils.show(bannerView);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -783,6 +783,7 @@ public enum Statistics
|
|||
public static final String TINKOFF_ALL_AIRLINES = "Tinkoff_AllAirlines";
|
||||
public static final String SKYENG = "Skyeng";
|
||||
public static final String MTS = "MTS";
|
||||
public static final String MASTERCARD_SBERBANK = "MastercardSberbank";
|
||||
public static final String WIKIPEDIA = "wikipedia";
|
||||
public static final String PREVIEW = "preview";
|
||||
public static final String FULL = "full";
|
||||
|
|
Loading…
Add table
Reference in a new issue