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
2b5ec950
Commit
2b5ec950
authored
Jan 06, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
18613aab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
24 deletions
+31
-24
AdsMgr.kt
app/src/main/java/com/base/locationsharewhite/ads/AdsMgr.kt
+5
-2
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+2
-1
StayJobService.kt
...ava/com/base/locationsharewhite/service/StayJobService.kt
+15
-10
LocationMapActivity.kt
.../locationsharewhite/ui/locationmap/LocationMapActivity.kt
+9
-11
No files found.
app/src/main/java/com/base/locationsharewhite/ads/AdsMgr.kt
View file @
2b5ec950
...
...
@@ -119,8 +119,11 @@ object AdsMgr {
val
executor
=
Executors
.
newSingleThreadExecutor
()
executor
.
execute
{
val
currentGaid
=
AdvertisingIdClient
.
getAdvertisingIdInfo
(
context
).
id
val
currentGaid
=
""
runCatching
{
AdvertisingIdClient
.
getAdvertisingIdInfo
(
context
).
id
AppPreferences
.
getInstance
().
getString
(
"gid"
,
currentGaid
)
}
val
build
=
AppLovinSdkInitializationConfiguration
.
builder
(
GlobalConfig
.
KEY_MAX
,
context
)
...
...
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
2b5ec950
...
...
@@ -107,9 +107,10 @@ class MyApplication : Application() {
FCMManager
.
initFirebase
(
this
)
FCMManager
.
subscribeToTopic
(
topic
)
initConfig
()
Thread
{
initConfig
()
InstallHelps
.
init
{
initRemoteConfig
()
}
...
...
app/src/main/java/com/base/locationsharewhite/service/StayJobService.kt
View file @
2b5ec950
...
...
@@ -16,6 +16,7 @@ import android.os.CountDownTimer
import
android.os.Looper
import
androidx.work.Configuration
import
com.base.locationsharewhite.BuildConfig
import
com.base.locationsharewhite.helper.EventUtils
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.service.StayNotification.createPermanentNotification
import
com.base.locationsharewhite.utils.LogEx
...
...
@@ -95,6 +96,7 @@ class StayJobService : JobService() {
}
private
fun
startForeground
()
{
try
{
val
notification
=
createPermanentNotification
(
applicationContext
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
startForeground
(
...
...
@@ -106,6 +108,9 @@ class StayJobService : JobService() {
startForeground
(
NOTIFICATION_PERMANENT_ID
,
notification
)
}
isRunning
=
true
}
catch
(
e
:
Exception
)
{
EventUtils
.
event
(
"start_foreground_service_error"
)
}
}
private
fun
notifyForeground
()
{
...
...
app/src/main/java/com/base/locationsharewhite/ui/locationmap/LocationMapActivity.kt
View file @
2b5ec950
package
com.base.locationsharewhite.ui.locationmap
import
android.Manifest
import
android.animation.ValueAnimator
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.content.Intent
import
android.graphics.Color
import
android.os.Build
import
android.view.LayoutInflater
import
android.view.View
import
android.view.animation.LinearInterpolator
...
...
@@ -61,7 +59,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
private
var
map
:
GoogleMap
?
=
null
private
lateinit
var
locationPresenter
:
LocationPresenter
private
lateinit
var
adapter
:
ViewingAdapter
private
var
adapter
:
ViewingAdapter
?
=
null
private
var
getLocationJob
:
Job
?
=
null
override
val
binding
:
ActivityLocationMapBinding
by
lazy
{
...
...
@@ -203,9 +201,9 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
if
(
BuildConfig
.
DEBUG
)
{
// toast("getLocation ${locatDate?.latitude} ${locatDate?.longitude}")
}
val
viewing
=
adapter
.
items
.
findLast
{
it
.
device
==
viewingBean
.
device
}
val
viewing
=
adapter
?.
items
?
.
findLast
{
it
.
device
==
viewingBean
.
device
}
viewing
?.
locatDate
=
locatDate
adapter
.
notifyDataSetChanged
()
adapter
?
.
notifyDataSetChanged
()
changeViewingBeanPosition
(
false
,
false
,
false
)
}
...
...
@@ -246,13 +244,13 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
runOnUiThread
{
if
(
viewing
.
isEmpty
())
{
showFriendGuideOrNoFriend
()
adapter
.
submitList
(
listOf
())
adapter
?
.
submitList
(
listOf
())
cancelGetLocationJob
()
}
else
{
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
binding
.
llNoFriend
.
visibility
=
View
.
GONE
binding
.
rvViewing
.
visibility
=
View
.
VISIBLE
adapter
.
submitList
(
viewing
)
adapter
?
.
submitList
(
viewing
)
}
}
}
...
...
@@ -292,14 +290,14 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
binding
.
tvGotIt
.
setOnClickListener
{
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
if
(
adapter
.
items
.
isEmpty
()
)
{
if
(
adapter
?.
items
?.
isEmpty
()
==
true
)
{
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
}
}
binding
.
tvNoShowAgain
.
setOnClickListener
{
ConstObject
.
noShowFriendsShareGuide
=
true
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
if
(
adapter
.
items
.
isEmpty
()
)
{
if
(
adapter
?.
items
?.
isEmpty
()
==
true
)
{
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
}
}
...
...
@@ -530,11 +528,11 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
private
fun
refreshNickName
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
val
nickList
=
SpStringUtils
.
getSpStringList
(
VIEWING_NICKNAME_KEY
)
adapter
.
items
.
map
{
viewing
->
adapter
?.
items
?
.
map
{
viewing
->
changeLocalNickName
(
viewing
,
nickList
)
}
launch
(
Dispatchers
.
Main
)
{
adapter
.
notifyDataSetChanged
()
adapter
?
.
notifyDataSetChanged
()
}
}
...
...
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