Browse Source

主料名称展示

master-new-炒锅
liup 1 month ago
parent
commit
a0de3475e5
7 changed files with 131 additions and 335 deletions
  1. +0
    -329
      .idea/other.xml
  2. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  3. +64
    -0
      app/src/main/java/com/bonait/bnframework/ui/adapter/step/FoodNameAdapter.java
  4. +19
    -3
      app/src/main/java/com/bonait/bnframework/ui/dialog/EditGoodsDialog.java
  5. +1
    -1
      app/src/main/res/layout/item/layout/dialog_edit_goods.xml
  6. +28
    -0
      app/src/main/res/layout/item/layout/item_food_name.xml
  7. +18
    -1
      app/src/main/res/layout/item/layout/layout_add_goods_mainfood.xml

+ 0
- 329
.idea/other.xml View File

@@ -1,329 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="direct_access_persist.xml">
<option name="deviceSelectionList">
<list>
<PersistentDeviceSelectionData>
<option name="api" value="27" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="F01L" />
<option name="id" value="F01L" />
<option name="manufacturer" value="FUJITSU" />
<option name="name" value="F-01L" />
<option name="screenDensity" value="360" />
<option name="screenX" value="720" />
<option name="screenY" value="1280" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="28" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="SH-01L" />
<option name="id" value="SH-01L" />
<option name="manufacturer" value="SHARP" />
<option name="name" value="AQUOS sense2 SH-01L" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="Lenovo" />
<option name="codename" value="TB370FU" />
<option name="id" value="TB370FU" />
<option name="manufacturer" value="Lenovo" />
<option name="name" value="Tab P12" />
<option name="screenDensity" value="340" />
<option name="screenX" value="1840" />
<option name="screenY" value="2944" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="a51" />
<option name="id" value="a51" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A51" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="akita" />
<option name="id" value="akita" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="b0q" />
<option name="id" value="b0q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S22 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="32" />
<option name="brand" value="google" />
<option name="codename" value="bluejay" />
<option name="id" value="bluejay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="caiman" />
<option name="id" value="caiman" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro" />
<option name="screenDensity" value="360" />
<option name="screenX" value="960" />
<option name="screenY" value="2142" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="comet" />
<option name="id" value="comet" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro Fold" />
<option name="screenDensity" value="390" />
<option name="screenX" value="2076" />
<option name="screenY" value="2152" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="29" />
<option name="brand" value="samsung" />
<option name="codename" value="crownqlteue" />
<option name="id" value="crownqlteue" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Note9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2220" />
<option name="screenY" value="1080" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="dm3q" />
<option name="id" value="dm3q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S23 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="e1q" />
<option name="id" value="e1q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S24" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix_camera" />
<option name="id" value="felix_camera" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold (Camera-enabled)" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="gts8uwifi" />
<option name="id" value="gts8uwifi" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Tab S8 Ultra" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1848" />
<option name="screenY" value="2960" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="husky" />
<option name="id" value="husky" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8 Pro" />
<option name="screenDensity" value="390" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="motorola" />
<option name="codename" value="java" />
<option name="id" value="java" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="G20" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="komodo" />
<option name="id" value="komodo" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9 Pro XL" />
<option name="screenDensity" value="360" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="lynx" />
<option name="id" value="lynx" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="google" />
<option name="codename" value="oriole" />
<option name="id" value="oriole" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="panther" />
<option name="id" value="panther" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q5q" />
<option name="id" value="q5q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold5" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1812" />
<option name="screenY" value="2176" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q6q" />
<option name="id" value="q6q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1856" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="r11" />
<option name="id" value="r11" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Watch" />
<option name="screenDensity" value="320" />
<option name="screenX" value="384" />
<option name="screenY" value="384" />
<option name="type" value="WEAR_OS" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="redfin" />
<option name="id" value="redfin" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 5" />
<option name="screenDensity" value="440" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="shiba" />
<option name="id" value="shiba" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="tangorpro" />
<option name="id" value="tangorpro" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Tablet" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="tokay" />
<option name="id" value="tokay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2424" />
</PersistentDeviceSelectionData>
</list>
</option>
</component>
</project>

+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java View File

@@ -33,7 +33,7 @@ import java.util.concurrent.ConcurrentHashMap;
* 配置文件
*/
public class ConfigName {
public static boolean isTEST = false;
public static boolean isTEST = true;
public boolean is800WithFeeding = false;//是否是800带投料版 有5个投料位
public boolean isPhoneVersion = false;//是否适配手机
public boolean isHighVersion = false;//是否适配高版本


+ 64
- 0
app/src/main/java/com/bonait/bnframework/ui/adapter/step/FoodNameAdapter.java View File

@@ -0,0 +1,64 @@
package com.bonait.bnframework.ui.adapter.step;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.databinding.ItemFoodNameBinding;
import com.bonait.bnframework.databinding.ItemStepBinding;
import com.bonait.bnframework.ui.adapter.BaseAdapter;
import com.bonait.bnframework.ui.util.DisplayManager;

/**
* @author: liup
* @description: 步骤列表
* @date: 2024/5/8 15:36.
*/
public class FoodNameAdapter extends BaseAdapter<String, FoodNameAdapter.ViewHolder> {

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(ItemFoodNameBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}

@Override
public void onBindViewHolder(@NonNull ViewHolder holder, @SuppressLint("RecyclerView") int position) {
try {
if(holder.binding.getRoot().getWidth()==0){
if(holder.binding.name.getTextSize()> 32|| holder.binding.name.getTextSize()< 28){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
}
holder.binding.root.setSelected(mCurrentPosition == position);
holder.binding.name.setText((position+1)+"."+mData.get(position));
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
protected void onItemClick(View v, int position) {

}


public static class ViewHolder extends RecyclerView.ViewHolder {
private ItemFoodNameBinding binding;


public ViewHolder(ItemFoodNameBinding view) {
super(view.getRoot());
binding = view;
}
}
}



+ 19
- 3
app/src/main/java/com/bonait/bnframework/ui/dialog/EditGoodsDialog.java View File

@@ -52,6 +52,7 @@ import com.bonait.bnframework.modules.home.fragment.from.ImageChooseActivity;
import com.bonait.bnframework.ui.activity.DiyProcessActivity;
import com.bonait.bnframework.ui.adapter.classify.ClassifySpinnerAdapter;
import com.bonait.bnframework.ui.adapter.classify.SelectAttributeListAdapter;
import com.bonait.bnframework.ui.adapter.step.FoodNameAdapter;
import com.bonait.bnframework.ui.util.AdbCommandUtil;
import com.bonait.bnframework.ui.util.DimensUtil;
import com.bonait.bnframework.ui.util.DisplayManager;
@@ -420,6 +421,10 @@ public class EditGoodsDialog extends DialogFragment {
viewBinding.layoutMainfoods.editName4.setText("");
viewBinding.layoutMainfoods.editName5.setText("");
// viewBinding.layoutMainfoods.editName6.setText("");
List<String> namesList = new ArrayList<>();
FoodNameAdapter adapter = new FoodNameAdapter();
adapter.setNewData(namesList);
viewBinding.layoutMainfoods.recycleView.setAdapter(adapter);
if(subattributeGroup!=null){
ArrayList<BPA_GOODS_PROCESS_DETAIL> list = GoodsProcessDetailDBUtil.getByGroupId(subattributeGroup.id);
for(BPA_GOODS_PROCESS_DETAIL bean:list ){
@@ -431,6 +436,8 @@ public class EditGoodsDialog extends DialogFragment {
if(!params.isEmpty()){
int position = -1;//几号位
String name = "";//主料名称
String weight = "";
String positonS = "";
for (HashMap.Entry<String, String> entry : params.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
@@ -438,15 +445,24 @@ public class EditGoodsDialog extends DialogFragment {
name = value;
}else if(key.contains("主料位置")){
position = Integer.parseInt(value.replace("号位",""));
positonS = ",位置:"+ position+"号位";
}else if(key.equals("重量")){
weight = ",重量:"+value;
}else if(key.equals("主料重量")){
weight = ",重量:"+value;
}
}
if(position>=0){
updateName(position,name);
if(!name.isEmpty()){
namesList.add("名称:"+name+weight+positonS);
}
// if(position>=0){
// updateName(position,name);
// }
}
}
}
}
adapter.notifyDataSetChanged();
}
}

@@ -533,7 +549,7 @@ public class EditGoodsDialog extends DialogFragment {
picUrl = goods.url;
updateImage(picUrl);
}
viewBinding.layoutMainfoods.ll3.setVisibility(ConfigName.getInstance().is800WithFeeding?View.VISIBLE:View.GONE);
// viewBinding.layoutMainfoods.ll3.setVisibility(ConfigName.getInstance().is800WithFeeding?View.VISIBLE:View.GONE);

viewBinding.layoutName.editName.setText(Objects.requireNonNull(GoodsDBUtil.getById(goodId)).name);
if(!isEdit){


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

@@ -47,7 +47,7 @@
<include
android:id="@+id/layout_mainfoods"
android:layout_width="@dimen/dp_660"
android:layout_height="@dimen/dp_620"
android:layout_height="1000dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"


+ 28
- 0
app/src/main/res/layout/item/layout/item_food_name.xml View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:orientation="vertical"
>

<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_70"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textColor="@color/black"
tools:text="1.双向搅拌"
android:textSize="@dimen/sp_30"
android:duplicateParentState="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:lines="2"
/>



</LinearLayout>

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

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_660"
android:layout_height="@dimen/dp_620"
android:layout_height="@dimen/dp_1000"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/bg_round25_white">
@@ -26,6 +26,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:id="@+id/ll1"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/title3"
@@ -85,6 +86,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:visibility="gone"
android:id="@+id/ll2"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
@@ -145,6 +147,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:visibility="gone"
android:id="@+id/ll3"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
@@ -204,10 +207,24 @@
android:textSize="@dimen/sp_32" />
</LinearLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycle_view"
app:layout_constraintTop_toBottomOf="@id/title3"
app:layout_constraintBottom_toTopOf="@id/llbtn"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical"
android:layout_height="0dp"/>




<LinearLayout
android:id="@+id/llbtn"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_200"
app:layout_constraintBottom_toBottomOf="parent"


Loading…
Cancel
Save