Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
android
machine
Commits
ae173688
Commit
ae173688
authored
Jun 28, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加空闲时间清空购物车,并回到首页
parent
83340ba8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
app/src/main/java/com/ihaoin/hooloo/device/view/ConfirmOrderDialog.java
+2
-0
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
+7
-1
No files found.
app/src/main/java/com/ihaoin/hooloo/device/view/ConfirmOrderDialog.java
View file @
ae173688
...
...
@@ -83,6 +83,7 @@ public class ConfirmOrderDialog extends Dialog {
super
.
onCreate
(
savedInstanceState
);
this
.
setContentView
(
R
.
layout
.
view_confirm_order
);
initViews
();
LauncherActivity
.
TIMEOUT_TOGGLE
=
false
;
}
private
void
initViews
()
{
...
...
@@ -171,6 +172,7 @@ public class ConfirmOrderDialog extends Dialog {
OnDismissListener
dismissListener
=
new
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialog
)
{
LauncherActivity
.
TIMEOUT_TOGGLE
=
true
;
Utils
.
fastBroadcast
(
getContext
(),
Base
.
BROADCAST_ACTION_CLEAR_GOODS
);
if
(
expireThread
!=
null
)
{
expireThread
.
interrupt
();
...
...
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
View file @
ae173688
...
...
@@ -700,6 +700,8 @@ public class LauncherActivity extends Activity {
}
public
static
Long
TIMESTAMP
=
System
.
currentTimeMillis
();
public
static
Boolean
TIMEOUT_TOGGLE
=
true
;
/** 判断空闲时间定时器 */
private
class
TimeoutThread
extends
Thread
{
@Override
...
...
@@ -708,8 +710,12 @@ public class LauncherActivity extends Activity {
try
{
while
(
true
)
{
Thread
.
sleep
(
1000
);
if
(!
TIMEOUT_TOGGLE
)
{
// 打开确认订单弹窗,停止判断空闲
TIMESTAMP
=
Utils
.
getTimestamp
();
continue
;
}
Log
.
i
(
AppConfig
.
TAG
,
String
.
valueOf
(
Utils
.
getTimestamp
()
-
TIMESTAMP
));
if
(
Utils
.
getTimestamp
()
-
TIMESTAMP
>
1000
*
5
)
{
if
(
Utils
.
getTimestamp
()
-
TIMESTAMP
>
1000
*
30
)
{
TIMESTAMP
=
Utils
.
getTimestamp
();
Utils
.
fastBroadcast
(
HLApplication
.
SELF
,
Base
.
BROADCAST_ACTION_CLEAR_GOODS
);
Utils
.
fastBroadcast
(
HLApplication
.
SELF
,
Base
.
BROADCAST_ACTION_TIMEOUT
);
...
...
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