Browse Source

修改新建配方

调味吧台
liup 6 months ago
parent
commit
009728ab46
21 changed files with 532 additions and 477 deletions
  1. +1
    -0
      app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java
  2. +13
    -0
      app/src/main/java/com/bonait/bnframework/event/ImageUrlSelectEvent.java
  3. +5
    -5
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupDetailAdapter.java
  4. +15
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupNameAdapter.java
  5. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/newgood_adapter.java
  6. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/pfsx_adapter.java
  7. +31
    -70
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java
  8. +4
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/ImageChooseActivity.java
  9. +42
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/AddGoodDialog.java
  10. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/CopyRecipeDialog.java
  11. +46
    -41
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java
  12. +2
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java
  13. +7
    -0
      app/src/main/res/drawable/bg_form.xml
  14. +6
    -0
      app/src/main/res/drawable/bg_form2.xml
  15. +6
    -0
      app/src/main/res/drawable/bg_form3.xml
  16. +4
    -16
      app/src/main/res/layout/activity_goodpeifang.xml
  17. +1
    -1
      app/src/main/res/layout/item/layout/dialog_add_good.xml
  18. +12
    -9
      app/src/main/res/layout/item/layout/dialog_add_good_info.xml
  19. +316
    -303
      app/src/main/res/layout/item/layout/goods_edit_layout.xml
  20. +6
    -10
      app/src/main/res/layout/item/layout/item_group_detail.xml
  21. +10
    -8
      app/src/main/res/layout/item/layout/item_group_name.xml

+ 1
- 0
app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java View File

@@ -1643,6 +1643,7 @@ public class QueryDB {
data.add(par);
}
}
LogUtils.d("GetGoodsSrecipeList 根据商品id查询配方信息 data.size="+data.size());
return data;
}



+ 13
- 0
app/src/main/java/com/bonait/bnframework/event/ImageUrlSelectEvent.java View File

@@ -0,0 +1,13 @@
package com.bonait.bnframework.event;

/**
* @author: liup
* @description:
* @date: 2024/6/7 16:51.
*/
public class ImageUrlSelectEvent {
public String url;
public ImageUrlSelectEvent(String url){
this.url = url;
}
}

+ 5
- 5
app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupDetailAdapter.java View File

@@ -55,9 +55,9 @@ public class GoodGroupDetailAdapter extends BaseAdapter<ResGoodsRecipe, GoodGrou
if(holder.binding.btnMaterialDelete.getTextSize()>28||holder.binding.btnMaterialDelete.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
holder.binding.btnMaterialDelete.setOnClickListener(view -> {
});
if(mData.get(position).value!=null && !mData.get(position).value.isEmpty()){
holder.binding.edittextWeight.setText(mData.get(position).value);
}
List<String> names = new ArrayList<>();
for(BPA_MATERIAL material : materilasList){
names.add(material.name);
@@ -100,12 +100,12 @@ public class GoodGroupDetailAdapter extends BaseAdapter<ResGoodsRecipe, GoodGrou

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
mData.get(position).value = holder.binding.edittextWeight.getText().toString();
}

@Override
public void afterTextChanged(Editable editable) {
mData.get(position).value = editable.toString();
}
});



+ 15
- 3
app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupNameAdapter.java View File

@@ -8,6 +8,7 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
@@ -63,13 +64,17 @@ public abstract class GoodGroupNameAdapter extends BaseAdapter<BPA_GOODSRECIPENA
onDelete(position,mData.get(position));
});
if(holder.binding.tvExpand.getText().toString().equals("收起")){
holder.binding.imgArrow.setBackgroundResource(R.mipmap.ic_arrow_down2);
holder.binding.llControl.setVisibility(View.VISIBLE);
holder.binding.recycleDetail.setVisibility(View.VISIBLE);
}else {
holder.binding.llControl.setVisibility(View.GONE);
holder.binding.recycleDetail.setVisibility(View.GONE);
holder.binding.imgArrow.setBackgroundResource(R.mipmap.ic_arrow_left2);
}
GoodGroupDetailAdapter detailAdapter = new GoodGroupDetailAdapter();
detailAdapter.setMaterilasList(materilasList);
detailAdapter.setNewData(QueryDB.GetGoodsSrecipeList(mData.get(position).id));
detailAdapter.setNewData(QueryDB.GetGoodsSreciperecipeList(mData.get(position).id));
holder.binding.recycleDetail.setAdapter(detailAdapter);
holder.binding.btnSave.setOnClickListener(v->{
ArrayList<ResGoodsRecipe> re= QueryDB.GetGoodsSreciperecipeList(mData.get(position).id);
@@ -101,20 +106,27 @@ public abstract class GoodGroupNameAdapter extends BaseAdapter<BPA_GOODSRECIPENA

holder.binding.llArrow.setOnClickListener(v->{
if(holder.binding.tvExpand.getText().toString().equals("展开")){
holder.binding.tvExpand.setText("展开");
holder.binding.imgArrow.setBackgroundResource(R.mipmap.ic_arrow_down2);
holder.binding.tvExpand.setText("收起");
holder.binding.recycleDetail.setVisibility(View.VISIBLE);
holder.binding.llControl.setVisibility(View.VISIBLE);

}else {
holder.binding.tvExpand.setText("收起");
holder.binding.imgArrow.setBackgroundResource(R.mipmap.ic_arrow_left2);
holder.binding.tvExpand.setText("展开");
holder.binding.recycleDetail.setVisibility(View.GONE);
holder.binding.llControl.setVisibility(View.GONE);
}
});
holder.binding.root.setOnClickListener(v->{
if(holder.binding.tvExpand.getText().toString().equals("展开")){
holder.binding.tvExpand.setText("收起");
holder.binding.recycleDetail.setVisibility(View.VISIBLE);
holder.binding.llControl.setVisibility(View.VISIBLE);
}else {
holder.binding.tvExpand.setText("展开");
holder.binding.recycleDetail.setVisibility(View.GONE);
holder.binding.llControl.setVisibility(View.GONE);
}
});
}


+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/adapter/newgood_adapter.java View File

@@ -90,13 +90,13 @@ public class newgood_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
myViewHolder.Tag_text.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MessageManager.getInstance().sendMessage(MessageName.ClickGoodNew,goods);
MessageManager.getInstance().sendMessage(MessageName.ClickGoodNew,new GoodsAPositionBean(currentPos,goods));
}
});
myViewHolder.ImageUrl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MessageManager.getInstance().sendMessage(MessageName.ClickGoodNew,goods);
MessageManager.getInstance().sendMessage(MessageName.ClickGoodNew,new GoodsAPositionBean(currentPos,goods));
}
});



+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/home/adapter/pfsx_adapter.java View File

@@ -82,7 +82,7 @@ public class pfsx_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
myViewHolder.recyclerView.setAdapter(zsxadapter);

// 设置要显示的图片和文字
myViewHolder.name.setText(bpa_goodproperty.name);
myViewHolder.name.setText(bpa_goodproperty.name+":");
}
}
@Override


+ 31
- 70
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java View File

@@ -60,9 +60,10 @@ import com.bonait.bnframework.common.model.mode.UpdateCloudGood;
import com.bonait.bnframework.common.oss.OssHelper;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.AddGoodDialog;
import com.bonait.bnframework.common.view.GoodEditDialog;
import com.bonait.bnframework.databinding.ActivityGoodpeifangBinding;
import com.bonait.bnframework.modules.home.fragment.GongnengFragment;
import com.bonait.bnframework.modules.home.fragment.mode.AddGoodDialog;
import com.bonait.bnframework.modules.home.fragment.mode.add_good_control;
import com.bonait.bnframework.modules.home.fragment.mode.add_pf_control;
import com.bonait.bnframework.modules.home.fragment.mode.add_pf_home_control;
@@ -89,6 +90,7 @@ import okhttp3.RequestBody;

public class GoodPeiFangActivity extends BaseActivity {

private ActivityGoodpeifangBinding viewBinding;
/**
* 顶部标题
*/
@@ -117,23 +119,7 @@ public class GoodPeiFangActivity extends BaseActivity {
@BindView(R.id.rv_right)
RecyclerView rv_right;

/**
* 增加商品
*/
@BindView(R.id.add_good)
add_good_control add_good;

// /**
// * 增加配方选择页
// */
// @BindView(R.id.add_pf_home)
// add_pf_home_control add_pf_home;
//
// /**
// * 增加配方
// */
// @BindView(R.id.add_pf)
// add_pf_control add_pf;
private AddGoodDialog addGoodDialog;

/**
* 商品类型
@@ -142,12 +128,13 @@ public class GoodPeiFangActivity extends BaseActivity {

private Context context;

private Activity activity;
private GoodPeiFangActivity activity;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_goodpeifang);
viewBinding = ActivityGoodpeifangBinding.inflate(getLayoutInflater());
setContentView(viewBinding.getRoot());

ButterKnife.bind(this);
activity = this;
@@ -156,7 +143,6 @@ public class GoodPeiFangActivity extends BaseActivity {
Initdata();
}


private int typePos = 0;
private void initTopBar() {
mTopBar.setTitle("商品配方管理");
@@ -171,10 +157,10 @@ public class GoodPeiFangActivity extends BaseActivity {
@Override
public void onMessage(Object msg) {
if (msg != null) {
GoodsAPositionBean xx = (GoodsAPositionBean) msg;
add_good.setData("保存", xx.goods, goodstypes, activity);
add_good.setVisibility(View.VISIBLE);
typePos = xx.position;
GoodsAPositionBean bean = (GoodsAPositionBean) msg;
typePos = bean.position;
viewBinding.goodEditView.setData(bean.goods,activity);
viewBinding.goodEditView.setVisibility(View.VISIBLE);
}
}
});
@@ -226,13 +212,14 @@ public class GoodPeiFangActivity extends BaseActivity {
@Override
public void onMessage(Object msg) {
if (msg != null) {
BPA_GOODS goods = (BPA_GOODS) msg;
add_pf_home.SetData(goods, goodstypes);
add_pf_home.setVisibility(View.VISIBLE);
GoodsAPositionBean bean = (GoodsAPositionBean) msg;
typePos = bean.position;
viewBinding.goodEditView.setData(bean.goods,activity);
viewBinding.goodEditView.setVisibility(View.VISIBLE);
}
}
});
/*

//增加商品
add_good.mListener = new MyClickListener() {
@@ -314,13 +301,9 @@ public class GoodPeiFangActivity extends BaseActivity {
ToastUtils.info("保存成功!!!");
}
}
};
};*/
}

/**
* 属性数据
*/
ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>();
public List<LinkMode> Fdata = new ArrayList<>();
private GoodLeftAdapter leftAdapter;
private GoodRightAdapter rightAdapter;
@@ -330,33 +313,6 @@ public class GoodPeiFangActivity extends BaseActivity {
*/
public void Initdata() {

bpa_goodproperties.clear();
ArrayList<BPA_GOODPROPERTY> da = QueryDB.GetGoodsPropertyALL("0");
for (BPA_GOODPROPERTY item : da) {
ResGoodProperty re = new ResGoodProperty();
re.id = item.id;
re.name = item.name;

ArrayList<BPA_GOODPROPERTY> zsx = QueryDB.GetGoodsPropertyALL(item.id);
re.child = new ArrayList<>();


ArrayList<ResGoodProperty> _chid = new ArrayList<>();
for (BPA_GOODPROPERTY k : zsx) {
ResGoodProperty m = new ResGoodProperty();
m.id = k.id;
m.name = k.name;
m.isSelect = false;
_chid.add(m);
}
re.child = _chid;
re.GoodsTypeId=item.GoodsTypeId;
re.sort= item.sort;
bpa_goodproperties.add(re);
}


//1.商品类型
goodstypes = QueryDB.GetGoodsTypeALL();

Fdata.clear();
@@ -452,24 +408,29 @@ public class GoodPeiFangActivity extends BaseActivity {
ToastUtils.info("请先创建至少一个分类");
return;
}
add_good.setData("保存", null, goodstypes, activity);
add_good.setVisibility(View.VISIBLE);
if(addGoodDialog == null){
addGoodDialog = new AddGoodDialog();
}
addGoodDialog.setSaveCallBack(new AddGoodDialog.SaveCallBack() {
@Override
public void onSave() {
BPA_GOODSTYPE bpaGoodstype = goodstypes.get(typePos);
ArrayList<BPA_GOODS> goodsm = QueryDB.GetGoodsTypeId(bpaGoodstype.id);
Fdata.set(typePos,new LinkMode(bpaGoodstype, Arrays.asList(goodsm.toArray()), false));
rightAdapter.notifyItemChanged(typePos);
ToastUtils.info("添加成功");
}
});
addGoodDialog.show(getSupportFragmentManager(),"添加商品名称");
break;
}
}

@Override
public void onDestroy() {
add_pf.destroy();
add_good.destroy();
add_pf_home.destroy();
super.onDestroy();
add_good.mListener = null;
add_pf_home.mListener = null;
add_pf.mListener = null;
goodstypes.clear();
goodstypes = null;

rv_right.setAdapter(null);
rv_left.setAdapter(null);
Glide.get(this).clearMemory();


+ 4
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/ImageChooseActivity.java View File

@@ -21,12 +21,15 @@ import com.bonait.bnframework.common.image.utils.LocalCacheUtils;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.event.ImageUrlSelectEvent;
import com.bonait.bnframework.modules.home.adapter.image_sp_adapter;
import com.bonait.bnframework.modules.home.fragment.mode.image_sp;
import com.bumptech.glide.Glide;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;

import org.greenrobot.eventbus.EventBus;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -81,6 +84,7 @@ public class ImageChooseActivity extends BaseActivity {
@Override
public void clickListener(View v, Object data) {
image_sp sp=(image_sp)data;
EventBus.getDefault().post(new ImageUrlSelectEvent(sp.url));
MessageManager.getInstance().sendMessage(MessageName.ClickImage,sp.url);
finish();
}


+ 42
- 4
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/AddGoodDialog.java View File

@@ -1,5 +1,6 @@
package com.bonait.bnframework.modules.home.fragment.mode;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
@@ -20,9 +21,16 @@ import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.DialogAddGoodInfoBinding;
import com.bonait.bnframework.event.ImageUrlSelectEvent;
import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -43,6 +51,7 @@ public class AddGoodDialog extends DialogFragment {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.DialogScale);
EventBus.getDefault().register(this);
}

@Nullable
@@ -65,8 +74,8 @@ public class AddGoodDialog extends DialogFragment {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.CENTER;
params.width = ViewGroup.LayoutParams.WRAP_CONTENT;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
window.setAttributes(params);
}
}
@@ -107,6 +116,14 @@ public class AddGoodDialog extends DialogFragment {
Data.foreignKeyRe=viewBinding.edittextFk.getText().toString();
Data.goodtype=mapTypes.get(viewBinding.spinner.getSelectedItem().toString());
QueryDB.AddGoods(Data);
if(saveCallBack!=null){
saveCallBack.onSave();
}
});
viewBinding.image.setOnClickListener(v->{
Intent intent = new Intent(getContext(), ImageChooseActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
});
}

@@ -122,8 +139,29 @@ public class AddGoodDialog extends DialogFragment {

private void initSpinner()
{
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(mapTypes.keySet()));
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text32_item, new ArrayList<>(mapTypes.keySet()));
adapter.setDropDownViewResource(R.layout.spinner_dropdown32_item);
viewBinding.spinner.setAdapter(adapter);
}
private SaveCallBack saveCallBack;

public void setSaveCallBack(SaveCallBack saveCallBack) {
this.saveCallBack = saveCallBack;
}

public interface SaveCallBack{
void onSave();
}

@Override
public void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}

//接收图片选择事件
@Subscribe(threadMode = ThreadMode.MAIN)
public void onImageSelectEvent(ImageUrlSelectEvent event){
new MyBitmapUtils().disPlay(viewBinding.image,event.url);
}
}

+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/CopyRecipeDialog.java View File

@@ -76,8 +76,8 @@ public class CopyRecipeDialog extends DialogFragment {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.CENTER;
params.width = ViewGroup.LayoutParams.WRAP_CONTENT;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
window.setAttributes(params);
}
}


+ 46
- 41
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java View File

@@ -53,7 +53,7 @@ import java.util.Map;

/**
* @author: liup
* @description:
* @description: 添加配方 修改商品
* @date: 2024/6/6 15:38.
*/
public class GoodsEditView extends LinearLayout {
@@ -210,6 +210,10 @@ public class GoodsEditView extends LinearLayout {
return;
}
viewBinding.addGroup.setText("修改名称");
if(ggids.isEmpty()&&!bpa_goodproperties.isEmpty()){
ToastUtils.info("请选择属性");
return;
}

BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids,goodsData.id);
if(goodsrecipename!=null)
@@ -217,15 +221,15 @@ public class GoodsEditView extends LinearLayout {
goodsrecipename.name = viewBinding.edittextGroup.getText().toString();
goodsrecipename.design=ggids;
goodsrecipename.goodsID=goodsData.id;
QueryDB.AddGoodsRecipeName(goodsrecipename);
ToastUtils.info("添加【"+goodsrecipename.name+"】配方成功");
QueryDB.UpdateGoodsRecipeName(goodsrecipename);
ToastUtils.info("修改【"+goodsrecipename.name+"】配方成功");
}else {
goodsrecipename = new BPA_GOODSRECIPENAME();
goodsrecipename.name = viewBinding.edittextGroup.getText().toString();
goodsrecipename.design=ggids;
goodsrecipename.goodsID=goodsData.id;
QueryDB.UpdateGoodsRecipeName(goodsrecipename);
ToastUtils.info("修改【"+goodsrecipename.name+"】配方成功");
QueryDB.AddGoodsRecipeName(goodsrecipename);
ToastUtils.info("新建【"+goodsrecipename.name+"】配方成功");
}
});
}
@@ -248,6 +252,9 @@ public class GoodsEditView extends LinearLayout {
}
}
}
if(!groupName.isEmpty()&&groupName.length()>1){
groupName = groupName.substring(1);
}

if (!ggids.isEmpty()) {
ggids = ggids.substring(0, ggids.length() - 1);
@@ -283,38 +290,41 @@ public class GoodsEditView extends LinearLayout {
}

bpa_goodproperties.clear();
ArrayList<BPA_GOODPROPERTY> parentAttributes = QueryDB.GetGoodsPropertyByTypeId(goodsData.goodtype);
for(BPA_GOODPROPERTY bpaGoodproperty : parentAttributes ){
ArrayList<BPA_GOODPROPERTY> zsx= QueryDB.GetGoodsPropertyALL(bpaGoodproperty.id);
ArrayList<ResGoodProperty> childList = new ArrayList<>();
for(BPA_GOODPROPERTY bean:zsx){
if(attributeNameList.contains(bean.id)){
ResGoodProperty child = new ResGoodProperty();
child.id = bean.id;
child.name = bean.name;
child.foreignKeyRe = bean.foreignKeyRe;
child.parentid = bpaGoodproperty.id;
child.sort = bean.sort;
child.GoodsTypeId = bean.GoodsTypeId;
child.isSelect = false;
childList.add(child);
}
ArrayList<ResGoodProperty> allGoodProperty = new ArrayList<>();
ArrayList<BPA_GOODPROPERTY> da = QueryDB.GetGoodsPropertyALL("0");
for (BPA_GOODPROPERTY item : da) {
ResGoodProperty re = new ResGoodProperty();
re.id = item.id;
re.name = item.name;

ArrayList<BPA_GOODPROPERTY> zsx = QueryDB.GetGoodsPropertyALL(item.id);
re.child = new ArrayList<>();

ArrayList<ResGoodProperty> _chid = new ArrayList<>();
for (BPA_GOODPROPERTY k : zsx) {
ResGoodProperty m = new ResGoodProperty();
m.id = k.id;
m.name = k.name;
m.isSelect = false;
_chid.add(m);
}
if(!childList.isEmpty()){
ResGoodProperty resGoodProperty = new ResGoodProperty();
resGoodProperty.id = bpaGoodproperty.id;
resGoodProperty.name = bpaGoodproperty.name;
resGoodProperty.foreignKeyRe = bpaGoodproperty.foreignKeyRe;
resGoodProperty.parentid = "";
resGoodProperty.sort = bpaGoodproperty.sort;
resGoodProperty.GoodsTypeId = bpaGoodproperty.GoodsTypeId;
resGoodProperty.isSelect = false;
resGoodProperty.child = new ArrayList<>(childList);
bpa_goodproperties.add(resGoodProperty);
re.child = _chid;
re.GoodsTypeId=item.GoodsTypeId;
re.sort= item.sort;
allGoodProperty.add(re);
}
for (ResGoodProperty pro:allGoodProperty)
{
if(pro.GoodsTypeId!=null && !pro.GoodsTypeId.isEmpty())
{
if(pro.GoodsTypeId.contains(goodsData.goodtype))
{
bpa_goodproperties.add(pro);
}
}

}


List<String> idList = new ArrayList<>();
for (ResGoodProperty item:bpa_goodproperties)
{
@@ -333,15 +343,12 @@ public class GoodsEditView extends LinearLayout {
@Override
public void onClickItem(View view, int position, String attributeId) {
if(hasGroup()){
viewBinding.tvGroupTip.setText("存在配方");
viewBinding.addGroup.setText("修改名称");
//todo

}else {
viewBinding.tvGroupTip.setText("不存在配方");
viewBinding.addGroup.setText("新建配方");
}
viewBinding.edittextGroup.setText(groupName);
viewBinding.edittextGroup.setText(goodsData.name +(groupName.isEmpty()?"":("—"+groupName)));
}
});
viewBinding.recyclerProperty.setAdapter(sxadapter);
@@ -349,15 +356,13 @@ public class GoodsEditView extends LinearLayout {
@Override
public void run() {
if(hasGroup()){
viewBinding.tvGroupTip.setText("存在配方");
viewBinding.addGroup.setText("修改名称");
}else {
viewBinding.tvGroupTip.setText("不存在配方");
viewBinding.addGroup.setText("新建配方");
}
viewBinding.edittextGroup.setText(groupName);
viewBinding.edittextGroup.setText(goodsData.name +(groupName.isEmpty()?"":("—"+groupName)));
}
},100);
},200);
}

/**


+ 2
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java View File

@@ -224,8 +224,8 @@ public class add_good_control extends LinearLayout {
public void onMessage(Object msg) {
if (msg != null) {
url=(String) msg;
// new MyBitmapUtils().disPlay(cpfm,url);
GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3);
new MyBitmapUtils().disPlay(cpfm,url);
// GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3);
}
}
});


+ 7
- 0
app/src/main/res/drawable/bg_form.xml View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

<stroke android:width="1dp" android:color="@color/color3"/>
<corners android:radius="@dimen/dp_10"/>
<solid android:color="@color/white"/>
</shape>

+ 6
- 0
app/src/main/res/drawable/bg_form2.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

<stroke android:width="1dp" android:color="@color/color3"/>
<solid android:color="@color/white"/>
</shape>

+ 6
- 0
app/src/main/res/drawable/bg_form3.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

<stroke android:width="1dp" android:color="@color/color3"/>
<solid android:color="@color/main_background"/>
</shape>

+ 4
- 16
app/src/main/res/layout/activity_goodpeifang.xml View File

@@ -128,22 +128,10 @@
android:layout_height="wrap_content"
android:background="@color/app_color_blue"/>

<FrameLayout
android:id="@+id/fl_content_goods"
<com.bonait.bnframework.modules.home.fragment.mode.GoodsEditView
android:id="@+id/good_edit_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"
tools:visibility="gone"
android:background="@color/white"
android:layout_height="match_parent">

<include
android:layout_height="match_parent"
android:layout_width="match_parent"
layout="@layout/goods_edit_layout"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
/>
</FrameLayout>
/>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 1
- 1
app/src/main/res/layout/item/layout/dialog_add_good.xml View File

@@ -12,7 +12,7 @@
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginBottom="60dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/common_bg_with_radius_and_border">


+ 12
- 9
app/src/main/res/layout/item/layout/dialog_add_good_info.xml View File

@@ -4,13 +4,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dialogbj"
android:focusable="true"
android:id="@+id/root"
android:clickable="true">
>

<RelativeLayout
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_centerInParent="true"
@@ -63,7 +62,7 @@
</LinearLayout>

<LinearLayout
android:layout_marginLeft="@dimen/dp_40"
android:layout_marginStart="@dimen/dp_40"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
@@ -72,11 +71,15 @@
android:layout_marginBottom="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:"
android:textSize="32sp"/>
android:focusable="true"
android:focusableInTouchMode="true"
android:textSize="32sp">
<requestFocus/>
</TextView>
<!--账号输入框-->
<EditText
android:id="@+id/edittext_name"
@@ -96,7 +99,7 @@
android:layout_marginBottom="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品外键:"
@@ -119,7 +122,7 @@
android:layout_marginBottom="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品分类:"


+ 316
- 303
app/src/main/res/layout/item/layout/goods_edit_layout.xml View File

@@ -3,347 +3,360 @@
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
android:background="@color/dialogbj"
android:orientation="vertical"
android:paddingStart="30dp"
android:paddingEnd="30dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_height="match_parent">

<RelativeLayout
android:id="@+id/close_from"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_gravity="end"
android:gravity="end"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="10dp"
>
<TextView
android:orientation="vertical"
android:background="@drawable/common_bg_with_radius_and_border"
android:paddingStart="30dp"
android:paddingEnd="30dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/close_from"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/black"
android:textSize="32sp"
android:text="商品编辑"
/>
<TextView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/close_image"
android:textColor="@color/white"/>
</RelativeLayout>
android:layout_gravity="end"
android:gravity="end"
android:layout_marginBottom="10dp"
android:background="@drawable/input_bj"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/black"
android:textSize="32sp"
android:text="商品编辑"
android:textStyle="bold"
/>
<TextView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/close_image"
android:textColor="@color/white"/>
</RelativeLayout>

<RelativeLayout
android:id="@+id/title_goods"
android:layout_width="match_parent"
android:layout_height="70dp">
<TextView
<RelativeLayout
android:id="@+id/title_goods"
android:layout_width="match_parent"
android:layout_height="70dp"
android:text="商品信息"
android:textStyle="bold"
android:textSize="32sp"
android:gravity="center_vertical"
/>
<TextView
android:id="@+id/tv_goods"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:text="展开"
android:textSize="32sp"
android:gravity="center_vertical"
android:textColor="@color/app_color_blue"
android:layout_marginEnd="70dp"
/>
<ImageView
android:id="@+id/ic_arrow_goods"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_arrow_left"
/>
</RelativeLayout>


<RelativeLayout
android:id="@+id/content_goods"
android:layout_width="match_parent"
android:layout_below="@id/title_goods"
android:visibility="gone"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
tools:visibility="visible"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/img_goods"
android:layout_width="160dp"
android:layout_height="100dp"
android:layout_marginStart="3dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:src="@mipmap/loading3" />
android:background="@drawable/input_bj"
android:layout_height="70dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="点击修改封面"
android:textSize="18dp"/>
</LinearLayout>
android:layout_height="70dp"
android:text="商品信息"
android:textStyle="bold"
android:textSize="32sp"
android:gravity="center_vertical"
/>
<TextView
android:id="@+id/tv_goods"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:text="展开"
android:textSize="26sp"
android:gravity="center_vertical"
android:textColor="@color/app_color_blue"
android:layout_marginEnd="70dp"
/>

<LinearLayout
android:layout_toRightOf="@id/ll_img"
<ImageView
android:id="@+id/ic_arrow_goods"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_arrow_left"
/>
</RelativeLayout>


<RelativeLayout
android:id="@+id/content_goods"
android:layout_width="match_parent"
android:layout_below="@id/title_goods"
android:visibility="gone"
android:layout_marginStart="20dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="12dp"
android:layout_marginEnd="20dp"
android:layout_width="800dp"
android:layout_marginTop="5dp"
tools:visibility="visible"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<LinearLayout
android:id="@+id/ll_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:"
android:orientation="vertical">
<ImageView
android:id="@+id/img_goods"
android:layout_width="160dp"
android:layout_height="100dp"
android:layout_marginStart="3dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="3dp"
android:layout_marginBottom="3dp"
android:src="@mipmap/loading3" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="点击修改封面"
android:textSize="22sp"/>
</LinearLayout>

<LinearLayout
android:layout_toRightOf="@id/ll_img"
android:layout_marginStart="20dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="12dp"
android:layout_marginEnd="20dp"
android:layout_width="600dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品名称:"
android:textSize="26sp"/>
<!--账号输入框-->
<EditText
android:id="@+id/edittext_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:maxLength="30"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>

<LinearLayout
android:layout_toRightOf="@id/ll_img"
android:layout_marginTop="80dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="12dp"
android:layout_width="600dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品外键:"
android:textSize="26sp"/>
<!--账号输入框-->
<EditText
android:id="@+id/edittext_fk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>

<Button
android:id="@+id/update_goods"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_marginEnd="40dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/bg_btn_login_selected"
android:text="修改商品"
android:textColor="@color/white"
android:textSize="32sp"/>
<!--账号输入框-->
<EditText
android:id="@+id/edittext_name"
</RelativeLayout>

<RelativeLayout
android:id="@+id/title_attribute"
android:layout_width="match_parent"
android:background="@drawable/input_bj"
android:layout_height="70dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:maxLength="30"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>
android:layout_height="70dp"
android:text="属性选择"
android:textStyle="bold"
android:textSize="32sp"
android:gravity="center_vertical"
/>
<TextView
android:id="@+id/tv_arrow_attribute"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:text="展开"
android:textSize="26sp"
android:gravity="center_vertical"
android:textColor="@color/app_color_blue"
android:layout_marginEnd="70dp"
/>

<ImageView
android:id="@+id/ic_arrow_attribute"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_arrow_left"
/>
</RelativeLayout>

<LinearLayout
android:layout_toRightOf="@id/ll_img"
android:layout_marginTop="80dp"
android:id="@+id/content_attribut"
android:layout_width="match_parent"
android:layout_marginStart="20dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"
android:layout_marginEnd="20dp"
android:layout_marginBottom="12dp"
android:layout_width="800dp"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="商品外键:"
android:textSize="32sp"/>
<!--账号输入框-->
<EditText
android:id="@+id/edittext_fk"
<LinearLayout
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="配方名称:"
android:textSize="26sp"/>
<!--输入框-->
<EditText
android:id="@+id/edittext_group"
android:layout_width="670dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:maxLength="30"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
tools:text="泡椒鸡杂面_清汤干拌_标准_大份"
android:textSize="32sp" />

<Button
android:id="@+id/add_group"
android:layout_width="200dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:background="@drawable/bg_btn_login_selected"
android:text="新建配方"
android:textColor="@color/white"
android:textSize="32sp"/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_property"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
android:background="@drawable/bg_form"
android:paddingTop="5dp"
android:paddingBottom="5dp"
/>
</LinearLayout>

<Button
android:id="@+id/update_goods"
android:layout_width="200dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/bg_btn_login_selected"
android:text="修改商品"
android:textColor="@color/white"
android:textSize="32sp"/>
</RelativeLayout>

<RelativeLayout
android:id="@+id/title_attribute"
android:layout_width="match_parent"
android:layout_height="70dp">
<TextView
<RelativeLayout
android:id="@+id/title_detail"
android:layout_width="match_parent"
android:layout_height="70dp"
android:text="属性选择"
android:textStyle="bold"
android:textSize="32sp"
android:gravity="center_vertical"
/>
<TextView
android:id="@+id/tv_arrow_attribute"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:text="展开"
android:textSize="32sp"
android:gravity="center_vertical"
android:textColor="@color/app_color_blue"
android:layout_marginEnd="70dp"
/>

<ImageView
android:id="@+id/ic_arrow_attribute"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_arrow_left"
/>
</RelativeLayout>

<LinearLayout
android:id="@+id/content_attribut"
android:layout_width="match_parent"
android:layout_marginStart="20dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_marginTop="5dp"
android:layout_marginBottom="12dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="配方名称:"
android:textSize="32sp"/>
<!--输入框-->
<EditText
android:id="@+id/edittext_group"
android:layout_width="700dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:maxLength="30"
android:hint="请输入"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
tools:text="泡椒鸡杂面_清汤干拌_标准_大份"
android:textSize="32sp" />
android:background="@drawable/input_bj"
android:layout_height="70dp">
<TextView
android:layout_width="match_parent"
android:layout_height="70dp"
android:text="配方详情"
android:textStyle="bold"
android:textSize="32sp"
android:gravity="center_vertical"
/>
<TextView
android:id="@+id/tv_group_tip"
android:id="@+id/tv_arrow_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:text="收起"
android:textSize="26sp"
android:gravity="center_vertical"
android:textColor="@color/app_color_blue"
tools:text="存在配方"
android:textSize="24sp"
android:layout_marginStart="20dp"
android:layout_marginEnd="70dp"
/>
<Button
android:id="@+id/add_group"
android:layout_width="200dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:background="@drawable/bg_btn_login_selected"
android:text="新建配方"
android:textColor="@color/white"
android:textSize="32sp"/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_property"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>

<RelativeLayout
android:id="@+id/title_detail"
android:layout_width="match_parent"
android:layout_height="70dp">
<TextView
android:layout_width="match_parent"
android:layout_height="70dp"
android:text="配方详情"
android:textStyle="bold"
android:textSize="32sp"
android:gravity="center_vertical"
/>
<TextView
android:id="@+id/tv_arrow_detail"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:text="收起"
android:textSize="32sp"
android:gravity="center_vertical"
android:textColor="@color/app_color_blue"
android:layout_marginEnd="70dp"
/>

<ImageView
android:id="@+id/ic_arrow_detail"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_arrow_down"
/>
</RelativeLayout>
<ImageView
android:id="@+id/ic_arrow_detail"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_arrow_down"
/>
</RelativeLayout>

<LinearLayout
android:id="@+id/content_detail"
android:layout_width="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 表头 -->
<LinearLayout
android:id="@+id/content_detail"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="@color/app_color_blue"
android:layout_height="50dp">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="名称"
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/white"/>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="重量(g)"
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/white"/>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="0dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 表头 -->
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="@color/app_color_blue"
android:layout_height="50dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="名称"
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/white"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="重量(g)"
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/white"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="删除操作"
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/white"/>
</LinearLayout>
<!-- 数据 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="删除操作"
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/white"/>
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical"
/>
</LinearLayout>
<!-- 数据 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical"
/>
</LinearLayout>

</LinearLayout>

+ 6
- 10
app/src/main/res/layout/item/layout/item_group_detail.xml View File

@@ -2,8 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="60dp"
android:orientation="horizontal"
android:background="@drawable/bg_form3"
>
<TextView
android:layout_width="1dp"
@@ -15,13 +16,16 @@
android:layout_weight="3">

<Spinner
android:layout_marginStart="50dp"
android:id="@+id/spinner_name"
style="@style/commonSpinnerStyle"
android:background="@drawable/spinner_border_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
android:layout_marginEnd="3dp"
android:layout_marginStart="3dp"
android:textSize="26sp"/>

</LinearLayout>
@@ -39,7 +43,6 @@
android:id="@+id/edittext_weight"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/input_bj"
android:hint="请输入重量"
android:inputType="number|numberDecimal"
android:digits="0123456789."
@@ -66,14 +69,7 @@
android:text="删除"
android:gravity="center"
android:textSize="26sp"
android:background="@drawable/input_bj"
android:textColor="@color/red_primary"/>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/color3"
android:layout_marginEnd="50dp"
/>
</LinearLayout>
<TextView
android:layout_width="1dp"


+ 10
- 8
app/src/main/res/layout/item/layout/item_group_name.xml View File

@@ -8,9 +8,9 @@
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="@drawable/input_bj"
android:background="@drawable/bg_form2"
android:id="@+id/root"
android:layout_height="50dp">
android:layout_height="70dp">
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
@@ -21,7 +21,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
tools:text="名称"
tools:text="名\n称"
android:gravity="center"
android:textSize="26sp"
android:textColor="@color/black"/>
@@ -77,7 +77,7 @@
android:layout_height="match_parent"
android:gravity="center"
android:layout_weight="1">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:id="@+id/tv_expand"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -86,6 +86,7 @@
android:textSize="26sp"
android:textColor="@color/app_color_blue"/>
<ImageView
android:id="@+id/img_arrow"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@mipmap/ic_arrow_left2"
@@ -102,11 +103,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
/>
<LinearLayout
android:id="@+id/ll_control"
android:layout_width="match_parent"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:layout_height="60dp">
<TextView
android:id="@+id/btn_add"
@@ -116,8 +122,6 @@
android:textSize="26sp"
android:textColor="@color/white"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:layout_gravity="center_horizontal"
android:background="@drawable/bg_btn_login_selected"
/>
@@ -129,8 +133,6 @@
android:textSize="26sp"
android:textColor="@color/white"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:layout_gravity="center_horizontal"
android:background="@drawable/bg_btn_red_selected"
/>


Loading…
Cancel
Save