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
dc0b08ce
Commit
dc0b08ce
authored
Mar 19, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
f43b9a38
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
19 deletions
+49
-19
AppServiceImp.kt
...rc/main/java/com/base/appzxhy/drouterimp/AppServiceImp.kt
+8
-0
InterAdServiceImp.kt
...ain/java/com/base/appzxhy/drouterimp/InterAdServiceImp.kt
+6
-6
NativeAdServiceImp.kt
...in/java/com/base/appzxhy/drouterimp/NativeAdServiceImp.kt
+3
-2
StartActivity.kt
app/src/main/java/com/base/appzxhy/ui/start/StartActivity.kt
+32
-11
No files found.
app/src/main/java/com/base/appzxhy/drouterimp/AppServiceImp.kt
View file @
dc0b08ce
...
...
@@ -5,9 +5,17 @@ import android.content.Intent
import
com.base.appzxhy.ui.main.MainActivity
import
com.didi.drouter.annotation.Service
import
com.koko.drouter.app.AppService
import
java.util.Locale
@Service
(
function
=
[
AppService
::
class
])
class
AppServiceImp
:
AppService
{
override
fun
getCurrentSpLocal
():
Locale
{
return
Locale
.
getDefault
()
}
override
fun
changeActivityLanguage
(
activity
:
Activity
,
currentLocale
:
Locale
,
changeAction
:
()
->
Unit
):
Boolean
{
return
false
}
override
fun
finishToMainTop
(
activity
:
Activity
)
{
val
intent
=
Intent
(
activity
,
MainActivity
::
class
.
java
)
...
...
app/src/main/java/com/base/appzxhy/drouterimp/InterAdServiceImp.kt
View file @
dc0b08ce
...
...
@@ -12,10 +12,9 @@ class InterAdServiceImp : InterAdService {
override
fun
showInterAd
(
activity
:
Activity
,
interWhere
:
String
,
callBack
:
()
->
Unit
)
{
val
isUnLimit
=
false
if
(
AdConfigBean
.
adsConfigBean
.
functionInShowAd
)
{
AdsMgr
.
showInsert
(
activity
,
isUnLimit
,
object
:
AdsShowCallBack
()
{
AdsMgr
.
showInsert
(
activity
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
callBack
.
invoke
()
}
...
...
@@ -24,9 +23,11 @@ class InterAdServiceImp : InterAdService {
callBack
.
invoke
()
}
override
fun
google
Failed
(
where
:
Int
)
{
override
fun
ad
Failed
(
where
:
Int
)
{
callBack
.
invoke
()
}
})
}
else
{
callBack
.
invoke
()
...
...
@@ -35,10 +36,9 @@ class InterAdServiceImp : InterAdService {
}
override
fun
showInterAdBack
(
activity
:
Activity
,
interWhere
:
String
,
callBack
:
()
->
Unit
)
{
val
isUnLimit
=
false
if
(
AdConfigBean
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
activity
,
isUnLimit
,
object
:
AdsShowCallBack
()
{
AdsMgr
.
showInsert
(
activity
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
callBack
.
invoke
()
}
...
...
@@ -47,7 +47,7 @@ class InterAdServiceImp : InterAdService {
callBack
.
invoke
()
}
override
fun
google
Failed
(
where
:
Int
)
{
override
fun
ad
Failed
(
where
:
Int
)
{
callBack
.
invoke
()
}
})
...
...
app/src/main/java/com/base/appzxhy/drouterimp/NativeAdServiceImp.kt
View file @
dc0b08ce
...
...
@@ -16,11 +16,12 @@ class NativeAdServiceImp : NativeAdService {
override
fun
showNative
(
activity
:
Activity
,
flAd
:
FrameLayout
,
nativeType
:
String
)
{
LogEx
.
logDebug
(
TAG
,
"activity=${activity::class.java.simpleName}"
)
val
l
ayout
=
when
(
nativeType
)
{
val
admobL
ayout
=
when
(
nativeType
)
{
NativeBatteryType
->
R
.
layout
.
layout_admob_native_custom
else
->
R
.
layout
.
layout_admob_native_custom
}
AdsMgr
.
showNative
(
activity
,
flAd
,
layout
)
val
maxLayout
=
R
.
layout
.
layout_max_native_custom
AdsMgr
.
showNative
(
activity
,
flAd
,
admobLayout
,
maxLayout
)
}
...
...
app/src/main/java/com/base/appzxhy/ui/start/StartActivity.kt
View file @
dc0b08ce
...
...
@@ -7,25 +7,22 @@ import androidx.activity.SystemBarStyle
import
androidx.activity.enableEdgeToEdge
import
androidx.core.view.ViewCompat
import
androidx.core.view.WindowInsetsCompat
import
androidx.lifecycle.ViewModelProvider
import
com.base.appzxhy.R
import
com.base.appzxhy.ads.AdsMgr
import
com.base.appzxhy.databinding.ActivityStartBinding
import
com.koko.batteryinfo.BatteryInfoActivity
import
com.koko.drouter.base.BaseActivity
class
StartActivity
:
BaseActivity
<
ActivityStartBinding
>(
ActivityStartBinding
::
inflate
)
{
override
fun
initView
()
{
super
.
initView
()
}
override
fun
useDefaultImmersive
()
{
// enableEdgeToEdge(SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT))
enableEdgeToEdge
(
SystemBarStyle
.
dark
(
Color
.
TRANSPARENT
))
ViewCompat
.
setOnApplyWindowInsetsListener
(
binding
.
root
)
{
v
,
insets
->
val
systemBars
=
insets
.
getInsets
(
WindowInsetsCompat
.
Type
.
systemBars
())
v
.
setPadding
(
systemBars
.
left
,
0
,
systemBars
.
right
,
systemBars
.
bottom
)
insets
}
private
val
viewModel
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
ViewModelProvider
(
this
)[
StartViewModel
::
class
.
java
]
}
override
fun
initView
()
{
super
.
initView
()
}
@SuppressLint
(
"SetTextI18n"
)
...
...
@@ -46,4 +43,28 @@ class StartActivity : BaseActivity<ActivityStartBinding>(ActivityStartBinding::i
startActivity
(
Intent
(
this
,
BatteryInfoActivity
::
class
.
java
))
}
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
viewModel
.
startJumpCountdown
()
}
override
fun
onStop
()
{
super
.
onStop
()
viewModel
.
cancelJumpCountDown
()
}
override
fun
useDefaultImmersive
()
{
// enableEdgeToEdge(SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT))
enableEdgeToEdge
(
SystemBarStyle
.
dark
(
Color
.
TRANSPARENT
))
ViewCompat
.
setOnApplyWindowInsetsListener
(
binding
.
root
)
{
v
,
insets
->
val
systemBars
=
insets
.
getInsets
(
WindowInsetsCompat
.
Type
.
systemBars
())
v
.
setPadding
(
systemBars
.
left
,
0
,
systemBars
.
right
,
systemBars
.
bottom
)
insets
}
}
}
\ 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