Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
scanqrwhitecopy
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
scanqrwhitecopy
Commits
bde6295b
Commit
bde6295b
authored
Jan 20, 2025
by
周文华
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
b4fce14e
fe8ef929
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
1102 additions
and
1 deletion
+1102
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-1
NotificationSendBean.kt
...in/java/com/base/scanqrclear/bean/NotificationSendBean.kt
+7
-0
MyNotificationManager.kt
...ase/scanqrclear/fcm/notification/MyNotificationManager.kt
+14
-0
NotificationUiUtil.kt
...m/base/scanqrclear/fcm/notification/NotificationUiUtil.kt
+120
-0
WebBrowserActivity.kt
...ava/com/base/scanqrclear/ui/webview/WebBrowserActivity.kt
+173
-0
TimeUtils.kt
app/src/main/java/com/base/scanqrclear/utils/TimeUtils.kt
+59
-0
bg_0571ed_25.xml
app/src/main/res/drawable/bg_0571ed_25.xml
+5
-0
bg_ffffff_15.xml
app/src/main/res/drawable/bg_ffffff_15.xml
+5
-0
progress_bar_web.xml
app/src/main/res/drawable/progress_bar_web.xml
+18
-0
activity_web_browser.xml
app/src/main/res/layout/activity_web_browser.xml
+43
-0
notification_common_large.xml
app/src/main/res/layout/notification_common_large.xml
+76
-0
notification_common_small.xml
app/src/main/res/layout/notification_common_small.xml
+59
-0
notification_constellation_big.xml
app/src/main/res/layout/notification_constellation_big.xml
+69
-0
notification_constellation_small.xml
app/src/main/res/layout/notification_constellation_small.xml
+42
-0
notification_weather_big.xml
app/src/main/res/layout/notification_weather_big.xml
+308
-0
notification_weather_small.xml
app/src/main/res/layout/notification_weather_small.xml
+96
-0
d_xingzuo.png
app/src/main/res/mipmap-xxhdpi/d_xingzuo.png
+0
-0
icon_smart.png
app/src/main/res/mipmap-xxhdpi/icon_smart.png
+0
-0
tishiicon.png
app/src/main/res/mipmap-xxhdpi/tishiicon.png
+0
-0
x_tianqibg.png
app/src/main/res/mipmap-xxhdpi/x_tianqibg.png
+0
-0
x_xingzuo.png
app/src/main/res/mipmap-xxhdpi/x_xingzuo.png
+0
-0
d_tiantibg.png
app/src/main/res/mipmap-xxxhdpi/d_tiantibg.png
+0
-0
strings.xml
app/src/main/res/values/strings.xml
+5
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
bde6295b
...
...
@@ -35,7 +35,9 @@
android:supportsRtl=
"true"
android:theme=
"@style/Theme.ScanQR"
tools:targetApi=
"31"
>
<activity
android:name=
".ui.webview.WebBrowserActivity"
android:exported=
"false"
/>
<activity
android:name=
".ui.start.StartActivity"
android:exported=
"true"
...
...
app/src/main/java/com/base/scanqrclear/bean/NotificationSendBean.kt
View file @
bde6295b
...
...
@@ -36,5 +36,12 @@ class NotificationSendBean(
const
val
ACTION_ID_TEXT
=
"action_id_text"
const
val
ACTION_ID_EMAIL
=
"action_id_email"
const
val
ACTION_ID_WEBSITE
=
"action_id_website"
const
val
ACTION_ID_CLEAN_JUNK
=
"action_id_clean_junk"
const
val
ACTION_ID_WEATHER
=
"action_id_weather"
const
val
ACTION_ID_APP_PROCESS
=
"action_id_app_process"
const
val
ACTION_ID_WHATSAPP
=
"action_id_whatsapp"
const
val
ACTION_ID_SCREEN_SHORT
=
"action_id_screen_short"
const
val
ACTION_ID_SIMILAR
=
"action_id_similar"
const
val
ACTION_ID_CONSTELLATION
=
"action_id_constellation"
}
}
\ No newline at end of file
app/src/main/java/com/base/scanqrclear/fcm/notification/MyNotificationManager.kt
View file @
bde6295b
...
...
@@ -4,10 +4,17 @@ import android.content.Context
import
com.base.scanqrclear.BuildConfig
import
com.base.scanqrclear.MyApplication
import
com.base.scanqrclear.bean.NotificationSendBean
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_APP_PROCESS
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_CLEAN_JUNK
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_CONSTELLATION
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_EMAIL
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_SCAN
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_SCREEN_SHORT
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_SIMILAR
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_TEXT
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WEATHER
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WEBSITE
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WHATSAPP
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WIFI
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.POPUP_WHERE_ALARM
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.POPUP_WHERE_BATTERY
...
...
@@ -47,6 +54,13 @@ object MyNotificationManager {
ACTION_ID_TEXT
,
ACTION_ID_EMAIL
,
ACTION_ID_WEBSITE
,
ACTION_ID_CLEAN_JUNK
,
ACTION_ID_WEATHER
,
ACTION_ID_APP_PROCESS
,
ACTION_ID_WHATSAPP
,
ACTION_ID_SCREEN_SHORT
,
ACTION_ID_SIMILAR
,
ACTION_ID_CONSTELLATION
,
)
private
var
actionIdList
=
arrayListOf
<
String
>()
...
...
app/src/main/java/com/base/scanqrclear/fcm/notification/NotificationUiUtil.kt
View file @
bde6295b
...
...
@@ -13,12 +13,23 @@ import androidx.core.graphics.drawable.IconCompat
import
com.base.scanqrclear.MyApplication
import
com.base.scanqrclear.R
import
com.base.scanqrclear.bean.NotificationSendBean
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_APP_PROCESS
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_CLEAN_JUNK
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_CONSTELLATION
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_EMAIL
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_SCAN
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_SCREEN_SHORT
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_SIMILAR
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_TEXT
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WEATHER
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WEBSITE
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WHATSAPP
import
com.base.scanqrclear.bean.NotificationSendBean.Companion.ACTION_ID_WIFI
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.luma.WeatherUtils
import
com.base.scanqrclear.ui.start.StartActivity
import
com.base.scanqrclear.utils.TimeUtils.formatATime
import
com.base.scanqrclear.utils.TimeUtils.isDayOrNight
import
kotlin.random.Random
/**
...
...
@@ -104,6 +115,113 @@ object NotificationUiUtil {
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_CLEAN_JUNK
->
{
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
clean_junk_pop
))
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_large
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
clean_junk_pop
))
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_image
,
R
.
mipmap
.
icon_junk_scan1
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_APP_PROCESS
->
{
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
app_process_pop
))
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_large
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
app_process_pop
))
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_image
,
R
.
mipmap
.
icon_app_process_1
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_WHATSAPP
->
{
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
whatsapp_pop
))
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_large
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
whatsapp_pop
))
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_image
,
R
.
mipmap
.
icon_whatsapp_1
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_SCREEN_SHORT
->
{
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
screen_pop
))
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_large
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
screen_pop
))
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_image
,
R
.
mipmap
.
icon_screenshot_1
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_SIMILAR
->
{
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
similar_pop
))
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_common_large
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_content
,
MyApplication
.
appContext
.
getString
(
R
.
string
.
similar_pop
))
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_image
,
R
.
mipmap
.
icon_similar
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_CONSTELLATION
->
{
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_constellation_small
)
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_constellation_big
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
ACTION_ID_WEATHER
->
{
val
weatherBean
:
WeatherBean
=
WeatherUtils
.
getWeatherEntity
()
?:
return
if
(
weatherBean
.
list
.
isEmpty
())
return
val
subBean
=
weatherBean
.
list
[
0
]
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_weather_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_city
,
weatherBean
.
city
)
val
min
=
subBean
.
tempMin
.
toInt
()
val
max
=
subBean
.
tempMax
.
toInt
()
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
val
icon
=
when
(
WeatherUtils
.
getWeatherType
(
subBean
.
iconDay
.
toInt
()))
{
"Sunny day"
->
R
.
mipmap
.
d_qing
"Cloudy day"
->
R
.
mipmap
.
d_yin
"Rainy day"
->
R
.
mipmap
.
d_dayu
"Snowy day"
->
R
.
mipmap
.
d_xiaxue
"Greasy day"
->
R
.
mipmap
.
d_wumaishachengbao
"Unknown"
->
R
.
mipmap
.
d_qing
else
->
R
.
mipmap
.
d_qing
}
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_range
,
"$min℃/$max℃"
)
val
bigRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_weather_big
)
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather_11h
,
icon
)
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather_14h
,
icon
)
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather_17h
,
icon
)
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather_20h
,
icon
)
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather_23h
,
icon
)
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_weather
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_11h
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_14h
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_17h
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_20h
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_23h
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_day_desc
,
if
(
isDayOrNight
())
subBean
.
textDay
else
subBean
.
textNight
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_weather_info
,
"$min℃/$max℃ ${formatATime()}"
)
}
}
val
intent
=
Intent
(
sendBean
.
context
,
StartActivity
::
class
.
java
)
...
...
@@ -171,4 +289,6 @@ object NotificationUiUtil {
notificationManager
.
notify
(
sendBean
.
notificationId
,
builder
.
build
())
}
}
\ No newline at end of file
app/src/main/java/com/base/scanqrclear/ui/webview/WebBrowserActivity.kt
0 → 100644
View file @
bde6295b
package
com.base.scanqrclear.ui.webview
import
android.content.Intent
import
android.graphics.Bitmap
import
android.net.Uri
import
android.net.http.SslError
import
android.view.View
import
android.webkit.CookieManager
import
android.webkit.JsResult
import
android.webkit.SslErrorHandler
import
android.webkit.ValueCallback
import
android.webkit.WebChromeClient
import
android.webkit.WebResourceError
import
android.webkit.WebResourceRequest
import
android.webkit.WebSettings
import
android.webkit.WebStorage
import
android.webkit.WebView
import
android.webkit.WebViewClient
import
androidx.lifecycle.lifecycleScope
import
com.base.scanqrclear.base.BaseActivity
import
com.base.scanqrclear.databinding.ActivityWebBrowserBinding
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
kotlin.random.Random
class
WebBrowserActivity
:
BaseActivity
<
ActivityWebBrowserBinding
>(
ActivityWebBrowserBinding
::
inflate
)
{
override
fun
initView
()
{
super
.
initView
()
initWebSettings
()
binding
.
webView
.
loadUrl
(
"https://www.horoscope.com/us/index.aspx"
)
}
override
fun
initListener
()
{
super
.
initListener
()
binding
.
refreshLayout
.
setOnRefreshListener
{
lifecycleScope
.
launch
{
binding
.
refreshLayout
.
isRefreshing
=
true
delay
(
Random
.
nextLong
(
1500
,
2500
))
binding
.
refreshLayout
.
isRefreshing
=
false
}
binding
.
webView
.
reload
()
}
}
private
fun
initWebSettings
()
{
val
webSettings
=
binding
.
webView
.
settings
webSettings
.
allowFileAccess
=
true
// 设置允许访问文件数据
webSettings
.
setSupportZoom
(
false
)
webSettings
.
builtInZoomControls
=
true
webSettings
.
cacheMode
=
WebSettings
.
LOAD_NO_CACHE
webSettings
.
domStorageEnabled
=
true
webSettings
.
databaseEnabled
=
true
@Suppress
(
"DEPRECATION"
)
webSettings
.
allowFileAccessFromFileURLs
=
true
WebStorage
.
getInstance
().
deleteAllData
()
// 关键性代码,这里要给webView添加这行代码,才可以点击之后正常播放音频。记录一下。
webSettings
.
mediaPlaybackRequiresUserGesture
=
false
//设置WebView属性,能够执行Javascript脚本
webSettings
.
javaScriptEnabled
=
true
//设置混合内容模式:对于HTTPS和HTTP混合内容的加载,需要设置WebView以允许混合内容:
webSettings
.
mixedContentMode
=
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
//使用CookieManager设置允许跨域Cookie
CookieManager
.
getInstance
().
setAcceptThirdPartyCookies
(
binding
.
webView
,
true
)
//适应屏幕设置
webSettings
.
useWideViewPort
=
true
webSettings
.
loadWithOverviewMode
=
true
//网页使用localStorage等Web存储API,需要启用DOM存储
webSettings
.
domStorageEnabled
=
true
webSettings
.
setUseWideViewPort
(
false
)
webSettings
.
setLoadsImagesAutomatically
(
true
)
// 确保自动加载图片
//设置WebChromeClient
binding
.
webView
.
webChromeClient
=
object
:
WebChromeClient
()
{
override
fun
onProgressChanged
(
view
:
WebView
,
newProgress
:
Int
)
{
binding
.
progressBar
.
progress
=
newProgress
if
(
binding
.
progressBar
.
progress
>=
100
)
{
binding
.
progressBar
.
visibility
=
View
.
GONE
}
}
override
fun
onReceivedTitle
(
view
:
WebView
?,
title
:
String
?)
{
super
.
onReceivedTitle
(
view
,
title
)
}
override
fun
onShowFileChooser
(
webView
:
WebView
?,
filePathCallback
:
ValueCallback
<
Array
<
Uri
?
>?>,
fileChooserParams
:
FileChooserParams
?
):
Boolean
{
return
true
}
override
fun
onJsAlert
(
view
:
WebView
?,
url
:
String
?,
message
:
String
?,
result
:
JsResult
?
):
Boolean
=
true
}
binding
.
webView
.
webViewClient
=
object
:
WebViewClient
()
{
override
fun
onLoadResource
(
view
:
WebView
?,
url
:
String
?)
{
super
.
onLoadResource
(
view
,
url
)
}
override
fun
shouldOverrideUrlLoading
(
view
:
WebView
?,
request
:
WebResourceRequest
?
):
Boolean
{
if
(
request
!=
null
)
{
val
uri
=
request
.
url
val
scheme
=
uri
.
scheme
// 检查 URL 是否是 scheme 类型
if
(
scheme
!=
null
&&
(
scheme
==
"http"
||
scheme
==
"https"
))
{
}
else
{
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
uri
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
if
(
packageManager
!=
null
&&
intent
.
resolveActivity
(
packageManager
)
!=
null
)
{
startActivity
(
intent
)
}
return
true
// 返回 true,表示 URL 已经被处理
}
return
super
.
shouldOverrideUrlLoading
(
view
,
request
)
}
return
false
}
override
fun
onPageStarted
(
view
:
WebView
?,
url
:
String
?,
favicon
:
Bitmap
?)
{
super
.
onPageStarted
(
view
,
url
,
favicon
)
}
override
fun
onPageFinished
(
view
:
WebView
?,
url
:
String
?)
{
}
override
fun
onReceivedSslError
(
view
:
WebView
?,
handler
:
SslErrorHandler
?,
error
:
SslError
?
)
{
}
override
fun
onReceivedError
(
view
:
WebView
?,
request
:
WebResourceRequest
?,
error
:
WebResourceError
?
)
{
super
.
onReceivedError
(
view
,
request
,
error
)
}
}
//设置Cookie
val
instance
=
CookieManager
.
getInstance
()
instance
.
setAcceptThirdPartyCookies
(
binding
.
webView
,
true
)
binding
.
webView
.
addJavascriptInterface
(
this
,
"android"
)
}
}
\ No newline at end of file
app/src/main/java/com/base/scanqrclear/utils/TimeUtils.kt
0 → 100644
View file @
bde6295b
package
com.base.scanqrclear.utils
import
android.annotation.SuppressLint
import
java.text.SimpleDateFormat
import
java.util.Calendar
object
TimeUtils
{
fun
isDayOrNight
():
Boolean
{
val
calendar
:
Calendar
=
Calendar
.
getInstance
()
val
hour
:
Int
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)
// 假设早上6点到晚上6点是白天
return
if
(
hour
in
6
..
17
)
{
// "现在是白天。"
true
}
else
{
// "现在是晚上。"
false
}
}
@SuppressLint
(
"SimpleDateFormat"
)
fun
formatATime
():
String
{
val
calendar
=
Calendar
.
getInstance
()
// 格式化时间为 "AM 9:50" 格式
val
sdf
=
SimpleDateFormat
(
"a hh:mm"
)
return
sdf
.
format
(
calendar
.
time
)
}
fun
isTimeBetweenEightAndTenPM
():
Boolean
{
val
now
=
Calendar
.
getInstance
()
val
hour
=
now
[
Calendar
.
HOUR_OF_DAY
]
// 获取当前小时数(24小时制)
// 检查当前时间是否在 8 点到 22 点之间
return
hour
in
8
..
21
}
fun
isTimeBetweenWan17toWan23
():
Boolean
{
val
calendar
=
Calendar
.
getInstance
()
val
currentHour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)
// 获取当前小时数(24小时制)
val
isEvening
=
currentHour
in
17
..
22
// Kotlin中的in运算符用于判断范围
return
if
(
isEvening
)
{
// 当前时间是晚上17点到23点之间
true
}
else
{
// 当前时间不是晚上17点到23点之间
false
}
}
@SuppressLint
(
"SimpleDateFormat"
)
fun
Long
.
formatTimeH
():
String
{
val
dateFormat
=
SimpleDateFormat
(
"yyyy-M-d H"
)
return
dateFormat
.
format
(
this
)
}
}
\ No newline at end of file
app/src/main/res/drawable/bg_0571ed_25.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#0571ED"
/>
<corners
android:radius=
"25dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_ffffff_15.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"15dp"
/>
<solid
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/progress_bar_web.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!-- 设置背景色 -->
<item
android:id=
"@android:id/background"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@android:color/transparent"
/>
</shape>
</item>
<!-- 设置进度条颜色 -->
<item
android:id=
"@android:id/progress"
>
<clip>
<shape>
<solid
android:color=
"#0571ED"
/>
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
app/src/main/res/layout/activity_web_browser.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<ProgressBar
android:id=
"@+id/progress_bar"
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"3dp"
android:layout_marginVertical=
"3dp"
android:max=
"100"
android:progressDrawable=
"@drawable/progress_bar_web"
tools:progress=
"50"
/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id=
"@+id/refresh_layout"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<WebView
android:id=
"@+id/webView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<FrameLayout
android:id=
"@+id/flBanner"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
/>
</LinearLayout>
app/src/main/res/layout/notification_common_large.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"200dp"
android:background=
"@drawable/white_background"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_marginTop=
"24dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/icon_smart"
/>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:text=
"@string/notification_clean_junk"
android:textColor=
"@color/color_181b1f"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:gravity=
"center"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:paddingTop=
"8dp"
android:paddingBottom=
"8dp"
android:gravity=
"center"
android:background=
"@drawable/gradient"
android:text=
"@string/clean"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"33dp"
android:layout_alignParentStart=
"true"
android:src=
"@mipmap/img_guangbiao_tuisong"
/>
</RelativeLayout>
</LinearLayout>
<TextView
android:id=
"@+id/tv_mark"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textSize=
"16sp"
android:textColor=
"@color/colorPrimary"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/notification_common_small.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:gravity=
"center"
android:paddingTop=
"4dp"
android:paddingBottom=
"4dp"
android:paddingStart=
"8dp"
android:paddingEnd=
"12dp"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/ll_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:layout_marginEnd=
"10dp"
android:gravity=
"center_vertical"
android:text=
"@string/notification_clean_junk"
android:textColor=
"@color/color_181b1f"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_btn"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingTop=
"6dp"
android:paddingBottom=
"6dp"
android:paddingStart=
"14dp"
android:paddingEnd=
"14dp"
android:text=
"@string/clean"
android:textColor=
"@color/white"
android:textSize=
"12sp"
android:textStyle=
"bold"
android:background=
"@drawable/gradient"
/>
</LinearLayout>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"12dp"
android:layout_alignParentEnd=
"true"
android:src=
"@mipmap/img_guangbiao_tuisong"
/>
<TextView
android:id=
"@+id/tv_mark"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textSize=
"16sp"
android:textColor=
"@color/colorPrimary"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/notification_constellation_big.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"52dp"
android:layout_height=
"52dp"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"20dp"
android:src=
"@mipmap/d_xingzuo"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_tittle_1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Check out your luck today!"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:textStyle=
"bold"
tools:ignore=
"HardcodedText"
/>
<TextView
android:id=
"@+id/tv_tittle_2"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:textColor=
"#898989"
android:textSize=
"12sp"
android:visibility=
"gone"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id=
"@+id/tv_btn"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginHorizontal=
"25dp"
android:layout_marginVertical=
"16dp"
android:background=
"@drawable/bg_0571ed_25"
android:gravity=
"center"
android:text=
"Clean"
android:textColor=
"@color/white"
android:textSize=
"15sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/notification_constellation_small.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:background=
"@drawable/bg_ffffff_15"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"15dp"
android:src=
"@mipmap/x_xingzuo"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_desc"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginStart=
"7dp"
android:layout_marginEnd=
"40dp"
android:layout_weight=
"1"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:text=
"Check out your luck today!"
tools:ignore=
"HardcodedText"
/>
<TextView
android:id=
"@+id/tv_btn"
android:layout_width=
"69dp"
android:layout_height=
"34dp"
android:layout_gravity=
"center_vertical"
android:layout_marginEnd=
"13dp"
android:background=
"@drawable/bg_0571ed_18"
android:gravity=
"center"
android:text=
"View"
android:textColor=
"@color/white"
android:textSize=
"15sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/notification_weather_big.xml
0 → 100644
View file @
bde6295b
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/notification_weather_small.xml
0 → 100644
View file @
bde6295b
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:background=
"@drawable/bg_ffffff_15"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"5dp"
android:background=
"@mipmap/x_tianqibg"
tools:ignore=
"ContentDescription"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_wendu_now"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center"
android:layout_marginStart=
"20dp"
android:textColor=
"@color/white"
android:textSize=
"30sp"
tools:text=
"20"
/>
<TextView
android:textSize=
"14sp"
android:id=
"@+id/tv_c"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignTop=
"@id/tv_wendu_now"
android:layout_toEndOf=
"@id/tv_wendu_now"
android:text=
"℃"
android:textColor=
"@color/white"
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather"
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_alignTop=
"@id/tv_wendu_now"
android:layout_alignBottom=
"@id/tv_wendu_now"
android:layout_toEndOf=
"@id/tv_c"
android:src=
"@mipmap/d_qing"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:layout_marginEnd=
"22dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:src=
"@mipmap/tishiicon"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_city"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"4dp"
android:textColor=
"@color/white"
android:textSize=
"13sp"
tools:text=
"Cheney"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_wendu_range"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/white"
android:textSize=
"15sp"
tools:text=
"19℃/36℃"
/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/mipmap-xxhdpi/d_xingzuo.png
0 → 100644
View file @
bde6295b
52.1 KB
app/src/main/res/mipmap-xxhdpi/icon_smart.png
0 → 100644
View file @
bde6295b
22.7 KB
app/src/main/res/mipmap-xxhdpi/tishiicon.png
0 → 100644
View file @
bde6295b
2.09 KB
app/src/main/res/mipmap-xxhdpi/x_tianqibg.png
0 → 100644
View file @
bde6295b
154 KB
app/src/main/res/mipmap-xxhdpi/x_xingzuo.png
0 → 100644
View file @
bde6295b
21.3 KB
app/src/main/res/mipmap-xxxhdpi/d_tiantibg.png
0 → 100644
View file @
bde6295b
901 KB
app/src/main/res/values/strings.xml
View file @
bde6295b
...
...
@@ -281,6 +281,11 @@
<string
name=
"device_ready"
>
Device Ready
</string>
<string
name=
"loading_point"
>
loading...
</string>
<string
name=
"files"
>
Files
</string>
<string
name=
"clean_junk_pop"
>
Clean out junk files to free up space on your phone!
</string>
<string
name=
"app_process_pop"
>
app process management for smooth performance.
</string>
<string
name=
"whatsapp_pop"
>
Clear whatsapp file to free up space!
</string>
<string
name=
"screen_pop"
>
Clear screenshot clutter to free up space!
</string>
<string
name=
"similar_pop"
>
Clear similar file to free up space!
</string>
<string
name=
"zodiac"
>
Zodiac
</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