Kaynağa Gözat

修改bug

调味吧台
liup 5 ay önce
ebeveyn
işleme
bdcc39d270
26 değiştirilmiş dosya ile 2316 ekleme ve 2088 silme
  1. +2
    -2
      .idea/deploymentTargetSelector.xml
  2. +5
    -1
      app/src/main/java/com/bonait/bnframework/HBL/Dialog/WaitDialog.java
  3. +2
    -2
      app/src/main/java/com/bonait/bnframework/MainApplication.java
  4. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  5. +23
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/GoodsRecipeUtil.java
  6. +34
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/GoodsUtil.java
  7. +8
    -2
      app/src/main/java/com/bonait/bnframework/common/linktab/good/GoodLeftAdapter.java
  8. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/utils/ToastUtils.java
  9. +409
    -409
      app/src/main/java/com/bonait/bnframework/common/view/AddGoodDialog.java
  10. +3
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupDetailAdapter.java
  11. +4
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupNameAdapter.java
  12. +7
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/pfsx_adapter.java
  13. +7
    -7
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java
  14. +69
    -12
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java
  15. +5
    -4
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/AddGoodDialog.java
  16. +827
    -827
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodInformation.java
  17. +78
    -45
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java
  18. +411
    -411
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java
  19. +30
    -6
      app/src/main/res/layout/activity_goodpeifang.xml
  20. +4
    -2
      app/src/main/res/layout/datatab/layout/pfsx_item.xml
  21. +2
    -0
      app/src/main/res/layout/fragment_make_good.xml
  22. +1
    -1
      app/src/main/res/layout/item/layout/dialog_add_good.xml
  23. +3
    -2
      app/src/main/res/layout/item/layout/dialog_add_makegood.xml
  24. +306
    -278
      app/src/main/res/layout/item/layout/goods_edit_layout.xml
  25. +69
    -62
      app/src/main/res/layout/item/layout/item_group_detail.xml
  26. +4
    -4
      app/src/main/res/layout/item/layout/item_group_name.xml

+ 2
- 2
.idea/deploymentTargetSelector.xml Dosyayı Görüntüle

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2024-05-24T08:58:29.020582800Z">
<DropdownSelection timestamp="2024-06-08T07:52:37.356736400Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=f785e23a" />
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=24123a83" />
</handle>
</Target>
</DropdownSelection>


+ 5
- 1
app/src/main/java/com/bonait/bnframework/HBL/Dialog/WaitDialog.java Dosyayı Görüntüle

@@ -57,7 +57,11 @@ public class WaitDialog {
public void Dismiss(){
if(activityWeakReference.get()==null) return;
if(progressDialog==null) return;
activityWeakReference.get().runOnUiThread(()->{ progressDialog.dismiss();});
activityWeakReference.get().runOnUiThread(()->{
if(progressDialog!=null){
progressDialog.dismiss();
}
});
}

public void TimeOut(String info){


+ 2
- 2
app/src/main/java/com/bonait/bnframework/MainApplication.java Dosyayı Görüntüle

@@ -90,9 +90,9 @@ public class MainApplication extends Application {
context = getApplicationContext();
ConfigName.getInstance().dishesCon = this;
ConfigName.getInstance().app = this;
if(ConfigName.TEST){
// if(ConfigName.TEST){
initBugly();
}
// }
ThreadManager.get().inti();
}



+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java Dosyayı Görüntüle

@@ -46,7 +46,7 @@ import java.util.concurrent.ConcurrentHashMap;
* 配置文件
*/
public class ConfigName {
public static final boolean TEST = true;
public static final boolean TEST = false;
public static final boolean TEST2 = false;
//region 单例模式
private static ConfigName mInstance; //实例变量设置私有,防止直接通过类名访问


+ 23
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/GoodsRecipeUtil.java Dosyayı Görüntüle

@@ -1,9 +1,13 @@
package com.bonait.bnframework.common.db.util;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPENAME;

import java.util.ArrayList;
@@ -67,4 +71,23 @@ public class GoodsRecipeUtil {
return null;
}
}

/**
* 删除商品下的工序
*
* @param goodsID
* @return 是否成功
*/
public static boolean deleteGoodsRecipeByGoodId(String goodsID) {
boolean result = true;
SQLiteDatabase db = DBHelper.getInstance(ConfigName.getInstance().dishesCon).getWritableDatabase();
long delete = db.delete(BPA_GOODSRECIPENAME.class.getSimpleName(), "goodsID=?",
new String[]{goodsID});
if(delete <= 0){
result = false;
}
db.close();
LogUtils.d("deleteGoodsByTypeId 删除分类下的商品 result=" + result);
return result;
}
}

+ 34
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/GoodsUtil.java Dosyayı Görüntüle

@@ -0,0 +1,34 @@
package com.bonait.bnframework.common.db.util;

import android.database.sqlite.SQLiteDatabase;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.file.DBHelper;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;

/**
* @author: liup
* @description:
* @date: 2024/6/12 10:27.
*/
public class GoodsUtil {
/**
* 删除分类下的商品
*
* @param goodtype
* @return 是否成功
*/
public static boolean deleteGoodsByTypeId(String goodtype) {
boolean result = true;
SQLiteDatabase db = DBHelper.getInstance(ConfigName.getInstance().dishesCon).getWritableDatabase();
long delete = db.delete(BPA_GOODS.class.getSimpleName(), "goodtype=?",
new String[]{goodtype});
if(delete <= 0){
result = false;
}
db.close();
LogUtils.d("deleteGoodsByTypeId 删除分类下的商品 result=" + result);
return result;
}
}

+ 8
- 2
app/src/main/java/com/bonait/bnframework/common/linktab/good/GoodLeftAdapter.java Dosyayı Görüntüle

@@ -9,10 +9,11 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
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.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.util.GoodsRecipeUtil;
import com.bonait.bnframework.common.db.util.GoodsUtil;
import com.bonait.bnframework.common.linktab.LinkMode;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
@@ -134,7 +135,12 @@ public class GoodLeftAdapter extends BaseQuickAdapter<LinkMode, BaseViewHolder>
* @param index
*/
public void Detele(int index) {
BPA_GOODSTYPE bpaGoodstype = (BPA_GOODSTYPE) Fdata.get(index).type;
QueryDB.DeleteGoodsType((BPA_GOODSTYPE) Fdata.get(index).type);
for(BPA_GOODS goods : QueryDB.GetGoodsTypeId(bpaGoodstype.id)){
GoodsRecipeUtil.deleteGoodsRecipeByGoodId(goods.id);
}
GoodsUtil.deleteGoodsByTypeId(bpaGoodstype.id);
Fdata.remove(index);
notifyDataSetChanged();
}


+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/utils/ToastUtils.java Dosyayı Görüntüle

@@ -278,7 +278,7 @@ public class ToastUtils {

currentToast.setView(toastLayout);
currentToast.setDuration(duration);
currentToast.setGravity(Gravity.BOTTOM|Gravity.END,0,60);
currentToast.setGravity(Gravity.BOTTOM,0,20);
// currentToast.setGravity(Gravity.LEFT | Gravity.TOP, 0, 0);//左上角
// currentToast.setGravity(Gravity.RIGHT | Gravity.TOP, 0, 0);//右上角
// currentToast.setGravity(Gravity.LEFT | Gravity.BOTTOM, 0, 0);//左下角
@@ -320,7 +320,7 @@ public class ToastUtils {
currentToastThread.setView(toastLayout);
currentToastThread.setDuration(duration);

currentToastThread.setGravity(Gravity.TOP,0,100);
currentToastThread.setGravity(Gravity.BOTTOM,0,20);
currentToastThread.show();
// currentToast.setGravity(Gravity.LEFT | Gravity.TOP, 0, 0);//左上角
// currentToast.setGravity(Gravity.RIGHT | Gravity.TOP, 0, 0);//右上角


+ 409
- 409
app/src/main/java/com/bonait/bnframework/common/view/AddGoodDialog.java Dosyayı Görüntüle

@@ -1,409 +1,409 @@
package com.bonait.bnframework.common.view;
import static com.bonait.bnframework.MainApplication.getContext;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.MessageName;
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.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.res.ResMaterilas;
import com.bonait.bnframework.common.glide.GlideUtil;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.message.MessageLooper;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.model.mode.BomTypeInfo;
import com.bonait.bnframework.common.model.mode.FoodMenuInfo;
import com.bonait.bnframework.common.model.mode.GoodsParentTypeInfo;
import com.bonait.bnframework.common.model.mode.GoodsTypeInfo;
import com.bonait.bnframework.common.model.mode.GoodsUintInfo;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.adapter.newgood_adapter;
import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter;
import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
public class AddGoodDialog extends Dialog {
/**
* 数据接口
*/
public BPA_GOODS Data=null;
/**
* 商品类型
*/
public ArrayList<BPA_GOODSTYPE> Types=new ArrayList<>();
/**
* 当前物料数据
*/
public ArrayList<ResMaterilas> resMaterilas=new ArrayList<>();
//确定文本和取消文本的显示内容
private String yesStr;
/**
* 取消按钮
*/
public Button close_from,xinjian;
public ImageView cpfm;
public EditText edittext,edittext1;
public Spinner editsp_fl;
public RecyclerView recycler_view_wl;
private onNoOnclickListener noOnclickListener;//取消按钮被点击了的监听器
private onYesOnclickListener yesOnclickListener;//确定按钮被点击了的监听器
/**
* 设置取消按钮的显示内容和监听
*
* @param onNoOnclickListener
*/
public void setNoOnclickListener(onNoOnclickListener onNoOnclickListener) {
this.noOnclickListener = onNoOnclickListener;
}
/**
* 设置确定按钮的显示内容和监听
*
* @param str
* @param onYesOnclickListener
*/
public void setYesOnclickListener(String str, onYesOnclickListener onYesOnclickListener) {
if (str != null) {
yesStr = str;
}
this.yesOnclickListener = onYesOnclickListener;
}
public AddGoodDialog(Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_add_good);
//按空白处不能取消动画
setCanceledOnTouchOutside(false);
//初始化界面控件
initView();
//初始化界面数据
initData();
//初始化界面控件的事件
initEvent();
}
/**
* 初始化界面的确定和取消监听器
*/
private void initEvent() {
//设置确定按钮被点击后,向外界提供监听
xinjian.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(DataVerification()) {
ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
if(Data== null)//新增
{
boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
return;
}
Data=new BPA_GOODS();
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids=ids;
QueryDB.AddGoods(Data);
ToastUtils.info("菜谱生成成功!");
if (yesOnclickListener != null) {
yesOnclickListener.onYesClick(Data);
}
}else //修改
{
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids=ids;
QueryDB.UpdateGoods(Data);
ToastUtils.info("菜谱修改成功!");
if (yesOnclickListener != null) {
yesOnclickListener.onYesClick(Data);
}
}
}
}
});
close_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (noOnclickListener != null) {
noOnclickListener.onNoClick();
}
}
});
cpfm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getContext(), ImageChooseActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity_ma.startActivity(intent);
}
});
//图标选择
MessageManager.getInstance().registerMessageReceiver(activity_ma, MessageName.ClickImage, new MessageLooper.OnMessageListener() {
@Override
public void onMessage(Object msg) {
if (msg != null) {
url=(String) msg;
GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3);
// new MyBitmapUtils().disPlay(cpfm,url);
}
}
});
}
public String ids="";
/**
* 数据验证
* @return
*/
public boolean DataVerification()
{
boolean IsSucees=false;
try
{
if(edittext.getText().toString().isEmpty())
{
ToastUtils.info("名称不能为空!");
return false;
}
boolean issc=false;
ids="";
for (ResMaterilas item:resMaterilas)
{
ids=item.id+",";
if(item.isSelect)
{
issc=true;
}
}
//resMaterilas
if(issc==false)
{
ToastUtils.info("必须选择一个物料!");
return false;
}
return true;
}catch (Exception ex)
{
ToastUtils.error("数据验证异常!"+ex.getMessage());
return IsSucees;
}
}
Activity activity_ma;
public String url="";
Map<String,String> map_fl = new LinkedHashMap<>();
/**
* 初始化界面控件
*/
private void initView() {
close_from = (Button) findViewById(R.id.close_from);
xinjian = (Button) findViewById(R.id.xinjian);
cpfm = findViewById(R.id.cpfm);
edittext = findViewById(R.id.edittext);
edittext1 = findViewById(R.id.edittext1);
editsp_fl = findViewById(R.id.editsp_fl);
recycler_view_wl = findViewById(R.id.recycler_view_wl);
}
/**
* 初始化界面控件的显示数据
*/
private void initData() {
for (BPA_GOODSTYPE item:Types)
{
map_fl.put(item.name,item.id);
}
SetAdapter(editsp_fl,map_fl);
//如果设置按钮的文字
if (yesStr != null) {
xinjian.setText(yesStr);
}
//数据不为空 那么就是修改
if(Data!=null)
{
edittext.setText(Data.name);
edittext1.setText(Data.foreignKeyRe);
// new MyBitmapUtils().disPlay(cpfm,Data.url);
GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3);
int index=0;
for (Map.Entry<String, String> entry : map_fl.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if(value.equals(Data.goodtype))
{
editsp_fl.setSelection(index);
}
index++;
}
}
//查询物料数据
ArrayList<BPA_MATERIAL> materials= QueryDB.GetMaterialALL();
if(materials!=null && materials.size()>0)
{
resMaterilas.clear();
for (BPA_MATERIAL item:materials)
{
ResMaterilas mk=new ResMaterilas();
mk.name=item.name;
mk.id=item.id;
mk.isSelect=false;
if(Data!=null && !Data.materialids.isEmpty())
{
if(Data.materialids.contains(item.id))
{
mk.isSelect=true;
}
}
resMaterilas.add(mk);
}
}
MyLayoutManager layout = new MyLayoutManager();
layout.setAutoMeasureEnabled(true);
recycler_view_wl.setLayoutManager(layout);
newmeatrilselect_adapter adapter = new newmeatrilselect_adapter(getContext(), resMaterilas);
recycler_view_wl.setAdapter(adapter);
}
/**
* 从外界Activity为Dialog 设置数据
*
* @param data
*/
public void setData(BPA_GOODS data, ArrayList<BPA_GOODSTYPE> types, Activity activity) {
Data = data;
Types=types;
activity_ma=activity;
}
public void SetAdapter(Spinner spinner,Map<String,String> map)
{
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(map.keySet()));
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
spinner.setAdapter(adapter);
}
/**
* 设置确定按钮和取消被点击的接口
*/
public interface onYesOnclickListener {
public void onYesClick(BPA_GOODS data);
}
/**
* 取消按钮
*/
public interface onNoOnclickListener {
public void onNoClick();
}
static Window dow;
@Override
public void show() {
super.show();
/**
* 设置宽度全屏,要设置在show的后面
*/
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.width= ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.height= ViewGroup.LayoutParams.MATCH_PARENT;
getWindow().getDecorView().setPadding(0, 0, 0, 0);
getWindow().setAttributes(layoutParams);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(keyboardVisibilityListener);
dow=getWindow();
}
private static ViewTreeObserver.OnGlobalLayoutListener keyboardVisibilityListener = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
// 在此处处理键盘关闭事件
// 检查键盘的可见性和高度等信息来判断键盘是否关闭
dow.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
};
@Override
public void dismiss() {
super.dismiss();
MessageManager.getInstance().unRegisterMessageReceiver(activity_ma);
}
}
//package com.bonait.bnframework.common.view;
//
//import static com.bonait.bnframework.MainApplication.getContext;
//
//import android.app.Activity;
//import android.app.Dialog;
//import android.content.Context;
//import android.content.Intent;
//import android.os.Bundle;
//import android.view.View;
//import android.view.ViewGroup;
//import android.view.ViewTreeObserver;
//import android.view.Window;
//import android.view.WindowManager;
//import android.widget.ArrayAdapter;
//import android.widget.Button;
//import android.widget.EditText;
//import android.widget.ImageView;
//import android.widget.Spinner;
//import android.widget.TextView;
//
//import androidx.recyclerview.widget.RecyclerView;
//
//import com.bonait.bnframework.R;
//import com.bonait.bnframework.common.constant.ConfigName;
//import com.bonait.bnframework.common.constant.MessageName;
//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.db.mode.BPA_MATERIAL;
//import com.bonait.bnframework.common.db.res.ResMaterilas;
//import com.bonait.bnframework.common.glide.GlideUtil;
//import com.bonait.bnframework.common.image.MyBitmapUtils;
//import com.bonait.bnframework.common.message.MessageLooper;
//import com.bonait.bnframework.common.message.MessageManager;
//import com.bonait.bnframework.common.model.mode.BomTypeInfo;
//import com.bonait.bnframework.common.model.mode.FoodMenuInfo;
//import com.bonait.bnframework.common.model.mode.GoodsParentTypeInfo;
//import com.bonait.bnframework.common.model.mode.GoodsTypeInfo;
//import com.bonait.bnframework.common.model.mode.GoodsUintInfo;
//import com.bonait.bnframework.common.utils.NetworkUtils;
//import com.bonait.bnframework.common.utils.ToastUtils;
//import com.bonait.bnframework.modules.home.adapter.newgood_adapter;
//import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter;
//import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;
//
//import java.util.ArrayList;
//import java.util.LinkedHashMap;
//import java.util.Map;
//
//public class AddGoodDialog extends Dialog {
//
// /**
// * 数据接口
// */
// public BPA_GOODS Data=null;
// /**
// * 商品类型
// */
// public ArrayList<BPA_GOODSTYPE> Types=new ArrayList<>();
// /**
// * 当前物料数据
// */
// public ArrayList<ResMaterilas> resMaterilas=new ArrayList<>();
//
//
// //确定文本和取消文本的显示内容
// private String yesStr;
//
// /**
// * 取消按钮
// */
// public Button close_from,xinjian;
// public ImageView cpfm;
// public EditText edittext,edittext1;
// public Spinner editsp_fl;
// public RecyclerView recycler_view_wl;
//
// private onNoOnclickListener noOnclickListener;//取消按钮被点击了的监听器
// private onYesOnclickListener yesOnclickListener;//确定按钮被点击了的监听器
//
// /**
// * 设置取消按钮的显示内容和监听
// *
// * @param onNoOnclickListener
// */
// public void setNoOnclickListener(onNoOnclickListener onNoOnclickListener) {
// this.noOnclickListener = onNoOnclickListener;
// }
//
// /**
// * 设置确定按钮的显示内容和监听
// *
// * @param str
// * @param onYesOnclickListener
// */
// public void setYesOnclickListener(String str, onYesOnclickListener onYesOnclickListener) {
// if (str != null) {
// yesStr = str;
// }
// this.yesOnclickListener = onYesOnclickListener;
// }
//
// public AddGoodDialog(Context context) {
// super(context);
// }
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.dialog_add_good);
// //按空白处不能取消动画
// setCanceledOnTouchOutside(false);
// //初始化界面控件
// initView();
// //初始化界面数据
// initData();
// //初始化界面控件的事件
// initEvent();
// }
//
// /**
// * 初始化界面的确定和取消监听器
// */
// private void initEvent() {
// //设置确定按钮被点击后,向外界提供监听
// xinjian.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if(DataVerification()) {
//
// ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
// if(Data== null)//新增
// {
// boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
// if(isSucess)
// {
// ToastUtils.info("菜谱名称已存在!");
// return;
// }
// Data=new BPA_GOODS();
// Data.name = edittext.getText().toString();
// Data.status = 1;
// Data.sort = goods.size() + 1;
// Data.maketime = 180;
// Data.issc = 1;
// Data.url = url;
// Data.foreignKeyRe=edittext1.getText().toString();
// Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
// Data.materialids=ids;
// QueryDB.AddGoods(Data);
// ToastUtils.info("菜谱生成成功!");
// if (yesOnclickListener != null) {
// yesOnclickListener.onYesClick(Data);
// }
// }else //修改
// {
// Data.name = edittext.getText().toString();
// Data.status = 1;
// Data.sort = goods.size() + 1;
// Data.maketime = 180;
// Data.issc = 1;
// Data.url = url;
// Data.foreignKeyRe=edittext1.getText().toString();
// Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
// Data.materialids=ids;
// QueryDB.UpdateGoods(Data);
// ToastUtils.info("菜谱修改成功!");
// if (yesOnclickListener != null) {
// yesOnclickListener.onYesClick(Data);
// }
// }
//
// }
// }
// });
//
// close_from.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if (noOnclickListener != null) {
// noOnclickListener.onNoClick();
// }
// }
// });
//
// cpfm.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getContext(), ImageChooseActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// activity_ma.startActivity(intent);
// }
// });
//
// //图标选择
// MessageManager.getInstance().registerMessageReceiver(activity_ma, MessageName.ClickImage, new MessageLooper.OnMessageListener() {
// @Override
// public void onMessage(Object msg) {
// if (msg != null) {
// url=(String) msg;
// GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3);
//// new MyBitmapUtils().disPlay(cpfm,url);
// }
// }
// });
// }
//
// public String ids="";
// /**
// * 数据验证
// * @return
// */
// public boolean DataVerification()
// {
// boolean IsSucees=false;
// try
// {
// if(edittext.getText().toString().isEmpty())
// {
// ToastUtils.info("名称不能为空!");
// return false;
// }
//
// boolean issc=false;
// ids="";
// for (ResMaterilas item:resMaterilas)
// {
// ids=item.id+",";
// if(item.isSelect)
// {
// issc=true;
// }
// }
//
// //resMaterilas
//
// if(issc==false)
// {
// ToastUtils.info("必须选择一个物料!");
// return false;
// }
//
//
// return true;
// }catch (Exception ex)
// {
// ToastUtils.error("数据验证异常!"+ex.getMessage());
// return IsSucees;
// }
// }
//
// Activity activity_ma;
// public String url="";
// Map<String,String> map_fl = new LinkedHashMap<>();
// /**
// * 初始化界面控件
// */
// private void initView() {
// close_from = (Button) findViewById(R.id.close_from);
// xinjian = (Button) findViewById(R.id.xinjian);
//
// cpfm = findViewById(R.id.cpfm);
//
// edittext = findViewById(R.id.edittext);
// edittext1 = findViewById(R.id.edittext1);
// editsp_fl = findViewById(R.id.editsp_fl);
//
// recycler_view_wl = findViewById(R.id.recycler_view_wl);
// }
//
// /**
// * 初始化界面控件的显示数据
// */
// private void initData() {
// for (BPA_GOODSTYPE item:Types)
// {
// map_fl.put(item.name,item.id);
// }
// SetAdapter(editsp_fl,map_fl);
// //如果设置按钮的文字
// if (yesStr != null) {
// xinjian.setText(yesStr);
// }
//
// //数据不为空 那么就是修改
// if(Data!=null)
// {
// edittext.setText(Data.name);
// edittext1.setText(Data.foreignKeyRe);
//// new MyBitmapUtils().disPlay(cpfm,Data.url);
// GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3);
// int index=0;
// for (Map.Entry<String, String> entry : map_fl.entrySet()) {
// String key = entry.getKey();
// String value = entry.getValue();
// if(value.equals(Data.goodtype))
// {
// editsp_fl.setSelection(index);
// }
// index++;
// }
// }
//
// //查询物料数据
// ArrayList<BPA_MATERIAL> materials= QueryDB.GetMaterialALL();
// if(materials!=null && materials.size()>0)
// {
// resMaterilas.clear();
// for (BPA_MATERIAL item:materials)
// {
// ResMaterilas mk=new ResMaterilas();
// mk.name=item.name;
// mk.id=item.id;
// mk.isSelect=false;
// if(Data!=null && !Data.materialids.isEmpty())
// {
// if(Data.materialids.contains(item.id))
// {
// mk.isSelect=true;
// }
// }
// resMaterilas.add(mk);
// }
// }
// MyLayoutManager layout = new MyLayoutManager();
// layout.setAutoMeasureEnabled(true);
// recycler_view_wl.setLayoutManager(layout);
// newmeatrilselect_adapter adapter = new newmeatrilselect_adapter(getContext(), resMaterilas);
// recycler_view_wl.setAdapter(adapter);
//
// }
// /**
// * 从外界Activity为Dialog 设置数据
// *
// * @param data
// */
// public void setData(BPA_GOODS data, ArrayList<BPA_GOODSTYPE> types, Activity activity) {
// Data = data;
// Types=types;
// activity_ma=activity;
// }
//
// public void SetAdapter(Spinner spinner,Map<String,String> map)
// {
// ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(map.keySet()));
// adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
// spinner.setAdapter(adapter);
// }
//
// /**
// * 设置确定按钮和取消被点击的接口
// */
// public interface onYesOnclickListener {
// public void onYesClick(BPA_GOODS data);
// }
//
// /**
// * 取消按钮
// */
// public interface onNoOnclickListener {
// public void onNoClick();
// }
// static Window dow;
// @Override
// public void show() {
// super.show();
// /**
// * 设置宽度全屏,要设置在show的后面
// */
// WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
// layoutParams.width= ViewGroup.LayoutParams.MATCH_PARENT;
// layoutParams.height= ViewGroup.LayoutParams.MATCH_PARENT;
// getWindow().getDecorView().setPadding(0, 0, 0, 0);
// getWindow().setAttributes(layoutParams);
// getWindow().getDecorView().setSystemUiVisibility(
// View.SYSTEM_UI_FLAG_LOW_PROFILE
// | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
// | View.SYSTEM_UI_FLAG_FULLSCREEN
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
// getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(keyboardVisibilityListener);
// dow=getWindow();
// }
//
// private static ViewTreeObserver.OnGlobalLayoutListener keyboardVisibilityListener = new ViewTreeObserver.OnGlobalLayoutListener() {
// @Override
// public void onGlobalLayout() {
// // 在此处处理键盘关闭事件
// // 检查键盘的可见性和高度等信息来判断键盘是否关闭
// dow.getDecorView().setSystemUiVisibility(
// View.SYSTEM_UI_FLAG_LOW_PROFILE
// | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
// | View.SYSTEM_UI_FLAG_FULLSCREEN
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
// }
// };
//
// @Override
// public void dismiss() {
// super.dismiss();
// MessageManager.getInstance().unRegisterMessageReceiver(activity_ma);
// }
//}

+ 3
- 3
app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupDetailAdapter.java Dosyayı Görüntüle

@@ -52,9 +52,9 @@ public class GoodGroupDetailAdapter extends BaseAdapter<ResGoodsRecipe, GoodGrou

@Override
public void onBindViewHolder(@NonNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
if(holder.binding.btnMaterialDelete.getTextSize()>28||holder.binding.btnMaterialDelete.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
// if(holder.binding.btnMaterialDelete.getTextSize()>28||holder.binding.btnMaterialDelete.getTextSize()<24){
// DisplayManager.scaleViewGroup(holder.binding.root);
// }
if(mData.get(position).value!=null && !mData.get(position).value.isEmpty()){
holder.binding.edittextWeight.setText(mData.get(position).value);
}


+ 4
- 3
app/src/main/java/com/bonait/bnframework/modules/home/adapter/GoodGroupNameAdapter.java Dosyayı Görüntüle

@@ -53,9 +53,10 @@ public abstract class GoodGroupNameAdapter extends BaseAdapter<BPA_GOODSRECIPENA

@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
if(holder.binding.groupName.getTextSize()>28||holder.binding.groupName.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
// if(holder.binding.groupName.getTextSize()>28||holder.binding.groupName.getTextSize()<24){
// DisplayManager.scaleViewGroup(holder.binding.root);
// DisplayManager.scaleViewGroup(holder.binding.llControl);
// }
holder.binding.groupName.setText(mData.get(position).name+"");
holder.binding.btnCopy.setOnClickListener(v->{
onCopy(position,mData.get(position));


+ 7
- 2
app/src/main/java/com/bonait/bnframework/modules/home/adapter/pfsx_adapter.java Dosyayı Görüntüle

@@ -62,9 +62,12 @@ public class pfsx_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (holder instanceof MyViewHolder) {
MyViewHolder myViewHolder = (MyViewHolder) holder;
ResGoodProperty bpa_goodproperty =datas.get(position);
// 设置要显示的图片和文字


if(position == datas.size()-1){
myViewHolder.root.setBackgroundResource(0);
}else {
myViewHolder.root.setBackgroundResource(R.drawable.input_bj);
}
MyLayoutManager layout = new MyLayoutManager();
layout.setAutoMeasureEnabled(true);
myViewHolder.recyclerView.setLayoutManager(layout);
@@ -93,10 +96,12 @@ public class pfsx_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
static class MyViewHolder extends RecyclerView.ViewHolder {
RecyclerView recyclerView;
TextView name;
RelativeLayout root;
public MyViewHolder(View view) {
super(view);
recyclerView = view.findViewById(R.id.recycler_view);
name = view.findViewById(R.id.name);
root = view.findViewById(R.id.root);
}
}



+ 7
- 7
app/src/main/java/com/bonait/bnframework/modules/home/fragment/GongnengFragment.java Dosyayı Görüntüle

@@ -125,21 +125,21 @@ public class GongnengFragment extends BaseFragment {
public void onResume() {
super.onResume();
LogUtils.d("gongnengfragment onResume");
EventBus.getDefault().register(this);
// EventBus.getDefault().register(this);
}

@Override
public void onPause() {
super.onPause();
LogUtils.d("gongnengfragment onPause");
EventBus.getDefault().unregister(this);
// EventBus.getDefault().unregister(this);
}

@Subscribe(threadMode = ThreadMode.MAIN)
public void onSynchronousCloudDataEvent(SynchronousCloudDataEvent event) {
WaitDialog.getInstance().Dismiss();
ToastUtils.info("同步完成");
}
// @Subscribe(threadMode = ThreadMode.MAIN)
// public void onSynchronousCloudDataEvent(SynchronousCloudDataEvent event) {
// WaitDialog.getInstance().Dismiss();
// ToastUtils.info("同步完成");
// }

/**
* 当在activity设置viewPager + BottomNavigation + fragment时,


+ 69
- 12
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java Dosyayı Görüntüle

@@ -19,6 +19,11 @@ import android.widget.Button;
import android.widget.RelativeLayout;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.HBL.Dialog.AlertDialogButton;
import com.bonait.bnframework.HBL.Dialog.DialogManager;
import com.bonait.bnframework.HBL.Dialog.WaitDialog;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.HttpModel.APIService;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.base.BaseFragment;
@@ -48,6 +53,7 @@ import com.bonait.bnframework.common.linktab.good.GoodRightAdapter;
import com.bonait.bnframework.common.message.MessageLooper;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.model.ResAPI;
import com.bonait.bnframework.common.model.event.SynchronousCloudDataEvent;
import com.bonait.bnframework.common.model.mode.ActionJsonMode;
import com.bonait.bnframework.common.model.mode.BatchingInfo;
import com.bonait.bnframework.common.model.mode.BomTechnologyActionInfo;
@@ -64,9 +70,7 @@ 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;
import com.bonait.bnframework.modules.home.fragment.mode.GoodsEditView;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.lzy.okgo.OkGo;
@@ -76,6 +80,10 @@ import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -135,16 +143,30 @@ public class GoodPeiFangActivity extends BaseActivity {
super.onCreate(savedInstanceState);
viewBinding = ActivityGoodpeifangBinding.inflate(getLayoutInflater());
setContentView(viewBinding.getRoot());
EventBus.getDefault().register(this);
ButterKnife.bind(this);
activity = this;
context = getContext();
initTopBar();
initView();
Initdata();
}

private int typePos = 0;
private void initTopBar() {
private void initView() {
viewBinding.btnSync.setOnClickListener(v->{
DialogManager.showWarn(this,"同步云端商品会参数本地所有配方数据,\r\n请问是否继续?", AlertDialogButton.YesNo,(s)->{
if(s){
WaitDialog.getInstance().Show("同步数据","请耐心等待,不要关闭应用",this,this);
ThreadManager.get().execute(new Runnable() {
@Override
public void run() {
APIService.MainInit();
EventBus.getDefault().post(new SynchronousCloudDataEvent());
}
});
}
});
});
mTopBar.setTitle("商品配方管理");
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
@@ -152,6 +174,16 @@ public class GoodPeiFangActivity extends BaseActivity {
finish();
}
});
viewBinding.goodEditView.setChangeCallBack(new GoodsEditView.ChangeCallBack() {
@Override
public void onChangeGood() {
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("修改成功");
}
});

MessageManager.getInstance().registerMessageReceiver(this, MessageName.UpdateGood, new MessageLooper.OnMessageListener() {
@Override
@@ -413,12 +445,28 @@ public class GoodPeiFangActivity extends BaseActivity {
}
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("添加成功");
public void onSave(String typeId) {
int pos = -1;
for(int i =0;i<Fdata.size();i++){
if(((BPA_GOODSTYPE)Fdata.get(i).type).id.equals(typeId)){
pos = i;
}
}
if(pos>=0){
BPA_GOODSTYPE bpaGoodstype = goodstypes.get(pos);
ArrayList<BPA_GOODS> goodsm = QueryDB.GetGoodsTypeId(bpaGoodstype.id);
Fdata.set(pos,new LinkMode(bpaGoodstype, Arrays.asList(goodsm.toArray()), false));
int lastPos = typePos;
typePos = pos;
leftAdapter.setChoose(typePos);
rightAdapter.notifyItemChanged(lastPos);
rightAdapter.notifyItemChanged(typePos);
((LinearLayoutManager) rv_right.getLayoutManager()).scrollToPositionWithOffset(typePos, 0);
ToastUtils.info("添加成功");
}else {
ToastUtils.info("刷新失败,请退出重进");
}

}
});
addGoodDialog.show(getSupportFragmentManager(),"添加商品名称");
@@ -428,7 +476,9 @@ public class GoodPeiFangActivity extends BaseActivity {

@Override
public void onDestroy() {
viewBinding.goodEditView.destroy();
super.onDestroy();
EventBus.getDefault().unregister(this);
goodstypes.clear();
goodstypes = null;
rv_right.setAdapter(null);
@@ -443,4 +493,11 @@ public class GoodPeiFangActivity extends BaseActivity {
protected boolean canDragBack() {
return false;
}

@Subscribe(threadMode = ThreadMode.MAIN)
public void onSynchronousCloudDataEvent(SynchronousCloudDataEvent event) {
WaitDialog.getInstance().Dismiss();
ToastUtils.info("同步完成");
Initdata();
}
}

+ 5
- 4
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/AddGoodDialog.java Dosyayı Görüntüle

@@ -78,13 +78,13 @@ public class AddGoodDialog extends DialogFragment {
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
window.setAttributes(params);
}
initView();
initData();
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initView();
initData();
}

public String url="";
@@ -117,7 +117,7 @@ public class AddGoodDialog extends DialogFragment {
Data.goodtype=mapTypes.get(viewBinding.spinner.getSelectedItem().toString());
QueryDB.AddGoods(Data);
if(saveCallBack!=null){
saveCallBack.onSave();
saveCallBack.onSave(mapTypes.get(viewBinding.spinner.getSelectedItem().toString()));
}
});
viewBinding.image.setOnClickListener(v->{
@@ -150,7 +150,7 @@ public class AddGoodDialog extends DialogFragment {
}

public interface SaveCallBack{
void onSave();
void onSave(String typeId);
}

@Override
@@ -162,6 +162,7 @@ public class AddGoodDialog extends DialogFragment {
//接收图片选择事件
@Subscribe(threadMode = ThreadMode.MAIN)
public void onImageSelectEvent(ImageUrlSelectEvent event){
url = event.url;
new MyBitmapUtils().disPlay(viewBinding.image,event.url);
}
}

+ 827
- 827
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodInformation.java
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 78
- 45
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java Dosyayı Görüntüle

@@ -38,6 +38,7 @@ import com.bonait.bnframework.common.utils.KeyboardUtil;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.databinding.GoodsEditLayoutBinding;
import com.bonait.bnframework.event.ImageUrlSelectEvent;
import com.bonait.bnframework.modules.home.adapter.GoodGroupNameAdapter;
import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter;
import com.bonait.bnframework.modules.home.adapter.pfsx_adapter;
@@ -46,6 +47,10 @@ import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -75,6 +80,7 @@ public class GoodsEditView extends LinearLayout {
View root = LayoutInflater.from(context).inflate(R.layout.goods_edit_layout, this);
viewBinding = GoodsEditLayoutBinding.bind(root);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
EventBus.getDefault().register(this);
initView();
}

@@ -120,37 +126,42 @@ public class GoodsEditView extends LinearLayout {
* 按键监听
*/
private void initListener(){
viewBinding.getRoot().setOnClickListener(v->{
KeyboardUtil.hideKeyboard(viewBinding.getRoot());
});
viewBinding.titleGoods.setOnClickListener(v->{
if(viewBinding.contentGoods.getVisibility() == VISIBLE){
viewBinding.contentGoods.setVisibility(GONE);
viewBinding.icArrowGoods.setBackgroundResource(R.mipmap.ic_arrow_left);
viewBinding.tvGoods.setText("收起");
viewBinding.tvGoods.setText("展开");
}else {
viewBinding.contentGoods.setVisibility(VISIBLE);
viewBinding.icArrowGoods.setBackgroundResource(R.mipmap.ic_arrow_down);
viewBinding.tvGoods.setText("展开");
viewBinding.tvGoods.setText("收起");
}
});
viewBinding.titleAttribute.setOnClickListener(v->{
if(viewBinding.contentAttribut.getVisibility() == VISIBLE){
viewBinding.contentAttribut.setVisibility(GONE);
viewBinding.icArrowAttribute.setBackgroundResource(R.mipmap.ic_arrow_left);
viewBinding.tvArrowAttribute.setText("收起");
viewBinding.tvArrowAttribute.setText("展开");
}else {
viewBinding.contentAttribut.setVisibility(VISIBLE);
viewBinding.icArrowAttribute.setBackgroundResource(R.mipmap.ic_arrow_down);
viewBinding.tvArrowAttribute.setText("展开");
viewBinding.tvArrowAttribute.setText("收起");
}
});
viewBinding.titleDetail.setOnClickListener(v->{
if(viewBinding.contentDetail.getVisibility() == VISIBLE){
viewBinding.contentDetail.setVisibility(GONE);
if(viewBinding.recyclerDetail.getVisibility() == VISIBLE){
viewBinding.tabTitle.setVisibility(GONE);
viewBinding.recyclerDetail.setVisibility(GONE);
viewBinding.icArrowDetail.setBackgroundResource(R.mipmap.ic_arrow_left);
viewBinding.tvArrowDetail.setText("收起");
viewBinding.tvArrowDetail.setText("展开");
}else {
viewBinding.contentDetail.setVisibility(VISIBLE);
viewBinding.tabTitle.setVisibility(VISIBLE);
viewBinding.recyclerDetail.setVisibility(VISIBLE);
viewBinding.icArrowDetail.setBackgroundResource(R.mipmap.ic_arrow_down);
viewBinding.tvArrowDetail.setText("展开");
viewBinding.tvArrowDetail.setText("收起");
}
});

@@ -160,18 +171,21 @@ public class GoodsEditView extends LinearLayout {
getContext().startActivity(intent);
});
//图标选择
MessageManager.getInstance().registerMessageReceiver(activity, MessageName.ClickImage, new MessageLooper.OnMessageListener() {
@Override
public void onMessage(Object msg) {
if (msg != null) {
url=(String) msg;
new MyBitmapUtils().disPlay(viewBinding.imgGoods,url);
GlideUtil.showImage(viewBinding.imgGoods.getContext(),url,viewBinding.imgGoods,R.mipmap.loading3);
goodsData.url = url;
QueryDB.UpdateGoods(goodsData);
}
}
});
// MessageManager.getInstance().registerMessageReceiver(activity, MessageName.ClickImage, new MessageLooper.OnMessageListener() {
// @Override
// public void onMessage(Object msg) {
// if (msg != null) {
// url=(String) msg;
// new MyBitmapUtils().disPlay(viewBinding.imgGoods,url);
// GlideUtil.showImage(viewBinding.imgGoods.getContext(),url,viewBinding.imgGoods,R.mipmap.loading3);
// goodsData.url = url;
// QueryDB.UpdateGoods(goodsData);
// if(changeCallBack!=null){
// changeCallBack.onChangeGood();
// }
// }
// }
// });

//商品
viewBinding.updateGoods.setOnClickListener(new View.OnClickListener() {
@@ -182,20 +196,25 @@ public class GoodsEditView extends LinearLayout {
ToastUtils.info("名称不能为空!");
return;
}
boolean isSucess = QueryDB.GetGoodsIs(viewBinding.edittextName.getText().toString());
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
return;
if(!viewBinding.edittextName.getText().toString().equals(goodsData.name)){
boolean isSucess = QueryDB.GetGoodsIs(viewBinding.edittextName.getText().toString());
if(isSucess )
{
ToastUtils.info("菜谱名称已存在!");
return;
}
}
goodsData.name = viewBinding.edittextGroup.getText().toString();

goodsData.name = viewBinding.edittextName.getText().toString();
goodsData.url = url;
goodsData.foreignKeyRe=viewBinding.edittextFk.getText().toString();
QueryDB.UpdateGoods(goodsData);
if (mListener != null) {
mListener.clickListenerNew(v,1,goodsData);
}
ToastUtils.info("修改成功");
if(changeCallBack!=null){
changeCallBack.onChangeGood();
}
}
});
viewBinding.closeFrom.setOnClickListener(v->{
@@ -231,6 +250,10 @@ public class GoodsEditView extends LinearLayout {
QueryDB.AddGoodsRecipeName(goodsrecipename);
ToastUtils.info("新建【"+goodsrecipename.name+"】配方成功");
}
//商品配方名称
goodsrecipenames.clear();
goodsrecipenames.addAll(QueryDB.GetGoodsRecipeNameGoodId(goodsData.id));
groupAdapter.notifyDataSetChanged();
});
}

@@ -276,19 +299,6 @@ public class GoodsEditView extends LinearLayout {
//2.填充规则数据,查询所有属性大类
viewBinding.recyclerProperty.setLayoutManager(new WrapContentLinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL,false));

ArrayList<BPA_GOODSRECIPENAME> goodsrecipenames = QueryDB.GetGoodsRecipeNameGoodId(goodsData.id);
assert goodsrecipenames != null;
LogUtils.d("add_makegood_control goodsrecipenames = "+goodsrecipenames.size());
List<String> attributeNameList = new ArrayList<>();
for(BPA_GOODSRECIPENAME goodsrecipename1 : goodsrecipenames){
if(goodsrecipename1.design.contains(",")){
String[] res = goodsrecipename1.design.split(",");
attributeNameList.addAll(Arrays.asList(res));
}else {
attributeNameList.add(goodsrecipename1.design);
}
}

bpa_goodproperties.clear();
ArrayList<ResGoodProperty> allGoodProperty = new ArrayList<>();
ArrayList<BPA_GOODPROPERTY> da = QueryDB.GetGoodsPropertyALL("0");
@@ -381,10 +391,10 @@ public class GoodsEditView extends LinearLayout {
private void initGroupDetail(){
//物料数据
materilasList.clear();
materilasList= QueryDB.GetMaterialALL();
materilasList.addAll(QueryDB.GetMaterialALL());
//商品配方名称
goodsrecipenames.clear();
goodsrecipenames=QueryDB.GetGoodsRecipeNameGoodId(goodsData.id);
goodsrecipenames.addAll(QueryDB.GetGoodsRecipeNameGoodId(goodsData.id));

groupAdapter = new GoodGroupNameAdapter() {
@Override
@@ -426,7 +436,7 @@ public class GoodsEditView extends LinearLayout {
QueryDB.DeleteGoodsSrecipe(item);
}
List<BPA_GOODSRECIPE> data = new ArrayList<>();
ArrayList<ResGoodsRecipe> copys = QueryDB.GetGoodsSreciperecipeList(bean.id);
ArrayList<ResGoodsRecipe> copys = QueryDB.GetGoodsSreciperecipeList(copyGoodsRecipe.id);
for(ResGoodsRecipe item:copys){
BPA_GOODSRECIPE bpaGoodsrecipe = new BPA_GOODSRECIPE();
bpaGoodsrecipe.sort = 0;
@@ -457,7 +467,8 @@ public class GoodsEditView extends LinearLayout {
* 销毁
*/
public void destroy(){
MessageManager.getInstance().unRegisterMessageReceiver(activity);
// MessageManager.getInstance().unRegisterMessageReceiver(activity);
EventBus.getDefault().unregister(this);
goodsData = null;
mListener = null;
bpa_goodproperties.clear();
@@ -477,4 +488,26 @@ public class GoodsEditView extends LinearLayout {
}
activity = null;
}
private ChangeCallBack changeCallBack;

public void setChangeCallBack(ChangeCallBack changeCallBack) {
this.changeCallBack = changeCallBack;
}

public interface ChangeCallBack{
void onChangeGood();
}

//接收图片选择事件
@Subscribe(threadMode = ThreadMode.MAIN)
public void onImageSelectEvent(ImageUrlSelectEvent event){
url=event.url;
new MyBitmapUtils().disPlay(viewBinding.imgGoods,url);
GlideUtil.showImage(viewBinding.imgGoods.getContext(),url,viewBinding.imgGoods,R.mipmap.loading3);
goodsData.url = url;
QueryDB.UpdateGoods(goodsData);
if(changeCallBack!=null){
changeCallBack.onChangeGood();
}
}
}

+ 411
- 411
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java Dosyayı Görüntüle

@@ -1,411 +1,411 @@
package com.bonait.bnframework.modules.home.fragment.mode;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.MessageName;
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.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.res.ResMaterilas;
import com.bonait.bnframework.common.glide.GlideUtil;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.image.MyBitmapUtils;
import com.bonait.bnframework.common.message.MessageLooper;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.utils.KeyboardUtil;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter;
import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
import butterknife.ButterKnife;
public class add_good_control extends LinearLayout {
/**
* 数据接口
*/
public BPA_GOODS Data=null;
/**
* 商品类型
*/
public ArrayList<BPA_GOODSTYPE> Types=new ArrayList<>();
/**
* 当前物料数据
*/
public ArrayList<ResMaterilas> resMaterilas=new ArrayList<>();
//确定文本和取消文本的显示内容
private String yesStr;
/**
* 取消按钮
*/
public Button close_from,xinjian,save_xinjian;
public ImageView cpfm;
public EditText edittext,edittext1;
public Spinner editsp_fl;
public RecyclerView recycler_view_wl;
/**
* 点击事件
*/
public MyClickListener mListener=null;
private View root;
public add_good_control(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
root= LayoutInflater.from(context).inflate(R.layout.dialog_add_good, this);
ButterKnife.bind(this, root);
}
public void Init()
{
//初始化界面控件
initView();
//初始化界面数据
initData();
//初始化界面控件的事件
initEvent();
}
/**
* 初始化界面的确定和取消监听器
*/
private void initEvent() {
//设置确定按钮被点击后,向外界提供监听
xinjian.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(DataVerification()) {
ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
if(Data== null)//新增
{
boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
return;
}
Data=new BPA_GOODS();
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids=ids;
QueryDB.AddGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v,1,Data);
}
}else //修改
{
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
Data.materialids=ids;
QueryDB.UpdateGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v,1,Data);
}
}
}
}
});
save_xinjian.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(DataVerification()) {
ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
if(Data== null)//新增
{
boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
if(isSucess)
{
ToastUtils.info("菜谱名称已存在!");
return;
}
Data=new BPA_GOODS();
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
/*24-2-2 lyw 更改*/
if (editsp_fl.getSelectedItem()!=null){
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
}
Data.materialids=ids;
QueryDB.AddGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v,2,Data);
}
}else //修改
{
Data.name = edittext.getText().toString();
Data.status = 1;
Data.sort = goods.size() + 1;
Data.maketime = 180;
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
/*24-2-2 lyw 更改*/
if (editsp_fl.getSelectedItem()!=null){
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
}
Data.materialids=ids;
QueryDB.UpdateGoods(Data);
if (mListener != null) {
mListener.clickListenerNew(v,2,Data);
}
}
}
}
});
close_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.clickListenerNew(v,0,null);
}
}
});
cpfm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getContext(), ImageChooseActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity_ma.startActivity(intent);
}
});
//图标选择
MessageManager.getInstance().registerMessageReceiver(activity_ma, MessageName.ClickImage, new MessageLooper.OnMessageListener() {
@Override
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);
}
}
});
}
public void destroy(){
MessageManager.getInstance().unRegisterMessageReceiver(activity_ma);
Data = null;
mListener = null;
Types.clear();
Types = null;
resMaterilas.clear();
resMaterilas = null;
map_fl.clear();
map_fl = null;
yesStr = null;
url = null;
if(recycler_view_wl!=null){
recycler_view_wl.setAdapter(null);
}
activity_ma = null;
}
public String ids="";
/**
* 数据验证
* @return
*/
public boolean DataVerification()
{
boolean IsSucees=false;
try
{
if(edittext.getText().toString().isEmpty())
{
ToastUtils.info("名称不能为空!");
return false;
}
boolean issc=false;
ids="";
for (ResMaterilas item:resMaterilas)
{
if(item.isSelect)
{
ids+=item.id+",";
issc=true;
}
}
if(!ids.isEmpty())
{
ids=ids.substring(0, ids.length() - 1);
}
//resMaterilas
if(issc==false)
{
ToastUtils.info("必须选择一个物料!");
return false;
}
return true;
}catch (Exception ex)
{
ToastUtils.error("数据验证异常!"+ex.getMessage());
return IsSucees;
}
}
Activity activity_ma;
public String url="";
Map<String,String> map_fl = new LinkedHashMap<>();
RelativeLayout rlRoot;
/**
* 初始化界面控件
*/
private void initView() {
close_from = (Button) findViewById(R.id.close_from);
xinjian = (Button) findViewById(R.id.xinjian);
save_xinjian= (Button) findViewById(R.id.save_xinjian);
cpfm = findViewById(R.id.cpfm);
edittext = findViewById(R.id.edittext);
edittext1 = findViewById(R.id.edittext1);
editsp_fl = findViewById(R.id.editsp_fl);
recycler_view_wl = findViewById(R.id.recycler_view_wl);
rlRoot = findViewById(R.id.root);
rlRoot.setOnClickListener(KeyboardUtil::hideKeyboard);
}
/**
* 初始化界面控件的显示数据
*/
private void initData() {
for (BPA_GOODSTYPE item:Types)
{
map_fl.put(item.name,item.id);
}
SetAdapter(editsp_fl,map_fl);
//如果设置按钮的文字
if (yesStr != null) {
xinjian.setText(yesStr);
}
//数据不为空 那么就是修改
if(Data!=null)
{
edittext.setText(Data.name);
edittext1.setText(Data.foreignKeyRe);
new MyBitmapUtils().disPlay(cpfm,Data.url);
// GlideUtil.showImageWithRadius(cpfm.getContext(),url,cpfm,R.mipmap.loading3,10);
url=Data.url;
int index=0;
for (Map.Entry<String, String> entry : map_fl.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if(value.equals(Data.goodtype))
{
editsp_fl.setSelection(index);
}
index++;
}
}else
{
edittext.setText("");
edittext1.setText("");
new MyBitmapUtils().disPlay(cpfm,"");
// GlideUtil.showImageWithRadius(cpfm.getContext(),"",cpfm,R.mipmap.loading3,10);
url="";
}
//查询物料数据
ArrayList<BPA_MATERIAL> materials= QueryDB.GetMaterialALL();
if(materials!=null && materials.size()>0)
{
resMaterilas.clear();
for (BPA_MATERIAL item:materials)
{
ResMaterilas mk=new ResMaterilas();
mk.name=item.name;
mk.id=item.id;
mk.isSelect=false;
if(Data!=null && !Data.materialids.isEmpty())
{
if(Data.materialids.contains(item.id))
{
mk.isSelect=true;
}
}
resMaterilas.add(mk);
}
}
MyLayoutManager layout = new MyLayoutManager();
layout.setAutoMeasureEnabled(true);
recycler_view_wl.setLayoutManager(layout);
newmeatrilselect_adapter adapter = new newmeatrilselect_adapter(getContext(), resMaterilas);
recycler_view_wl.setAdapter(adapter);
}
/**
* 从外界Activity为Dialog 设置数据
*
* @param data
*/
public void setData(String str, BPA_GOODS data, ArrayList<BPA_GOODSTYPE> types, Activity activity) {
if (str != null) {
yesStr = str;
}
Data = data;
Types=types;
activity_ma=activity;
Init();
}
public void SetAdapter(Spinner spinner,Map<String,String> map)
{
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(map.keySet()));
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
spinner.setAdapter(adapter);
}
}
//package com.bonait.bnframework.modules.home.fragment.mode;
//
//import android.app.Activity;
//import android.content.Context;
//import android.content.Intent;
//import android.util.AttributeSet;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.widget.ArrayAdapter;
//import android.widget.Button;
//import android.widget.EditText;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.RelativeLayout;
//import android.widget.Spinner;
//
//import androidx.annotation.Nullable;
//import androidx.recyclerview.widget.RecyclerView;
//
//import com.bonait.bnframework.R;
//import com.bonait.bnframework.common.constant.MessageName;
//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.db.mode.BPA_MATERIAL;
//import com.bonait.bnframework.common.db.res.ResMaterilas;
//import com.bonait.bnframework.common.glide.GlideUtil;
//import com.bonait.bnframework.common.helper.I.MyClickListener;
//import com.bonait.bnframework.common.image.MyBitmapUtils;
//import com.bonait.bnframework.common.message.MessageLooper;
//import com.bonait.bnframework.common.message.MessageManager;
//import com.bonait.bnframework.common.utils.KeyboardUtil;
//import com.bonait.bnframework.common.utils.ToastUtils;
//import com.bonait.bnframework.common.view.MyLayoutManager;
//import com.bonait.bnframework.modules.home.adapter.newmeatrilselect_adapter;
//import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;
//
//import java.util.ArrayList;
//import java.util.LinkedHashMap;
//import java.util.Map;
//
//import butterknife.ButterKnife;
//
//public class add_good_control extends LinearLayout {
//
// /**
// * 数据接口
// */
// public BPA_GOODS Data=null;
// /**
// * 商品类型
// */
// public ArrayList<BPA_GOODSTYPE> Types=new ArrayList<>();
// /**
// * 当前物料数据
// */
// public ArrayList<ResMaterilas> resMaterilas=new ArrayList<>();
//
//
// //确定文本和取消文本的显示内容
// private String yesStr;
//
// /**
// * 取消按钮
// */
// public Button close_from,xinjian,save_xinjian;
// public ImageView cpfm;
//
// public EditText edittext,edittext1;
// public Spinner editsp_fl;
// public RecyclerView recycler_view_wl;
//
// /**
// * 点击事件
// */
// public MyClickListener mListener=null;
// private View root;
// public add_good_control(Context context, @Nullable AttributeSet attrs) {
// super(context, attrs);
// root= LayoutInflater.from(context).inflate(R.layout.dialog_add_good, this);
// ButterKnife.bind(this, root);
// }
//
// public void Init()
// {
// //初始化界面控件
// initView();
// //初始化界面数据
// initData();
// //初始化界面控件的事件
// initEvent();
// }
//
// /**
// * 初始化界面的确定和取消监听器
// */
// private void initEvent() {
// //设置确定按钮被点击后,向外界提供监听
// xinjian.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if(DataVerification()) {
//
// ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
// if(Data== null)//新增
// {
// boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
// if(isSucess)
// {
// ToastUtils.info("菜谱名称已存在!");
// return;
// }
// Data=new BPA_GOODS();
// Data.name = edittext.getText().toString();
// Data.status = 1;
// Data.sort = goods.size() + 1;
// Data.maketime = 180;
// Data.issc = 1;
// Data.url = url;
// Data.foreignKeyRe=edittext1.getText().toString();
// Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
// Data.materialids=ids;
// QueryDB.AddGoods(Data);
// if (mListener != null) {
// mListener.clickListenerNew(v,1,Data);
// }
// }else //修改
// {
// Data.name = edittext.getText().toString();
// Data.status = 1;
// Data.sort = goods.size() + 1;
// Data.maketime = 180;
// Data.issc = 1;
// Data.url = url;
// Data.foreignKeyRe=edittext1.getText().toString();
// Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
// Data.materialids=ids;
// QueryDB.UpdateGoods(Data);
// if (mListener != null) {
// mListener.clickListenerNew(v,1,Data);
// }
// }
//
// }
// }
// });
//
// save_xinjian.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View v) {
// if(DataVerification()) {
//
// ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL();
// if(Data== null)//新增
// {
// boolean isSucess = QueryDB.GetGoodsIs(edittext.getText().toString());
// if(isSucess)
// {
// ToastUtils.info("菜谱名称已存在!");
// return;
// }
// Data=new BPA_GOODS();
// Data.name = edittext.getText().toString();
// Data.status = 1;
// Data.sort = goods.size() + 1;
// Data.maketime = 180;
// Data.issc = 1;
// Data.url = url;
// Data.foreignKeyRe=edittext1.getText().toString();
// /*24-2-2 lyw 更改*/
// if (editsp_fl.getSelectedItem()!=null){
// Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
// }
//
// Data.materialids=ids;
// QueryDB.AddGoods(Data);
// if (mListener != null) {
// mListener.clickListenerNew(v,2,Data);
// }
// }else //修改
// {
// Data.name = edittext.getText().toString();
// Data.status = 1;
// Data.sort = goods.size() + 1;
// Data.maketime = 180;
// Data.issc = 1;
// Data.url = url;
// Data.foreignKeyRe=edittext1.getText().toString();
// /*24-2-2 lyw 更改*/
// if (editsp_fl.getSelectedItem()!=null){
// Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
// }
// Data.materialids=ids;
// QueryDB.UpdateGoods(Data);
// if (mListener != null) {
// mListener.clickListenerNew(v,2,Data);
// }
// }
//
// }
// }
// });
// close_from.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if (mListener != null) {
// mListener.clickListenerNew(v,0,null);
// }
// }
// });
//
// cpfm.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getContext(), ImageChooseActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// activity_ma.startActivity(intent);
// }
// });
//
// //图标选择
// MessageManager.getInstance().registerMessageReceiver(activity_ma, MessageName.ClickImage, new MessageLooper.OnMessageListener() {
// @Override
// 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);
// }
// }
// });
// }
//
// public void destroy(){
// MessageManager.getInstance().unRegisterMessageReceiver(activity_ma);
// Data = null;
// mListener = null;
// Types.clear();
// Types = null;
// resMaterilas.clear();
// resMaterilas = null;
// map_fl.clear();
// map_fl = null;
// yesStr = null;
// url = null;
// if(recycler_view_wl!=null){
// recycler_view_wl.setAdapter(null);
// }
// activity_ma = null;
// }
//
// public String ids="";
// /**
// * 数据验证
// * @return
// */
// public boolean DataVerification()
// {
// boolean IsSucees=false;
// try
// {
// if(edittext.getText().toString().isEmpty())
// {
// ToastUtils.info("名称不能为空!");
// return false;
// }
//
// boolean issc=false;
// ids="";
// for (ResMaterilas item:resMaterilas)
// {
// if(item.isSelect)
// {
// ids+=item.id+",";
// issc=true;
// }
// }
//
// if(!ids.isEmpty())
// {
// ids=ids.substring(0, ids.length() - 1);
// }
//
// //resMaterilas
// if(issc==false)
// {
// ToastUtils.info("必须选择一个物料!");
// return false;
// }
// return true;
// }catch (Exception ex)
// {
// ToastUtils.error("数据验证异常!"+ex.getMessage());
// return IsSucees;
// }
// }
//
// Activity activity_ma;
// public String url="";
// Map<String,String> map_fl = new LinkedHashMap<>();
// RelativeLayout rlRoot;
// /**
// * 初始化界面控件
// */
// private void initView() {
// close_from = (Button) findViewById(R.id.close_from);
// xinjian = (Button) findViewById(R.id.xinjian);
// save_xinjian= (Button) findViewById(R.id.save_xinjian);
// cpfm = findViewById(R.id.cpfm);
//
// edittext = findViewById(R.id.edittext);
// edittext1 = findViewById(R.id.edittext1);
// editsp_fl = findViewById(R.id.editsp_fl);
//
// recycler_view_wl = findViewById(R.id.recycler_view_wl);
// rlRoot = findViewById(R.id.root);
// rlRoot.setOnClickListener(KeyboardUtil::hideKeyboard);
// }
//
// /**
// * 初始化界面控件的显示数据
// */
// private void initData() {
// for (BPA_GOODSTYPE item:Types)
// {
// map_fl.put(item.name,item.id);
// }
// SetAdapter(editsp_fl,map_fl);
// //如果设置按钮的文字
// if (yesStr != null) {
// xinjian.setText(yesStr);
// }
//
// //数据不为空 那么就是修改
// if(Data!=null)
// {
// edittext.setText(Data.name);
// edittext1.setText(Data.foreignKeyRe);
// new MyBitmapUtils().disPlay(cpfm,Data.url);
//// GlideUtil.showImageWithRadius(cpfm.getContext(),url,cpfm,R.mipmap.loading3,10);
// url=Data.url;
// int index=0;
// for (Map.Entry<String, String> entry : map_fl.entrySet()) {
// String key = entry.getKey();
// String value = entry.getValue();
// if(value.equals(Data.goodtype))
// {
// editsp_fl.setSelection(index);
// }
// index++;
// }
// }else
// {
// edittext.setText("");
// edittext1.setText("");
// new MyBitmapUtils().disPlay(cpfm,"");
//// GlideUtil.showImageWithRadius(cpfm.getContext(),"",cpfm,R.mipmap.loading3,10);
// url="";
// }
//
// //查询物料数据
// ArrayList<BPA_MATERIAL> materials= QueryDB.GetMaterialALL();
// if(materials!=null && materials.size()>0)
// {
// resMaterilas.clear();
// for (BPA_MATERIAL item:materials)
// {
// ResMaterilas mk=new ResMaterilas();
// mk.name=item.name;
// mk.id=item.id;
// mk.isSelect=false;
// if(Data!=null && !Data.materialids.isEmpty())
// {
// if(Data.materialids.contains(item.id))
// {
// mk.isSelect=true;
// }
// }
// resMaterilas.add(mk);
// }
// }
// MyLayoutManager layout = new MyLayoutManager();
// layout.setAutoMeasureEnabled(true);
// recycler_view_wl.setLayoutManager(layout);
// newmeatrilselect_adapter adapter = new newmeatrilselect_adapter(getContext(), resMaterilas);
// recycler_view_wl.setAdapter(adapter);
// }
// /**
// * 从外界Activity为Dialog 设置数据
// *
// * @param data
// */
// public void setData(String str, BPA_GOODS data, ArrayList<BPA_GOODSTYPE> types, Activity activity) {
// if (str != null) {
// yesStr = str;
// }
//
// Data = data;
// Types=types;
// activity_ma=activity;
//
// Init();
// }
//
// public void SetAdapter(Spinner spinner,Map<String,String> map)
// {
// ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(map.keySet()));
// adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
// spinner.setAdapter(adapter);
// }
//}

+ 30
- 6
app/src/main/res/layout/activity_goodpeifang.xml Dosyayı Görüntüle

@@ -95,14 +95,16 @@
android:layout_width="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:paddingBottom="50dp"
android:clipToPadding="false"
android:layout_height="match_parent"/>

<!-- 增加商品 -->
<com.bonait.bnframework.modules.home.fragment.mode.add_good_control
android:id="@+id/add_good"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
<!-- <com.bonait.bnframework.modules.home.fragment.mode.add_good_control-->
<!-- android:id="@+id/add_good"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:visibility="gone"/>-->

<!-- <com.bonait.bnframework.modules.home.fragment.mode.add_pf_home_control-->
<!-- android:id="@+id/add_pf_home"-->
@@ -126,12 +128,34 @@
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/app_color_blue"/>
android:background="@color/app_color_blue">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?attr/qmui_topbar_height">
<Button
android:id="@+id/btn_sync"
android:layout_width="150dp"
android:layout_height="?attr/qmui_topbar_height"
android:background="#00000000"
android:textSize="16sp"
android:layout_gravity="end"
android:layout_centerHorizontal="true"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="?attr/qmui_topbar_height"
android:src="@mipmap/yxz"
android:layout_marginEnd="20dp"
android:layout_gravity="end"
android:scaleType="fitCenter"
/>
</FrameLayout>
</com.qmuiteam.qmui.widget.QMUITopBarLayout>

<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"
android:clickable="true"
/>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 4
- 2
app/src/main/res/layout/datatab/layout/pfsx_item.xml Dosyayı Görüntüle

@@ -6,6 +6,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
android:paddingTop="15dp"
android:paddingBottom="5dp"
android:id="@+id/root"
android:background="@drawable/input_bj"
xsi:schemaLocation="http://schemas.android.com/apk/res/android ">

@@ -15,7 +16,7 @@
android:orientation="horizontal">

<RelativeLayout
android:layout_width="60dp"
android:layout_width="90dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/name"
@@ -23,10 +24,11 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_10"
android:text="回锅"
android:text="回锅:"
android:paddingTop="12dp"
android:gravity="center"
android:textSize="24sp" />

</RelativeLayout>




+ 2
- 0
app/src/main/res/layout/fragment_make_good.xml Dosyayı Görüntüle

@@ -66,7 +66,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="250dp"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="80dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

<LinearLayout


+ 1
- 1
app/src/main/res/layout/item/layout/dialog_add_good.xml Dosyayı Görüntüle

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


+ 3
- 2
app/src/main/res/layout/item/layout/dialog_add_makegood.xml Dosyayı Görüntüle

@@ -8,9 +8,10 @@

<RelativeLayout
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:layout_width="1000dp"
android:layout_height="730dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="45dp"
android:layout_height="match_parent"
android:background="@drawable/common_bg_with_radius_and_border">

<Button


+ 306
- 278
app/src/main/res/layout/item/layout/goods_edit_layout.xml Dosyayı Görüntüle

@@ -11,303 +11,329 @@
android:paddingTop="10dp"
android:layout_height="match_parent">

<LinearLayout
<RelativeLayout
android:id="@+id/close_from"
android:layout_width="match_parent"
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_height="80dp"
android:layout_gravity="end"
android:gravity="end"
android:background="@color/white"
>
<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_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>
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/close_image"
android:textColor="@color/white"/>

<RelativeLayout
android:id="@+id/title_goods"
<TextView
android:layout_width="match_parent"
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_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"
/>

<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>
android:layout_height="1dp"
android:background="@color/color3"
/>
</RelativeLayout>

<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:visibility="visible">

<RelativeLayout
android:id="@+id/content_goods"
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_below="@id/title_goods"
android:visibility="gone"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="5dp"
tools:visibility="visible"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
>
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
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" />
<TextView
app:contentScrim="#00000000"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="点击修改封面"
android:textSize="22sp"/>
</LinearLayout>
android:orientation="vertical"
android:paddingStart="30dp"
android:paddingEnd="30dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_height="match_parent">

<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>
<RelativeLayout
android:id="@+id/title_goods"
android:layout_width="match_parent"
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_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"
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>
<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>

<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"/>
</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="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"
/>
<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"
android:layout_marginTop="5dp"
tools:visibility="visible"
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" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="点击修改封面"
android:textSize="22sp"/>
</LinearLayout>

<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_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: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="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" />
<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/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:background="@drawable/bg_form"
android:paddingTop="5dp"
android:paddingBottom="5dp"
/>
</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"/>
</RelativeLayout>

<RelativeLayout
android:id="@+id/title_detail"
android:layout_width="match_parent"
android:background="@drawable/input_bj"
android:layout_height="70dp">
<TextView
<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="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: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="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:background="@drawable/bg_form"
android:paddingTop="5dp"
android:paddingBottom="5dp"
/>
</LinearLayout>

</LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
<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_detail"
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"
/>
android:paddingStart="30dp"
android:paddingEnd="30dp"
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="26sp"
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>
</com.google.android.material.appbar.AppBarLayout>

<LinearLayout
android:id="@+id/content_detail"
@@ -316,9 +342,11 @@
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:orientation="vertical">
<!-- 表头 -->
<LinearLayout
android:id="@+id/tab_title"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="@color/app_color_blue"
@@ -357,6 +385,6 @@
android:orientation="vertical"
/>
</LinearLayout>
</LinearLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>

+ 69
- 62
app/src/main/res/layout/item/layout/item_group_detail.xml Dosyayı Görüntüle

@@ -2,79 +2,86 @@
<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="60dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_form3"
>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3">

<Spinner
android:id="@+id/spinner_name"
style="@style/commonSpinnerStyle"
android:background="@drawable/spinner_border_bg"
android:layout_width="match_parent"
android:id="@+id/root"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="60dp">
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
/>
<LinearLayout
android:layout_width="0dp"
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"/>
android:layout_weight="3">

</LinearLayout>
<Spinner
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>

<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/color3"
/>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3">
<EditText
android:id="@+id/edittext_weight"
android:layout_width="match_parent"
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:hint="请输入重量"
android:inputType="number|numberDecimal"
android:digits="0123456789."
android:gravity="center"
android:maxLines="1"
android:padding="3dp"
android:textSize="26sp"
android:background="@color/color3"
/>
</RelativeLayout>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/color3"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3">
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:id="@+id/btn_material_delete"
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="删除"
android:gravity="center"
android:textSize="26sp"
android:textColor="@color/red_primary"/>
android:layout_weight="3">
<EditText
android:id="@+id/edittext_weight"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="请输入重量"
android:inputType="number|numberDecimal"
android:digits="0123456789."
android:gravity="center"
android:maxLines="1"
android:padding="3dp"
android:textSize="26sp"
/>
</RelativeLayout>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/color3"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3">
<TextView
android:id="@+id/btn_material_delete"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="删除"
android:gravity="center"
android:textSize="26sp"
android:textColor="@color/red_primary"/>
</LinearLayout>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/color3"
/>
</LinearLayout>
<TextView
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/color3"
/>


</LinearLayout>

+ 4
- 4
app/src/main/res/layout/item/layout/item_group_name.xml Dosyayı Görüntüle

@@ -16,7 +16,7 @@
android:layout_height="match_parent"
android:background="@color/color3"
/>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:id="@+id/groupName"
android:layout_width="0dp"
android:layout_height="match_parent"
@@ -30,7 +30,7 @@
android:layout_height="match_parent"
android:background="@color/color3"
/>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
@@ -43,7 +43,7 @@
android:layout_height="match_parent"
android:background="@color/color3"
/>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:id="@+id/btn_copy"
android:layout_width="0dp"
android:layout_height="match_parent"
@@ -57,7 +57,7 @@
android:layout_height="match_parent"
android:background="@color/color3"
/>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
<TextView
android:id="@+id/btn_delete"
android:layout_width="0dp"
android:layout_height="match_parent"


Yükleniyor…
İptal
Kaydet