Themeing for premium dialog.

This commit is contained in:
Samuel Clay 2017-11-15 10:47:57 -08:00
parent 0f03eee57d
commit defa540c85
4 changed files with 27 additions and 9 deletions

View file

@ -160,7 +160,7 @@ static UIFont *userLabelFont;
self.notifier.topOffsetConstraint = [NSLayoutConstraint constraintWithItem:self.notifier attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.feedViewToolbar attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:self.notifier.topOffsetConstraint];
// self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.feedTitlesTable.separatorColor = [UIColor clearColor];
userAvatarButton.customView.hidden = YES;
@ -979,7 +979,7 @@ static UIFont *userLabelFont;
[self layoutHeaderCounts:0];
[self refreshHeaderCounts];
// self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
[self.feedTitlesTable reloadData];
[self resetupGestures];

View file

@ -18,6 +18,7 @@
NSArray *reasons;
SKProductsRequest *request;
}
@property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate;
@ -31,6 +32,8 @@
@property (nonatomic) IBOutlet UIView *premiumView;
@property (nonatomic) IBOutlet SAConfettiView *confettiView;
@property (nonatomic) IBOutlet NSLayoutConstraint *productsHeight;
@property (nonatomic) IBOutlet UILabel *labelTitle;
@property (nonatomic) IBOutlet UILabel *labelSubtitle;
- (IBAction)closeDialog:(id)sender;

View file

@ -29,6 +29,8 @@
@synthesize premiumView;
@synthesize confettiView;
@synthesize productsHeight;
@synthesize labelTitle;
@synthesize labelSubtitle;
- (void)viewDidLoad {
[super viewDidLoad];
@ -65,16 +67,24 @@
[super viewWillAppear:animated];
self.navigationItem.title = appDelegate.isPremium ? @"Premium Account" : @"Upgrade to Premium";
[self loadProducts];
[self updateTheme];
}
- (void)closeDialog:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)viewDidLayoutSubviews
{
// productsHeight.constant = self.productsTable.contentSize.height;
[self.view layoutIfNeeded];
- (void)updateTheme {
[super updateTheme];
self.productsTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.reasonsTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.labelTitle.textColor = UIColorFromRGB(0x0c0c0c);
self.labelSubtitle.textColor = UIColorFromRGB(0x0c0c0c);
[self.productsTable reloadData];
[self.reasonsTable reloadData];
}
#pragma mark - StoreKit
@ -259,9 +269,11 @@
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ReasonsCellIndentifier];
}
cell.backgroundColor = UIColorFromRGB(0xf4f4f4);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.text = reasons[indexPath.row][0];
cell.textLabel.font = [UIFont systemFontOfSize:14.f weight:UIFontWeightLight];
cell.textLabel.textColor = UIColorFromRGB(0x0c0c0c);
cell.textLabel.numberOfLines = 2;
CGSize itemSize = CGSizeMake(18, 18);
cell.imageView.image = [UIImage imageNamed:reasons[indexPath.row][1]];
@ -282,8 +294,10 @@
SKProduct *product = products[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
cell.backgroundColor = UIColorFromRGB(0xf4f4f4);
cell.textLabel.numberOfLines = 2;
cell.textLabel.textColor = UIColorFromRGB(0x203090);
cell.textLabel.textColor = UIColorFromRGB(0x203070);
cell.detailTextLabel.textColor = UIColorFromRGB(0x0c0c0c);
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];

View file

@ -18,6 +18,8 @@
<connections>
<outlet property="confettiView" destination="TFM-k9-HJ2" id="Xqn-VR-200"/>
<outlet property="freeView" destination="vys-ne-LmS" id="EUB-JT-1vy"/>
<outlet property="labelSubtitle" destination="wHV-Eo-ith" id="BeK-G5-G9j"/>
<outlet property="labelTitle" destination="bVF-I1-nis" id="0Eg-04-NaQ"/>
<outlet property="premiumView" destination="rCC-u8-EID" id="SRr-a7-DrJ"/>
<outlet property="productsHeight" destination="Gta-B6-eUD" id="nYZ-wi-Pfc"/>
<outlet property="productsTable" destination="0Bc-Oc-gNV" id="9R5-FZ-rK7"/>
@ -120,7 +122,6 @@
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.96769907994923854" green="0.96769907994923854" blue="0.96769907994923854" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="fn0-sC-cuM" secondAttribute="bottom" id="2Bj-WY-sdY"/>
<constraint firstItem="yBE-Kx-Lyj" firstAttribute="centerY" secondItem="0Bc-Oc-gNV" secondAttribute="centerY" id="A3t-Kf-7rY"/>