Commit 83c9d9a7 by 张建升

菜品添加食材相關 代码同步

parent 2dd5c457
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
@Data
public class DishDetailBean {
private int id;
private int biFoodId;// 非必须 菜品ID
private String dishesName;// 非必须 菜品名称
private int brandId;// number 非必须
private int restaurantId;// number 非必须
private int purchaseFoodId;// number 非必须 食材编号
private String foodName;// string 非必须 食材名称
private int consumeQuantity;// number 非必须 消耗个数
private String basicUnitName;// string 非必须 配置单位
private String foodNo;// string 非必须 食材编号
private int type;// number 非必须 状态 0 食材 1 细项
private boolean deletes;// 非必须 删除 false 未删除 true 删除
private String foodBasicUnit;// string 非必须 食材基本单位
private List<DeputyUnitBean> foodUnits;
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
@Data
public class DishDetailResultBean {
private boolean success;
private long sysTime;
private String errMsg;
private List<DishDetailBean> data;
}
......@@ -7,7 +7,7 @@ import java.util.List;
import lombok.Data;
@Data
public class DishesResultBean {
public class DishesResultBean { //Result
private boolean success;
private long sysTime;
......
......@@ -2,7 +2,10 @@ package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.BuyIngredientsBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailResultBean;
import com.gingersoft.supply_chain.mvp.bean.DishesResultBean;
import com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishNode;
import com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishesGroupNode;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
......@@ -21,21 +24,18 @@ public interface DishesContract {
* 加載菜品組數據
*/
void loadDishGroupInfo( List<DishesGroupNode> dishGroup);
void loadDishesInfo(DishesResultBean dishes);
/* 查询菜品食材信息*/
void loadDishesInfo(DishNode dishNode, DishDetailResultBean dishesDetail);
/**
* 加載失敗
*/
void loadFail();
void loadDishGroupFail();
/**
* 結束加載並且沒有更多數據了
*/
void finishLoad(boolean noData);
void loadDishesFail();
/**
* 加載食品
* 加載/修改菜品食材信息
*
* @param buyIngredientsBeans 顯示的食材
*/
......@@ -49,9 +49,9 @@ public interface DishesContract {
interface Model extends IModel {
Observable<DishesResultBean> getDishGroupData(Map<String, Object> map);
Observable<DishesResultBean> getDishesData(Map<String, Object> map);
Observable<DishDetailResultBean> getDishesDetailData(Map<String, Object> map);
Observable<BaseResult> bindDishes(Map<String, Object> map);
Observable<String> bindDishes(Map<String, Object> map);
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.gingersoft.supply_chain.mvp.model;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.DishDetailBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailResultBean;
import com.gingersoft.supply_chain.mvp.bean.DishesResultBean;
import com.gingersoft.supply_chain.mvp.server.SupplierServer;
import com.google.gson.Gson;
......@@ -44,13 +46,16 @@ public class DishesModel extends BaseModel implements DishesContract.Model {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).getDishesList(map);
}
@Override
public Observable<DishesResultBean> getDishesData(Map<String, Object> map) {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).getDishesList(map);
public Observable<DishDetailResultBean> getDishesDetailData(Map<String, Object> map) {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).getPurchaseDishesConversionList(map);
}
@Override
public Observable<BaseResult> bindDishes(Map<String, Object> map) {
return null;
public Observable<String> bindDishes(Map<String, Object> map) {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).bindFoods(map);
}
}
\ No newline at end of file
......@@ -3,9 +3,13 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.constans.AppConstant;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.DishDetailBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailResultBean;
import com.gingersoft.supply_chain.mvp.bean.DishesResultBean;
import com.gingersoft.supply_chain.mvp.contract.DishesContract;
import com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishNode;
import com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishesGroupNode;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -56,11 +60,11 @@ public class DishesPresenter extends BasePresenter<DishesContract.Model, DishesC
}
public void getDishesData() {
public void getDishGroupData() {
Map<String, Object> map = new HashMap<>(2);
AppConstant.addBrandId(map);
AppConstant.addRestaurantId(map);
mModel.getDishesData(map)//發送請求
mModel.getDishGroupData(map)//發送請求
.subscribeOn(Schedulers.io())//切換到io異步線程
.doOnSubscribe(disposable -> mRootView.showLoading(AppConstant.GET_INFO_LOADING))//顯示加載提示框
.subscribeOn(AndroidSchedulers.mainThread())//切換到主線程,上面的提示框就在主線程
......@@ -70,12 +74,45 @@ public class DishesPresenter extends BasePresenter<DishesContract.Model, DishesC
.observeOn(AndroidSchedulers.mainThread())//切換到主線程
.subscribe(new ErrorHandleSubscriber<DishesResultBean>(mErrorHandler) {//mErrorHandler是統一的錯誤處理
@Override
public void onNext(DishesResultBean orderCategoryBean) {//數據處理
if (orderCategoryBean.isSuccess()) {
List<DishesGroupNode> data = orderCategoryBean.getData();
public void onNext(DishesResultBean dishGroup) {//數據處理
if (dishGroup.isSuccess()) {
List<DishesGroupNode> data = dishGroup.getData();
mRootView.loadDishGroupInfo(data);
} else if (TextUtil.isNotEmptyOrNullOrUndefined(orderCategoryBean.getErrMsg())) {
mRootView.showMessage(orderCategoryBean.getErrMsg());
} else if (TextUtil.isNotEmptyOrNullOrUndefined(dishGroup.getErrMsg())) {
mRootView.showMessage(dishGroup.getErrMsg());
mRootView.loadDishGroupFail();
} else {
mRootView.showMessage(AppConstant.GET_INFO_ERROR);
mRootView.loadDishGroupFail();
}
}
});
}
public void getDishesDetailData(final DishNode dishNode) {
Map<String, Object> map = new HashMap<>(4);
map.put("biFoodId",String.valueOf(dishNode.getId()));
map.put("type","0");
AppConstant.addBrandId(map);
AppConstant.addRestaurantId(map);
mModel.getDishesDetailData(map)//發送請求
.subscribeOn(Schedulers.io())//切換到io異步線程
.doOnSubscribe(disposable -> mRootView.showLoading(AppConstant.GET_INFO_LOADING))//顯示加載提示框
.subscribeOn(AndroidSchedulers.mainThread())//切換到主線程,上面的提示框就在主線程
.observeOn(AndroidSchedulers.mainThread())//切換到主線程,隱藏提示框在主線程
.doAfterTerminate(() -> mRootView.hideLoading())//任務執行完成後,隱藏提示框
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))//綁定生命週期,頁面隱藏時斷開請求
.observeOn(AndroidSchedulers.mainThread())//切換到主線程
.subscribe(new ErrorHandleSubscriber<DishDetailResultBean>(mErrorHandler) {//mErrorHandler是統一的錯誤處理
@Override
public void onNext(DishDetailResultBean dishDetailBean) {//數據處理
if (dishDetailBean.isSuccess()) {
LogUtil.e("ZJS"," dishDetailBean"+dishDetailBean.toString());
dishNode.setDetailBean(dishDetailBean);
mRootView.loadDishesInfo(dishNode,dishDetailBean);
} else if (TextUtil.isNotEmptyOrNullOrUndefined(dishDetailBean.getErrMsg())) {
mRootView.showMessage(dishDetailBean.getErrMsg());
} else {
mRootView.showMessage(AppConstant.GET_INFO_ERROR);
}
......
package com.gingersoft.supply_chain.mvp.server;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.DishDetailBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailResultBean;
import com.gingersoft.supply_chain.mvp.bean.DishesResultBean;
import com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean;
import com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean;
......@@ -557,16 +559,25 @@ public interface SupplierServer {
Observable<DishesResultBean> getDishesList(@QueryMap Map<String, Object> map);
/**
* 查询某个菜品和食材配置关系表
* biFoodId 是 菜品id
* type 是 消耗种类: 0菜品 1细项 目前只传 0
* brandId 是 品牌id
* restaurantId 是 餐厅id
*/
@Headers({"Domain-Name: ricepon-purchase"})
@GET("purchaseDishesConversion/getPurchaseDishesConversionList" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<DishDetailResultBean> getPurchaseDishesConversionList(@QueryMap Map<String, Object> map);
/**
* 菜品綁定食材
* http://a.ricepon.com:58201/ricepon-purchase/api/
* purchaseDishesConversion/getPurchaseDishesConversionDishes?
* parentId=9615&restaurantId=25
* isParent: 0
*
*/
@Headers({"Domain-Name: ricepon-purchase"})
@GET("purchaseDishesConversion/getPurchaseDishesConversionDishes" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<DishesResultBean> bindFoods(@QueryMap Map<String, Object> map);
@GET("purchaseDishesConversion/addPurchaseDishesConversion" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<String> bindFoods(@QueryMap Map<String, Object> map);
}
package com.gingersoft.supply_chain.mvp.ui.adapter.dishes;
import android.content.Context;
import androidx.core.content.ContextCompat;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.DeputyUnitBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @author zjs.
* 菜品食材綁定列表
*/
public class DishDetailAdapter extends BaseQuickAdapter<DishDetailBean, BaseViewHolder> {
private Context context;
private int[] colors = new int[]{R.color.color_f9, R.color.white};
public DishDetailAdapter(Context context, List<DishDetailBean> foods) {
super(R.layout.item_dishes_foods, foods);
this.context = context;
addChildClickViewIds(R.id.tv_dishes_unit,R.id.tv_dishes_del);
// TODO: 2021/7/25 扶單位處理
}
@Override
protected void convert(@NotNull BaseViewHolder viewHolder, DishDetailBean item) {
viewHolder.setText(R.id.tv_dishes_name, item.getFoodName());//食材名字
viewHolder.setText(R.id.tv_dishes_unit, item.getBasicUnitName());//配置的單位
// viewHolder.setText(R.id.tv_dishes_unit, item.getUnitName());
List<DeputyUnitBean> deputyUnitBeans= item.getFoodUnits();//副單位
if (CollectionUtils.isNullOrEmpty(deputyUnitBeans)) {
// addChildClickViewIds(R.id.tv_dishes_unit); consumeQuantity
}
viewHolder.setText(R.id.tv_dishes_count, item.getConsumeQuantity());//消耗數量
}
}
......@@ -4,6 +4,7 @@ import androidx.annotation.Nullable;
import com.chad.library.adapter.base.entity.node.BaseExpandNode;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.gingersoft.supply_chain.mvp.bean.DishDetailResultBean;
import java.util.ArrayList;
import java.util.List;
......@@ -15,8 +16,11 @@ public class DishNode extends BaseExpandNode {
private boolean isParent;
private int seqNo;
private String foodName;
private boolean isSelect;
private List<BaseNode> childNode;
//判断是否有配置过
private DishDetailResultBean detailBean;
public void addChildNode(BaseNode baseNode) {
if (baseNode == null) {
......@@ -27,6 +31,23 @@ public class DishNode extends BaseExpandNode {
}
childNode.add(baseNode);
}
public boolean isSelect() {
return isSelect;
}
public DishDetailResultBean getDetailBean() {
return detailBean;
}
public void setDetailBean(DishDetailResultBean detailBean) {
this.detailBean = detailBean;
}
public void setSelect(boolean select) {
isSelect = select;
}
public int getId() {
return id;
}
......
......@@ -2,6 +2,8 @@ package com.gingersoft.supply_chain.mvp.ui.adapter.dishes;
import android.view.View;
import androidx.core.content.ContextCompat;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.chad.library.adapter.base.provider.BaseNodeProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
......@@ -25,12 +27,12 @@ public class DishProvider extends BaseNodeProvider {
public void convert(@NotNull BaseViewHolder helper, @NotNull BaseNode data) {
DishNode entity = (DishNode) data;
helper.setText(R.id.tv_dish_title, entity.getFoodName());
LogUtil.e("zjs","isExpanded()="+entity.isExpanded()+" getFoodName"+entity.getFoodName());
// if (entity.isExpanded()) {
// helper.setImageResource(R.id.iv_dishes_group_icon, R.drawable.ic_dishes_up);
// } else {
// helper.setImageResource(R.id.iv_dishes_group_icon, R.drawable.ic_dishes_down);
// }
if (entity.isSelect()) {
helper.setTextColor(R.id.tv_dish_title, ContextCompat.getColor(context, R.color.order_category_name_select_color));
}else {
helper.setTextColor(R.id.tv_dish_title, ContextCompat.getColor(context, R.color.color_18));
}
}
@Override
......
......@@ -2,6 +2,7 @@ package com.gingersoft.supply_chain.mvp.ui.adapter.dishes;
import com.chad.library.adapter.base.entity.node.BaseExpandNode;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import org.jetbrains.annotations.Nullable;
......@@ -15,10 +16,20 @@ public class DishesGroupNode extends BaseExpandNode{
private boolean isParent;
private int seqNo;
private String foodName;
//子项目项目选中
private int pos;
private List<DishNode> child;
private List<BaseNode> childNode;
public int getPos() {
return pos;
}
public void setPos(int pos) {
this.pos = pos;
}
public List<DishNode> getDishNodes() {
return child;
}
......@@ -97,19 +108,6 @@ public class DishesGroupNode extends BaseExpandNode{
return foodName;
}
@Override
public String toString() {
return "DishesGroupNode{" +
"id=" + id +
", parentId=" + parentId +
", restaurantId=" + restaurantId +
", isParent=" + isParent +
", seqNo=" + seqNo +
", foodName='" + foodName + '\'' +
", childNode=" + childNode +
'}';
}
@Nullable
@Override
public List<BaseNode> getChildNode() {
......@@ -117,6 +115,7 @@ public class DishesGroupNode extends BaseExpandNode{
childNode=new ArrayList<>();
}
if ( child != null) {
childNode.clear();
childNode.addAll(child);
}
return childNode;
......
......@@ -12,6 +12,7 @@ import com.chad.library.adapter.base.entity.node.BaseNode;
import com.chad.library.adapter.base.provider.BaseNodeProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.supply_chain.R;
import org.jetbrains.annotations.NotNull;
......@@ -91,6 +92,22 @@ public class DishesGroupProvider extends BaseNodeProvider {
@Override
public void onClick(@NotNull BaseViewHolder helper, @NotNull View view, BaseNode data, int position) {
// 这里使用payload进行增量刷新(避免整个item刷新导致的闪烁,不自然)
DishesGroupNode groupNode= (DishesGroupNode)data;
List<DishNode> dishNodes= groupNode.getDishNodes();
LogUtil.e("zjs","父菜单点击 onClick position ="+position+" getFoodName"+groupNode.getFoodName()+" groupNode="+groupNode.isExpanded());
if (CollectionUtils.isNotNullOrEmpty(dishNodes)) {
if (groupNode.getPos()==0) {
groupNode.setPos(1);
dishNodes.get(0).setSelect(true);
}
}
if (groupNode.isExpanded()) {
getAdapter().expandOrCollapse(position, true, true, DishesTreeAdapter.EXPAND_COLLAPSE_PAYLOAD);
}else {
getAdapter().expandAndCollapseOther(position,true);
}
}
}
......@@ -11,11 +11,14 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.R2;
import com.gingersoft.supply_chain.di.component.DaggerDishesComponent;
import com.gingersoft.supply_chain.mvp.bean.BuyIngredientsBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailBean;
import com.gingersoft.supply_chain.mvp.bean.DishDetailResultBean;
import com.gingersoft.supply_chain.mvp.bean.DishesResultBean;
import com.gingersoft.supply_chain.mvp.contract.DishesContract;
import com.gingersoft.supply_chain.mvp.presenter.DishesPresenter;
......@@ -44,7 +47,7 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
RecyclerView rvDishesGroup;
@BindView(R2.id.rv_dishes_food)
RecyclerView rvDishes;
private DishesTreeAdapter dishesTreeAdapter;
public static DishesFragment newInstance() {
DishesFragment fragment = new DishesFragment();
return fragment;
......@@ -69,22 +72,37 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
public void initData(@Nullable Bundle savedInstanceState) {
//setToolBarNoBack(toolbar, "Dishes");
initTopBar(topbarFoodIngredients, getString(R.string.str_dishes));
mPresenter.getDishesData();
mPresenter.getDishGroupData();
}
private void initDishes( List<DishesGroupNode> dishesGroupNodes){
final DishesTreeAdapter dishesTreeAdapter = new DishesTreeAdapter();
dishesTreeAdapter = new DishesTreeAdapter();
dishesTreeAdapter.setOnItemChildClickListener((adapter, view, position) -> {
BaseNode baseNode= dishesTreeAdapter.getItem(position);
if (baseNode instanceof DishesGroupNode) {
DishesGroupNode groupNode= (DishesGroupNode) baseNode;
LogUtil.e("ZJS"," groupNode position="+position +" getFoodName"+ groupNode.getFoodName());
}else {
DishNode dishNode= (DishNode) baseNode;
LogUtil.e("ZJS"," onItemChildClick position="+position +" getFoodName"+ dishNode.getFoodName());
if (baseNode instanceof DishNode) {
DishNode curDishNode= (DishNode) baseNode;
int ppos= dishesTreeAdapter.findParentNode(position);
DishesGroupNode pNode = (DishesGroupNode) dishesTreeAdapter.getItem(ppos);
if (pNode != null) {
int lastPost = pNode.getPos()+ppos;
int myPostion=position-ppos;
boolean isCur=position ==lastPost;
LogUtil.e("ZJS"," lastPost="+lastPost+" myPostion="+myPostion+" isCur="+isCur );
if (!isCur) {//当前点击的不是上次点击的项目
DishNode lastDishNode= (DishNode) dishesTreeAdapter.getItem(lastPost);
lastDishNode.setSelect(false);
curDishNode.setSelect(true);
pNode.setPos(myPostion);
dishesTreeAdapter.notifyItemChanged(lastPost);
dishesTreeAdapter.notifyItemChanged(position);
DishDetailResultBean detailBean= curDishNode.getDetailBean();
LogUtil.e("ZJS"," detailBean="+(detailBean==null));
mPresenter.getDishesDetailData(curDishNode);
}
}
LogUtil.e("ZJS"," onItemChildClick position="+position+" 父节点="+ppos +" getFoodName"+ curDishNode.getFoodName());
}
LogUtil.e("ZJS"," onItemChildClick position="+position );
});
dishesTreeAdapter.setList(dishesGroupNodes);
......@@ -98,17 +116,22 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
}
@Override
public void loadDishesInfo(DishesResultBean dishes) {
public void loadDishesInfo(DishNode dishNode,DishDetailResultBean dishesDetail) {
List<DishDetailBean> foods= dishesDetail.getData();
if (CollectionUtils.isNullOrEmpty(foods)) { //沒有加過食材 那麼只有add
}else {
}
}
@Override
public void loadFail() {
public void loadDishGroupFail() {
killMyself();
}
@Override
public void finishLoad(boolean noData) {
public void loadDishesFail() {
}
......
......@@ -16,26 +16,87 @@
app:qmui_topbar_title_color="@color/theme_white_color" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_height="0dp">
android:orientation="horizontal">
<!--菜品-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_dishes"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_weight="1">
</androidx.recyclerview.widget.RecyclerView>
<!-- 食材 -->
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_height="match_parent">
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent">
<TextView
style="@style/WareHouse_item_TextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="食材名稱" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:background="@color/supply_function_color" />
<TextView
style="@style/WareHouse_item_TextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="單位" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:background="@color/supply_function_color" />
<TextView
style="@style/WareHouse_item_TextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="數量" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:background="@color/supply_function_color" />
<TextView
android:layout_width="@dimen/dp_64"
android:gravity="center"
android:textColor="@color/white"
android:layout_height="wrap_content"
android:text="操作" />
</LinearLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:id="@+id/fresh_header"
......@@ -79,6 +140,8 @@
app:srlTextRelease="釋放查看下一分類"
app:srlTextSizeTitle="@dimen/dp_12" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
</LinearLayout>
......
......@@ -12,6 +12,8 @@
android:id="@+id/tv_dish_title"
android:layout_marginLeft="@dimen/dp_16"
android:padding="@dimen/dp_4"
tools:text="1222"
android:textColor="@color/color_18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_head_layout_res_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_dishes_name"
style="@style/WareHouse_item_TextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/color_18"
tools:text="食材名稱" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:background="@color/supply_function_color" />
<TextView
android:id="@+id/tv_dishes_unit"
style="@style/WareHouse_item_TextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/color_18"
tools:text="單位" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:background="@color/supply_function_color" />
<TextView
android:id="@+id/tv_dishes_count"
style="@style/WareHouse_item_TextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/color_18"
tools:text="數量" />
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:background="@color/supply_function_color" />
<ImageView
android:id="@+id/tv_dishes_del"
android:layout_width="@dimen/dp_64"
android:padding="@dimen/dp_12"
android:drawablePadding="@dimen/dp_6"
android:layout_height="wrap_content"
android:src="@drawable/ic_delete"
tools:text="" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_dishes_foot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/white"
android:gravity="center"
android:padding="@dimen/dp_6"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_dish_add"
style="@style/WareHouse_item_TextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:padding="@dimen/dp_6"
android:text="+ 選擇食材"
android:textColor="@color/theme_color"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_dish_done"
style="@style/WareHouse_item_TextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:padding="@dimen/dp_6"
android:text="完成"
android:textColor="@color/theme_color"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>
\ No newline at end of file
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