Added Halloween sponsored objects

This commit is contained in:
r.kuznetsov 2017-10-13 17:40:53 +03:00 committed by Vlad Mihaylenko
parent 197a99e1ad
commit 4e15406cc2
10 changed files with 21 additions and 3 deletions

View file

@ -1478,7 +1478,8 @@ public class PlacePageView extends RelativeLayout
mTvSponsoredPrice.setText(mSponsoredPrice);
UiUtils.showIf(!isPriceEmpty, mTvSponsoredPrice);
UiUtils.showIf((!isRatingEmpty || !isPriceEmpty) &&
mSponsored.getType() != Sponsored.TYPE_THOR, mPreviewRatingInfo);
mSponsored.getType() != Sponsored.TYPE_THOR &&
mSponsored.getType() != Sponsored.TYPE_HALLOWEEN, mPreviewRatingInfo);
}
}

View file

@ -29,10 +29,11 @@ public final class Sponsored
public static final int TYPE_VIATOR = 4;
public static final int TYPE_CIAN = 5;
public static final int TYPE_THOR = 6;
public static final int TYPE_HALLOWEEN = 7;
@Retention(RetentionPolicy.SOURCE)
@IntDef({ TYPE_NONE, TYPE_BOOKING, TYPE_OPENTABLE, TYPE_GEOCHAT,
TYPE_VIATOR, TYPE_CIAN, TYPE_THOR })
TYPE_VIATOR, TYPE_CIAN, TYPE_THOR, TYPE_HALLOWEEN })
public @interface SponsoredType {}
private static class Price

View file

@ -95,6 +95,7 @@ import static com.mapswithme.util.statistics.Statistics.ParamValue.GEOCHAT;
import static com.mapswithme.util.statistics.Statistics.ParamValue.OPENTABLE;
import static com.mapswithme.util.statistics.Statistics.ParamValue.SEARCH_BOOKING_COM;
import static com.mapswithme.util.statistics.Statistics.ParamValue.THOR;
import static com.mapswithme.util.statistics.Statistics.ParamValue.HALLOWEEN;
import static com.mapswithme.util.statistics.Statistics.ParamValue.VIATOR;
public enum Statistics
@ -368,6 +369,7 @@ public enum Statistics
public static final String GEOCHAT = "Geochat";
public static final String CIAN = "Cian.Ru";
public static final String THOR = "Thor";
public static final String HALLOWEEN = "Halloween";
public static final String NO_PRODUCTS = "no_products";
public static final String ADD = "add";
public static final String EDIT = "edit";
@ -811,6 +813,8 @@ public enum Statistics
return CIAN;
case Sponsored.TYPE_THOR:
return THOR;
case Sponsored.TYPE_HALLOWEEN:
return HALLOWEEN;
case Sponsored.TYPE_NONE:
return "N/A";
default:

View file

@ -22,6 +22,7 @@ SPONSORED_CHECKER(IsBookingChecker, "booking");
SPONSORED_CHECKER(IsOpentableChecker, "opentable");
SPONSORED_CHECKER(IsViatorChecker, "viator");
SPONSORED_CHECKER(IsThorChecker, "thor");
SPONSORED_CHECKER(IsHalloweenChecker, "halloween");
#undef SPONSORED_CHECKER
} // namespace ftypes

View file

@ -116,6 +116,7 @@ static NSString * const kStatFromLocation = @"from_location";
static NSString * const kStatFromMyPosition = @"From my position";
static NSString * const kStatGo = @"Go";
static NSString * const kStatGoogle = @"Google";
static NSString * const kStatHalloween = @"Halloween";
static NSString * const kStatHelp = @"Help";
static NSString * const kStatHidden = @"Hidden";
static NSString * const kStatHistory = @"History";

View file

@ -247,6 +247,7 @@ using CianIsReady = void (^)(NSArray<MWMCianItemModel *> * items);
- (BOOL)isViator;
- (BOOL)isCian;
- (BOOL)isThor;
- (BOOL)isHalloween;
- (BOOL)isBookingSearch;
- (BOOL)isHTMLDescription;
- (BOOL)isMyPosition;

View file

@ -766,6 +766,7 @@ using namespace place_page;
- (BOOL)isViator { return m_info.GetSponsoredType() == SponsoredType::Viator; }
- (BOOL)isCian { return m_info.GetSponsoredType() == SponsoredType::Cian; }
- (BOOL)isThor { return m_info.GetSponsoredType() == SponsoredType::Thor; }
- (BOOL)isHalloween { return m_info.GetSponsoredType() == SponsoredType::Halloween; }
- (BOOL)isBookingSearch { return !m_info.GetBookingSearchUrl().empty(); }
- (BOOL)isMyPosition { return m_info.IsMyPosition(); }
- (BOOL)isHTMLDescription { return strings::IsHTML(m_info.GetBookmarkData().GetDescription()); }

View file

@ -254,6 +254,8 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName)
parameters[kStatProvider] = kStatCian;
else if (data.isThor)
parameters[kStatProvider] = kStatThor;
else if (data.isHalloween)
parameters[kStatProvider] = kStatHalloween;
switch (Platform::ConnectionStatus())
{
case Platform::EConnectionType::CONNECTION_NONE:

View file

@ -916,6 +916,11 @@ void Framework::FillInfoFromFeatureType(FeatureType const & ft, place_page::Info
info.SetSponsoredDescriptionUrl(url);
GetPlatform().GetMarketingService().SendPushWooshTag(marketing::kSponsoredThorDiscovered);
}
else if (ftypes::IsHalloweenChecker::Instance()(ft) &&
!info.GetMetadata().Get(feature::Metadata::FMD_RATING).empty())
{
info.SetSponsoredType(place_page::SponsoredType::Halloween);
}
FillLocalExperts(ft, info);

View file

@ -39,7 +39,8 @@ enum class SponsoredType
Geochat,
Viator,
Cian,
Thor
Thor,
Halloween
};
enum class LocalAdsStatus