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
f6203fad
Commit
f6203fad
authored
2 years ago
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、优化增加空闲弹窗
2、KDS增加视频支持
parent
15a99390
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
7 deletions
+56
-7
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
+2
-0
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
+8
-2
app/src/main/java/com/ihaoin/hooloo/device/view/MenuPresentation.java
+33
-4
app/src/main/java/com/ihaoin/hooloo/device/view/TipsDialog.java
+5
-1
app/src/main/res/layout/activity_menu.xml
+8
-0
No files found.
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
View file @
f6203fad
...
...
@@ -88,6 +88,7 @@ public class GoodsDetailDialog extends Dialog {
this
.
setContentView
(
R
.
layout
.
view_goods_detail
);
initViews
();
regsitTimeoutReceiver
();
LauncherActivity
.
IN_MAIN
=
false
;
}
@Override
...
...
@@ -221,6 +222,7 @@ public class GoodsDetailDialog extends Dialog {
pagerThread
=
null
;
}
unregsitTimeoutReceiver
();
LauncherActivity
.
IN_MAIN
=
true
;
}
};
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/view/LauncherActivity.java
View file @
f6203fad
...
...
@@ -703,6 +703,7 @@ public class LauncherActivity extends Activity {
public
static
Long
TIMESTAMP
=
System
.
currentTimeMillis
();
public
static
Boolean
TIMEOUT_TOGGLE
=
true
;
public
static
Boolean
IN_MAIN
=
true
;
/** 判断空闲时间定时器 */
private
class
TimeoutThread
extends
Thread
{
...
...
@@ -712,12 +713,17 @@ public class LauncherActivity extends Activity {
try
{
while
(
true
)
{
Thread
.
sleep
(
1000
);
if
(!
TIMEOUT_TOGGLE
||
HLApplication
.
getGoodsCount
()
<=
0
)
{
// 打开确认订单弹窗,停止判断空闲
if
(!
TIMEOUT_TOGGLE
||
(
IN_MAIN
&&
HLApplication
.
getGoodsCount
()
<=
0
))
{
// 打开确认订单弹窗,停止判断空闲 或 在首页,但购物车没有商品
TIMESTAMP
=
Utils
.
getTimestamp
();
continue
;
}
// if (!IN_MAIN) {
// TIMESTAMP = Utils.getTimestamp();
// continue;
// }
// Log.i(AppConfig.TAG, String.valueOf(Utils.getTimestamp() - TIMESTAMP));
if
(
Utils
.
getTimestamp
()
-
TIMESTAMP
>
1000
*
30
)
{
if
(
Utils
.
getTimestamp
()
-
TIMESTAMP
>
1000
*
5
)
{
TIMESTAMP
=
Utils
.
getTimestamp
();
// Utils.fastBroadcast(HLApplication.SELF, Base.BROADCAST_ACTION_CLEAR_GOODS);
// Utils.fastBroadcast(HLApplication.SELF, Base.BROADCAST_ACTION_TIMEOUT);
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/view/MenuPresentation.java
View file @
f6203fad
...
...
@@ -8,8 +8,10 @@ import android.content.IntentFilter;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.view.Display
;
import
android.view.View
;
import
android.widget.GridView
;
import
android.widget.ImageView
;
import
android.widget.VideoView
;
import
androidx.annotation.NonNull
;
...
...
@@ -48,6 +50,7 @@ public class MenuPresentation extends Presentation {
private
ImageView
imgLeft
;
private
ImageView
imgRight
;
private
VideoView
vidRight
;
private
GridView
gridCooking
;
private
GridView
gridWaiting
;
private
GridView
gridCompleted
;
...
...
@@ -72,6 +75,7 @@ public class MenuPresentation extends Presentation {
private
void
initViews
()
{
imgLeft
=
findViewById
(
R
.
id
.
img_left
);
imgRight
=
findViewById
(
R
.
id
.
img_right
);
vidRight
=
findViewById
(
R
.
id
.
vid_right
);
gridCooking
=
findViewById
(
R
.
id
.
grid_cooking
);
gridWaiting
=
findViewById
(
R
.
id
.
grid_waiting
);
gridCompleted
=
findViewById
(
R
.
id
.
grid_completed
);
...
...
@@ -105,14 +109,39 @@ public class MenuPresentation extends Presentation {
Utils
.
getGlide
(
getContext
()).
load
(
mainData
.
getImages
().
getLeft
()).
into
(
imgLeft
);
}
String
url
=
""
;
if
(
mainData
.
getShopState
().
equals
(
Base
.
FALSE
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
CLOSED
.
getCode
())).
into
(
imgRight
);
url
=
getRightImage
(
ImageState
.
CLOSED
.
getCode
()
);
}
else
if
(!
CollectionUtils
.
isEmpty
(
cookingOrders
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
COOKING
.
getCode
())).
into
(
imgRight
);
url
=
getRightImage
(
ImageState
.
COOKING
.
getCode
()
);
}
else
if
(!
CollectionUtils
.
isEmpty
(
completedOrders
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
COMPLETED
.
getCode
())).
into
(
imgRight
);
url
=
getRightImage
(
ImageState
.
COMPLETED
.
getCode
()
);
}
else
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
NOT_COMPLETED
.
getCode
())).
into
(
imgRight
);
url
=
getRightImage
(
ImageState
.
NOT_COMPLETED
.
getCode
());
}
if
(
StringUtils
.
isEmpty
(
url
))
{
vidRight
.
pause
();
vidRight
.
setVisibility
(
View
.
INVISIBLE
);
imgRight
.
setVisibility
(
View
.
INVISIBLE
);
return
;
}
// url = "http://songclound.oss-cn-hongkong.aliyuncs.com/2022/06/27/e6582afb60924.mp4";
if
(
url
.
substring
(
url
.
lastIndexOf
(
"."
)).
equalsIgnoreCase
(
".mp4"
))
{
vidRight
.
setVisibility
(
View
.
VISIBLE
);
imgRight
.
setVisibility
(
View
.
GONE
);
vidRight
.
setOnPreparedListener
(
mp
->
{
mp
.
start
();
mp
.
setLooping
(
true
);
});
vidRight
.
setVideoPath
(
url
);
vidRight
.
requestFocus
();
vidRight
.
start
();
}
else
{
vidRight
.
pause
();
vidRight
.
setVisibility
(
View
.
GONE
);
imgRight
.
setVisibility
(
View
.
VISIBLE
);
Utils
.
getGlide
(
getContext
()).
load
(
url
).
into
(
imgRight
);
}
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/view/TipsDialog.java
View file @
f6203fad
...
...
@@ -40,6 +40,7 @@ public class TipsDialog extends Dialog {
}
initViews
();
regsitTimeoutReceiver
();
LauncherActivity
.
IN_MAIN
=
false
;
}
private
void
initViews
()
{
...
...
@@ -65,7 +66,10 @@ public class TipsDialog extends Dialog {
return
super
.
dispatchTouchEvent
(
ev
);
}
OnDismissListener
dismissListener
=
dialog
->
unregsitTimeoutReceiver
();
OnDismissListener
dismissListener
=
dialog
->
{
unregsitTimeoutReceiver
();
LauncherActivity
.
IN_MAIN
=
true
;
};
private
TimeoutReceiver
timeoutReceiver
;
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_menu.xml
View file @
f6203fad
...
...
@@ -135,5 +135,12 @@
android:layout_weight=
"0.5"
android:adjustViewBounds=
"true"
android:scaleType=
"centerCrop"
/>
<VideoView
android:id=
"@+id/vid_right"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"0.5"
android:adjustViewBounds=
"true"
android:scaleType=
"centerCrop"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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