Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
4713605a
Commit
4713605a
authored
Jul 19, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
6f711405
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
43 deletions
+45
-43
SplashActivity.kt
...om/base/filerecoveryrecyclebin/activity/SplashActivity.kt
+2
-0
AdmobMaxHelper.kt
...ava/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
+0
-7
AdMaxNativeUtils.kt
...m/base/filerecoveryrecyclebin/ads/max/AdMaxNativeUtils.kt
+37
-31
LogEx.kt
.../main/java/com/base/filerecoveryrecyclebin/utils/LogEx.kt
+1
-0
layout_max_native_big.xml
app/src/main/res/layout/layout_max_native_big.xml
+3
-3
layout_max_native_small.xml
app/src/main/res/layout/layout_max_native_small.xml
+1
-1
layout_max_native_small_f8f8f8.xml
app/src/main/res/layout/layout_max_native_small_f8f8f8.xml
+1
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/activity/SplashActivity.kt
View file @
4713605a
...
...
@@ -23,6 +23,7 @@ import com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInit
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxOpenUtils
import
com.base.filerecoveryrecyclebin.bean.ConstObject
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_JUNK_CLEAN_PUSH
...
...
@@ -115,6 +116,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
AdMaxInit
.
maxInitAction
=
{
AdMaxOpenUtils
.
loadAppOpenAd
(
this
)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
this
)
AdMaxNativeUtils
.
loadNativeAd
()
}
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
View file @
4713605a
...
...
@@ -33,13 +33,6 @@ object AdmobMaxHelper {
}
}
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
isOpenAdLoaded
()
}
else
{
AdMaxOpenUtils
.
isOpenAdLoaded
()
}
}
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxNativeUtils.kt
View file @
4713605a
...
...
@@ -17,6 +17,7 @@ import com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.utils.EventUtils
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.ironsource.na
import
org.json.JSONObject
object
AdMaxNativeUtils
{
...
...
@@ -48,6 +49,8 @@ object AdMaxNativeUtils {
override
fun
onNativeAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
super
.
onNativeAdLoadFailed
(
p0
,
p1
)
loadingListener
?.
invoke
()
loadingListener
=
null
LogEx
.
logDebug
(
TAG
,
"onNativeAdLoadFailed"
)
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
val
obj2
=
JSONObject
()
...
...
@@ -101,7 +104,7 @@ object AdMaxNativeUtils {
.
setBodyTextViewId
(
R
.
id
.
ad_body
)
// .setAdvertiserTextViewId(R.id.advertiser_text_view)
.
setIconImageViewId
(
R
.
id
.
ad_app_icon
)
.
setMediaContentViewGroupId
(
R
.
id
.
ad_media
)
.
setMediaContentViewGroupId
(
R
.
id
.
media_view_container
)
// .setOptionsContentViewGroupId(R.id.options_view)
// .setStarRatingContentViewGroupId(R.id.star_rating_view)
.
setCallToActionButtonId
(
R
.
id
.
ad_call_to_action
)
...
...
@@ -109,49 +112,52 @@ object AdMaxNativeUtils {
return
MaxNativeAdView
(
binder
,
context
)
}
fun
showNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
)
{
activityString
=
activity
::
class
.
java
.
toString
().
split
(
"."
).
last
()
fun
loadNativeAd
()
{
setNativeAdListener
()
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"nativeAd"
))
{
return
}
loadingListener
=
{
//展示广告
val
adView
=
createNativeAdView
(
activity
,
layout
)
if
(
System
.
currentTimeMillis
()
-
nativeLoadTime
<=
1000
*
60
*
60
)
{
nativeAdLoader
.
loadAd
()
}
//是否已经加载渲染
if
(
nativeAd
?.
nativeAd
?.
isExpired
==
true
)
{
nativeAdLoader
.
destroy
(
nativeAd
)
nativeAdLoader
.
loadAd
(
adView
)
}
else
{
parent
.
isVisible
=
true
nativeAdLoader
.
render
(
adView
,
nativeAd
)
parent
.
removeAllViews
()
parent
.
addView
(
adView
)
nativeAd
?.
let
{
AdMaxEvent
.
showAd
(
it
,
"nativeAd"
,
activityString
)
}
AdDisplayUtils
.
getInstance
().
incrementAdDisplayCount
()
}
}
fun
showNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
)
{
activityString
=
activity
::
class
.
java
.
toString
().
split
(
"."
).
last
()
LogEx
.
logDebug
(
TAG
,
"activityString=$activityString"
)
setNativeAdListener
()
nativeAdLoader
.
loadAd
(
adView
)
LogEx
.
logDebug
(
TAG
,
"loadingListener finish"
)
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"nativeAd"
))
{
LogEx
.
logDebug
(
TAG
,
"!shouldShowAd"
)
return
}
if
(
nativeAd
==
null
)
{
if
(
nativeAd
?.
nativeAd
?.
isExpired
==
true
||
nativeAd
==
null
)
{
LogEx
.
logDebug
(
TAG
,
"nativeAd?.nativeAd?.isExpired == true"
)
nativeAdLoader
.
destroy
(
nativeAd
)
nativeAdLoader
.
loadAd
()
val
obj2
=
JSONObject
()
obj2
.
put
(
"reason"
,
"no_ad"
)
obj2
.
put
(
"ad_unit"
,
"nativeAd"
)
EventUtils
.
event
(
"ad_show_error"
,
ext
=
obj2
)
loadingListener
=
{
if
(
nativeAd
!=
null
)
{
showReadNative
(
activity
,
parent
,
layout
)
}
}
}
else
{
loadingListener
?.
invoke
(
)
showReadNative
(
activity
,
parent
,
layout
)
}
}
private
fun
showReadNative
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
)
{
val
adView
=
createNativeAdView
(
activity
,
layout
)
LogEx
.
logDebug
(
TAG
,
"showReadNative adUnitId=${nativeAd?.adUnitId}"
)
parent
.
isVisible
=
true
parent
.
removeAllViews
()
nativeAdLoader
.
render
(
adView
,
nativeAd
)
parent
.
addView
(
adView
)
nativeAd
?.
let
{
AdMaxEvent
.
showAd
(
it
,
"nativeAd"
,
activityString
)
}
AdDisplayUtils
.
getInstance
().
incrementAdDisplayCount
()
LogEx
.
logDebug
(
TAG
,
"loadingListener finish"
)
}
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/utils/LogEx.kt
View file @
4713605a
...
...
@@ -8,6 +8,7 @@ object LogEx {
val
filterTAG
=
arrayOf
(
"FileScanActivity"
,
// "FileHexEx",
"FileScanResultActivity"
,
"FileGridAdapter"
)
...
...
app/src/main/res/layout/layout_max_native_big.xml
View file @
4713605a
...
...
@@ -51,10 +51,10 @@
tools:ignore=
"HardcodedText"
/>
<TextView
android:layout_marginStart=
"8dp"
android:id=
"@+id/ad_headline"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"8dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
...
...
@@ -77,8 +77,8 @@
</LinearLayout>
<
com.google.android.gms.ads.nativead.MediaView
android:id=
"@+id/
ad_media
"
<
FrameLayout
android:id=
"@+id/
media_view_container
"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:layout_gravity=
"center_vertical"
...
...
app/src/main/res/layout/layout_max_native_small.xml
View file @
4713605a
...
...
@@ -24,7 +24,7 @@
android:layout_gravity=
"center_vertical"
>
<FrameLayout
android:id=
"@+id/
ad_media
"
android:id=
"@+id/
media_view_container
"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
...
...
app/src/main/res/layout/layout_max_native_small_f8f8f8.xml
View file @
4713605a
...
...
@@ -24,7 +24,7 @@
android:layout_gravity=
"center_vertical"
>
<FrameLayout
android:id=
"@+id/
ad_media
"
android:id=
"@+id/
media_view_container
"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
...
...
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