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
8d88e1ac
Commit
8d88e1ac
authored
Jun 09, 2025
by
wanglei
Committed by
songjianyu
Jun 11, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[修改]处理广告开关关闭时,原生和banner占位问题
parent
03ba12b0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
9 deletions
+37
-9
GlobalConfig.kt
app/src/main/java/com/base/appzxhy/GlobalConfig.kt
+2
-2
AdsMgr.kt
app/src/main/java/com/base/appzxhy/business/ads/AdsMgr.kt
+22
-0
GuideActivity.kt
app/src/main/java/com/base/appzxhy/ui/guide/GuideActivity.kt
+1
-1
MainActivity.kt
app/src/main/java/com/base/appzxhy/ui/main/MainActivity.kt
+11
-5
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-1
No files found.
app/src/main/java/com/base/appzxhy/GlobalConfig.kt
View file @
8d88e1ac
...
...
@@ -5,13 +5,13 @@ package com.base.appzxhy
*/
object
GlobalConfig
{
//包名
const
val
PACKAGE_NAME
=
"com.
dumpster.cleaner.tbt
"
const
val
PACKAGE_NAME
=
"com.
easy.clean.tvb.cool
"
// 域名
/**
* Url Event 上报接口
*/
const
val
URL_EVENT
=
"https://rp.
kubukubanten
.xyz"
const
val
URL_EVENT
=
"https://rp.
danehyjudydanehy1310
.xyz"
/**
* Url Api 业务接口
...
...
app/src/main/java/com/base/appzxhy/business/ads/AdsMgr.kt
View file @
8d88e1ac
...
...
@@ -2,6 +2,7 @@ package com.base.appzxhy.business.ads
import
android.app.Activity
import
android.content.Context
import
android.view.View
import
android.view.ViewGroup
import
androidx.annotation.LayoutRes
import
com.applovin.sdk.AppLovinMediationProvider
...
...
@@ -167,6 +168,11 @@ object AdsMgr {
)
{
eventAdUt
()
if
(!
adsConfigBean
.
isAdShow
)
{
showCallBack
?.
failed
()
return
}
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
"isInBlackList=${configBean.isInBlackList}"
)
showCallBack
?.
failed
()
...
...
@@ -208,6 +214,11 @@ object AdsMgr {
)
{
eventAdUt
()
if
(!
adsConfigBean
.
isAdShow
)
{
showCallBack
?.
failed
()
return
}
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
showCallBack
?.
failed
()
...
...
@@ -233,6 +244,12 @@ object AdsMgr {
@LayoutRes
layout
:
Int
,
nativeCallBack
:
((
Any
?)
->
Unit
)?
=
null
)
{
if
(!
adsConfigBean
.
isAdShow
)
{
nativeCallBack
?.
invoke
(
null
)
nativeView
.
visibility
=
View
.
GONE
return
}
nativeView
.
visibility
=
View
.
VISIBLE
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
return
...
...
@@ -260,6 +277,11 @@ object AdsMgr {
* @param parent 展示广告的父布局容器
*/
fun
showBanner
(
parent
:
ViewGroup
,
collapsible
:
Boolean
=
true
,
adClose
:
(()
->
Unit
)?
=
null
)
{
if
(!
adsConfigBean
.
isAdShow
)
{
parent
.
visibility
=
View
.
GONE
return
}
parent
.
visibility
=
View
.
VISIBLE
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
return
...
...
app/src/main/java/com/base/appzxhy/ui/guide/GuideActivity.kt
View file @
8d88e1ac
...
...
@@ -33,7 +33,7 @@ class GuideActivity : BaseActivity<ActivityGuideBinding>(ActivityGuideBinding::i
override
fun
initView
()
{
super
.
initView
()
if
(
AdConfigBean
.
adsConfigBean
.
fullNativeShow
)
{
if
(
AdConfigBean
.
adsConfigBean
.
fullNativeShow
&&
AdConfigBean
.
adsConfigBean
.
isAdShow
)
{
fragments
.
add
(
2
,
pageNative
)
}
...
...
app/src/main/java/com/base/appzxhy/ui/main/MainActivity.kt
View file @
8d88e1ac
...
...
@@ -3,8 +3,10 @@ package com.base.appzxhy.ui.main
import
android.graphics.Color
import
android.view.LayoutInflater
import
android.view.View
import
android.widget.FrameLayout
import
android.widget.TextView
import
androidx.activity.enableEdgeToEdge
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.ViewModelProvider
...
...
@@ -15,6 +17,7 @@ import com.base.appzxhy.R
import
com.base.appzxhy.SpConstObject.mainPageCount
import
com.base.appzxhy.base.BaseActivity
import
com.base.appzxhy.bean.HomeTabUIBean
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.business.ads.AdsMgr
import
com.base.appzxhy.databinding.ActivityMainBinding
import
com.base.appzxhy.databinding.ItemHomeTabBinding
...
...
@@ -61,6 +64,14 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
exitDialog
=
ExitDialog
(
this
)
exitDialog
.
init
()
setStatusBarColor
(
getColor
(
R
.
color
.
colorPrimary
))
val
lp
=
binding
.
flBottom
.
layoutParams
as
ConstraintLayout
.
LayoutParams
if
(!
AdConfigBean
.
adsConfigBean
.
isAdShow
)
{
lp
.
setMargins
(
0
,
0
,
0
,
0
)
}
else
{
lp
.
setMargins
(
0
,
0
,
0
,
resources
.
getDimensionPixelSize
(
R
.
dimen
.
dp_60
))
}
binding
.
flBottom
.
layoutParams
=
lp
}
private
fun
initDialogFlow
()
{
...
...
@@ -101,11 +112,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
binding
.
viewPager2
.
adapter
=
viewPagerAdapter
binding
.
viewPager2
.
registerOnPageChangeCallback
(
object
:
ViewPager2
.
OnPageChangeCallback
()
{
override
fun
onPageSelected
(
position
:
Int
)
{
// if (position == 0) {
// setStatusBarColor(getColor(R.color.colorPrimary))
// } else {
// setStatusBarColor(getColor(R.color.transparent))
// }
val
defaultTab
=
binding
.
tabLayout
.
getTabAt
(
position
)
defaultTab
?.
select
()
defaultTab
?.
setSelected
()
...
...
app/src/main/res/layout/activity_main.xml
View file @
8d88e1ac
...
...
@@ -24,7 +24,7 @@
android:id=
"@+id/flBottom"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"
60dp
"
android:layout_marginBottom=
"
@dimen/dp_60
"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/fl_container"
>
...
...
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