Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
Super Cleaner Max
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
Super Cleaner Max
Commits
749f7c96
Commit
749f7c96
authored
Jun 08, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
=====节假日加班======
parent
454c6ffe
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
279 additions
and
76 deletions
+279
-76
build.gradle
app/build.gradle
+1
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+12
-26
CleanJunkActivity.kt
...m/test/basd/supercleanermax/activity/CleanJunkActivity.kt
+3
-3
SettingActivity.kt
...com/test/basd/supercleanermax/activity/SettingActivity.kt
+53
-0
NewSplashActivity.kt
...basd/supercleanermax/activity/splash/NewSplashActivity.kt
+2
-14
SplashJumpUtils.kt
...t/basd/supercleanermax/activity/splash/SplashJumpUtils.kt
+1
-0
ActionBroadcast.kt
.../com/test/basd/supercleanermax/display/ActionBroadcast.kt
+0
-6
NotificationHelper.kt
...m/test/basd/supercleanermax/display/NotificationHelper.kt
+6
-0
FcmHelper.kt
...va/com/test/basd/supercleanermax/display/fcm/FcmHelper.kt
+14
-4
MyFirebaseMessagingService.kt
...supercleanermax/display/fcm/MyFirebaseMessagingService.kt
+2
-13
NotificationJobService.kt
...asd/supercleanermax/display/fcm/NotificationJobService.kt
+15
-0
HomeFragment.kt
...va/com/test/basd/supercleanermax/fragment/HomeFragment.kt
+4
-1
ConfigHelper.kt
.../java/com/test/basd/supercleanermax/helps/ConfigHelper.kt
+16
-1
color_switch_track_selector.xml
app/src/main/res/color/color_switch_track_selector.xml
+5
-0
bg_switch_thumb_ffffff.xml
app/src/main/res/drawable/bg_switch_thumb_ffffff.xml
+14
-0
bg_switch_track.xml
app/src/main/res/drawable/bg_switch_track.xml
+10
-0
activity_setting.xml
app/src/main/res/layout/activity_setting.xml
+98
-0
fragment_layout_home.xml
app/src/main/res/layout/fragment_layout_home.xml
+23
-8
setting_home.png
app/src/main/res/mipmap-xxhdpi/setting_home.png
+0
-0
No files found.
app/build.gradle
View file @
749f7c96
...
...
@@ -73,6 +73,7 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.6.1'
implementation
'com.google.android.material:material:1.12.0'
implementation
'androidx.constraintlayout:constraintlayout:2.1.4'
implementation
'androidx.activity:activity:1.8.0'
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.5'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.5.1'
...
...
app/src/main/AndroidManifest.xml
View file @
749f7c96
...
...
@@ -12,20 +12,16 @@
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore=
"ScopedStorage"
/>
<!-- fcm 添加以下权限 -->
tools:ignore=
"ScopedStorage"
/>
<!-- fcm 添加以下权限 -->
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"com.google.android.c2dm.permission.RECEIVE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.POST_NOTIFICATIONS"
/>
<uses-permission
android:name=
"android.permission.USE_FULL_SCREEN_INTENT"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<application
...
...
@@ -40,6 +36,12 @@
android:theme=
"@style/Theme.SmartCleaner"
android:usesCleartextTraffic=
"true"
tools:targetApi=
"31"
>
<activity
android:name=
".activity.SettingActivity"
android:exported=
"false"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".activity.splash.NewSplashActivity"
android:exported=
"true"
...
...
@@ -49,9 +51,9 @@
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".activity.GuestActivity"
...
...
@@ -65,7 +67,6 @@
android:name=
".activity.PrepareScanActivity"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".activity.RecentAppActivity"
android:exported=
"true"
...
...
@@ -90,13 +91,7 @@
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".activity.MainActivity"
android:exported=
"true"
>
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
</activity>
android:exported=
"true"
></activity>
<activity
android:name=
".activity.ScanJunkActivity"
android:screenOrientation=
"portrait"
...
...
@@ -109,7 +104,6 @@
android:name=
".activity.CleaningActivity"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".activity.PermissionTripActivity"
android:screenOrientation=
"portrait"
...
...
@@ -150,7 +144,6 @@
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<meta-data
android:name=
"com.google.android.gms.ads.flag.OPTIMIZE_INITIALIZATION"
android:value=
"true"
/>
...
...
@@ -159,10 +152,7 @@
android:value=
"true"
/>
<meta-data
android:name=
"com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED"
android:value=
"false"
/>
<!-- 添加以下服务 -->
android:value=
"false"
/>
<!-- 添加以下服务 -->
<service
android:name=
".display.fcm.MyFirebaseMessagingService"
android:exported=
"true"
...
...
@@ -170,9 +160,7 @@
<intent-filter>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
/>
</intent-filter>
</service>
<!-- 添加以下接收器 -->
</service>
<!-- 添加以下接收器 -->
<!-- 注册广播 -->
<receiver
android:name=
".display.fcm.MyFirebaseMessagingReceiver"
...
...
@@ -192,7 +180,6 @@
<service
android:name=
".display.fcm.NotificationJobService"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
android:name=
".notificationclean.AppNotificationListenerService"
android:exported=
"true"
...
...
@@ -205,8 +192,7 @@
<service
android:name=
".service.FlashlightService"
android:exported=
"true"
tools:ignore=
"ExportedService"
/>
<!--照片压缩-->
tools:ignore=
"ExportedService"
/>
<!-- 照片压缩 -->
<activity
android:name=
".activity.photocompress.photo.StartCompressionPhotoActivity"
android:screenOrientation=
"portrait"
...
...
app/src/main/java/com/test/basd/supercleanermax/activity/CleanJunkActivity.kt
View file @
749f7c96
...
...
@@ -107,7 +107,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val
a
=
it
.
filter
{
it
.
isApk
()
}
val
halfSize
=
if
(
a
.
size
%
2
==
1
)
a
.
size
/
2
+
1
else
a
.
size
/
2
val
firstHalf
=
a
.
subList
(
0
,
halfSize
)
firstHalf
.
forEach
{
l
->
a
.
forEach
{
l
->
sizes
[
0
]
+=
l
.
size
val
bean
=
ChildBean
(
R
.
mipmap
.
hapk
,
l
.
name
,
l
.
path
,
l
.
size
)
child3
.
add
(
bean
)
...
...
@@ -117,7 +117,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val
b
=
it
.
filter
{
it
.
isJunk
()
}
val
bHalfSize
=
if
(
b
.
size
%
2
==
1
)
b
.
size
/
2
+
1
else
b
.
size
/
2
val
bFirstHalf
=
b
.
subList
(
0
,
bHalfSize
)
b
FirstHalf
.
forEach
{
l
->
b
.
forEach
{
l
->
sizes
[
1
]
+=
l
.
size
val
bean
=
ChildBean
(
null
,
l
.
name
,
l
.
path
,
l
.
size
)
child4
.
add
(
bean
)
...
...
@@ -127,7 +127,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val
c
=
it
.
filter
{
it
.
isOtherTrash
()
}
val
cHalfSize
=
if
(
c
.
size
%
2
==
1
)
c
.
size
/
2
+
1
else
c
.
size
/
2
val
cFirstHalf
=
c
.
subList
(
0
,
cHalfSize
)
c
FirstHalf
.
forEach
{
l
->
c
.
forEach
{
l
->
sizes
[
2
]
+=
l
.
size
val
bean
=
ChildBean
(
null
,
l
.
name
,
l
.
path
,
l
.
size
)
child5
.
add
(
bean
)
...
...
app/src/main/java/com/test/basd/supercleanermax/activity/SettingActivity.kt
0 → 100644
View file @
749f7c96
package
com.test.basd.supercleanermax.activity
import
android.content.Intent
import
com.test.basd.supercleanermax.databinding.ActivitySettingBinding
import
com.test.basd.supercleanermax.display.NotificationService
import
com.test.basd.supercleanermax.display.fcm.FcmHelper
import
com.test.basd.supercleanermax.display.fcm.NotificationJobService.Companion.initJob
import
com.test.basd.supercleanermax.helps.BaseActivity
import
com.test.basd.supercleanermax.helps.ConfigHelper.allNotification
import
com.test.basd.supercleanermax.helps.ConfigHelper.remainNotification
import
com.test.basd.supercleanermax.helps.ads.AdmobUtils
class
SettingActivity
:
BaseActivity
<
ActivitySettingBinding
>()
{
override
val
binding
:
ActivitySettingBinding
by
lazy
{
ActivitySettingBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
binding
.
switchRemainNotification
.
isChecked
=
remainNotification
binding
.
switchAllNotification
.
isChecked
=
allNotification
}
override
fun
initListener
()
{
binding
.
ivBack
.
setOnClickListener
{
AdmobUtils
.
showInterstitialAd
(
this
)
{
finishToMain
()
}
}
binding
.
switchRemainNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
remainNotification
=
isChecked
if
(
isChecked
)
{
initJob
()
}
else
{
val
serviceIntent
=
Intent
(
this
,
NotificationService
::
class
.
java
)
stopService
(
serviceIntent
)
}
}
binding
.
switchAllNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
allNotification
=
isChecked
switchFcm
(
isChecked
)
}
}
private
fun
switchFcm
(
checked
:
Boolean
)
{
if
(
checked
)
{
FcmHelper
.
subscribeToTopic
()
}
else
{
FcmHelper
.
unSubscribeToTopic
()
}
}
}
\ No newline at end of file
app/src/main/java/com/test/basd/supercleanermax/activity/splash/NewSplashActivity.kt
View file @
749f7c96
...
...
@@ -2,10 +2,6 @@ package com.test.basd.supercleanermax.activity.splash
import
android.Manifest
import
android.annotation.SuppressLint
import
android.app.job.JobInfo
import
android.app.job.JobScheduler
import
android.content.ComponentName
import
android.content.Context
import
android.content.Intent
import
android.graphics.Color
import
android.os.Build
...
...
@@ -18,7 +14,7 @@ import com.blankj.utilcode.util.BarUtils
import
com.test.basd.supercleanermax.databinding.ActivityLayoutSplashBinding
import
com.test.basd.supercleanermax.display.CloseNotificationReceiver
import
com.test.basd.supercleanermax.display.NotificationHelper
import
com.test.basd.supercleanermax.display.fcm.NotificationJobService
import
com.test.basd.supercleanermax.display.fcm.NotificationJobService
.Companion.initJob
import
com.test.basd.supercleanermax.helps.BaseActivity
import
com.test.basd.supercleanermax.helps.ConfigHelper
import
com.test.basd.supercleanermax.helps.LogEx
...
...
@@ -74,15 +70,7 @@ class NewSplashActivity : BaseActivity<ActivityLayoutSplashBinding>(),
mProgressManager
?.
startProgress
()
loadAd
()
}
private
fun
initJob
()
{
val
jobScheduler
=
getSystemService
(
Context
.
JOB_SCHEDULER_SERVICE
)
as
JobScheduler
val
job
=
JobInfo
.
Builder
(
0
,
ComponentName
(
this
,
NotificationJobService
::
class
.
java
))
.
setMinimumLatency
(
0L
)
.
setOverrideDeadline
(
0L
)
.
setPersisted
(
true
)
.
build
()
jobScheduler
.
schedule
(
job
)
}
override
fun
onProgressMax
()
{
Handler
().
postDelayed
({
...
...
app/src/main/java/com/test/basd/supercleanermax/activity/splash/SplashJumpUtils.kt
View file @
749f7c96
...
...
@@ -98,6 +98,7 @@ object SplashJumpUtils {
val
isHotLaunch
=
context
.
intent
?.
extras
?.
getBoolean
(
"isHotLaunch"
,
false
)
?:
false
if
(!
isHotLaunch
)
{
if
(!
ConfigHelper
.
ifGuest
)
{
ConfigHelper
.
ifGuest
=
true
context
.
startActivity
(
Intent
(
context
,
CleanGuestActivity
::
class
.
java
))
}
else
{
context
.
startActivity
(
Intent
(
context
,
MainActivity
::
class
.
java
))
...
...
app/src/main/java/com/test/basd/supercleanermax/display/ActionBroadcast.kt
View file @
749f7c96
...
...
@@ -6,12 +6,6 @@ import android.content.Intent
import
android.content.IntentFilter
import
android.os.Build
import
android.util.Log
import
com.blankj.utilcode.util.SPUtils
import
com.test.basd.supercleanermax.bean.ConfigBean.Companion.ID_LOW_BATTERY_PUSH
import
com.test.basd.supercleanermax.display.NotificationHelper.postActionNotification
import
com.test.basd.supercleanermax.helps.BaseApplication
import
kotlin.time.Duration.Companion.minutes
import
kotlin.time.DurationUnit
class
ActionBroadcast
:
BroadcastReceiver
()
{
...
...
app/src/main/java/com/test/basd/supercleanermax/display/NotificationHelper.kt
View file @
749f7c96
...
...
@@ -31,6 +31,7 @@ import com.test.basd.supercleanermax.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import
com.test.basd.supercleanermax.bean.ConfigBean.Companion.ID_UNINSTALL_PACKAGE_PUSH
import
com.test.basd.supercleanermax.helps.BaseApplication
import
com.test.basd.supercleanermax.helps.ComUtils
import
com.test.basd.supercleanermax.helps.ConfigHelper
import
com.test.basd.supercleanermax.helps.EventHelper
import
kotlin.random.Random
...
...
@@ -119,6 +120,11 @@ object NotificationHelper {
*/
@SuppressLint
(
"RemoteViewLayout"
)
fun
Context
.
postActionNotification
(
actionId
:
Int
,
extra
:
Int
?
=
null
,
pushStayTime
:
Long
?
=
null
)
{
if
(!
ConfigHelper
.
allNotification
)
{
return
}
val
remoteViews
=
RemoteViews
(
packageName
,
R
.
layout
.
notification_common_notify
)
when
(
actionId
)
{
ID_JUNK_CLEAN_PUSH
->
{
...
...
app/src/main/java/com/test/basd/supercleanermax/display/fcm/FcmHelper.kt
View file @
749f7c96
...
...
@@ -7,7 +7,6 @@ import com.google.android.gms.tasks.Task
import
com.google.firebase.messaging.FirebaseMessaging
import
com.test.basd.supercleanermax.helps.EventHelper
object
FcmHelper
{
private
const
val
TAG
=
"FcmHelper"
...
...
@@ -16,7 +15,7 @@ object FcmHelper {
FirebaseMessaging
.
getInstance
().
subscribeToTopic
(
"news"
)
.
addOnCompleteListener
{
task
:
Task
<
Void
?
>
->
if
(
task
.
isSuccessful
)
{
EventHelper
.
event
(
"fcm_subscribed_suc"
,
"news"
)
EventHelper
.
event
(
"fcm_subscribed_suc"
,
"news"
)
// Log.d(TAG, "Subscribed to topic: TOPIC_NAME")
}
else
{
EventHelper
.
event
(
"fcm_subscribed_fail"
)
...
...
@@ -27,7 +26,8 @@ object FcmHelper {
}
fun
getToken
(){
fun
getToken
()
{
FirebaseMessaging
.
getInstance
().
token
.
addOnCompleteListener
(
OnCompleteListener
{
task
->
if
(!
task
.
isSuccessful
)
{
...
...
@@ -37,9 +37,19 @@ object FcmHelper {
}
// Get new FCM registration token
val
token
=
task
.
result
EventHelper
.
event
(
"fcm_token_suc"
,
token
)
EventHelper
.
event
(
"fcm_token_suc"
,
token
)
Log
.
d
(
TAG
,
"token: $token"
)
})
}
fun
unSubscribeToTopic
()
{
FirebaseMessaging
.
getInstance
().
unsubscribeFromTopic
(
"news"
)
.
addOnCompleteListener
{
task
:
Task
<
Void
?
>
->
if
(
task
.
isSuccessful
)
{
}
else
{
}
}
}
}
\ No newline at end of file
app/src/main/java/com/test/basd/supercleanermax/display/fcm/MyFirebaseMessagingService.kt
View file @
749f7c96
package
com.test.basd.supercleanermax.display.fcm
import
android.app.job.JobInfo
import
android.app.job.JobScheduler
import
android.content.ComponentName
import
android.content.Context
import
android.os.Build
import
android.util.Log
import
com.google.firebase.messaging.FirebaseMessagingService
import
com.google.firebase.messaging.RemoteMessage
import
com.test.basd.supercleanermax.display.NotificationUtils
import
com.test.basd.supercleanermax.display.fcm.NotificationJobService.Companion.initJob
import
com.test.basd.supercleanermax.helps.EventHelper
...
...
@@ -28,15 +25,7 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
initJob
()
}
private
fun
initJob
()
{
val
jobScheduler
=
getSystemService
(
Context
.
JOB_SCHEDULER_SERVICE
)
as
JobScheduler
val
job
=
JobInfo
.
Builder
(
0
,
ComponentName
(
this
,
NotificationJobService
::
class
.
java
))
.
setMinimumLatency
(
0L
)
.
setOverrideDeadline
(
0L
)
.
setPersisted
(
true
)
.
build
()
jobScheduler
.
schedule
(
job
)
}
override
fun
onNewToken
(
token
:
String
)
{
Log
.
d
(
TAG
,
"Refreshed token: $token"
)
...
...
app/src/main/java/com/test/basd/supercleanermax/display/fcm/NotificationJobService.kt
View file @
749f7c96
...
...
@@ -2,8 +2,12 @@ package com.test.basd.supercleanermax.display.fcm
import
android.annotation.SuppressLint
import
android.app.ActivityManager
import
android.app.job.JobInfo
import
android.app.job.JobParameters
import
android.app.job.JobScheduler
import
android.app.job.JobService
import
android.content.ComponentName
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
com.test.basd.supercleanermax.display.NotificationService
...
...
@@ -54,5 +58,16 @@ class NotificationJobService : JobService() {
companion
object
{
private
const
val
JOB_ID
=
123
fun
Context
.
initJob
()
{
val
jobScheduler
=
getSystemService
(
Context
.
JOB_SCHEDULER_SERVICE
)
as
JobScheduler
val
job
=
JobInfo
.
Builder
(
0
,
ComponentName
(
this
,
NotificationJobService
::
class
.
java
))
.
setMinimumLatency
(
0L
)
.
setOverrideDeadline
(
0L
)
.
setPersisted
(
true
)
.
build
()
jobScheduler
.
schedule
(
job
)
}
}
}
\ No newline at end of file
app/src/main/java/com/test/basd/supercleanermax/fragment/HomeFragment.kt
View file @
749f7c96
...
...
@@ -14,6 +14,7 @@ import com.test.basd.supercleanermax.activity.LargeFileCleanActivity
import
com.test.basd.supercleanermax.activity.NetWorkActivity
import
com.test.basd.supercleanermax.activity.RecentAppActivity
import
com.test.basd.supercleanermax.activity.ScanJunkActivity
import
com.test.basd.supercleanermax.activity.SettingActivity
import
com.test.basd.supercleanermax.activity.photocompress.photo.StartCompressionPhotoActivity
import
com.test.basd.supercleanermax.databinding.FragmentLayoutHomeBinding
import
com.test.basd.supercleanermax.helps.BaseFragment
...
...
@@ -64,7 +65,6 @@ class HomeFragment : BaseFragment<FragmentLayoutHomeBinding>() {
startActivity
(
Intent
(
requireActivity
(),
NotificationGuestActivity
::
class
.
java
))
}
binding
.
idRecentApp
.
setOnClickListener
{
startActivity
(
Intent
(
requireActivity
(),
RecentAppActivity
::
class
.
java
))
}
...
...
@@ -72,6 +72,9 @@ class HomeFragment : BaseFragment<FragmentLayoutHomeBinding>() {
startActivity
(
Intent
(
requireActivity
(),
NetWorkActivity
::
class
.
java
))
}
binding
.
ivSetting
.
setOnClickListener
{
startActivity
(
Intent
(
requireActivity
(),
SettingActivity
::
class
.
java
))
}
MainScope
().
launch
(
Dispatchers
.
IO
)
{
NetWorkSpeed
.
startMoritor
()
...
...
app/src/main/java/com/test/basd/supercleanermax/helps/ConfigHelper.kt
View file @
749f7c96
...
...
@@ -39,7 +39,6 @@ object ConfigHelper {
}
var
ifAgreePrivacy
=
false
get
()
{
return
SPUtils
.
getInstance
().
getBoolean
(
"ifAgreePrivacy"
,
field
)
...
...
@@ -57,5 +56,21 @@ object ConfigHelper {
SPUtils
.
getInstance
().
put
(
"ifGuest"
,
value
,
true
)
}
var
remainNotification
=
true
get
()
{
return
SPUtils
.
getInstance
().
getBoolean
(
"remainNotification"
,
field
)
}
set
(
value
)
{
field
=
value
SPUtils
.
getInstance
().
put
(
"remainNotification"
,
value
,
true
)
}
var
allNotification
=
true
get
()
{
return
SPUtils
.
getInstance
().
getBoolean
(
"fcmNotification"
,
field
)
}
set
(
value
)
{
field
=
value
SPUtils
.
getInstance
().
put
(
"fcmNotification"
,
value
,
true
)
}
}
\ No newline at end of file
app/src/main/res/color/color_switch_track_selector.xml
0 → 100644
View file @
749f7c96
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"#2372FC"
android:state_checked=
"true"
/>
<item
android:color=
"#D1D1D1"
android:state_checked=
"false"
/>
</selector>
\ No newline at end of file
app/src/main/res/drawable/bg_switch_thumb_ffffff.xml
0 → 100644
View file @
749f7c96
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<!-- <solid android:color="#EDFF7A" />-->
<size
android:width=
"25dp"
android:height=
"25dp"
/>
<!-- 边缘全透明 -->
<stroke
android:width=
"2dp"
android:color=
"#00000000"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_switch_track.xml
0 → 100644
View file @
749f7c96
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape
android:shape=
"rectangle"
>
<!-- <solid android:color="#2372FD" />-->
<size
android:height=
"25dp"
/>
<corners
android:radius=
"30dp"
/>
</shape>
</item>
</layer-list>
\ No newline at end of file
app/src/main/res/layout/activity_setting.xml
0 → 100644
View file @
749f7c96
<?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:id=
"@+id/main"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".activity.SettingActivity"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"30dp"
tools:ignore=
"UselessParent"
>
<ImageView
android:id=
"@+id/iv_back"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_marginStart=
"16dp"
android:src=
"@mipmap/fanhui"
android:tint=
"@color/black"
tools:ignore=
"ContentDescription,UseAppTint"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"Notification settings"
android:textColor=
"@color/black"
android:textSize=
"19sp"
android:textStyle=
"bold"
tools:ignore=
"HardcodedText"
/>
</FrameLayout>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"20dp"
app:cardBackgroundColor=
"@color/white"
app:cardCornerRadius=
"15dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"12dp"
android:text=
"Notification toolbar"
android:textColor=
"@color/black"
android:textSize=
"16sp"
tools:ignore=
"HardcodedText"
/>
<androidx.appcompat.widget.SwitchCompat
android:id=
"@+id/switch_remain_notification"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical|end"
android:layout_marginEnd=
"15dp"
android:layout_marginBottom=
"5dp"
android:thumb=
"@drawable/bg_switch_thumb_ffffff"
app:thumbTint=
"@color/white"
app:track=
"@drawable/bg_switch_track"
app:trackTint=
"@color/color_switch_track_selector"
/>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"20dp"
app:cardBackgroundColor=
"@color/white"
app:cardCornerRadius=
"15dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"12dp"
android:text=
"All Notification Messages"
android:textColor=
"@color/black"
android:textSize=
"16sp"
tools:ignore=
"HardcodedText"
/>
<androidx.appcompat.widget.SwitchCompat
android:id=
"@+id/switch_all_notification"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical|end"
android:layout_marginEnd=
"15dp"
android:layout_marginBottom=
"5dp"
android:thumb=
"@drawable/bg_switch_thumb_ffffff"
app:thumbTint=
"@color/white"
app:track=
"@drawable/bg_switch_track"
app:trackTint=
"@color/color_switch_track_selector"
/>
</androidx.cardview.widget.CardView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_layout_home.xml
View file @
749f7c96
...
...
@@ -7,15 +7,30 @@
android:orientation=
"vertical"
>
<
TextView
android:layout_width=
"
wrap_cont
ent"
<
FrameLayout
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"32dp"
android:text=
"@string/app_name"
android:textColor=
"#222222"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
android:layout_marginTop=
"32dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"@string/app_name"
android:textColor=
"#222222"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_setting"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_gravity=
"center_vertical|end"
android:layout_marginEnd=
"16dp"
android:src=
"@mipmap/setting_home"
tools:ignore=
"ContentDescription"
/>
</FrameLayout>
<androidx.core.widget.NestedScrollView
android:id=
"@+id/id_scroll_view"
...
...
app/src/main/res/mipmap-xxhdpi/setting_home.png
0 → 100644
View file @
749f7c96
6.82 KB
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