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
afe466fd
Commit
afe466fd
authored
Oct 31, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
8b1c7c11
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
80 additions
and
88 deletions
+80
-88
AdsConfigBean.kt
...ain/java/com/base/locationsharewhite/ads/AdsConfigBean.kt
+3
-2
AdsMgr.kt
app/src/main/java/com/base/locationsharewhite/ads/AdsMgr.kt
+3
-3
AdInsertMgr.kt
...java/com/base/locationsharewhite/ads/admob/AdInsertMgr.kt
+2
-2
AdOpenMgr.kt
...n/java/com/base/locationsharewhite/ads/admob/AdOpenMgr.kt
+3
-4
LimitUtils.kt
.../java/com/base/locationsharewhite/ads/admob/LimitUtils.kt
+1
-1
BatteryStatusReceiver.kt
.../com/base/locationsharewhite/fcm/BatteryStatusReceiver.kt
+3
-3
MsgConfig.kt
...rc/main/java/com/base/locationsharewhite/fcm/MsgConfig.kt
+2
-2
MsgConfigBean.kt
...ain/java/com/base/locationsharewhite/fcm/MsgConfigBean.kt
+1
-1
MsgMgr.kt
app/src/main/java/com/base/locationsharewhite/fcm/MsgMgr.kt
+10
-10
MsgType.kt
app/src/main/java/com/base/locationsharewhite/fcm/MsgType.kt
+1
-1
PackageStatusReceiver.kt
.../com/base/locationsharewhite/fcm/PackageStatusReceiver.kt
+4
-4
RemoteConfigBean.kt
.../java/com/base/locationsharewhite/fcm/RemoteConfigBean.kt
+2
-1
ScreenStatusReceiver.kt
...a/com/base/locationsharewhite/fcm/ScreenStatusReceiver.kt
+3
-3
TimerManager.kt
...main/java/com/base/locationsharewhite/fcm/TimerManager.kt
+1
-1
GoogleSdkMgr.kt
...n/java/com/base/locationsharewhite/helper/GoogleSdkMgr.kt
+7
-7
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+6
-11
DeleteNotificationReceiver.kt
...tionsharewhite/notification/DeleteNotificationReceiver.kt
+2
-2
NotificationBean.kt
.../base/locationsharewhite/notification/NotificationBean.kt
+1
-1
NotificationHoverUtils.kt
...locationsharewhite/notification/NotificationHoverUtils.kt
+2
-2
NotificationMgr.kt
...m/base/locationsharewhite/notification/NotificationMgr.kt
+2
-2
StayNotificationService.kt
...ase/locationsharewhite/service/StayNotificationService.kt
+3
-3
MainActivity.kt
.../java/com/base/locationsharewhite/ui/main/MainActivity.kt
+15
-19
SplashActivity.kt
...a/com/base/locationsharewhite/ui/splash/SplashActivity.kt
+1
-1
SplashPresenter.kt
.../com/base/locationsharewhite/ui/splash/SplashPresenter.kt
+2
-2
No files found.
app/src/main/java/com/base/locationsharewhite/ads/AdsConfigBean.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.ads
package
com.
base.locationsharewhite
.ads
/**
/**
* 广告限制配置
* 广告限制配置
...
@@ -14,5 +14,6 @@ data class AdsConfigBean(
...
@@ -14,5 +14,6 @@ data class AdsConfigBean(
var
numDisplayLimit
:
Int
=
-
1
,
var
numDisplayLimit
:
Int
=
-
1
,
var
numRequestLimit
:
Int
=
-
1
,
var
numRequestLimit
:
Int
=
-
1
,
var
numClickLimit
:
Int
=
-
1
,
var
numClickLimit
:
Int
=
-
1
,
var
timeInterval
:
Int
=
1
var
timeInterval
:
Int
=
1
,
val
openAdLoading
:
Int
=
15
,
)
)
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ads/AdsMgr.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.ads
package
com.
base.locationsharewhite
.ads
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
...
@@ -6,7 +6,7 @@ import android.view.ViewGroup
...
@@ -6,7 +6,7 @@ import android.view.ViewGroup
import
com.base.locationsharewhite.ads.admob.AdBannerMgr
import
com.base.locationsharewhite.ads.admob.AdBannerMgr
import
com.base.locationsharewhite.ads.admob.AdInsertMgr
import
com.base.locationsharewhite.ads.admob.AdInsertMgr
import
com.base.locationsharewhite.ads.admob.AdNativeMgr
import
com.base.locationsharewhite.ads.admob.AdNativeMgr
import
com.
example.mydemo.strategy
.ads.admob.AdOpenMgr
import
com.
base.locationsharewhite
.ads.admob.AdOpenMgr
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.initialization.AdapterStatus
import
com.google.android.gms.ads.initialization.AdapterStatus
...
@@ -49,7 +49,7 @@ object AdsMgr {
...
@@ -49,7 +49,7 @@ object AdsMgr {
*/
*/
fun
init
(
context
:
Context
,
adsConfigBean
:
AdsConfigBean
)
{
fun
init
(
context
:
Context
,
adsConfigBean
:
AdsConfigBean
)
{
if
(
adsConfigBean
.
isInBlackList
)
return
if
(
adsConfigBean
.
isInBlackList
)
return
this
.
adsConfigBean
=
adsConfigBean
AdsMgr
.
adsConfigBean
=
adsConfigBean
MobileAds
.
initialize
(
context
)
{
MobileAds
.
initialize
(
context
)
{
val
readyAdapter
=
it
.
adapterStatusMap
.
entries
.
find
{
entry
->
val
readyAdapter
=
it
.
adapterStatusMap
.
entries
.
find
{
entry
->
entry
.
value
.
initializationState
==
AdapterStatus
.
State
.
READY
entry
.
value
.
initializationState
==
AdapterStatus
.
State
.
READY
...
...
app/src/main/java/com/base/locationsharewhite/ads/admob/AdInsertMgr.kt
View file @
afe466fd
...
@@ -2,9 +2,9 @@ package com.base.locationsharewhite.ads.admob
...
@@ -2,9 +2,9 @@ package com.base.locationsharewhite.ads.admob
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
import
com.base.locationsharewhite.ads.AdsShowCallBack
import
com.base.locationsharewhite.ads.BaseAdMgr
import
com.base.locationsharewhite.helper.ConstConfig
import
com.base.locationsharewhite.helper.ConstConfig
import
com.example.mydemo.strategy.ads.AdsShowCallBack
import
com.example.mydemo.strategy.ads.BaseAdMgr
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.FullScreenContentCallback
import
com.google.android.gms.ads.FullScreenContentCallback
...
...
app/src/main/java/com/base/locationsharewhite/ads/admob/AdOpenMgr.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.ads.admob
package
com.
base.locationsharewhite
.ads.admob
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
import
com.base.locationsharewhite.ads.admob.LimitUtils
import
com.base.locationsharewhite.ads.AdsShowCallBack
import
com.base.locationsharewhite.ads.BaseAdMgr
import
com.base.locationsharewhite.helper.ConstConfig
import
com.base.locationsharewhite.helper.ConstConfig
import
com.example.mydemo.strategy.ads.AdsShowCallBack
import
com.example.mydemo.strategy.ads.BaseAdMgr
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.FullScreenContentCallback
import
com.google.android.gms.ads.FullScreenContentCallback
...
...
app/src/main/java/com/base/locationsharewhite/ads/admob/LimitUtils.kt
View file @
afe466fd
package
com.base.locationsharewhite.ads.admob
package
com.base.locationsharewhite.ads.admob
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.KotlinExt.toFormatTime4
import
com.base.locationsharewhite.utils.KotlinExt.toFormatTime4
import
com.example.mydemo.strategy.ads.AdsMgr
/**
/**
* 控制广告计数与判断显示条件
* 控制广告计数与判断显示条件
...
...
app/src/main/java/com/base/locationsharewhite/fcm/BatteryStatusReceiver.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
import
android.content.BroadcastReceiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Context
...
@@ -6,8 +6,8 @@ import android.content.Intent
...
@@ -6,8 +6,8 @@ import android.content.Intent
import
android.content.IntentFilter
import
android.content.IntentFilter
import
android.os.BatteryManager
import
android.os.BatteryManager
import
android.os.Build
import
android.os.Build
import
com.
example.mydemo.strategy
.utils.AppPreferences
import
com.
base.locationsharewhite
.utils.AppPreferences
import
com.
example.mydemo.strategy.utils
.toFormatTime4
import
com.
base.locationsharewhite.utils.KotlinExt
.toFormatTime4
/**
/**
*电量监听
*电量监听
...
...
app/src/main/java/com/base/locationsharewhite/fcm/MsgConfig.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
import
android.util.SparseArray
import
android.util.SparseArray
import
androidx.core.util.isNotEmpty
import
androidx.core.util.isNotEmpty
import
com.
example.mydemo.strategy
.notification.NotificationBean
import
com.
base.locationsharewhite
.notification.NotificationBean
/**
/**
* 消息触发配置与消息通知栏配置项目
* 消息触发配置与消息通知栏配置项目
...
...
app/src/main/java/com/base/locationsharewhite/fcm/MsgConfigBean.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
/**
/**
* 消息推送显示策略
* 消息推送显示策略
...
...
app/src/main/java/com/base/locationsharewhite/fcm/MsgMgr.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
import
android.app.NotificationManager
import
android.app.NotificationManager
import
android.content.Context
import
android.content.Context
import
android.util.SparseArray
import
android.util.SparseArray
import
androidx.core.util.isEmpty
import
androidx.core.util.isEmpty
import
androidx.core.util.size
import
androidx.core.util.size
import
com.
example.mydemo.strategy
.notification.NotificationBean
import
com.
base.locationsharewhite
.notification.NotificationBean
import
com.
example.mydemo.strategy
.notification.NotificationHoverUtils
import
com.
base.locationsharewhite
.notification.NotificationHoverUtils
import
com.
example.mydemo.strategy
.notification.NotificationMgr
import
com.
base.locationsharewhite
.notification.NotificationMgr
import
com.
example.mydemo.strategy
.service.StayNotificationService.Companion.startStayNotification
import
com.
base.locationsharewhite
.service.StayNotificationService.Companion.startStayNotification
import
com.
example.mydemo.strategy
.utils.AppPreferences
import
com.
base.locationsharewhite
.utils.AppPreferences
import
com.
example.mydemo.strategy.utils
.toFormatMinute
import
com.
base.locationsharewhite.utils.KotlinExt
.toFormatMinute
import
com.
example.mydemo.strategy.utils
.toFormatTime4
import
com.
base.locationsharewhite.utils.KotlinExt
.toFormatTime4
/**
/**
* 推送消息通知栏相关管理类
* 推送消息通知栏相关管理类
...
@@ -51,11 +51,11 @@ object MsgMgr {
...
@@ -51,11 +51,11 @@ object MsgMgr {
//初始化SDK
//初始化SDK
FCMManager
.
initFirebase
(
context
)
FCMManager
.
initFirebase
(
context
)
//注册fcm主题订阅
//注册fcm主题订阅
var
topic
=
t
his
.
t
opic
var
topic
=
topic
if
(
topic
.
isEmpty
())
{
if
(
topic
.
isEmpty
())
{
val
topicNumber
=
System
.
currentTimeMillis
().
toFormatMinute
()
val
topicNumber
=
System
.
currentTimeMillis
().
toFormatMinute
()
topic
=
packageName
+
"_$topicNumber"
topic
=
packageName
+
"_$topicNumber"
this
.
topic
=
topic
MsgMgr
.
topic
=
topic
}
}
FCMManager
.
subscribeToTopic
(
topic
)
FCMManager
.
subscribeToTopic
(
topic
)
...
...
app/src/main/java/com/base/locationsharewhite/fcm/MsgType.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
/**
/**
* 推送类型
* 推送类型
...
...
app/src/main/java/com/base/locationsharewhite/fcm/PackageStatusReceiver.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
import
android.content.BroadcastReceiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.content.IntentFilter
import
android.content.IntentFilter
import
android.os.Build
import
android.os.Build
import
com.
example.mydemo.strategy
.utils.AppPreferences
import
com.
base.locationsharewhite
.utils.AppPreferences
import
com.
example.mydemo.strategy.utils
.toFormatTime4
import
com.
base.locationsharewhite.utils.KotlinExt
.toFormatTime4
class
PackageStatusReceiver
(
private
val
configBean
:
MsgConfigBean
)
:
BroadcastReceiver
()
{
class
PackageStatusReceiver
(
private
val
configBean
:
MsgConfigBean
)
:
BroadcastReceiver
()
{
...
@@ -48,7 +48,7 @@ class PackageStatusReceiver(private val configBean: MsgConfigBean) : BroadcastRe
...
@@ -48,7 +48,7 @@ class PackageStatusReceiver(private val configBean: MsgConfigBean) : BroadcastRe
MsgMgr
.
saveDate
=
currentDate
MsgMgr
.
saveDate
=
currentDate
count
=
0
count
=
0
}
}
if
((
configBean
.
value2
<
0
||
count
<
configBean
.
value2
)
&&
((
currentMillis
-
date
)
/
1000
/
60
).
toInt
()
>
configBean
.
value1
)
{
if
((
configBean
.
value2
<
0
||
count
<
configBean
.
value2
)
&&
((
currentMillis
-
date
)
/
1000
/
60
).
toInt
()
>
configBean
.
value1
)
{
//推送次数没有达到限制并且展示的最小时间间隔大于配置时间(分钟)
//推送次数没有达到限制并且展示的最小时间间隔大于配置时间(分钟)
count
+=
1
count
+=
1
date
=
System
.
currentTimeMillis
()
date
=
System
.
currentTimeMillis
()
...
...
app/src/main/java/com/base/locationsharewhite/fcm/RemoteConfigBean.kt
View file @
afe466fd
package
com.example.mydemo.strategy.fcm
package
com.base.locationsharewhite.fcm
/**
/**
* 云控返回的json数据格式
* 云控返回的json数据格式
...
...
app/src/main/java/com/base/locationsharewhite/fcm/ScreenStatusReceiver.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
import
android.content.BroadcastReceiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.content.IntentFilter
import
android.content.IntentFilter
import
android.os.Build
import
android.os.Build
import
com.
example.mydemo.strategy
.utils.AppPreferences
import
com.
base.locationsharewhite
.utils.AppPreferences
import
com.
example.mydemo.strategy.utils
.toFormatTime4
import
com.
base.locationsharewhite.utils.KotlinExt
.toFormatTime4
class
ScreenStatusReceiver
(
private
val
configBean
:
MsgConfigBean
)
:
BroadcastReceiver
()
{
class
ScreenStatusReceiver
(
private
val
configBean
:
MsgConfigBean
)
:
BroadcastReceiver
()
{
...
...
app/src/main/java/com/base/locationsharewhite/fcm/TimerManager.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.fcm
package
com.
base.locationsharewhite
.fcm
import
com.base.locationsharewhite.helper.GoogleSdkMgr
import
com.base.locationsharewhite.helper.GoogleSdkMgr
import
java.util.Timer
import
java.util.Timer
...
...
app/src/main/java/com/base/locationsharewhite/helper/GoogleSdkMgr.kt
View file @
afe466fd
...
@@ -2,14 +2,14 @@ package com.base.locationsharewhite.helper
...
@@ -2,14 +2,14 @@ package com.base.locationsharewhite.helper
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
com.base.locationsharewhite.ads.AdsMgr
import
com.base.locationsharewhite.fcm.MsgConfig
import
com.base.locationsharewhite.fcm.MsgConfigBean
import
com.base.locationsharewhite.fcm.MsgMgr
import
com.base.locationsharewhite.fcm.MsgType
import
com.base.locationsharewhite.fcm.RemoteConfigBean
import
com.base.locationsharewhite.notification.NotificationMgr
import
com.example.mydemo.strategy.ads.AdsConfigBean
import
com.example.mydemo.strategy.ads.AdsConfigBean
import
com.example.mydemo.strategy.ads.AdsMgr
import
com.example.mydemo.strategy.fcm.MsgConfig
import
com.example.mydemo.strategy.fcm.MsgConfigBean
import
com.example.mydemo.strategy.fcm.MsgMgr
import
com.example.mydemo.strategy.fcm.MsgType
import
com.example.mydemo.strategy.fcm.RemoteConfigBean
import
com.example.mydemo.strategy.notification.NotificationMgr
import
com.google.firebase.remoteconfig.FirebaseRemoteConfig
import
com.google.firebase.remoteconfig.FirebaseRemoteConfig
import
com.google.gson.Gson
import
com.google.gson.Gson
...
...
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
afe466fd
...
@@ -5,16 +5,12 @@ import android.app.Application
...
@@ -5,16 +5,12 @@ import android.app.Application
import
android.content.Intent
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
android.widget.RemoteViews
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.bean.ConstObject.topic_number
import
com.base.locationsharewhite.bean.ConstObject.topic_number
import
com.base.locationsharewhite.
ui.main.MainActivity
import
com.base.locationsharewhite.
fcm.MsgConfig
import
com.base.locationsharewhite.ui.splash.SplashActivity
import
com.base.locationsharewhite.ui.splash.SplashActivity
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.KotlinExt.toFormatMinute
import
com.base.locationsharewhite.utils.KotlinExt.toFormatMinute
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.LogEx
import
com.example.mydemo.strategy.fcm.MsgConfig
import
com.example.mydemo.strategy.notification.NotificationBean
import
java.util.Locale
import
java.util.Locale
import
java.util.UUID
import
java.util.UUID
...
@@ -73,10 +69,9 @@ class MyApplication : Application() {
...
@@ -73,10 +69,9 @@ class MyApplication : Application() {
// FCMManager.initFirebase(this)
// FCMManager.initFirebase(this)
// FCMManager.subscribeToTopic(topic)
// FCMManager.subscribeToTopic(topic)
// InstallHelps.init()
// InstallHelps.init()
initAdSdk
()
initLifeListener
()
initLifeListener
()
// ScreenStatusReceiver.setupScreenStatusListener(this)
// ScreenStatusReceiver.setupScreenStatusListener(this)
initAdSdk
()
}
}
...
@@ -154,7 +149,7 @@ class MyApplication : Application() {
...
@@ -154,7 +149,7 @@ class MyApplication : Application() {
//设置自己的自定义通知栏
//设置自己的自定义通知栏
// .addRemoteBean(
// .addRemoteBean(
// //自定义的通知事件id,可以自己添加
// //自定义的通知事件id,可以自己添加
// ConstConfig.ACTION_0, NotificationBean(
// ConstConfig.ACTION_0,
com.base.locationsharewhite.notification.
NotificationBean(
// Intent(this, MainActivity::class.java).apply {
// Intent(this, MainActivity::class.java).apply {
// //悬停点击标记,用来进入当相关页面进行悬停关闭
// //悬停点击标记,用来进入当相关页面进行悬停关闭
// putExtra("hover", true)
// putExtra("hover", true)
...
@@ -170,7 +165,7 @@ class MyApplication : Application() {
...
@@ -170,7 +165,7 @@ class MyApplication : Application() {
// )
// )
// )
// )
// .addRemoteBean(
// .addRemoteBean(
// ConstConfig.ACTION_1, NotificationBean(
// ConstConfig.ACTION_1,
com.base.locationsharewhite.notification.
NotificationBean(
// Intent(this, MainActivity::class.java).apply {
// Intent(this, MainActivity::class.java).apply {
// putExtra("hover", true)
// putExtra("hover", true)
// },
// },
...
@@ -185,7 +180,7 @@ class MyApplication : Application() {
...
@@ -185,7 +180,7 @@ class MyApplication : Application() {
// )
// )
// )
// )
// .addRemoteBean(
// .addRemoteBean(
// ConstConfig.ACTION_2, NotificationBean(
// ConstConfig.ACTION_2,
com.base.locationsharewhite.notification.
NotificationBean(
// Intent(this, MainActivity::class.java).apply {
// Intent(this, MainActivity::class.java).apply {
// putExtra("hover", true)
// putExtra("hover", true)
// },
// },
...
...
app/src/main/java/com/base/locationsharewhite/notification/DeleteNotificationReceiver.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.notification
package
com.
base.locationsharewhite
.notification
import
android.content.BroadcastReceiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
com.
example.mydemo.strategy
.fcm.MsgMgr
import
com.
base.locationsharewhite
.fcm.MsgMgr
/**
/**
*通知刪除监听
*通知刪除监听
...
...
app/src/main/java/com/base/locationsharewhite/notification/NotificationBean.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.notification
package
com.
base.locationsharewhite
.notification
import
android.content.Intent
import
android.content.Intent
import
android.widget.RemoteViews
import
android.widget.RemoteViews
...
...
app/src/main/java/com/base/locationsharewhite/notification/NotificationHoverUtils.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.notification
package
com.
base.locationsharewhite
.notification
import
android.content.Context
import
android.content.Context
import
android.os.Handler
import
android.os.Handler
import
android.os.HandlerThread
import
android.os.HandlerThread
import
com.
example.mydemo.strategy
.fcm.MsgMgr
import
com.
base.locationsharewhite
.fcm.MsgMgr
object
NotificationHoverUtils
{
object
NotificationHoverUtils
{
...
...
app/src/main/java/com/base/locationsharewhite/notification/NotificationMgr.kt
View file @
afe466fd
package
com.
example.mydemo.strategy
.notification
package
com.
base.locationsharewhite
.notification
import
android.app.NotificationChannel
import
android.app.NotificationChannel
import
android.app.NotificationManager
import
android.app.NotificationManager
...
@@ -10,8 +10,8 @@ import android.os.Build
...
@@ -10,8 +10,8 @@ import android.os.Build
import
android.widget.RemoteViews
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.app.NotificationCompat
import
androidx.core.graphics.drawable.IconCompat
import
androidx.core.graphics.drawable.IconCompat
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.helper.ConstConfig
import
com.base.locationsharewhite.helper.ConstConfig
import
com.example.mydemo.R
import
kotlin.random.Random
import
kotlin.random.Random
/**
/**
...
...
app/src/main/java/com/base/locationsharewhite/service/StayNotificationService.kt
View file @
afe466fd
package
com.example.mydemo.strategy
.service
package
com.base.locationsharewhite
.service
import
android.app.Notification
import
android.app.Notification
import
android.app.NotificationChannel
import
android.app.NotificationChannel
...
@@ -15,10 +15,10 @@ import android.os.IBinder
...
@@ -15,10 +15,10 @@ import android.os.IBinder
import
android.widget.RemoteViews
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.app.NotificationCompat
import
androidx.core.graphics.drawable.IconCompat
import
androidx.core.graphics.drawable.IconCompat
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.helper.ConstConfig
import
com.base.locationsharewhite.helper.ConstConfig
import
com.base.locationsharewhite.helper.GoogleSdkMgr
import
com.base.locationsharewhite.helper.GoogleSdkMgr
import
com.example.mydemo.MainActivity
import
com.base.locationsharewhite.ui.main.MainActivity
import
com.example.mydemo.R
/**
/**
...
...
app/src/main/java/com/base/locationsharewhite/ui/main/MainActivity.kt
View file @
afe466fd
...
@@ -10,10 +10,6 @@ import androidx.core.view.updatePadding
...
@@ -10,10 +10,6 @@ import androidx.core.view.updatePadding
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.lifecycleScope
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.databinding.ActivityMainBinding
import
com.base.locationsharewhite.databinding.ActivityMainBinding
import
com.base.locationsharewhite.fcm.PopupConstObject
import
com.base.locationsharewhite.fcm.PopupConstObject.NOTIFICATION_ACTION_MY_CODE
import
com.base.locationsharewhite.fcm.PopupConstObject.NOTIFICATION_ACTION_SETTINGS
import
com.base.locationsharewhite.fcm.PopupConstObject.NOTIFICATION_ACTION_SHARE
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.location.LocationLoginUtils
import
com.base.locationsharewhite.location.LocationLoginUtils
...
@@ -118,21 +114,21 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
...
@@ -118,21 +114,21 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
}
}
private
fun
actionIdOperation
()
{
private
fun
actionIdOperation
()
{
if
(
actionId
==
PopupConstObject
.
NOTIFICATION_ACTION_HOME
)
{
//
if (actionId == PopupConstObject.NOTIFICATION_ACTION_HOME) {
//
}
//
}
if
(
actionId
==
NOTIFICATION_ACTION_MY_CODE
)
{
//
if (actionId == NOTIFICATION_ACTION_MY_CODE) {
startActivity
(
Intent
(
this
,
LocationCodeActivity
::
class
.
java
))
//
startActivity(Intent(this, LocationCodeActivity::class.java))
return
//
return
}
//
}
if
(
actionId
==
NOTIFICATION_ACTION_SHARE
)
{
//
if (actionId == NOTIFICATION_ACTION_SHARE) {
startActivity
(
Intent
(
this
,
LocationShareActivity
::
class
.
java
))
//
startActivity(Intent(this, LocationShareActivity::class.java))
return
//
return
}
//
}
if
(
actionId
==
NOTIFICATION_ACTION_SETTINGS
)
{
//
if (actionId == NOTIFICATION_ACTION_SETTINGS) {
startActivity
(
Intent
(
this
,
SettingActivity
::
class
.
java
))
//
startActivity(Intent(this, SettingActivity::class.java))
return
//
return
}
//
}
}
}
override
fun
onResume
()
{
override
fun
onResume
()
{
...
...
app/src/main/java/com/base/locationsharewhite/ui/splash/SplashActivity.kt
View file @
afe466fd
...
@@ -8,8 +8,8 @@ import com.base.locationsharewhite.R
...
@@ -8,8 +8,8 @@ import com.base.locationsharewhite.R
import
com.base.locationsharewhite.bean.ConstObject.ifAgreePrivacy
import
com.base.locationsharewhite.bean.ConstObject.ifAgreePrivacy
import
com.base.locationsharewhite.bean.ConstObject.isFirstLauncher
import
com.base.locationsharewhite.bean.ConstObject.isFirstLauncher
import
com.base.locationsharewhite.databinding.ActivitySplashBinding
import
com.base.locationsharewhite.databinding.ActivitySplashBinding
import
com.base.locationsharewhite.fcm.NotificationHoverUtils
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.notification.NotificationHoverUtils
import
com.base.locationsharewhite.service.StayNotificationService.Companion.startStayNotification
import
com.base.locationsharewhite.service.StayNotificationService.Companion.startStayNotification
import
com.base.locationsharewhite.ui.howuse.HowUseActivity
import
com.base.locationsharewhite.ui.howuse.HowUseActivity
import
com.base.locationsharewhite.ui.main.MainActivity
import
com.base.locationsharewhite.ui.main.MainActivity
...
...
app/src/main/java/com/base/locationsharewhite/ui/splash/SplashPresenter.kt
View file @
afe466fd
...
@@ -4,7 +4,6 @@ import androidx.lifecycle.LifecycleCoroutineScope
...
@@ -4,7 +4,6 @@ import androidx.lifecycle.LifecycleCoroutineScope
import
com.base.locationsharewhite.bean.ConstObject
import
com.base.locationsharewhite.bean.ConstObject
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.LogEx
import
com.base.pdfreader2.ads.AdmobHelper.open_ad_loading
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
...
@@ -17,7 +16,8 @@ class SplashPresenter(
...
@@ -17,7 +16,8 @@ class SplashPresenter(
private
var
jumpJob
:
Job
?
=
null
private
var
jumpJob
:
Job
?
=
null
var
loadingTime
=
AppPreferences
.
getInstance
().
getString
(
open_ad_loading
,
"5"
).
toInt
()
// var loadingTime = AppPreferences.getInstance().getString(open_ad_loading, "5").toInt()
var
loadingTime
=
5
var
startJumpJob
:
Boolean
=
false
var
startJumpJob
:
Boolean
=
false
...
...
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