Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy Cleaner Junk
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
wanglei
Easy Cleaner Junk
Commits
737e29b8
Commit
737e29b8
authored
Aug 02, 2024
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步广告需求
parent
e0c362aa
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
445 additions
and
103 deletions
+445
-103
MaxAdUtils.kt
...ava/com/test/easy/easycleanerjunk/helps/ads/MaxAdUtils.kt
+230
-99
DialogViews.kt
...in/java/com/test/easy/easycleanerjunk/view/DialogViews.kt
+2
-2
FileScanDialog.kt
...java/com/test/easy/easycleanerjunk/view/FileScanDialog.kt
+1
-1
bg_ad_button.xml
app/src/main/res/drawable/bg_ad_button.xml
+1
-1
bg_theme_10.xml
app/src/main/res/drawable/bg_theme_10.xml
+5
-0
layout_max_native_big.xml
app/src/main/res/layout/layout_max_native_big.xml
+100
-0
layout_max_native_small.xml
app/src/main/res/layout/layout_max_native_small.xml
+106
-0
No files found.
app/src/main/java/com/test/easy/easycleanerjunk/helps/ads/MaxAdUtils.kt
View file @
737e29b8
...
...
@@ -2,8 +2,11 @@ package com.test.easy.easycleanerjunk.helps.ads
import
android.app.Activity
import
android.app.Dialog
import
android.content.Context
import
android.os.Bundle
import
android.util.Log
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
com.applovin.mediation.MaxAd
import
com.applovin.mediation.MaxAdListener
import
com.applovin.mediation.MaxAdRevenueListener
...
...
@@ -13,6 +16,7 @@ import com.applovin.mediation.ads.MaxInterstitialAd
import
com.applovin.mediation.nativeAds.MaxNativeAdListener
import
com.applovin.mediation.nativeAds.MaxNativeAdLoader
import
com.applovin.mediation.nativeAds.MaxNativeAdView
import
com.applovin.mediation.nativeAds.MaxNativeAdViewBinder
import
com.facebook.appevents.AppEventsConstants
import
com.facebook.appevents.AppEventsLogger
import
com.google.firebase.analytics.FirebaseAnalytics
...
...
@@ -31,9 +35,6 @@ object MaxAdUtils {
private
var
openLoadTime
=
Long
.
MAX_VALUE
private
var
interLoadTime
=
Long
.
MAX_VALUE
private
var
nativeLoadTime
=
Long
.
MAX_VALUE
private
var
openAdUnit
=
"1fce760852e47224"
private
var
interAdUnit
=
"636e57ec33ac5698"
private
var
naviteAdUnit
=
"63d874bafb4c4841"
var
mOpenAd
:
MaxAppOpenAd
?
=
null
var
isBlack
=
false
get
()
{
...
...
@@ -43,7 +44,8 @@ object MaxAdUtils {
field
=
value
SPUtils
.
getInstance
().
put
(
"isBlack"
,
value
,
true
)
}
fun
loadAppOpenAd
(
skip
:
Boolean
=
false
,
activity
:
Activity
,
onLoad
:
(()
->
Unit
)?
=
null
)
{
fun
loadAppOpenAd
(
skip
:
Boolean
=
false
,
activity
:
Activity
,
onLoad
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
EventUtils
.
event
(
"blacklist_filter"
)
onLoad
?.
invoke
()
...
...
@@ -57,8 +59,7 @@ object MaxAdUtils {
onLoad
?.
invoke
()
return
}
openAdUnit
=
ConfigHelper
.
openMaxId
mOpenAd
=
MaxAppOpenAd
(
openAdUnit
,
BaseApplication
.
context
)
mOpenAd
=
MaxAppOpenAd
(
ConfigHelper
.
openMaxId
,
BaseApplication
.
context
)
if
(
isOpenAdLoaded
()
||
skip
)
{
onLoad
?.
invoke
()
return
...
...
@@ -76,24 +77,22 @@ object MaxAdUtils {
maxAdPullReport
(
p0
,
"openAd"
,
reqId
=
reqId
)
}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{
}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{}
override
fun
onAdHidden
(
p0
:
MaxAd
)
{}
override
fun
onAdClicked
(
p0
:
MaxAd
)
{}
override
fun
onAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
mOpenAd
=
null
mOpenAd
=
null
maxAdPullReport
(
null
,
"AppOpenAd"
,
p1
.
message
)
// Log.e("MXL", "onAdLoadFailed: " + p1
)
Log
.
e
(
"MXL"
,
"onAdLoadFailed: "
+
p1
.
message
)
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
if
(
ConfigHelper
.
openAdLoadFail
==
1
)
{
showInterstitialAd
(
activity
){
if
(
ConfigHelper
.
openAdLoadFail
==
1
)
{
showInterstitialAd
(
activity
)
{
onLoad
?.
invoke
()
}
}
else
{
}
else
{
onLoad
?.
invoke
()
}
}
...
...
@@ -162,7 +161,6 @@ object MaxAdUtils {
obj
.
put
(
"reason"
,
p1
.
message
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventUtils
.
event
(
"ad_show_error"
,
ext
=
obj
)
// Log.e("MXL", "onAdDisplayFailed: "+p1.message )
}
})
if
(
isOpenAdLoaded
())
{
...
...
@@ -194,15 +192,6 @@ object MaxAdUtils {
onLoad
?.
invoke
()
return
}
interAdUnit
=
ConfigHelper
.
interMaxId
var
hasDone
=
false
activity
.
window
.
decorView
.
postDelayed
(
Runnable
{
if
(
hasDone
)
{
return
@Runnable
}
hasDone
=
true
onLoad
?.
invoke
()
},
15000
)
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
...
...
@@ -210,18 +199,16 @@ object MaxAdUtils {
obj
.
put
(
"mediation"
,
"applovin"
)
obj
.
put
(
"from"
,
activity
.
javaClass
.
simpleName
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
interAd
=
MaxInterstitialAd
(
interAdUnit
,
activity
)
interAd
=
MaxInterstitialAd
(
ConfigHelper
.
interMaxId
,
activity
)
interAd
?.
setListener
(
object
:
MaxAdListener
{
override
fun
onAdLoaded
(
p0
:
MaxAd
)
{
//Log.e("MXL", "interAd:onAdLoaded: ")
maxAdPullReport
(
p0
,
"InterstitialAd"
)
retryAttempt
=
0
onLoad
?.
invoke
()
}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{
isInterAdShow
=
true
}
override
fun
onAdHidden
(
p0
:
MaxAd
)
{
...
...
@@ -235,7 +222,7 @@ object MaxAdUtils {
maxAdPullReport
(
null
,
"InterstitialAd"
,
p1
.
message
)
onLoad
?.
invoke
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
// Log.e("MXL", "interAdLoadFailed: "+p1.message
)
Log
.
e
(
"MXL"
,
"onAdLoadFailed: "
+
p1
.
message
)
// retryAttempt++
// Handler(Looper.getMainLooper()).postDelayed({
// retryAttempt++
...
...
@@ -275,7 +262,7 @@ object MaxAdUtils {
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"interAd"
)
EventUtils
.
event
(
"ad_prepare_show"
,
ext
=
obj
)
isInterAdShow
=
false
isInterAdShow
=
false
if
(
isAdExpired
())
{
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"interAd"
)
...
...
@@ -290,7 +277,7 @@ object MaxAdUtils {
onHidden
?.
invoke
()
return
}
if
(
i
sInterLoaded
()
)
{
if
(
i
nterAd
!=
null
)
{
interAd
?.
setRevenueListener
(
EventOnPaidEventListener
())
showIntervalDialogAndShowAd
(
activity
,
isLoadAdNow
,
isShowInterVal
,
onHidden
,
0
)
}
else
{
...
...
@@ -389,14 +376,14 @@ object MaxAdUtils {
maxAdShowReport
(
p0
,
"interAd"
,
activity
)
AdDisplayUtils
.
getInstance
().
incrementAdDisplayCount
()
adLastDisplayTime
=
System
.
currentTimeMillis
()
/
1000
isInterAdShow
=
true
isInterAdShow
=
true
}
override
fun
onAdHidden
(
p0
:
MaxAd
)
{
interAd
=
null
onHidden
?.
invoke
()
// loadInterstitialAd(activity)
isInterAdShow
=
false
isInterAdShow
=
false
}
override
fun
onAdClicked
(
p0
:
MaxAd
)
{
...
...
@@ -421,90 +408,232 @@ object MaxAdUtils {
})
if
(
thisInterAd
?.
isReady
==
true
)
{
thisInterAd
.
showAd
()
thisInterAd
?
.
showAd
()
}
else
{
onHidden
?.
invoke
()
interAd
?.
loadAd
()
}
}
var
nativeAdLoader
:
MaxNativeAdLoader
?
=
null
private
var
currentNativeAd
:
MaxAd
?
=
null
//当前展示的NativeAd
private
var
showedNativeAd
:
MaxAd
?
=
null
//已经展示过的NativeAd
private
var
nativeData
:
Pair
<
MaxNativeAdView
?,
MaxAd
?>?
=
null
private
var
nativeAdLoader
:
MaxNativeAdLoader
=
MaxNativeAdLoader
(
ConfigHelper
.
nativeMaxId
,
BaseApplication
.
context
)
private
var
nativeAd
:
MaxAd
?
=
null
private
var
haveSetAdListener
:
Boolean
=
false
private
var
loadingListener
:
(()
->
Unit
)?
=
null
private
var
isLoading
=
false
private
var
activityString
:
String
=
""
private
val
TAG
=
"AdMaxNativeUtils"
private
fun
setNativeAdListener
()
{
if
(!
haveSetAdListener
)
{
//加载展示监听
nativeAdLoader
.
setNativeAdListener
(
object
:
MaxNativeAdListener
()
{
override
fun
onNativeAdLoaded
(
nativeAdView
:
MaxNativeAdView
?,
ad
:
MaxAd
)
{
// Cleanup any pre-existing native ad to prevent memory leaks.
if
(
nativeAd
?.
nativeAd
?.
isExpired
==
true
)
{
nativeAdLoader
.
destroy
(
nativeAd
)
}
// Save ad to be rendered later.
nativeAd
=
ad
nativeLoadTime
=
System
.
currentTimeMillis
()
loadingListener
?.
invoke
()
loadingListener
=
null
}
fun
loadNativeAd
()
{
if
(
currentNativeAd
!=
null
)
{
return
override
fun
onNativeAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
super
.
onNativeAdLoadFailed
(
p0
,
p1
)
loadingListener
?.
invoke
()
loadingListener
=
null
// AdDisplayUtils.getInstance().incrementAdRequestFailCount()
val
obj2
=
JSONObject
()
obj2
.
put
(
"reason"
,
"no_ad"
)
obj2
.
put
(
"ad_unit"
,
"nativeAd"
)
EventUtils
.
event
(
"ad_show_error"
,
ext
=
obj2
)
}
if
(
nativeData
!=
null
)
{
return
override
fun
onNativeAdClicked
(
p0
:
MaxAd
)
{
super
.
onNativeAdClicked
(
p0
)
// AdDisplayUtils.getInstance().incrementAdClickCount()
nativeAd
?.
let
{
maxAdclickReport
(
it
,
"nativeAd"
)
}
isMultiClick
(
nativeAd
)
}
if
(
isLoading
)
{
return
override
fun
onNativeAdExpired
(
p0
:
MaxAd
)
{
super
.
onNativeAdExpired
(
p0
)
}
isLoading
=
true
naviteAdUnit
=
ConfigHelper
.
nativeMaxId
nativeAdLoader
=
MaxNativeAdLoader
(
naviteAdUnit
,
BaseApplication
.
context
)
})
//广告价格监听
nativeAdLoader
.
setRevenueListener
{
ad
->
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
return
}
// val reqId = UUID.randomUUID().toString()
// val obj = JSONObject()
// obj.put("req_id", reqId)
// obj.put("ad_type", "nativeAd")
nativeAdLoader
?.
setNativeAdListener
(
object
:
MaxNativeAdListener
()
{
override
fun
onNativeAdLoaded
(
maxNativeAdView
:
MaxNativeAdView
?,
maxAd
:
MaxAd
)
{
//Log.e("MXL", "onNativeAdLoaded: " )
nativeData
=
Pair
(
maxNativeAdView
,
maxAd
)
currentNativeAd
=
nativeData
?.
second
maxAdPullReport
(
maxAd
,
"NativeAd"
)
isLoading
=
false
loadingListener
?.
invoke
()
haveSetAdListener
=
true
}
}
override
fun
onNativeAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
maxAdPullReport
(
null
,
"NativeAd"
,
p1
.
message
)
isLoading
=
false
private
fun
createNativeAdView
(
context
:
Context
,
layout
:
Int
):
MaxNativeAdView
{
val
binder
:
MaxNativeAdViewBinder
=
MaxNativeAdViewBinder
.
Builder
(
layout
)
.
setTitleTextViewId
(
R
.
id
.
ad_headline
)
.
setBodyTextViewId
(
R
.
id
.
ad_body
)
// .setAdvertiserTextViewId(R.id.advertiser_text_view)
.
setIconImageViewId
(
R
.
id
.
ad_app_icon
)
.
setMediaContentViewGroupId
(
R
.
id
.
ad_media
)
// .setOptionsContentViewGroupId(R.id.options_view)
// .setStarRatingContentViewGroupId(R.id.star_rating_view)
.
setCallToActionButtonId
(
R
.
id
.
ad_call_to_action
)
.
build
()
return
MaxNativeAdView
(
binder
,
context
)
}
})
nativeAdLoader
?.
loadAd
()
fun
loadNativeAd
()
{
setNativeAdListener
()
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
return
}
nativeAdLoader
.
loadAd
()
}
fun
showNativeAd
(
activity
:
Activity
?,
parent
:
ViewGroup
)
{
// val obj = JSONObject()
// obj.put("ad_unit", "NativeAd")
// EventUtils.event("ad_prepare_show", ext = obj)
fun
showNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
var
layout
=
R
.
layout
.
layout_max_native_small
if
(
where
==
1
)
{
layout
=
R
.
layout
.
layout_max_native_big
}
activityString
=
activity
::
class
.
java
.
toString
().
split
(
"."
).
last
()
setNativeAdListener
()
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
return
}
if
(
nativeAd
?.
nativeAd
?.
isExpired
==
true
||
nativeAd
==
null
)
{
nativeAdLoader
.
destroy
(
nativeAd
)
nativeAdLoader
.
loadAd
()
loadingListener
=
{
//赋值给已经展示过的
showedNativeAd
=
currentNativeAd
//nativeAd已展示了赋空
currentNativeAd
=
null
nativeData
=
null
loadingListener
=
null
loadNativeAd
()
if
(
nativeAd
!=
null
)
{
showReadyNative
(
activity
,
parent
,
layout
)
}
}
if
(
currentNativeAd
==
null
)
{
loadNativeAd
()
// val obj = JSONObject()
// obj.put("reason", "no_ad")
// obj.put("ad_unit", "nativeAd")
// EventUtils.event("ad_show_error", ext = obj)
}
else
{
loadingListener
?.
invoke
(
)
showReadyNative
(
activity
,
parent
,
layout
)
}
}
private
fun
showReadyNative
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
)
{
val
adView
=
createNativeAdView
(
activity
,
layout
)
parent
.
isVisible
=
true
parent
.
removeAllViews
()
nativeAdLoader
.
render
(
adView
,
nativeAd
)
parent
.
addView
(
adView
)
nativeAd
?.
let
{
maxAdShowReport
(
it
,
"nativeAd"
)
}
// AdDisplayUtils.getInstance().incrementAdDisplayCount()
}
// var nativeAdLoader: MaxNativeAdLoader? = null
// private var currentNativeAd: MaxAd? = null//当前展示的NativeAd
// private var showedNativeAd: MaxAd? = null//已经展示过的NativeAd
// private var nativeData: Pair<MaxNativeAdView?, MaxAd?>? = null
// private var loadingListener: (() -> Unit)? = null
// private var isLoading = false
//
// fun loadNativeAd() {
// if (currentNativeAd != null) {
// return
// }
// if (nativeData != null) {
// return
// }
//
// if (isLoading) {
// return
// }
// isLoading = true
// nativeAdLoader = MaxNativeAdLoader(ConfigHelper.nativeMaxId, BaseApplication.context)
//
// if (!AdDisplayUtils.getInstance().shouldShowAd()) {
// return
// }
//
//// val reqId = UUID.randomUUID().toString()
//// val obj = JSONObject()
//// obj.put("req_id", reqId)
//// obj.put("ad_type", "nativeAd")
// nativeAdLoader?.setNativeAdListener(object : MaxNativeAdListener() {
// override fun onNativeAdLoaded(maxNativeAdView: MaxNativeAdView?, maxAd: MaxAd) {
// Log.e("MXL", "onNativeAdLoaded: " )
// nativeData = Pair(maxNativeAdView, maxAd)
// currentNativeAd = nativeData?.second
// maxAdPullReport(maxAd, "NativeAd")
// isLoading = false
// loadingListener?.invoke()
// }
//
// override fun onNativeAdLoadFailed(p0: String, p1: MaxError) {
// maxAdPullReport(null, "NativeAd", p1.message)
// isLoading = false
// Log.e("MXL", "onNativeAdLoadFailed: "+p1.message )
// }
// })
// nativeAdLoader?.loadAd()
// }
// private var nativeAdLoader: MaxNativeAdLoader? = null
// private var loadedNativeAd: MaxAd? = null
// fun showNativeAd(activity: Activity?, parent: ViewGroup) {
//// val obj = JSONObject()
//// obj.put("ad_unit", "NativeAd")
//// EventUtils.event("ad_prepare_show", ext = obj)
// if (!AdDisplayUtils.getInstance().shouldShowAd()) {
// return
// }
// nativeAdLoader = MaxNativeAdLoader(ConfigHelper.nativeMaxId, BaseApplication.context)
// nativeAdLoader?.setNativeAdListener(object :MaxNativeAdListener(){
// override fun onNativeAdLoaded(p0: MaxNativeAdView?, p1: MaxAd) {
// Log.e("MXL", "onNativeAdLoaded: ", )
// if (loadedNativeAd != null)
// {
// nativeAdLoader?.destroy(loadedNativeAd)
// }
// loadedNativeAd = p1
// parent.removeAllViews()
// parent.addView(p0)
// }
//
// override fun onNativeAdLoadFailed(p0: String, p1: MaxError) {
// Log.e("MXL", "onNativeAdLoadFailed: "+p1.message )
// }
// })
//
//// loadingListener = {
//// if ((System.currentTimeMillis() - nativeLoadTime <= 1000 * 60 * 60) && nativeData?.first != null) {
//// parent.removeAllViews()
//// parent.addView(nativeData?.first)
//// }
//// showedNativeAd = currentNativeAd
//// currentNativeAd = null
//// nativeData = null
//// loadingListener = null
//// loadNativeAd()
//// }
//// if (currentNativeAd == null) {
//// loadNativeAd()
////// val obj = JSONObject()
////// obj.put("reason", "no_ad")
////// obj.put("ad_unit", "nativeAd")
////// EventUtils.event("ad_show_error", ext = obj)
//// } else {
//// loadingListener?.invoke()
//// }
// }
private
var
lastAd
:
Any
?
=
null
var
maxMultiClick
=
4
...
...
@@ -557,7 +686,6 @@ object MaxAdUtils {
obj
.
put
(
"status"
,
"2"
)
}
EventUtils
.
event
(
"ad_pull"
,
ext
=
obj
)
// Log.e("MXL", "maxAdPullReport: ", )
}
...
...
@@ -573,7 +701,12 @@ object MaxAdUtils {
obj
.
put
(
"latency"
,
ad
?.
requestLatencyMillis
)
obj
.
put
(
"valueMicros"
,
ad
?.
revenue
)
obj
.
put
(
"from"
,
activity
?.
localClassName
)
if
(!
adUnit
.
equals
(
"nativeAd"
))
{
EventUtils
.
event
(
"ad_show"
,
ext
=
obj
)
}
else
{
EventUtils
.
event
(
"big_img_ad_show"
,
ext
=
obj
)
}
}
...
...
@@ -619,12 +752,10 @@ object MaxAdUtils {
roasbundle
.
putString
(
FirebaseAnalytics
.
Param
.
CURRENCY
,
"USD"
)
///(Required)tROAS事件必须
mFirebaseAnalytics
.
logEvent
(
"Total_Ads_Revenue_001"
,
roasbundle
)
// 给Taichi用
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
0f
)
//重新清零,开始计算
val
logger
=
AppEventsLogger
.
newLogger
(
BaseApplication
.
context
)
val
parameters
=
Bundle
()
parameters
.
putString
(
AppEventsConstants
.
EVENT_PARAM_CURRENCY
,
"USD"
)
logger
.
logEvent
(
"ad_value"
,
currentTaichiTroasCache
,
parameters
)
logger
.
logEvent
(
"ad_value"
,
currentTaichiTroasCache
.
toDouble
(),
parameters
)
}
else
{
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
...
...
app/src/main/java/com/test/easy/easycleanerjunk/view/DialogViews.kt
View file @
737e29b8
...
...
@@ -168,9 +168,9 @@ object DialogViews {
if
(
adS
==
1
)
{
view
.
visibility
=
View
.
VISIBLE
if
(
ConfigHelper
.
admobTrueMaxFlase
==
0
){
MaxAdUtils
.
showNativeAd
(
null
,
view
)
MaxAdUtils
.
showNativeAd
(
this
as
Activity
,
view
)
}
else
{
AdmobUtils
.
showNativeAd
(
null
,
view
)
AdmobUtils
.
showNativeAd
(
this
as
Activity
,
view
)
}
}
else
{
...
...
app/src/main/java/com/test/easy/easycleanerjunk/view/FileScanDialog.kt
View file @
737e29b8
...
...
@@ -56,7 +56,7 @@ class FileScanDialog(
a1
.
cancel
()
}
if
(
ConfigHelper
.
admobTrueMaxFlase
==
0
){
MaxAdUtils
.
showNativeAd
(
activity
,
binding
.
flAd
)
MaxAdUtils
.
showNativeAd
(
activity
,
binding
.
flAd
,
where
=
1
)
}
else
{
AdmobUtils
.
showNativeAd
(
activity
,
binding
.
flAd
)
}
...
...
app/src/main/res/drawable/bg_ad_button.xml
View file @
737e29b8
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"
#FF3C22
"
/>
<solid
android:color=
"
@color/theme_color
"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_theme_10.xml
0 → 100644
View file @
737e29b8
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/theme_color"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/layout_max_native_big.xml
0 → 100644
View file @
737e29b8
<com.google.android.gms.ads.nativead.NativeAdView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@drawable/bg_ad_border"
android:baselineAligned=
"false"
android:orientation=
"vertical"
android:padding=
"10dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/ad_app_icon"
android:layout_width=
"46dp"
android:layout_height=
"46dp"
android:layout_gravity=
"center_vertical"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:background=
"#FF923E"
android:padding=
"2dp"
android:text=
"Ad"
android:textColor=
"@color/white"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
<TextView
android:layout_marginStart=
"8dp"
android:id=
"@+id/ad_headline"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:id=
"@+id/ad_body"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
<com.google.android.gms.ads.nativead.MediaView
android:id=
"@+id/ad_media"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:layout_gravity=
"center_vertical"
android:layout_marginVertical=
"10dp"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/ad_call_to_action"
android:layout_width=
"match_parent"
android:layout_height=
"38dp"
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/bg_ad_button"
android:gravity=
"center"
android:textAllCaps=
"false"
android:textColor=
"@color/white"
android:textSize=
"15sp"
tools:text=
"Install"
/>
</LinearLayout>
</com.google.android.gms.ads.nativead.NativeAdView>
\ No newline at end of file
app/src/main/res/layout/layout_max_native_small.xml
0 → 100644
View file @
737e29b8
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"2dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"#D9D9D9"
android:baselineAligned=
"false"
android:minHeight=
"40dp"
android:orientation=
"horizontal"
android:paddingHorizontal=
"5dp"
android:paddingVertical=
"2dp"
tools:ignore=
"UselessParent"
>
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
>
<FrameLayout
android:id=
"@+id/ad_media"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end"
android:background=
"@color/black"
android:padding=
"2dp"
android:text=
"Ad"
android:textColor=
"@color/white"
android:textSize=
"8sp"
tools:ignore=
"HardcodedText,SmallSp"
/>
</FrameLayout>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"5dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/ad_headline"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:includeFontPadding=
"false"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/ad_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"14sp"
tools:ignore=
"SmallSp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/ad_app_icon"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
tools:ignore=
"ContentDescription"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/ad_call_to_action"
android:layout_width=
"wrap_content"
android:layout_height=
"30dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:layout_marginVertical=
"5dp"
android:background=
"@drawable/bg_theme_10"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
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