Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
80b5e714
Commit
80b5e714
authored
May 31, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-73: native ad layout.
parent
a3a4eb93
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
96 additions
and
0 deletions
+96
-0
1Weather/Ads/Native/BRNativeBannerView.swift
+20
-0
1Weather/Ads/Native/BRNativeBannerView.xib
+0
-0
1Weather/Resources/Assets.xcassets/ads/Contents.json
+6
-0
1Weather/Resources/Assets.xcassets/ads/native_ad_ad_choices.imageset/Contents.json
+15
-0
1Weather/Resources/Assets.xcassets/ads/native_ad_ad_choices.imageset/group4Copy2.pdf
+0
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/ads/Contents.json
+6
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/ads/native_ad_call_to_action_background.colorset/Contents.json
+38
-0
1Weather/Resources/en.lproj/Localizable.strings
+3
-0
1Weather/UI/Helpers/Themes/DefaultTheme.swift
+5
-0
1Weather/UI/Helpers/Themes/ThemeProtocol.swift
+3
-0
No files found.
1Weather/Ads/Native/BRNativeBannerView.swift
View file @
80b5e714
...
...
@@ -10,14 +10,33 @@ import Foundation
import
GoogleMobileAds
class
BRNativeBannerView
:
GADNativeAdView
{
@IBOutlet
weak
var
sponsoredLabel
:
UILabel
!
@IBOutlet
weak
var
adChoicesViewCustomOutlet
:
GADAdChoicesView
!
class
func
instantiateWithXib
()
->
BRNativeBannerView
?
{
let
nib
=
UINib
(
nibName
:
"
\(
BRNativeBannerView
.
self
)
"
,
bundle
:
nil
)
let
bView
=
nib
.
instantiate
(
withOwner
:
self
,
options
:
nil
)
.
first
as?
BRNativeBannerView
bView
?
.
setupPostXib
()
return
bView
}
private
func
setupPostXib
()
{
let
currentTheme
=
ThemeManager
.
currentTheme
self
.
callToActionView
?
.
backgroundColor
=
currentTheme
.
nativeAdCallToActionColor
self
.
callToActionView
?
.
layer
.
cornerRadius
=
2
self
.
callToActionView
?
.
clipsToBounds
=
true
(
self
.
headlineView
as?
UILabel
)?
.
textColor
=
currentTheme
.
primaryTextColor
(
self
.
advertiserView
as?
UILabel
)?
.
textColor
=
currentTheme
.
primaryTextColor
self
.
adChoicesView
=
self
.
adChoicesViewCustomOutlet
sponsoredLabel
.
text
=
"ads.native.sponsored"
.
localized
()
sponsoredLabel
.
textColor
=
currentTheme
.
primaryTextColor
}
var
nativeAdItem
:
NativeAdItem
?
{
willSet
{
self
.
adChoicesView
=
self
.
adChoicesViewCustomOutlet
}
didSet
{
nativeAd
=
nativeAdItem
?
.
nativeAd
setupView
()
...
...
@@ -29,6 +48,7 @@ class BRNativeBannerView: GADNativeAdView {
(
iconView
as?
UIImageView
)?
.
image
=
nativeAd
?
.
icon
?
.
image
(
advertiserView
as?
UILabel
)?
.
text
=
nativeAd
?
.
advertiser
(
callToActionView
as?
UILabel
)?
.
text
=
nativeAd
?
.
callToAction
setupPostXib
()
}
}
...
...
1Weather/Ads/Native/BRNativeBannerView.xib
View file @
80b5e714
This diff is collapsed.
Click to expand it.
1Weather/Resources/Assets.xcassets/ads/Contents.json
0 → 100644
View file @
80b5e714
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/Assets.xcassets/ads/native_ad_ad_choices.imageset/Contents.json
0 → 100644
View file @
80b5e714
{
"images"
:
[
{
"filename"
:
"group4Copy2.pdf"
,
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
},
"properties"
:
{
"template-rendering-intent"
:
"template"
}
}
1Weather/Resources/Assets.xcassets/ads/native_ad_ad_choices.imageset/group4Copy2.pdf
0 → 100644
View file @
80b5e714
File added
1Weather/Resources/OneWeatherColorsAsset.xcassets/ads/Contents.json
0 → 100644
View file @
80b5e714
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/ads/native_ad_call_to_action_background.colorset/Contents.json
0 → 100644
View file @
80b5e714
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.286"
,
"green"
:
"0.434"
,
"red"
:
"0.182"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.286"
,
"green"
:
"0.434"
,
"red"
:
"0.182"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/en.lproj/Localizable.strings
View file @
80b5e714
...
...
@@ -268,3 +268,6 @@
// Humidity type, for smart texts
"humidity.type.high" = "high";
"humidity.type.low" = "low";
// Ads
"ads.native.sponsored" = "Sponsored";
1Weather/UI/Helpers/Themes/DefaultTheme.swift
View file @
80b5e714
...
...
@@ -115,4 +115,9 @@ struct DefaultTheme: ThemeProtocol {
var
mapControlsColor
:
UIColor
{
return
UIColor
(
named
:
"map_controls_color"
)
??
.
red
}
//Ads
var
nativeAdCallToActionColor
:
UIColor
{
return
UIColor
(
named
:
"native_ad_call_to_action_background"
)
??
.
red
}
}
1Weather/UI/Helpers/Themes/ThemeProtocol.swift
View file @
80b5e714
...
...
@@ -49,4 +49,7 @@ public protocol ThemeProtocol {
//Map
var
mapControlsColor
:
UIColor
{
get
}
//Ads
var
nativeAdCallToActionColor
:
UIColor
{
get
}
}
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