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
a3352462
Commit
a3352462
authored
2 years ago
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整列表金额和详情金额逻辑一致
parent
e88d0595
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
65 additions
and
33 deletions
+65
-33
app/src/main/AndroidManifest.xml
+2
-2
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
+3
-1
app/src/main/java/com/ihaoin/hooloo/device/component/PushMessageReceiver.java
+34
-21
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
+1
-1
app/src/main/java/com/ihaoin/hooloo/device/view/MenuPresentation.java
+25
-8
app/src/main/res/mipmap-hdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-mdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-xhdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
+0
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
a3352462
...
...
@@ -19,11 +19,11 @@
<application
android:name=
".HLApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/
ic
_launcher"
android:icon=
"@mipmap/
hooloo
_launcher"
android:label=
"@string/app_name"
android:theme=
"@style/AppTheme"
android:usesCleartextTraffic=
"true"
tools:replace=
"android:allowBackup"
>
tools:replace=
"android:allowBackup
,android:icon
"
>
<activity
android:name=
".view.LauncherActivity"
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
View file @
a3352462
...
...
@@ -13,6 +13,7 @@ import com.umeng.commonsdk.UMConfigure;
import
cn.jpush.android.api.JPushInterface
;
public
class
HLApplication
extends
Application
{
public
static
HLApplication
SELF
=
null
;
private
static
MainData
mainData
=
new
MainData
();
public
static
MainData
getMainData
()
{
...
...
@@ -26,6 +27,7 @@ public class HLApplication extends Application {
@Override
public
void
onCreate
()
{
super
.
onCreate
();
HLApplication
.
SELF
=
this
;
UMConfigure
.
preInit
(
this
,
AppConfig
.
UMENG_APPKEY
,
AppConfig
.
UMENG_CHANNEL
);
UMConfigure
.
init
(
this
,
AppConfig
.
UMENG_APPKEY
,
AppConfig
.
UMENG_CHANNEL
,
0
,
null
);
...
...
@@ -35,7 +37,7 @@ public class HLApplication extends Application {
JPushInterface
.
init
(
this
);
String
registrationId
=
JPushInterface
.
getRegistrationID
(
this
);
Log
.
d
(
AppConfig
.
TAG_PUSH
,
registrationId
);
Log
.
d
(
AppConfig
.
TAG_PUSH
,
"get registrationId:"
+
registrationId
);
if
(!
StringUtils
.
isEmpty
(
registrationId
))
{
HttpUtil
.
postRegistrationId
(
registrationId
,
null
);
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/component/PushMessageReceiver.java
View file @
a3352462
...
...
@@ -35,7 +35,8 @@ public class PushMessageReceiver extends JPushMessageReceiver {
@Override
public
void
onMessage
(
Context
context
,
CustomMessage
customMessage
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMessage] "
+
customMessage
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMessage] "
+
customMessage
);
this
.
showToast
(
"onMessage"
);
dispatchMsg
(
customMessage
);
}
...
...
@@ -47,12 +48,12 @@ public class PushMessageReceiver extends JPushMessageReceiver {
JSONObject
jsonObject
=
JSON
.
parseObject
(
customMessage
.
message
);
String
action
=
jsonObject
.
getString
(
"action"
);
if
(
StringUtils
.
isEmpty
(
action
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"msg action is empty"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"msg action is empty"
);
return
;
}
Handler
handler
=
subscribers
.
get
(
action
);
if
(
handler
==
null
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
String
.
format
(
"msg action[%s] subscribers is empty"
,
action
));
Log
.
e
(
AppConfig
.
TAG_PUSH
,
String
.
format
(
"msg action[%s] subscribers is empty"
,
action
));
return
;
}
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
...
...
@@ -62,54 +63,72 @@ public class PushMessageReceiver extends JPushMessageReceiver {
@Override
public
void
onNotifyMessageOpened
(
Context
context
,
NotificationMessage
message
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageOpened] "
+
message
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageOpened] "
+
message
);
this
.
showToast
(
"onNotifyMessageOpened"
);
}
@Override
public
void
onMultiActionClicked
(
Context
context
,
Intent
intent
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击了通知栏按钮"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击了通知栏按钮"
);
this
.
showToast
(
"onMultiActionClicked"
);
String
nActionExtra
=
intent
.
getExtras
().
getString
(
JPushInterface
.
EXTRA_NOTIFICATION_ACTION_EXTRA
);
//开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
if
(
nActionExtra
==
null
)
{
Log
.
d
(
AppConfig
.
TAG_PUSH
,
"ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null"
);
Log
.
d
(
AppConfig
.
TAG_PUSH
,
"ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null"
);
return
;
}
if
(
nActionExtra
.
equals
(
"my_extra1"
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮一"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮一"
);
}
else
if
(
nActionExtra
.
equals
(
"my_extra2"
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮二"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮二"
);
}
else
if
(
nActionExtra
.
equals
(
"my_extra3"
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮三"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮三"
);
}
else
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮未定义"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮未定义"
);
}
}
@Override
public
void
onNotifyMessageArrived
(
Context
context
,
NotificationMessage
message
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageArrived] "
+
message
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageArrived] "
+
message
);
this
.
showToast
(
"onNotifyMessageArrived"
);
}
@Override
public
void
onNotifyMessageDismiss
(
Context
context
,
NotificationMessage
message
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageDismiss] "
+
message
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageDismiss] "
+
message
);
this
.
showToast
(
"onNotifyMessageDismiss"
);
}
@Override
public
void
onRegister
(
Context
context
,
String
registrationId
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onRegister] "
+
registrationId
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onRegister] "
+
registrationId
);
HttpUtil
.
postRegistrationId
(
registrationId
,
null
);
this
.
showToast
(
"onRegister"
);
}
@Override
public
void
onConnected
(
Context
context
,
boolean
isConnected
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onConnected] "
+
isConnected
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onConnected] "
+
isConnected
);
this
.
showToast
(
"onConnected"
);
}
@Override
public
void
onCommandResult
(
Context
context
,
CmdMessage
cmdMessage
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onCommandResult] "
+
cmdMessage
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onCommandResult] "
+
cmdMessage
);
this
.
showToast
(
"onCommandResult"
);
}
@Override
public
void
onNotificationSettingsCheck
(
Context
context
,
boolean
isOn
,
int
source
)
{
super
.
onNotificationSettingsCheck
(
context
,
isOn
,
source
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotificationSettingsCheck] isOn:"
+
isOn
+
",source:"
+
source
);
this
.
showToast
(
"onNotificationSettingsCheck"
);
}
private
void
showToast
(
String
content
)
{
// Toast.makeText(HLApplication.SELF, content, Toast.LENGTH_SHORT).show();
}
@Override
...
...
@@ -135,10 +154,4 @@ public class PushMessageReceiver extends JPushMessageReceiver {
// TagAliasOperatorHelper.getInstance().onMobileNumberOperatorResult(context,jPushMessage);
super
.
onMobileNumberOperatorResult
(
context
,
jPushMessage
);
}
@Override
public
void
onNotificationSettingsCheck
(
Context
context
,
boolean
isOn
,
int
source
)
{
super
.
onNotificationSettingsCheck
(
context
,
isOn
,
source
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotificationSettingsCheck] isOn:"
+
isOn
+
",source:"
+
source
);
}
}
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
View file @
a3352462
...
...
@@ -133,7 +133,7 @@ public class Utils {
}
public
static
String
toString
(
BigDecimal
num
)
{
DecimalFormat
df
=
new
DecimalFormat
(
"
#
.00"
);
DecimalFormat
df
=
new
DecimalFormat
(
"
0
.00"
);
return
df
.
format
(
num
);
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ihaoin/hooloo/device/view/MenuPresentation.java
View file @
a3352462
...
...
@@ -104,7 +104,7 @@ public class MenuPresentation extends Presentation {
Utils
.
getGlide
(
getContext
()).
load
(
mainData
.
getImages
().
getLeft
()).
into
(
imgLeft
);
}
if
(
mainData
.
getShopState
().
equals
(
0
))
{
if
(
mainData
.
getShopState
().
equals
(
Base
.
FALSE
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
CLOSED
.
getCode
())).
into
(
imgRight
);
}
else
if
(!
CollectionUtils
.
isEmpty
(
cookingOrders
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
COOKING
.
getCode
())).
into
(
imgRight
);
...
...
@@ -236,23 +236,40 @@ public class MenuPresentation extends Presentation {
return
;
}
// 添加新订单状态
pkgs
.
forEach
(
pkg
->
{
if
(!
pkg
.
getState
().
equals
(
order
.
getState
()))
{
return
;
}
OrderPkg
pkg
=
getOrdersByState
(
pkgs
,
order
.
getState
());
if
(
pkg
==
null
)
{
List
<
Order
>
orders
=
new
ArrayList
<>();
orders
.
add
(
order
);
pkg
=
new
OrderPkg
();
pkg
.
setState
(
order
.
getState
());
pkg
.
setOrders
(
orders
);
pkgs
.
add
(
pkg
);
}
else
{
List
<
Order
>
orders
=
pkg
.
getOrders
();
if
(
CollectionUtils
.
isEmpty
(
orders
))
{
orders
=
new
ArrayList
<>();
}
orders
.
add
(
order
);
pkg
.
setOrders
(
orders
);
}
);
}
}
orderDataChanged
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
orderDataChanged
();
}
}
}
private
OrderPkg
getOrdersByState
(
List
<
OrderPkg
>
pkgs
,
Integer
state
)
{
if
(
CollectionUtils
.
isEmpty
(
pkgs
))
{
return
null
;
}
for
(
OrderPkg
pkg
:
pkgs
)
{
if
(
pkg
.
getState
().
equals
(
state
))
{
return
pkg
;
}
}
return
null
;
}
}
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
2.89 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
4.79 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
2.01 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
2.72 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
4.38 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
6.73 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
6.24 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
10.2 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
8.91 KB
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
14.8 KB
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