Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
location share 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
location share white
Commits
9eeee1fb
Commit
9eeee1fb
authored
Dec 11, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
b648a580
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
AdsMgr.kt
app/src/main/java/com/base/locationsharewhite/ads/AdsMgr.kt
+2
-2
MainActivity.kt
.../java/com/base/locationsharewhite/ui/main/MainActivity.kt
+18
-18
No files found.
app/src/main/java/com/base/locationsharewhite/ads/AdsMgr.kt
View file @
9eeee1fb
...
...
@@ -243,13 +243,13 @@ object AdsMgr {
*
* @param parent 展示广告的父布局容器
*/
fun
showBanner
(
parent
:
ViewGroup
,
collapsible
:
Boolean
=
true
)
{
fun
showBanner
(
parent
:
ViewGroup
,
collapsible
:
Boolean
=
true
,
adClose
:
(()
->
Unit
)?
=
null
)
{
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
return
}
if
(
adsConfigBean
.
adSwitch
)
{
adBannerMgr
.
show
(
parent
,
collapsibl
e
)
adBannerMgr
.
show
(
parent
,
collapsible
,
adClos
e
)
}
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/main/MainActivity.kt
View file @
9eeee1fb
package
com.base.locationsharewhite.ui.main
import
android.Manifest
import
android.app.Dialog
import
android.content.Intent
import
android.graphics.Color
import
android.os.Build
import
android.view.LayoutInflater
import
androidx.activity.addCallback
import
androidx.core.view.updatePadding
...
...
@@ -29,10 +27,6 @@ import com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.PermissionUtils.areNotificationsEnabled
import
com.base.locationsharewhite.utils.PermissionUtils.checkAllLocationPermission
import
com.base.locationsharewhite.utils.PermissionUtils.checkBackgroundLocationPermission
import
com.base.locationsharewhite.utils.PermissionUtils.checkBackgroundLocationPermissionDeniedByUser
import
com.base.locationsharewhite.utils.PermissionUtils.checkLocationPermission
import
com.base.locationsharewhite.utils.PermissionUtils.checkLocationPermissionDeniedByUser
import
com.base.locationsharewhite.utils.PermissionUtils.requestLocationAllowAllTime
import
com.google.android.gms.maps.CameraUpdateFactory
import
com.google.android.gms.maps.GoogleMap
...
...
@@ -84,12 +78,16 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
//
// }
// }
LocationLoginUtils
.
login
()
val
flag
=
areNotificationsEnabled
()
EventUtils
.
event
(
"areNotificationsEnabled"
,
"areNotificationsEnabled=$flag"
)
if
(!
bannerShowed
.
get
())
{
bannerShowed
.
set
(
true
)
AdsMgr
.
showBanner
(
binding
.
flAd
)
{
if
(!
checkAllLocationPermission
())
{
showAllowAllTimeDialog
()
}
else
{
requestServiceLocationUpdates
()
}
}
}
}
private
var
bannerShowed
=
AtomicBoolean
(
false
)
...
...
@@ -98,17 +96,17 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
if
(!
checkAllLocationPermission
())
{
showAllowAllTimeDialog
()
}
else
{
requestServiceLocationUpdates
()
}
LocationLoginUtils
.
login
()
val
mapFragment
=
supportFragmentManager
.
findFragmentById
(
R
.
id
.
map
)
as
SupportMapFragment
?
mapFragment
?.
getMapAsync
(
this
)
mainPresenter
.
startLocationJob
(
lifecycleScope
)
val
flag
=
areNotificationsEnabled
()
EventUtils
.
event
(
"areNotificationsEnabled"
,
"areNotificationsEnabled=$flag"
)
}
override
fun
onResume
()
{
...
...
@@ -136,7 +134,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
sendAllAllowedNotification
(
this
)
requestLocationAllowAllTime
(
launcher
,
jumpOutAction
=
{
LogEx
.
logDebug
(
TAG
,
"jumpOutAction"
)
},
permissionAllowCallBack
=
{})
},
permissionAllowCallBack
=
{
})
},
dismissAction
=
{
allowAllTimeDialog
=
null
...
...
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