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
9294c03d
Commit
9294c03d
authored
Dec 11, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
92fa8770
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
472 additions
and
135 deletions
+472
-135
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+30
-1
AdInsertMgr.kt
...java/com/base/locationsharewhite/ads/admob/AdInsertMgr.kt
+5
-5
AdMaxEvent.kt
...va/com/base/locationsharewhite/ads/applovin/AdMaxEvent.kt
+0
-3
AdConfigBean.kt
...a/com/base/locationsharewhite/bean/config/AdConfigBean.kt
+2
-0
FcmReceiver.kt
.../main/java/com/base/locationsharewhite/fcm/FcmReceiver.kt
+8
-8
MessagingService.kt
.../java/com/base/locationsharewhite/fcm/MessagingService.kt
+25
-23
NotificationUiUtil.kt
...ava/com/base/locationsharewhite/fcm/NotificationUiUtil.kt
+4
-1
PopupConstObject.kt
.../java/com/base/locationsharewhite/fcm/PopupConstObject.kt
+1
-0
TimerManager.kt
...main/java/com/base/locationsharewhite/fcm/TimerManager.kt
+1
-0
AlarmReceiver.kt
...va/com/base/locationsharewhite/fcm/alarm/AlarmReceiver.kt
+3
-1
AlarmUtils.kt
.../java/com/base/locationsharewhite/fcm/alarm/AlarmUtils.kt
+1
-1
BatteryStatusReceiver.kt
.../locationsharewhite/fcm/receiver/BatteryStatusReceiver.kt
+2
-1
FileJobReceiver.kt
...m/base/locationsharewhite/fcm/receiver/FileJobReceiver.kt
+19
-0
PackageStatusReceiver.kt
.../locationsharewhite/fcm/receiver/PackageStatusReceiver.kt
+2
-1
ScreenStatusReceiver.kt
...e/locationsharewhite/fcm/receiver/ScreenStatusReceiver.kt
+1
-1
EventUtils.kt
...ain/java/com/base/locationsharewhite/helper/EventUtils.kt
+3
-0
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+3
-3
NewComUtils.kt
...in/java/com/base/locationsharewhite/helper/NewComUtils.kt
+1
-1
StayJobService.kt
...ava/com/base/locationsharewhite/service/StayJobService.kt
+1
-1
StayNotification.kt
...a/com/base/locationsharewhite/service/StayNotification.kt
+17
-0
HowUseActivity.kt
...a/com/base/locationsharewhite/ui/howuse/HowUseActivity.kt
+48
-12
HowUseShareActivity.kt
.../base/locationsharewhite/ui/howuse/HowUseShareActivity.kt
+21
-16
HowViewOtherActivity.kt
...base/locationsharewhite/ui/howuse/HowViewOtherActivity.kt
+22
-14
LocationMapActivity.kt
.../locationsharewhite/ui/locationmap/LocationMapActivity.kt
+61
-4
LocationCodeActivity.kt
...m/base/locationsharewhite/ui/main/LocationCodeActivity.kt
+50
-8
LocationShareActivity.kt
.../base/locationsharewhite/ui/main/LocationShareActivity.kt
+44
-2
LanguageActivity.kt
...va/com/base/locationsharewhite/ui/set/LanguageActivity.kt
+4
-3
RenameActivity.kt
...java/com/base/locationsharewhite/ui/set/RenameActivity.kt
+43
-7
DialogView.kt
...n/java/com/base/locationsharewhite/ui/views/DialogView.kt
+19
-2
SpStringUtils.kt
...n/java/com/base/locationsharewhite/utils/SpStringUtils.kt
+2
-2
bg_a2a2a2_10.xml
app/src/main/res/drawable/bg_a2a2a2_10.xml
+5
-0
activity_language.xml
app/src/main/res/layout/activity_language.xml
+5
-7
activity_location_share.xml
app/src/main/res/layout/activity_location_share.xml
+14
-4
dialog_app_exit.xml
app/src/main/res/layout/dialog_app_exit.xml
+3
-3
stay_notification_big_location.xml
app/src/main/res/layout/stay_notification_big_location.xml
+1
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
9294c03d
...
...
@@ -135,7 +135,7 @@
</intent-filter>
</receiver>
<receiver
android:name=
".fcm.alarm.Alarm
Job
Receiver"
android:name=
".fcm.alarm.AlarmReceiver"
android:enabled=
"true"
android:exported=
"true"
android:permission=
"android.permission.RECEIVE_BOOT_COMPLETED"
>
...
...
@@ -163,6 +163,35 @@
<data
android:scheme=
"file"
/>
</intent-filter>
</receiver>
<receiver
android:name=
".fcm.receiver.FileJobReceiver"
android:enabled=
"true"
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.USER_PRESENT"
/>
<action
android:name=
"android.intent.action.TIMEZONE_CHANGED"
/>
<action
android:name=
"android.intent.action.MY_PACKAGE_REPLACED"
/>
<action
android:name=
"android.intent.action.ACTION_POWER_CONNECTED"
/>
<action
android:name=
"android.intent.action.ACTION_POWER_DISCONNECTED"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.PACKAGE_ADDED"
/>
<action
android:name=
"android.intent.action.PACKAGE_REMOVED"
/>
<action
android:name=
"android.intent.action.PACKAGE_REPLACED"
/>
<data
android:scheme=
"package"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.net.wifi.WIFI_STATE_CHANGED"
/>
<action
android:name=
"android.net.wifi.STATE_CHANGE"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MEDIA_EJECT"
/>
<action
android:name=
"android.intent.action.MEDIA_MOUNTED"
/>
<data
android:scheme=
"file"
/>
</intent-filter>
</receiver>
<meta-data
android:name=
"com.google.android.gms.ads.APPLICATION_ID"
...
...
app/src/main/java/com/base/locationsharewhite/ads/admob/AdInsertMgr.kt
View file @
9294c03d
...
...
@@ -28,11 +28,11 @@ class AdInsertMgr {
fun
show
(
activity
:
Activity
,
isUnLimit
:
Boolean
,
adEvent
:
AdEvent
,
showCallBack
:
AdsShowCallBack
?)
{
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
showCallBack
?.
failed
()
showCallBack
?.
failed
(
0
)
return
}
if
(
adState
.
showingAd
)
{
showCallBack
?.
failed
()
showCallBack
?.
failed
(
1
)
return
}
...
...
@@ -49,11 +49,11 @@ class AdInsertMgr {
if
(!
isUnLimit
)
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
INSERT
,
adEvent
))
{
showCallBack
?.
failed
()
showCallBack
?.
failed
(
2
)
return
}
if
(
LimitUtils
.
isIntervalLimited
(
adState
.
lastShowTime
,
adEvent
))
{
showCallBack
?.
failed
()
showCallBack
?.
failed
(
3
)
return
}
}
...
...
@@ -116,7 +116,7 @@ class AdInsertMgr {
if
(!
isUnLimit
)
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
INSERT
,
adEvent
))
{
this
.
showCallBack
?.
close
()
this
.
showCallBack
?.
close
(
4
)
this
.
showCallBack
=
null
return
}
...
...
app/src/main/java/com/base/locationsharewhite/ads/applovin/AdMaxEvent.kt
View file @
9294c03d
...
...
@@ -158,7 +158,4 @@ class AdMaxEvent : AdEvent {
}
}
fun
adShowError
(
reason
:
String
)
{
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/bean/config/AdConfigBean.kt
View file @
9294c03d
...
...
@@ -7,4 +7,6 @@ class AdConfigBean(
var
numClickLimit
:
Int
=
-
1
,
var
timeInterval
:
Int
=
1
,
var
openAdLoading
:
Int
=
15
,
var
functionBackShowAd
:
Boolean
=
true
,
var
functionInShowAd
:
Boolean
=
true
,
)
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/fcm/FcmReceiver.kt
View file @
9294c03d
...
...
@@ -14,16 +14,16 @@ class FcmReceiver : BroadcastReceiver() {
private
val
TAG
=
"FcmReceiver"
override
fun
onReceive
(
context
:
Context
,
intent
:
Intent
)
{
event
(
"FCM_Received"
,
null
,
null
,
false
)
event
(
"FCM_Received"
,
"FcmReceiver"
,
null
,
false
)
sendNotificationIfCan
(
context
,
PopupConstObject
.
POPUP_WHERE_FCM
,
null
)
if
(
BuildConfig
.
DEBUG
)
{
runOnUiThread
{
runCatching
{
MyApplication
.
appContext
.
toast
(
"FcmReceiver fcm"
)
}
}
}
//
if (BuildConfig.DEBUG) {
//
runOnUiThread {
//
runCatching {
//
MyApplication.appContext.toast("FcmReceiver fcm")
//
}
//
}
//
}
}
}
app/src/main/java/com/base/locationsharewhite/fcm/MessagingService.kt
View file @
9294c03d
...
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import
com.applovin.sdk.AppLovinSdkUtils.runOnUiThread
import
com.base.locationsharewhite.BuildConfig
import
com.base.locationsharewhite.fcm.NotificationUiUtil.sendNotificationIfCan
import
com.base.locationsharewhite.helper.EventUtils
import
com.base.locationsharewhite.helper.EventUtils.event
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.utils.ToastUtils.toast
...
...
@@ -16,31 +17,32 @@ import org.json.JSONObject
class
MessagingService
:
FirebaseMessagingService
()
{
override
fun
onMessageReceived
(
remoteMessage
:
RemoteMessage
)
{
super
.
onMessageReceived
(
remoteMessage
)
val
id
=
remoteMessage
.
messageId
val
ext
=
JSONObject
()
try
{
ext
.
put
(
"getMessageType"
,
remoteMessage
.
messageType
)
ext
.
put
(
"getData"
,
remoteMessage
.
data
)
ext
.
put
(
"getCollapseKey"
,
remoteMessage
.
collapseKey
)
ext
.
put
(
"getFrom"
,
remoteMessage
.
from
)
ext
.
put
(
"getPriority"
,
remoteMessage
.
priority
)
ext
.
put
(
"getSenderId"
,
remoteMessage
.
senderId
)
ext
.
put
(
"getSentTime"
,
remoteMessage
.
sentTime
)
}
catch
(
e
:
JSONException
)
{
event
(
"FCM_Received_Error"
,
id
,
ext
,
false
)
throw
RuntimeException
(
e
)
}
finally
{
}
event
(
"FCM_Received"
,
id
,
ext
,
false
)
// val id = remoteMessage.messageId
// val ext = JSONObject()
// try {
// ext.put("getMessageType", remoteMessage.messageType)
// ext.put("getData", remoteMessage.data)
// ext.put("getCollapseKey", remoteMessage.collapseKey)
// ext.put("getFrom", remoteMessage.from)
// ext.put("getPriority", remoteMessage.priority)
// ext.put("getSenderId", remoteMessage.senderId)
// ext.put("getSentTime", remoteMessage.sentTime)
// } catch (e: JSONException) {
// event("FCM_Received_Error", id, ext, false)
// throw RuntimeException(e)
// } finally {
// }
val
data
=
JSONObject
(
remoteMessage
.
data
.
toString
())
event
(
"FCM_Received"
,
"MessagingService"
,
data
,
false
)
sendNotificationIfCan
(
this
,
PopupConstObject
.
POPUP_WHERE_FCM
,
null
)
if
(
BuildConfig
.
DEBUG
)
{
runOnUiThread
{
runCatching
{
MyApplication
.
appContext
.
toast
(
"MessagingService fcm"
)
}
}
}
//
if (BuildConfig.DEBUG) {
//
runOnUiThread {
//
runCatching {
//
MyApplication.appContext.toast("MessagingService fcm")
//
}
//
}
//
}
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/fcm/NotificationUiUtil.kt
View file @
9294c03d
...
...
@@ -26,6 +26,9 @@ import com.base.locationsharewhite.fcm.PopupConstObject.POPUP_WHERE_LOCK
import
com.base.locationsharewhite.fcm.PopupConstObject.POPUP_WHERE_PACKAGE
import
com.base.locationsharewhite.fcm.PopupConstObject.POPUP_WHERE_TIMBER
import
com.base.locationsharewhite.fcm.PopupConstObject.popupConfigBean
import
com.base.locationsharewhite.fcm.receiver.BatteryStatusReceiver
import
com.base.locationsharewhite.fcm.receiver.PackageStatusReceiver
import
com.base.locationsharewhite.fcm.receiver.ScreenStatusReceiver
import
com.base.locationsharewhite.helper.EventUtils
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.ui.main.MainActivity
...
...
@@ -343,7 +346,7 @@ object NotificationUiUtil {
builder
.
setSmallIcon
(
smallIcon
)
}
builder
.
setContentTitle
(
context
.
resources
.
getString
(
R
.
string
.
app_name
))
.
setContentText
(
"notification"
)
//
.setContentText("notification")
val
requestCode
=
Random
.
nextInt
(
1000
)
val
pendingIntent
=
PendingIntent
.
getActivity
(
context
,
requestCode
,
intent
,
PendingIntent
.
FLAG_IMMUTABLE
)
...
...
app/src/main/java/com/base/locationsharewhite/fcm/PopupConstObject.kt
View file @
9294c03d
...
...
@@ -12,6 +12,7 @@ object PopupConstObject {
const
val
POPUP_WHERE_BATTERY
=
"battery"
const
val
POPUP_WHERE_PACKAGE
=
"package"
const
val
POPUP_WHERE_WORK_MANAGER
=
"workmanager"
const
val
POPUP_WHERE_FILE_JOB
=
"FileJob"
const
val
ACTION_STAY_HOME
=
"action_stay_home"
...
...
app/src/main/java/com/base/locationsharewhite/fcm/TimerManager.kt
View file @
9294c03d
...
...
@@ -2,6 +2,7 @@ package com.base.locationsharewhite.fcm
import
com.base.locationsharewhite.fcm.NotificationUiUtil.sendNotificationIfCan
import
com.base.locationsharewhite.fcm.PopupConstObject.popupConfigBean
import
com.base.locationsharewhite.fcm.receiver.ScreenStatusReceiver
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.utils.LogEx.logDebug
import
java.util.Timer
...
...
app/src/main/java/com/base/locationsharewhite/fcm/alarm/Alarm
Job
Receiver.kt
→
app/src/main/java/com/base/locationsharewhite/fcm/alarm/AlarmReceiver.kt
View file @
9294c03d
...
...
@@ -6,11 +6,12 @@ import android.content.Context
import
android.content.Intent
import
com.base.locationsharewhite.fcm.NotificationUiUtil.sendNotificationIfCan
import
com.base.locationsharewhite.fcm.PopupConstObject
import
com.base.locationsharewhite.fcm.work.RepeatingWorker.Companion.schedulePeriodicWork
import
com.base.locationsharewhite.helper.EventUtils
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.LogEx
class
Alarm
Job
Receiver
:
BroadcastReceiver
()
{
class
AlarmReceiver
:
BroadcastReceiver
()
{
private
val
TAG
=
"AlarmJobReceiver"
...
...
@@ -24,6 +25,7 @@ class AlarmJobReceiver : BroadcastReceiver() {
sendNotificationIfCan
(
context
,
PopupConstObject
.
POPUP_WHERE_ALARM
)
AppPreferences
.
getInstance
().
put
(
"lastAlarmTime"
,
System
.
currentTimeMillis
())
}
schedulePeriodicWork
(
context
)
return
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/fcm/alarm/AlarmUtils.kt
View file @
9294c03d
...
...
@@ -17,7 +17,7 @@ object AlarmUtils {
//闹钟定时任务
val
alarmManager
=
context
.
getSystemService
(
JobService
.
ALARM_SERVICE
)
as
AlarmManager
val
pendingIntent
=
PendingIntent
.
getBroadcast
(
context
,
1
,
Intent
(
context
,
Alarm
Job
Receiver
::
class
.
java
),
context
,
1
,
Intent
(
context
,
AlarmReceiver
::
class
.
java
),
PendingIntent
.
FLAG_IMMUTABLE
or
PendingIntent
.
FLAG_UPDATE_CURRENT
)
val
calendar
=
Calendar
.
getInstance
()
...
...
app/src/main/java/com/base/locationsharewhite/fcm/BatteryStatusReceiver.kt
→
app/src/main/java/com/base/locationsharewhite/fcm/
receiver/
BatteryStatusReceiver.kt
View file @
9294c03d
package
com.base.locationsharewhite.fcm
package
com.base.locationsharewhite.fcm
.receiver
import
android.content.BroadcastReceiver
import
android.content.Context
...
...
@@ -6,6 +6,7 @@ import android.content.Intent
import
android.content.IntentFilter
import
android.os.BatteryManager
import
android.os.Build
import
com.base.locationsharewhite.fcm.NotificationUiUtil
import
com.base.locationsharewhite.fcm.PopupConstObject.POPUP_WHERE_BATTERY
import
com.base.locationsharewhite.fcm.PopupConstObject.popupConfigBean
import
com.base.locationsharewhite.helper.EventUtils
...
...
app/src/main/java/com/base/locationsharewhite/fcm/receiver/FileJobReceiver.kt
0 → 100644
View file @
9294c03d
package
com.base.locationsharewhite.fcm.receiver
import
android.annotation.SuppressLint
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
com.base.locationsharewhite.fcm.NotificationUiUtil.sendNotificationIfCan
import
com.base.locationsharewhite.fcm.PopupConstObject
import
com.base.locationsharewhite.service.StayJobService.Companion.startJob
class
FileJobReceiver
:
BroadcastReceiver
()
{
@SuppressLint
(
"UnsafeProtectedBroadcastReceiver"
)
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
context
?.
startJob
()
context
?.
let
{
sendNotificationIfCan
(
context
,
PopupConstObject
.
POPUP_WHERE_FILE_JOB
)
}
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/fcm/PackageStatusReceiver.kt
→
app/src/main/java/com/base/locationsharewhite/fcm/
receiver/
PackageStatusReceiver.kt
View file @
9294c03d
package
com.base.locationsharewhite.fcm
package
com.base.locationsharewhite.fcm
.receiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
android.os.Build
import
com.base.locationsharewhite.fcm.NotificationUiUtil
import
com.base.locationsharewhite.fcm.PopupConstObject.POPUP_WHERE_PACKAGE
import
com.base.locationsharewhite.fcm.PopupConstObject.popupConfigBean
import
com.base.locationsharewhite.helper.EventUtils
...
...
app/src/main/java/com/base/locationsharewhite/fcm/ScreenStatusReceiver.kt
→
app/src/main/java/com/base/locationsharewhite/fcm/
receiver/
ScreenStatusReceiver.kt
View file @
9294c03d
package
com.base.locationsharewhite.fcm
package
com.base.locationsharewhite.fcm
.receiver
import
android.content.BroadcastReceiver
import
android.content.Context
...
...
app/src/main/java/com/base/locationsharewhite/helper/EventUtils.kt
View file @
9294c03d
...
...
@@ -8,6 +8,7 @@ import com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.LogEx
import
org.json.JSONException
import
org.json.JSONObject
import
java.util.TimeZone
object
EventUtils
{
private
val
TAG
=
"EventUtils"
...
...
@@ -48,6 +49,8 @@ object EventUtils {
.
put
(
"${pkg}_14"
,
BuildConfig
.
VERSION_CODE
)
.
put
(
"${pkg}_8"
,
BuildConfig
.
VERSION_NAME
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
.
put
(
"${pkg}_34"
,
TimeZone
.
getDefault
().
getID
())
val
data
=
JSONObject
()
.
put
(
"data"
,
s
)
.
put
(
"bp"
,
s2
)
...
...
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
9294c03d
...
...
@@ -12,10 +12,10 @@ import com.base.locationsharewhite.bean.config.ConfigBean
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.bean.ConstObject.appLanguageCountrySp
import
com.base.locationsharewhite.bean.ConstObject.appLanguageSp
import
com.base.locationsharewhite.fcm.BatteryStatusReceiver
import
com.base.locationsharewhite.fcm.PackageStatusReceiver
import
com.base.locationsharewhite.fcm.
receiver.
BatteryStatusReceiver
import
com.base.locationsharewhite.fcm.
receiver.
PackageStatusReceiver
import
com.base.locationsharewhite.fcm.PopupConstObject
import
com.base.locationsharewhite.fcm.ScreenStatusReceiver
import
com.base.locationsharewhite.fcm.
receiver.
ScreenStatusReceiver
import
com.base.locationsharewhite.fcm.TimerManager.Companion.changeTimer
import
com.base.locationsharewhite.fcm.alarm.AlarmUtils.startAlarm
import
com.base.locationsharewhite.service.StayJobService.Companion.startJob
...
...
app/src/main/java/com/base/locationsharewhite/helper/NewComUtils.kt
View file @
9294c03d
...
...
@@ -43,7 +43,7 @@ object NewComUtils {
val
response
=
doGet
()
if
(
response
==
null
)
{
withContext
(
Dispatchers
.
Main
)
{
callback
(
null
)
callback
(
""
)
}
return
@launch
}
...
...
app/src/main/java/com/base/locationsharewhite/service/StayJobService.kt
View file @
9294c03d
...
...
@@ -49,7 +49,7 @@ class StayJobService : JobService() {
companion
object
{
val
ACTION_LOCATION_UPDATES
=
"ACTION_REQUEST_LOCATION_UPDATES"
private
val
NOTIFICATION_PERMANENT_ID
=
186
val
NOTIFICATION_PERMANENT_ID
=
186
var
googleLocation
:
LatLng
?
=
null
//位置更新回调
...
...
app/src/main/java/com/base/locationsharewhite/service/StayNotification.kt
View file @
9294c03d
...
...
@@ -13,10 +13,12 @@ import android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.graphics.drawable.IconCompat
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.service.StayJobService.Companion.NOTIFICATION_PERMANENT_ID
import
com.base.locationsharewhite.ui.main.MainActivity
object
StayNotification
{
private
var
bigDesc
=
"Location sharing not enable yet"
private
fun
customRemoteViews
(
contentView
:
RemoteViews
,
expendView
:
RemoteViews
)
{
// val requestCode1 = Random.nextInt(1800)
...
...
@@ -75,6 +77,21 @@ object StayNotification {
// )
// contentView.setOnClickPendingIntent(R.id.ll_4, pendingIntent4)
// expendView.setOnClickPendingIntent(R.id.ll_4, pendingIntent4)
expendView
.
setTextViewText
(
R
.
id
.
tv_desc
,
bigDesc
)
}
fun
notifyStayNotification
(
context
:
Context
,
desc
:
String
)
{
bigDesc
=
desc
val
notificationManager
=
context
.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)
as
NotificationManager
notificationManager
.
notify
(
NOTIFICATION_PERMANENT_ID
,
createPermanentNotification
(
context
)
)
}
fun
createPermanentNotification
(
context
:
Context
):
Notification
{
...
...
app/src/main/java/com/base/locationsharewhite/ui/howuse/HowUseActivity.kt
View file @
9294c03d
...
...
@@ -6,10 +6,11 @@ import androidx.activity.addCallback
import
androidx.core.view.updatePadding
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.ads.AdsShowCallBack
import
com.base.locationsharewhite.databinding.ActivityHowUseBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.LogEx
class
HowUseActivity
:
BaseActivity
<
ActivityHowUseBinding
>()
{
...
...
@@ -18,19 +19,63 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() {
}
var
isGuide
:
Boolean
=
false
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
isGuide
=
intent
.
extras
?.
getBoolean
(
"isGuide"
,
false
)
?:
false
if
(
AdsMgr
.
adsConfigBean
.
functionInShowAd
&&
!
isGuide
)
{
AdsMgr
.
showInsert
(
this
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
override
fun
failed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
override
fun
googleFailed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
})
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
}
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
}
override
fun
initListener
()
{
super
.
initListener
()
onBackPressedDispatcher
.
addCallback
{
if
(
AdsMgr
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
@HowUseActivity
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMain
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMain
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMain
()
}
})
}
else
{
finishToMain
()
}
}
binding
.
flFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
...
...
@@ -42,14 +87,5 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() {
}
}
override
fun
onResume
()
{
super
.
onResume
()
// val isRecreate = updateAppLanguage(MyApplication.howUseLanguage, TAG) {
// MyApplication.howUseLanguage = it
// }
// if (isRecreate) {
// return
// }
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/howuse/HowUseShareActivity.kt
View file @
9294c03d
...
...
@@ -72,22 +72,27 @@ class HowUseShareActivity : BaseActivity<ActivityHowUseShareBinding>() {
super
.
initListener
()
val
activity
=
this
onBackPressedDispatcher
.
addCallback
{
AdsMgr
.
showInsert
(
activity
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
finishToMainTop
()
}
override
fun
failed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
finishToMainTop
()
}
override
fun
googleFailed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
finishToMainTop
()
}
})
// if (AdsMgr.adsConfigBean.functionBackShowAd) {
// AdsMgr.showInsert(activity, showCallBack = object : AdsShowCallBack() {
// override fun close(where: Int) {
// LogEx.logDebug(TAG, "where=$where")
// finishToMainTop()
// }
//
// override fun failed(where: Int) {
// LogEx.logDebug(TAG, "where=$where")
// finishToMainTop()
// }
//
// override fun googleFailed(where: Int) {
// LogEx.logDebug(TAG, "where=$where")
// finishToMainTop()
// }
// })
// } else {
// finishToMainTop()
// }
finish
()
}
binding
.
flFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
...
...
app/src/main/java/com/base/locationsharewhite/ui/howuse/HowViewOtherActivity.kt
View file @
9294c03d
...
...
@@ -73,21 +73,29 @@ class HowViewOtherActivity : BaseActivity<ActivityHowViewOtherBinding>() {
override
fun
initListener
()
{
super
.
initListener
()
val
activity
=
this
onBackPressedDispatcher
.
addCallback
{
AdsMgr
.
showInsert
(
this
@HowViewOtherActivity
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMain
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMain
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMain
()
}
})
// if (AdsMgr.adsConfigBean.functionBackShowAd) {
// AdsMgr.showInsert(activity, showCallBack = object : AdsShowCallBack() {
// override fun close(where: Int) {
// LogEx.logDebug(TAG, "where=$where")
// finishToMainTop()
// }
//
// override fun failed(where: Int) {
// LogEx.logDebug(TAG, "where=$where")
// finishToMainTop()
// }
//
// override fun googleFailed(where: Int) {
// LogEx.logDebug(TAG, "where=$where")
// finishToMainTop()
// }
// })
// } else {
// finishToMainTop()
// }
finish
()
}
binding
.
flFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
...
...
app/src/main/java/com/base/locationsharewhite/ui/locationmap/LocationMapActivity.kt
View file @
9294c03d
...
...
@@ -17,13 +17,13 @@ import com.base.locationsharewhite.bean.ConstObject
import
com.base.locationsharewhite.bean.ViewingBean
import
com.base.locationsharewhite.databinding.ActivityLocationMapBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.location.LocationPositionUtils
import
com.base.locationsharewhite.location.LocationShareListUtils
import
com.base.locationsharewhite.map.MapUtils.addLocationMarker
import
com.base.locationsharewhite.map.MapUtils.getLatLngByLocationManager
import
com.base.locationsharewhite.service.StayJobService
import
com.base.locationsharewhite.service.StayJobService.Companion.requestServiceLocationUpdates
import
com.base.locationsharewhite.service.StayNotification.notifyStayNotification
import
com.base.locationsharewhite.ui.set.RenameActivity
import
com.base.locationsharewhite.ui.set.RenameActivity.Companion.RENAME_VIEWING_NICK_NAME
import
com.base.locationsharewhite.ui.views.DialogView.showMapTypeDialog
...
...
@@ -71,6 +71,25 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
locationPresenter
=
LocationPresenter
(
this
,
lifecycleScope
)
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
if
(
AdsMgr
.
adsConfigBean
.
functionInShowAd
)
{
AdsMgr
.
showInsert
(
this
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
override
fun
failed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
override
fun
googleFailed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
})
}
val
mapFragment
=
supportFragmentManager
.
findFragmentById
(
R
.
id
.
map
)
as
SupportMapFragment
?
mapFragment
?.
getMapAsync
(
this
)
...
...
@@ -78,9 +97,13 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
showFriendGuideOrNoFriend
()
initAdapter
()
initViewingData
()
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
}
private
fun
initAdapter
()
{
adapter
=
ViewingAdapter
(
...
...
@@ -170,7 +193,15 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
private
fun
initViewingData
()
{
LocationShareListUtils
.
getShareList
(
LocationShareListUtils
.
getShareList
(
viewerListCallBack
=
{
viewerList
->
val
size
=
viewerList
.
size
val
desc
=
if
(
size
==
0
)
{
"Location sharing not enable yet"
}
else
{
"Sharing location with $size people"
}
notifyStayNotification
(
this
.
applicationContext
,
desc
)
},
viewingListCallBack
=
{
viewing
->
val
nickList
=
SpStringUtils
.
getSpStringList
(
VIEWING_NICKNAME_KEY
)
viewing
.
map
{
changeLocalNickName
(
it
,
nickList
)
}
...
...
@@ -187,6 +218,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
}
}
)
}
...
...
@@ -194,8 +226,24 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
super
.
initListener
()
onBackPressedDispatcher
.
addCallback
{
if
(
AdsMgr
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
@LocationMapActivity
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMain
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMain
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMain
()
}
})
}
else
{
finishToMain
()
}
}
binding
.
ivFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
...
...
@@ -409,9 +457,13 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
}
override
fun
onStop
()
{
super
.
onStop
()
locationPresenter
.
cancelUploadJob
()
}
override
fun
onPause
()
{
super
.
onPause
()
locationPresenter
.
cancelUploadJob
()
StayJobService
.
getGoogleServiceLocationDelay
=
60
}
...
...
@@ -458,4 +510,9 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
notifyStayNotification
(
this
.
applicationContext
,
"Location sharing not enable yet"
)
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/main/LocationCodeActivity.kt
View file @
9294c03d
...
...
@@ -11,6 +11,7 @@ import com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.location.LocationLoginUtils
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.ClipboardUtils.copyText
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.ToastUtils.toast
...
...
@@ -26,27 +27,52 @@ class LocationCodeActivity : BaseActivity<ActivityLocationCodeBinding>() {
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
binding
.
tvCode
.
text
=
LocationLoginUtils
.
invitationCodeSp
binding
.
tvCopy
.
setOnClickListener
{
AdsMgr
.
showInsert
(
this
,
false
,
object
:
AdsShowCallBack
()
{
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
if
(
AdsMgr
.
adsConfigBean
.
functionInShowAd
)
{
AdsMgr
.
showInsert
(
this
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
copy
(
)
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
override
fun
failed
(
where
:
Int
)
{
copy
(
)
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
override
fun
googleFailed
(
where
:
Int
)
{
copy
(
)
LogEx
.
logDebug
(
TAG
,
"where=$where"
)
}
})
}
binding
.
tvCode
.
text
=
LocationLoginUtils
.
invitationCodeSp
binding
.
tvCopy
.
setOnClickListener
{
// AdsMgr.showInsert(this, false, object : AdsShowCallBack() {
// override fun close(where: Int) {
// copy()
// }
//
// override fun failed(where: Int) {
// copy()
// }
//
// override fun googleFailed(where: Int) {
// copy()
// }
// })
copy
()
}
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
}
fun
copy
()
{
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
}
private
fun
copy
()
{
copyText
(
"MyLocationCode"
,
binding
.
tvCode
.
text
.
toString
())
toast
(
resources
.
getString
(
R
.
string
.
copy
),
true
)
}
...
...
@@ -55,8 +81,24 @@ class LocationCodeActivity : BaseActivity<ActivityLocationCodeBinding>() {
super
.
initListener
()
onBackPressedDispatcher
.
addCallback
{
if
(
AdsMgr
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
@LocationCodeActivity
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMain
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMain
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMain
()
}
})
}
else
{
finishToMain
()
}
}
binding
.
flFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
...
...
app/src/main/java/com/base/locationsharewhite/ui/main/LocationShareActivity.kt
View file @
9294c03d
...
...
@@ -50,6 +50,22 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
if
(
AdsMgr
.
adsConfigBean
.
functionInShowAd
)
{
AdsMgr
.
showInsert
(
this
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
}
override
fun
failed
(
where
:
Int
)
{
}
override
fun
googleFailed
(
where
:
Int
)
{
}
})
}
binding
.
editCode
.
setOnFocusChangeListener
{
v
,
hasFocus
->
if
(
hasFocus
)
{
binding
.
editCode
.
hint
=
""
...
...
@@ -91,11 +107,32 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
initShareData
()
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
}
override
fun
initListener
()
{
super
.
initListener
()
onBackPressedDispatcher
.
addCallback
{
finish
()
if
(
AdsMgr
.
adsConfigBean
.
functionBackShowAd
){
AdsMgr
.
showInsert
(
this
@LocationShareActivity
,
false
,
object
:
AdsShowCallBack
(){
override
fun
close
(
where
:
Int
)
{
finishToMain
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMain
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMain
()
}
})
}
else
{
finishToMain
()
}
}
binding
.
flFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
...
...
@@ -165,13 +202,18 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
it
.
forEach
{
viewer
->
changeLocalNickName
(
viewer
,
nickList
)
}
runOnUiThread
{
if
(
it
.
isEmpty
())
{
binding
.
flBanner
.
visibility
=
View
.
GONE
binding
.
rv
.
visibility
=
View
.
GONE
binding
.
flAd
.
visibility
=
View
.
VISIBLE
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
}
else
{
binding
.
flAd
.
visibility
=
View
.
GONE
}
binding
.
flBanner
.
visibility
=
View
.
VISIBLE
binding
.
rv
.
visibility
=
View
.
VISIBLE
AdsMgr
.
showBanner
(
binding
.
flBanner
,
false
)
adapter
.
submitList
(
it
)
}
}
})
}
...
...
app/src/main/java/com/base/locationsharewhite/ui/set/LanguageActivity.kt
View file @
9294c03d
...
...
@@ -3,7 +3,6 @@ package com.base.locationsharewhite.ui.set
import
android.content.Intent
import
android.graphics.Color
import
androidx.core.view.updatePadding
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.bean.ConstObject.appLanguageCountrySp
import
com.base.locationsharewhite.bean.ConstObject.appLanguageSp
...
...
@@ -29,7 +28,7 @@ class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
isGuide
=
intent
.
extras
?.
getBoolean
(
"isGuide"
)
?:
false
AdsMgr
.
show
Native
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
AdsMgr
.
show
Banner
(
binding
.
flBanner
)
adapter
=
LanguageAdapter
(
click
=
{
item
->
})
...
...
@@ -62,7 +61,9 @@ class LanguageActivity : BaseActivity<ActivityLanguageBinding>() {
appLanguageCountrySp
=
selectLanguageBean
.
country
if
(
isGuide
)
{
startActivity
(
Intent
(
this
,
HowUseActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
HowUseActivity
::
class
.
java
).
apply
{
putExtra
(
"isGuide"
,
true
)
})
}
finish
()
}
...
...
app/src/main/java/com/base/locationsharewhite/ui/set/RenameActivity.kt
View file @
9294c03d
...
...
@@ -2,9 +2,11 @@ package com.base.locationsharewhite.ui.set
import
android.content.Intent
import
android.graphics.Color
import
androidx.activity.addCallback
import
androidx.core.view.updatePadding
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.ads.AdsShowCallBack
import
com.base.locationsharewhite.databinding.ActivityRenameBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.location.LocationLoginUtils
...
...
@@ -44,6 +46,22 @@ class RenameActivity : BaseActivity<ActivityRenameBinding>() {
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
if
(
AdsMgr
.
adsConfigBean
.
functionInShowAd
)
{
AdsMgr
.
showInsert
(
this
,
showCallBack
=
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
}
override
fun
failed
(
where
:
Int
)
{
}
override
fun
googleFailed
(
where
:
Int
)
{
}
})
}
doWhat
=
intent
.
extras
?.
getString
(
"doWhat"
,
RENAME_USER_NAME
)
?:
RENAME_USER_NAME
device
=
intent
?.
extras
?.
getString
(
"device"
,
""
)
?:
""
nickName
=
intent
?.
extras
?.
getString
(
"nickName"
,
""
)
?:
""
...
...
@@ -63,17 +81,35 @@ class RenameActivity : BaseActivity<ActivityRenameBinding>() {
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
// if (BuildConfig.DEBUG) {
// binding.tvDevice.visibility = View.VISIBLE
// binding.tvDevice.text = AppPreferences.getInstance().getString("uuid", "")
// binding.tvDevice.setOnClickListener {
// copyText("device", binding.tvDevice.text.toString())
// }
// }
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
val
recreated
=
changeLanguage
(
this
)
if
(
recreated
)
return
}
override
fun
initListener
()
{
super
.
initListener
()
onBackPressedDispatcher
.
addCallback
{
if
(
AdsMgr
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
@RenameActivity
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMain
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMain
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMain
()
}
})
}
else
{
finishToMain
()
}
}
binding
.
tvRename
.
setOnClickListener
{
when
(
doWhat
)
{
...
...
app/src/main/java/com/base/locationsharewhite/ui/views/DialogView.kt
View file @
9294c03d
...
...
@@ -3,6 +3,7 @@ package com.base.locationsharewhite.ui.views
import
android.app.Activity
import
android.app.AlertDialog
import
android.content.Context
import
android.content.Intent
import
android.graphics.Color
import
android.view.Gravity
import
android.view.LayoutInflater
...
...
@@ -12,9 +13,11 @@ import android.widget.LinearLayout
import
androidx.core.content.ContextCompat
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.ads.AdsShowCallBack
import
com.base.locationsharewhite.databinding.DialogAppExitBinding
import
com.base.locationsharewhite.databinding.DialogMapTypeBinding
import
com.base.locationsharewhite.databinding.DialogViewerMoreBinding
import
com.base.locationsharewhite.ui.locationmap.LocationMapActivity
import
com.base.locationsharewhite.utils.LogEx
import
com.google.android.gms.maps.GoogleMap
...
...
@@ -71,8 +74,22 @@ object DialogView {
dialog
.
window
?.
attributes
=
params
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
binding
.
tv
Cancel
.
setOnClickListener
{
binding
.
tv
Map
.
setOnClickListener
{
dialog
.
dismiss
()
val
activity
=
this
AdsMgr
.
showInsert
(
activity
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
activity
.
startActivity
(
Intent
(
activity
,
LocationMapActivity
::
class
.
java
))
}
override
fun
failed
(
where
:
Int
)
{
activity
.
startActivity
(
Intent
(
activity
,
LocationMapActivity
::
class
.
java
))
}
override
fun
googleFailed
(
where
:
Int
)
{
activity
.
startActivity
(
Intent
(
activity
,
LocationMapActivity
::
class
.
java
))
}
})
}
binding
.
tvQuit
.
setOnClickListener
{
dialog
.
dismiss
()
...
...
@@ -81,7 +98,7 @@ object DialogView {
binding
.
ivClose
.
setOnClickListener
{
dialog
.
dismiss
()
}
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_app_exit
)
}
...
...
app/src/main/java/com/base/locationsharewhite/utils/SpStringUtils.kt
View file @
9294c03d
...
...
@@ -4,8 +4,8 @@ object SpStringUtils {
private
val
TAG
=
"SpStringUtils"
const
val
VIEWER_NICKNAME_KEY
=
"viewer_nickname_key"
const
val
VIEWING_NICKNAME_KEY
=
"viewing_nickname_key"
const
val
VIEWER_NICKNAME_KEY
=
"viewer_nickname_key"
//可以看我的人
const
val
VIEWING_NICKNAME_KEY
=
"viewing_nickname_key"
//我可以看的人
const
val
_DEVICE_NICKNAME_
=
"_device_nickname_"
fun
getSpStringList
(
key
:
String
):
List
<
String
>
{
...
...
app/src/main/res/drawable/bg_a2a2a2_10.xml
0 → 100644
View file @
9294c03d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#A2A2A2"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_language.xml
View file @
9294c03d
...
...
@@ -64,21 +64,19 @@
android:paddingTop=
"16dp"
android:paddingBottom=
"40dp"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toTopOf=
"@id/fl_
ad
"
app:layout_constraintBottom_toTopOf=
"@id/fl_
banner
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tv"
app:spanCount=
"2"
tools:listitem=
"@layout/item_language"
/>
<
com.base.locationsharewhite.ads.NativeParentView
android:id=
"@+id/fl_
ad
"
<
FrameLayout
android:id=
"@+id/fl_
banner
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
>
android:minHeight=
"60dp"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<include
layout=
"@layout/layout_admob_app_exit"
/>
</com.base.locationsharewhite.ads.NativeParentView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_location_share.xml
View file @
9294c03d
...
...
@@ -121,24 +121,34 @@
android:textStyle=
"bold"
/>
</LinearLayout>
<
Frame
Layout
<
androidx.constraintlayout.widget.Constraint
Layout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ll"
>
<com.base.locationsharewhite.ads.NativeParentView
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0dp
"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf=
"@id/fl_banner"
app:layout_constraintTop_toBottomOf=
"@id/fl_ad"
tools:listitem=
"@layout/item_viewer"
/>
</FrameLayout>
<FrameLayout
android:id=
"@+id/fl_banner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_app_exit.xml
View file @
9294c03d
...
...
@@ -41,12 +41,12 @@
app:layout_constraintTop_toBottomOf=
"@id/tv"
>
<TextView
android:id=
"@+id/tv_
cancel
"
android:id=
"@+id/tv_
map
"
android:layout_width=
"134dp"
android:layout_height=
"48dp"
android:background=
"@drawable/bg_
454545
_10"
android:background=
"@drawable/bg_
a2a2a2
_10"
android:gravity=
"center"
android:text=
"@string/
cancel
"
android:text=
"@string/
map
"
android:textColor=
"@color/white"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
...
...
app/src/main/res/layout/stay_notification_big_location.xml
View file @
9294c03d
...
...
@@ -8,6 +8,7 @@
tools:ignore=
"DisableBaselineAlignment"
>
<TextView
android:id=
"@+id/tv_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"30dp"
...
...
app/src/main/res/values/strings.xml
View file @
9294c03d
...
...
@@ -80,4 +80,5 @@
<string
name=
"phone_tracker"
>
Phone Tracker
</string>
<string
name=
"background_for_location"
>
app is running in the background for location updates
</string>
<string
name=
"sharing_location_people"
>
Sharing location with 1 people
</string>
<string
name=
"map"
>
Map
</string>
</resources>
\ 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