[iOS] Fixed present/dismiss order of All Pass subscription view from promo screen

https://jira.mail.ru/browse/MAPSME-12611
This commit is contained in:
Alexander Boriskov 2019-12-09 15:30:19 +03:00 committed by Arsentiy Milchakov
parent 6fe8587c7e
commit 68f5096487
4 changed files with 15 additions and 3 deletions

View file

@ -275,6 +275,8 @@
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="allPassSubscriptionDiscountBackground"/>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="discountText"/>
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="bold17"/>
</userDefinedRuntimeAttributes>
</label>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wL2-uQ-ivp" userLabel="Restore">
@ -400,6 +402,7 @@
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.5" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="TaY-K1-Hdb" firstAttribute="width" secondItem="OgE-tu-SWu" secondAttribute="width" id="5EU-Ae-NUs"/>
<constraint firstAttribute="bottom" secondItem="TaY-K1-Hdb" secondAttribute="bottom" id="R5w-2Q-dOF"/>

View file

@ -61,6 +61,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (UIColor *)subscriptionCellBackground;
+ (UIColor *)subscriptionCellTitle;
+ (UIColor *)discountBackground;
+ (UIColor *)discountText;
+ (UIColor *)bookmarkSubscriptionScrollBackground;
+ (UIColor *)bookmarkSubscriptionBackground;
+ (UIColor *)bookmarkSubscriptionFooterBackground;

View file

@ -60,6 +60,7 @@ static UIColor * color(SEL cmd) {
@"bannerBackground" : [UIColor colorWithRed:scaled(249) green:scaled(251) blue:scaled(231) alpha:alpha100],
@"border" : [UIColor colorWithWhite:0. alpha:alpha04],
@"discountBackground" : [UIColor colorWithRed:scaled(240) green:scaled(100) blue:scaled(60) alpha:alpha100],
@"discountText" : [UIColor colorWithRed:scaled(60) green:scaled(64) blue:scaled(68) alpha:alpha100],
@"bookmarkSubscriptionBackground" : [UIColor colorWithRed:scaled(240) green:scaled(252) blue:scaled(255) alpha:alpha100],
@"bookmarkSubscriptionScrollBackground" : [UIColor colorWithRed:scaled(137) green:scaled(217) blue:scaled(255) alpha:alpha100],
@"bookmarkSubscriptionFooterBackground" : [UIColor colorWithRed:scaled(47) green:scaled(58) blue:scaled(73) alpha:alpha100],
@ -114,6 +115,7 @@ static UIColor * color(SEL cmd) {
@"bannerBackground" : [UIColor colorWithRed:scaled(71) green:scaled(75) blue:scaled(79) alpha:alpha100],
@"border" : [UIColor colorWithWhite:1. alpha:alpha04],
@"discountBackground" : [UIColor colorWithRed:scaled(240) green:scaled(100) blue:scaled(60) alpha:alpha100],
@"discountText" : [UIColor colorWithRed:scaled(60) green:scaled(64) blue:scaled(68) alpha:alpha100],
@"bookmarkSubscriptionBackground" : [UIColor colorWithRed:scaled(60.) green:scaled(64.) blue:scaled(68.) alpha:alpha100],
@"bookmarkSubscriptionScrollBackground" : [UIColor colorWithRed:scaled(137) green:scaled(217) blue:scaled(255) alpha:alpha100],
@"bookmarkSubscriptionFooterBackground" : [UIColor colorWithRed:scaled(47) green:scaled(58) blue:scaled(73) alpha:alpha100],
@ -428,6 +430,11 @@ static UIColor * color(SEL cmd) {
return color(_cmd);
}
+ (UIColor *)discountText
{
return color(_cmd);
}
+ (UIColor *)bookmarkSubscriptionScrollBackground
{
return color(_cmd);

View file

@ -40,15 +40,16 @@ extension PromoDiscoveryRouter: IPromoDiscoveryRouter {
}
private func presentPromoDiscoverySubscribe() {
guard let viewController = viewController else {
guard let rootViewController = rootViewController else {
return;
}
dissmiss()
let subscribeViewController = SubscriptionViewBuilder.build(type: .allPass,
parentViewController: viewController,
parentViewController: rootViewController,
source: kStatOnboardingGuidesSubscription,
successDialog: .goToCatalog,
completion: nil)
viewController.present(subscribeViewController, animated: true)
rootViewController.present(subscribeViewController, animated: true)
}
private func presentPromoDiscoveryFree() {