Commit 25561d28 by llxqb

优化代码(删除多余引用)

parent d7e437bc
...@@ -7,6 +7,7 @@ import android.media.MediaPlayer; ...@@ -7,6 +7,7 @@ import android.media.MediaPlayer;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
...@@ -71,13 +72,17 @@ public class DinnerActivity extends Activity { ...@@ -71,13 +72,17 @@ public class DinnerActivity extends Activity {
private static final int SCAN_REQUEST_CODE = 0x400; private static final int SCAN_REQUEST_CODE = 0x400;
private static final int FACE_DETECT_REQUEST_CODE = 0x401; private static final int FACE_DETECT_REQUEST_CODE = 0x401;
/**
* 返回的条形码数字
*/
private String mAuthCode = null; private String mAuthCode = null;
private String mOpenId = null; private String mOpenId = null;
private enum RobotStatus{ private enum RobotStatus {
NORMAL, NORMAL,
WALKING WALKING
} }
//xunfei appid = 5af25aee //xunfei appid = 5af25aee
private static final String TAG = "ROBOT"; private static final String TAG = "ROBOT";
...@@ -118,6 +123,9 @@ public class DinnerActivity extends Activity { ...@@ -118,6 +123,9 @@ public class DinnerActivity extends Activity {
private int mCurrentPath = 0; private int mCurrentPath = 0;
private int mCurrentIndex = 0; private int mCurrentIndex = 0;
/**
* 导航目标点集合
*/
private List targetData = new ArrayList(); private List targetData = new ArrayList();
//XUNFEI VOICE //XUNFEI VOICE
...@@ -129,7 +137,7 @@ public class DinnerActivity extends Activity { ...@@ -129,7 +137,7 @@ public class DinnerActivity extends Activity {
private String voicer = "xiaofang"; //nannan private String voicer = "xiaofang"; //nannan
private String[] mCloudVoicersEntries; private String[] mCloudVoicersEntries;
private String[] mCloudVoicersValue ; private String[] mCloudVoicersValue;
// 缓冲进度 // 缓冲进度
private int mPercentForBuffering = 0; private int mPercentForBuffering = 0;
...@@ -161,44 +169,52 @@ public class DinnerActivity extends Activity { ...@@ -161,44 +169,52 @@ public class DinnerActivity extends Activity {
setContentView(R.layout.activity_dinner); setContentView(R.layout.activity_dinner);
mContext = this; mContext = this;
log.d(TAG, "autoPilotResume");
//initialize robot relative interface //initialize robot relative interface
initXunfei(); initXunfei();
initRobot(); initRobot();
initApp(); initApp();
tvStoreName = (TextView)findViewById(R.id.store_name); tvStoreName = findViewById(R.id.store_name);
tvStoreAddress = (TextView)findViewById(R.id.store_address); tvStoreAddress = findViewById(R.id.store_address);
tvRobotWorkMode = (TextView)findViewById(R.id.robot_work_mode); tvRobotWorkMode = findViewById(R.id.robot_work_mode);
robotLayout = findViewById(R.id.robot);
robotLayout = (LinearLayout)findViewById(R.id.robot); robotParams = (LinearLayout.LayoutParams) robotLayout.getLayoutParams();
robotParams =(LinearLayout.LayoutParams) robotLayout.getLayoutParams(); mLoading = findViewById(R.id.loading);
mLoading = (MetroLoadingView) findViewById(R.id.loading); dinnerLayout = findViewById(R.id.content);
robotPlate = findViewById(R.id.robot_plate);
dinnerLayout = (LinearLayout) findViewById(R.id.content); mRobot = findViewById(R.id.robot_dinner);
mDinnerStatus = findViewById(R.id.dinner_status);
robotPlate = (LinearLayout)findViewById(R.id.robot_plate); mDinnerStatusValue = findViewById(R.id.dinner_status_value);
rotateAnimation = AnimationUtils.loadAnimation(DinnerActivity.this, R.anim.rotate_view);
mRobot = (ImageView)findViewById(R.id.robot_dinner); rotatePlate = AnimationUtils.loadAnimation(DinnerActivity.this, R.anim.rotate_plate);
mDinnerStatus = (TextView)findViewById(R.id.dinner_status);
mDinnerStatusValue = (FlickerTextView) findViewById(R.id.dinner_status_value);
rotateAnimation = AnimationUtils.loadAnimation(DinnerActivity.this,R.anim.rotate_view);
rotatePlate = AnimationUtils.loadAnimation(DinnerActivity.this,R.anim.rotate_plate);
if (mLoading.isAnimating()) { if (mLoading.isAnimating()) {
mLoading.stop(); mLoading.stop();
} }
top = (CheckBox)findViewById(R.id.plate_top); top = findViewById(R.id.plate_top);
left = (CheckBox)findViewById(R.id.plate_left); left = findViewById(R.id.plate_left);
right = (CheckBox)findViewById(R.id.plate_right); right = findViewById(R.id.plate_right);
mTableGroup = (RadioGroupEx)findViewById(R.id.tableGroup);
btnScan = (Button) findViewById(R.id.btn_scan); mTableGroup = findViewById(R.id.tableGroup);
Button btnReset = findViewById(R.id.btn_reset);
btnReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
top.setChecked(false);
left.setChecked(false);
right.setChecked(false);
top.setText("");
left.setText("");
right.setText("");
mCurrentPlate = null;
mCurrentIndex = 0;
dinnerPath = null;
mTableGroup.clearCheck();
}
});
btnScan = findViewById(R.id.btn_scan);
btnScan.setOnClickListener(new View.OnClickListener() { btnScan.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -212,8 +228,7 @@ public class DinnerActivity extends Activity { ...@@ -212,8 +228,7 @@ public class DinnerActivity extends Activity {
} }
}); });
mGo = (Button)findViewById(R.id.btn_go); mGo = findViewById(R.id.btn_go);
mGo.setOnClickListener(new View.OnClickListener() { mGo.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -223,12 +238,11 @@ public class DinnerActivity extends Activity { ...@@ -223,12 +238,11 @@ public class DinnerActivity extends Activity {
} }
}); });
mPickup = (Button)findViewById(R.id.btn_pickup); mPickup = findViewById(R.id.btn_pickup);
mPickup.setOnClickListener(new View.OnClickListener() { mPickup.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
mCurrentPath ++; mCurrentPath++;
startDispatch(mCurrentPath); startDispatch(mCurrentPath);
//mDinnerStatusValue.setText("送餐中"); //mDinnerStatusValue.setText("送餐中");
} }
...@@ -238,17 +252,32 @@ public class DinnerActivity extends Activity { ...@@ -238,17 +252,32 @@ public class DinnerActivity extends Activity {
@Override @Override
public void onCheckedChanged(RadioGroup radioGroup, int i) { public void onCheckedChanged(RadioGroup radioGroup, int i) {
int id = radioGroup.getCheckedRadioButtonId(); int id = radioGroup.getCheckedRadioButtonId();
RadioButton radio = (RadioButton)findViewById(id); RadioButton radio = (RadioButton) findViewById(id);
if(radio != null) { if (radio != null) {
if (mCurrentPlate == null) { if (mCurrentPlate == null) {
// top.setText(radio.getText());
// left.setText(radio.getText());
// right.setText(radio.getText());
//
// int target = Integer.valueOf(radio.getTag().toString());
// dinnerPath[0] = target;
// dinnerPath[1] = target;
// dinnerPath[2] = target;
if (mCurrentIndex == 0) {
top.setText(radio.getText()); top.setText(radio.getText());
dinnerPath[0] = Integer.valueOf(radio.getTag().toString());
mCurrentIndex++;
} else if (mCurrentIndex == 1) {
left.setText(radio.getText()); left.setText(radio.getText());
dinnerPath[1] = Integer.valueOf(radio.getTag().toString());
mCurrentIndex++;
} else if (mCurrentIndex == 2) {
right.setText(radio.getText()); right.setText(radio.getText());
dinnerPath[2] = Integer.valueOf(radio.getTag().toString());
mCurrentIndex++;
}
int target = Integer.valueOf(radio.getTag().toString());
dinnerPath[0] = target;
dinnerPath[1] = target;
dinnerPath[2] = target;
} else { } else {
mCurrentPlate.setText(radio.getText()); mCurrentPlate.setText(radio.getText());
int target = Integer.valueOf(radio.getTag().toString()); int target = Integer.valueOf(radio.getTag().toString());
...@@ -261,13 +290,13 @@ public class DinnerActivity extends Activity { ...@@ -261,13 +290,13 @@ public class DinnerActivity extends Activity {
top.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { top.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
if(checked) { if (checked) {
mCurrentPlate = (CheckBox) compoundButton; mCurrentPlate = (CheckBox) compoundButton;
mCurrentIndex = 0; mCurrentIndex = 0;
left.setChecked(false); left.setChecked(false);
right.setChecked(false); right.setChecked(false);
}else{ } else {
if(mCurrentPlate == compoundButton){ if (mCurrentPlate == compoundButton) {
mCurrentPlate = null; mCurrentPlate = null;
} }
} }
...@@ -277,13 +306,13 @@ public class DinnerActivity extends Activity { ...@@ -277,13 +306,13 @@ public class DinnerActivity extends Activity {
left.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { left.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
if(checked) { if (checked) {
mCurrentPlate = (CheckBox) compoundButton; mCurrentPlate = (CheckBox) compoundButton;
mCurrentIndex = 1; mCurrentIndex = 1;
top.setChecked(false); top.setChecked(false);
right.setChecked(false); right.setChecked(false);
}else{ } else {
if(mCurrentPlate == compoundButton){ if (mCurrentPlate == compoundButton) {
mCurrentPlate = null; mCurrentPlate = null;
} }
} }
...@@ -293,13 +322,13 @@ public class DinnerActivity extends Activity { ...@@ -293,13 +322,13 @@ public class DinnerActivity extends Activity {
right.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { right.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
if(checked) { if (checked) {
mCurrentPlate = (CheckBox) compoundButton; mCurrentPlate = (CheckBox) compoundButton;
mCurrentIndex = 2; mCurrentIndex = 2;
top.setChecked(false); top.setChecked(false);
left.setChecked(false); left.setChecked(false);
}else{ } else {
if(mCurrentPlate == compoundButton){ if (mCurrentPlate == compoundButton) {
mCurrentPlate = null; mCurrentPlate = null;
} }
} }
...@@ -317,7 +346,7 @@ public class DinnerActivity extends Activity { ...@@ -317,7 +346,7 @@ public class DinnerActivity extends Activity {
startRobotThread(); startRobotThread();
merchant = (ImageView)findViewById(R.id.merchantLogo); merchant = (ImageView) findViewById(R.id.merchantLogo);
merchant.setOnClickListener(new View.OnClickListener() { merchant.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -327,15 +356,15 @@ public class DinnerActivity extends Activity { ...@@ -327,15 +356,15 @@ public class DinnerActivity extends Activity {
}); });
} }
private void startDispatch(int current){ private void startDispatch(int current) {
Message msg = new Message(); Message msg = new Message();
msg.what = ROBOT_DISPATCH; msg.what = ROBOT_DISPATCH;
msg.arg1 = current; msg.arg1 = current;
handler.sendMessage(msg); handler.sendMessage(msg);
} }
private void dispatching(int current){ private void dispatching(int current) {
if(current < targetData.size()){//仍然有未送达的餐,这里继续进行送餐 if (current < targetData.size()) {//仍然有未送达的餐,这里继续进行送餐
mDinnerStatusValue.setText("送餐中"); mDinnerStatusValue.setText("送餐中");
mPickup.setVisibility(View.GONE); mPickup.setVisibility(View.GONE);
int target = Integer.valueOf(targetData.get(current).toString()); int target = Integer.valueOf(targetData.get(current).toString());
...@@ -345,12 +374,12 @@ public class DinnerActivity extends Activity { ...@@ -345,12 +374,12 @@ public class DinnerActivity extends Activity {
} else { } else {
log.d(TAG, "autoPilotToPoint" + "(" + target + ")" + " called"); log.d(TAG, "autoPilotToPoint" + "(" + target + ")" + " called");
} }
}else if(current == targetData.size()){//机器人到达全部目标点,准备返回 } else if (current == targetData.size()) {//机器人到达全部目标点,准备返回
mDinnerStatusValue.setText("返回中"); mDinnerStatusValue.setText("返回中");
mPickup.setVisibility(View.GONE); mPickup.setVisibility(View.GONE);
int ret = autoPilotManager.autoPilotToPoint(1); int ret = autoPilotManager.autoPilotToPoint(1);
String orderNumber = mAuthCode; String orderNumber = mAuthCode;
if(mUserToken != null && !mUserToken.isEmpty()) {//already login if (mUserToken != null && !mUserToken.isEmpty()) {//already login
try { try {
mAction.setIndex(WebApiRequest.ORDER_COMPLETED_INDEX); mAction.setIndex(WebApiRequest.ORDER_COMPLETED_INDEX);
mAction.orderCompleted(mUserToken, orderNumber); mAction.orderCompleted(mUserToken, orderNumber);
...@@ -358,7 +387,7 @@ public class DinnerActivity extends Activity { ...@@ -358,7 +387,7 @@ public class DinnerActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} }
} }
}else{//机器人返回到起点 } else {//机器人返回到起点
setRobotStatus(RobotStatus.NORMAL); setRobotStatus(RobotStatus.NORMAL);
dinnerPath[0] = 0; dinnerPath[0] = 0;
dinnerPath[1] = 0; dinnerPath[1] = 0;
...@@ -366,13 +395,13 @@ public class DinnerActivity extends Activity { ...@@ -366,13 +395,13 @@ public class DinnerActivity extends Activity {
} }
} }
private void startDelivery(){ private void startDelivery() {
if(calcPath() == 0){ if (calcPath() == 0) {
int code = mTts.startSpeaking("请先设置送餐桌号", mTtsListener); int code = mTts.startSpeaking("请先设置送餐桌号", mTtsListener);
}else { } else {
//int code = mTts.startSpeaking("正在送餐", mTtsListener); //int code = mTts.startSpeaking("正在送餐", mTtsListener);
String orderNumber = mAuthCode; String orderNumber = mAuthCode;
if(mUserToken != null && !mUserToken.isEmpty()) {//already login if (mUserToken != null && !mUserToken.isEmpty()) {//already login
try { try {
mAction.setIndex(WebApiRequest.ORDER_DELIVERY_INDEX); mAction.setIndex(WebApiRequest.ORDER_DELIVERY_INDEX);
mAction.orderDelivery(mUserToken, orderNumber); mAction.orderDelivery(mUserToken, orderNumber);
...@@ -380,6 +409,7 @@ public class DinnerActivity extends Activity { ...@@ -380,6 +409,7 @@ public class DinnerActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} }
setRobotStatus(RobotStatus.WALKING); setRobotStatus(RobotStatus.WALKING);
// Log.e("ddd","targetData:"+targetData.toString());
int target = Integer.valueOf(targetData.get(mCurrentPath).toString()); int target = Integer.valueOf(targetData.get(mCurrentPath).toString());
int ret = autoPilotManager.autoPilotToPoint(target); int ret = autoPilotManager.autoPilotToPoint(target);
if (ret != PeanutErrorCode.SUCCESS) { if (ret != PeanutErrorCode.SUCCESS) {
...@@ -391,12 +421,12 @@ public class DinnerActivity extends Activity { ...@@ -391,12 +421,12 @@ public class DinnerActivity extends Activity {
} }
} }
private void initApp(){ private void initApp() {
mAction.setSucceedListener(new NetworkListener.Succeed<WebResponse>() { mAction.setSucceedListener(new NetworkListener.Succeed<WebResponse>() {
@Override @Override
public void onRequestSucceed(WebResponse data, int index) { public void onRequestSucceed(WebResponse data, int index) {
log.d(TAG, data.toString()); log.d(TAG, data.toString());
if(data.statusCode == AppConstant.ERROR_SUCCESS){ if (data.statusCode == AppConstant.ERROR_SUCCESS) {
switch (index) { switch (index) {
case WebApiRequest.USER_LOGIN_INDEX: case WebApiRequest.USER_LOGIN_INDEX:
mUserToken = data.token; mUserToken = data.token;
...@@ -406,13 +436,13 @@ public class DinnerActivity extends Activity { ...@@ -406,13 +436,13 @@ public class DinnerActivity extends Activity {
break; break;
case WebApiRequest.ORDER_QUERY_INDEX: case WebApiRequest.ORDER_QUERY_INDEX:
OrderInfo info = data.order; OrderInfo info = data.order;
if(info != null && info.tab_num != null && !info.tab_num.isEmpty()){ if (info != null && info.tab_num != null && !info.tab_num.isEmpty()) {
RadioButton radioButton = findRadioButtonByTag(Integer.valueOf(info.tab_num)); RadioButton radioButton = findRadioButtonByTag(Integer.valueOf(info.tab_num));
if(radioButton != null){ if (radioButton != null) {
radioButton.performClick(); radioButton.performClick();
mTts.startSpeaking(radioButton.getText().toString(), mTtsListener); mTts.startSpeaking(radioButton.getText().toString(), mTtsListener);
} }
}else{ } else {
mTts.startSpeaking("桌号为空,请手动选择桌号", mTtsListener); mTts.startSpeaking("桌号为空,请手动选择桌号", mTtsListener);
} }
...@@ -422,7 +452,7 @@ public class DinnerActivity extends Activity { ...@@ -422,7 +452,7 @@ public class DinnerActivity extends Activity {
case WebApiRequest.ORDER_DELIVERY_INDEX: case WebApiRequest.ORDER_DELIVERY_INDEX:
break; break;
} }
}else{ } else {
switch (index) { switch (index) {
case WebApiRequest.USER_LOGIN_INDEX: case WebApiRequest.USER_LOGIN_INDEX:
mTts.startSpeaking("网络异常啦!", mTtsListener); mTts.startSpeaking("网络异常啦!", mTtsListener);
...@@ -457,13 +487,13 @@ public class DinnerActivity extends Activity { ...@@ -457,13 +487,13 @@ public class DinnerActivity extends Activity {
mediaPlayer = MediaPlayer.create(this, R.raw.lovin); mediaPlayer = MediaPlayer.create(this, R.raw.lovin);
} }
private RadioButton findRadioButtonByTag(int tag){ private RadioButton findRadioButtonByTag(int tag) {
RadioButton radio = null; RadioButton radio = null;
if(mTableGroup != null){ if (mTableGroup != null) {
for(int i = 0 ;i < mTableGroup.getChildCount();i++){ for (int i = 0; i < mTableGroup.getChildCount(); i++) {
RadioButton rb = (RadioButton)mTableGroup.getChildAt(i); RadioButton rb = (RadioButton) mTableGroup.getChildAt(i);
if(Integer.valueOf(rb.getTag().toString()) == tag){ if (Integer.valueOf(rb.getTag().toString()) == tag) {
radio = rb; radio = rb;
break; break;
} }
...@@ -495,10 +525,10 @@ public class DinnerActivity extends Activity { ...@@ -495,10 +525,10 @@ public class DinnerActivity extends Activity {
} }
//消息处理者,创建一个Handler的子类对象,目的是重写Handler的处理消息的方法(handleMessage()) //消息处理者,创建一个Handler的子类对象,目的是重写Handler的处理消息的方法(handleMessage())
private Handler handler = new Handler(){ private Handler handler = new Handler() {
@Override @Override
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
switch (msg.what){ switch (msg.what) {
case LOGIN: case LOGIN:
try { try {
mAction.setIndex(WebApiRequest.USER_LOGIN_INDEX); mAction.setIndex(WebApiRequest.USER_LOGIN_INDEX);
...@@ -522,7 +552,7 @@ public class DinnerActivity extends Activity { ...@@ -522,7 +552,7 @@ public class DinnerActivity extends Activity {
} }
}; };
public void startLoginThread(){ public void startLoginThread() {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -536,12 +566,12 @@ public class DinnerActivity extends Activity { ...@@ -536,12 +566,12 @@ public class DinnerActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} }
//打印log //打印log
log.d(TAG,"start login"); log.d(TAG, "start login");
} }
}).start(); }).start();
} }
public void startRobotThread(){ public void startRobotThread() {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -555,12 +585,12 @@ public class DinnerActivity extends Activity { ...@@ -555,12 +585,12 @@ public class DinnerActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} }
//打印log //打印log
log.d(TAG,"start login"); log.d(TAG, "start login");
} }
}).start(); }).start();
} }
private void initRobot(){ private void initRobot() {
sdk = PeanutSDK.createInstance(getApplicationContext(), "sdk_type=local"); sdk = PeanutSDK.createInstance(getApplicationContext(), "sdk_type=local");
robot = sdk.getFinder().find(); robot = sdk.getFinder().find();
autoPilotManager = robot.getAutoPilotManager(); autoPilotManager = robot.getAutoPilotManager();
...@@ -575,7 +605,7 @@ public class DinnerActivity extends Activity { ...@@ -575,7 +605,7 @@ public class DinnerActivity extends Activity {
@Override @Override
public void onProcessChanged(PeanutPath peanutPath) { public void onProcessChanged(PeanutPath peanutPath) {
if(mediaPlayer != null) { if (mediaPlayer != null) {
mediaPlayer.start(); mediaPlayer.start();
} }
} }
...@@ -583,9 +613,9 @@ public class DinnerActivity extends Activity { ...@@ -583,9 +613,9 @@ public class DinnerActivity extends Activity {
@Override @Override
public void onFinished(PeanutPath peanutPath) { public void onFinished(PeanutPath peanutPath) {
int destination = peanutPath.getDestinationId(); int destination = peanutPath.getDestinationId();
if(destination == ROBOT_START_TARGET){//机器人到达终点 if (destination == ROBOT_START_TARGET) {//机器人到达终点
dispatching(ROBOT_INITIALIZED); dispatching(ROBOT_INITIALIZED);
}else { } else {
int code = mTts.startSpeaking("送到啦,请您慢用", mTtsListener); int code = mTts.startSpeaking("送到啦,请您慢用", mTtsListener);
mDinnerStatusValue.setText("请取餐"); mDinnerStatusValue.setText("请取餐");
mPickup.setVisibility(View.VISIBLE); mPickup.setVisibility(View.VISIBLE);
...@@ -594,7 +624,7 @@ public class DinnerActivity extends Activity { ...@@ -594,7 +624,7 @@ public class DinnerActivity extends Activity {
startActivityForResult(intent, FACE_DETECT_REQUEST_CODE); startActivityForResult(intent, FACE_DETECT_REQUEST_CODE);
} }
if(mediaPlayer != null) { if (mediaPlayer != null) {
mediaPlayer.pause(); mediaPlayer.pause();
} }
} }
...@@ -602,7 +632,7 @@ public class DinnerActivity extends Activity { ...@@ -602,7 +632,7 @@ public class DinnerActivity extends Activity {
@Override @Override
public void onBlocking(PeanutPath peanutPath) { public void onBlocking(PeanutPath peanutPath) {
int code = mTts.startSpeaking("亲,挡到我啦,人家可是很忙的!", mTtsListener); int code = mTts.startSpeaking("亲,挡到我啦,人家可是很忙的!", mTtsListener);
if(mediaPlayer != null) { if (mediaPlayer != null) {
mediaPlayer.pause(); mediaPlayer.pause();
} }
} }
...@@ -674,7 +704,7 @@ public class DinnerActivity extends Activity { ...@@ -674,7 +704,7 @@ public class DinnerActivity extends Activity {
//workModeManager.changeMode(WorkMode.MODE_AUTO_PILOT); //workModeManager.changeMode(WorkMode.MODE_AUTO_PILOT);
} }
private void initXunfei(){ private void initXunfei() {
// 初始化合成对象 // 初始化合成对象
mTts = SpeechSynthesizer.createSynthesizer(DinnerActivity.this, mTtsInitListener); mTts = SpeechSynthesizer.createSynthesizer(DinnerActivity.this, mTtsInitListener);
...@@ -743,13 +773,14 @@ public class DinnerActivity extends Activity { ...@@ -743,13 +773,14 @@ public class DinnerActivity extends Activity {
/** /**
* 参数设置 * 参数设置
*
* @return * @return
*/ */
private void setParam(){ private void setParam() {
// 清空参数 // 清空参数
mTts.setParameter(SpeechConstant.PARAMS, null); mTts.setParameter(SpeechConstant.PARAMS, null);
// 根据合成引擎设置相应参数 // 根据合成引擎设置相应参数
if(mEngineType.equals(SpeechConstant.TYPE_CLOUD)) { if (mEngineType.equals(SpeechConstant.TYPE_CLOUD)) {
mTts.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_CLOUD); mTts.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_CLOUD);
// 设置在线合成发音人 // 设置在线合成发音人
mTts.setParameter(SpeechConstant.VOICE_NAME, voicer); mTts.setParameter(SpeechConstant.VOICE_NAME, voicer);
...@@ -759,7 +790,7 @@ public class DinnerActivity extends Activity { ...@@ -759,7 +790,7 @@ public class DinnerActivity extends Activity {
mTts.setParameter(SpeechConstant.PITCH, "75"); mTts.setParameter(SpeechConstant.PITCH, "75");
//设置合成音量 //设置合成音量
mTts.setParameter(SpeechConstant.VOLUME, "100"); mTts.setParameter(SpeechConstant.VOLUME, "100");
}else { } else {
mTts.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_LOCAL); mTts.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_LOCAL);
// 设置本地合成发音人 voicer为空,默认通过语记界面指定发音人。 // 设置本地合成发音人 voicer为空,默认通过语记界面指定发音人。
mTts.setParameter(SpeechConstant.VOICE_NAME, ""); mTts.setParameter(SpeechConstant.VOICE_NAME, "");
...@@ -779,9 +810,9 @@ public class DinnerActivity extends Activity { ...@@ -779,9 +810,9 @@ public class DinnerActivity extends Activity {
//mTts.setParameter(SpeechConstant.TTS_AUDIO_PATH, Environment.getExternalStorageDirectory()+"/msc/tts.wav"); //mTts.setParameter(SpeechConstant.TTS_AUDIO_PATH, Environment.getExternalStorageDirectory()+"/msc/tts.wav");
} }
private void setRobotStatus(RobotStatus status){ private void setRobotStatus(RobotStatus status) {
if(status == RobotStatus.NORMAL){//普通状态 if (status == RobotStatus.NORMAL) {//普通状态
if(mediaPlayer != null) { if (mediaPlayer != null) {
mediaPlayer.pause(); mediaPlayer.pause();
//mediaPlayer = null; //mediaPlayer = null;
} }
...@@ -812,7 +843,7 @@ public class DinnerActivity extends Activity { ...@@ -812,7 +843,7 @@ public class DinnerActivity extends Activity {
left.setText(""); left.setText("");
right.setText(""); right.setText("");
}else{//送餐状态 } else {//送餐状态
int code = mTts.startSpeaking("出发啦!", mTtsListener); int code = mTts.startSpeaking("出发啦!", mTtsListener);
robotParams.weight = 0; robotParams.weight = 0;
robotLayout.setLayoutParams(robotParams); robotLayout.setLayoutParams(robotParams);
...@@ -839,14 +870,14 @@ public class DinnerActivity extends Activity { ...@@ -839,14 +870,14 @@ public class DinnerActivity extends Activity {
//mediaPlayer = null; //mediaPlayer = null;
//mediaPlayer = new MediaPlayer(); //mediaPlayer = new MediaPlayer();
//mediaPlayer = MediaPlayer.create(this, R.raw.lovin); //mediaPlayer = MediaPlayer.create(this, R.raw.lovin);
if(mediaPlayer != null) { if (mediaPlayer != null) {
mediaPlayer.seekTo(0); mediaPlayer.seekTo(0);
mediaPlayer.start();//开始播放 mediaPlayer.start();//开始播放
} }
} }
} }
private int calcPath(){ private int calcPath() {
for (int num : dinnerPath) { for (int num : dinnerPath) {
if ((num != 0) && !targetData.contains(num)) { if ((num != 0) && !targetData.contains(num)) {
targetData.add(num); targetData.add(num);
...@@ -858,9 +889,9 @@ public class DinnerActivity extends Activity { ...@@ -858,9 +889,9 @@ public class DinnerActivity extends Activity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode){ switch (requestCode) {
case SCAN_REQUEST_CODE: case SCAN_REQUEST_CODE:
if (resultCode == RESULT_OK){ if (resultCode == RESULT_OK) {
mAuthCode = data.getStringExtra("authCode"); mAuthCode = data.getStringExtra("authCode");
//Toast.makeText(MainActivity.this, mAuthCode, Toast.LENGTH_SHORT).show(); //Toast.makeText(MainActivity.this, mAuthCode, Toast.LENGTH_SHORT).show();
//start to query //start to query
...@@ -868,7 +899,7 @@ public class DinnerActivity extends Activity { ...@@ -868,7 +899,7 @@ public class DinnerActivity extends Activity {
//table 2 = 108730605004391217 //table 2 = 108730605004391217
String orderNumber = mAuthCode; String orderNumber = mAuthCode;
if(mUserToken != null && !mUserToken.isEmpty()) {//already login if (mUserToken != null && !mUserToken.isEmpty()) {//already login
try { try {
mAction.setIndex(WebApiRequest.ORDER_QUERY_INDEX); mAction.setIndex(WebApiRequest.ORDER_QUERY_INDEX);
mAction.orderQuery(mUserToken, orderNumber); mAction.orderQuery(mUserToken, orderNumber);
...@@ -879,9 +910,9 @@ public class DinnerActivity extends Activity { ...@@ -879,9 +910,9 @@ public class DinnerActivity extends Activity {
} }
break; break;
case FACE_DETECT_REQUEST_CODE: case FACE_DETECT_REQUEST_CODE:
if(resultCode == RESULT_OK){ if (resultCode == RESULT_OK) {
mOpenId = data.getStringExtra("openid"); mOpenId = data.getStringExtra("openid");
if(mOpenId != null) { if (mOpenId != null) {
mTts.startSpeaking(mOpenId + "请取餐!", mTtsListener); mTts.startSpeaking(mOpenId + "请取餐!", mTtsListener);
} }
} }
...@@ -896,13 +927,13 @@ public class DinnerActivity extends Activity { ...@@ -896,13 +927,13 @@ public class DinnerActivity extends Activity {
//robot sdk release //robot sdk release
sdk.release(); sdk.release();
//xunfei sdk release //xunfei sdk release
if( null != mTts ){ if (null != mTts) {
mTts.stopSpeaking(); mTts.stopSpeaking();
// 退出时释放连接 // 退出时释放连接
mTts.destroy(); mTts.destroy();
} }
if(mediaPlayer != null) { if (mediaPlayer != null) {
mediaPlayer.stop(); mediaPlayer.stop();
mediaPlayer.release(); mediaPlayer.release();
mediaPlayer = null; mediaPlayer = null;
......
...@@ -15,76 +15,80 @@ ...@@ -15,76 +15,80 @@
android:id="@+id/robot" android:id="@+id/robot"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:layout_weight="2"
android:layout_weight="2"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="73dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_height="73dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/merchantLogo" android:id="@+id/merchantLogo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/md"/> android:src="@drawable/md" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/store_name" android:id="@+id/store_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/colorNormal"
android:textSize="20dp"
android:textStyle="bold"
android:layout_weight="1" android:layout_weight="1"
android:gravity="top" android:gravity="top"
android:text="麦当劳"/> android:text="麦当劳"
android:textColor="@color/colorNormal"
android:textSize="20dp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/store_address" android:id="@+id/store_address"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/colorNormal"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="祁连山南路店"/> android:text="祁连山南路店"
android:textColor="@color/colorNormal" />
<TextView <TextView
android:id="@+id/robot_work_mode" android:id="@+id/robot_work_mode"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/colorNormal"
android:layout_weight="1" android:layout_weight="1"
android:gravity="bottom" android:gravity="bottom"
android:text="机器人壹号 - 可可小爱"/> android:text="机器人壹号 - 可可小爱"
android:textColor="@color/colorNormal" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:paddingTop="2dp" android:layout_marginTop="6dp"
android:paddingBottom="2dp" android:background="@color/colorNormal"
android:textSize="14dp"
android:gravity="center" android:gravity="center"
android:paddingBottom="2dp"
android:paddingTop="2dp"
android:text="送餐桌号"
android:textColor="@color/colorDefault" android:textColor="@color/colorDefault"
android:background="@color/colorNormal" android:textSize="14dp" />
android:text="送餐桌号"/>
<peanut.keenon.com.control.RadioGroupEx <peanut.keenon.com.control.RadioGroupEx
android:id="@+id/tableGroup" android:id="@+id/tableGroup"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:paddingBottom="10dp"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal"
android:paddingBottom="10dp">
<RadioButton <RadioButton
android:id="@+id/btn1" android:id="@+id/btn1"
...@@ -96,10 +100,10 @@ ...@@ -96,10 +100,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="1"
android:text="一号餐桌" android:text="一号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="1"/>
<RadioButton <RadioButton
android:id="@+id/btn2" android:id="@+id/btn2"
...@@ -111,10 +115,10 @@ ...@@ -111,10 +115,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="2"
android:text="二号餐桌" android:text="二号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="2"/>
<RadioButton <RadioButton
android:id="@+id/btn3" android:id="@+id/btn3"
...@@ -126,10 +130,10 @@ ...@@ -126,10 +130,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="3"
android:text="三号餐桌" android:text="三号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="3"/>
<RadioButton <RadioButton
android:id="@+id/btn4" android:id="@+id/btn4"
...@@ -141,10 +145,10 @@ ...@@ -141,10 +145,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="4"
android:text="四号餐桌" android:text="四号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="4"/>
<RadioButton <RadioButton
android:id="@+id/btn5" android:id="@+id/btn5"
...@@ -156,10 +160,10 @@ ...@@ -156,10 +160,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="5"
android:text="五号餐桌" android:text="五号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="5"/>
<RadioButton <RadioButton
android:id="@+id/btn6" android:id="@+id/btn6"
...@@ -171,10 +175,10 @@ ...@@ -171,10 +175,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="6"
android:text="六号餐桌" android:text="六号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="6"/>
<RadioButton <RadioButton
android:id="@+id/bt7" android:id="@+id/bt7"
...@@ -186,10 +190,10 @@ ...@@ -186,10 +190,10 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="7"
android:text="七号餐桌" android:text="七号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="7"/>
<RadioButton <RadioButton
android:id="@+id/btn8" android:id="@+id/btn8"
...@@ -201,10 +205,25 @@ ...@@ -201,10 +205,25 @@
android:background="@drawable/radiobutton_background" android:background="@drawable/radiobutton_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:tag="8"
android:text="八号餐桌" android:text="八号餐桌"
android:textColor="@color/radiobutton_textcolor" android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" android:textSize="14sp" />
android:tag="8"/>
<RadioButton
android:id="@+id/btn9"
android:layout_width="90dp"
android:layout_height="35dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:gravity="center"
android:tag="8"
android:text="九号餐桌"
android:textColor="@color/radiobutton_textcolor"
android:textSize="14sp" />
</peanut.keenon.com.control.RadioGroupEx> </peanut.keenon.com.control.RadioGroupEx>
...@@ -214,10 +233,10 @@ ...@@ -214,10 +233,10 @@
android:id="@+id/content" android:id="@+id/content"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:layout_weight="1"
android:background="@color/colorRobot" android:background="@color/colorRobot"
android:gravity="center" android:gravity="center"
android:layout_weight="1"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/metro" android:id="@+id/metro"
...@@ -229,55 +248,95 @@ ...@@ -229,55 +248,95 @@
android:id="@+id/robot_plate" android:id="@+id/robot_plate"
android:layout_width="230dp" android:layout_width="230dp"
android:layout_height="230dp" android:layout_height="230dp"
android:orientation="vertical"
android:background="@drawable/robot_load_background"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:gravity="center"> android:background="@drawable/robot_load_background"
android:gravity="center"
android:orientation="vertical">
<!-- <!--
<peanut.keenon.com.control.NestedRadioGroup <peanut.keenon.com.control.NestedRadioGroup
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"> android:gravity="center">
--> -->
<CheckBox <RelativeLayout
android:id="@+id/plate_top"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_marginTop="-30dp"
android:orientation="vertical">
<CheckBox
android:id="@+id/plate_top"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/plate_background" android:background="@drawable/plate_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:layout_marginTop="-30dp" android:text="" />
android:text=""/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="center_horizontal"
android:text="@string/dinner_top_table"
android:textSize="10sp" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="-14dp" android:layout_marginTop="-14dp"
android:gravity="center"> android:gravity="center"
<!-- android:orientation="horizontal">
<peanut.keenon.com.control.CircleButton
<RelativeLayout
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="100dp" android:layout_height="100dp"
android:src="@drawable/plate" android:orientation="vertical">
app:cb_color="#99CC00"
app:cb_pressedRingWidth="8dp"/>
-->
<CheckBox <CheckBox
android:id="@+id/plate_left" android:id="@+id/plate_left"
android:layout_width="100dp" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="match_parent"
android:background="@drawable/plate_background" android:background="@drawable/plate_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:text=""/> android:text="" />
<CheckBox
android:id="@+id/plate_right" <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="center_horizontal"
android:text="@string/dinner_left_table"
android:textSize="10sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="100dp" android:layout_height="100dp"
android:orientation="vertical">
<CheckBox
android:id="@+id/plate_right"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/plate_background" android:background="@drawable/plate_background"
android:button="@null" android:button="@null"
android:gravity="center" android:gravity="center"
android:text=""/> android:text="" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="center_horizontal"
android:text="@string/dinner_right_table"
android:textSize="10sp" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
<!-- <!--
</peanut.keenon.com.control.NestedRadioGroup> </peanut.keenon.com.control.NestedRadioGroup>
...@@ -289,39 +348,51 @@ ...@@ -289,39 +348,51 @@
android:id="@+id/robot_dinner" android:id="@+id/robot_dinner"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="200dp" android:layout_height="200dp"
android:src="@drawable/robot"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:visibility="invisible"/> android:src="@drawable/robot"
android:visibility="invisible" />
<TextView <TextView
android:id="@+id/dinner_status" android:id="@+id/dinner_status"
android:layout_width="200dp" android:layout_width="200dp"
android:layout_height="200dp" android:layout_height="200dp"
android:background="@drawable/status_background" android:background="@drawable/status_background"
android:text=""
android:gravity="center" android:gravity="center"
android:textSize="42dp" android:text=""
android:textColor="@color/colorFocus" android:textColor="@color/colorFocus"
android:visibility="gone"/> android:textSize="42dp"
android:visibility="gone" />
<peanut.keenon.com.control.FlickerTextView <peanut.keenon.com.control.FlickerTextView
android:id="@+id/dinner_status_value" android:id="@+id/dinner_status_value"
android:layout_width="200dp" android:layout_width="200dp"
android:layout_height="200dp" android:layout_height="200dp"
android:text=""
android:gravity="center" android:gravity="center"
android:textSize="42dp" android:text=""
android:textColor="@color/colorFocus" android:textColor="@color/colorFocus"
android:visibility="gone"/> android:textSize="42dp"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
<include layout="@layout/metro_loading"/> <include layout="@layout/metro_loading" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:gravity="center"
android:gravity="center"> android:orientation="vertical">
<Button
android:id="@+id/btn_reset"
android:layout_width="160dp"
android:layout_height="80dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/button_background"
android:gravity="center"
android:text="重置餐桌"
android:textColor="@color/colorFocus" />
<Button <Button
android:id="@+id/btn_scan" android:id="@+id/btn_scan"
android:layout_width="160dp" android:layout_width="160dp"
...@@ -331,11 +402,13 @@ ...@@ -331,11 +402,13 @@
android:background="@drawable/button_background" android:background="@drawable/button_background"
android:gravity="center" android:gravity="center"
android:text="扫一扫" android:text="扫一扫"
android:textColor="@color/colorFocus"/> android:textColor="@color/colorFocus" />
<TextView <TextView
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="invisible"/> android:visibility="invisible" />
<Button <Button
android:id="@+id/btn_go" android:id="@+id/btn_go"
android:layout_width="120dp" android:layout_width="120dp"
...@@ -345,11 +418,13 @@ ...@@ -345,11 +418,13 @@
android:background="@drawable/button_background" android:background="@drawable/button_background"
android:gravity="center" android:gravity="center"
android:text="立即送餐" android:text="立即送餐"
android:textColor="@color/colorFocus"/> android:textColor="@color/colorFocus" />
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="invisible"/> android:visibility="invisible" />
<Button <Button
android:id="@+id/btn_pickup" android:id="@+id/btn_pickup"
android:layout_width="200dp" android:layout_width="200dp"
...@@ -358,10 +433,10 @@ ...@@ -358,10 +433,10 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:background="@drawable/button_background" android:background="@drawable/button_background"
android:gravity="center" android:gravity="center"
android:textSize="32dp"
android:text="确认取餐" android:text="确认取餐"
android:textColor="@color/colorFocus" android:textColor="@color/colorFocus"
android:visibility="gone"/> android:textSize="32dp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -13,4 +13,8 @@ ...@@ -13,4 +13,8 @@
<string name="code_text">将商品的条形码置于边框内,即可进行记录</string> <string name="code_text">将商品的条形码置于边框内,即可进行记录</string>
<string name="query_text">将订单的条形码置于边框内,即可进行查询</string> <string name="query_text">将订单的条形码置于边框内,即可进行查询</string>
<string name="scan_tips">应收金额</string> <string name="scan_tips">应收金额</string>
<string name="dinner_top_table">1</string>
<string name="dinner_left_table">2</string>
<string name="dinner_right_table">3</string>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment