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
4fb53f34
Commit
4fb53f34
authored
Dec 20, 2024
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b34368cc
Pipeline
#1374
canceled with stages
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
17 deletions
+27
-17
StartActivity.java
.../com/swiftcleaner/chovey/view/activity/StartActivity.java
+25
-16
NonBlockingCountdown.java
app/src/main/java/com/zxdemo/utils/NonBlockingCountdown.java
+1
-0
TimeOut.java
app/src/main/java/com/zxdemo/utils/TimeOut.java
+1
-1
No files found.
app/src/main/java/com/swiftcleaner/chovey/view/activity/StartActivity.java
View file @
4fb53f34
...
@@ -21,6 +21,8 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
...
@@ -21,6 +21,8 @@ import com.swiftcleaner.chovey.model.tool.ToastUtil;
import
com.swiftcleaner.chovey.model.util.PermissionUtils
;
import
com.swiftcleaner.chovey.model.util.PermissionUtils
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.zxdemo.admob.AdmobHelper
;
import
com.zxdemo.admob.AdmobHelper
;
import
com.zxdemo.utils.NonBlockingCountdown
;
import
com.zxdemo.utils.TimeOut
;
import
java.util.function.Function
;
import
java.util.function.Function
;
...
@@ -32,6 +34,12 @@ public class StartActivity extends AppCompatActivity {
...
@@ -32,6 +34,12 @@ public class StartActivity extends AppCompatActivity {
private
SharedPreferences
sharedPreferences
;
private
SharedPreferences
sharedPreferences
;
private
ActivityResultLauncher
<
String
[]>
multiplePermissionsLauncher
;
private
ActivityResultLauncher
<
String
[]>
multiplePermissionsLauncher
;
private
ActivityResultLauncher
<
Intent
>
notificationSettingsLauncher
;
private
ActivityResultLauncher
<
Intent
>
notificationSettingsLauncher
;
private
NonBlockingCountdown
nonBlockingCountdown
=
new
NonBlockingCountdown
(
5
,
new
TimeOut
()
{
@Override
public
void
timeOut
()
{
goToMainActivity
();
}
});
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -41,11 +49,12 @@ public class StartActivity extends AppCompatActivity {
...
@@ -41,11 +49,12 @@ public class StartActivity extends AppCompatActivity {
setContentView
(
view
);
setContentView
(
view
);
initBar
();
initBar
();
initPermission
();
initPermission
();
nonBlockingCountdown
.
start
();
sharedPreferences
=
getSharedPreferences
(
"AppPreferences"
,
MODE_PRIVATE
);
sharedPreferences
=
getSharedPreferences
(
"AppPreferences"
,
MODE_PRIVATE
);
boolean
isFirstTime
=
sharedPreferences
.
getBoolean
(
"isFirstTime"
,
true
);
boolean
isFirstTime
=
sharedPreferences
.
getBoolean
(
"isFirstTime"
,
true
);
//广告
//广告
initAdvertisement
();
//
initAdvertisement();
if
(!
isFirstTime
)
{
if
(!
isFirstTime
)
{
//点击过start
//点击过start
binding
.
startId
.
setVisibility
(
View
.
GONE
);
binding
.
startId
.
setVisibility
(
View
.
GONE
);
...
@@ -152,21 +161,21 @@ public class StartActivity extends AppCompatActivity {
...
@@ -152,21 +161,21 @@ public class StartActivity extends AppCompatActivity {
// 在这里执行第三方 SDK 的初始化和其他数据读取操作
// 在这里执行第三方 SDK 的初始化和其他数据读取操作
}
}
private
void
initAdvertisement
()
{
//
private void initAdvertisement() {
AdmobHelper
.
INSTANCE
.
showAppOpenAd
(
this
,
//
AdmobHelper.INSTANCE.showAppOpenAd(this,
()
->
{
//
() -> {
goToMainActivity
();
//
goToMainActivity();
return
null
;
//
return null;
},
//
},
()
->
{
//
() -> {
return
null
;
//
return null;
},
//
},
()
->
{
//
() -> {
return
null
;
//
return null;
}
//
}
//
);
//
);
}
//
}
private
void
setupAgreementTextView
()
{
private
void
setupAgreementTextView
()
{
binding
.
userAgreement
.
setOnClickListener
(
v
->
{
binding
.
userAgreement
.
setOnClickListener
(
v
->
{
...
...
app/src/main/java/com/zxdemo/utils/NonBlockingCountdown.java
View file @
4fb53f34
...
@@ -18,6 +18,7 @@ public class NonBlockingCountdown {
...
@@ -18,6 +18,7 @@ public class NonBlockingCountdown {
if
(
seconds
>
0
)
{
if
(
seconds
>
0
)
{
seconds
--;
seconds
--;
// 在这里更新UI,显示剩余时间
// 在这里更新UI,显示剩余时间
handler
.
postDelayed
(
countdownRunnable
,
COUNTDOWN_INTERVAL
);
}
else
{
}
else
{
// 倒计时结束,可以在这里做一些操作,比如通知用户
// 倒计时结束,可以在这里做一些操作,比如通知用户
handler
.
removeCallbacks
(
this
);
handler
.
removeCallbacks
(
this
);
...
...
app/src/main/java/com/zxdemo/utils/TimeOut.java
View file @
4fb53f34
package
com
.
zxdemo
.
utils
;
package
com
.
zxdemo
.
utils
;
interface
TimeOut
{
public
interface
TimeOut
{
abstract
void
timeOut
();
abstract
void
timeOut
();
}
}
\ 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