Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
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
swiftcleanerphonehelper
Commits
16d805b5
Commit
16d805b5
authored
Jan 06, 2025
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
正式包
parent
b4a2b13b
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
537 additions
and
270 deletions
+537
-270
build.gradle.kts
app/build.gradle.kts
+5
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+4
-0
CleanApplication.kt
...src/main/java/com/swiftcleaner/chovey/CleanApplication.kt
+2
-0
GlobalConfig.kt
app/src/main/java/com/swiftcleaner/chovey/GlobalConfig.kt
+22
-0
AppProcessActivity.java
...swiftcleaner/chovey/view/activity/AppProcessActivity.java
+48
-21
BatteryInfoActivity.java
...wiftcleaner/chovey/view/activity/BatteryInfoActivity.java
+41
-18
CleanJunkActivity.java
.../swiftcleaner/chovey/view/activity/CleanJunkActivity.java
+52
-19
EndCleanJunkActivity.java
...iftcleaner/chovey/view/activity/EndCleanJunkActivity.java
+46
-43
InfoActivity.java
...a/com/swiftcleaner/chovey/view/activity/InfoActivity.java
+76
-68
LargeFileActivity.java
.../swiftcleaner/chovey/view/activity/LargeFileActivity.java
+48
-21
ScreenShotActivity.java
...swiftcleaner/chovey/view/activity/ScreenShotActivity.java
+48
-20
SettingActivity.java
...om/swiftcleaner/chovey/view/activity/SettingActivity.java
+8
-1
SimilarPhotosActivity.kt
...wiftcleaner/chovey/view/activity/SimilarPhotosActivity.kt
+53
-18
StartActivity.java
.../com/swiftcleaner/chovey/view/activity/StartActivity.java
+24
-2
WhatsAppActivity.java
...m/swiftcleaner/chovey/view/activity/WhatsAppActivity.java
+47
-20
AppInfoAdapter.java
.../com/swiftcleaner/chovey/view/adapter/AppInfoAdapter.java
+1
-2
LargeFileAdapter.java
...om/swiftcleaner/chovey/view/adapter/LargeFileAdapter.java
+12
-12
activity_large_file.xml
app/src/main/res/layout/activity_large_file.xml
+0
-1
No files found.
app/build.gradle.kts
View file @
16d805b5
...
@@ -14,9 +14,8 @@ android {
...
@@ -14,9 +14,8 @@ android {
applicationId
=
"com.swiftcleaner.chovey"
applicationId
=
"com.swiftcleaner.chovey"
minSdk
=
28
minSdk
=
28
targetSdk
=
34
targetSdk
=
34
versionCode
=
9
versionCode
=
10
versionName
=
"1.0"
versionName
=
"1.0"
testInstrumentationRunner
=
"androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
=
"androidx.test.runner.AndroidJUnitRunner"
}
}
// 添加签名配置
// 添加签名配置
...
@@ -102,6 +101,8 @@ dependencies {
...
@@ -102,6 +101,8 @@ dependencies {
implementation
(
libs
.
applovin
.
vungle
)
implementation
(
libs
.
applovin
.
vungle
)
implementation
(
libs
.
androidx
.
work
.
runtime
.
ktx
)
implementation
(
libs
.
androidx
.
work
.
runtime
.
ktx
)
api
(
"com.geyifeng.immersionbar:immersionbar:3.2.2"
)
api
(
"com.geyifeng.immersionbar:immersionbar:3.2.2"
)
implementation
(
"io.reactivex.rxjava3:rxjava:3.1.5"
)
implementation
(
"io.reactivex.rxjava3:rxjava:3.1.5"
)
implementation
(
"io.reactivex.rxjava3:rxandroid:3.0.0"
)
implementation
(
"io.reactivex.rxjava3:rxandroid:3.0.0"
)
// debugApi ("com.squareup.leakcanary:leakcanary-android:2.12")//leakcanary
}
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
16d805b5
...
@@ -191,6 +191,10 @@
...
@@ -191,6 +191,10 @@
android:name=
"com.google.android.gms.ads.APPLICATION_ID"
android:name=
"com.google.android.gms.ads.APPLICATION_ID"
android:value=
"ca-app-pub-9723053978060994~5799767410"
/>
android:value=
"ca-app-pub-9723053978060994~5799767410"
/>
<!-- <meta-data-->
<!-- android:name="com.google.android.gms.ads.APPLICATION_ID"-->
<!-- android:value="ca-app-pub-3940256099942544~3347511713" />-->
<meta-data
<meta-data
android:name=
"com.facebook.sdk.ApplicationId"
android:name=
"com.facebook.sdk.ApplicationId"
android:value=
"@string/facebook_app_id"
/>
android:value=
"@string/facebook_app_id"
/>
...
...
app/src/main/java/com/swiftcleaner/chovey/CleanApplication.kt
View file @
16d805b5
...
@@ -38,6 +38,7 @@ import com.swiftcleaner.chovey.business.push.UnlockReceiver
...
@@ -38,6 +38,7 @@ import com.swiftcleaner.chovey.business.push.UnlockReceiver
import
com.swiftcleaner.chovey.util.SPUtils
import
com.swiftcleaner.chovey.util.SPUtils
import
com.swiftcleaner.chovey.view.activity.StartActivity
import
com.swiftcleaner.chovey.view.activity.StartActivity
import
com.tool.elite.cleaner.utils.ActivityManagerUtils
import
com.tool.elite.cleaner.utils.ActivityManagerUtils
import
org.json.JSONObject
import
org.json.JSONObject
import
java.util.Calendar
import
java.util.Calendar
import
java.util.UUID
import
java.util.UUID
...
@@ -71,6 +72,7 @@ class CleanApplication : Application() {
...
@@ -71,6 +72,7 @@ class CleanApplication : Application() {
SPUtils
.
getInstance
().
putLong
(
KEY_INSTALL_TIME
,
System
.
currentTimeMillis
())
SPUtils
.
getInstance
().
putLong
(
KEY_INSTALL_TIME
,
System
.
currentTimeMillis
())
if
(
SPUtils
.
getInstance
().
getBoolean
(
KEY_INIT
))
init
()
if
(
SPUtils
.
getInstance
().
getBoolean
(
KEY_INIT
))
init
()
}
}
private
fun
init
()
{
private
fun
init
()
{
...
...
app/src/main/java/com/swiftcleaner/chovey/GlobalConfig.kt
View file @
16d805b5
...
@@ -37,7 +37,29 @@ object GlobalConfig {
...
@@ -37,7 +37,29 @@ object GlobalConfig {
* Key solar 归因key
* Key solar 归因key
*/
*/
const
val
KEY_SOLAR
=
"17697786c4fcd7e9"
const
val
KEY_SOLAR
=
"17697786c4fcd7e9"
/* 以下测试广告id*/
// // admob广告位id
// inline val ID_ADMOB_OPEN get() = "/6499/example/app-open"
// inline val ID_ADMOB_INTER get() = "ca-app-pub-3940256099942544/1033173712"
// inline val ID_ADMOB_NATIVE get() = "ca-app-pub-3940256099942544/2247696110"
// inline val ID_ADMOB_BANNER get() = "ca-app-pub-3940256099942544/9214589741"
// inline val ID_ADMOB_REWARD get() = "None"
//
//
// // max广告位id
// inline val ID_MAX_OPEN get() = "None"
// inline val ID_MAX_INTER get() = "None"
// inline val ID_MAX_NATIVE get() = "None"
// inline val ID_MAX_BANNER get() = "None"
// inline val ID_MAX_REWARD get() = "None"
//
// /**
// * Key MAX MAX广告初始化key
// */
// const val KEY_MAX = "GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
/*以下正式广告id*/
// admob广告位id
// admob广告位id
inline
val
ID_ADMOB_OPEN
get
()
=
"ca-app-pub-9723053978060994/2762540539"
inline
val
ID_ADMOB_OPEN
get
()
=
"ca-app-pub-9723053978060994/2762540539"
inline
val
ID_ADMOB_INTER
get
()
=
"ca-app-pub-9723053978060994/3372651292"
inline
val
ID_ADMOB_INTER
get
()
=
"ca-app-pub-9723053978060994/3372651292"
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/AppProcessActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
...
@@ -7,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
...
@@ -7,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import
android.Manifest
;
import
android.Manifest
;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.ApplicationInfo
;
...
@@ -29,6 +31,7 @@ import com.swiftcleaner.chovey.model.bean.AppInfoBean;
...
@@ -29,6 +31,7 @@ import com.swiftcleaner.chovey.model.bean.AppInfoBean;
import
com.swiftcleaner.chovey.model.tool.MemoryUtils
;
import
com.swiftcleaner.chovey.model.tool.MemoryUtils
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.adapter.AppProcessAdapter
;
import
com.swiftcleaner.chovey.view.adapter.AppProcessAdapter
;
import
com.swiftcleaner.chovey.view.dialog.CustomBottomSheetDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomBottomSheetDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
...
@@ -152,12 +155,15 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
...
@@ -152,12 +155,15 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
}
}
...
@@ -168,7 +174,7 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
...
@@ -168,7 +174,7 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
...
@@ -176,12 +182,29 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
...
@@ -176,12 +182,29 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
}
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
private
void
initProcess
()
{
private
void
initProcess
()
{
// 获取总内存
// 获取总内存
String
totalMemory
=
MemoryUtils
.
getUsedDiskMemory
(
this
);
String
totalMemory
=
MemoryUtils
.
getUsedDiskMemory
(
this
);
...
@@ -260,6 +283,7 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
...
@@ -260,6 +283,7 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
AppProcessActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
AppProcessActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -274,6 +298,9 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
...
@@ -274,6 +298,9 @@ public class AppProcessActivity extends BaseActivity<ActivityAppProcessBinding>
}
}
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/BatteryInfoActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
...
@@ -30,6 +31,7 @@ import com.swiftcleaner.chovey.model.bean.AppInfoBean;
...
@@ -30,6 +31,7 @@ import com.swiftcleaner.chovey.model.bean.AppInfoBean;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.adapter.AppInfoAdapter
;
import
com.swiftcleaner.chovey.view.adapter.AppInfoAdapter
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
...
@@ -122,7 +124,6 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
...
@@ -122,7 +124,6 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
}
}
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
...
@@ -130,19 +131,37 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
...
@@ -130,19 +131,37 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Activity not found"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
}
}
}
@Override
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
...
@@ -150,7 +169,7 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
...
@@ -150,7 +169,7 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
}
...
@@ -250,7 +269,7 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
...
@@ -250,7 +269,7 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
BatteryInfoActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
BatteryInfoActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -263,6 +282,10 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
...
@@ -263,6 +282,10 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
}
}
}
});
});
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/CleanJunkActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
...
@@ -8,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
...
@@ -8,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import
android.Manifest
;
import
android.Manifest
;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.net.Uri
;
import
android.net.Uri
;
...
@@ -30,6 +32,7 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
...
@@ -30,6 +32,7 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.adapter.ApkCleanAdapter
;
import
com.swiftcleaner.chovey.view.adapter.ApkCleanAdapter
;
import
com.swiftcleaner.chovey.view.adapter.EmptyCleanAdapter
;
import
com.swiftcleaner.chovey.view.adapter.EmptyCleanAdapter
;
import
com.swiftcleaner.chovey.view.adapter.LogsCleanAdapter
;
import
com.swiftcleaner.chovey.view.adapter.LogsCleanAdapter
;
...
@@ -138,12 +141,15 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
...
@@ -138,12 +141,15 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
}
}
...
@@ -189,7 +195,7 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
...
@@ -189,7 +195,7 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
if
(
selectedSize
<
0
)
{
if
(
selectedSize
<
0
)
{
ToastUtil
.
showLongToast
(
CleanJunkActivity
.
this
,
"
请勾选要删除的文件
"
);
ToastUtil
.
showLongToast
(
CleanJunkActivity
.
this
,
"
Please check the file to be deleted
"
);
}
else
{
}
else
{
if
(
view
!=
null
)
{
if
(
view
!=
null
)
{
onClickCleanUpButton
(
view
);
onClickCleanUpButton
(
view
);
...
@@ -212,6 +218,25 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
...
@@ -212,6 +218,25 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
@Override
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
...
@@ -226,15 +251,18 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
...
@@ -226,15 +251,18 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
if
(
grantResults
.
length
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
&&
grantResults
[
1
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
if
(
grantResults
.
length
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
&&
grantResults
[
1
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
}
...
@@ -603,6 +631,7 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
...
@@ -603,6 +631,7 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
CleanJunkActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
CleanJunkActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -614,6 +643,10 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
...
@@ -614,6 +643,10 @@ public class CleanJunkActivity extends BaseActivity<ActivityCleanJunkBinding> {
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/EndCleanJunkActivity.java
View file @
16d805b5
...
@@ -13,6 +13,7 @@ import com.swiftcleaner.chovey.business.EventUtils;
...
@@ -13,6 +13,7 @@ import com.swiftcleaner.chovey.business.EventUtils;
import
com.swiftcleaner.chovey.business.admob.AdmobManager
;
import
com.swiftcleaner.chovey.business.admob.AdmobManager
;
import
com.swiftcleaner.chovey.databinding.ActivityEndCleanJunkBinding
;
import
com.swiftcleaner.chovey.databinding.ActivityEndCleanJunkBinding
;
import
com.swiftcleaner.chovey.databinding.ActivityScreenShotBinding
;
import
com.swiftcleaner.chovey.databinding.ActivityScreenShotBinding
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
...
@@ -21,6 +22,7 @@ import com.swiftcleaner.chovey.view.dialog.LoadingDialog;
...
@@ -21,6 +22,7 @@ import com.swiftcleaner.chovey.view.dialog.LoadingDialog;
public
class
EndCleanJunkActivity
extends
BaseActivity
<
ActivityEndCleanJunkBinding
>
{
public
class
EndCleanJunkActivity
extends
BaseActivity
<
ActivityEndCleanJunkBinding
>
{
private
CountDownTimer
countDownTimer
;
private
CountDownTimer
countDownTimer
;
private
ValueAnimator
animator
;
private
ValueAnimator
animator
;
@Override
@Override
protected
ActivityEndCleanJunkBinding
getViewBinding
()
{
protected
ActivityEndCleanJunkBinding
getViewBinding
()
{
return
ActivityEndCleanJunkBinding
.
inflate
(
getLayoutInflater
());
return
ActivityEndCleanJunkBinding
.
inflate
(
getLayoutInflater
());
...
@@ -37,6 +39,7 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
...
@@ -37,6 +39,7 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
initPage
();
initPage
();
initShow
();
initShow
();
}
}
private
void
initPage
()
{
private
void
initPage
()
{
binding
.
clRadarview
.
setVisibility
(
View
.
VISIBLE
);
binding
.
clRadarview
.
setVisibility
(
View
.
VISIBLE
);
binding
.
radarview
.
setSearching
(
true
);
binding
.
radarview
.
setSearching
(
true
);
...
@@ -49,8 +52,9 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
...
@@ -49,8 +52,9 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
@Override
@Override
public
void
onFinish
()
{
public
void
onFinish
()
{
binding
.
radarview
.
setSearching
(
false
);
binding
.
radarview
.
setSearching
(
false
);
countDownTimer
.
cancel
();
if
(
animator
!=
null
)
{
animator
.
cancel
();
animator
.
cancel
();
}
binding
.
clRadarview
.
setVisibility
(
View
.
GONE
);
binding
.
clRadarview
.
setVisibility
(
View
.
GONE
);
LoadingDialog
loadingDialog
=
new
LoadingDialog
(
EndCleanJunkActivity
.
this
);
LoadingDialog
loadingDialog
=
new
LoadingDialog
(
EndCleanJunkActivity
.
this
);
loadingDialog
.
show
();
loadingDialog
.
show
();
...
@@ -68,58 +72,51 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
...
@@ -68,58 +72,51 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
}
}
}.
start
();
}.
start
();
}
}
private
void
initAnimotorPer
(){
// 创建ValueAnimator,从1到100
animator
=
ValueAnimator
.
ofInt
(
1
,
100
);
animator
.
setDuration
(
3000
);
// 3秒
// 设置更新监听器,每帧更新进度文本
private
void
initAnimotorPer
()
{
animator
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
animator
=
ValueAnimator
.
ofInt
(
1
,
100
);
@Override
animator
.
setDuration
(
3000
);
public
void
onAnimationUpdate
(
ValueAnimator
animation
)
{
animator
.
addUpdateListener
(
animation
->
{
int
currentValue
=
(
int
)
animation
.
getAnimatedValue
();
int
currentValue
=
(
int
)
animation
.
getAnimatedValue
();
binding
.
parText
.
setText
(
currentValue
+
"%"
);
binding
.
parText
.
setText
(
currentValue
+
"%"
);
}
});
});
// 开始动画
animator
.
start
();
animator
.
start
();
}
}
private
void
initShow
()
{
private
void
initShow
()
{
Intent
intent
=
getIntent
();
Intent
intent
=
getIntent
();
String
stringExtra
=
intent
.
getStringExtra
(
"cleanstr"
);
String
stringExtra
=
intent
.
getStringExtra
(
"cleanstr"
);
binding
.
endCleanJunkFileNum
.
setText
(
"Cleaned "
+
stringExtra
+
" junk files"
);
binding
.
endCleanJunkFileNum
.
setText
(
"Cleaned "
+
stringExtra
+
" junk files"
);
binding
.
ivReturn
.
setOnClickListener
(
v
->{
binding
.
ivReturn
.
setOnClickListener
(
v
->
initCustDialog
());
initCustDialog
();
binding
.
buttonBatteryInfoCheckNo
.
setOnClickListener
(
v
->
{
});
binding
.
buttonBatteryInfoCheckNo
.
setOnClickListener
(
v
->{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
InfoActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
InfoActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonAppManagerCheckNo
.
setOnClickListener
(
v
->
{
binding
.
buttonAppManagerCheckNo
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
BatteryInfoActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
BatteryInfoActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonWhatsappCheckNo
.
setOnClickListener
(
v
->
{
binding
.
buttonWhatsappCheckNo
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
WhatsAppActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
WhatsAppActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonAppProcessCheckNo
.
setOnClickListener
(
v
->
{
binding
.
buttonAppProcessCheckNo
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
AppProcessActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
AppProcessActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonCleanJunkCleanNo
.
setOnClickListener
(
v
->
{
binding
.
buttonCleanJunkCleanNo
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
CleanJunkActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
CleanJunkActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonLargefilecleanerCleanUp
.
setOnClickListener
(
v
->
{
binding
.
buttonLargefilecleanerCleanUp
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
LargeFileActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
LargeFileActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonSimilarPhotos
.
setOnClickListener
(
v
->
{
binding
.
buttonSimilarPhotos
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
SimilarPhotosActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
SimilarPhotosActivity
.
class
));
finish
();
finish
();
});
});
binding
.
buttonScreenshot
.
setOnClickListener
(
v
->
{
binding
.
buttonScreenshot
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
ScreenShotActivity
.
class
));
startActivity
(
new
Intent
(
EndCleanJunkActivity
.
this
,
ScreenShotActivity
.
class
));
finish
();
finish
();
});
});
...
@@ -127,9 +124,9 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
...
@@ -127,9 +124,9 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
private
void
initBar
()
{
private
void
initBar
()
{
ImmersionBar
.
with
(
this
)
ImmersionBar
.
with
(
this
)
.
transparentStatusBar
()
// 透明状态栏
.
transparentStatusBar
()
.
statusBarDarkFont
(
false
)
// 状态栏字体颜色为浅色
.
statusBarDarkFont
(
false
)
.
navigationBarDarkIcon
(
true
)
// 导航栏图标颜色为浅色
.
navigationBarDarkIcon
(
true
)
.
init
();
.
init
();
}
}
...
@@ -148,6 +145,7 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
...
@@ -148,6 +145,7 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
EndCleanJunkActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
EndCleanJunkActivity
.
this
,
()
->
{
finish
();
finish
();
return
null
;
return
null
;
...
@@ -159,21 +157,26 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
...
@@ -159,21 +157,26 @@ public class EndCleanJunkActivity extends BaseActivity<ActivityEndCleanJunkBindi
finish
();
finish
();
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
finish
();
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
}
}
@Override
@Override
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
super
.
onDestroy
();
super
.
onDestroy
();
if
(
binding
.
radarview
!=
null
)
{
if
(
binding
.
radarview
!=
null
)
{
binding
.
radarview
.
setSearching
(
false
);
binding
.
radarview
.
setSearching
(
false
);
}
}
if
(
animator
!=
null
)
{
if
(
animator
!=
null
)
{
animator
.
cancel
();
animator
.
cancel
();
}
}
if
(
countDownTimer
!=
null
)
{
if
(
countDownTimer
!=
null
)
{
countDownTimer
.
cancel
();
countDownTimer
.
cancel
();
}
}
}
}
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/InfoActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
...
@@ -7,6 +8,7 @@ import androidx.core.content.ContextCompat;
...
@@ -7,6 +8,7 @@ import androidx.core.content.ContextCompat;
import
android.Manifest
;
import
android.Manifest
;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.content.IntentFilter
;
...
@@ -28,6 +30,7 @@ import com.swiftcleaner.chovey.databinding.ActivityInfoBinding;
...
@@ -28,6 +30,7 @@ import com.swiftcleaner.chovey.databinding.ActivityInfoBinding;
import
com.swiftcleaner.chovey.model.util.BatteryReceiver
;
import
com.swiftcleaner.chovey.model.util.BatteryReceiver
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
...
@@ -37,6 +40,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -37,6 +40,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
private
CountDownTimer
countDownTimer
;
private
CountDownTimer
countDownTimer
;
private
static
final
int
REQUEST_ALL_FILES_ACCESS_PERMISSION
=
100
;
private
static
final
int
REQUEST_ALL_FILES_ACCESS_PERMISSION
=
100
;
private
static
final
int
REQUEST_PERMISSION_CODE
=
101
;
private
static
final
int
REQUEST_PERMISSION_CODE
=
101
;
@Override
@Override
protected
ActivityInfoBinding
getViewBinding
()
{
protected
ActivityInfoBinding
getViewBinding
()
{
return
ActivityInfoBinding
.
inflate
(
getLayoutInflater
());
return
ActivityInfoBinding
.
inflate
(
getLayoutInflater
());
...
@@ -54,6 +58,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -54,6 +58,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
initShow
();
initShow
();
registerReceiver
();
registerReceiver
();
}
}
private
void
initPage
()
{
private
void
initPage
()
{
binding
.
clRadarview
.
setVisibility
(
View
.
VISIBLE
);
binding
.
clRadarview
.
setVisibility
(
View
.
VISIBLE
);
binding
.
radarview
.
setSearching
(
true
);
binding
.
radarview
.
setSearching
(
true
);
...
@@ -66,12 +71,11 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -66,12 +71,11 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
@Override
@Override
public
void
onFinish
()
{
public
void
onFinish
()
{
binding
.
radarview
.
setSearching
(
false
);
binding
.
radarview
.
setSearching
(
false
);
countDownTimer
.
cancel
();
cancelCountDownTimerAndAnimator
();
animator
.
cancel
();
binding
.
clRadarview
.
setVisibility
(
View
.
GONE
);
binding
.
clRadarview
.
setVisibility
(
View
.
GONE
);
LoadingDialog
loadingDialog
=
new
LoadingDialog
(
InfoActivity
.
this
);
LoadingDialog
loadingDialog
=
new
LoadingDialog
(
InfoActivity
.
this
);
loadingDialog
.
show
();
loadingDialog
.
show
();
if
(
AdmobManager
.
INSTANCE
.
isShowAdInter
()){
if
(
AdmobManager
.
INSTANCE
.
isShowAdInter
())
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
InfoActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
InfoActivity
.
this
,
()
->
{
return
null
;
return
null
;
},
},
...
@@ -85,7 +89,8 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -85,7 +89,8 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
loadingDialog
.
dismiss
();
loadingDialog
.
dismiss
();
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
}
else
{
checkAndRequestPermissions
();
checkAndRequestPermissions
();
loadingDialog
.
dismiss
();
loadingDialog
.
dismiss
();
}
}
...
@@ -93,6 +98,16 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -93,6 +98,16 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
}
}
}.
start
();
}.
start
();
}
}
private
void
cancelCountDownTimerAndAnimator
()
{
if
(
countDownTimer
!=
null
)
{
countDownTimer
.
cancel
();
}
if
(
animator
!=
null
)
{
animator
.
cancel
();
}
}
private
void
checkAndRequestPermissions
()
{
private
void
checkAndRequestPermissions
()
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 没有权限,请求权限
// 没有权限,请求权限
...
@@ -112,12 +127,15 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -112,12 +127,15 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
}
}
...
@@ -125,70 +143,64 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -125,70 +143,64 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
@Override
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
||
requestCode
==
REQUEST_PERMISSION_CODE
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
if
(
grantResults
.
length
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
&&
grantResults
[
1
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
}
// 权限已授予,可以继续操作
@Override
}
else
{
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
// 权限未授予,直接关闭页面
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
Toast
.
makeText
(
this
,
"权限未授权,页面即将关闭"
,
Toast
.
LENGTH_SHORT
).
show
();
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
}
}
}
private
void
initAnimotor
(){
private
void
initAnimotor
()
{
// 创建ValueAnimator,从1到100
animator
=
ValueAnimator
.
ofInt
(
1
,
100
);
animator
=
ValueAnimator
.
ofInt
(
1
,
100
);
animator
.
setDuration
(
3000
);
// 3秒
animator
.
setDuration
(
3000
);
animator
.
addUpdateListener
(
animation
->
{
// 设置更新监听器,每帧更新进度文本
animator
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
@Override
public
void
onAnimationUpdate
(
ValueAnimator
animation
)
{
int
currentValue
=
(
int
)
animation
.
getAnimatedValue
();
int
currentValue
=
(
int
)
animation
.
getAnimatedValue
();
binding
.
parText
.
setText
(
currentValue
+
"%"
);
binding
.
parText
.
setText
(
currentValue
+
"%"
);
}
});
});
// 开始动画
animator
.
start
();
animator
.
start
();
}
}
private
void
initBar
()
{
private
void
initBar
()
{
ImmersionBar
.
with
(
this
).
transparentStatusBar
()
// 透明状态栏
ImmersionBar
.
with
(
this
).
transparentStatusBar
()
.
statusBarDarkFont
(
false
)
// 状态栏字体颜色为浅色
.
statusBarDarkFont
(
false
)
.
navigationBarDarkIcon
(
true
)
// 导航栏图标颜色为浅色
.
navigationBarDarkIcon
(
true
)
.
init
();
.
init
();
}
}
private
void
initShow
()
{
private
void
initShow
()
{
binding
.
ivReturn
.
setOnClickListener
(
v
->
{
binding
.
ivReturn
.
setOnClickListener
(
v
->
initCustDialog
());
initCustDialog
();
binding
.
infoButtonOk
.
setOnClickListener
(
v
->
initCustDialog
());
});
binding
.
infoButtonOk
.
setOnClickListener
(
v
->{
initCustDialog
();
});
}
}
private
void
registerReceiver
()
{
private
void
registerReceiver
()
{
batteryReceiver
=
new
BatteryReceiver
(
new
Runnable
()
{
batteryReceiver
=
new
BatteryReceiver
(()
->
setBatteryInfo
());
@Override
public
void
run
()
{
setBatteryInfo
();
}
});
IntentFilter
intentFilter
=
new
IntentFilter
(
Intent
.
ACTION_BATTERY_CHANGED
);
IntentFilter
intentFilter
=
new
IntentFilter
(
Intent
.
ACTION_BATTERY_CHANGED
);
registerReceiver
(
batteryReceiver
,
intentFilter
);
registerReceiver
(
batteryReceiver
,
intentFilter
);
}
}
private
void
setBatteryInfo
()
{
private
void
setBatteryInfo
()
{
binding
.
temperatureNum
.
setText
(
String
.
format
(
"%.1f ℃"
,
batteryReceiver
.
temperature
/
10.0
));
binding
.
temperatureNum
.
setText
(
String
.
format
(
"%.1f ℃"
,
batteryReceiver
.
temperature
/
10.0
));
binding
.
voltageNum
.
setText
(
String
.
format
(
"%.1f V"
,
batteryReceiver
.
voltage
/
1000.0
));
binding
.
voltageNum
.
setText
(
String
.
format
(
"%.1f V"
,
batteryReceiver
.
voltage
/
1000.0
));
binding
.
technologyNum
.
setText
(
batteryReceiver
.
technology
);
binding
.
technologyNum
.
setText
(
batteryReceiver
.
technology
);
// 格式化显示 batteryCapacityNum,保留整数
binding
.
batteryCapacityNum
.
setText
(
String
.
format
(
"%d mAh"
,
(
int
)
batteryReceiver
.
mAh
));
binding
.
batteryCapacityNum
.
setText
(
String
.
format
(
"%d mAh"
,
(
int
)
batteryReceiver
.
mAh
));
binding
.
electricNum
.
setText
(
String
.
format
(
"%.2f mA"
,
batteryReceiver
.
current
/
1000.0
));
binding
.
electricNum
.
setText
(
String
.
format
(
"%.2f mA"
,
batteryReceiver
.
current
/
1000.0
));
binding
.
currentNum
.
setText
(
String
.
format
(
"%.2f mA"
,
batteryReceiver
.
currentAverage
/
1000.0
));
binding
.
currentNum
.
setText
(
String
.
format
(
"%.2f mA"
,
batteryReceiver
.
currentAverage
/
1000.0
));
...
@@ -199,18 +211,10 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -199,18 +211,10 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
@Override
@Override
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
super
.
onDestroy
();
super
.
onDestroy
();
if
(
batteryReceiver
!=
null
)
{
if
(
batteryReceiver
!=
null
)
{
unregisterReceiver
(
batteryReceiver
);
unregisterReceiver
(
batteryReceiver
);
}
}
if
(
binding
.
radarview
!=
null
)
{
cancelCountDownTimerAndAnimator
();
binding
.
radarview
.
setSearching
(
false
);
}
if
(
countDownTimer
!=
null
){
countDownTimer
.
cancel
();
}
if
(
animator
!=
null
){
animator
.
cancel
();
}
}
}
@Override
@Override
...
@@ -229,6 +233,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -229,6 +233,7 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
InfoActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
InfoActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -240,6 +245,9 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
...
@@ -240,6 +245,9 @@ public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/LargeFileActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.widget.AppCompatButton
;
import
androidx.appcompat.widget.AppCompatButton
;
import
androidx.cardview.widget.CardView
;
import
androidx.cardview.widget.CardView
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
...
@@ -12,6 +13,7 @@ import android.animation.ValueAnimator;
...
@@ -12,6 +13,7 @@ import android.animation.ValueAnimator;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
...
@@ -35,6 +37,7 @@ import com.swiftcleaner.chovey.model.tool.MediaHelps;
...
@@ -35,6 +37,7 @@ import com.swiftcleaner.chovey.model.tool.MediaHelps;
import
com.swiftcleaner.chovey.model.tool.ToastUtil
;
import
com.swiftcleaner.chovey.model.tool.ToastUtil
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.adapter.LargeFileAdapter
;
import
com.swiftcleaner.chovey.view.adapter.LargeFileAdapter
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
...
@@ -135,23 +138,43 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
...
@@ -135,23 +138,43 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
@Override
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
...
@@ -159,17 +182,16 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
...
@@ -159,17 +182,16 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
}
}
}
private
void
initShow
()
{
private
void
initShow
()
{
binding
.
ivReturn
.
setOnClickListener
(
v
->
initCustDialog
());
binding
.
ivReturn
.
setOnClickListener
(
v
->
initCustDialog
());
binding
.
largeFileButton
.
setOnClickListener
(
v
->
{
binding
.
largeFileButton
.
setOnClickListener
(
v
->
{
if
(
selectedSize
==
0
)
{
if
(
selectedSize
==
0
)
{
ToastUtil
.
showLongToast
(
this
,
"
请勾选要删除的文件
"
);
ToastUtil
.
showLongToast
(
this
,
"
Please check the file to be deleted
"
);
}
else
{
}
else
{
showCustomDialog
();
showCustomDialog
();
}
}
...
@@ -308,6 +330,7 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
...
@@ -308,6 +330,7 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
LargeFileActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
LargeFileActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -319,6 +342,10 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
...
@@ -319,6 +342,10 @@ public class LargeFileActivity extends BaseActivity<ActivityLargeFileBinding> {
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
finish
();
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/ScreenShotActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.widget.AppCompatButton
;
import
androidx.appcompat.widget.AppCompatButton
;
import
androidx.cardview.widget.CardView
;
import
androidx.cardview.widget.CardView
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
...
@@ -11,6 +12,7 @@ import android.Manifest;
...
@@ -11,6 +12,7 @@ import android.Manifest;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
...
@@ -36,6 +38,7 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
...
@@ -36,6 +38,7 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.adapter.ScreenShotAdapter
;
import
com.swiftcleaner.chovey.view.adapter.ScreenShotAdapter
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
;
...
@@ -132,12 +135,15 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -132,12 +135,15 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
}
}
...
@@ -148,7 +154,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -148,7 +154,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
...
@@ -156,7 +162,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -156,7 +162,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
}
...
@@ -167,7 +173,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -167,7 +173,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
});
});
binding
.
buttonScreenshotDelete
.
setOnClickListener
(
v
->
{
binding
.
buttonScreenshotDelete
.
setOnClickListener
(
v
->
{
if
(
selectedSize
==
0
)
{
if
(
selectedSize
==
0
)
{
ToastUtil
.
showLongToast
(
this
,
"
请勾选要删除的文件
"
);
ToastUtil
.
showLongToast
(
this
,
"
Please check the file to be deleted
"
);
}
else
{
}
else
{
showCustomDialog
();
showCustomDialog
();
}
}
...
@@ -289,7 +295,24 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -289,7 +295,24 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
startActivity
(
intent
);
startActivity
(
intent
);
finish
();
finish
();
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
private
String
formatFileSize
(
long
size
)
{
private
String
formatFileSize
(
long
size
)
{
if
(
size
<=
0
)
return
"0 Bytes"
;
if
(
size
<=
0
)
return
"0 Bytes"
;
final
String
[]
units
=
new
String
[]{
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
};
final
String
[]
units
=
new
String
[]{
"Bytes"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
};
...
@@ -321,6 +344,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -321,6 +344,7 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
ScreenShotActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
ScreenShotActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -332,6 +356,10 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
...
@@ -332,6 +356,10 @@ public class ScreenShotActivity extends BaseActivity<ActivityScreenShotBinding>
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
finish
();
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/SettingActivity.java
View file @
16d805b5
...
@@ -7,6 +7,7 @@ import androidx.appcompat.widget.AppCompatButton;
...
@@ -7,6 +7,7 @@ import androidx.appcompat.widget.AppCompatButton;
import
androidx.cardview.widget.CardView
;
import
androidx.cardview.widget.CardView
;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.ClipData
;
import
android.content.ClipData
;
import
android.content.ClipboardManager
;
import
android.content.ClipboardManager
;
import
android.content.Context
;
import
android.content.Context
;
...
@@ -55,7 +56,12 @@ public class SettingActivity extends AppCompatActivity {
...
@@ -55,7 +56,12 @@ public class SettingActivity extends AppCompatActivity {
binding
.
settingCl3Policy
.
setOnClickListener
(
v
->
{
binding
.
settingCl3Policy
.
setOnClickListener
(
v
->
{
Uri
uri
=
Uri
.
parse
(
URL_PRIVACY
);
Uri
uri
=
Uri
.
parse
(
URL_PRIVACY
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
try
{
startActivity
(
intent
);
startActivity
(
intent
);
}
catch
(
ActivityNotFoundException
e
)
{
e
.
printStackTrace
();
Toast
.
makeText
(
this
,
"No app can handle this action"
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
});
// String token = SPUtils.Companion.getInstance().getString("token", "");
// String token = SPUtils.Companion.getInstance().getString("token", "");
...
@@ -136,6 +142,7 @@ public class SettingActivity extends AppCompatActivity {
...
@@ -136,6 +142,7 @@ public class SettingActivity extends AppCompatActivity {
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
}
}
//复制
//复制
private
void
copyTextToClipboard
(
String
text
)
{
private
void
copyTextToClipboard
(
String
text
)
{
// 获取剪贴板管理器
// 获取剪贴板管理器
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/SimilarPhotosActivity.kt
View file @
16d805b5
...
@@ -2,6 +2,7 @@ package com.swiftcleaner.chovey.view.activity
...
@@ -2,6 +2,7 @@ package com.swiftcleaner.chovey.view.activity
import
android.Manifest
import
android.Manifest
import
android.app.Activity
import
android.app.Activity
import
android.content.ActivityNotFoundException
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.content.pm.PackageManager
import
android.content.pm.PackageManager
...
@@ -29,6 +30,7 @@ import com.swiftcleaner.chovey.model.bean.SimilarBean
...
@@ -29,6 +30,7 @@ import com.swiftcleaner.chovey.model.bean.SimilarBean
import
com.swiftcleaner.chovey.model.tool.FileHelps
import
com.swiftcleaner.chovey.model.tool.FileHelps
import
com.swiftcleaner.chovey.model.tool.MediaHelps
import
com.swiftcleaner.chovey.model.tool.MediaHelps
import
com.swiftcleaner.chovey.model.util.FinishMain.finishToMain
import
com.swiftcleaner.chovey.model.util.FinishMain.finishToMain
import
com.swiftcleaner.chovey.view.MainActivity
import
com.swiftcleaner.chovey.view.adapter.SimilarPhotosAdapter
import
com.swiftcleaner.chovey.view.adapter.SimilarPhotosAdapter
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
import
com.swiftcleaner.chovey.view.dialog.LoadingDialog
...
@@ -190,6 +192,7 @@ class SimilarPhotosActivity : AppCompatActivity() {
...
@@ -190,6 +192,7 @@ class SimilarPhotosActivity : AppCompatActivity() {
}
}
override
fun
onSubmit
()
{
override
fun
onSubmit
()
{
if
(
AdmobManager
.
isShowAdBackInter
()){
showInterstitialAd
(
showInterstitialAd
(
this
@SimilarPhotosActivity
,
{
this
@SimilarPhotosActivity
,
{
finishToMain
(
activity
)
finishToMain
(
activity
)
...
@@ -201,6 +204,9 @@ class SimilarPhotosActivity : AppCompatActivity() {
...
@@ -201,6 +204,9 @@ class SimilarPhotosActivity : AppCompatActivity() {
null
null
},
false
},
false
)
)
}
else
{
finishToMain
(
activity
)
}
}
}
})
})
customScoreDialog
.
show
()
customScoreDialog
.
show
()
...
@@ -252,10 +258,19 @@ class SimilarPhotosActivity : AppCompatActivity() {
...
@@ -252,10 +258,19 @@ class SimilarPhotosActivity : AppCompatActivity() {
private
fun
requestFilesAccessPermission
()
{
private
fun
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
val
intent
=
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
)
val
intent
=
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
)
intent
.
addCategory
(
"android.intent.category.DEFAULT"
)
intent
.
addCategory
(
"android.intent.category.DEFAULT"
)
intent
.
data
=
Uri
.
parse
(
"package:$packageName"
)
intent
.
data
=
Uri
.
parse
(
"package:$packageName"
)
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
}
catch
(
e
:
ActivityNotFoundException
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
ActivityCompat
.
requestPermissions
(
...
@@ -268,7 +283,27 @@ class SimilarPhotosActivity : AppCompatActivity() {
...
@@ -268,7 +283,27 @@ class SimilarPhotosActivity : AppCompatActivity() {
)
)
}
}
}
}
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
val
intent
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
intent
)
finish
()
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
override
fun
onRequestPermissionsResult
(
override
fun
onRequestPermissionsResult
(
requestCode
:
Int
,
requestCode
:
Int
,
permissions
:
Array
<
String
?
>,
permissions
:
Array
<
String
?
>,
...
@@ -278,7 +313,7 @@ class SimilarPhotosActivity : AppCompatActivity() {
...
@@ -278,7 +313,7 @@ class SimilarPhotosActivity : AppCompatActivity() {
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
()
finish
()
finish
()
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
...
@@ -286,7 +321,7 @@ class SimilarPhotosActivity : AppCompatActivity() {
...
@@ -286,7 +321,7 @@ class SimilarPhotosActivity : AppCompatActivity() {
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
()
finish
()
finish
()
}
}
}
}
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/StartActivity.java
View file @
16d805b5
...
@@ -29,6 +29,7 @@ import androidx.core.content.ContextCompat;
...
@@ -29,6 +29,7 @@ import androidx.core.content.ContextCompat;
import
android.Manifest
;
import
android.Manifest
;
import
android.animation.Animator
;
import
android.animation.Animator
;
import
android.content.ActivityNotFoundException
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
...
@@ -37,6 +38,7 @@ import android.os.Build;
...
@@ -37,6 +38,7 @@ import android.os.Build;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Toast
;
import
com.gyf.immersionbar.ImmersionBar
;
import
com.gyf.immersionbar.ImmersionBar
;
import
com.swiftcleaner.chovey.CleanApplication
;
import
com.swiftcleaner.chovey.CleanApplication
;
...
@@ -50,6 +52,14 @@ import com.swiftcleaner.chovey.util.ActivityLauncher;
...
@@ -50,6 +52,14 @@ import com.swiftcleaner.chovey.util.ActivityLauncher;
import
com.swiftcleaner.chovey.util.NonBlockingCountdown
;
import
com.swiftcleaner.chovey.util.NonBlockingCountdown
;
import
com.swiftcleaner.chovey.util.SPUtils
;
import
com.swiftcleaner.chovey.util.SPUtils
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.activity.AppProcessActivity
;
import
com.swiftcleaner.chovey.view.activity.BatteryInfoActivity
;
import
com.swiftcleaner.chovey.view.activity.CleanJunkActivity
;
import
com.swiftcleaner.chovey.view.activity.InfoActivity
;
import
com.swiftcleaner.chovey.view.activity.LargeFileActivity
;
import
com.swiftcleaner.chovey.view.activity.ScreenShotActivity
;
import
com.swiftcleaner.chovey.view.activity.SimilarPhotosActivity
;
import
com.swiftcleaner.chovey.view.activity.WhatsAppActivity
;
import
com.swiftcleaner.chovey.view.dialog.NoticeDialog
;
import
com.swiftcleaner.chovey.view.dialog.NoticeDialog
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -259,13 +269,23 @@ public class StartActivity extends AppCompatActivity {
...
@@ -259,13 +269,23 @@ public class StartActivity extends AppCompatActivity {
binding
.
userAgreement
.
setOnClickListener
(
v
->
{
binding
.
userAgreement
.
setOnClickListener
(
v
->
{
Uri
uri
=
Uri
.
parse
(
"https://sites.google.com/view/terms-swf/terms"
);
Uri
uri
=
Uri
.
parse
(
"https://sites.google.com/view/terms-swf/terms"
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
try
{
startActivity
(
intent
);
startActivity
(
intent
);
}
catch
(
ActivityNotFoundException
e
)
{
e
.
printStackTrace
();
Toast
.
makeText
(
this
,
"No app can handle this action"
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
});
binding
.
privacyPolicy
.
setOnClickListener
(
v
->
{
binding
.
privacyPolicy
.
setOnClickListener
(
v
->
{
Uri
uri
=
Uri
.
parse
(
URL_PRIVACY
);
Uri
uri
=
Uri
.
parse
(
URL_PRIVACY
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
try
{
startActivity
(
intent
);
startActivity
(
intent
);
}
catch
(
ActivityNotFoundException
e
)
{
e
.
printStackTrace
();
Toast
.
makeText
(
this
,
"No app can handle this action"
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
});
}
}
...
@@ -349,5 +369,7 @@ public class StartActivity extends AppCompatActivity {
...
@@ -349,5 +369,7 @@ public class StartActivity extends AppCompatActivity {
binding
.
lottieAnimattionView
.
destroyDrawingCache
();
// 销毁缓存
binding
.
lottieAnimattionView
.
destroyDrawingCache
();
// 销毁缓存
}
}
nonBlockingCountdown
.
cancel
();
nonBlockingCountdown
.
cancel
();
multiplePermissionsLauncher
=
null
;
notificationSettingsLauncher
=
null
;
}
}
}
}
\ No newline at end of file
app/src/main/java/com/swiftcleaner/chovey/view/activity/WhatsAppActivity.java
View file @
16d805b5
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
...
@@ -8,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
...
@@ -8,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import
android.Manifest
;
import
android.Manifest
;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
...
@@ -32,6 +34,7 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
...
@@ -32,6 +34,7 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.AppSchedulers
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.model.util.FinishMain
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.BaseActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.adapter.WhatsAppCleanAudioAdapter
;
import
com.swiftcleaner.chovey.view.adapter.WhatsAppCleanAudioAdapter
;
import
com.swiftcleaner.chovey.view.adapter.WhatsAppCleanImageAdapter
;
import
com.swiftcleaner.chovey.view.adapter.WhatsAppCleanImageAdapter
;
import
com.swiftcleaner.chovey.view.adapter.WhatsAppCleanVideoAdapter
;
import
com.swiftcleaner.chovey.view.adapter.WhatsAppCleanVideoAdapter
;
...
@@ -144,23 +147,43 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
...
@@ -144,23 +147,43 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
try
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Unable to request permission, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
}
else
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
}
}
}
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
// 检查权限是否已经授予
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
if
(
Environment
.
isExternalStorageManager
())
{
// 权限已授予,刷新页面或执行相关操作
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
}
else
{
// 权限未授予,提示用户
Toast
.
makeText
(
this
,
"Permission not granted, please grant manually"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
@Override
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(
requestCode
==
REQUEST_ALL_FILES_ACCESS_PERMISSION
)
{
if
(!
checkFilesAccessPermission
(
this
))
{
if
(!
checkFilesAccessPermission
(
this
))
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
}
else
if
(
requestCode
==
REQUEST_PERMISSION_CODE
)
{
...
@@ -168,7 +191,7 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
...
@@ -168,7 +191,7 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
// 权限已授予,可以继续操作
// 权限已授予,可以继续操作
}
else
{
}
else
{
// 权限未授予,直接关闭页面
// 权限未授予,直接关闭页面
Toast
.
makeText
(
this
,
"
权限未授权,页面即将关闭
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"
Unauthorized permission, the page is about to close
"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
finish
();
}
}
}
}
...
@@ -207,7 +230,7 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
...
@@ -207,7 +230,7 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
if
(
selectedSize
<
0
)
{
if
(
selectedSize
<
0
)
{
ToastUtil
.
showLongToast
(
WhatsAppActivity
.
this
,
"
请勾选要删除的文件
"
);
ToastUtil
.
showLongToast
(
WhatsAppActivity
.
this
,
"
Please check the file to be deleted
"
);
}
else
{
}
else
{
if
(
view
!=
null
)
{
if
(
view
!=
null
)
{
onClickCleanUpButton
(
view
);
onClickCleanUpButton
(
view
);
...
@@ -498,6 +521,7 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
...
@@ -498,6 +521,7 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
@Override
@Override
public
void
onSubmit
()
{
public
void
onSubmit
()
{
if
(
AdmobManager
.
INSTANCE
.
isShowAdBackInter
()){
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
WhatsAppActivity
.
this
,
()
->
{
AdmobManager
.
INSTANCE
.
showInterstitialAd
(
WhatsAppActivity
.
this
,
()
->
{
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
...
@@ -509,6 +533,9 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
...
@@ -509,6 +533,9 @@ public class WhatsAppActivity extends BaseActivity<ActivityWhatsAppBinding> {
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
FinishMain
.
INSTANCE
.
finishToMain
(
activity
);
return
null
;
return
null
;
},
false
);
},
false
);
}
else
{
finish
();
}
}
}
});
});
customScoreDialog
.
show
();
customScoreDialog
.
show
();
...
...
app/src/main/java/com/swiftcleaner/chovey/view/adapter/AppInfoAdapter.java
View file @
16d805b5
...
@@ -50,8 +50,7 @@ public class AppInfoAdapter extends RecyclerView.Adapter<AppInfoAdapter.AppInfoV
...
@@ -50,8 +50,7 @@ public class AppInfoAdapter extends RecyclerView.Adapter<AppInfoAdapter.AppInfoV
Intent
intentUninstall
=
new
Intent
(
Intent
.
ACTION_DELETE
);
Intent
intentUninstall
=
new
Intent
(
Intent
.
ACTION_DELETE
);
intentUninstall
.
setData
(
Uri
.
parse
(
"package:"
+
appInfoBean
.
getPackageName
()));
intentUninstall
.
setData
(
Uri
.
parse
(
"package:"
+
appInfoBean
.
getPackageName
()));
context
.
startActivity
(
intentUninstall
);
context
.
startActivity
(
intentUninstall
);
// appList.remove(position);
appList
.
remove
(
appInfoBean
);
notifyDataSetChanged
();
});
});
Glide
.
with
(
context
)
Glide
.
with
(
context
)
.
load
(
appInfoBean
.
getAppIcon
())
.
load
(
appInfoBean
.
getAppIcon
())
...
...
app/src/main/java/com/swiftcleaner/chovey/view/adapter/LargeFileAdapter.java
View file @
16d805b5
...
@@ -56,8 +56,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
...
@@ -56,8 +56,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
Glide
.
with
(
holder
.
itemView
.
getContext
())
Glide
.
with
(
holder
.
itemView
.
getContext
())
.
asBitmap
()
.
asBitmap
()
.
load
(
fileInfo
.
getPath
())
.
load
(
fileInfo
.
getPath
())
.
placeholder
(
R
.
mipmap
.
h_appmanager
)
.
placeholder
(
R
.
mipmap
.
l_tu
)
.
error
(
R
.
mipmap
.
l_
other
)
.
error
(
R
.
mipmap
.
l_
tu
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
into
(
holder
.
img
);
.
into
(
holder
.
img
);
// 设置图片图标或背景
// 设置图片图标或背景
...
@@ -65,8 +65,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
...
@@ -65,8 +65,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
Glide
.
with
(
holder
.
itemView
.
getContext
())
Glide
.
with
(
holder
.
itemView
.
getContext
())
.
asBitmap
()
.
asBitmap
()
.
load
(
fileInfo
.
getPath
())
.
load
(
fileInfo
.
getPath
())
.
placeholder
(
R
.
mipmap
.
h_appmanager
)
.
placeholder
(
R
.
mipmap
.
l_shipin
)
.
error
(
R
.
mipmap
.
l_
tu
)
.
error
(
R
.
mipmap
.
l_
shipin
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
into
(
holder
.
img
);
.
into
(
holder
.
img
);
// 设置视频图标或背景
// 设置视频图标或背景
...
@@ -74,8 +74,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
...
@@ -74,8 +74,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
Glide
.
with
(
holder
.
itemView
.
getContext
())
Glide
.
with
(
holder
.
itemView
.
getContext
())
.
asBitmap
()
.
asBitmap
()
.
load
(
fileInfo
.
getPath
())
.
load
(
fileInfo
.
getPath
())
.
placeholder
(
R
.
mipmap
.
h_appmanager
)
.
placeholder
(
R
.
mipmap
.
w_audio
)
.
error
(
R
.
mipmap
.
l_shipin
)
.
error
(
R
.
mipmap
.
w_audio
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
into
(
holder
.
img
);
.
into
(
holder
.
img
);
// 设置音频图标或背景
// 设置音频图标或背景
...
@@ -83,8 +83,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
...
@@ -83,8 +83,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
Glide
.
with
(
holder
.
itemView
.
getContext
())
Glide
.
with
(
holder
.
itemView
.
getContext
())
.
asBitmap
()
.
asBitmap
()
.
load
(
fileInfo
.
getPath
())
.
load
(
fileInfo
.
getPath
())
.
placeholder
(
R
.
mipmap
.
h_appmanager
)
.
placeholder
(
R
.
mipmap
.
l_doc
)
.
error
(
R
.
mipmap
.
w_audio
)
.
error
(
R
.
mipmap
.
l_doc
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
into
(
holder
.
img
);
.
into
(
holder
.
img
);
// 设置文档图标或背景
// 设置文档图标或背景
...
@@ -92,8 +92,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
...
@@ -92,8 +92,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
Glide
.
with
(
holder
.
itemView
.
getContext
())
Glide
.
with
(
holder
.
itemView
.
getContext
())
.
asBitmap
()
.
asBitmap
()
.
load
(
fileInfo
.
getPath
())
.
load
(
fileInfo
.
getPath
())
.
placeholder
(
R
.
mipmap
.
h_appmanager
)
.
placeholder
(
R
.
mipmap
.
l_apk
)
.
error
(
R
.
mipmap
.
l_
doc
)
.
error
(
R
.
mipmap
.
l_
apk
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
into
(
holder
.
img
);
.
into
(
holder
.
img
);
// 设置 APK 图标或背景
// 设置 APK 图标或背景
...
@@ -102,8 +102,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
...
@@ -102,8 +102,8 @@ public class LargeFileAdapter extends RecyclerView.Adapter<LargeFileAdapter.View
Glide
.
with
(
holder
.
itemView
.
getContext
())
Glide
.
with
(
holder
.
itemView
.
getContext
())
.
asBitmap
()
.
asBitmap
()
.
load
(
fileInfo
.
getPath
())
.
load
(
fileInfo
.
getPath
())
.
placeholder
(
R
.
mipmap
.
h_appmanag
er
)
.
placeholder
(
R
.
mipmap
.
l_oth
er
)
.
error
(
R
.
mipmap
.
l_
apk
)
.
error
(
R
.
mipmap
.
l_
other
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
20
)))
.
into
(
holder
.
img
);
.
into
(
holder
.
img
);
}
}
...
...
app/src/main/res/layout/activity_large_file.xml
View file @
16d805b5
...
@@ -70,7 +70,6 @@
...
@@ -70,7 +70,6 @@
android:layout_marginHorizontal=
"16dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"110dp"
android:layout_marginTop=
"110dp"
android:layout_marginBottom=
"100dp"
android:layout_marginBottom=
"100dp"
android:background=
"@color/white"
android:overScrollMode=
"never"
android:overScrollMode=
"never"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
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