Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
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
Data Recovery White
Commits
12a4c39a
Commit
12a4c39a
authored
Jul 16, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
28bc1b76
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
128 additions
and
18 deletions
+128
-18
ResultActivity.kt
...ain/java/com/base/datarecovery/activity/ResultActivity.kt
+1
-5
RepeatActivity.kt
...a/com/base/datarecovery/activity/repeat/RepeatActivity.kt
+1
-1
ScreenShotActivity.kt
...se/datarecovery/activity/screenshot/ScreenShotActivity.kt
+2
-1
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+6
-1
AdMaxNativeUtils.kt
...in/java/com/base/datarecovery/ads/max/AdMaxNativeUtils.kt
+7
-7
HomeFragment.kt
.../main/java/com/base/datarecovery/fragment/HomeFragment.kt
+3
-2
FileScanDialog.kt
...rc/main/java/com/base/datarecovery/view/FileScanDialog.kt
+2
-1
layout_max_native_small_f8f8f8.xml
app/src/main/res/layout/layout_max_native_small_f8f8f8.xml
+106
-0
No files found.
app/src/main/java/com/base/datarecovery/activity/ResultActivity.kt
View file @
12a4c39a
...
...
@@ -132,11 +132,7 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
binding
.
ivBack
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
AdmobNativeUtils
.
showNativeAd
(
this
@ResultActivity
,
binding
.
flAd
,
R
.
layout
.
layout_native_custom_white
)
AdmobMaxHelper
.
admobMaxShowNativeAd
(
this
@ResultActivity
,
binding
.
flAd
)
}
override
fun
onDestroy
()
{
...
...
app/src/main/java/com/base/datarecovery/activity/repeat/RepeatActivity.kt
View file @
12a4c39a
...
...
@@ -136,7 +136,7 @@ class RepeatActivity : BaseActivity<ActivityRepeatBinding>() {
binding
.
progressBar
.
visibility
=
View
.
GONE
mediaAdapter
.
setData
(
beanList
)
if
(
beanList
.
sumOf
{
it
.
beans
.
size
}
>
6
||
ConfigHelper
.
mustShowNativeAd
)
{
Admob
NativeUtils
.
s
howNativeAd
(
this
@RepeatActivity
,
binding
.
flAd
)
Admob
MaxHelper
.
admobMaxS
howNativeAd
(
this
@RepeatActivity
,
binding
.
flAd
)
}
}
}
...
...
app/src/main/java/com/base/datarecovery/activity/screenshot/ScreenShotActivity.kt
View file @
12a4c39a
...
...
@@ -24,6 +24,7 @@ import com.base.datarecovery.utils.BarUtils
import
com.base.datarecovery.view.DialogViews.showDeletePermanentlyDialog
import
com.base.datarecovery.view.DialogViews.showExitFunctionDialog
import
com.base.datarecovery.view.DialogViews.showGerPermission
import
com.facebook.ads.Ad
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.async
import
kotlinx.coroutines.launch
...
...
@@ -89,7 +90,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding
.
tvSize
.
text
=
sizeF
[
0
]
binding
.
tvUnit
.
text
=
sizeF
[
1
]
if
(
list
.
sumOf
{
it
.
screenPhotoBean
.
size
}
>
6
||
ConfigHelper
.
mustShowNativeAd
)
{
Admob
NativeUtils
.
s
howNativeAd
(
this
@ScreenShotActivity
,
binding
.
flAd
)
Admob
MaxHelper
.
admobMaxS
howNativeAd
(
this
@ScreenShotActivity
,
binding
.
flAd
)
}
}
}
...
...
app/src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
View file @
12a4c39a
...
...
@@ -4,6 +4,7 @@ import AdMaxNativeUtils
import
android.app.Activity
import
android.view.View
import
android.view.ViewGroup
import
com.base.datarecovery.R
import
com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import
com.base.datarecovery.ads.admob.AdmobNativeUtils
import
com.base.datarecovery.ads.admob.AdmobOpenUtils
...
...
@@ -39,10 +40,14 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
)
{
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
}
else
{
var
layout
=
R
.
layout
.
layout_max_native_small
if
(
where
==
0
)
{
layout
=
R
.
layout
.
layout_max_native_small_f8f8f8
}
AdMaxNativeUtils
.
showNativeAd
(
activity
,
parent
)
}
}
...
...
app/src/main/java/com/base/datarecovery/ads/max/AdMaxNativeUtils.kt
View file @
12a4c39a
...
...
@@ -31,7 +31,7 @@ object AdMaxNativeUtils {
//加载展示监听
nativeAdLoader
.
setNativeAdListener
(
object
:
MaxNativeAdListener
()
{
override
fun
onNativeAdLoaded
(
nativeAdView
:
MaxNativeAdView
?,
ad
:
MaxAd
)
{
LogEx
.
logDebug
(
TAG
,
"onNativeAdLoaded"
)
LogEx
.
logDebug
(
TAG
,
"onNativeAdLoaded"
)
// Cleanup any pre-existing native ad to prevent memory leaks.
if
(
nativeAd
?.
nativeAd
?.
isExpired
==
true
)
{
nativeAdLoader
.
destroy
(
nativeAd
)
...
...
@@ -45,7 +45,7 @@ object AdMaxNativeUtils {
override
fun
onNativeAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
super
.
onNativeAdLoadFailed
(
p0
,
p1
)
LogEx
.
logDebug
(
TAG
,
"onNativeAdLoadFailed"
)
LogEx
.
logDebug
(
TAG
,
"onNativeAdLoadFailed"
)
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
val
obj2
=
JSONObject
()
obj2
.
put
(
"reason"
,
"no_ad"
)
...
...
@@ -55,7 +55,7 @@ object AdMaxNativeUtils {
override
fun
onNativeAdClicked
(
p0
:
MaxAd
)
{
super
.
onNativeAdClicked
(
p0
)
LogEx
.
logDebug
(
TAG
,
"onNativeAdClicked"
)
LogEx
.
logDebug
(
TAG
,
"onNativeAdClicked"
)
AdDisplayUtils
.
getInstance
().
incrementAdClickCount
()
nativeAd
?.
let
{
AdMaxEvent
.
clickAd
(
it
,
"nativeAd"
)
}
AdmobCommonUtils
.
isMultiClick
(
nativeAd
)
...
...
@@ -79,7 +79,7 @@ object AdMaxNativeUtils {
}
}
private
fun
createNativeAdView
(
context
:
Context
):
MaxNativeAdView
{
private
fun
createNativeAdView
(
context
:
Context
,
layout
:
Int
):
MaxNativeAdView
{
// val binder: MaxNativeAdViewBinder = MaxNativeAdViewBinder.Builder(R.layout.layout_max_native_custom)
// .setTitleTextViewId(R.id.title_text_view)
...
...
@@ -93,7 +93,7 @@ object AdMaxNativeUtils {
// .build()
// return MaxNativeAdView(binder, context)
val
binder
:
MaxNativeAdViewBinder
=
MaxNativeAdViewBinder
.
Builder
(
R
.
layout
.
layout_max_native_small
)
val
binder
:
MaxNativeAdViewBinder
=
MaxNativeAdViewBinder
.
Builder
(
layout
)
.
setTitleTextViewId
(
R
.
id
.
ad_headline
)
.
setBodyTextViewId
(
R
.
id
.
ad_body
)
// .setAdvertiserTextViewId(R.id.advertiser_text_view)
...
...
@@ -107,7 +107,7 @@ object AdMaxNativeUtils {
}
fun
showNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
)
{
fun
showNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
layout
:
Int
=
R
.
layout
.
layout_max_native_small
)
{
setNativeAdListener
()
...
...
@@ -126,7 +126,7 @@ object AdMaxNativeUtils {
nativeAdLoader
.
loadAd
()
}
else
{
//展示广告
val
adView
=
createNativeAdView
(
activity
)
val
adView
=
createNativeAdView
(
activity
,
layout
)
parent
.
isVisible
=
true
nativeAdLoader
.
render
(
adView
,
nativeAd
)
parent
.
removeAllViews
()
...
...
app/src/main/java/com/base/datarecovery/fragment/HomeFragment.kt
View file @
12a4c39a
...
...
@@ -6,6 +6,7 @@ import android.annotation.SuppressLint
import
android.content.Intent
import
android.view.View
import
android.view.animation.AccelerateDecelerateInterpolator
import
com.base.datarecovery.R
import
com.base.datarecovery.activity.SettingActivity
import
com.base.datarecovery.activity.junkclean.ScanJunkActivity
import
com.base.datarecovery.activity.privacyspace.PrivacyPinOneActivity
...
...
@@ -31,7 +32,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override
fun
setView
()
{
animatorSet
=
createHeartbeatAnimation
(
binding
.
flScan
)
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
)
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
,
0
)
}
override
fun
setListener
()
{
...
...
@@ -110,7 +111,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
super
.
onResume
()
animatorSet
.
resume
()
if
(
resumeTime
!=
0
)
{
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
)
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
,
0
)
resumeTime
++
}
}
...
...
app/src/main/java/com/base/datarecovery/view/FileScanDialog.kt
View file @
12a4c39a
...
...
@@ -9,6 +9,7 @@ import android.view.animation.LinearInterpolator
import
androidx.appcompat.app.AppCompatActivity
import
androidx.lifecycle.lifecycleScope
import
com.base.datarecovery.R
import
com.base.datarecovery.ads.AdmobMaxHelper
import
com.base.datarecovery.ads.admob.AdmobNativeUtils
import
com.base.datarecovery.databinding.DialogFileScanBinding
import
kotlinx.coroutines.Dispatchers
...
...
@@ -55,7 +56,7 @@ class FileScanDialog(
a1
.
cancel
()
}
Admob
NativeUtils
.
showNativeAd
(
activity
,
binding
.
flAd
,
R
.
layout
.
layout_native_custom_big
)
Admob
MaxHelper
.
admobMaxShowNativeAd
(
activity
,
binding
.
flAd
)
var
pathShowed
=
false
activity
.
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
...
...
app/src/main/res/layout/layout_max_native_small_f8f8f8.xml
0 → 100644
View file @
12a4c39a
<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=
"#f8f8f8"
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_355bea_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