Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner 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
PDF Viewer Scanner White
Commits
397bfd85
Commit
397bfd85
authored
Oct 11, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
209d5803
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
9 deletions
+22
-9
NotificationUiUtil.kt
.../com/base/pdfviewerscannerwhite/fcm/NotificationUiUtil.kt
+14
-4
PopupConstObject.kt
...va/com/base/pdfviewerscannerwhite/fcm/PopupConstObject.kt
+5
-1
ScreenStatusReceiver.java
.../base/pdfviewerscannerwhite/fcm/ScreenStatusReceiver.java
+1
-1
TimerManager.java
...java/com/base/pdfviewerscannerwhite/fcm/TimerManager.java
+2
-2
PdfActivity.kt
...base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
+0
-1
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/NotificationUiUtil.kt
View file @
397bfd85
...
...
@@ -17,11 +17,15 @@ import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_NEW_I
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_DOCUMENTS
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_PDF
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_UN_VIEW_FILES
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_LOCK
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_TIMBER
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_count
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_end
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_lock_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_start
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_status
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_timber_interval
import
com.base.pdfviewerscannerwhite.helper.MyApplication
import
com.base.pdfviewerscannerwhite.ui.splash.SplashActivity
import
com.base.pdfviewerscannerwhite.utils.AppPreferences
...
...
@@ -67,7 +71,7 @@ object NotificationUiUtil {
AppPreferences
.
getInstance
().
put
(
"lastPopupTime"
,
value
,
true
)
}
fun
canSendNotification
():
Boolean
{
fun
canSendNotification
(
where
:
String
):
Boolean
{
//是否开启推送
val
status
=
AppPreferences
.
getInstance
().
getString
(
popup_status
,
"1"
).
toInt
()
if
(
status
==
0
)
{
...
...
@@ -91,7 +95,13 @@ object NotificationUiUtil {
}
//单位分钟
val
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_interval
,
"1"
).
toInt
()
var
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_interval
,
"1"
).
toInt
()
if
(
where
==
POPUP_WHERE_TIMBER
)
{
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_timber_interval
,
"7"
).
toInt
()
}
if
(
where
==
POPUP_WHERE_LOCK
)
{
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_lock_interval
,
"1"
).
toInt
()
}
if
(
System
.
currentTimeMillis
()
-
lastPopupTime
<
interval
*
60
*
1000L
)
{
LogEx
.
logDebug
(
"canSendNotification"
,
"interval"
)
return
false
...
...
@@ -101,8 +111,8 @@ object NotificationUiUtil {
}
@SuppressLint
(
"RemoteViewLayout"
)
fun
sendNotification
(
context
:
Context
,
actionId
:
String
)
{
if
(!
canSendNotification
())
return
fun
sendNotification
(
context
:
Context
,
actionId
:
String
,
where
:
String
=
""
)
{
if
(!
canSendNotification
(
where
))
return
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
context
.
packageName
,
R
.
layout
.
notification_message
)
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
context
.
packageName
,
R
.
layout
.
notification_message
)
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/PopupConstObject.kt
View file @
397bfd85
...
...
@@ -2,6 +2,9 @@ package com.base.pdfviewerscannerwhite.fcm
object
PopupConstObject
{
const
val
POPUP_WHERE_TIMBER
=
"Timber"
const
val
POPUP_WHERE_LOCK
=
"Lock"
//推送总开关 0 关 1开
val
popup_status
=
"popup_status"
...
...
@@ -11,7 +14,8 @@ object PopupConstObject {
val
popup_start
=
"popup_start"
val
popup_end
=
"popup_start"
val
popup_interval
=
"popup_interval"
val
popup_timber_interval
=
"popup_timber_interval"
val
popup_lock_interval
=
"popup_lock_interval"
//推送样式一配置
val
popup_style1_start
=
"popup_style1_start"
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/ScreenStatusReceiver.java
View file @
397bfd85
...
...
@@ -48,7 +48,7 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
int
secureSetting
=
Integer
.
parseInt
(
AppPreferences
.
getInstance
().
getString
(
"lockS"
,
"1"
));
if
(
secureSetting
==
1
)
{
String
actionId
=
NotificationUiUtil
.
INSTANCE
.
getNextActionId
();
NotificationUiUtil
.
INSTANCE
.
sendNotification
(
context
,
actionId
);
NotificationUiUtil
.
INSTANCE
.
sendNotification
(
context
,
actionId
,
PopupConstObject
.
POPUP_WHERE_LOCK
);
}
}
break
;
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/TimerManager.java
View file @
397bfd85
...
...
@@ -36,8 +36,8 @@ public class TimerManager {
!
ScreenStatusReceiver
.
isSecureLockActive
()
&&
MyApplication
.
PAUSED_VALUE
!=
1
)
{
Log
.
d
(
"glc"
,
"Scheduled task conditions are met"
);
String
actionId
=
NotificationUiUtil
.
INSTANCE
.
getNextActionId
();
NotificationUiUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
actionId
);
String
actionId
=
NotificationUiUtil
.
INSTANCE
.
getNextActionId
();
NotificationUiUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
actionId
,
PopupConstObject
.
POPUP_WHERE_TIMBER
);
}
}
};
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
View file @
397bfd85
...
...
@@ -26,7 +26,6 @@ import com.artifex.mupdfdemo.SearchTask
import
com.artifex.mupdfdemo.SearchTaskResult
import
com.base.pdfviewerscannerwhite.R
import
com.base.pdfviewerscannerwhite.ads.AdmobHelper
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobBannerUtils
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobInterstitialUtils
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobNativeUtils
import
com.base.pdfviewerscannerwhite.bean.ConstObject.DO_SAVE_PDF
...
...
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