Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peanut-sample
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘立
peanut-sample
Commits
39fccf6e
Commit
39fccf6e
authored
Nov 29, 2018
by
llxqb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
擎朗机器人第一个版本提交
parent
5de9c7a8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
151 additions
and
95 deletions
+151
-95
app/src/main/AndroidManifest.xml
+1
-1
app/src/main/java/peanut/keenon/com/action/RobotServiceAction.java
+2
-1
app/src/main/java/peanut/keenon/com/network/BaseAction.java
+1
-1
app/src/main/java/peanut/keenon/com/network/NetworkListener.java
+1
-1
app/src/main/java/peanut/keenon/com/peanutsample/DinnerActivity.java
+93
-22
app/src/main/java/peanut/keenon/com/peanutsample/FaceActivity.java
+4
-0
app/src/main/java/peanut/keenon/com/peanutsample/MainActivity.java
+4
-0
app/src/main/java/peanut/keenon/com/util/AppConstant.java
+8
-1
app/src/main/java/peanut/keenon/com/util/DinnerUtil.java
+12
-16
app/src/main/res/layout/activity_dinner.xml
+23
-50
app/src/main/res/mipmap-xhdpi/logo_ql.png
+0
-0
app/src/main/res/values/strings.xml
+2
-2
No files found.
app/src/main/AndroidManifest.xml
View file @
39fccf6e
...
...
@@ -27,7 +27,7 @@
<application
android:name=
".RobotApp"
android:allowBackup=
"true"
android:icon=
"@mipmap/
ic_launcher
"
android:icon=
"@mipmap/
logo_ql
"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
...
...
app/src/main/java/peanut/keenon/com/action/RobotServiceAction.java
View file @
39fccf6e
...
...
@@ -21,7 +21,8 @@ import peanut.keenon.com.network.WebApiRequest;
public
class
RobotServiceAction
extends
BaseAction
<
WebResponse
>
{
private
static
final
String
O2O_URL_ADDRESS
=
"http://111.231.64.247/api"
;
private
static
final
String
O2O_URL_ADDRESS
=
"http://waimaiapitest.freemudorder.com/api"
;
// private static final String O2O_URL_ADDRESS = "http://111.231.64.247/api";
@Override
public
void
startLoad
()
throws
JSONException
{
...
...
app/src/main/java/peanut/keenon/com/network/BaseAction.java
View file @
39fccf6e
...
...
@@ -68,7 +68,7 @@ public class BaseAction<T> implements Response.Listener<T>, Response.ErrorListen
this
.
mErrorListener
=
mErrorListener
;
}
public
void
setSucceedListener
(
NetworkListener
.
Succeed
<
T
>
mSucceedListener
)
{
public
void
setSucceedListener
(
NetworkListener
.
Succeed
<
T
>
mSucceedListener
,
NetworkListener
.
Error
<
String
>
error
)
{
this
.
mSucceedListener
=
mSucceedListener
;
}
...
...
app/src/main/java/peanut/keenon/com/network/NetworkListener.java
View file @
39fccf6e
...
...
@@ -9,7 +9,7 @@ public class NetworkListener<T> {
void
onRequestSucceed
(
T
data
,
int
index
);
}
public
interface
Error
{
public
interface
Error
<
T
>
{
void
onErrorHappened
(
String
errorCode
,
String
errorMessage
);
}
...
...
app/src/main/java/peanut/keenon/com/peanutsample/DinnerActivity.java
View file @
39fccf6e
This diff is collapsed.
Click to expand it.
app/src/main/java/peanut/keenon/com/peanutsample/FaceActivity.java
View file @
39fccf6e
...
...
@@ -123,6 +123,10 @@ public class FaceActivity extends AppCompatActivity implements CameraBridgeViewB
//mFaceSerialCount = -5000;
}
}
},
new
NetworkListener
.
Error
<
String
>()
{
@Override
public
void
onErrorHappened
(
String
errorCode
,
String
errorMessage
)
{
}
});
setWebRequestLoding
(
imageService
);
}
...
...
app/src/main/java/peanut/keenon/com/peanutsample/MainActivity.java
View file @
39fccf6e
...
...
@@ -211,6 +211,10 @@ public class MainActivity extends Activity {
public
void
onRequestSucceed
(
WebResponse
data
,
int
index
)
{
}
},
new
NetworkListener
.
Error
<
String
>()
{
@Override
public
void
onErrorHappened
(
String
errorCode
,
String
errorMessage
)
{
}
});
mAction
.
setErrorListener
(
new
NetworkListener
.
Error
()
{
...
...
app/src/main/java/peanut/keenon/com/util/AppConstant.java
View file @
39fccf6e
...
...
@@ -10,5 +10,12 @@ public class AppConstant {
/**
* 机器人初始点位
*/
public
static
final
int
INIT_POINT
=
0
;
public
static
final
int
INIT_POINT
=
60006
;
/**
* 登陆信息
*/
public
static
final
String
LOGIN_USERNAME
=
"ql_pos_Keenon001"
;
public
static
final
String
LOGIN_PASSWORD
=
"posoperator@freemud.cn"
;
}
app/src/main/java/peanut/keenon/com/util/DinnerUtil.java
View file @
39fccf6e
...
...
@@ -7,22 +7,18 @@ package peanut.keenon.com.util;
public
class
DinnerUtil
{
public
static
String
tranPointName
(
int
point
){
String
pointName
=
null
;
if
(
point
==
1
){
pointName
=
"一号餐桌"
;
}
else
if
(
point
==
2
){
pointName
=
"二号餐桌"
;
}
else
if
(
point
==
3
){
pointName
=
"三号餐桌"
;
}
else
if
(
point
==
4
){
pointName
=
"四号餐桌"
;
}
else
if
(
point
==
5
){
pointName
=
"五号餐桌"
;
}
else
if
(
point
==
6
){
pointName
=
"六号餐桌"
;
}
else
if
(
point
==
7
){
pointName
=
"七号餐桌"
;
}
else
if
(
point
==
8
){
pointName
=
"八号餐桌"
;
if
(
point
==
60006
){
pointName
=
"返回中"
;
}
else
if
(
point
==
81
){
pointName
=
"送餐中:一号餐桌"
;
}
else
if
(
point
==
82
){
pointName
=
"送餐中:二号餐桌"
;
}
else
if
(
point
==
83
){
pointName
=
"送餐中:三号餐桌"
;
}
else
if
(
point
==
84
){
pointName
=
"送餐中:四号餐桌"
;
}
else
if
(
point
==
85
){
pointName
=
"送餐中:五号餐桌"
;
}
return
pointName
;
}
...
...
app/src/main/res/layout/activity_dinner.xml
View file @
39fccf6e
...
...
@@ -22,9 +22,9 @@
<ImageView
android:id=
"@+id/merchantLogo"
android:layout_width=
"@dimen/dp_
5
0"
android:layout_height=
"@dimen/dp_
5
0"
android:src=
"@
drawable/md
"
/>
android:layout_width=
"@dimen/dp_
6
0"
android:layout_height=
"@dimen/dp_
6
0"
android:src=
"@
mipmap/logo_ql
"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -54,7 +54,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"bottom"
android:text=
"机器人
壹号
- 可可小爱"
android:text=
"机器人 - 可可小爱"
android:textColor=
"@color/colorNormal"
android:textSize=
"@dimen/sp_14"
/>
</LinearLayout>
...
...
@@ -82,7 +82,7 @@
android:paddingBottom=
"@dimen/dp_10"
>
<RadioButton
android:id=
"@+id/
btn1
"
android:id=
"@+id/
start_point_rb
"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
...
...
@@ -90,27 +90,13 @@
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"
1
"
android:text=
"
一号餐桌
"
android:tag=
"
60006
"
android:text=
"
服务台
"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/btn2"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"2"
android:text=
"二号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/btn3"
android:id=
"@+id/btn1"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
...
...
@@ -118,13 +104,13 @@
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"
3
"
android:text=
"
三
号餐桌"
android:tag=
"
81
"
android:text=
"
一
号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/btn
4
"
android:id=
"@+id/btn
2
"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
...
...
@@ -132,13 +118,13 @@
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"
4
"
android:text=
"
四
号餐桌"
android:tag=
"
82
"
android:text=
"
二
号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/btn
5
"
android:id=
"@+id/btn
3
"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
...
...
@@ -146,13 +132,13 @@
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"
5
"
android:text=
"
五
号餐桌"
android:tag=
"
83
"
android:text=
"
三
号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/btn
6
"
android:id=
"@+id/btn
4
"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
...
...
@@ -160,13 +146,13 @@
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"
6
"
android:text=
"
六
号餐桌"
android:tag=
"
84
"
android:text=
"
四
号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/bt
7
"
android:id=
"@+id/bt
n5
"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
...
...
@@ -174,24 +160,11 @@
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"
7
"
android:text=
"
七
号餐桌"
android:tag=
"
85
"
android:text=
"
五
号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
<RadioButton
android:id=
"@+id/btn8"
android:layout_width=
"@dimen/dp_90"
android:layout_height=
"@dimen/dp_35"
android:layout_marginStart=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:background=
"@drawable/radiobutton_background"
android:button=
"@null"
android:gravity=
"center"
android:tag=
"8"
android:text=
"八号餐桌"
android:textColor=
"@color/radiobutton_textcolor"
android:textSize=
"@dimen/sp_14"
/>
</peanut.keenon.com.control.RadioGroupEx>
...
...
@@ -202,7 +175,7 @@
android:padding=
"@dimen/dp_10"
android:text=
"@string/dinner_table_hint"
android:textColor=
"@color/colorNormal"
android:textSize=
"@dimen/sp_1
1
"
/>
android:textSize=
"@dimen/sp_1
2
"
/>
</LinearLayout>
...
...
app/src/main/res/mipmap-xhdpi/logo_ql.png
0 → 100644
View file @
39fccf6e
12.2 KB
app/src/main/res/values/strings.xml
View file @
39fccf6e
<resources>
<string
name=
"app_id"
>
5af25aee
</string>
<string
name=
"app_name"
>
PeanutSample
</string>
<string
name=
"app_name"
>
擎朗机器人
</string>
<string
name=
"auto_pilot_pause"
>
暂停导航
</string>
<string
name=
"auto_pilot"
>
自动导航
</string>
<string
name=
"auto_pilot_resume"
>
继续导航
</string>
...
...
@@ -18,5 +18,5 @@
<string
name=
"dinner_left_table"
>
2
</string>
<string
name=
"dinner_right_table"
>
3
</string>
<string
name=
"dinner_table_have_check"
>
已经被选择,请选择其它餐桌
</string>
<string
name=
"dinner_table_hint"
>
机器人会按右侧餐桌顺序送餐
</string>
<string
name=
"dinner_table_hint"
>
请选择餐桌号,
机器人会按右侧餐桌顺序送餐
</string>
</resources>
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