界面完成
@@ -78,6 +78,7 @@ dependencies {
|
||||
// implementation files('libs\\libWeighingscale.jar')
|
||||
|
||||
implementation files('libs\\org.eclipse.paho.client.mqttv3-1.2.5.jar')
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
||||
@@ -87,6 +87,28 @@ public class Test {
|
||||
// System.out.println(s);
|
||||
// }
|
||||
|
||||
String temp = calcPct(71.08, 1.49);
|
||||
System.out.println(temp);
|
||||
System.out.println(extractNumber(temp));
|
||||
}
|
||||
|
||||
public static String calcPct(double weight, double realWeight) {
|
||||
double pct = (realWeight - weight) / weight;
|
||||
System.out.println(pct);
|
||||
String pctStr = "";
|
||||
if (pct > 0) {
|
||||
pctStr = "+" + (int) (pct * 100) + "%";
|
||||
} else {
|
||||
pctStr = (int) (pct * 100) + "%";
|
||||
}
|
||||
return pctStr;
|
||||
}
|
||||
|
||||
public static int extractNumber(String input) {
|
||||
// 使用正则表达式替换掉字符串中所有非数字、非负号的字符
|
||||
String numberStr = input.replaceAll("[^-0-9.]", "");
|
||||
// 将处理后的字符串转换为 double 类型的数字
|
||||
return Math.abs(Integer.parseInt(numberStr));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sw.st.api;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.cache.CacheMode;
|
||||
@@ -21,6 +22,7 @@ import com.sw.st.net.helper.JsonConvert;
|
||||
import com.sw.st.ui.device.BindDeviceModel;
|
||||
import com.sw.st.ui.setting.FoodListModel;
|
||||
import com.sw.st.utils.AppUtil;
|
||||
import com.sw.st.utils.L;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -35,10 +37,11 @@ import static com.sw.st.ui.init.InitActivity.BASE_URL;
|
||||
|
||||
|
||||
public class SwService {
|
||||
private static final String BASE_URL = "http://192.168.10.7:9092";
|
||||
// private static final String BASE_URL = "http://192.168.10.25:9092";
|
||||
// private static final String BASE_URL = "http://192.168.10.7:9092";
|
||||
// private static final String BASE_URL = "http://192.168.1.250:9999/";
|
||||
// private static final String BASE_URL = "http://192.168.1.199:9999/";
|
||||
// private static final String BASE_URL = "http://vip.shuziweidao.com";
|
||||
private static final String BASE_URL = "http://vip.shuziweidao.com";
|
||||
|
||||
public static String getServerAddress = "/equipment/stEquipment/queryByEquipmentCode";//外网服务获取业务服务器地址
|
||||
public static final String checkUpdate = "/app/stApp/appVersionPpgrade";
|
||||
@@ -76,7 +79,7 @@ public class SwService {
|
||||
|
||||
//================================新版本=======================================
|
||||
|
||||
public static String getRestInfoFoodsByType = "/shuwei-zhct/scales/getRestInfoFoodsByType";//菜品信息
|
||||
public static String getRestInfoFoodsByType = "/shuwei-zhct/scales/getRestInfoFoods";//菜品信息 getRestInfoFoodsByType
|
||||
public static String getUserNutritionData = "/shuwei-zhct/scales/getFoodInfoByplateNumber";//获取用户本餐次就餐数据
|
||||
|
||||
public static String startMealService = "/shuwei-zhct/scales/startMealService";//开餐
|
||||
@@ -491,7 +494,7 @@ public class SwService {
|
||||
.adapt(new ObservableBody<ResponseData<RecommendValueModel>>());
|
||||
}
|
||||
|
||||
public static Observable<String> getGoodsUseList(String foodId, double foodWeight) {
|
||||
public static Observable<String> getGoodsUseList(String foodId, String foodWeight) {
|
||||
return OkGo.<String>get(BASE_URL + getGoodsUseList)
|
||||
.params("foodId", foodId)
|
||||
.params("foodWeight", foodWeight)
|
||||
@@ -501,17 +504,14 @@ public class SwService {
|
||||
.adapt(new ObservableBody<String>());
|
||||
}
|
||||
|
||||
public static Observable<String> saveFoodGoodsUseInfo(String foodId, double foodWeight, ArrayList<FoodGoodsInfo> goodsInfo) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
try {
|
||||
jsonObject.put("foodId", foodId);
|
||||
jsonObject.put("foodWeight", foodWeight);
|
||||
jsonObject.put("voList", goodsInfo);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public static Observable<String> saveFoodGoodsUseInfo(String foodId, double foodWeight, List<FoodGoodsInfo> goodsInfo) {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("foodId", foodId);
|
||||
hashMap.put("foodRealWeight", foodWeight);
|
||||
hashMap.put("voList", goodsInfo);
|
||||
String jsonStr = new Gson().toJson(hashMap);
|
||||
return OkGo.<String>post(BASE_URL + saveFoodGoodsUseInfo)
|
||||
.upJson(jsonObject)
|
||||
.upJson(jsonStr)
|
||||
.cacheMode(CacheMode.NO_CACHE)
|
||||
.converter(new JsonConvert<String>() {
|
||||
})
|
||||
|
||||
@@ -8,6 +8,8 @@ public class FoodGoodsInfo {
|
||||
private String goodsName;
|
||||
private double useWeight;
|
||||
private double useRealWeight;
|
||||
private boolean isSelect = false;
|
||||
private int materialType;
|
||||
|
||||
public String getFoodId() {
|
||||
return foodId;
|
||||
@@ -64,4 +66,20 @@ public class FoodGoodsInfo {
|
||||
public void setUseRealWeight(double useRealWeight) {
|
||||
this.useRealWeight = useRealWeight;
|
||||
}
|
||||
|
||||
public int getMaterialType() {
|
||||
return materialType;
|
||||
}
|
||||
|
||||
public void setMaterialType(int materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public boolean isSelect() {
|
||||
return isSelect;
|
||||
}
|
||||
|
||||
public void setSelect(boolean select) {
|
||||
isSelect = select;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class NewFoodInfoModel implements Serializable {
|
||||
private String id;
|
||||
private String foodId;
|
||||
private String foodName;
|
||||
private String img;
|
||||
private List<String> labList;
|
||||
@@ -29,14 +29,19 @@ public class NewFoodInfoModel implements Serializable {
|
||||
private double mixedBeans;
|
||||
private double soyaNew;
|
||||
|
||||
private double foodWeight;
|
||||
private double estimateFoodWeight;
|
||||
|
||||
private boolean isFirst = true;
|
||||
|
||||
private boolean isSelect = false;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
public String getFoodId() {
|
||||
return foodId;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
public void setFoodId(String foodId) {
|
||||
this.foodId = foodId;
|
||||
}
|
||||
|
||||
public int getTablewareWeight() {
|
||||
@@ -207,6 +212,30 @@ public class NewFoodInfoModel implements Serializable {
|
||||
this.soyaNew = soyaNew;
|
||||
}
|
||||
|
||||
public double getFoodWeight() {
|
||||
return foodWeight;
|
||||
}
|
||||
|
||||
public void setFoodWeight(double foodWeight) {
|
||||
this.foodWeight = foodWeight;
|
||||
}
|
||||
|
||||
public double getEstimateFoodWeight() {
|
||||
return estimateFoodWeight;
|
||||
}
|
||||
|
||||
public void setEstimateFoodWeight(double estimateFoodWeight) {
|
||||
this.estimateFoodWeight = estimateFoodWeight;
|
||||
}
|
||||
|
||||
public boolean isFirst() {
|
||||
return isFirst;
|
||||
}
|
||||
|
||||
public void setFirst(boolean first) {
|
||||
isFirst = first;
|
||||
}
|
||||
|
||||
public boolean isSelect() {
|
||||
return isSelect;
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public class FoodInfoActivity extends BaseActivity<FoodInfoView, FoodInfoPresent
|
||||
|
||||
foodInfo = Convert.fromJson(foodInfoStr, new TypeToken<NewFoodInfoModel>() {
|
||||
}.getType());
|
||||
foodId = foodInfo.getId();
|
||||
foodId = foodInfo.getFoodId();
|
||||
// foodInfo = (FoodInfoModel) getIntent().getSerializableExtra("foodInfo");
|
||||
String restName = PrefUtils.getString(this, REST_NAME, "");
|
||||
restNameTv.setText("欢迎光临" + restName);
|
||||
@@ -644,7 +644,7 @@ public class FoodInfoActivity extends BaseActivity<FoodInfoView, FoodInfoPresent
|
||||
ScalesFoodList scalesFoodList = new ScalesFoodList();
|
||||
scalesFoodList.setFoodWeight(weight);
|
||||
scalesFoodList.setFoodName(foodInfo.getFoodName());
|
||||
scalesFoodList.setFoodId(foodInfo.getId());
|
||||
scalesFoodList.setFoodId(foodInfo.getFoodId());
|
||||
|
||||
float totalKcal = kcal + currentUserModel.getHeatKcal();
|
||||
|
||||
@@ -1202,7 +1202,7 @@ public class FoodInfoActivity extends BaseActivity<FoodInfoView, FoodInfoPresent
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String foodId = jsonObject.optString("foodId");
|
||||
if (foodInfo != null &&
|
||||
foodId.equals(foodInfo.getId())) {
|
||||
foodId.equals(foodInfo.getFoodId())) {
|
||||
int updateFlag = jsonObject.optInt("updateFlag");
|
||||
if (updateFlag == 0) {//删除
|
||||
PrefUtils.setString(mContext, CURRENT_FOOD_DATA, "");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sw.st.ui.setting;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
@@ -18,20 +19,29 @@ public class FoodNameAdapter extends BaseQuickAdapter<NewFoodInfoModel, BaseView
|
||||
Context context;
|
||||
|
||||
public FoodNameAdapter(@Nullable List<NewFoodInfoModel> strs, Context context) {
|
||||
super(R.layout.item_food_name_tv, strs);
|
||||
super(R.layout.item_food_name, strs);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(@NotNull BaseViewHolder baseViewHolder, NewFoodInfoModel info) {
|
||||
RelativeLayout relativeLayout = baseViewHolder.findView(R.id.foodLayout);
|
||||
relativeLayout.setSelected(info.isSelect());
|
||||
|
||||
TextView textView = baseViewHolder.findView(R.id.tv);
|
||||
// baseViewHolder.setText(R.id.tv, info.getFoodName());
|
||||
textView.setText(info.getFoodName());
|
||||
textView.setSelected(info.isSelect());
|
||||
if(info.isSelect()){
|
||||
baseViewHolder.setText(R.id.nameTv, info.getFoodName());
|
||||
if (info.getFoodWeight() > 0) {
|
||||
baseViewHolder.setText(R.id.weightTv, "实际:" + info.getFoodWeight() + " kg");
|
||||
} else {
|
||||
baseViewHolder.setText(R.id.weightTv, "实际:" + "-- kg");
|
||||
}
|
||||
if (info.getEstimateFoodWeight() > 0) {
|
||||
baseViewHolder.setText(R.id.estimateWeightTv, "预计:" + info.getEstimateFoodWeight() + " kg");
|
||||
} else {
|
||||
baseViewHolder.setText(R.id.estimateWeightTv, "预计:" + "-- kg");
|
||||
}
|
||||
if (info.isSelect()) {
|
||||
|
||||
}else{
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.sw.st.ui.setting;
|
||||
|
||||
import static com.sw.st.utils.AppUtil.extractFirstPart;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@@ -11,19 +13,23 @@ import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.listener.OnItemClickListener;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.gyf.immersionbar.BarHide;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpHeaders;
|
||||
import com.sw.st.R;
|
||||
@@ -36,12 +42,15 @@ import com.sw.st.utils.AppUtil;
|
||||
import com.sw.st.utils.InputMethod;
|
||||
import com.sw.st.utils.L;
|
||||
import com.sw.st.utils.PrefUtils;
|
||||
import com.sw.st.view.FoodWarningPopup;
|
||||
import com.wabon.wbintelligenthardwaresdk.api.WeigherTwo;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
@@ -67,17 +76,52 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
ImageView cancelImg;
|
||||
// @BindView(R.id.item_shopping_flowlayout)
|
||||
// TagFlowLayout flowLayout;
|
||||
@BindView(R.id.setting_current_food_tv)
|
||||
TextView currentFoodTv;
|
||||
@BindView(R.id.currentWeight)
|
||||
TextView currentWeight;
|
||||
@BindView(R.id.start)
|
||||
Button startButton;
|
||||
@BindView(R.id.foodNameTv)
|
||||
TextView foodNameTv;
|
||||
@BindView(R.id.foodName)
|
||||
TextView foodName;
|
||||
@BindView(R.id.totalWeightTv)
|
||||
TextView totalWeightTv;
|
||||
@BindView(R.id.inputLayout)
|
||||
LinearLayout inputLayout;
|
||||
@BindView(R.id.leftWeightTv)
|
||||
TextView leftWeightTv;
|
||||
@BindView(R.id.leftWeightUnitTv)
|
||||
TextView leftWeightUnitTv;
|
||||
@BindView(R.id.foodRecyclerView)
|
||||
RecyclerView foodRecyclerView;
|
||||
@BindView(R.id.swipeRefreshLayout)
|
||||
SwipeRefreshLayout swipeRefreshLayout;
|
||||
@BindView(R.id.foodListEmptyLayout)
|
||||
LinearLayout foodListEmptyLayout;
|
||||
@BindView(R.id.reloadFoodListTv)
|
||||
TextView reloadFoodListTv;
|
||||
@BindView(R.id.makeWeightEdit)
|
||||
TextView makeWeightEdit;
|
||||
@BindView(R.id.ingredientLayout)
|
||||
LinearLayout ingredientLayout;
|
||||
@BindView(R.id.ingredientRecyclerView)
|
||||
RecyclerView ingredientRecyclerView;
|
||||
@BindView(R.id.ingredientName)
|
||||
TextView ingredientName;
|
||||
@BindView(R.id.ingredientType)
|
||||
TextView ingredientType;
|
||||
@BindView(R.id.ingredientCalcWeight)
|
||||
TextView ingredientCalcWeight;
|
||||
@BindView(R.id.ingredientCalcPctTv)
|
||||
TextView ingredientCalcPctTv;
|
||||
@BindView(R.id.foodMakingLayout)
|
||||
LinearLayout foodMakingLayout;
|
||||
@BindView(R.id.endWeightLayout)
|
||||
RelativeLayout endWeightLayout;
|
||||
@BindView(R.id.rightWeightTv)
|
||||
TextView rightWeightTv;
|
||||
|
||||
private FoodWarningPopup foodWarningPopup;
|
||||
|
||||
// private MyFlowAdapters myFlowAdapters;
|
||||
private FoodNameAdapter foodNameAdapter;
|
||||
private IngredientAdapter ingredientAdapter;
|
||||
private ArrayList<NewFoodInfoModel> foodTagList = new ArrayList<>();
|
||||
|
||||
private NewFoodInfoModel currentFoodInfo;
|
||||
@@ -92,6 +136,7 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
private double leftDeviceWeight = 0;
|
||||
private double rightDeviceWeight = 0;
|
||||
private int currentDeviceIndex = LEFT_WEIGHT_INDEX;
|
||||
HashSet<String> finishedFoodSet = new HashSet<>();//保存已制作food id
|
||||
|
||||
@Override
|
||||
protected int provideContentViewId() {
|
||||
@@ -118,6 +163,7 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
.statusBarDarkFont(true)
|
||||
.statusBarColor(R.color.white)
|
||||
.init();
|
||||
foodWarningPopup = new FoodWarningPopup(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,10 +173,18 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
|
||||
foodNameAdapter = new FoodNameAdapter(null, mContext);
|
||||
foodRecyclerView.setAdapter(foodNameAdapter);
|
||||
|
||||
|
||||
ingredientAdapter = new IngredientAdapter(null, mContext);
|
||||
ingredientRecyclerView.setAdapter(ingredientAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initListener() {
|
||||
swipeRefreshLayout.setOnRefreshListener(() -> {
|
||||
// 调用数据刷新的方法
|
||||
mPresenter.getRestInfoFoodsByType(restNo, "1");
|
||||
});
|
||||
searchEdit.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
@@ -170,12 +224,11 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
@Override
|
||||
public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
||||
// 当按了搜索之后关闭软键盘
|
||||
InputMethod.closeInputMethod(FoodSettingActivity.this, startButton);
|
||||
|
||||
startButton.setVisibility(View.VISIBLE);
|
||||
InputMethod.closeInputMethod(FoodSettingActivity.this, foodNameTv);
|
||||
|
||||
currentFoodInfo = (NewFoodInfoModel) adapter.getItem(position);
|
||||
currentFoodTv.setText(currentFoodInfo.getFoodName());
|
||||
foodNameTv.setText(currentFoodInfo.getFoodName());
|
||||
foodName.setText(currentFoodInfo.getFoodName());
|
||||
|
||||
List<NewFoodInfoModel> foodInfoModelList = foodNameAdapter.getData();
|
||||
for (NewFoodInfoModel foodInfoModel : foodInfoModelList) {
|
||||
@@ -184,17 +237,105 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
foodNameAdapter.getItem(position).setSelect(true);
|
||||
foodNameAdapter.notifyDataSetChanged();
|
||||
|
||||
mPresenter.getGoodsUseList(currentFoodInfo.getId(), 1000);
|
||||
inputLayout.setVisibility(View.VISIBLE);
|
||||
if (currentFoodInfo.isFirst()) {
|
||||
makeWeightEdit.setText(currentFoodInfo.getEstimateFoodWeight() + "");
|
||||
} else {
|
||||
makeWeightEdit.setText("");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ingredientAdapter.setOnItemClickListener(new OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
||||
setSelectIngredient(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setSelectIngredient(int position) {
|
||||
foodGoodsIndex = position;
|
||||
List<FoodGoodsInfo> foodGoodsInfos = ingredientAdapter.getData();
|
||||
for (FoodGoodsInfo foodInfoModel : foodGoodsInfos) {
|
||||
foodInfoModel.setSelect(false);
|
||||
}
|
||||
currentFoodGoodsInfo = ingredientAdapter.getItem(position);
|
||||
currentFoodGoodsInfo.setSelect(true);
|
||||
ingredientAdapter.notifyDataSetChanged();
|
||||
|
||||
@OnClick({R.id.setting_search_edit_cancel_img, R.id.back,
|
||||
R.id.start, R.id.currentWeight, R.id.zeroTv, R.id.zeroTitleTv})
|
||||
setIngredientInfoData(currentFoodGoodsInfo);
|
||||
}
|
||||
|
||||
private void setIngredientInfoData(FoodGoodsInfo info) {
|
||||
ingredientName.setText(extractFirstPart(info.getGoodsName()));
|
||||
switch (info.getMaterialType()) {//1主料 2辅料 3调料
|
||||
case 1:
|
||||
ingredientType.setText("主料");
|
||||
break;
|
||||
case 2:
|
||||
ingredientType.setText("辅料");
|
||||
break;
|
||||
}
|
||||
ingredientCalcWeight.setText(info.getUseWeight() + "");
|
||||
}
|
||||
|
||||
List<FoodGoodsInfo> currentGoodsInfos;
|
||||
|
||||
@OnClick({R.id.setting_search_edit_cancel_img, R.id.reloadFoodListTv, R.id.ingredientOkTv,
|
||||
R.id.one, R.id.two, R.id.three, R.id.four, R.id.five, R.id.six, R.id.seven, R.id.eight,
|
||||
R.id.nine, R.id.dot, R.id.zero, R.id.del, R.id.inputOkTv, R.id.leftZeroTv, R.id.makingCancelTv,
|
||||
R.id.calStartTv, R.id.rightZeroTv, R.id.okTv})
|
||||
public void onViewClicked(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.inputOkTv:
|
||||
if (currentFoodInfo != null) {
|
||||
// currentFoodInfo.setFirst(false);
|
||||
String inputWeight = makeWeightEdit.getText().toString();
|
||||
totalWeightTv.setText(inputWeight + "kg");
|
||||
mPresenter.getGoodsUseList(currentFoodInfo.getFoodId(), inputWeight);
|
||||
} else {
|
||||
showToast("请选择菜品");
|
||||
}
|
||||
break;
|
||||
case R.id.ingredientOkTv:
|
||||
// if (Math.abs(AppUtil.extractNumber(ingredientCalcPctTv.getText().toString())) > 5) {
|
||||
//
|
||||
// new XPopup.Builder(mContext)
|
||||
// .asCustom(foodWarningPopup)
|
||||
// .show();
|
||||
// return;
|
||||
// }
|
||||
|
||||
currentFoodGoodsInfo.setUseRealWeight(leftDeviceWeight);
|
||||
ingredientAdapter.notifyDataSetChanged();
|
||||
|
||||
if (ingredientAdapter.getData().size() - 1 > foodGoodsIndex) {
|
||||
foodGoodsIndex++;
|
||||
setSelectIngredient(foodGoodsIndex);
|
||||
ingredientRecyclerView.smoothScrollToPosition(foodGoodsIndex);
|
||||
currentFoodGoodsInfo = ingredientAdapter.getData().get(foodGoodsIndex);
|
||||
} else {
|
||||
currentGoodsInfos = ingredientAdapter.getData();
|
||||
for (FoodGoodsInfo foodGoodsInfo : currentGoodsInfos) {
|
||||
if (foodGoodsInfo.getUseRealWeight() == 0) {
|
||||
showToast("请确认所有食材重量已录入完成");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ingredientLayout.setVisibility(View.GONE);
|
||||
foodMakingLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
break;
|
||||
case R.id.makingCancelTv:
|
||||
ingredientLayout.setVisibility(View.VISIBLE);
|
||||
foodMakingLayout.setVisibility(View.GONE);
|
||||
break;
|
||||
case R.id.calStartTv:
|
||||
foodMakingLayout.setVisibility(View.GONE);
|
||||
endWeightLayout.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case R.id.title_name_tv:
|
||||
break;
|
||||
case R.id.title_back_iv:
|
||||
@@ -204,31 +345,68 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
searchEdit.setText(null);
|
||||
InputMethod.closeInputMethod(this, view);
|
||||
|
||||
|
||||
if (foodTagList == null || foodTagList.size() == 0) {
|
||||
// myFlowAdapters = new MyFlowAdapters(this, allFoodList);
|
||||
|
||||
foodNameAdapter.setList(allFoodList);
|
||||
foodAdapterSetData(allFoodList);
|
||||
} else {
|
||||
foodNameAdapter.setList(foodTagList);
|
||||
foodAdapterSetData(foodTagList);
|
||||
}
|
||||
break;
|
||||
// case R.id.zeroTitleTv:
|
||||
// showProgress("请稍候...");
|
||||
// weightZero(currentDeviceIndex);
|
||||
// break;
|
||||
case R.id.leftZeroTv:
|
||||
weightZero(LEFT_WEIGHT_INDEX);
|
||||
break;
|
||||
case R.id.rightZeroTv:
|
||||
weightZero(RIGHT_WEIGHT_INDEX);
|
||||
break;
|
||||
case R.id.okTv:
|
||||
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("foodId", currentFoodGoodsInfo.getFoodId());
|
||||
hashMap.put("foodWeight", rightDeviceWeight);
|
||||
hashMap.put("voList", currentGoodsInfos);
|
||||
new Gson().toJson(hashMap);
|
||||
L.e(new Gson().toJson(hashMap));
|
||||
mPresenter.saveFoodGoodsUseInfo(currentFoodGoodsInfo.getFoodId(), rightDeviceWeight, currentGoodsInfos);
|
||||
break;
|
||||
case R.id.back:
|
||||
finish();
|
||||
case R.id.reloadFoodListTv:
|
||||
mPresenter.getRestInfoFoodsByType(restNo, "1");
|
||||
break;
|
||||
case R.id.start:
|
||||
currentDeviceIndex=RIGHT_WEIGHT_INDEX;
|
||||
case R.id.one:
|
||||
case R.id.two:
|
||||
case R.id.three:
|
||||
case R.id.four:
|
||||
case R.id.five:
|
||||
case R.id.six:
|
||||
case R.id.seven:
|
||||
case R.id.eight:
|
||||
case R.id.nine:
|
||||
case R.id.zero:
|
||||
case R.id.dot:
|
||||
String txt = makeWeightEdit.getText().toString();
|
||||
TextView tv = null;
|
||||
if (view instanceof TextView) {
|
||||
tv = (TextView) view;
|
||||
}
|
||||
String inputValue = null;
|
||||
if (view != null) {
|
||||
inputValue = tv.getText().toString();
|
||||
}
|
||||
makeWeightEdit.setText(inputValue);
|
||||
if (!TextUtils.isEmpty(txt)) {
|
||||
makeWeightEdit.setText(txt + inputValue);
|
||||
} else {
|
||||
makeWeightEdit.setText(inputValue);
|
||||
}
|
||||
break;
|
||||
case R.id.currentWeight:
|
||||
currentDeviceIndex=RIGHT_WEIGHT_INDEX;
|
||||
break;
|
||||
case R.id.zeroTitleTv:
|
||||
showProgress("请稍候...");
|
||||
weightZero(currentDeviceIndex);
|
||||
break;
|
||||
case R.id.zeroTv:
|
||||
weightTare(currentDeviceIndex);
|
||||
case R.id.del:
|
||||
txt = makeWeightEdit.getText().toString();
|
||||
int length = txt.length();
|
||||
if (length > 0)
|
||||
makeWeightEdit.setText(txt.substring(0, length - 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -245,22 +423,39 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
|
||||
@Override
|
||||
public void getFoodListSuccess(ArrayList<NewFoodInfoModel> list, String type) {
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
for (NewFoodInfoModel foodInfoModel : list) {
|
||||
for (String foodId : finishedFoodSet) {
|
||||
if (foodId.equals(foodInfoModel.getFoodId())) {
|
||||
foodInfoModel.setFirst(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (type) {
|
||||
case "0":
|
||||
allFoodList = list;
|
||||
L.e("FoodListSize===" + allFoodList.size());
|
||||
if (foodTagList == null || foodTagList.size() == 0) {
|
||||
foodNameAdapter.setList(allFoodList);
|
||||
foodAdapterSetData(allFoodList);
|
||||
}
|
||||
break;
|
||||
case "1":
|
||||
foodTagList = list;
|
||||
foodNameAdapter.setList(foodTagList);
|
||||
foodAdapterSetData(foodTagList);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void foodAdapterSetData(ArrayList<NewFoodInfoModel> list) {
|
||||
foodNameAdapter.setList(list);
|
||||
if (foodNameAdapter.getData() != null && foodNameAdapter.getData().size() > 0) {
|
||||
foodListEmptyLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
foodListEmptyLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFoodListFail(String info) {
|
||||
|
||||
@@ -286,17 +481,12 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
|
||||
@Override
|
||||
public void addFoodWeightSuccess(String info) {
|
||||
String currentFoodInfoStr = Convert.toJson(currentFoodInfo);
|
||||
L.e(currentFoodInfoStr);
|
||||
PrefUtils.setString(FoodSettingActivity.this, CURRENT_FOOD_DATA, currentFoodInfoStr);
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFoodWeightFail(String info) {
|
||||
hideProgress();
|
||||
showToast(info);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,7 +529,7 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
public void searchFoodListSuccess(ArrayList<NewFoodInfoModel> list) {
|
||||
searchResultFoodList = list;
|
||||
|
||||
foodNameAdapter.setList(searchResultFoodList);
|
||||
foodAdapterSetData(searchResultFoodList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -348,20 +538,33 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
}
|
||||
|
||||
ArrayList<FoodGoodsInfo> foodGoodsInfoArrayList;
|
||||
private FoodGoodsInfo currentFoodGoodsInfo;
|
||||
private int foodGoodsIndex = 0;
|
||||
|
||||
@Override
|
||||
public void getGoodsUseListSuccess(String info) {
|
||||
try {
|
||||
makeWeightEdit.setText("");
|
||||
JSONObject jsonObject = new JSONObject(info);
|
||||
foodGoodsInfoArrayList = Convert.fromJson(jsonObject.optString("voList"), new TypeToken<ArrayList<FoodGoodsInfo>>() {
|
||||
}.getType());
|
||||
|
||||
if (foodGoodsInfoArrayList.size() > 0) {
|
||||
currentFoodGoodsInfo = foodGoodsInfoArrayList.get(0);
|
||||
currentFoodGoodsInfo.setSelect(true);
|
||||
foodGoodsIndex = 0;
|
||||
setIngredientInfoData(currentFoodGoodsInfo);
|
||||
}
|
||||
ingredientAdapter.setList(foodGoodsInfoArrayList);
|
||||
L.e("size===" + foodGoodsInfoArrayList.size());
|
||||
|
||||
inputLayout.setVisibility(View.GONE);
|
||||
ingredientLayout.setVisibility(View.VISIBLE);
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getGoodsUseListFail(String info) {
|
||||
|
||||
@@ -369,7 +572,14 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
|
||||
@Override
|
||||
public void saveFoodGoodsUseInfoSuccess(String info) {
|
||||
showToast(info);
|
||||
endWeightLayout.setVisibility(View.GONE);
|
||||
inputLayout.setVisibility(View.VISIBLE);
|
||||
if (currentFoodInfo != null) {
|
||||
finishedFoodSet.add(currentFoodInfo.getFoodId());
|
||||
}
|
||||
|
||||
mPresenter.getRestInfoFoodsByType(restNo, "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -452,24 +662,29 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
// }
|
||||
|
||||
|
||||
if (address == LEFT_WEIGHT_INDEX) {
|
||||
leftDeviceWeight = weight;
|
||||
}
|
||||
|
||||
if (address == RIGHT_WEIGHT_INDEX) {
|
||||
rightDeviceWeight = weight;
|
||||
}
|
||||
|
||||
|
||||
//======================================================
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (currentDeviceIndex == LEFT_WEIGHT_INDEX) {
|
||||
currentWeight.setText(formatWeight(leftDeviceWeight));
|
||||
} else if (currentDeviceIndex == RIGHT_WEIGHT_INDEX) {
|
||||
currentWeight.setText(formatWeight(rightDeviceWeight));
|
||||
if (address == LEFT_WEIGHT_INDEX) {
|
||||
double leftWeight = weight;
|
||||
leftDeviceWeight = leftWeight / 1000;
|
||||
leftWeightTv.setText(leftDeviceWeight + "");
|
||||
if (currentFoodGoodsInfo != null) {
|
||||
String pct = AppUtil.calcPct(currentFoodGoodsInfo.getUseWeight(), leftDeviceWeight);
|
||||
if (Math.abs(AppUtil.extractNumber(pct)) > 5) {
|
||||
ingredientCalcPctTv.setTextColor(getColor(R.color.chart_red));
|
||||
} else {
|
||||
ingredientCalcPctTv.setTextColor(getColor(R.color.chart_green));
|
||||
}
|
||||
ingredientCalcPctTv.setText(pct);
|
||||
}
|
||||
}
|
||||
if (address == RIGHT_WEIGHT_INDEX) {
|
||||
double rightWeight = weight;
|
||||
rightDeviceWeight = rightWeight / 1000;
|
||||
rightWeightTv.setText(rightDeviceWeight + "");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -534,11 +749,16 @@ public class FoodSettingActivity extends BaseActivity<FoodSettingView, FoodSetti
|
||||
|
||||
private String formatWeight(double weight) {
|
||||
// weight = weight < 0 ? 0 : weight;
|
||||
if (weight > 1000) {
|
||||
return "余量 " + AppUtil.formatDouble(weight / 1000) + " 千克";
|
||||
} else {
|
||||
return "余量 " + weight + " 克";
|
||||
}
|
||||
// if (weight > 1000) {
|
||||
leftWeightUnitTv.setText("千克");
|
||||
return "" + AppUtil.formatDouble(weight);// / 1000
|
||||
|
||||
// return "余量 " + AppUtil.formatDouble(weight / 1000) + " 千克";
|
||||
// } else {
|
||||
// leftWeightUnitTv.setText("克");
|
||||
// return "" + (int) weight;
|
||||
//// return "余量 " + weight + " 克";
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sw.st.ui.setting;
|
||||
|
||||
import com.sw.st.api.SwService;
|
||||
import com.sw.st.base.BasePresenter;
|
||||
import com.sw.st.model.FoodGoodsInfo;
|
||||
import com.sw.st.model.FoodInfoModel;
|
||||
import com.sw.st.model.NewFoodInfoModel;
|
||||
import com.sw.st.model.UserFaceModel;
|
||||
@@ -15,6 +16,7 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
@@ -23,6 +25,7 @@ public class FoodSettingPresenter extends BasePresenter<FoodSettingView> {
|
||||
|
||||
|
||||
public void getRestInfoFoodsByType(String restNo, String type) {
|
||||
getView().showProgress("加载中...");
|
||||
SwService.getRestInfoFoodsByType(restNo, type)
|
||||
.compose(RxSchedulersHelper.io_main())
|
||||
.compose(RxResultHelper.handleResult())
|
||||
@@ -33,20 +36,26 @@ public class FoodSettingPresenter extends BasePresenter<FoodSettingView> {
|
||||
|
||||
@Override
|
||||
public void _onNext(ArrayList<NewFoodInfoModel> info) {
|
||||
if (getView() != null)
|
||||
if (getView() != null) {
|
||||
getView().getFoodListSuccess(info, type);
|
||||
getView().hideProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void _onError(String errorMessage) {
|
||||
if (getView() != null)
|
||||
if (getView() != null) {
|
||||
getView().getFoodListFail(errorMessage);
|
||||
getView().hideProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void _onComplete() {
|
||||
if (getView() != null)
|
||||
if (getView() != null) {
|
||||
getView().hideProgress();
|
||||
getView().hideProgress();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -249,7 +258,8 @@ public class FoodSettingPresenter extends BasePresenter<FoodSettingView> {
|
||||
});
|
||||
}
|
||||
|
||||
public void getGoodsUseList(String foodId, double foodWeight) {
|
||||
public void getGoodsUseList(String foodId, String foodWeight) {
|
||||
getView().showProgress("请稍候...");
|
||||
SwService.getGoodsUseList(foodId, foodWeight)
|
||||
.compose(RxSchedulersHelper.io_main())
|
||||
.compose(RxResultHelper.handleJsonResponse())
|
||||
@@ -283,8 +293,51 @@ public class FoodSettingPresenter extends BasePresenter<FoodSettingView> {
|
||||
|
||||
@Override
|
||||
public void _onComplete() {
|
||||
if (getView() != null)
|
||||
getView().hideProgress();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveFoodGoodsUseInfo(String foodId, double foodWeight, List<FoodGoodsInfo> goodsInfo) {
|
||||
getView().showProgress("上传中...");
|
||||
SwService.saveFoodGoodsUseInfo(foodId, foodWeight, goodsInfo)
|
||||
.compose(RxSchedulersHelper.io_main())
|
||||
.compose(RxResultHelper.handleJsonResponse())
|
||||
.subscribe(new RxObserver<String>() {
|
||||
@Override
|
||||
public void _onSubscribe(Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void _onNext(String info) {
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(info);
|
||||
if (jsonObject.optInt("code") == 200) {
|
||||
getView().saveFoodGoodsUseInfoSuccess("提交成功");
|
||||
} else {
|
||||
getView().saveFoodGoodsUseInfoFail(jsonObject.optString("message"));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
if (getView() != null)
|
||||
getView().saveFoodGoodsUseInfoFail("数据解析异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void _onError(String errorMessage) {
|
||||
if (getView() != null)
|
||||
getView().saveFoodGoodsUseInfoFail(errorMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void _onComplete() {
|
||||
if (getView() != null) {
|
||||
getView().hideProgress();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.sw.st.ui.setting;
|
||||
|
||||
import static com.sw.st.utils.AppUtil.extractFirstPart;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
|
||||
import com.sw.st.R;
|
||||
import com.sw.st.model.FoodGoodsInfo;
|
||||
import com.sw.st.model.ScalesFoodList;
|
||||
import com.sw.st.utils.AppUtil;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class IngredientAdapter extends BaseQuickAdapter<FoodGoodsInfo, BaseViewHolder> {
|
||||
|
||||
Context context;
|
||||
|
||||
public IngredientAdapter(@Nullable List<FoodGoodsInfo> listModels, Context context) {
|
||||
super(R.layout.item_ingredient, listModels);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(@NotNull BaseViewHolder baseViewHolder, FoodGoodsInfo info) {
|
||||
|
||||
RelativeLayout relativeLayout = baseViewHolder.findView(R.id.ingredientItemLayout);
|
||||
// relativeLayout.setSelected(info.isSelect());
|
||||
|
||||
baseViewHolder.setText(R.id.nameTv, extractFirstPart(info.getGoodsName()));
|
||||
baseViewHolder.setText(R.id.weightTv, info.getUseRealWeight() + "kg");
|
||||
baseViewHolder.setText(R.id.calcWeightTv, info.getUseWeight() + "kg");
|
||||
String pct = AppUtil.calcPct(info.getUseWeight(), info.getUseRealWeight());
|
||||
baseViewHolder.setText(R.id.pctTv, pct);
|
||||
if (Math.abs(AppUtil.extractNumber(pct)) > 5) {
|
||||
baseViewHolder.setTextColor(R.id.pctTv, getContext().getColor(R.color.chart_red));
|
||||
} else {
|
||||
baseViewHolder.setTextColor(R.id.pctTv, getContext().getColor(R.color.chart_green));
|
||||
}
|
||||
switch (info.getMaterialType()) {//1主料 2辅料 3调料
|
||||
case 1:
|
||||
baseViewHolder.setImageResource(R.id.typeImg, R.mipmap.icon_zc);
|
||||
break;
|
||||
case 2:
|
||||
baseViewHolder.setImageResource(R.id.typeImg, R.mipmap.icon_fc);
|
||||
break;
|
||||
}
|
||||
if (info.getUseRealWeight() > 0) {
|
||||
baseViewHolder.setImageResource(R.id.checkImg, R.mipmap.img_checkbox_checked);
|
||||
relativeLayout.setBackgroundResource(R.drawable.a_item_ingredient_bg);
|
||||
// baseViewHolder.setText(R.id.pctTv, info.getUseWeight() + "");
|
||||
} else {
|
||||
baseViewHolder.setImageResource(R.id.checkImg, R.mipmap.img_checkbox_normal);
|
||||
// baseViewHolder.setText(R.id.pctTv, info.getUseWeight() + "");
|
||||
relativeLayout.setBackgroundResource(R.drawable.a_transparent_bg);
|
||||
}
|
||||
|
||||
if (info.isSelect()) {
|
||||
relativeLayout.setBackgroundResource(R.drawable.a_blue_line_bg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -658,4 +658,60 @@ public class AppUtil {
|
||||
int min2 = Math.min(min1, c); // 使用之前计算的最小值来比较第三个
|
||||
return min2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算偏移量
|
||||
*
|
||||
* @param weight
|
||||
* @param realWeight
|
||||
* @return
|
||||
*/
|
||||
public static String calcPct(double weight, double realWeight) {
|
||||
if (weight == 0 || realWeight == 0) {
|
||||
return "--";
|
||||
}
|
||||
double pct = (realWeight - weight) / weight;
|
||||
System.out.println(pct);
|
||||
String pctStr = "";
|
||||
if (pct > 0) {
|
||||
pctStr = "+" + (int) (pct * 100) + "%";
|
||||
} else {
|
||||
pctStr = (int) (pct * 100) + "%";
|
||||
}
|
||||
return pctStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取字符串中数字
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static int extractNumber(String input) {
|
||||
// 使用正则表达式替换掉字符串中所有非数字、非负号的字符
|
||||
String numberStr = input.replaceAll("[^-0-9.]", "");
|
||||
try {
|
||||
return Integer.parseInt(numberStr);
|
||||
} catch (Exception e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从逗号分隔的字符串中提取第一个逗号前的内容
|
||||
*
|
||||
* @param input 输入的逗号分隔的字符串
|
||||
* @return 第一个逗号前的字符串内容,如果没有逗号则返回原字符串
|
||||
*/
|
||||
public static String extractFirstPart(String input) {
|
||||
if (AppUtil.isEmpty(input)) {
|
||||
return "";
|
||||
}
|
||||
int commaIndex = input.indexOf(',');
|
||||
if (commaIndex == -1) {
|
||||
return input;
|
||||
}
|
||||
return input.substring(0, commaIndex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
|
||||
PrefUtils.setString(mContext, "crashUrl", InitActivity.BASE_URL + DeviceUrl);
|
||||
PrefUtils.setString(mContext, "crashData", Convert.toJson(requestMap));
|
||||
|
||||
Intent intent = new Intent(mContext, InitActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
// Intent intent = new Intent(mContext, InitActivity.class);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// mContext.startActivity(intent);
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.sw.st.view;
|
||||
|
||||
import static com.sw.st.ui.setting.FoodSettingActivity.REST_NAME;
|
||||
import static com.sw.st.ui.setting.FoodSettingActivity.REST_NUM;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.sw.st.R;
|
||||
import com.sw.st.api.SwService;
|
||||
import com.sw.st.net.helper.rxjavahelper.RxObserver;
|
||||
import com.sw.st.net.helper.rxjavahelper.RxResultHelper;
|
||||
import com.sw.st.net.helper.rxjavahelper.RxSchedulersHelper;
|
||||
import com.sw.st.utils.AppUtil;
|
||||
import com.sw.st.utils.InputMethod;
|
||||
import com.sw.st.utils.PrefUtils;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
||||
public class FoodWarningPopup extends CenterPopupView {
|
||||
private Context context;
|
||||
|
||||
|
||||
public FoodWarningPopup(@NonNull Context context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.popup_food_warning;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.okTv).setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
protected void onShow() {
|
||||
super.onShow();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getMaxHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//返回0表示让宽度撑满window,或者你可以返回一个任意宽度
|
||||
@Override
|
||||
protected int getMaxWidth() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/chart_blue" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/dp1"
|
||||
android:color="@color/chart_blue" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#494753" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/a_gray_fill_bg" android:state_pressed="true"></item>
|
||||
<item android:drawable="@drawable/a_gray_fill_bg" android:state_selected="true"></item>
|
||||
<item android:drawable="@drawable/a_gray_bg" android:state_pressed="false"></item>
|
||||
<item android:drawable="@drawable/a_gray_bg" android:state_selected="false"></item>
|
||||
<item android:drawable="@drawable/a_gray_bg"></item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#1E1E28" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/a_blue_line_bg" android:state_pressed="true"></item>
|
||||
<item android:drawable="@drawable/a_blue_line_bg" android:state_selected="true"></item>
|
||||
<item android:drawable="@drawable/a_transparent_bg" android:state_pressed="false"></item>
|
||||
<item android:drawable="@drawable/a_transparent_bg" android:state_selected="false"></item>
|
||||
<item android:drawable="@drawable/a_transparent_bg"></item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#292834" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#343240" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FE8402" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/a_orange_press_fill_bg" android:state_pressed="true"></item>
|
||||
<item android:drawable="@drawable/a_orange_press_fill_bg" android:state_selected="true"></item>
|
||||
<item android:drawable="@drawable/a_orange_fill_bg" android:state_pressed="false"></item>
|
||||
<item android:drawable="@drawable/a_orange_fill_bg" android:state_selected="false"></item>
|
||||
<item android:drawable="@drawable/a_orange_fill_bg"></item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FE8402" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#99FE8402" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#0000" />
|
||||
<corners android:radius="@dimen/dp6" />
|
||||
</shape>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- <item android:drawable="@drawable/bg_convex"-->
|
||||
<!-- android:state_pressed="false" />-->
|
||||
<!-- <item android:drawable="@drawable/bg_small_concave"-->
|
||||
<!-- android:state_pressed="true" />-->
|
||||
|
||||
|
||||
<item android:drawable="@drawable/a_blue_bg"
|
||||
android:state_pressed="true"></item>
|
||||
<item android:drawable="@drawable/a_blue_bg"
|
||||
android:state_selected="true"></item>
|
||||
<item android:drawable="@drawable/a_gray_bg"
|
||||
android:state_pressed="false"></item>
|
||||
<item android:drawable="@drawable/a_gray_bg"
|
||||
android:state_selected="false"></item>
|
||||
<item android:drawable="@drawable/a_gray_bg"></item>
|
||||
</selector>
|
||||
@@ -43,37 +43,34 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:paddingBottom="32dp">
|
||||
android:paddingLeft="@dimen/dp14"
|
||||
android:paddingRight="@dimen/dp14"
|
||||
android:paddingBottom="@dimen/dp14">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_small_concave"
|
||||
android:orientation="vertical"
|
||||
android:padding="22dp">
|
||||
android:layout_weight="3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/bg_convex"
|
||||
android:padding="26dp">
|
||||
android:layout_height="@dimen/dp64"
|
||||
android:background="@drawable/a_gray_bg">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/setting_search_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_small_concave"
|
||||
android:background="@null"
|
||||
android:cursorVisible="true"
|
||||
android:drawableLeft="@mipmap/icon_search"
|
||||
android:drawablePadding="@dimen/dp_4"
|
||||
android:hint="输入菜品名称"
|
||||
android:drawablePadding="@dimen/dp8"
|
||||
android:hint="请输入菜品名称"
|
||||
android:imeOptions="actionSearch"
|
||||
android:paddingLeft="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/themeBlackTextColor"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/themeDarkTextColor"
|
||||
android:textCursorDrawable="@drawable/cursor"
|
||||
android:textSize="18sp" />
|
||||
@@ -90,138 +87,460 @@
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- <ScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginTop="12dp"-->
|
||||
<!-- android:layout_weight="1">-->
|
||||
|
||||
<!-- <com.zhy.view.flowlayout.TagFlowLayout-->
|
||||
<!-- android:id="@+id/item_shopping_flowlayout"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginRight="24dp"-->
|
||||
<!-- app:max_select="1" />-->
|
||||
<!-- </ScrollView>-->
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/foodRecyclerView"
|
||||
<LinearLayout
|
||||
android:id="@+id/foodListEmptyLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#0000"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2" />
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_foodlist_empty" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp24"
|
||||
android:text="暂无食谱"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp24"
|
||||
android:text="请重试获取食谱"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reloadFoodListTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp24"
|
||||
android:background="@drawable/a_orange_bg"
|
||||
android:paddingLeft="@dimen/dp60"
|
||||
android:paddingTop="@dimen/dp16"
|
||||
android:paddingRight="@dimen/dp60"
|
||||
android:paddingBottom="@dimen/dp16"
|
||||
android:text="重试"
|
||||
android:textColor="#fffe8402"
|
||||
android:textSize="@dimen/sp24"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/foodRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:background="#0000"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_weight="7"
|
||||
android:background="@drawable/a_gray_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noDataTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="@dimen/dp60"
|
||||
android:text="暂无数据"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp24"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
android:id="@+id/inputLayout"
|
||||
layout="@layout/input_layout" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/foodTitleLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_small_concave"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/dp24"
|
||||
android:paddingTop="@dimen/dp22"
|
||||
android:paddingRight="@dimen/dp24"
|
||||
android:paddingBottom="@dimen/dp22">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/foodNameTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="--"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="计划熟重:"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/totalWeightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#0087FE"
|
||||
android:textSize="@dimen/sp18" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp1"
|
||||
android:background="#343240" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ingredientLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/ingredientRecyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginRight="@dimen/dp12"
|
||||
android:layout_weight="1"
|
||||
android:background="#0000"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.sw.st.view.TextDrawable
|
||||
android:id="@+id/zeroTitleTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:drawablePadding="12dp"
|
||||
android:text="当前展示菜品"
|
||||
android:textColor="@color/themeBlackTextColor"
|
||||
android:textSize="20sp"
|
||||
app:leftDrawable="@mipmap/icon_total_take_food"
|
||||
app:leftDrawableHeight="26dp"
|
||||
app:leftDrawableWidth="26dp" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#292834"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.sw.st.view.TextDrawable
|
||||
android:id="@+id/zeroTv"
|
||||
<TextView
|
||||
android:id="@+id/ingredientName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp22"
|
||||
android:text="--"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ingredientType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:text="--"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp150"
|
||||
android:layout_margin="@dimen/dp22"
|
||||
android:background="@drawable/a_gray_fill_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/leftWeightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="--"
|
||||
android:textColor="#ff00dfff"
|
||||
android:textSize="60sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/leftWeightUnitTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="@dimen/dp12"
|
||||
android:text="千克"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp16" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ingredientCalcWeight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:text="计算量(kg)"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp16" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ingredientCalcPctTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:text="实际偏移量(%)"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp16" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ingredientOkTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp64"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp32"
|
||||
android:layout_marginRight="@dimen/dp12"
|
||||
android:background="@drawable/a_orange_button"
|
||||
android:gravity="center"
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp30" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/leftZeroTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:layout_marginRight="@dimen/dp12"
|
||||
android:background="@drawable/a_gray_bg"
|
||||
android:paddingLeft="@dimen/dp26"
|
||||
android:paddingTop="@dimen/dp16"
|
||||
android:paddingRight="@dimen/dp26"
|
||||
android:paddingBottom="@dimen/dp16"
|
||||
android:text="清零"
|
||||
android:textColor="@color/themeBlackTextColor"
|
||||
android:textSize="20sp"
|
||||
app:leftDrawable="@mipmap/icon_zero"
|
||||
app:leftDrawableHeight="26dp"
|
||||
app:leftDrawableWidth="26dp" />
|
||||
android:textColor="#fffe8402"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/foodMakingLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/img_food_making" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp32"
|
||||
android:text="菜品制作中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp24"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="菜品制作完成请点击【"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="熟重计量"
|
||||
android:textColor="#FE8402"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="】提交数据"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp18" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp48"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/makingCancelTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/a_gray_button"
|
||||
android:paddingLeft="@dimen/dp72"
|
||||
android:paddingTop="@dimen/dp18"
|
||||
android:paddingRight="@dimen/dp72"
|
||||
android:paddingBottom="@dimen/dp18"
|
||||
android:text=" 取消 "
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/calStartTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp18"
|
||||
android:background="@drawable/a_orange_button"
|
||||
android:paddingLeft="@dimen/dp72"
|
||||
android:paddingTop="@dimen/dp18"
|
||||
android:paddingRight="@dimen/dp72"
|
||||
android:paddingBottom="@dimen/dp18"
|
||||
android:text="熟重计量"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/endWeightLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_convex"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setting_current_food_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/foodName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/themeDarkTextColor"
|
||||
android:textSize="32sp" />
|
||||
android:layout_marginTop="@dimen/dp22"
|
||||
android:text="--"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp24" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="@dimen/dp200"
|
||||
android:layout_marginTop="@dimen/dp24"
|
||||
android:background="@drawable/a_gray_fill_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rightWeightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="--"
|
||||
android:textColor="#ff00dfff"
|
||||
android:textSize="60sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rightWeightUnitTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="@dimen/dp12"
|
||||
android:text="千克"
|
||||
android:textColor="#ff6e6e82"
|
||||
android:textSize="@dimen/sp16" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/currentWeight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:id="@+id/okTv"
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="@dimen/dp64"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp24"
|
||||
android:layout_marginRight="@dimen/dp12"
|
||||
android:background="@drawable/a_orange_button"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/themeBlackTextColor"
|
||||
android:textSize="88sp" />
|
||||
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp30" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="38dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/rightZeroTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:layout_marginRight="@dimen/dp12"
|
||||
android:background="@drawable/a_gray_bg"
|
||||
android:paddingLeft="@dimen/dp26"
|
||||
android:paddingTop="@dimen/dp16"
|
||||
android:paddingRight="@dimen/dp26"
|
||||
android:paddingBottom="@dimen/dp16"
|
||||
android:text="清零"
|
||||
android:textColor="#fffe8402"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/back"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/new_ok_button"
|
||||
android:text="返回"
|
||||
android:textColor="@color/themeDarkTextColor"
|
||||
android:textSize="32sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_marginLeft="22dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/new_ok_button"
|
||||
android:text="开餐"
|
||||
android:textColor="#2AC79F"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp168"
|
||||
android:layout_marginRight="@dimen/dp168"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp6"
|
||||
android:layout_marginRight="@dimen/dp6"
|
||||
android:background="@drawable/a_gray_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/makeWeightEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp80"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:hint="输入制作量"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#464450"
|
||||
android:textSize="@dimen/sp32" />
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp1"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp12"
|
||||
android:background="#343240" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp20"
|
||||
android:layout_marginRight="@dimen/dp32"
|
||||
android:text="kg"
|
||||
android:textColor="#ff464450"
|
||||
android:textSize="@dimen/sp36" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/firstLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/one"
|
||||
style="@style/NumberTextView"
|
||||
android:text="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/two"
|
||||
style="@style/NumberTextView"
|
||||
android:text="2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/three"
|
||||
style="@style/NumberTextView"
|
||||
android:text="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/secondLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/four"
|
||||
style="@style/NumberTextView"
|
||||
android:text="4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/five"
|
||||
style="@style/NumberTextView"
|
||||
android:text="5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/six"
|
||||
style="@style/NumberTextView"
|
||||
android:text="6" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/thirdLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/seven"
|
||||
style="@style/NumberTextView"
|
||||
android:text="7" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/eight"
|
||||
style="@style/NumberTextView"
|
||||
android:text="8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nine"
|
||||
style="@style/NumberTextView"
|
||||
android:text="9" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fourLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dot"
|
||||
style="@style/NumberTextView"
|
||||
android:text="." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/zero"
|
||||
style="@style/NumberTextView"
|
||||
android:text="0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/del"
|
||||
style="@style/NumberTextView"
|
||||
android:paddingLeft="@dimen/dp42"
|
||||
android:paddingTop="@dimen/dp16"
|
||||
android:paddingRight="@dimen/dp42"
|
||||
android:paddingBottom="@dimen/dp16"
|
||||
app:srcCompat="@mipmap/icon_del" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inputOkTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp64"
|
||||
android:layout_marginLeft="@dimen/dp6"
|
||||
android:layout_marginTop="@dimen/dp6"
|
||||
android:layout_marginRight="@dimen/dp6"
|
||||
android:background="@drawable/a_orange_button"
|
||||
android:gravity="center"
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp30" />
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/foodLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:background="@drawable/new_food_item"
|
||||
android:paddingLeft="@dimen/dp20"
|
||||
android:paddingTop="@dimen/dp24"
|
||||
android:paddingRight="@dimen/dp24"
|
||||
android:paddingBottom="@dimen/dp20">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nameTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="菜品名称"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/nameTv"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/estimateWeightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="预计:-- kg"
|
||||
android:textColor="@color/color_6"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/weightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="实际:-- kg"
|
||||
android:textColor="#A9A9AB"
|
||||
android:textSize="@dimen/sp16" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/ingredientItemLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:background="@drawable/a_ingredient_item"
|
||||
android:padding="@dimen/dp12">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/line1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toLeftOf="@id/checkImg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/typeImg"
|
||||
android:layout_width="@dimen/dp18"
|
||||
android:layout_height="@dimen/dp18"
|
||||
android:src="@mipmap/icon_zc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nameTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp10"
|
||||
android:layout_weight="1"
|
||||
android:text="菜品名称"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/weightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="- kg"
|
||||
android:textColor="#6E6E82"
|
||||
android:textSize="@dimen/sp18" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/line1"
|
||||
android:layout_marginTop="@dimen/dp6"
|
||||
android:layout_toLeftOf="@id/checkImg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_zc"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/calcWeightTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp10"
|
||||
android:layout_weight="1"
|
||||
android:text="计算量"
|
||||
android:textColor="#6E6E82"
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp10"
|
||||
android:text="实际偏移量:"
|
||||
android:textColor="#6E6E82"
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pctTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="3%"
|
||||
android:textColor="#A9A9AB"
|
||||
android:textSize="@dimen/sp18" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/checkImg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/dp24"
|
||||
android:src="@mipmap/img_checkbox_normal" />
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="600dp"
|
||||
android:layout_height="360dp"
|
||||
android:background="@drawable/a_gray_fill_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/closeImg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp60"
|
||||
android:src="@mipmap/icon_food_warning" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/closeImg"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp30"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="@dimen/dp8"
|
||||
android:text="食材实际偏移量不可高于5%\n请调整后提交"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp1"
|
||||
android:layout_above="@id/okTv"
|
||||
android:background="#32323C" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/okTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp86"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center"
|
||||
android:text="知道了"
|
||||
android:textColor="#fffe8402"
|
||||
android:textSize="24sp" />
|
||||
</RelativeLayout>
|
||||
|
After Width: | Height: | Size: 638 B |
|
After Width: | Height: | Size: 476 B |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 872 B |
|
After Width: | Height: | Size: 355 B |
|
After Width: | Height: | Size: 950 B |
|
After Width: | Height: | Size: 958 B |
|
After Width: | Height: | Size: 3.0 KiB |
@@ -18,7 +18,7 @@
|
||||
<color name="chart_yellow">#FFD633</color>
|
||||
<color name="chart_red">#FF4F44</color>
|
||||
<color name="chart_blue">#3486DA</color>
|
||||
<color name="chart_green">#22E8FF</color>
|
||||
<color name="chart_green">#4EF591</color>
|
||||
|
||||
<color name="color_3">#FF333333</color>
|
||||
<color name="color_6">#FF666666</color>
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<color name="colorTransparent">#0000</color>
|
||||
<color name="themeTextColor">#F0E6DC</color>
|
||||
<color name="themeDarkTextColor">#78736E</color>
|
||||
<color name="themeDarkTextColor">#464450</color>
|
||||
|
||||
<color name="themeBlackTextColor">#78736E</color>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@android:color/white</item>
|
||||
<!-- <item name="android:fontFamily">@font/dakai</item>-->
|
||||
<!-- <item name="android:fontFamily">@font/dakai</item>-->
|
||||
</style>
|
||||
<!-- <item name="android:typeface">monospace</item>-->
|
||||
|
||||
@@ -85,4 +85,15 @@
|
||||
<item name="leftDrawableHeight">26dp</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="NumberTextView">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">@dimen/dp64</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:textSize">@dimen/sp36</item>
|
||||
<item name="android:textColor">@color/white</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_margin">@dimen/dp6</item>
|
||||
<item name="android:background">@drawable/a_num_bg</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||