@@ -1,3 +0,0 @@ | |||||
# Default ignored files | |||||
/shelf/ | |||||
/workspace.xml |
@@ -1,10 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
<project version="4"> | <project version="4"> | ||||
<component name="ExternalStorageConfigurationManager" enabled="true" /> | <component name="ExternalStorageConfigurationManager" enabled="true" /> | ||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK"> | |||||
<output url="file://$PROJECT_DIR$/build/classes" /> | |||||
</component> | |||||
<component name="ProjectType"> | |||||
<option name="id" value="Android" /> | |||||
</component> | |||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK" /> | |||||
</project> | </project> |
@@ -0,0 +1,6 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<project version="4"> | |||||
<component name="RenderSettings"> | |||||
<option name="showDecorations" value="true" /> | |||||
</component> | |||||
</project> |
@@ -30,6 +30,18 @@ android { | |||||
targetCompatibility JavaVersion.VERSION_1_8 | targetCompatibility JavaVersion.VERSION_1_8 | ||||
} | } | ||||
buildToolsVersion rootProject.ext.buildToolsVersion | buildToolsVersion rootProject.ext.buildToolsVersion | ||||
sourceSets { | |||||
main { | |||||
res.srcDirs = [ | |||||
'src/main/res/layout/datatab', | |||||
'src/main/res/layout/item', | |||||
'src/main/res/layout', | |||||
'src/main/res' | |||||
] | |||||
} | |||||
} | |||||
} | } | ||||
dependencies { | dependencies { | ||||
@@ -77,21 +77,44 @@ public class DataBus { | |||||
for (BPA_SILOS silo : bpa_silos) { | for (BPA_SILOS silo : bpa_silos) { | ||||
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | ||||
if (m.size() > 0) { | if (m.size() > 0) { | ||||
lcModes.add(new lcMode(silo.id, silo.num, m.get(0).name, silo.silosmargin, m.get(0).id,m.get(0).type, silo.warningValue, silo.thrsoleValue)); | |||||
lcModes.add(new lcMode(silo.id, silo.num, m.get(0).name, silo.silosmargin, silo.siloszl, m.get(0).id,m.get(0).type, silo.warningValue, silo.thrsoleValue)); | |||||
} else { | } else { | ||||
lcModes.add(new lcMode(silo.id, silo.num, "未设置", silo.silosmargin, "",0, silo.warningValue, silo.thrsoleValue)); | |||||
lcModes.add(new lcMode(silo.id, silo.num, "未设置", silo.silosmargin, silo.siloszl, "",0, silo.warningValue, silo.thrsoleValue)); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
if (lcadapter!=null) | if (lcadapter!=null) | ||||
{ | { | ||||
DataBus.getInstance().lcadapter.refresh(); | |||||
lcadapter.refresh(); | |||||
} | } | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
e.printStackTrace(); | e.printStackTrace(); | ||||
} | } | ||||
} | } | ||||
public ArrayList<lcMode> ResGetLc() | |||||
{ | |||||
ArrayList<lcMode> lc=new ArrayList<>(); | |||||
try { | |||||
//获取料仓数据 | |||||
ArrayList<BPA_SILOS> bpa_silos = QueryDB.GetSilosALL(); | |||||
//加载materials数据 | |||||
if (bpa_silos.size() > 0) { | |||||
for (BPA_SILOS silo : bpa_silos) { | |||||
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | |||||
if (m.size() > 0) { | |||||
lc.add(new lcMode(silo.id, silo.num, m.get(0).name, silo.silosmargin, silo.siloszl, m.get(0).id,m.get(0).type, silo.warningValue, silo.thrsoleValue)); | |||||
} else { | |||||
lc.add(new lcMode(silo.id, silo.num, "未设置", silo.silosmargin, silo.siloszl, "",0, silo.warningValue, silo.thrsoleValue)); | |||||
} | |||||
} | |||||
} | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
return lc; | |||||
} | |||||
/** | /** | ||||
* 加满物料 | * 加满物料 | ||||
*/ | */ | ||||
@@ -100,10 +123,10 @@ public class DataBus { | |||||
if(index>=0 && lcModes.size()>=0) | if(index>=0 && lcModes.size()>=0) | ||||
{ | { | ||||
lcModes.get(index).silosmargin=10000; | lcModes.get(index).silosmargin=10000; | ||||
QueryDB.UpdateYL(lcModes.get(index).id,lcModes.get(index).silosmargin); | |||||
if (lcadapter!=null) | if (lcadapter!=null) | ||||
{ | { | ||||
QueryDB.UpdateYL(lcModes.get(index).id,lcModes.get(index).silosmargin); | |||||
DataBus.getInstance().lcadapter.refresh(); | |||||
lcadapter.refresh(); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -222,6 +222,32 @@ public class QueryDB { | |||||
} | } | ||||
} | } | ||||
/** | |||||
* 修改物料名称 | |||||
* @param id | |||||
* @param name | |||||
*/ | |||||
public static void UpdateMaterialName(String id, String name) { | |||||
BPA_MATERIAL material = GetMaterialID(id); | |||||
if (material != null) { | |||||
material.name = name; | |||||
Update(BPA_MATERIAL.class, material); | |||||
} | |||||
} | |||||
/** | |||||
* 修改物料类型 | |||||
* @param id | |||||
* @param type | |||||
*/ | |||||
public static void UpdateMaterialType(String id, int type) { | |||||
BPA_MATERIAL material = GetMaterialID(id); | |||||
if (material != null) { | |||||
material.type = type; | |||||
Update(BPA_MATERIAL.class, material); | |||||
} | |||||
} | |||||
//endregion | //endregion | ||||
//region BPA_SILOS 料仓管理表 | //region BPA_SILOS 料仓管理表 | ||||
@@ -302,6 +328,9 @@ public class QueryDB { | |||||
par.name = k.name; | par.name = k.name; | ||||
par.warningValue = k.warningValue; | par.warningValue = k.warningValue; | ||||
par.thrsoleValue = k.thrsoleValue; | par.thrsoleValue = k.thrsoleValue; | ||||
par.silosmargin = k.silosmargin; | |||||
par.siloszl = k.siloszl; | |||||
par.plcValue = k.plcValue; | par.plcValue = k.plcValue; | ||||
par.bValue = k.bValue; | par.bValue = k.bValue; | ||||
par.jValue = k.jValue; | par.jValue = k.jValue; | ||||
@@ -377,6 +406,34 @@ public class QueryDB { | |||||
Update(BPA_SILOS.class, silos); | Update(BPA_SILOS.class, silos); | ||||
} | } | ||||
} | } | ||||
/** | |||||
* 修改报警值 | |||||
* | |||||
* @param id | |||||
* @param data | |||||
*/ | |||||
public static void UpdateSilosBJZ(String id, int data) { | |||||
BPA_SILOS silos = GetSilosID(id); | |||||
if (silos != null) { | |||||
silos.warningValue = data; | |||||
Update(BPA_SILOS.class, silos); | |||||
} | |||||
} | |||||
/** | |||||
* 修改总量 | |||||
* | |||||
* @param id | |||||
* @param data | |||||
*/ | |||||
public static void UpdateSilosZL(String id, int data) { | |||||
BPA_SILOS silos = GetSilosID(id); | |||||
if (silos != null) { | |||||
silos.siloszl = data; | |||||
Update(BPA_SILOS.class, silos); | |||||
} | |||||
} | |||||
//endregion | //endregion | ||||
//region BPA_SILOSANDMATERIAL 料仓物料关联表 | //region BPA_SILOSANDMATERIAL 料仓物料关联表 | ||||
@@ -2080,6 +2137,7 @@ public class QueryDB { | |||||
((BPA_SILOS) data).status = cursor.getInt((int) cursor.getColumnIndex("status")); | ((BPA_SILOS) data).status = cursor.getInt((int) cursor.getColumnIndex("status")); | ||||
((BPA_SILOS) data).Sort = cursor.getInt((int) cursor.getColumnIndex("Sort")); | ((BPA_SILOS) data).Sort = cursor.getInt((int) cursor.getColumnIndex("Sort")); | ||||
((BPA_SILOS) data).silosmargin = cursor.getInt((int) cursor.getColumnIndex("silosmargin")); | ((BPA_SILOS) data).silosmargin = cursor.getInt((int) cursor.getColumnIndex("silosmargin")); | ||||
((BPA_SILOS) data).siloszl = cursor.getInt((int) cursor.getColumnIndex("siloszl")); | |||||
break; | break; | ||||
case "BPA_SILOSANDMATERIAL": | case "BPA_SILOSANDMATERIAL": | ||||
data = new BPA_SILOSANDMATERIAL(); | data = new BPA_SILOSANDMATERIAL(); | ||||
@@ -25,4 +25,6 @@ public class BPA_SILOS extends ModeBase { | |||||
public int Sort; | public int Sort; | ||||
//料仓余料 | //料仓余料 | ||||
public int silosmargin; | public int silosmargin; | ||||
//料仓总量 | |||||
public int siloszl; | |||||
} | } |
@@ -10,7 +10,7 @@ public class lcMode extends BPA_SILOS { | |||||
public String materialId; | public String materialId; | ||||
//物料类型 | //物料类型 | ||||
public int materiallx; | public int materiallx; | ||||
public lcMode(String id, int num,String materialName, int silosmargin,String materialId,int materiallx,int warningValue,int thrsoleValue) { | |||||
public lcMode(String id, int num,String materialName, int silosmargin,int siloszl,String materialId,int materiallx,int warningValue,int thrsoleValue) { | |||||
this.materialName = materialName; | this.materialName = materialName; | ||||
this.silosmargin = silosmargin; | this.silosmargin = silosmargin; | ||||
this.num = num; | this.num = num; | ||||
@@ -19,5 +19,6 @@ public class lcMode extends BPA_SILOS { | |||||
this.materiallx=materiallx; | this.materiallx=materiallx; | ||||
this.warningValue=warningValue; | this.warningValue=warningValue; | ||||
this.thrsoleValue=thrsoleValue; | this.thrsoleValue=thrsoleValue; | ||||
this.siloszl=siloszl; | |||||
} | } | ||||
} | } |
@@ -4,4 +4,6 @@ import android.view.View; | |||||
public interface MyClickListener { | public interface MyClickListener { | ||||
public void clickListener(View v, Object data); | public void clickListener(View v, Object data); | ||||
public void clickListenerNew(View v,int k, Object data); | |||||
} | } |
@@ -0,0 +1,76 @@ | |||||
package com.bonait.bnframework.modules.home.adapter; | |||||
import android.content.Context; | |||||
import android.view.LayoutInflater; | |||||
import android.view.View; | |||||
import android.view.ViewGroup; | |||||
import android.widget.ArrayAdapter; | |||||
import android.widget.Button; | |||||
import android.widget.TextView; | |||||
import androidx.annotation.NonNull; | |||||
import androidx.annotation.Nullable; | |||||
import com.bonait.bnframework.R; | |||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||||
import com.bonait.bnframework.common.db.res.lcMode; | |||||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||||
import java.util.List; | |||||
/** | |||||
* 物料数据表格 | |||||
*/ | |||||
public class lcsz_adapter extends ArrayAdapter<lcMode> { | |||||
/** | |||||
* 内部点击事件 | |||||
*/ | |||||
private MyClickListener mListener; | |||||
private List<lcMode> datas; | |||||
int resource1; | |||||
public lcsz_adapter(@NonNull Context context, int resource, @NonNull List<lcMode> objects, MyClickListener listener) { | |||||
super(context, resource, objects); | |||||
mListener = listener; | |||||
datas=objects; | |||||
this.resource1=resource; | |||||
} | |||||
//每个子项被滚动到屏幕内的时候会被调用 | |||||
@NonNull | |||||
@Override | |||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { | |||||
lcMode lc = (lcMode) getItem(position);//得到当前项选中item实例 | |||||
//为每一个子项加载设定的布局 | |||||
View view = LayoutInflater.from(getContext()).inflate(resource1, parent, false); | |||||
//分别获取 image view 和 textview 的实例 | |||||
TextView xh = view.findViewById(R.id.xh); | |||||
TextView name = view.findViewById(R.id.name); | |||||
TextView bjz = view.findViewById(R.id.bjz); | |||||
TextView zlz = view.findViewById(R.id.zlz); | |||||
// 设置要显示的图片和文字 | |||||
xh.setText(lc.num+""); | |||||
name.setText(lc.materialName); | |||||
bjz.setText(lc.warningValue+""); | |||||
zlz.setText(lc.siloszl+""); | |||||
name.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
if(mListener!=null) mListener.clickListenerNew(view,0,lc); | |||||
} | |||||
}); | |||||
bjz.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
if(mListener!=null) mListener.clickListenerNew(view,0,lc); | |||||
} | |||||
}); | |||||
zlz.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
if(mListener!=null) mListener.clickListenerNew(view,0,lc); | |||||
} | |||||
}); | |||||
return view; | |||||
} | |||||
} |
@@ -0,0 +1,72 @@ | |||||
package com.bonait.bnframework.modules.home.adapter; | |||||
import android.content.Context; | |||||
import android.view.LayoutInflater; | |||||
import android.view.View; | |||||
import android.view.ViewGroup; | |||||
import android.widget.ArrayAdapter; | |||||
import android.widget.Button; | |||||
import android.widget.TextView; | |||||
import androidx.annotation.NonNull; | |||||
import androidx.annotation.Nullable; | |||||
import com.bonait.bnframework.R; | |||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||||
import java.util.List; | |||||
/** | |||||
* 物料数据表格 | |||||
*/ | |||||
public class wl_adapter extends ArrayAdapter<BPA_MATERIAL> { | |||||
/** | |||||
* 内部点击事件 | |||||
*/ | |||||
private MyClickListener mListener; | |||||
private List<BPA_MATERIAL> datas; | |||||
int resource1; | |||||
public wl_adapter(@NonNull Context context, int resource, @NonNull List<BPA_MATERIAL> objects, MyClickListener listener) { | |||||
super(context, resource, objects); | |||||
mListener = listener; | |||||
datas=objects; | |||||
this.resource1=resource; | |||||
} | |||||
//每个子项被滚动到屏幕内的时候会被调用 | |||||
@NonNull | |||||
@Override | |||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { | |||||
BPA_MATERIAL bpa_material = (BPA_MATERIAL) getItem(position);//得到当前项选中item实例 | |||||
//为每一个子项加载设定的布局 | |||||
View view = LayoutInflater.from(getContext()).inflate(resource1, parent, false); | |||||
//分别获取 image view 和 textview 的实例 | |||||
TextView name = view.findViewById(R.id.name); | |||||
Button button = view.findViewById(R.id.button_item); | |||||
TextView lx = view.findViewById(R.id.lx); | |||||
// 设置要显示的图片和文字 | |||||
name.setText(bpa_material.name); | |||||
lx.setText(bpa_material.type==0?"液料":"酱料"); | |||||
lx.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
if(mListener!=null) mListener.clickListener(view,bpa_material); | |||||
} | |||||
}); | |||||
name.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
if(mListener!=null) mListener.clickListener(view,bpa_material); | |||||
} | |||||
}); | |||||
button.setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View view) { | |||||
if(mListener!=null) mListener.clickListener(view,bpa_material); | |||||
} | |||||
}); | |||||
return view; | |||||
} | |||||
} |
@@ -102,6 +102,7 @@ public class Home1Fragment extends BaseFragment { | |||||
*/ | */ | ||||
private void initData() { | private void initData() { | ||||
try{ | try{ | ||||
DataBus.getInstance().GetLc(); | |||||
MyLayoutManager layout = new MyLayoutManager(); | MyLayoutManager layout = new MyLayoutManager(); | ||||
layout.setAutoMeasureEnabled(true); | layout.setAutoMeasureEnabled(true); | ||||
recyclerView.setLayoutManager(layout); | recyclerView.setLayoutManager(layout); | ||||
@@ -109,6 +110,7 @@ public class Home1Fragment extends BaseFragment { | |||||
DataBus.getInstance().lcadapter = new lc_adapter( getContext()); | DataBus.getInstance().lcadapter = new lc_adapter( getContext()); | ||||
recyclerView.setAdapter(DataBus.getInstance().lcadapter); | recyclerView.setAdapter(DataBus.getInstance().lcadapter); | ||||
}catch(Exception e){ | }catch(Exception e){ | ||||
ToastUtils.info("异常信息:"+e.getMessage()); | ToastUtils.info("异常信息:"+e.getMessage()); | ||||
} | } | ||||
@@ -124,6 +126,11 @@ public class Home1Fragment extends BaseFragment { | |||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
ToastUtils.info("火力按钮点击,当前级别:"+data); | ToastUtils.info("火力按钮点击,当前级别:"+data); | ||||
} | } | ||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
} | |||||
}; | }; | ||||
DataBus.getInstance().mListener=new MyClickListener() { | DataBus.getInstance().mListener=new MyClickListener() { | ||||
@@ -133,6 +140,12 @@ public class Home1Fragment extends BaseFragment { | |||||
caipumingcheng.setText(good.name); | caipumingcheng.setText(good.name); | ||||
shengyushijian.setText("预计剩余时间:300s"); | shengyushijian.setText("预计剩余时间:300s"); | ||||
} | } | ||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
ToastUtils.info("刷新界面"); | |||||
initData(); | |||||
} | |||||
}; | }; | ||||
} | } | ||||
@@ -84,12 +84,22 @@ public class CpxzActivity extends BaseActivity { | |||||
} | } | ||||
finish(); | finish(); | ||||
} | } | ||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
} | |||||
}; | }; | ||||
}catch(Exception e){ | }catch(Exception e){ | ||||
ToastUtils.info("异常信息:"+e.getMessage()); | ToastUtils.info("异常信息:"+e.getMessage()); | ||||
} | } | ||||
} | } | ||||
public void initEvent() | |||||
{ | |||||
} | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
@@ -4,9 +4,18 @@ import android.content.Context; | |||||
import androidx.annotation.NonNull; | import androidx.annotation.NonNull; | ||||
import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
import androidx.appcompat.app.AppCompatActivity; | import androidx.appcompat.app.AppCompatActivity; | ||||
import android.content.DialogInterface; | |||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import android.text.InputType; | |||||
import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||
import android.view.View; | import android.view.View; | ||||
import android.widget.AdapterView; | |||||
import android.widget.ArrayAdapter; | |||||
import android.widget.Button; | |||||
import android.widget.EditText; | |||||
import android.widget.ListView; | |||||
import android.widget.Spinner; | |||||
import android.widget.TextView; | import android.widget.TextView; | ||||
import com.bin.david.form.core.SmartTable; | import com.bin.david.form.core.SmartTable; | ||||
@@ -14,19 +23,55 @@ import com.bin.david.form.data.column.ColumnInfo; | |||||
import com.bin.david.form.listener.OnColumnClickListener; | import com.bin.david.form.listener.OnColumnClickListener; | ||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.common.base.BaseFragment; | import com.bonait.bnframework.common.base.BaseFragment; | ||||
import com.bonait.bnframework.common.constant.ConfigName; | |||||
import com.bonait.bnframework.common.constant.DataBus; | |||||
import com.bonait.bnframework.common.constant.MessageName; | |||||
import com.bonait.bnframework.common.db.QueryDB; | |||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | ||||
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | |||||
import com.bonait.bnframework.common.db.res.lcMode; | |||||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||||
import com.bonait.bnframework.common.message.MessageManager; | |||||
import com.bonait.bnframework.common.utils.ToastUtils; | import com.bonait.bnframework.common.utils.ToastUtils; | ||||
import com.bonait.bnframework.modules.home.adapter.lc_adapter; | |||||
import com.bonait.bnframework.modules.home.adapter.lcsz_adapter; | |||||
import com.bonait.bnframework.modules.home.adapter.wl_adapter; | |||||
import com.bonait.bnframework.modules.home.fragment.from.CpActivity; | |||||
import com.bonait.bnframework.modules.home.fragment.from.DiyActivity; | |||||
import com.bonait.bnframework.modules.home.fragment.from.SzActivity; | |||||
import com.bonait.bnframework.modules.home.fragment.from.WhActivity; | |||||
import com.orhanobut.logger.Logger; | import com.orhanobut.logger.Logger; | ||||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.LinkedHashMap; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | |||||
import butterknife.BindView; | import butterknife.BindView; | ||||
import butterknife.ButterKnife; | import butterknife.ButterKnife; | ||||
import butterknife.OnClick; | |||||
public class SystemSeasoningsetFragment extends BaseFragment { | |||||
public class SystemSeasoningsetFragment extends BaseFragment implements MyClickListener { | |||||
@BindView(R.id.edittext) | |||||
EditText edittext; | |||||
@BindView(R.id.wllx) | |||||
Spinner wllx; | |||||
@BindView(R.id.add_wl) | |||||
Button add_wl; | |||||
@BindView(R.id.datatab_wl) | |||||
ListView datatab_wl; | |||||
Map<String,Integer> wllx_map = new LinkedHashMap<>(); | |||||
/** | |||||
* 物料数据 | |||||
*/ | |||||
ArrayList<BPA_MATERIAL> bpa_materials=new ArrayList<>(); | |||||
@BindView(R.id.datatab_lc) | |||||
ListView datatab_lc;//料仓 | |||||
ArrayList<lcMode> lcModes=new ArrayList<>(); | |||||
private Context context; | private Context context; | ||||
@Override | @Override | ||||
protected View onCreateView() { | protected View onCreateView() { | ||||
@@ -47,22 +92,85 @@ public class SystemSeasoningsetFragment extends BaseFragment { | |||||
* 初始化界面 | * 初始化界面 | ||||
*/ | */ | ||||
public void InitView() { | public void InitView() { | ||||
// 设置数据源 | |||||
// List<BPA_MATERIAL> dataSource = new ArrayList(); | |||||
// for (int i = 0; i < 30; i++) | |||||
// { | |||||
// BPA_MATERIAL b=new BPA_MATERIAL(){ }; | |||||
// b.name="物料"+i; | |||||
// b.type=i%3==0?0:1; | |||||
// dataSource.add(b); | |||||
// } | |||||
wllx_map.put("液料",0); | |||||
wllx_map.put("酱料",1); | |||||
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(wllx_map.keySet())); | |||||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||||
wllx.setAdapter(adapter2); | |||||
Initdata_wl(); | |||||
Initdata_lc(); | |||||
} | |||||
@OnClick({R.id.add_wl}) | |||||
public void onViewClicked(View view) { | |||||
switch (view.getId()) { | |||||
case R.id.add_wl://增加物料 | |||||
String name= edittext.getText().toString(); | |||||
String lx=wllx.getSelectedItem().toString(); | |||||
if(name.isEmpty()){ | |||||
ToastUtils.info("物料名称不能为空"); | |||||
return; | |||||
} | |||||
if(lx.isEmpty()){ | |||||
ToastUtils.info("物料类型不能为空"); | |||||
return; | |||||
} | |||||
if(QueryDB.GetMaterialIs(name)){ | |||||
ToastUtils.info("物料名称重复,请重新输入后重试!"); | |||||
return; | |||||
} | |||||
BPA_MATERIAL bpa_material=new BPA_MATERIAL(); | |||||
bpa_material.name=name; | |||||
bpa_material.imgUrl=""; | |||||
bpa_material.type=wllx_map.get(lx); | |||||
bpa_material.deviceID= ConfigName.getInstance().DeviceId; | |||||
bpa_material.userID=ConfigName.getInstance().user.userID; | |||||
QueryDB.AddMaterial(bpa_material); | |||||
ToastUtils.info("新增成功"); | |||||
Initdata_wl(); | |||||
break; | |||||
} | |||||
} | |||||
//region 数据加载 | |||||
/** | |||||
* 初始化数据加载 | |||||
*/ | |||||
public void Initdata_wl() | |||||
{ | |||||
try{ | |||||
bpa_materials= QueryDB.GetMaterialALL(); | |||||
wl_adapter adapter = new wl_adapter(context, R.layout.wl_item, bpa_materials,this); | |||||
datatab_wl.setAdapter(adapter); | |||||
}catch(Exception e){ | |||||
} | |||||
} | |||||
/** | |||||
* 初始化数据加载 | |||||
*/ | |||||
public void Initdata_lc() | |||||
{ | |||||
try{ | |||||
lcModes=DataBus.getInstance().ResGetLc(); | |||||
lcsz_adapter adapter1 = new lcsz_adapter(context, R.layout.lcsz_item,lcModes,this); | |||||
datatab_lc.setAdapter(adapter1); | |||||
}catch(Exception e){ | |||||
} | |||||
} | } | ||||
//endregion | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
if( DataBus.getInstance().mListener!=null) | |||||
{ | |||||
DataBus.getInstance().mListener.clickListenerNew(this.getView(),0,""); | |||||
} | |||||
Logger.d("我的fragment销毁"); | Logger.d("我的fragment销毁"); | ||||
} | } | ||||
@@ -79,4 +187,175 @@ public class SystemSeasoningsetFragment extends BaseFragment { | |||||
protected boolean canDragBack() { | protected boolean canDragBack() { | ||||
return false; | return false; | ||||
} | } | ||||
/** | |||||
* 点击事件 | |||||
* @param v | |||||
* @param data | |||||
*/ | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) | |||||
{ | |||||
case R.id.name://修改物料名称按钮 | |||||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder.setTitle("物料名称") | |||||
.setPlaceholder("在此输入物料名称") | |||||
.setDefaultText(((BPA_MATERIAL)data).name) | |||||
.setInputType(InputType.TYPE_CLASS_TEXT) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
if(QueryDB.GetMaterialIs(text.toString())){ | |||||
ToastUtils.info("物料名称重复,请重新输入后重试!"); | |||||
return; | |||||
} | |||||
QueryDB.UpdateMaterialName(((BPA_MATERIAL)data).id,text.toString()); | |||||
Initdata_wl(); | |||||
dialog.dismiss(); | |||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("物料名称不能为空!"); | |||||
} | |||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.lx://选择类型 | |||||
final String [] items=new String[]{"液料","酱料"}; | |||||
final int checkIndex=((BPA_MATERIAL)data).type; | |||||
new QMUIDialog.CheckableDialogBuilder(context) | |||||
.addItems(items, new DialogInterface.OnClickListener() { | |||||
@Override | |||||
public void onClick(DialogInterface dialog, int which) { | |||||
QueryDB.UpdateMaterialType(((BPA_MATERIAL)data).id,which); | |||||
Initdata_wl(); | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.setCheckedIndex(checkIndex) | |||||
.show(); | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
QueryDB.DeleteMaterial((BPA_MATERIAL)data); | |||||
Initdata_wl(); | |||||
break; | |||||
} | |||||
} | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
lcMode lc= (lcMode)data; | |||||
switch (v.getId()) | |||||
{ | |||||
case R.id.name://修改物料 | |||||
List<String> names=new ArrayList<>(); | |||||
int index=0; | |||||
int count=0; | |||||
ArrayList<BPA_MATERIAL> materials=new ArrayList<>(); | |||||
for (BPA_MATERIAL item: bpa_materials) | |||||
{ | |||||
materials.add(item); | |||||
} | |||||
BPA_MATERIAL wsz = new BPA_MATERIAL(); | |||||
wsz.name = "未设置"; | |||||
wsz.id = ""; | |||||
materials.add(wsz); | |||||
for (BPA_MATERIAL item: materials) | |||||
{ | |||||
names.add(item.name); | |||||
if(item.name.equals(lc.materialName)) | |||||
{ | |||||
index=count; | |||||
} | |||||
count++; | |||||
} | |||||
String[] items = names.toArray(new String[names.size()]); | |||||
final int checkIndex=index; | |||||
new QMUIDialog.CheckableDialogBuilder(context) | |||||
.addItems(items, new DialogInterface.OnClickListener() { | |||||
@Override | |||||
public void onClick(DialogInterface dialog, int which) { | |||||
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | |||||
BPA_MATERIAL material = materials.get(which); | |||||
item.silosID = lc.id; | |||||
item.materialID = material.id; | |||||
//更新 | |||||
if (QueryDB.UpdateSilosAndMaterial(item)) { | |||||
Initdata_lc(); | |||||
dialog.dismiss(); | |||||
} | |||||
} | |||||
}) | |||||
.setCheckedIndex(checkIndex) | |||||
.show(); | |||||
break; | |||||
case R.id.bjz://修改料仓报警值 | |||||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder.setTitle(lc.materialName+" 报警值(g)") | |||||
.setPlaceholder("在此输入报警值") | |||||
.setDefaultText(lc.warningValue+"") | |||||
.setInputType(InputType.TYPE_CLASS_NUMBER) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
QueryDB.UpdateSilosBJZ(lc.id,Integer.parseInt(text.toString())); | |||||
Initdata_lc(); | |||||
dialog.dismiss(); | |||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("值不能为空!"); | |||||
} | |||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.zlz://修改料仓总量值 | |||||
final QMUIDialog.EditTextDialogBuilder builder1 = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder1.setTitle(lc.materialName+" 总量值(g)") | |||||
.setPlaceholder("在此输入总量值") | |||||
.setDefaultText(lc.siloszl+"") | |||||
.setInputType(InputType.TYPE_CLASS_NUMBER) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder1.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
QueryDB.UpdateSilosZL(lc.id,Integer.parseInt(text.toString())); | |||||
Initdata_lc(); | |||||
dialog.dismiss(); | |||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("值不能为空!"); | |||||
} | |||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
} | |||||
} | |||||
} | } |
@@ -12,7 +12,7 @@ | |||||
<item android:state_enabled="false"> | <item android:state_enabled="false"> | ||||
<shape> | <shape> | ||||
<solid android:color="#cccccc" /> | |||||
<solid android:color="@color/color3" /> | |||||
<corners android:radius="3dp" /> | <corners android:radius="3dp" /> | ||||
</shape> | </shape> | ||||
</item> | </item> | ||||
@@ -2,14 +2,11 @@ | |||||
<!-- 在Topbar下方的Tab面板的背景,带底部分割线 --> | <!-- 在Topbar下方的Tab面板的背景,带底部分割线 --> | ||||
<inset xmlns:android="http://schemas.android.com/apk/res/android" | <inset xmlns:android="http://schemas.android.com/apk/res/android" | ||||
android:insetLeft="@dimen/list_divider_height_negative" | |||||
android:insetTop="@dimen/list_divider_height_negative" | |||||
android:insetRight="@dimen/list_divider_height_negative"> | |||||
> | |||||
<shape> | <shape> | ||||
<solid android:color="@color/tab_panel_bg" /> | <solid android:color="@color/tab_panel_bg" /> | ||||
<stroke | <stroke | ||||
android:width="1dp" | android:width="1dp" | ||||
android:color="@color/gray" /> | |||||
android:color="@color/color3" /> | |||||
</shape> | </shape> | ||||
</inset> | </inset> |
@@ -0,0 +1,28 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<!-- 第一组item:设置Spinner背景边框 --> | |||||
<item> | |||||
<shape> | |||||
<stroke | |||||
android:width="1dp" | |||||
android:color="@color/color3"> | |||||
</stroke> | |||||
<corners android:radius="0dp" /> | |||||
<!-- 设置背景颜色 --> | |||||
<padding | |||||
android:bottom="0dp" | |||||
android:left="30dp" | |||||
android:right="5dp" | |||||
android:top="0dp" > | |||||
</padding> | |||||
</shape> | |||||
<!-- 第二组item:设置spinner箭头图片 --> | |||||
</item> | |||||
<item> | |||||
<bitmap | |||||
android:gravity="end" | |||||
android:src="@mipmap/spinner_down_2"> | |||||
</bitmap> | |||||
</item> | |||||
</layer-list> |
@@ -134,7 +134,7 @@ | |||||
android:text="步骤:"/> | android:text="步骤:"/> | ||||
<Button | <Button | ||||
android:layout_width="50dp" | android:layout_width="50dp" | ||||
android:layout_height="30dp" | |||||
android:layout_height="26dp" | |||||
android:background="@drawable/button" | android:background="@drawable/button" | ||||
android:text="上移" | android:text="上移" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
@@ -142,7 +142,7 @@ | |||||
<Button | <Button | ||||
android:layout_marginLeft="@dimen/dp_10" | android:layout_marginLeft="@dimen/dp_10" | ||||
android:layout_width="50dp" | android:layout_width="50dp" | ||||
android:layout_height="30dp" | |||||
android:layout_height="26dp" | |||||
android:background="@drawable/button" | android:background="@drawable/button" | ||||
android:text="下移" | android:text="下移" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
@@ -154,7 +154,7 @@ | |||||
android:layout_centerHorizontal="true" | android:layout_centerHorizontal="true" | ||||
android:layout_alignParentBottom="true" | android:layout_alignParentBottom="true" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="30dp" | |||||
android:layout_height="26dp" | |||||
android:background="@drawable/button1" | android:background="@drawable/button1" | ||||
android:text="操作模式" | android:text="操作模式" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
@@ -207,7 +207,7 @@ | |||||
android:layout_height="wrap_content"> | android:layout_height="wrap_content"> | ||||
<Button | <Button | ||||
android:layout_width="50dp" | android:layout_width="50dp" | ||||
android:layout_height="30dp" | |||||
android:layout_height="26dp" | |||||
android:background="@drawable/button1" | android:background="@drawable/button1" | ||||
android:text="添加" | android:text="添加" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
@@ -215,7 +215,7 @@ | |||||
<Button | <Button | ||||
android:layout_marginLeft="@dimen/dp_10" | android:layout_marginLeft="@dimen/dp_10" | ||||
android:layout_width="50dp" | android:layout_width="50dp" | ||||
android:layout_height="30dp" | |||||
android:layout_height="26dp" | |||||
android:background="@drawable/button" | android:background="@drawable/button" | ||||
android:text="修改" | android:text="修改" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
@@ -223,7 +223,7 @@ | |||||
<Button | <Button | ||||
android:layout_marginLeft="@dimen/dp_10" | android:layout_marginLeft="@dimen/dp_10" | ||||
android:layout_width="50dp" | android:layout_width="50dp" | ||||
android:layout_height="30dp" | |||||
android:layout_height="26dp" | |||||
android:background="@drawable/button" | android:background="@drawable/button" | ||||
android:text="删除" | android:text="删除" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
@@ -0,0 +1,88 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:orientation="horizontal" | |||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||||
xsi:schemaLocation="http://schemas.android.com/apk/res/android "> | |||||
<TableLayout | |||||
android:background="@color/activity_background1" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="center" | |||||
android:layout_gravity="center" | |||||
android:stretchColumns="0"> | |||||
<TableRow | |||||
android:layout_width="fill_parent" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="center_horizontal"> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<TextView | |||||
android:id="@+id/xh" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="序号" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<TextView | |||||
android:id="@+id/name" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="类型" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<TextView | |||||
android:id="@+id/bjz" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="类型" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<TextView | |||||
android:id="@+id/zlz" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="类型" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
</TableRow> | |||||
</TableLayout> | |||||
</RelativeLayout> |
@@ -0,0 +1,73 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:orientation="horizontal" | |||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||||
xsi:schemaLocation="http://schemas.android.com/apk/res/android "> | |||||
<TableLayout | |||||
android:background="@color/activity_background1" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="center" | |||||
android:layout_gravity="center" | |||||
android:stretchColumns="0"> | |||||
<TableRow | |||||
android:layout_width="fill_parent" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="center_horizontal"> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<TextView | |||||
android:id="@+id/name" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="回锅肉" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<TextView | |||||
android:id="@+id/lx" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:layout_alignParentLeft="true" | |||||
android:text="类型" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="match_parent" | |||||
android:layout_weight="1"> | |||||
<Button | |||||
android:id="@+id/button_item" | |||||
android:layout_width="60dp" | |||||
android:layout_centerVertical="true" | |||||
android:layout_height="20dp" | |||||
android:layout_marginLeft="20dp" | |||||
android:background="@drawable/button" | |||||
android:focusable="false" | |||||
android:text="删除" | |||||
android:textSize="12dp"/> | |||||
</RelativeLayout> | |||||
</TableRow> | |||||
</TableLayout> | |||||
</RelativeLayout> |
@@ -261,10 +261,11 @@ android:orientation="vertical"> | |||||
android:layout_marginRight="5dp" | android:layout_marginRight="5dp" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="match_parent"> | android:layout_height="match_parent"> | ||||
<LinearLayout | <LinearLayout | ||||
android:layout_centerInParent="true" | |||||
android:layout_width="1dp" | android:layout_width="1dp" | ||||
android:layout_height="50dp" | android:layout_height="50dp" | ||||
android:layout_centerInParent="true" | |||||
android:background="@color/activity_background" /> | android:background="@color/activity_background" /> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
@@ -8,13 +8,303 @@ | |||||
<LinearLayout | <LinearLayout | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:orientation="vertical" | |||||
android:background="@color/main_background"> | |||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:background="@color/main_background" | |||||
android:orientation="vertical"> | |||||
<!-- 物料信息管理 --> | |||||
<LinearLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:background="@color/qmui_config_color_white" | |||||
android:orientation="vertical" | |||||
android:paddingLeft="@dimen/dp_10" | |||||
android:paddingTop="@dimen/dp_10" | |||||
android:paddingRight="@dimen/dp_10"> | |||||
<RelativeLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="match_parent"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="物料信息" | |||||
android:textSize="19dp" /> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginLeft="80dp" | |||||
android:layout_centerVertical="true" | |||||
android:textColor="@color/amber_primary_dark" | |||||
android:text="(温馨提示:点击行可修改内容.)" | |||||
android:textSize="12dp" /> | |||||
</RelativeLayout> | |||||
<LinearLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentBottom="true" | |||||
android:layout_marginTop="5dp" | |||||
android:layout_marginBottom="5dp"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="名称:" /> | |||||
<EditText | |||||
android:id="@+id/edittext" | |||||
android:layout_width="120dp" | |||||
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="12dp" /> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginLeft="@dimen/dp_10" | |||||
android:text="类型:" /> | |||||
<RelativeLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="match_parent"> | |||||
<Spinner | |||||
android:id="@+id/wllx" | |||||
style="@style/commonSpinnerStyle" | |||||
android:layout_width="80dp" | |||||
android:layout_height="24dp" | |||||
android:layout_centerVertical="true" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content"> | |||||
<Button | |||||
android:id="@+id/add_wl" | |||||
android:layout_width="60dp" | |||||
android:layout_height="26dp" | |||||
android:layout_alignParentRight="true" | |||||
android:layout_centerInParent="true" | |||||
android:layout_marginLeft="@dimen/dp_10" | |||||
android:background="@drawable/button1" | |||||
android:text="增加" | |||||
android:textSize="14dp" /> | |||||
</RelativeLayout> | |||||
</LinearLayout> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="150dp" | |||||
android:layout_marginTop="5dp"> | |||||
<LinearLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:orientation="vertical"> | |||||
<!-- 表头 --> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="26dp" | |||||
android:background="@color/activity_background"> | |||||
<TableLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_gravity="center" | |||||
android:gravity="center" | |||||
android:stretchColumns="0"> | |||||
<TableRow | |||||
android:layout_width="fill_parent" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="center_horizontal"> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="物料名称" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="物料类型" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="用户操作" /> | |||||
</RelativeLayout> | |||||
</TableRow> | |||||
</TableLayout> | |||||
</RelativeLayout> | |||||
<!-- 数据 --> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent"> | |||||
<ListView | |||||
android:id="@+id/datatab_wl" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:layout_marginTop="3dp" | |||||
android:divider="#00000000" | |||||
android:dividerHeight="3dp" /> | |||||
</RelativeLayout> | |||||
</LinearLayout> | |||||
</RelativeLayout> | |||||
</LinearLayout> | |||||
<!-- 料仓信息管理 --> | |||||
<LinearLayout | |||||
android:layout_marginTop="5dp" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:text="物料信息"/> | |||||
android:background="@color/qmui_config_color_white" | |||||
android:orientation="vertical" | |||||
android:paddingLeft="@dimen/dp_10" | |||||
android:paddingTop="@dimen/dp_10" | |||||
android:paddingRight="@dimen/dp_10"> | |||||
<RelativeLayout | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="match_parent"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:text="料仓管理" | |||||
android:textSize="19dp" /> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginLeft="80dp" | |||||
android:layout_centerVertical="true" | |||||
android:textColor="@color/amber_primary_dark" | |||||
android:text="(温馨提示:点击行可修改内容.)" | |||||
android:textSize="12dp" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="150dp" | |||||
android:layout_marginTop="5dp"> | |||||
<LinearLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:orientation="vertical"> | |||||
<!-- 表头 --> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="26dp" | |||||
android:background="@color/activity_background"> | |||||
<TableLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:layout_centerVertical="true" | |||||
android:layout_gravity="center" | |||||
android:gravity="center" | |||||
android:stretchColumns="0"> | |||||
<TableRow | |||||
android:layout_width="fill_parent" | |||||
android:layout_height="wrap_content" | |||||
android:gravity="center_horizontal"> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="仓号" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="液料名" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="报警值(g)" /> | |||||
</RelativeLayout> | |||||
<RelativeLayout | |||||
android:layout_width="0dp" | |||||
android:layout_height="wrap_content" | |||||
android:layout_weight="1"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_alignParentLeft="true" | |||||
android:layout_marginLeft="20dp" | |||||
android:text="总量值(g)" /> | |||||
</RelativeLayout> | |||||
</TableRow> | |||||
</TableLayout> | |||||
</RelativeLayout> | |||||
<!-- 数据 --> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent"> | |||||
<ListView | |||||
android:id="@+id/datatab_lc" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:layout_marginTop="3dp" | |||||
android:divider="#00000000" | |||||
android:dividerHeight="3dp" /> | |||||
</RelativeLayout> | |||||
</LinearLayout> | |||||
</RelativeLayout> | |||||
</LinearLayout> | |||||
</LinearLayout> | </LinearLayout> | ||||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> | </com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,12 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" | |||||
android:id="@+id/checkedTextViewCustom_1" | |||||
style="?android:attr/spinnerDropDownItemStyle" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="35dp" | |||||
android:background="@color/activity_background" | |||||
android:ellipsize="marquee" | |||||
android:singleLine="true" | |||||
android:text="11111" | |||||
android:textAlignment="inherit" | |||||
android:textSize="12dp"/> |
@@ -0,0 +1,16 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | |||||
android:id="@+id/textViewCustom" | |||||
style="?android:attr/spinnerItemStyle" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:ellipsize="marquee" | |||||
android:singleLine="true" | |||||
android:textAlignment="inherit" | |||||
android:gravity="center_vertical" | |||||
android:text="请选择" | |||||
android:textSize="12dp"> | |||||
</TextView> | |||||
@@ -5,24 +5,28 @@ | |||||
android:background="@drawable/common_bg_with_radius_and_border"> | android:background="@drawable/common_bg_with_radius_and_border"> | ||||
<LinearLayout | <LinearLayout | ||||
android:layout_width="wrap_content" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_centerInParent="true" | android:layout_centerInParent="true" | ||||
android:orientation="vertical"> | android:orientation="vertical"> | ||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_centerHorizontal="true" | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="wrap_content" | |||||
android:background="@drawable/hr_bj"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:id="@+id/type" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content"> | |||||
<RelativeLayout | |||||
android:layout_centerHorizontal="true" | |||||
android:layout_width="60dp" | |||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_marginBottom="5dp" | |||||
android:text="液料" | |||||
android:textSize="12dp" | |||||
android:layout_centerInParent="true" | |||||
android:textColor="@color/white"/> | |||||
android:background="@drawable/hr_bj"> | |||||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||||
android:id="@+id/type" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginBottom="5dp" | |||||
android:text="液料" | |||||
android:textSize="12dp" | |||||
android:layout_centerInParent="true" | |||||
android:textColor="@color/white"/> | |||||
</RelativeLayout> | |||||
</RelativeLayout> | </RelativeLayout> | ||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_marginTop="5dp" | android:layout_marginTop="5dp" | ||||
@@ -5,6 +5,10 @@ | |||||
<color name="colorAccent">#D81B60</color>--> | <color name="colorAccent">#D81B60</color>--> | ||||
<!-- common --> | <!-- common --> | ||||
<color name="dataGridColumnHeaderColor">#00c2f4</color> | |||||
<color name="foreground">#a2c2e8</color> | |||||
<color name="borderBrush">#FF074B92</color> | |||||
<color name="app_color_blue">#00A8E1</color> | <color name="app_color_blue">#00A8E1</color> | ||||
<color name="app_color_blue_disabled">#8000A8E1</color> | <color name="app_color_blue_disabled">#8000A8E1</color> | ||||
<color name="app_color_blue_pressed">#c000A8E1</color> | <color name="app_color_blue_pressed">#c000A8E1</color> | ||||
@@ -50,6 +54,7 @@ | |||||
<color name="gray_deep">#666666</color> | <color name="gray_deep">#666666</color> | ||||
<color name="black_overlay">#66000000</color> | <color name="black_overlay">#66000000</color> | ||||
<color name="activity_background">#EEEEEE</color> | <color name="activity_background">#EEEEEE</color> | ||||
<color name="activity_background1">#F8F7F7</color> | |||||
<color name="transparent">#00000000</color> | <color name="transparent">#00000000</color> | ||||
<color name="main_background">#EEEEEE</color> | <color name="main_background">#EEEEEE</color> | ||||
<color name="colorLoginButton">#004684</color> | <color name="colorLoginButton">#004684</color> | ||||
@@ -39,4 +39,9 @@ | |||||
<dimen name="dp_4">4dp</dimen> | <dimen name="dp_4">4dp</dimen> | ||||
<dimen name="dp_40">40dp</dimen> | <dimen name="dp_40">40dp</dimen> | ||||
<dimen name="sp_14">14sp</dimen> | <dimen name="sp_14">14sp</dimen> | ||||
<!-- text --> | |||||
<dimen name="textSize">14dp</dimen> | |||||
<dimen name="textTitleSize">16sp</dimen> | |||||
<dimen name="TitleSize">18sp</dimen> | |||||
</resources> | </resources> |
@@ -3,6 +3,12 @@ | |||||
<!-- Base application theme. --> | <!-- Base application theme. --> | ||||
<style name="AppTheme" parent="QMUI.Compat.NoActionBar"> | <style name="AppTheme" parent="QMUI.Compat.NoActionBar"> | ||||
<!-- <style name="MyEditText1" parent="Theme.AppCompat.Light">--> | |||||
<!-- <item name="colorControlNormal">@color/borderBrush</item>--> | |||||
<!-- <item name="colorControlActivated">@color/foreground</item>--> | |||||
<!-- <item name="android:textColorHint">@color/borderBrush</item>--> | |||||
<!-- <item name="android:imeOptions">flagNoFullscreen</item>--> | |||||
<!-- </style>--> | |||||
<item name="colorPrimary">@color/app_color_blue</item> | <item name="colorPrimary">@color/app_color_blue</item> | ||||
<item name="colorPrimaryDark">@color/app_color_blue</item> | <item name="colorPrimaryDark">@color/app_color_blue</item> | ||||
<!--<item name="colorAccent">@color/app_color_blue</item>--> | <!--<item name="colorAccent">@color/app_color_blue</item>--> | ||||
@@ -188,4 +194,26 @@ | |||||
<item name="android:background">@color/black_overlay</item> | <item name="android:background">@color/black_overlay</item> | ||||
<item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item> | <item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item> | ||||
</style> | </style> | ||||
<style name="TechSpinnerStyle" parent="Widget.AppCompat.Spinner"> | |||||
<item name="android:background">#42A5F5</item> | |||||
<item name="android:popupBackground">@color/borderBrush</item> | |||||
<item name="android:dropDownVerticalOffset">40dp</item> | |||||
<item name="android:paddingLeft">4dp</item> | |||||
<item name="android:paddingRight">4dp</item> | |||||
<item name="android:paddingTop">4dp</item> | |||||
<item name="android:paddingBottom">4dp</item> | |||||
<item name="android:textColor">@color/white</item> | |||||
</style> | |||||
<style name="commonSpinnerStyle" parent="Widget.AppCompat.Spinner"> | |||||
<item name="android:background">@drawable/spinner_border</item> | |||||
<!-- <item name="android:popupBackground">@color/main_background</item>--> | |||||
<item name="android:dropDownVerticalOffset">30dp</item> | |||||
<item name="android:paddingLeft">0dp</item> | |||||
<item name="android:paddingRight">4dp</item> | |||||
<item name="android:paddingTop">0dp</item> | |||||
<item name="android:paddingBottom">0dp</item> | |||||
<item name="android:layout_height">26dp</item> | |||||
<item name="android:layout_marginLeft">5dp</item> | |||||
<item name="android:textColor">@color/black</item> | |||||
</style> | |||||
</resources> | </resources> |