Commit fd0ab9d0 authored by Mazy's avatar Mazy

add ad in alert

parent 87dd3a5b
......@@ -15,6 +15,8 @@
@property (nonatomic, weak) IBOutlet UIView * giftBgView;
@property (nonatomic, weak) IBOutlet UICollectionView * collectionView;
@property (nonatomic, strong) NSMutableArray * dataSource;
// 广告父视图
@property (weak, nonatomic) IBOutlet UIView *adContentView;
@end
......@@ -120,6 +122,30 @@
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
animation.values = values;
[_bgView.layer addAnimation:animation forKey:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//: 开始显示广告
[self getAdsDataSource];
[UIView animateWithDuration:0.25 animations:^{
self.bgView.transform = CGAffineTransformMakeTranslation(0, -160);
self.adContentView.transform = CGAffineTransformMakeTranslation(0, -160);
} completion:^(BOOL finished) {
}];
});
}
- (void)getAdsDataSource{
[IOSADManager shareADManager].nativeADSize = self.adContentView.frame.size;
[IOSADManager shareADManager].flowBgView = self.adContentView;
[[IOSADManager shareADManager] showADType:ADType_BigImage resultBlock:^(BOOL success) {
if (success) {
UIView * flowView = [IOSADManager shareADManager].flowBgView;
[self.adContentView addSubview:flowView];
}
}];
}
- (void)dismiss{
......
......@@ -16,13 +16,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4qd-2X-2kQ">
<rect key="frame" x="16.5" y="243" width="381" height="410"/>
<rect key="frame" x="16.5" y="248" width="381" height="400"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_bg" translatesAutoresizingMaskIntoConstraints="NO" id="wec-0m-x6P">
<rect key="frame" x="5" y="77.5" width="371" height="342.5"/>
<rect key="frame" x="5" y="68.5" width="371" height="341.5"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LPX-8e-GMj">
<rect key="frame" x="18" y="97.5" width="345" height="228"/>
<rect key="frame" x="18" y="88.5" width="345" height="228"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_mask" translatesAutoresizingMaskIntoConstraints="NO" id="KPA-TL-pwU">
<rect key="frame" x="-5" y="5" width="355" height="228"/>
......@@ -54,7 +54,7 @@
<rect key="frame" x="0.0" y="0.0" width="381" height="155"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BUz-Se-wQ9">
<rect key="frame" x="53.5" y="343.5" width="274" height="51"/>
<rect key="frame" x="53.5" y="334.5" width="274" height="51"/>
<constraints>
<constraint firstAttribute="width" secondItem="BUz-Se-wQ9" secondAttribute="height" multiplier="248:46" id="uTK-td-geA"/>
</constraints>
......@@ -93,7 +93,13 @@
<constraint firstItem="BUz-Se-wQ9" firstAttribute="centerX" secondItem="4qd-2X-2kQ" secondAttribute="centerX" id="knU-rg-TaD"/>
<constraint firstItem="eUM-sc-sxa" firstAttribute="top" secondItem="4qd-2X-2kQ" secondAttribute="top" id="nyB-YC-6VU"/>
<constraint firstAttribute="trailing" secondItem="pFs-il-GHF" secondAttribute="trailing" id="q4z-J4-zcg"/>
<constraint firstAttribute="height" constant="410" id="wZn-q9-oL7"/>
<constraint firstAttribute="height" constant="400" id="wZn-q9-oL7"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KW0-bM-2mY">
<rect key="frame" x="16.5" y="668" width="381" height="180"/>
<constraints>
<constraint firstAttribute="height" constant="180" id="sfE-Ry-Myq"/>
</constraints>
</view>
</subviews>
......@@ -102,15 +108,19 @@
<constraints>
<constraint firstItem="4qd-2X-2kQ" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="BuY-52-3kA"/>
<constraint firstItem="4qd-2X-2kQ" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="T8i-u3-YxH"/>
<constraint firstItem="KW0-bM-2mY" firstAttribute="width" secondItem="4qd-2X-2kQ" secondAttribute="width" id="cAQ-hS-m2K"/>
<constraint firstItem="KW0-bM-2mY" firstAttribute="top" secondItem="4qd-2X-2kQ" secondAttribute="bottom" constant="20" id="da2-2m-oH6"/>
<constraint firstItem="4qd-2X-2kQ" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="345:375" id="e7x-gN-1Fq"/>
<constraint firstItem="KW0-bM-2mY" firstAttribute="centerX" secondItem="4qd-2X-2kQ" secondAttribute="centerX" id="vmL-Jj-Q66"/>
</constraints>
<connections>
<outlet property="adContentView" destination="KW0-bM-2mY" id="vLT-yw-Ftk"/>
<outlet property="bgView" destination="4qd-2X-2kQ" id="V1H-AG-zkx"/>
<outlet property="collectionView" destination="3gA-JC-WLJ" id="QYw-PO-Wt5"/>
<outlet property="giftBgView" destination="LPX-8e-GMj" id="SKz-Gu-Z9N"/>
<outlet property="giftHeaderImv" destination="pFs-il-GHF" id="4Up-9f-Cqu"/>
</connections>
<point key="canvasLocation" x="139" y="55"/>
<point key="canvasLocation" x="137.68115942028987" y="54.910714285714285"/>
</view>
</objects>
<resources>
......
......@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -20,10 +21,10 @@
<rect key="frame" x="61" y="48" width="41" height="46"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kiQ-IN-LG2">
<rect key="frame" x="74" y="104" width="15.5" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<color key="highlightedColor" red="0.5607843137254902" green="0.29803921568627451" blue="0.027450980392156862" alpha="0.5" colorSpace="calibratedRGB"/>
<rect key="frame" x="71.5" y="104" width="20.5" height="23"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="19"/>
<color key="textColor" red="0.56078431370000004" green="0.29803921570000003" blue="0.027450980390000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="highlightedColor" red="0.5607843137254902" green="0.29803921568627451" blue="0.027450980392156862" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label>
</subviews>
</view>
......
......@@ -710,7 +710,7 @@ NSDictionary* appLaunchOpts;
NSString *status = [[CGUserManager shared].appSwitch[@"isopenH5"] stringValue];
NSLog(@"isopenH5 = %@", status);
if (![status isEqualToString:@"1"]) {
if ([status isEqualToString:@"1"]) {
Data * data = [[Data alloc] init];
if([[data Read] objectForKey:@"refresh_token"] == nil) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(launchAdSuccesShow) name:LaunchAdSuccesShow object:nil];
......
......@@ -51,7 +51,7 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="wechat_login_logo_icon" translatesAutoresizingMaskIntoConstraints="NO" id="iEN-Z8-WSa">
<rect key="frame" x="147.5" y="197" width="119.5" height="146.5"/>
<rect key="frame" x="147.5" y="197" width="119" height="146.5"/>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HN2-80-MUu">
<rect key="frame" x="78" y="823" width="258" height="29"/>
......@@ -126,7 +126,7 @@
<resources>
<image name="wechat_login_bg" width="375" height="667"/>
<image name="wechat_login_btn_bg" width="247" height="59.5"/>
<image name="wechat_login_logo_icon" width="119.5" height="146.5"/>
<image name="wechat_login_logo_icon" width="119" height="146.5"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
......
......@@ -46,8 +46,16 @@
#define kSplashAdViewDismissed @"SplashAdViewDismissed"
#ifdef DEBUG
#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define NSLog(format, ...) nil
#endif
#define kColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kColorWithRGB(r, g, b) [UIColor colorWithRed:(r) / 255.f green:(g) / 255.f blue:(b) / 255.f alpha:1.f]
......
......@@ -80,16 +80,11 @@
_tableView.layer.borderColor = [UIColor colorWithRed:153/255.0 green:74/255.0 blue:0/255.0 alpha:1.0].CGColor;
_tableView.layer.cornerRadius = 8;
_tableView.scrollEnabled = NO;
if (@available(iOS 11.0, *)) {
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
_idLab.text = [NSString stringWithFormat:@"ID: %@", [CGUserManager shared].uid];
[self getAdsDataSource];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment