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
224f2e00
Commit
224f2e00
authored
Jan 05, 2025
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
正式包
parent
369139ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
BatteryInfoActivity.java
...wiftcleaner/chovey/view/activity/BatteryInfoActivity.java
+11
-8
SettingActivity.java
...om/swiftcleaner/chovey/view/activity/SettingActivity.java
+9
-8
activity_setting.xml
app/src/main/res/layout/activity_setting.xml
+1
-0
No files found.
app/src/main/java/com/swiftcleaner/chovey/view/activity/BatteryInfoActivity.java
View file @
224f2e00
...
@@ -8,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
...
@@ -8,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
;
...
@@ -121,16 +122,18 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
...
@@ -121,16 +122,18 @@ public class BatteryInfoActivity extends BaseActivity<ActivityBatteryInfoBinding
}
}
private
void
requestFilesAccessPermission
()
{
private
void
requestFilesAccessPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
else
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
// 在Android 10及以下版本,请求READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE权限
try
{
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
REQUEST_PERMISSION_CODE
);
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
REQUEST_ALL_FILES_ACCESS_PERMISSION
);
}
catch
(
ActivityNotFoundException
e
)
{
Toast
.
makeText
(
this
,
"Activity not found"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
}
@Override
@Override
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/SettingActivity.java
View file @
224f2e00
...
@@ -60,14 +60,15 @@ public class SettingActivity extends AppCompatActivity {
...
@@ -60,14 +60,15 @@ public class SettingActivity extends AppCompatActivity {
String
token
=
SPUtils
.
Companion
.
getInstance
().
getString
(
"token"
,
""
);
String
token
=
SPUtils
.
Companion
.
getInstance
().
getString
(
"token"
,
""
);
Log
.
d
(
"setting_token"
,
token
);
Log
.
d
(
"setting_token"
,
token
);
binding
.
settingTitle
.
setOnClickListener
(
v
->{
// binding.settingTitle.setOnClickListener(v->{
if
(!
token
.
isEmpty
()){
// binding.settingToken.setVisibility(View.VISIBLE);
binding
.
settingToken
.
setText
(
token
);
// if (!token.isEmpty()){
copyTextToClipboard
(
token
);
// binding.settingToken.setText(token);
}
else
{
// copyTextToClipboard(token);
Toast
.
makeText
(
this
,
"token为空"
,
Toast
.
LENGTH_SHORT
).
show
();
// }else {
}
// Toast.makeText(this, "token为空", Toast.LENGTH_SHORT).show();
});
// }
// });
}
}
private
void
showCustomDialog
()
{
private
void
showCustomDialog
()
{
...
...
app/src/main/res/layout/activity_setting.xml
View file @
224f2e00
...
@@ -210,5 +210,6 @@
...
@@ -210,5 +210,6 @@
android:gravity=
"center"
android:gravity=
"center"
android:text=
"token"
android:text=
"token"
android:textSize=
"20sp"
android:textSize=
"20sp"
android:visibility=
"gone"
app:layout_constraintTop_toBottomOf=
"@id/setting_cl3"
/>
app:layout_constraintTop_toBottomOf=
"@id/setting_cl3"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment