Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckFarm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
LuckFarm
Commits
fd0ab9d0
Commit
fd0ab9d0
authored
Nov 12, 2020
by
Mazy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ad in alert
parent
87dd3a5b
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
20 deletions
+60
-20
GYGiftAlertView.m
GYDemo/GYDemo/Alert/GYGiftAlertView.m
+26
-0
GYGiftAlertView.xib
GYDemo/GYDemo/Alert/GYGiftAlertView.xib
+16
-6
GYGiftCell.xib
GYDemo/GYDemo/Alert/GYGiftCell.xib
+5
-4
AppDelegate.mm
GYDemo/GYDemo/AppDelegate.mm
+1
-1
wechat_login_logo_icon@2x.png
...at_login_logo_icon.imageset/wechat_login_logo_icon@2x.png
+0
-0
wechat_login_logo_icon@3x.png
...at_login_logo_icon.imageset/wechat_login_logo_icon@3x.png
+0
-0
Main.storyboard
GYDemo/GYDemo/Base.lproj/Main.storyboard
+2
-2
GYPrefixHeader.pch
GYDemo/GYDemo/GYPrefixHeader.pch
+8
-0
GYSettingViewController.m
GYDemo/GYDemo/ViewController/GYSettingViewController.m
+2
-7
UserInterfaceState.xcuserstate
...cuserdata/mazy.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
No files found.
GYDemo/GYDemo/Alert/GYGiftAlertView.m
View file @
fd0ab9d0
...
...
@@ -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
{
...
...
GYDemo/GYDemo/Alert/GYGiftAlertView.xib
View file @
fd0ab9d0
...
...
@@ -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=
"24
3"
width=
"381"
height=
"41
0"
/>
<rect
key=
"frame"
x=
"16.5"
y=
"24
8"
width=
"381"
height=
"40
0"
/>
<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=
"3
43
.5"
width=
"274"
height=
"51"
/>
<rect
key=
"frame"
x=
"53.5"
y=
"3
34
.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=
"13
9"
y=
"5
5"
/>
<point
key=
"canvasLocation"
x=
"13
7.68115942028987"
y=
"54.91071428571428
5"
/>
</view>
</objects>
<resources>
...
...
GYDemo/GYDemo/Alert/GYGiftCell.xib
View file @
fd0ab9d0
...
...
@@ -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=
"7
4"
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=
"calibrated
RGB"
/>
<rect
key=
"frame"
x=
"7
1.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=
"s
RGB"
/>
</label>
</subviews>
</view>
...
...
GYDemo/GYDemo/AppDelegate.mm
View file @
fd0ab9d0
...
...
@@ -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];
...
...
GYDemo/GYDemo/Assets.xcassets/setting/wechat_login_logo_icon.imageset/wechat_login_logo_icon@2x.png
View replaced file @
87dd3a5b
View file @
fd0ab9d0
60.2 KB
|
W:
|
H:
79 KB
|
W:
|
H:
2-up
Swipe
Onion skin
GYDemo/GYDemo/Assets.xcassets/setting/wechat_login_logo_icon.imageset/wechat_login_logo_icon@3x.png
View replaced file @
87dd3a5b
View file @
fd0ab9d0
137 KB
|
W:
|
H:
164 KB
|
W:
|
H:
2-up
Swipe
Onion skin
GYDemo/GYDemo/Base.lproj/Main.storyboard
View file @
fd0ab9d0
...
...
@@ -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>
...
...
GYDemo/GYDemo/GYPrefixHeader.pch
View file @
fd0ab9d0
...
...
@@ -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]
...
...
GYDemo/GYDemo/ViewController/GYSettingViewController.m
View file @
fd0ab9d0
...
...
@@ -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
];
}
...
...
farm.xcworkspace/xcuserdata/mazy.xcuserdatad/UserInterfaceState.xcuserstate
View file @
fd0ab9d0
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment