Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
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
zhouzhi
appzxhy
Commits
980231a8
Commit
980231a8
authored
Feb 28, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...模块化
parent
0a6d5908
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
17 deletions
+84
-17
BatteryInfoActivity.kt
...src/main/java/com/koko/batteryinfo/BatteryInfoActivity.kt
+11
-5
InterAdService.kt
Router/src/main/java/com/koko/router/ad/InterAdService.kt
+3
-1
AppService.kt
Router/src/main/java/com/koko/router/app/AppService.kt
+12
-0
AppServiceImp.kt
...rc/main/java/com/base/appzxhy/drouterimp/AppServiceImp.kt
+19
-0
InterAdServiceImp.kt
...ain/java/com/base/appzxhy/drouterimp/InterAdServiceImp.kt
+39
-11
No files found.
BatteryInfo/src/main/java/com/koko/batteryinfo/BatteryInfoActivity.kt
View file @
980231a8
...
@@ -16,6 +16,7 @@ import com.koko.batteryinfo.databinding.ActivityBatteryInfoBinding
...
@@ -16,6 +16,7 @@ import com.koko.batteryinfo.databinding.ActivityBatteryInfoBinding
import
com.koko.router.ad.InterAdService
import
com.koko.router.ad.InterAdService
import
com.koko.router.ad.NativeBatteryType
import
com.koko.router.ad.NativeBatteryType
import
com.koko.router.ad.NativeAdService
import
com.koko.router.ad.NativeAdService
import
com.koko.router.app.AppService
import
java.math.BigDecimal
import
java.math.BigDecimal
import
java.math.RoundingMode
import
java.math.RoundingMode
...
@@ -47,6 +48,15 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>() {
...
@@ -47,6 +48,15 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>() {
}
}
}
}
private
fun
backMainShowAd
()
{
val
interAdService
=
DRouter
.
build
(
InterAdService
::
class
.
java
).
getService
()
val
appService
=
DRouter
.
build
(
AppService
::
class
.
java
).
getService
()
interAdService
.
showInterAdBack
(
this
)
{
appService
.
finishToMainTop
(
this
)
}
}
private
fun
showNative
()
{
private
fun
showNative
()
{
val
nativeService
=
DRouter
.
build
(
NativeAdService
::
class
.
java
).
getService
()
val
nativeService
=
DRouter
.
build
(
NativeAdService
::
class
.
java
).
getService
()
nativeService
.
showNative
(
this
,
binding
.
flAd
,
NativeBatteryType
)
nativeService
.
showNative
(
this
,
binding
.
flAd
,
NativeBatteryType
)
...
@@ -55,11 +65,7 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>() {
...
@@ -55,11 +65,7 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>() {
override
fun
initView
()
{
override
fun
initView
()
{
registerReceiver
()
registerReceiver
()
onBackPressedDispatcher
.
addCallback
{
onBackPressedDispatcher
.
addCallback
{
// if (AdmobHelper.isBackShowAd()) {
backMainShowAd
()
// AdmobInterstitialUtils.showInterstitialAd(this@com.koko.batteryinfo.BatteryInfoActivity) {
// finishToMain()
// }
// }
}
}
binding
.
flBack
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
binding
.
flBack
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
}
}
...
...
Router/src/main/java/com/koko/router/ad/InterAdService.kt
View file @
980231a8
...
@@ -6,5 +6,7 @@ const val INTER_BATTERY_INFO = "INTER_BATTERY_INFO"
...
@@ -6,5 +6,7 @@ const val INTER_BATTERY_INFO = "INTER_BATTERY_INFO"
interface
InterAdService
{
interface
InterAdService
{
fun
showInterAd
(
activity
:
Activity
,
interWhere
:
String
=
""
,
callBack
:
()
->
Unit
)
fun
showInterAd
(
activity
:
Activity
,
interWhere
:
String
=
""
,
callBack
:
()
->
Unit
)
=
Unit
fun
showInterAdBack
(
activity
:
Activity
,
interWhere
:
String
=
""
,
callBack
:
()
->
Unit
)
=
Unit
}
}
\ No newline at end of file
Router/src/main/java/com/koko/router/app/AppService.kt
0 → 100644
View file @
980231a8
package
com.koko.router.app
import
android.app.Activity
interface
AppService
{
fun
eventActivity
()
=
Unit
fun
finishToMain
()
=
Unit
fun
finishToMainTop
(
activity
:
Activity
)
=
Unit
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/drouterimp/AppServiceImp.kt
0 → 100644
View file @
980231a8
package
com.base.appzxhy.drouterimp
import
android.app.Activity
import
android.content.Intent
import
com.base.appzxhy.ui.main.MainActivity
import
com.didi.drouter.annotation.Service
import
com.koko.router.app.AppService
@Service
(
function
=
[
AppService
::
class
])
class
AppServiceImp
:
AppService
{
override
fun
finishToMainTop
(
activity
:
Activity
)
{
val
intent
=
Intent
(
activity
,
MainActivity
::
class
.
java
)
intent
.
putExtra
(
"where"
,
"finishToMainTop"
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
)
activity
.
startActivity
(
intent
)
activity
.
finish
()
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/drouterimp/InterAdServiceImp.kt
View file @
980231a8
...
@@ -3,6 +3,7 @@ package com.base.appzxhy.drouterimp
...
@@ -3,6 +3,7 @@ package com.base.appzxhy.drouterimp
import
android.app.Activity
import
android.app.Activity
import
com.base.appzxhy.ads.AdsMgr
import
com.base.appzxhy.ads.AdsMgr
import
com.base.appzxhy.ads.AdsShowCallBack
import
com.base.appzxhy.ads.AdsShowCallBack
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.didi.drouter.annotation.Service
import
com.didi.drouter.annotation.Service
import
com.koko.router.ad.InterAdService
import
com.koko.router.ad.InterAdService
...
@@ -13,19 +14,46 @@ class InterAdServiceImp : InterAdService {
...
@@ -13,19 +14,46 @@ class InterAdServiceImp : InterAdService {
val
isUnLimit
=
false
val
isUnLimit
=
false
AdsMgr
.
showInsert
(
activity
,
isUnLimit
,
object
:
AdsShowCallBack
()
{
if
(
AdConfigBean
.
adsConfigBean
.
functionInShowAd
)
{
override
fun
close
(
where
:
Int
)
{
AdsMgr
.
showInsert
(
activity
,
isUnLimit
,
object
:
AdsShowCallBack
()
{
callBack
.
invoke
()
override
fun
close
(
where
:
Int
)
{
}
callBack
.
invoke
()
}
override
fun
failed
(
where
:
Int
)
{
override
fun
failed
(
where
:
Int
)
{
callBack
.
invoke
()
callBack
.
invoke
()
}
}
override
fun
googleFailed
(
where
:
Int
)
{
override
fun
googleFailed
(
where
:
Int
)
{
callBack
.
invoke
()
callBack
.
invoke
()
}
}
})
})
}
else
{
callBack
.
invoke
()
}
}
override
fun
showInterAdBack
(
activity
:
Activity
,
interWhere
:
String
,
callBack
:
()
->
Unit
)
{
val
isUnLimit
=
false
if
(
AdConfigBean
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
activity
,
isUnLimit
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
callBack
.
invoke
()
}
override
fun
failed
(
where
:
Int
)
{
callBack
.
invoke
()
}
override
fun
googleFailed
(
where
:
Int
)
{
callBack
.
invoke
()
}
})
}
else
{
callBack
.
invoke
()
}
}
}
}
}
\ 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