Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
SuperEasyClean
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
songjianyu
SuperEasyClean
Commits
85314e0e
Commit
85314e0e
authored
Jun 23, 2025
by
songjianyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改oppo 权限问题, 广告弹窗问题
parent
4782fc60
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
10 deletions
+46
-10
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-0
FileBean.kt
app/src/main/java/com/easy/clean/bean/FileBean.kt
+2
-1
AdConfigBean.kt
app/src/main/java/com/easy/clean/bean/config/AdConfigBean.kt
+1
-0
LimitUtils.kt
app/src/main/java/com/easy/clean/business/ads/LimitUtils.kt
+21
-1
AdInterMgr.kt
...main/java/com/easy/clean/business/ads/admob/AdInterMgr.kt
+4
-3
VideoCleanActivity.kt
...n/java/com/easy/clean/ui/videoclean/VideoCleanActivity.kt
+11
-2
MediaUtils.kt
app/src/main/java/com/easy/clean/utils/MediaUtils.kt
+5
-2
dialog_ad_countdown.xml
app/src/main/res/layout/dialog_ad_countdown.xml
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
85314e0e
...
...
@@ -28,6 +28,7 @@
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:requestLegacyExternalStorage=
"true"
android:theme=
"@style/Theme.AppTheme"
tools:targetApi=
"31"
>
...
...
app/src/main/java/com/easy/clean/bean/FileBean.kt
View file @
85314e0e
...
...
@@ -11,5 +11,6 @@ data class FileBean(
var
isScanning
:
Boolean
=
true
,
var
state
:
Int
=
0
,
var
type
:
Int
=
0
,
var
items
:
MutableList
<
FileBean
>
=
mutableListOf
()
var
items
:
MutableList
<
FileBean
>
=
mutableListOf
(),
var
_id
:
Long
=
0L
// uri id
)
app/src/main/java/com/easy/clean/bean/config/AdConfigBean.kt
View file @
85314e0e
...
...
@@ -11,6 +11,7 @@ class AdConfigBean(
var
numDisplayLimit
:
Int
=
-
1
,
//展示次数限制
var
numRequestLimit
:
Int
=
-
1
,
//请求次数限制
var
numClickLimit
:
Int
=
-
1
,
//点击次数限制
var
numNativeDisplayLimit
:
Int
=
-
1
,
// 原生广告显示次数
var
timeInterval
:
Int
=
10
,
//广告间隔秒
var
openAdLoading
:
Int
=
15
,
//开屏广告拉取时间
...
...
app/src/main/java/com/easy/clean/business/ads/LimitUtils.kt
View file @
85314e0e
...
...
@@ -16,6 +16,7 @@ object LimitUtils {
const
val
NUM_REQUEST
=
"local_numRequestLimit"
const
val
NUM_CLICK
=
"local_numClickLimit"
const
val
NUM_NATIVE_SHOW
=
"local_native_show"
// 显示的原生广告数量
const
val
SAVE_DATE
=
"local_saveDate"
...
...
@@ -54,6 +55,15 @@ object LimitUtils {
return
maxCount
>
-
1
&&
AppPreferences
.
getInstance
()
.
getInt
(
NUM_DISPLAY
,
0
)
>=
maxCount
}
/**
* 广告展示是否到达限制
*/
private
inline
val
isDisplayNativeLimited
:
Boolean
get
()
{
val
maxCount
=
AdConfigBean
.
adsConfigBean
.
numNativeDisplayLimit
return
maxCount
>
-
1
&&
AppPreferences
.
getInstance
()
.
getInt
(
NUM_DISPLAY
,
0
)
>=
maxCount
}
/**
* 广告点击是否到达限制
...
...
@@ -93,6 +103,13 @@ object LimitUtils {
AppPreferences
.
getInstance
().
put
(
NUM_REQUEST
,
0
)
AppPreferences
.
getInstance
().
put
(
NUM_CLICK
,
0
)
}
if
(
isDisplayNativeLimited
){
val
value
=
"current${getAdEventMsg(adsType)} "
+
"show=${AppPreferences.getInstance().getInt(NUM_NATIVE_SHOW, 0)} "
+
"${getAdEventMsg(adsType).lowercase()}_"
+
"max_show=${AdConfigBean.adsConfigBean.numNativeDisplayLimit}"
adEvent
?.
adLimited
(
value
)
}
if
(
isDisplayLimited
)
{
val
value
=
"current${getAdEventMsg(adsType)} "
+
...
...
@@ -116,7 +133,7 @@ object LimitUtils {
adEvent
?.
adLimited
(
value
)
}
return
!(
isDisplayLimited
||
isClickLimited
||
isRequestLimited
)
return
!(
isDisplayLimited
||
isClickLimited
||
isRequestLimited
||
isDisplayNativeLimited
)
}
private
fun
addNum
(
key
:
String
)
{
...
...
@@ -142,6 +159,9 @@ object LimitUtils {
fun
addClickNum
()
{
addNum
(
NUM_CLICK
)
}
fun
addNumNative
()
{
addNum
(
NUM_NATIVE_SHOW
)
}
/**
* 开屏和插页广告的显示间隔限制
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdInterMgr.kt
View file @
85314e0e
...
...
@@ -122,9 +122,10 @@ class AdInterMgr {
}
val
activity
=
adState
.
activityRef
?.
get
()
activity
?.
let
{
createUICountdownTimer
(
adState
.
adDialog
)
{
show
(
it
)
}
show
(
it
)
// createUICountdownTimer(adState.adDialog) {
// show(it)
// }
}
}
}
...
...
app/src/main/java/com/easy/clean/ui/videoclean/VideoCleanActivity.kt
View file @
85314e0e
package
com.easy.clean.ui.videoclean
import
android.annotation.SuppressLint
import
android.content.ContentUris
import
android.graphics.Bitmap
import
android.graphics.drawable.Drawable
import
android.provider.MediaStore
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.ViewCompat
...
...
@@ -23,9 +27,14 @@ import com.easy.clean.ui.dialog.ConfirmDialog
import
com.easy.clean.utils.MediaUtils
import
com.easy.clean.utils.Utils
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.DataSource
import
com.bumptech.glide.load.engine.GlideException
import
com.bumptech.glide.load.resource.bitmap.CenterCrop
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
import
com.bumptech.glide.request.RequestListener
import
com.bumptech.glide.request.RequestOptions
import
com.bumptech.glide.request.target.Target
import
com.vungle.ads.AnalyticsClient
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
java.io.File
...
...
@@ -55,8 +64,8 @@ class VideoCleanActivity :
val
round
=
resources
.
getDimensionPixelSize
(
R
.
dimen
.
dp_8
)
val
options
=
RequestOptions
().
transform
(
CenterCrop
(),
RoundedCorners
(
round
))
Glide
.
with
(
holder
.
itemView
.
context
)
.
asBitmap
(
)
.
load
(
File
(
bean
.
path
))
// .load(File(bean.path)
)
.
load
(
ContentUris
.
withAppendedId
(
MediaStore
.
Video
.
Media
.
EXTERNAL_CONTENT_URI
,
bean
.
_id
))
.
apply
(
options
)
.
into
(
holder
.
item
.
ivPreview
)
holder
.
item
.
tvSize
.
text
=
Utils
.
getSizeFormat
(
bean
.
length
)
...
...
app/src/main/java/com/easy/clean/utils/MediaUtils.kt
View file @
85314e0e
package
com.easy.clean.utils
import
android.annotation.SuppressLint
import
android.content.ContentUris
import
android.content.Context
import
android.database.Cursor
import
android.media.MediaScannerConnection
...
...
@@ -17,7 +18,8 @@ object MediaUtils {
MediaStore
.
Files
.
FileColumns
.
DATA
,
MediaStore
.
Files
.
FileColumns
.
SIZE
,
MediaStore
.
Files
.
FileColumns
.
DATE_MODIFIED
,
MediaStore
.
Files
.
FileColumns
.
MIME_TYPE
MediaStore
.
Files
.
FileColumns
.
MIME_TYPE
,
MediaStore
.
Files
.
FileColumns
.
_ID
)
private
const
val
EXTERNAL
=
"external"
...
...
@@ -135,7 +137,8 @@ object MediaUtils {
val
size
=
it
.
getLong
(
it
.
getColumnIndex
(
projection
[
2
]))
val
dateModified
=
it
.
getLong
(
it
.
getColumnIndex
(
projection
[
3
]))
*
1000
val
mineType
=
it
.
getString
(
it
.
getColumnIndex
(
projection
[
4
]))
list
.
add
(
FileBean
(
displayName
,
filePath
,
0
,
size
,
dateModified
,
mineType
))
val
_id
=
it
.
getLong
(
it
.
getColumnIndex
(
projection
[
5
]))
list
.
add
(
FileBean
(
displayName
,
filePath
,
0
,
size
,
dateModified
,
mineType
,
_id
=
_id
))
}
}
}
catch
(
e
:
Exception
)
{
...
...
app/src/main/res/layout/dialog_ad_countdown.xml
View file @
85314e0e
...
...
@@ -37,7 +37,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"10dp"
android:text=
"
AD
LOADING"
android:text=
"LOADING"
android:textColor=
"#ff111111"
android:textSize=
"20sp"
tools:ignore=
"HardcodedText"
/>
...
...
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