@@ -17,13 +17,9 @@ import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.MessageName; | |||
import com.bonait.bnframework.common.message.MessageManager; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
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.GoodPeiFangActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.JcsjglActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SilosActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SzActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.WhActivity; | |||
import com.bonait.bnframework.modules.home.fragment.mode.caidan_control; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
@@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment; | |||
import androidx.fragment.app.FragmentManager; | |||
import androidx.fragment.app.FragmentTransaction; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import androidx.viewpager.widget.ViewPager; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
@@ -23,6 +24,7 @@ import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.model.mode.ResMenuLeft; | |||
import com.bonait.bnframework.common.tabbar.MainNavigateTabBar; | |||
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter; | |||
import com.bonait.bnframework.modules.home.adapter.jiaoyan_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.JiaoYan_dzcjy_fragment; | |||
@@ -101,7 +103,7 @@ public class JiaoYanFragment extends BaseFragment { | |||
viewpager_jiaoyan.setAdapter(fragmentAdapter); | |||
viewpager_jiaoyan.setOffscreenPageLimit(5); | |||
viewpager_jiaoyan.setCurrentItem(0); | |||
viewpager_jiaoyan.addOnPageChangeListener(pageChangeListener); | |||
adapter=new jiaoyan_adapter(getContext(),menuModes); | |||
rv_left.setAdapter(adapter); | |||
rv_left.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |||
@@ -111,7 +113,22 @@ public class JiaoYanFragment extends BaseFragment { | |||
} | |||
}); | |||
} | |||
/** | |||
* 配置ViewPager监听器,手指滑动监听 | |||
*/ | |||
private ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener() { | |||
@Override | |||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | |||
} | |||
@Override | |||
public void onPageSelected(int position) { | |||
mPosition=position; | |||
adapter.notifyDataSetChanged(); | |||
} | |||
@Override | |||
public void onPageScrollStateChanged(int state) { | |||
} | |||
}; | |||
/** | |||
* Item 点击事件 | |||
* @param adapterView | |||
@@ -1,320 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.annotation.SuppressLint; | |||
import android.content.Context; | |||
import android.content.Intent; | |||
import android.os.Bundle; | |||
import androidx.recyclerview.widget.GridLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
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_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.common.message.MessageLooper; | |||
import com.bonait.bnframework.common.message.MessageManager; | |||
import com.bonait.bnframework.common.model.mode.CloudGood; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ScreenUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.mode.QDListSectionAdapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SectionHeader; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SectionItem; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import com.qmuiteam.qmui.widget.section.QMUISection; | |||
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter; | |||
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class CpActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.qmuisection_layout) | |||
QMUIStickySectionLayout mSectionLayout; | |||
private RecyclerView.LayoutManager mLayoutManager; | |||
protected static QMUIStickySectionAdapter<SectionHeader, SectionItem, QMUIStickySectionAdapter.ViewHolder> mAdapter; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_cp); | |||
//属性绑定 | |||
ButterKnife.bind(this); | |||
context=this; | |||
initTopBar(); | |||
initAdapter(); | |||
initAdapterLogicalOperation(); | |||
NBClick(); | |||
} | |||
// QDListSectionAdapter | |||
private void initAdapter() { | |||
mLayoutManager = createLayoutManager(); | |||
mSectionLayout.setLayoutManager(mLayoutManager); | |||
mAdapter = createAdapter(); | |||
//mSectionLayout.setAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.aword_fade_enter)); | |||
} | |||
private void initAdapterLogicalOperation() { | |||
mAdapter.setCallback(new QMUIStickySectionAdapter.Callback<SectionHeader, SectionItem>() { | |||
@Override | |||
public void loadMore(final QMUISection<SectionHeader, SectionItem> section, final boolean loadMoreBefore) { | |||
} | |||
//点击事件 | |||
@Override | |||
public void onItemClick(QMUIStickySectionAdapter.ViewHolder holder, int position) { | |||
if (holder.getItemViewType() != 1) { | |||
int pos = holder.isForStickyHeader ? position : holder.getAdapterPosition(); | |||
mAdapter.toggleFold(pos, false); | |||
} | |||
} | |||
//长按事件 | |||
@Override | |||
public boolean onItemLongClick(QMUIStickySectionAdapter.ViewHolder holder, int position) { | |||
int FirstPos = mAdapter.getSectionIndex(position); | |||
int SecondPos = mAdapter.getItemIndex(position); | |||
//ItemPopupWindow.show(getContext(), holder.itemView, holder.getItemViewType(), FirstPos, SecondPos); | |||
ToastUtils.info("一级条目" + FirstPos + "二级" + SecondPos); | |||
return true; | |||
} | |||
}); | |||
mSectionLayout.setAdapter(mAdapter, true); | |||
ConfigData.getInstance().GetGevGood(this, mHandler); | |||
mAdapter.setData(getList()); | |||
} | |||
Context context; | |||
@SuppressLint("HandlerLeak") | |||
private Handler mHandler = new Handler() { | |||
@Override | |||
public void handleMessage(Message msg) { | |||
if (msg.obj.toString() == "MSG_REFRESH") { | |||
mAdapter.setData(getList()); | |||
} | |||
} | |||
}; | |||
public void NBClick() { | |||
/** | |||
* 删除菜品 | |||
*/ | |||
MessageManager.getInstance().registerMessageReceiver(this, MessageName.DeleteGood, new MessageLooper.OnMessageListener() { | |||
@Override | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
SectionItem item = (SectionItem) msg; | |||
QueryDB.DeleteGoodsid(item.getAccount()); | |||
QueryDB.DeleteGoodsSrecipeList(item.getAccount()); | |||
mAdapter.setDataWithoutDiff(getList(), true); | |||
} | |||
} | |||
}); | |||
/** | |||
* 刷新菜品 | |||
*/ | |||
MessageManager.getInstance().registerMessageReceiver(this, MessageName.ScGood, new MessageLooper.OnMessageListener() { | |||
@Override | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
mAdapter.setData(new ArrayList<QMUISection<SectionHeader, SectionItem>>()); | |||
mAdapter.setData(getList()); | |||
} | |||
} | |||
}); | |||
/** | |||
* 点击菜品 | |||
*/ | |||
MessageManager.getInstance().registerMessageReceiver(this, MessageName.ClickGood, new MessageLooper.OnMessageListener() { | |||
@Override | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
SectionItem item = (SectionItem) msg; | |||
String goodid = item.getAccount();//商品id | |||
Intent intent = new Intent(getContext(), DiyUpdateActivity.class); | |||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |||
intent.putExtra("id", goodid); | |||
startActivity(intent); | |||
} | |||
} | |||
}); | |||
} | |||
protected QMUIStickySectionAdapter<SectionHeader, SectionItem, QMUIStickySectionAdapter.ViewHolder> createAdapter() { | |||
return new QDListSectionAdapter(); | |||
} | |||
protected RecyclerView.LayoutManager createLayoutManager() { | |||
// return new LinearLayoutManager(getContext()) { | |||
// @Override | |||
// public RecyclerView.LayoutParams generateDefaultLayoutParams() { | |||
// return new RecyclerView.LayoutParams( | |||
// ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); | |||
// } | |||
// }; | |||
final GridLayoutManager layoutManager; | |||
if(ConfigName.getInstance().IsPortraitScreen)//竖屏 | |||
{ | |||
layoutManager = new GridLayoutManager(getContext(), 3); | |||
}else | |||
{ | |||
layoutManager = new GridLayoutManager(getContext(), 5); | |||
} | |||
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { | |||
@Override | |||
public int getSpanSize(int i) { | |||
return mAdapter.getItemIndex(i) < 0 ? layoutManager.getSpanCount() : 1; | |||
} | |||
}); | |||
return layoutManager; | |||
} | |||
/** | |||
* 获取数据 | |||
* | |||
* @return | |||
*/ | |||
private static ArrayList<QMUISection<SectionHeader, SectionItem>> getList() { | |||
ArrayList<QMUISection<SectionHeader, SectionItem>> list = new ArrayList<>(); | |||
ArrayList<BPA_GOODS> good = QueryDB.GetGoodsALL(); | |||
List<String> Bendi_id = new ArrayList<>(); | |||
SectionHeader header_bdcp = new SectionHeader("本地菜谱", "", ""); | |||
ArrayList<SectionItem> contents_bdcp = new ArrayList<>(); | |||
SectionHeader header_sccp = new SectionHeader("收藏菜谱", "", ""); | |||
ArrayList<SectionItem> contents_sccp = new ArrayList<>(); | |||
SectionHeader header_ydcp = new SectionHeader("云端菜谱", "", ""); | |||
ArrayList<SectionItem> contents_ydcp = new ArrayList<>(); | |||
for (BPA_GOODS item : good) { | |||
if (item.url == null) { | |||
item.url = "未知"; | |||
} | |||
contents_bdcp.add(new SectionItem(item.name, String.valueOf(item.maketime), item.id, item.url, item.issc == 1, false, true)); | |||
if (item.issc == 1) { | |||
contents_sccp.add(new SectionItem(item.name, String.valueOf(item.maketime), item.id, item.url, item.issc == 1, false, true)); | |||
} | |||
Bendi_id.add(item.id); | |||
} | |||
for (CloudGood item : ConfigName.getInstance().cloudGoods) { | |||
contents_ydcp.add(new SectionItem(item.goods_Name, "180", item.id, item.goods_ImgUrl, false, true, Bendi_id.contains(item.id) ? true : false)); | |||
} | |||
list.add(new QMUISection<>(header_bdcp, contents_bdcp, false)); | |||
list.add(new QMUISection<>(header_sccp, contents_sccp, true)); | |||
list.add(new QMUISection<>(header_ydcp, contents_ydcp, true)); | |||
return list; | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("菜谱管理"); | |||
/** | |||
* 返回按钮 | |||
*/ | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
/** | |||
* 下载云端菜谱 | |||
*/ | |||
mTopBar.addRightImageButton(R.mipmap.clouddownload,R.id.cLeftImageViewId).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
String title = "同步云端菜谱操作提示!"; | |||
String message = "请问客官确定要同步菜谱吗?此操作将完全复刻云端菜谱,本地菜谱将清除!请确认本地菜谱已上传云端!!!!"; | |||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
if(ConfigName.getInstance().cloudGoods!=null && ConfigName.getInstance().cloudGoods.size()>0) | |||
{ | |||
ArrayList<BPA_GOODS> goods= QueryDB.GetGoodsALL(); | |||
ArrayList<BPA_GOODSRECIPE> rec= QueryDB.GetGoodsSrecipeALL(); | |||
for (BPA_GOODS good:goods) | |||
{ | |||
QueryDB.DeleteGoods(good); | |||
} | |||
for (BPA_GOODSRECIPE pf:rec) | |||
{ | |||
QueryDB.DeleteGoodsSrecipe(pf); | |||
} | |||
for (CloudGood item : ConfigName.getInstance().cloudGoods) { | |||
ConfigData.getInstance().GetGoodProcess(context,item.id,false); | |||
} | |||
} | |||
dialog.dismiss(); | |||
} | |||
}); | |||
} | |||
}); | |||
/** | |||
* 新建商品 | |||
*/ | |||
mTopBar.addRightTextButton("新建商品",R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
skipToActivity(DiyActivity.class); | |||
} | |||
}); | |||
} | |||
/** | |||
* 跳转界面 | |||
*/ | |||
private void skipToActivity(Class da) { | |||
// 跳转到登录页面 | |||
Intent intent = new Intent(context, da); | |||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |||
startActivity(intent); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,113 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.os.Bundle; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import androidx.appcompat.widget.SearchView; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.common.view.MyLayoutManager; | |||
import com.bonait.bnframework.modules.home.adapter.sp_adapter; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class CpxzActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar;//顶部标题 | |||
@BindView(R.id.recycler_view) | |||
RecyclerView recyclerView;//菜谱列表 | |||
@BindView(R.id.search_view) | |||
SearchView search_view;//查询框 | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_cpxz);//属性绑定 | |||
ButterKnife.bind(this); | |||
initTopBar(); | |||
Init(); | |||
initData(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("菜谱列表"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
} | |||
private void Init() | |||
{ | |||
search_view.setOnQueryTextListener(new SearchView.OnQueryTextListener() { | |||
@Override | |||
public boolean onQueryTextSubmit(String s) { | |||
ToastUtils.info("点击搜索按钮时触发"+s); | |||
return false; | |||
} | |||
@Override | |||
public boolean onQueryTextChange(String s) { | |||
DataBus.getInstance().GetGoods(s); | |||
ToastUtils.info("搜索内容改变时触发,"+s); | |||
return false; | |||
} | |||
}); | |||
} | |||
private void initData() { | |||
try{ | |||
MyLayoutManager layout = new MyLayoutManager(); | |||
layout.setAutoMeasureEnabled(true); | |||
recyclerView.setLayoutManager(layout); | |||
DataBus.getInstance().spadapter = new sp_adapter(this); | |||
recyclerView.setAdapter(DataBus.getInstance().spadapter); | |||
DataBus.getInstance().GetGoods(""); | |||
DataBus.getInstance().spadapter.mListener=new MyClickListener() { | |||
@Override | |||
public void clickListener(View v, Object data) { | |||
BPA_GOODS good=(BPA_GOODS)data; | |||
DataBus.getInstance().SelectGood=good; | |||
if( DataBus.getInstance().mListener!=null) | |||
{ | |||
DataBus.getInstance().mListener.clickListener(v,good); | |||
} | |||
finish(); | |||
} | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
} | |||
}; | |||
}catch(Exception e){ | |||
ToastUtils.info("异常信息:"+e.getMessage()); | |||
} | |||
} | |||
public void initEvent() | |||
{ | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,521 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.annotation.SuppressLint; | |||
import android.content.Intent; | |||
import android.graphics.Color; | |||
import android.graphics.drawable.Drawable; | |||
import android.os.Bundle; | |||
import android.util.AttributeSet; | |||
import android.util.Xml; | |||
import android.view.MotionEvent; | |||
import android.view.View; | |||
import android.view.WindowManager; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.CheckBox; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.ListView; | |||
import android.widget.Spinner; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
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_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.helper.MyImage; | |||
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.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.gongxubuzhou_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.lcsz_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; | |||
import com.bonait.bnframework.modules.home.fragment.mode.item_gx; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import com.youth.banner.Banner; | |||
import org.xmlpull.v1.XmlPullParser; | |||
import org.xmlpull.v1.XmlPullParserException; | |||
import java.io.IOException; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.IdentityHashMap; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class DiyActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.edittext) | |||
EditText edittext;//菜谱名称 | |||
@BindView(R.id.cpfm) | |||
ImageView cpfm;//菜谱封面 | |||
@BindView(R.id.zzsc) | |||
EditText zzsc;//制作时长 | |||
@BindView(R.id.check) | |||
CheckBox check;//默认收藏 | |||
// @BindView(R.id.Banner_Main) | |||
// Banner Banner_Main;//轮播图 | |||
// //用于存放获取的图片 | |||
List<Drawable> Banner_list = new ArrayList<>(); | |||
@BindView(R.id.hrgx) | |||
Spinner hrgx;//工序 | |||
Map<String, String> hrgx_map = new LinkedHashMap<>(); | |||
Map<String, Integer> hrgx_map_index = new LinkedHashMap<>(); | |||
@BindView(R.id.gxchid) | |||
LinearLayout gxchid;//工序子集 | |||
@BindView(R.id.datatab_gxbz) | |||
ListView datatab_gxbz;//工序步骤 | |||
public gongxubuzhou_adapter gxbz_adapter = null; | |||
public String imageUrl = ""; | |||
/** | |||
* 工序步骤 | |||
*/ | |||
public ArrayList<BPA_GOODSRECIPE> bpa_goodsrecipes = new ArrayList<>(); | |||
/** | |||
* 是否人工单击 | |||
*/ | |||
public boolean isUserClicked = false; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_diy);//属性绑定 | |||
ButterKnife.bind(this); | |||
initTopBar(); | |||
initData(); | |||
} | |||
private void initData() { | |||
//1.初始化轮播图 | |||
//Drawable_Get(Banner_list); | |||
//2.初始化工序 | |||
ArrayList<BPA_PROCESS> data = QueryDB.GetProcessALL(); | |||
int i = 0; | |||
String id = ""; | |||
for (BPA_PROCESS item : data) { | |||
hrgx_map.put(item.name, item.id); | |||
hrgx_map_index.put(item.name, i); | |||
if (i == 0) { | |||
id = item.id; | |||
} | |||
i++; | |||
} | |||
ArrayAdapter<String> adapter_kk = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(hrgx_map.keySet())); | |||
adapter_kk.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
hrgx.setAdapter(adapter_kk); | |||
hrgx.setOnTouchListener(new View.OnTouchListener() { | |||
@Override | |||
public boolean onTouch(View view, MotionEvent motionEvent) { | |||
isUserClicked = true; | |||
view.performClick(); | |||
return false; | |||
} | |||
}); | |||
hrgx.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | |||
@Override | |||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | |||
if (isUserClicked)//不是用户点击返回 | |||
{ | |||
String id = hrgx_map.get(hrgx.getSelectedItem().toString()); | |||
SelectItemFrom(id); | |||
isUserClicked = false; | |||
} | |||
} | |||
@Override | |||
public void onNothingSelected(AdapterView<?> adapterView) { | |||
} | |||
}); | |||
SelectItemFrom(id); | |||
//3.工序步骤 | |||
gxbz_adapter = new gongxubuzhou_adapter(getContext(), R.layout.gx_item, (List<BPA_GOODSRECIPE>) bpa_goodsrecipes, null); | |||
datatab_gxbz.setAdapter(gxbz_adapter); | |||
datatab_gxbz.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |||
@Override | |||
public void onItemClick(AdapterView<?> parent, View view, int position, long l) { | |||
// TODO Auto-generated method stub | |||
gxbz_adapter.setSelectedPosition(position); | |||
gxbz_adapter.notifyDataSetInvalidated(); | |||
SetSelectGX(bpa_goodsrecipes.get(position));//单击工序行,显示变量 | |||
} | |||
}); | |||
//图标选择 | |||
MessageManager.getInstance().registerMessageReceiver(this, MessageName.ClickImage, new MessageLooper.OnMessageListener() { | |||
@Override | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
imageUrl = (String) msg; | |||
new MyBitmapUtils().disPlay(cpfm, imageUrl); | |||
} | |||
} | |||
}); | |||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); | |||
} | |||
/** | |||
* 根据选中步骤显示变量 | |||
* | |||
* @param goodsrecipe | |||
*/ | |||
public void SetSelectGX(BPA_GOODSRECIPE goodsrecipe) { | |||
try { | |||
//1.根据工序名称显示工序集合 | |||
hrgx.setSelection(hrgx_map_index.get(goodsrecipe.processname)); | |||
String id = hrgx_map.get(hrgx.getSelectedItem().toString()); | |||
SelectItemFrom(id); | |||
//2.根据工序变量集合-获取变量名称和值 | |||
final HashMap<String, String> formulation = new HashMap<>(); | |||
//region 获取变量名称和值 | |||
String text = goodsrecipe.processvalue; | |||
List<String> data = new ArrayList<>(); | |||
if (text.contains("|")) { | |||
String[] res = text.split("[|]"); | |||
for (int i = 0; i < res.length; i++) { | |||
data.add(res[i]); | |||
} | |||
} else { | |||
data.add(text); | |||
} | |||
for (String item : data) { | |||
if (!item.isEmpty() && item.contains(",")) { | |||
String[] wl = item.split("[,]"); | |||
if (wl != null && wl.length == 2) { | |||
String name = wl[0]; | |||
String val = wl[1]; | |||
formulation.put(name, val); | |||
} | |||
} | |||
} | |||
//endregion | |||
//3.查询子集-填充变量 | |||
for (Map.Entry<String, String> entry : formulation.entrySet()) { | |||
String key = entry.getKey(); | |||
String value = entry.getValue(); | |||
String STR = formulation.get(key); | |||
} | |||
for (int i = 0; i < gxchid.getChildCount(); i++) { | |||
fragment_gx gongxu = (fragment_gx) gxchid.getChildAt(i); | |||
String res = formulation.get(gongxu.model.name); | |||
if (res != null) { | |||
gongxu.SetValues(res); | |||
} | |||
} | |||
} catch (Exception ex) { | |||
} | |||
} | |||
/** | |||
* 根据选中工序id显示集合 | |||
* | |||
* @param id | |||
*/ | |||
public void SelectItemFrom(String id) { | |||
try { | |||
gxchid.removeAllViews(); | |||
ArrayList<BPA_PROCESSModel> mode = QueryDB.GetProcessModelProcessID(id); | |||
if (mode.size() > 0)//工序 | |||
{ | |||
for (BPA_PROCESSModel item : mode) { | |||
item_gx gx = new item_gx(); | |||
gx.datatype = item.datatype; | |||
gx.name = item.name; | |||
gx.data = item.data; | |||
gx.IsWL = false; | |||
fragment_gx gongxu = new fragment_gx(this, null, gx); | |||
gxchid.addView(gongxu); | |||
} | |||
} else //物料 | |||
{ | |||
ArrayList<BPA_MATERIAL> materials = QueryDB.GetMaterialALL(); | |||
for (BPA_MATERIAL item2 : materials) { | |||
item_gx gx = new item_gx(); | |||
gx.datatype = 0;//液体料都是数字 | |||
gx.name = item2.name; | |||
gx.IsWL = true; | |||
fragment_gx gongxu = new fragment_gx(this, null, gx); | |||
gxchid.addView(gongxu); | |||
} | |||
} | |||
} catch (Exception ex) { | |||
} | |||
} | |||
/** | |||
* 获取选中行的变量 | |||
* | |||
* @return | |||
*/ | |||
public BPA_GOODSRECIPE GetSelectItemFromValue() { | |||
BPA_GOODSRECIPE pf = new BPA_GOODSRECIPE(); | |||
try { | |||
String name = hrgx.getSelectedItem().toString(); | |||
boolean IsVerify = true; | |||
String description = ""; | |||
// 延迟,100|延迟,100|延迟,100|延迟,100| | |||
String data = ""; | |||
String desc = ""; | |||
if (name.contains("液体料")) { | |||
pf.materialType = 0; | |||
for (int i = 0; i < gxchid.getChildCount(); i++) { | |||
fragment_gx gongxu = (fragment_gx) gxchid.getChildAt(i); | |||
String values = gongxu.GetValues(); | |||
if (!values.isEmpty()) { | |||
data += gongxu.model.name + "," + values + "|"; | |||
desc += values + ","; | |||
} | |||
} | |||
if (data.isEmpty()) { | |||
IsVerify = false; | |||
description += "物料-不能为空,请勾选一个物料\n"; | |||
} | |||
} else { | |||
pf.materialType = 1; | |||
for (int i = 0; i < gxchid.getChildCount(); i++) { | |||
fragment_gx gongxu = (fragment_gx) gxchid.getChildAt(i); | |||
String values = gongxu.GetValues(); | |||
if (values.isEmpty()) { | |||
IsVerify = false; | |||
description += gongxu.model.name + "-不能为空\n"; | |||
} else { | |||
data += gongxu.model.name + "," + values + "|"; | |||
desc += values + ","; | |||
} | |||
} | |||
} | |||
if (IsVerify) { | |||
pf.processname = name; | |||
pf.processms = name + "(" + desc.substring(0, desc.length() - 1) + ")"; | |||
pf.processvalue = data.substring(0, data.length() - 1); | |||
return pf; | |||
} else { | |||
ToastUtils.info("数据验证失败,原因:" + description); | |||
return null; | |||
} | |||
} catch (Exception ex) { | |||
return null; | |||
} | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("DIY模式"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
} | |||
/** | |||
* 获取图片存放到list中 | |||
* | |||
* @param arrayList | |||
*/ | |||
private void Drawable_Get(List arrayList) { | |||
//把他们存放到一个list集合中 | |||
arrayList.add(getResources().getDrawable(R.mipmap.image1)); | |||
arrayList.add(getResources().getDrawable(R.mipmap.image2)); | |||
arrayList.add(getResources().getDrawable(R.mipmap.image3)); | |||
arrayList.add(getResources().getDrawable(R.mipmap.image4)); | |||
//调用轮播图设置方法 | |||
Banner_Set(Banner_list); | |||
} | |||
/** | |||
* 将图片存放到轮播图中 | |||
* | |||
* @param arrayList | |||
*/ | |||
private void Banner_Set(List arrayList) { | |||
//这是设置轮播图的关键位置,setImages(list) 设置轮播图的图片资源 | |||
//setImageLoader(一个实体类)用于加载图片到手机页面上显示 | |||
//Banner_Main.setImages(Banner_list).setImageLoader(new MyImage()).start(); | |||
} | |||
/** | |||
* 点击事件 | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.add_hrgx, R.id.update_gx, R.id.delete_gx, R.id.shangyi, R.id.xiayi, R.id.caozuomoshi, R.id.shengchengcaipu, R.id.cpfm}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.cpfm://菜谱封面 | |||
// 跳转到登录页面 | |||
Intent intent = new Intent(getContext(), ImageChooseActivity.class); | |||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |||
startActivity(intent); | |||
break; | |||
case R.id.add_hrgx://添加工序 | |||
BPA_GOODSRECIPE goodsrecipe = GetSelectItemFromValue(); | |||
if (goodsrecipe != null) { | |||
bpa_goodsrecipes.add(GetSelectItemFromValue()); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
} | |||
break; | |||
case R.id.update_gx://修改工序 | |||
int index_update = gxbz_adapter.getSelectedPosition(); | |||
if (index_update >= 0 && index_update < bpa_goodsrecipes.size()) { | |||
BPA_GOODSRECIPE obj_update = (BPA_GOODSRECIPE) bpa_goodsrecipes.get(index_update); | |||
String selectname = hrgx.getSelectedItem().toString(); | |||
if (!obj_update.processname.equals(selectname)) { | |||
ToastUtils.info("请先选择工序!"); | |||
return; | |||
} | |||
bpa_goodsrecipes.set(index_update, GetSelectItemFromValue()); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
ToastUtils.info("修改步骤" + (index_update + 1) + ":" + obj_update.processname + "成功!"); | |||
} else { | |||
ToastUtils.info("请先选择工序!"); | |||
} | |||
break; | |||
case R.id.delete_gx://删除工序 | |||
int index_delete = gxbz_adapter.getSelectedPosition(); | |||
if (index_delete >= 0 && index_delete < bpa_goodsrecipes.size()) { | |||
BPA_GOODSRECIPE obj_delete = (BPA_GOODSRECIPE) bpa_goodsrecipes.get(index_delete); | |||
bpa_goodsrecipes.remove(obj_delete); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
//移动光标 | |||
if (index_delete - 1 >= 0) { | |||
SetSelectPos(index_delete - 1); | |||
} | |||
ToastUtils.info("删除工序" + obj_delete.processname + "成功!"); | |||
} else { | |||
ToastUtils.info("请先选择工序!"); | |||
} | |||
break; | |||
case R.id.shangyi://上移 | |||
int index_up = gxbz_adapter.getSelectedPosition(); | |||
; | |||
if (index_up > 0) { | |||
BPA_GOODSRECIPE obj_up = (BPA_GOODSRECIPE) bpa_goodsrecipes.get(index_up); | |||
bpa_goodsrecipes.remove(obj_up); | |||
bpa_goodsrecipes.add(index_up - 1, obj_up); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
//移动光标 | |||
SetSelectPos(index_up - 1); | |||
} else { | |||
ToastUtils.info("已经最顶部!"); | |||
} | |||
break; | |||
case R.id.xiayi://下移 | |||
int index_down = gxbz_adapter.getSelectedPosition(); | |||
if (index_down < bpa_goodsrecipes.size() - 1 && index_down >= 0) { | |||
BPA_GOODSRECIPE obj_down = (BPA_GOODSRECIPE) bpa_goodsrecipes.get(index_down); | |||
bpa_goodsrecipes.remove(obj_down); | |||
bpa_goodsrecipes.add(index_down + 1, obj_down); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
//移动光标 | |||
SetSelectPos(index_down + 1); | |||
} else { | |||
ToastUtils.info("已经最底部!"); | |||
} | |||
break; | |||
case R.id.caozuomoshi://操作模式 | |||
ToastUtils.info("操作模式"); | |||
break; | |||
case R.id.shengchengcaipu://生成菜谱 | |||
String name = edittext.getText().toString(); | |||
if (name.isEmpty()) { | |||
ToastUtils.info("菜谱名称不能为空!"); | |||
return; | |||
} else { | |||
boolean isSucess = QueryDB.GetGoodsIs(name); | |||
if (isSucess) { | |||
ToastUtils.info("菜谱名称已存在!"); | |||
return; | |||
} | |||
//按钮点击 | |||
String title = "生成菜谱操作提示!"; | |||
String message = "请问客官确定要生成[" + name + "]菜谱吗?"; | |||
AlertDialogUtils.showDialog(view.getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
int sc = 60 * 3; | |||
if (!zzsc.getText().toString().isEmpty() && !zzsc.getText().toString().equals("0")) { | |||
sc = Integer.parseInt(zzsc.getText().toString()); | |||
} | |||
ArrayList<BPA_GOODS> goods = QueryDB.GetGoodsALL(); | |||
BPA_GOODS good = new BPA_GOODS(); | |||
good.name = name; | |||
good.status = 1; | |||
good.sort = goods.size() + 1; | |||
good.maketime = sc; | |||
good.issc = check.isChecked() ? 1 : 0; | |||
good.url = imageUrl; | |||
QueryDB.AddGoods(good); | |||
for (int k = 0; k < bpa_goodsrecipes.size(); k++) { | |||
BPA_GOODSRECIPE item = bpa_goodsrecipes.get(k); | |||
item.goodsID = good.id; | |||
item.sort = k + 1; | |||
QueryDB.AddGoodsSrecipe(item); | |||
} | |||
ToastUtils.info("菜谱生成成功!"); | |||
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good"); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
} | |||
break; | |||
} | |||
} | |||
public void SetSelectPos(int index) { | |||
//移动光标 | |||
gxbz_adapter.setSelectedPosition(index); | |||
gxbz_adapter.notifyDataSetInvalidated(); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,627 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Intent; | |||
import android.graphics.drawable.Drawable; | |||
import android.os.Bundle; | |||
import android.view.MotionEvent; | |||
import android.view.View; | |||
import android.view.WindowManager; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.CheckBox; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.ListView; | |||
import android.widget.Spinner; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
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_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.helper.MyImage; | |||
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.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.gongxubuzhou_adapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; | |||
import com.bonait.bnframework.modules.home.fragment.mode.item_gx; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import com.youth.banner.Banner; | |||
import java.net.IDN; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class DiyUpdateActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.edittext) | |||
EditText edittext;//菜谱名称 | |||
@BindView(R.id.cpfm) | |||
ImageView cpfm;//菜谱封面 | |||
@BindView(R.id.zzsc) | |||
EditText zzsc;//制作时长 | |||
@BindView(R.id.check) | |||
CheckBox check;//默认收藏 | |||
// @BindView(R.id.Banner_Main) | |||
// Banner Banner_Main;//轮播图 | |||
//用于存放获取的图片 | |||
List<Drawable> Banner_list = new ArrayList<>(); | |||
@BindView(R.id.hrgx) | |||
Spinner hrgx;//工序 | |||
Map<String,String> hrgx_map = new LinkedHashMap<>(); | |||
Map<String,Integer> hrgx_map_index = new LinkedHashMap<>(); | |||
@BindView(R.id.gxchid) | |||
LinearLayout gxchid;//工序子集 | |||
@BindView(R.id.datatab_gxbz) | |||
ListView datatab_gxbz;//工序步骤 | |||
public gongxubuzhou_adapter gxbz_adapter=null; | |||
/** | |||
* 工序步骤 | |||
*/ | |||
public ArrayList<BPA_GOODSRECIPE> bpa_goodsrecipes=new ArrayList<>(); | |||
/** | |||
* 是否人工单击 | |||
*/ | |||
public boolean isUserClicked =false; | |||
/** | |||
* 当前商品 | |||
*/ | |||
public BPA_GOODS good=null; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_diy_update); | |||
ButterKnife.bind(this); | |||
initTopBar(); | |||
initData(); | |||
SetGood(); | |||
} | |||
private void initData() | |||
{ | |||
//1.初始化轮播图 | |||
//Drawable_Get(Banner_list); | |||
//2.初始化工序 | |||
ArrayList<BPA_PROCESS> data=QueryDB.GetProcessALL(); | |||
int i=0;String id=""; | |||
for (BPA_PROCESS item:data) | |||
{ | |||
hrgx_map.put(item.name,item.id); | |||
hrgx_map_index.put(item.name,i); | |||
if(i==0) | |||
{ | |||
id= item.id; | |||
} | |||
i++; | |||
} | |||
ArrayAdapter<String> adapter_kk = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, new ArrayList<>(hrgx_map.keySet())); | |||
adapter_kk.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
hrgx.setAdapter(adapter_kk); | |||
hrgx.setOnTouchListener(new View.OnTouchListener() { | |||
@Override | |||
public boolean onTouch(View view, MotionEvent motionEvent) { | |||
isUserClicked = true; | |||
view.performClick(); | |||
return false; | |||
} | |||
}); | |||
hrgx.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | |||
@Override | |||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { | |||
if(isUserClicked)//不是用户点击返回 | |||
{ | |||
String id= hrgx_map.get(hrgx.getSelectedItem().toString()); | |||
SelectItemFrom(id); | |||
isUserClicked=false; | |||
} | |||
} | |||
@Override | |||
public void onNothingSelected(AdapterView<?> adapterView) { | |||
} | |||
}); | |||
SelectItemFrom(id); | |||
//3.工序步骤 | |||
gxbz_adapter = new gongxubuzhou_adapter(getContext(), R.layout.gx_item, (List<BPA_GOODSRECIPE>) bpa_goodsrecipes,null); | |||
datatab_gxbz.setAdapter(gxbz_adapter); | |||
datatab_gxbz.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |||
@Override | |||
public void onItemClick(AdapterView<?> parent, View view, int position, long l) { | |||
// TODO Auto-generated method stub | |||
gxbz_adapter.setSelectedPosition(position); | |||
gxbz_adapter.notifyDataSetInvalidated(); | |||
SetSelectGX(bpa_goodsrecipes.get(position));//单击工序行,显示变量 | |||
} | |||
}); | |||
//图标选择 | |||
MessageManager.getInstance().registerMessageReceiver(this, MessageName.ClickImage, new MessageLooper.OnMessageListener() { | |||
@Override | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
good.url=(String) msg; | |||
new MyBitmapUtils().disPlay(cpfm,good.url); | |||
} | |||
} | |||
}); | |||
} | |||
/** | |||
* 根据选中步骤显示变量 | |||
* @param goodsrecipe | |||
*/ | |||
public void SetSelectGX(BPA_GOODSRECIPE goodsrecipe) | |||
{ | |||
try | |||
{ | |||
//1.根据工序名称显示工序集合 | |||
hrgx.setSelection(hrgx_map_index.get(goodsrecipe.processname)); | |||
String id= hrgx_map.get(hrgx.getSelectedItem().toString()); | |||
SelectItemFrom(id); | |||
//2.根据工序变量集合-获取变量名称和值 | |||
final HashMap<String,String> formulation=new HashMap<>(); | |||
//region 获取变量名称和值 | |||
String text=goodsrecipe.processvalue; | |||
List<String> data=new ArrayList<>(); | |||
if(text.contains("|")) | |||
{ | |||
String[] res= text.split("[|]"); | |||
for (int i=0;i<res.length;i++) | |||
{ | |||
data.add(res[i]); | |||
} | |||
}else | |||
{ | |||
data.add(text); | |||
} | |||
for(String item:data) | |||
{ | |||
if(!item.isEmpty() && item.contains(",")) | |||
{ | |||
String[] wl= item.split("[,]"); | |||
if (wl != null && wl.length == 2) | |||
{ | |||
String name=wl[0]; | |||
String val=wl[1]; | |||
formulation.put(name,val); | |||
} | |||
} | |||
} | |||
//endregion | |||
//3.查询子集-填充变量 | |||
for (Map.Entry<String, String> entry : formulation.entrySet()) { | |||
String key = entry.getKey(); | |||
String value = entry.getValue(); | |||
String STR= formulation.get(key); | |||
} | |||
for (int i = 0; i < gxchid.getChildCount(); i++) { | |||
fragment_gx gongxu = (fragment_gx) gxchid.getChildAt(i); | |||
String res= formulation.get(gongxu.model.name); | |||
if(res!=null) | |||
{ | |||
gongxu.SetValues(res); | |||
} | |||
} | |||
}catch (Exception ex) | |||
{ | |||
} | |||
} | |||
/** | |||
* 设置当前商品 | |||
* @param | |||
*/ | |||
public void SetGood() | |||
{ | |||
try | |||
{ | |||
Intent intent = getIntent(); | |||
String id = intent.getStringExtra("id"); | |||
if(!id.isEmpty()) | |||
{ | |||
good=QueryDB.GetGoodsId(id); | |||
if(good!=null) | |||
{ | |||
bpa_goodsrecipes.clear(); | |||
ArrayList<BPA_GOODSRECIPE> goodsrecipes=QueryDB.GetGoodsSrecipeID(good.id); | |||
for (BPA_GOODSRECIPE item :goodsrecipes) | |||
{ | |||
bpa_goodsrecipes.add(item); | |||
} | |||
edittext.setText(good.name); | |||
check.setChecked(good.issc==1); | |||
zzsc.setText(good.maketime+""); | |||
gxbz_adapter.notifyDataSetChanged();//刷新商品配方 | |||
new MyBitmapUtils().disPlay(cpfm,good.url); | |||
} | |||
} | |||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); | |||
}catch (Exception ex) | |||
{ | |||
} | |||
} | |||
/** | |||
* 根据选中工序id显示集合 | |||
* @param id | |||
*/ | |||
public void SelectItemFrom(String id) | |||
{ | |||
try | |||
{ | |||
gxchid.removeAllViews(); | |||
ArrayList<BPA_PROCESSModel> mode= QueryDB.GetProcessModelProcessID(id); | |||
if(mode.size()>0)//工序 | |||
{ | |||
for (BPA_PROCESSModel item : mode) | |||
{ | |||
item_gx gx=new item_gx(); | |||
gx.datatype=item.datatype; | |||
gx.name=item.name; | |||
gx.data=item.data; | |||
gx.IsWL=false; | |||
fragment_gx gongxu=new fragment_gx(this,null,gx); | |||
gxchid.addView(gongxu); | |||
} | |||
}else //物料 | |||
{ | |||
ArrayList<BPA_MATERIAL> materials= QueryDB.GetMaterialALL(); | |||
for (BPA_MATERIAL item2 : materials) | |||
{ | |||
item_gx gx=new item_gx(); | |||
gx.datatype=0;//液体料都是数字 | |||
gx.name=item2.name; | |||
gx.IsWL=true; | |||
fragment_gx gongxu=new fragment_gx(this,null,gx); | |||
gxchid.addView(gongxu); | |||
} | |||
} | |||
}catch (Exception ex) | |||
{ | |||
} | |||
} | |||
/** | |||
* 获取选中行的变量 | |||
* @return | |||
*/ | |||
public BPA_GOODSRECIPE GetSelectItemFromValue() | |||
{ | |||
BPA_GOODSRECIPE pf=new BPA_GOODSRECIPE(); | |||
try | |||
{ | |||
String name= hrgx.getSelectedItem().toString(); | |||
boolean IsVerify=true; | |||
String description=""; | |||
// 延迟,100|延迟,100|延迟,100|延迟,100| | |||
String data=""; | |||
String desc=""; | |||
if(name.contains("液体料")) | |||
{ | |||
pf.materialType=0; | |||
for (int i = 0; i < gxchid.getChildCount(); i++) { | |||
fragment_gx gongxu = (fragment_gx) gxchid.getChildAt(i); | |||
String values= gongxu.GetValues(); | |||
if(!values.isEmpty()) | |||
{ | |||
data+=gongxu.model.name+","+values+"|"; | |||
desc+=values+","; | |||
} | |||
} | |||
if(data.isEmpty()) | |||
{ | |||
IsVerify=false; | |||
description+="物料-不能为空,请勾选一个物料\n"; | |||
} | |||
}else | |||
{ | |||
pf.materialType=1; | |||
for (int i = 0; i < gxchid.getChildCount(); i++) { | |||
fragment_gx gongxu = (fragment_gx) gxchid.getChildAt(i); | |||
String values= gongxu.GetValues(); | |||
if(values.isEmpty()) | |||
{ | |||
IsVerify=false; | |||
description+=gongxu.model.name +"-不能为空\n"; | |||
}else | |||
{ | |||
data+=gongxu.model.name+","+values+"|"; | |||
desc+=values+","; | |||
} | |||
} | |||
} | |||
if(IsVerify) | |||
{ | |||
pf.processname=name; | |||
pf.processms= name+"("+desc.substring(0,desc.length()-1) +")"; | |||
pf.processvalue=data.substring(0,data.length()-1); | |||
return pf; | |||
}else | |||
{ | |||
ToastUtils.info("数据验证失败,原因:"+description); | |||
return null; | |||
} | |||
}catch (Exception ex) | |||
{ | |||
return null; | |||
} | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("菜谱信息修改"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
} | |||
/** | |||
* 获取图片存放到list中 | |||
* @param arrayList | |||
*/ | |||
private void Drawable_Get(List arrayList) { | |||
//把他们存放到一个list集合中 | |||
arrayList.add(getResources().getDrawable(R.mipmap.image1)); | |||
arrayList.add(getResources().getDrawable(R.mipmap.image2)); | |||
arrayList.add(getResources().getDrawable(R.mipmap.image3)); | |||
arrayList.add(getResources().getDrawable(R.mipmap.image4)); | |||
//调用轮播图设置方法 | |||
Banner_Set(Banner_list); | |||
} | |||
/** | |||
* 将图片存放到轮播图中 | |||
* @param arrayList | |||
*/ | |||
private void Banner_Set(List arrayList) { | |||
//这是设置轮播图的关键位置,setImages(list) 设置轮播图的图片资源 | |||
//setImageLoader(一个实体类)用于加载图片到手机页面上显示 | |||
//Banner_Main.setImages(Banner_list).setImageLoader(new MyImage()).start(); | |||
} | |||
/** | |||
* 点击事件 | |||
* @param view | |||
*/ | |||
@OnClick({R.id.add_hrgx,R.id.update_gx,R.id.delete_gx,R.id.shangyi,R.id.xiayi,R.id.caozuomoshi,R.id.shengchengcaipu,R.id.shengchengnewcaipu,R.id.cpfm}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.cpfm://菜谱封面 | |||
// 跳转到登录页面 | |||
Intent intent = new Intent(getContext(), ImageChooseActivity.class); | |||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |||
startActivity(intent); | |||
break; | |||
case R.id.add_hrgx://添加工序 | |||
BPA_GOODSRECIPE goodsrecipe= GetSelectItemFromValue(); | |||
if(goodsrecipe!=null) | |||
{ | |||
bpa_goodsrecipes.add(GetSelectItemFromValue()); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
} | |||
break; | |||
case R.id.update_gx://修改工序 | |||
int index_update= gxbz_adapter.getSelectedPosition(); | |||
if(index_update>=0 && index_update<bpa_goodsrecipes.size()) | |||
{ | |||
BPA_GOODSRECIPE obj_update= (BPA_GOODSRECIPE)bpa_goodsrecipes.get(index_update); | |||
String selectname= hrgx.getSelectedItem().toString(); | |||
if(!obj_update.processname.equals(selectname)) | |||
{ | |||
ToastUtils.info("请先选择工序!"); | |||
return; | |||
} | |||
bpa_goodsrecipes.set(index_update,GetSelectItemFromValue()); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
ToastUtils.info("修改步骤"+(index_update+1)+":"+obj_update.processname+"成功!"); | |||
}else | |||
{ | |||
ToastUtils.info("请先选择工序!"); | |||
} | |||
break; | |||
case R.id.delete_gx://删除工序 | |||
int index_delete= gxbz_adapter.getSelectedPosition(); | |||
if(index_delete>=0 && index_delete<bpa_goodsrecipes.size()) | |||
{ | |||
BPA_GOODSRECIPE obj_delete= (BPA_GOODSRECIPE)bpa_goodsrecipes.get(index_delete); | |||
bpa_goodsrecipes.remove(obj_delete); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
//移动光标 | |||
if(index_delete-1>=0) | |||
{ | |||
SetSelectPos(index_delete-1); | |||
} | |||
ToastUtils.info("删除工序"+obj_delete.processname+"成功!"); | |||
}else | |||
{ | |||
ToastUtils.info("请先选择工序!"); | |||
} | |||
break; | |||
case R.id.shangyi://上移 | |||
int index_up= gxbz_adapter.getSelectedPosition();; | |||
if(index_up>0) | |||
{ | |||
BPA_GOODSRECIPE obj_up= (BPA_GOODSRECIPE)bpa_goodsrecipes.get(index_up); | |||
bpa_goodsrecipes.remove(obj_up); | |||
bpa_goodsrecipes.add(index_up-1,obj_up); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
//移动光标 | |||
SetSelectPos(index_up-1); | |||
}else | |||
{ | |||
ToastUtils.info("已经最顶部!"); | |||
} | |||
break; | |||
case R.id.xiayi://下移 | |||
int index_down= gxbz_adapter.getSelectedPosition(); | |||
if(index_down<bpa_goodsrecipes.size()-1 && index_down>=0) | |||
{ | |||
BPA_GOODSRECIPE obj_down= (BPA_GOODSRECIPE)bpa_goodsrecipes.get(index_down); | |||
bpa_goodsrecipes.remove(obj_down); | |||
bpa_goodsrecipes.add(index_down+1,obj_down); | |||
gxbz_adapter.notifyDataSetChanged(); | |||
//移动光标 | |||
SetSelectPos(index_down+1); | |||
}else | |||
{ | |||
ToastUtils.info("已经最底部!"); | |||
} | |||
break; | |||
case R.id.caozuomoshi://操作模式 | |||
ToastUtils.info("操作模式"); | |||
break; | |||
case R.id.shengchengnewcaipu: | |||
String name1=edittext.getText().toString(); | |||
if(name1.isEmpty()) | |||
{ | |||
ToastUtils.info("菜谱名称不能为空!"); | |||
return; | |||
}else | |||
{ | |||
boolean isSucess= QueryDB.GetGoodsIs(name1); | |||
if(isSucess) | |||
{ | |||
ToastUtils.info("菜谱名称已存在!"); | |||
return; | |||
} | |||
//按钮点击 | |||
String title = "生成菜谱操作提示!"; | |||
String message = "请问客官确定要生成["+name1+"]菜谱吗?"; | |||
AlertDialogUtils.showDialog(view.getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
int sc=60*3; | |||
if(!zzsc.getText().toString().isEmpty() && !zzsc.getText().toString().equals("0")) | |||
{ | |||
sc=Integer.parseInt(zzsc.getText().toString()); | |||
} | |||
ArrayList<BPA_GOODS> goods=QueryDB.GetGoodsALL(); | |||
BPA_GOODS good1=new BPA_GOODS(); | |||
good1.name=name1; | |||
good1.status=1; | |||
good1.sort=goods.size()+1; | |||
good1.maketime=sc; | |||
good1.issc=check.isChecked()?1:0; | |||
good1.url=good.url; | |||
QueryDB.AddGoods(good1); | |||
for (int k=0;k<bpa_goodsrecipes.size();k++) | |||
{ | |||
BPA_GOODSRECIPE item=bpa_goodsrecipes.get(k); | |||
item.id=java.util.UUID.randomUUID().toString(); | |||
item.goodsID=good1.id; | |||
item.sort=k+1; | |||
QueryDB.AddGoodsSrecipe(item); | |||
} | |||
ToastUtils.info("菜谱复刻成功!"); | |||
dialog.dismiss(); | |||
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good"); | |||
finish(); | |||
} | |||
}); | |||
} | |||
break; | |||
case R.id.shengchengcaipu://修改菜谱 | |||
String name=edittext.getText().toString(); | |||
if(name.isEmpty()) | |||
{ | |||
ToastUtils.info("菜谱名称不能为空!"); | |||
return; | |||
}else | |||
{ | |||
boolean isSucess= QueryDB.GetGoodsIs(name,good.id); | |||
if(isSucess) | |||
{ | |||
ToastUtils.info("菜谱名称已存在!"); | |||
return; | |||
} | |||
//按钮点击 | |||
String title = "保存菜谱操作提示!"; | |||
String message = "请问客官确定要保存["+name+"]菜谱吗?"; | |||
AlertDialogUtils.showDialog(view.getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
int sc=60*3; | |||
if(!zzsc.getText().toString().isEmpty() && !zzsc.getText().toString().equals("0")) | |||
{ | |||
sc=Integer.parseInt(zzsc.getText().toString()); | |||
} | |||
good.maketime=sc; | |||
good.issc=check.isChecked()?1:0; | |||
good.name=name; | |||
QueryDB.UpdateGoods(good); | |||
ArrayList<BPA_GOODSRECIPE> pe=QueryDB.GetGoodsSrecipeID(good.id); | |||
for (BPA_GOODSRECIPE item:pe) | |||
{ | |||
QueryDB.DeleteGoodsSrecipe(item); | |||
} | |||
for (int k=0;k<bpa_goodsrecipes.size();k++) | |||
{ | |||
BPA_GOODSRECIPE item=bpa_goodsrecipes.get(k); | |||
item.goodsID=good.id; | |||
item.sort=k+1; | |||
QueryDB.AddGoodsSrecipe(item); | |||
} | |||
ToastUtils.info("菜谱修改成功!"); | |||
dialog.dismiss(); | |||
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good"); | |||
finish(); | |||
} | |||
}); | |||
} | |||
break; | |||
} | |||
} | |||
public void SetSelectPos(int index) | |||
{ | |||
//移动光标 | |||
gxbz_adapter.setSelectedPosition(index); | |||
gxbz_adapter.notifyDataSetInvalidated(); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,138 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import com.bonait.bnframework.modules.mine.fragment.MyFragment; | |||
import com.google.android.material.bottomnavigation.BottomNavigationView; | |||
import androidx.fragment.app.Fragment; | |||
import androidx.viewpager.widget.ViewPager; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.os.Bundle; | |||
import android.view.MenuItem; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemDeviceinFragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemSeasoningsetFragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemSystemsetFragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.systeminternetfragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class SzActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar;//top标题 | |||
@BindView(R.id.navigation) | |||
BottomNavigationView bottomNavigationView; | |||
@BindView(R.id.viewpager) | |||
QMUIViewPager viewPager; | |||
private MenuItem menuItem; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_sz);//属性绑定 | |||
ButterKnife.bind(this); | |||
initTopBar(); | |||
initFragment(); | |||
viewPager.addOnPageChangeListener(pageChangeListener); | |||
// 设置viewPager缓存多少个fragment | |||
viewPager.setOffscreenPageLimit(4); | |||
bottomNavigationView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("系统设置"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
List<Fragment> fragmentList= new ArrayList<>(); | |||
fragmentList.add(new systeminternetfragment()); | |||
fragmentList.add(new SystemDeviceinFragment()); | |||
fragmentList.add(new SystemSystemsetFragment()); | |||
fragmentList.add(new SystemSeasoningsetFragment()); | |||
FragmentAdapter fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(),fragmentList); | |||
// fragmentAdapter.addFragment(new systeminternetfragment()); | |||
// fragmentAdapter.addFragment(new SystemDeviceinFragment()); | |||
// fragmentAdapter.addFragment(new SystemSystemsetFragment()); | |||
// fragmentAdapter.addFragment(new SystemSeasoningsetFragment()); | |||
viewPager.setAdapter(fragmentAdapter); | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
/** | |||
* 配置bottom底部菜单栏监听器,手指点击底部菜单监听 | |||
*/ | |||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener | |||
= new BottomNavigationView.OnNavigationItemSelectedListener() { | |||
@Override | |||
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | |||
switch (item.getItemId()) { | |||
case R.id.bottom_navigation_1: | |||
viewPager.setCurrentItem(0); | |||
return true; | |||
case R.id.bottom_navigation_2: | |||
viewPager.setCurrentItem(1); | |||
return true; | |||
case R.id.bottom_navigation_3: | |||
viewPager.setCurrentItem(2); | |||
return true; | |||
case R.id.bottom_navigation_4: | |||
viewPager.setCurrentItem(3); | |||
return true; | |||
} | |||
return false; | |||
} | |||
}; | |||
/** | |||
* 配置ViewPager监听器,手指滑动监听 | |||
*/ | |||
private ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener() { | |||
@Override | |||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | |||
MenuItem menuItem = bottomNavigationView.getMenu().getItem(position); | |||
} | |||
@Override | |||
public void onPageSelected(int position) { | |||
menuItem = bottomNavigationView.getMenu().getItem(position); | |||
menuItem.setChecked(true); | |||
} | |||
@Override | |||
public void onPageScrollStateChanged(int state) { | |||
} | |||
}; | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,144 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemCsPLCFragment; | |||
import com.bonait.bnframework.modules.mine.fragment.MyFragment; | |||
import com.google.android.material.bottomnavigation.BottomNavigationView; | |||
import androidx.fragment.app.Fragment; | |||
import androidx.viewpager.widget.ViewPager; | |||
import android.os.Bundle; | |||
import android.view.MenuItem; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemCsFltlFragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemCsControlFragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.SystemCsMonitorFragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class WhActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.navigation) | |||
BottomNavigationView bottomNavigationView; | |||
@BindView(R.id.viewpager) | |||
QMUIViewPager viewPager; | |||
private MenuItem menuItem; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_wh);//属性绑定 | |||
ButterKnife.bind(this); | |||
initTopBar(); | |||
initFragment(); | |||
viewPager.addOnPageChangeListener(pageChangeListener); | |||
// 设置viewPager缓存多少个fragment | |||
viewPager.setOffscreenPageLimit(4); | |||
bottomNavigationView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); | |||
} | |||
@Override | |||
public void onWindowFocusChanged(boolean hasFocus) { | |||
super.onWindowFocusChanged(hasFocus); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("系统维护"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
} | |||
}); | |||
} | |||
FragmentAdapter fragmentAdapter=null; | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
List<Fragment> fragmentList= new ArrayList<>(); | |||
fragmentList.add(new SystemCsPLCFragment()); | |||
fragmentList.add(new SystemCsControlFragment()); | |||
fragmentList.add(new SystemCsMonitorFragment()); | |||
fragmentList.add(new SystemCsFltlFragment()); | |||
fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(),fragmentList); | |||
// fragmentAdapter.addFragment(new SystemCsPLCFragment()); | |||
// fragmentAdapter.addFragment(new SystemCsControlFragment()); | |||
// fragmentAdapter.addFragment(new SystemCsMonitorFragment()); | |||
// fragmentAdapter.addFragment(new SystemCsFltlFragment()); | |||
viewPager.setAdapter(fragmentAdapter); | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
/** | |||
* 配置bottom底部菜单栏监听器,手指点击底部菜单监听 | |||
*/ | |||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener | |||
= new BottomNavigationView.OnNavigationItemSelectedListener() { | |||
@Override | |||
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | |||
switch (item.getItemId()) { | |||
case R.id.bottom_navigation_0: | |||
viewPager.setCurrentItem(0); | |||
return true; | |||
case R.id.bottom_navigation_1: | |||
viewPager.setCurrentItem(1); | |||
return true; | |||
case R.id.bottom_navigation_2: | |||
viewPager.setCurrentItem(2); | |||
return true; | |||
case R.id.bottom_navigation_3: | |||
viewPager.setCurrentItem(3); | |||
return true; | |||
} | |||
return false; | |||
} | |||
}; | |||
/** | |||
* 配置ViewPager监听器,手指滑动监听 | |||
*/ | |||
private ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener() { | |||
@Override | |||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | |||
MenuItem menuItem = bottomNavigationView.getMenu().getItem(position); | |||
} | |||
@Override | |||
public void onPageSelected(int position) { | |||
menuItem = bottomNavigationView.getMenu().getItem(position); | |||
menuItem.setChecked(true); | |||
} | |||
@Override | |||
public void onPageScrollStateChanged(int state) { | |||
} | |||
}; | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -4,6 +4,7 @@ import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
@@ -70,7 +71,54 @@ public class JiaoYan_sdkz_fragment extends BaseFragment { | |||
*/ | |||
public void Initdata() { | |||
try { | |||
DataBus.getInstance().GetSDKZ(sdkz_linrarlaout,getActivity()); | |||
Activity activity=getActivity(); | |||
List<Res_PLCADDRESS1> plcaddresses=new ArrayList<>(); | |||
if (ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) { | |||
for (Res_PLCADDRESS1 item : ConfigName.getInstance().PlcAddress_配料吧台_手动) { | |||
if(item.address.equals("-------------"))//这是标题 | |||
{ | |||
if(plcaddresses.size()>0) | |||
{ | |||
sdkz_control sdkz = new sdkz_control(sdkz_linrarlaout.getContext(), null, plcaddresses,activity,true); | |||
sdkz_linrarlaout.addView(sdkz); | |||
} | |||
plcaddresses=new ArrayList<>(); | |||
tab_control tab = new tab_control(sdkz_linrarlaout.getContext(), null, item.name); | |||
sdkz_linrarlaout.addView(tab); | |||
}else | |||
{ | |||
plcaddresses.add(item); | |||
} | |||
} | |||
if(plcaddresses.size()>0) | |||
{ | |||
sdkz_control sdkz = new sdkz_control(sdkz_linrarlaout.getContext(), null, plcaddresses,activity,true); | |||
sdkz_linrarlaout.addView(sdkz); | |||
} | |||
}else | |||
{ | |||
for (Res_PLCADDRESS1 item : ConfigName.getInstance().PlcAddress_奶茶机_手动) { | |||
if(item.address.equals("-------------"))//这是标题 | |||
{ | |||
if(plcaddresses.size()>0) | |||
{ | |||
sdkz_control sdkz = new sdkz_control(sdkz_linrarlaout.getContext(), null, plcaddresses,activity,true); | |||
sdkz_linrarlaout.addView(sdkz); | |||
} | |||
plcaddresses=new ArrayList<>(); | |||
tab_control tab = new tab_control(sdkz_linrarlaout.getContext(), null, item.name); | |||
sdkz_linrarlaout.addView(tab); | |||
}else | |||
{ | |||
plcaddresses.add(item); | |||
} | |||
} | |||
if(plcaddresses.size()>0) | |||
{ | |||
sdkz_control sdkz = new sdkz_control(sdkz_linrarlaout.getContext(), null, plcaddresses,activity,true); | |||
sdkz_linrarlaout.addView(sdkz); | |||
} | |||
} | |||
} catch (Exception e) { | |||
} | |||
@@ -1,118 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import android.content.ContextWrapper; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc_control; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUILoadingView; | |||
import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
/** | |||
* PLC控制 | |||
*/ | |||
public class SystemCsControlFragment extends BaseFragment { | |||
private Context context; | |||
@BindView(R.id.plcview) | |||
LinearLayout plcview;//工序子集 | |||
@BindView(R.id.load_view) | |||
QMUILoadingView load_view;//工序子集 | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_cs_control, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
Init(); | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
public void Init() { | |||
load_view.setVisibility(View.VISIBLE); | |||
plcview.removeAllViews(); | |||
ArrayList<BPA_PLCADDRESS> arrayList = QueryDB.GetPlcaddressALL(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
Activity activity = findActivity(context); | |||
if (activity != null) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
for (BPA_PLCADDRESS item : arrayList) { | |||
fragment_plc_control gongxu = new fragment_plc_control(context, null, item); | |||
plcview.addView(gongxu); | |||
} | |||
} catch (Exception e) { | |||
}finally { | |||
load_view.setVisibility(View.INVISIBLE); | |||
} | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
if (context instanceof Activity) { | |||
return (Activity) context; | |||
} else if (context instanceof ContextWrapper) { | |||
return findActivity(((ContextWrapper) context).getBaseContext()); | |||
} else { | |||
return null; | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* | |||
* 切记!切记!切记!否则会闪退! | |||
* | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,113 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.ContextWrapper; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.myprogress.CustomSeekbar; | |||
import com.bonait.bnframework.common.myprogress.ResponseOnTouch; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc_control; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_silos_cl; | |||
import com.orhanobut.logger.Logger; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class SystemCsFltlFragment extends BaseFragment { | |||
@BindView(R.id.plcview) | |||
LinearLayout plcview;//工序子集 | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_cs_fltl, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
Init(); | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
public void Init() { | |||
plcview.removeAllViews(); | |||
ArrayList<BPA_SILOS> arrayList = QueryDB.GetSilosALL(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
Activity activity = findActivity(context); | |||
if (activity != null) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
for (BPA_SILOS item : arrayList) { | |||
fragment_silos_cl gongxu = new fragment_silos_cl(context, null, item); | |||
plcview.addView(gongxu); | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
if (context instanceof Activity) { | |||
return (Activity) context; | |||
} else if (context instanceof ContextWrapper) { | |||
return findActivity(((ContextWrapper) context).getBaseContext()); | |||
} else { | |||
return null; | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* | |||
* 切记!切记!切记!否则会闪退! | |||
* | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,138 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
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.db.res.StatusMode; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.common.view.MyLayoutManager; | |||
import com.bonait.bnframework.modules.home.adapter.lc_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.monitor_adapter; | |||
import com.orhanobut.logger.Logger; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
/** | |||
* plc 监控 | |||
*/ | |||
public class SystemCsMonitorFragment extends BaseFragment { | |||
@BindView(R.id.recycler_view) | |||
RecyclerView recyclerView;//工序子集 | |||
@BindView(R.id.jiaobandianji) | |||
TextView jiaobandianji;//工序子集 | |||
@BindView(R.id.fanzhuandianji) | |||
TextView fanzhuandianji;//工序子集 | |||
private Context context; | |||
monitor_adapter adapter; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_cs_monitor, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
initData(); | |||
} | |||
/** | |||
* 初始化显示数据 | |||
*/ | |||
private void initData() { | |||
try { | |||
MyLayoutManager layout = new MyLayoutManager(); | |||
layout.setAutoMeasureEnabled(true); | |||
recyclerView.setLayoutManager(layout); | |||
adapter = new monitor_adapter(getContext()); | |||
recyclerView.setAdapter(adapter); | |||
Run(); | |||
} catch (Exception e) { | |||
ToastUtils.info("异常信息:" + e.getMessage()); | |||
} | |||
} | |||
/** | |||
* 实时显示线程 | |||
*/ | |||
public void Run() { | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
while (true) { | |||
try { | |||
Activity activity=getActivity(); | |||
if(activity!=null) | |||
{ | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
for (StatusMode item:ConfigName.getInstance().statusModes) | |||
{ | |||
item.Status= ExecuteTheRecipe.getConcurrentHash(item.sort); | |||
} | |||
jiaobandianji.setText( ConfigName.getInstance().statusModes_电机.get(ExecuteTheRecipe.getConcurrentHash_dj("搅拌电机"))); | |||
fanzhuandianji.setText( ConfigName.getInstance().statusModes_电机.get(ExecuteTheRecipe.getConcurrentHash_dj("翻转电机"))); | |||
adapter.refresh(); | |||
} catch (Exception e) { | |||
} | |||
} | |||
}); | |||
} | |||
Thread.sleep(1000); | |||
} catch (InterruptedException e) { | |||
ToastUtils.info("异常信息:" + e.getMessage()); | |||
} | |||
} | |||
} | |||
}).start(); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* | |||
* 切记!切记!切记!否则会闪退! | |||
* | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,154 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.ContextWrapper; | |||
import android.os.Bundle; | |||
import android.text.InputType; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.Button; | |||
import android.widget.LinearLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.common.modbus.ModbusTcpServer; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.NetworkUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUILoadingView; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class SystemCsPLCFragment extends BaseFragment { | |||
@BindView(R.id.plcview) | |||
LinearLayout plcview;//工序子集 | |||
private Context context; | |||
@BindView(R.id.load_view) | |||
QMUILoadingView load_view;//工序子集 | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_cs_plc, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
Init(); | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
public void Init() { | |||
load_view.setVisibility(View.VISIBLE); | |||
// QMUITipDialog loadingDialog = new QMUITipDialog.Builder(getActivity()) | |||
// .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |||
// .setTipWord("正在加载...") | |||
// .create(); | |||
// loadingDialog.show(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
Activity activity = findActivity(context); | |||
if (activity != null) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ArrayList<BPA_PLCADDRESS> arrayList = QueryDB.GetPlcaddressALL(); | |||
for (BPA_PLCADDRESS item : arrayList) { | |||
fragment_plc gongxu = new fragment_plc(context, null, item); | |||
plcview.addView(gongxu); | |||
} | |||
} catch (Exception e) { | |||
}finally { | |||
load_view.setVisibility(View.INVISIBLE); | |||
} | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
if (context instanceof Activity) { | |||
return (Activity) context; | |||
} else if (context instanceof ContextWrapper) { | |||
return findActivity(((ContextWrapper) context).getBaseContext()); | |||
} else { | |||
return null; | |||
} | |||
} | |||
@OnClick({R.id.chushihua}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.chushihua: | |||
String title = "温馨提示!"; | |||
String message = "客官确定要初始化PLC地址吗,小菠萝温馨提示你,此操作将会影响到实际运行哦?"; | |||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
load_view.setVisibility(View.VISIBLE); | |||
ConfigData.getInstance().RevertPLCProcess(); | |||
Init(); | |||
ToastUtils.info("初始化成功!"); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
break; | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,108 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.net.Uri; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.EditText; | |||
import android.widget.ImageView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.image.MyBitmapUtils; | |||
import com.orhanobut.logger.Logger; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class SystemDeviceinFragment extends BaseFragment { | |||
@BindView(R.id.edittext1) | |||
EditText edittext1; | |||
@BindView(R.id.edittext2) | |||
EditText edittext2; | |||
@BindView(R.id.edittext3) | |||
EditText edittext3; | |||
@BindView(R.id.edittext4) | |||
EditText edittext4; | |||
@BindView(R.id.edittext5) | |||
EditText edittext5; | |||
@BindView(R.id.edittext6) | |||
EditText edittext6; | |||
@BindView(R.id.edittext7) | |||
EditText edittext7; | |||
// @BindView(R.id.image) | |||
// ImageView image; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_devicein, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
initdata(); | |||
} | |||
/** | |||
* 初始化数据 | |||
*/ | |||
public void initdata() | |||
{ | |||
if(ConfigName.getInstance().organizeMode !=null && ConfigName.getInstance().deviceInformation!=null) | |||
{ | |||
edittext1.setText(ConfigName.getInstance().deviceInformation.id); | |||
edittext2.setText(ConfigName.getInstance().deviceInformation.deviceName); | |||
edittext3.setText(ConfigName.getInstance().deviceInformation.deviceLoc); | |||
edittext4.setText(ConfigName.getInstance().organizeMode.tel); | |||
edittext5.setText(ConfigName.getInstance().deviceInformation.deviceAddr); | |||
edittext6.setText(ConfigName.getInstance().organizeMode.id); | |||
edittext7.setText(ConfigName.getInstance().organizeMode.store_Name); | |||
// if(ConfigName.getInstance().organizeMode.logo!=null) | |||
// { | |||
// new MyBitmapUtils().disPlay(image,ConfigName.getInstance().organizeMode.logo); | |||
// } | |||
}else | |||
{ | |||
edittext1.setText(ConfigName.getInstance().DeviceId); | |||
edittext2.setText(ConfigName.getInstance().versionSelectionEnum); | |||
edittext3.setText("未知"); | |||
edittext4.setText(""); | |||
edittext5.setText("未知"); | |||
edittext6.setText("未知"); | |||
edittext7.setText("未知"); | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* | |||
* 切记!切记!切记!否则会闪退! | |||
* | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,413 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.annotation.SuppressLint; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import android.content.DialogInterface; | |||
import android.os.Bundle; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.text.InputType; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.EditText; | |||
import android.widget.ListView; | |||
import android.widget.Spinner; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
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.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_PROCESS; | |||
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.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.NetworkUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.adapter.lcsz_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.process_adapter; | |||
import com.bonait.bnframework.modules.home.adapter.wl_adapter; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
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<>(); | |||
@BindView(R.id.datatab_gxmx) | |||
ListView datatab_gxmx;//工序 | |||
ArrayList<BPA_PROCESS> processes = new ArrayList<>(); | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_seasoningset, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
InitView(); | |||
} | |||
/** | |||
* 初始化界面 | |||
*/ | |||
public void InitView() { | |||
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(); | |||
Initdata_gx(); | |||
} | |||
@SuppressLint("HandlerLeak") | |||
private Handler mHandler = new Handler() { | |||
@Override | |||
public void handleMessage(Message msg) { | |||
if (msg.obj.toString()== "MSG_REFRESH") { | |||
Initdata_wl(); | |||
Initdata_lc(); | |||
Initdata_gx(); | |||
} | |||
} | |||
}; | |||
@OnClick({R.id.add_wl, R.id.synchronous, R.id.huifuchuchang}) | |||
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; | |||
case R.id.synchronous://同步云端 | |||
if (NetworkUtils.checkNetworkAvailable(context)) { | |||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||
builder.setTitle("密码确认") | |||
.setPlaceholder("在此输入权限密码") | |||
.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 (text.toString().equals(ConfigName.getInstance().user.pass)) { | |||
ConfigData.getInstance().SyncDataInTheCloud(context,mHandler); | |||
dialog.dismiss(); | |||
} else { | |||
ToastUtils.info("权限密码不正确!"); | |||
} | |||
} else { | |||
ToastUtils.info("权限密码不正确!"); | |||
} | |||
} | |||
}) | |||
.show(); | |||
} else { | |||
ToastUtils.warning("无网络,请先连接网络!!!"); | |||
} | |||
break; | |||
case R.id.huifuchuchang://恢复出 | |||
String title = "温馨提示!"; | |||
String message = "客官确定要初始化PLC地址吗,小菠萝温馨提示你,此操作将会影响到实际运行哦?"; | |||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
ConfigData.getInstance().RevertPLCProcess(); | |||
Initdata_gx(); | |||
ToastUtils.info("恢复出厂设置成功!"); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
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) { | |||
} | |||
} | |||
/** | |||
* 初始化数据加载 | |||
*/ | |||
public void Initdata_gx() { | |||
try { | |||
processes = QueryDB.GetProcessALL(); | |||
process_adapter adapter1 = new process_adapter(context, R.layout.process_item, processes, this); | |||
datatab_gxmx.setAdapter(adapter1); | |||
} catch (Exception e) { | |||
} | |||
} | |||
//endregion | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
if (DataBus.getInstance().mListener != null) { | |||
DataBus.getInstance().mListener.clickListenerNew(this.getView(), 0, ""); | |||
} | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
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.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; | |||
} | |||
} | |||
} |
@@ -1,235 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.EditText; | |||
import android.widget.Spinner; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET; | |||
import com.bonait.bnframework.common.model.mode.VersionSelectionEnum; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.orhanobut.logger.Logger; | |||
import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class SystemSystemsetFragment extends BaseFragment { | |||
@BindView(R.id.edittext1) | |||
EditText edittext1; | |||
@BindView(R.id.edittext2) | |||
EditText edittext2; | |||
@BindView(R.id.edittext3) | |||
EditText edittext3; | |||
@BindView(R.id.edittext4) | |||
EditText edittext4; | |||
@BindView(R.id.environment) | |||
Spinner environment; | |||
@BindView(R.id.versionselection) | |||
Spinner versionselection; | |||
@BindView(R.id.HuoLi) | |||
Spinner HuoLi; | |||
ArrayList<EditText> editTextLists = new ArrayList<>(); | |||
Map<String, Integer> material_map = new LinkedHashMap<>(); | |||
Map<String, Integer> material_map_vis = new LinkedHashMap<>(); | |||
/** | |||
* 系统设置参数 | |||
*/ | |||
ArrayList<BPA_SYSTEMSET> bpa_systemsets = new ArrayList<>(); | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_systemset, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
initData(); | |||
initSelect(); | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
private void initData() { | |||
editTextLists.add(edittext1); | |||
editTextLists.add(edittext2); | |||
editTextLists.add(edittext3); | |||
editTextLists.add(edittext4); | |||
material_map.put("开发环境", 0); | |||
material_map.put("测试环境", 1); | |||
material_map.put("正式环境", 2); | |||
for (int i = 0; i < ConfigName.getInstance().versionSelectionValues.length; i++) { | |||
material_map_vis.put(ConfigName.getInstance().versionSelectionValues[i], i); | |||
} | |||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map.keySet())); | |||
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
environment.setAdapter(adapter); | |||
ArrayAdapter<String> adapter1 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map_vis.keySet())); | |||
adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
versionselection.setAdapter(adapter1); | |||
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(ConfigName.getInstance().HeatingGearL.keySet())); | |||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
HuoLi.setAdapter(adapter2); | |||
HuoLi.setSelection(ConfigName.getInstance().HeatingGearL.get(ConfigName.getInstance().HuoLi)); | |||
bpa_systemsets = QueryDB.GetSystemsetALL(); | |||
for (BPA_SYSTEMSET item : bpa_systemsets) { | |||
switch (item.type) { | |||
case -100: | |||
ConfigName.getInstance().versionSelectionEnum = item.value; | |||
versionselection.setSelection(material_map_vis.get(item.value)); | |||
break; | |||
case -99: | |||
ConfigName.getInstance().Environment = item.value; | |||
environment.setSelection(material_map.get(item.value)); | |||
break; | |||
case 1: | |||
ConfigName.getInstance().Address = item.value; | |||
edittext1.setText(item.value); | |||
break; | |||
case 2: | |||
ConfigName.getInstance().Post = Integer.parseInt(item.value); | |||
edittext2.setText(item.value); | |||
break; | |||
case 3: | |||
ConfigName.getInstance().ClientAutoKey = item.value; | |||
edittext3.setText(item.value); | |||
break; | |||
case 4: | |||
ConfigName.getInstance().DeviceAutoKey = item.value; | |||
edittext4.setText(item.value); | |||
break; | |||
} | |||
} | |||
} | |||
/** | |||
* 初始化选中 | |||
*/ | |||
public void initSelect() { | |||
HuoLi.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() { | |||
@Override | |||
/*public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |||
}*/ | |||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { | |||
ConfigName.getInstance().HuoLi=HuoLi.getSelectedItem().toString(); | |||
ConfigData.getInstance().SavePZ(); | |||
} | |||
@Override | |||
public void onNothingSelected(AdapterView<?> parent) { | |||
} | |||
}); | |||
} | |||
@OnClick({R.id.StartButton}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.StartButton://保存按钮 | |||
ConfigName.getInstance().Address = edittext1.getText().toString(); | |||
ConfigName.getInstance().Post = Integer.parseInt(edittext2.getText().toString()); | |||
ConfigName.getInstance().ClientAutoKey = edittext3.getText().toString(); | |||
ConfigName.getInstance().DeviceAutoKey = edittext4.getText().toString(); | |||
ConfigName.getInstance().Environment = environment.getSelectedItem().toString(); | |||
boolean isgb = false; | |||
if (!ConfigName.getInstance().versionSelectionEnum.equals(versionselection.getSelectedItem().toString())) { | |||
ConfigName.getInstance().versionSelectionEnum = versionselection.getSelectedItem().toString(); | |||
isgb = true; | |||
} | |||
for (BPA_SYSTEMSET item : bpa_systemsets) { | |||
QueryDB.DeleteSystemset(item.id); | |||
} | |||
for (int i = 0; i < editTextLists.size(); i++) { | |||
BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | |||
set.type = i + 1; | |||
set.value = editTextLists.get(i).getText().toString(); | |||
set.deviceID = ConfigName.getInstance().DeviceId; | |||
set.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set); | |||
} | |||
BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | |||
set.type = -99; | |||
set.value = environment.getSelectedItem().toString(); | |||
set.deviceID = ConfigName.getInstance().DeviceId; | |||
set.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set); | |||
BPA_SYSTEMSET set_vis = new BPA_SYSTEMSET(); | |||
set_vis.type = -100; | |||
set_vis.value = versionselection.getSelectedItem().toString(); | |||
set_vis.deviceID = ConfigName.getInstance().DeviceId; | |||
set_vis.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set_vis); | |||
if (isgb) { | |||
ConfigData.getInstance().RevertPLCProcess(); | |||
} | |||
ToastUtils.info("保存成功"); | |||
break; | |||
} | |||
} | |||
} |
@@ -1,18 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import com.bin.david.form.annotation.SmartColumn; | |||
import com.bin.david.form.annotation.SmartTable; | |||
@SmartTable(name="用户信息列表") | |||
public class UserInfo { | |||
@SmartColumn(id =1,name = "姓名") | |||
private String name; | |||
@SmartColumn(id=2,name="年龄") | |||
private int age; | |||
public UserInfo(String name,int age) | |||
{ | |||
this.name=name; | |||
this.age=age; | |||
} | |||
} |
@@ -1,199 +0,0 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import android.content.Context; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import androidx.recyclerview.widget.LinearLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.content.Intent; | |||
import android.graphics.Bitmap; | |||
import android.graphics.BitmapFactory; | |||
import android.net.Uri; | |||
import android.os.Bundle; | |||
import android.os.Environment; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.Button; | |||
import android.widget.EditText; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.Constants; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET; | |||
import com.bonait.bnframework.common.filepicker.PickerManager; | |||
import com.bonait.bnframework.common.filepicker.adapter.FilePickerShowAdapter; | |||
import com.bonait.bnframework.common.filepicker.adapter.OnDeleteListener; | |||
import com.bonait.bnframework.common.filepicker.adapter.OnFileItemClickListener; | |||
import com.bonait.bnframework.common.filepicker.model.FileEntity; | |||
import com.bonait.bnframework.common.filepicker.model.FileType; | |||
import com.bonait.bnframework.common.filepicker.util.OpenFile; | |||
import com.bonait.bnframework.common.image.utils.LocalCacheUtils; | |||
import com.bonait.bnframework.common.image.utils.MD5Encoder; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.common.view.MyImageDialog; | |||
import com.bonait.bnframework.common.view.MyLayoutManager; | |||
import com.bonait.bnframework.modules.home.fragment.from.FileActivity; | |||
import com.bonait.bnframework.modules.home.fragment.mode.image_sp; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.arch.QMUIFragment; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
import pub.devrel.easypermissions.EasyPermissions; | |||
/** | |||
* 资源管理 | |||
*/ | |||
public class systeminternetfragment extends BaseFragment { | |||
@BindView(R.id.rl_file) | |||
RecyclerView mRecyclerView; | |||
@BindView(R.id.rl_yx_file) | |||
RecyclerView rl_yx_file; | |||
@BindView(R.id.baocunbendi) | |||
Button baocunbendi; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_internet, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
FlushedImage(); | |||
} | |||
@OnClick({R.id.xuanzhewenjian, R.id.baocunbendi}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.xuanzhewenjian://保存按钮 | |||
Intent intent = new Intent(context, FileActivity.class); | |||
startActivityForResult(intent, Constants.REQ_CODE); | |||
break; | |||
case R.id.baocunbendi://保存按钮 | |||
BitmapFactory.Options options = new BitmapFactory.Options(); | |||
options.inSampleSize = 2;//宽高压缩为原来的1/2 | |||
for (FileEntity item : PickerManager.getInstance().files) { | |||
File file = item.getFile(); | |||
try { | |||
Bitmap bitmap1 = BitmapFactory.decodeStream(new FileInputStream(file)); | |||
new LocalCacheUtils().setBitmapToLocal(file.getName(), bitmap1); | |||
} catch (Exception e) { | |||
} | |||
} | |||
ToastUtils.info("添加成功!"); | |||
break; | |||
} | |||
} | |||
ArrayList<FileEntity> yx_files = new ArrayList<>(); | |||
private static final String CACHE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/hblchayingdb/WebImage"; | |||
public void FlushedImage() { | |||
File path = new File(CACHE_PATH);// 获得路径 | |||
File[] files = path.listFiles();// 读取文件 | |||
yx_files.clear(); | |||
for (File f : files) { | |||
String absolutePath = f.getAbsolutePath(); | |||
FileEntity e; | |||
if (checkExits(absolutePath)) { | |||
e = new FileEntity(absolutePath, f, true); | |||
} else { | |||
e = new FileEntity(absolutePath, f, false); | |||
} | |||
if (f.isFile()) { | |||
String[] imgs = {"png", "jpg", "jpeg", "gif"}; | |||
e.setFileType(new FileType("IMG", imgs, 0)); | |||
yx_files.add(e); | |||
} | |||
} | |||
rl_yx_file.setLayoutManager(new LinearLayoutManager(context)); | |||
FilePickerShowAdapter adapter = new FilePickerShowAdapter(context, yx_files); | |||
rl_yx_file.setAdapter(adapter); | |||
adapter.setOnItemClickListener(new OnFileItemClickListener() { | |||
@Override | |||
public void click(int position) { | |||
// String path=yx_files.get(position).getPath(); | |||
// Bitmap bitmap =BitmapFactory.decodeFile("file://" + path); | |||
// MyImageDialog myImageDialog = new MyImageDialog(getActivity(),R.style.dialogWindowAnim,0,0,bitmap); | |||
// myImageDialog.show(); | |||
//打开系统相册浏览照片 | |||
// Intent intent = new Intent(); | |||
// intent.setAction(Intent.ACTION_VIEW); | |||
// intent.setDataAndType(Uri.parse("file://" + path), "image/*"); | |||
// startActivity(intent); | |||
} | |||
}); | |||
} | |||
private static boolean checkExits(String path) { | |||
for (FileEntity entity : PickerManager.getInstance().files) { | |||
if (entity.getPath().equals(path)) { | |||
return true; | |||
} | |||
} | |||
return false; | |||
} | |||
@Override | |||
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |||
super.onActivityResult(requestCode, resultCode, data); | |||
if (requestCode == Constants.REQ_CODE) { | |||
mRecyclerView.setLayoutManager(new LinearLayoutManager(context)); | |||
FilePickerShowAdapter adapter = new FilePickerShowAdapter(context, PickerManager.getInstance().files); | |||
mRecyclerView.setAdapter(adapter); | |||
String res = "(" + PickerManager.getInstance().files.size() + "/" + PickerManager.getInstance().maxCount + ")"; | |||
baocunbendi.setText(getString(R.string.file_select_res1, res)); | |||
adapter.setOnItemClickListener(new OnFileItemClickListener() { | |||
@Override | |||
public void click(int position) { | |||
// String path=PickerManager.getInstance().files.get(position).getPath(); | |||
// Intent intent = new Intent(); | |||
// intent.setAction(Intent.ACTION_VIEW); | |||
// intent.setDataAndType(Uri.parse("file://" + path), "image/*"); | |||
// startActivity(intent); | |||
} | |||
}); | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -1,27 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.CpActivity"> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/activity_background"> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout | |||
android:id="@+id/qmuisection_layout" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" /> | |||
</RelativeLayout> | |||
</ScrollView> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue" /> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,45 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.CpxzActivity" | |||
android:orientation="vertical" | |||
android:background="@color/app_color_blue" | |||
android:fitsSystemWindows="true"> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/activity_background" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<androidx.appcompat.widget.SearchView | |||
android:id="@+id/search_view" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/button"/> | |||
<RelativeLayout | |||
android:padding="5dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/recycler_view" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</ScrollView> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,319 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.DiyActivity" | |||
android:orientation="vertical" | |||
android:background="@color/app_color_blue" | |||
android:fitsSystemWindows="true" | |||
app:qmui_skin_background="?attr/app_skin_common_background"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/qmui_config_color_white"> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginRight="30dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical" | |||
> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:background="@color/color1"> | |||
<ImageView | |||
android:id="@+id/cpfm" | |||
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" /> | |||
</RelativeLayout> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:textAlignment="center" | |||
android:text="菜谱封面"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginBottom="12dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="菜谱名称:"/> | |||
<!--账号输入框--> | |||
<EditText | |||
android:id="@+id/edittext" | |||
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="12dp" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginBottom="12dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="制作时长:"/> | |||
<!--账号输入框--> | |||
<EditText | |||
android:id="@+id/zzsc" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入制作时长" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<CheckBox | |||
android:layout_marginLeft="70dp" | |||
android:id="@+id/check" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color" | |||
android:text="默认收藏"/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<!--边框分割细线--> | |||
<LinearLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="1dp" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
android:background="@color/color3" /> | |||
<LinearLayout android:layout_width="match_parent" | |||
android:layout_height="400dp"> | |||
<RelativeLayout | |||
android:layout_width="160dp" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="步骤:"/> | |||
<Button | |||
android:id="@+id/shangyi" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="上移" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:id="@+id/xiayi" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="下移" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</LinearLayout> | |||
<ListView | |||
android:id="@+id/datatab_gxbz" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:divider="#00000000" | |||
android:layout_marginTop="10dp" | |||
android:layout_marginBottom="@dimen/dp_40" | |||
android:dividerHeight="3dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:visibility="gone" | |||
android:id="@+id/caozuomoshi" | |||
android:layout_centerHorizontal="true" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button1" | |||
android:text="操作模式" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<!--边框分割细线--> | |||
<RelativeLayout | |||
android:layout_alignParentLeft="true" | |||
android:layout_width="@dimen/dp_10" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="1dp" | |||
android:layout_height="match_parent" | |||
android:layout_centerInParent="true" | |||
android:layout_marginTop="@dimen/dp_40" | |||
android:layout_marginBottom="@dimen/dp_40" | |||
android:background="@color/color3" /> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="烹饪工序:"/> | |||
<Spinner | |||
android:id="@+id/hrgx" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" | |||
/> | |||
</LinearLayout> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_marginBottom="40dp" | |||
android:layout_marginTop="20dp" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/gxchid" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/add_hrgx" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button1" | |||
android:text="添加" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:id="@+id/update_gx" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="修改" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:id="@+id/delete_gx" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="删除" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="30dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="30dp"> | |||
<Button | |||
android:id="@+id/shengchengcaipu" | |||
android:layout_width="match_parent" | |||
android:layout_height="45dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="生成菜谱" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</ScrollView> | |||
<!-- <RelativeLayout--> | |||
<!-- android:layout_alignParentBottom="true"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="10dp"--> | |||
<!-- android:layout_marginRight="10dp">--> | |||
<!-- <com.youth.banner.Banner--> | |||
<!-- android:id="@+id/Banner_Main"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="160dp"--> | |||
<!-- android:layout_gravity="center"--> | |||
<!-- app:image_scale_type="fit_xy"--> | |||
<!-- app:indicator_height="10dp"--> | |||
<!-- app:indicator_margin="5dp"--> | |||
<!-- app:indicator_width="10dp" />--> | |||
<!-- </RelativeLayout>--> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,333 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.DiyUpdateActivity" | |||
android:orientation="vertical" | |||
android:background="@color/app_color_blue" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/qmui_config_color_white"> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginRight="30dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:background="@color/color1"> | |||
<ImageView | |||
android:id="@+id/cpfm" | |||
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" /> | |||
</RelativeLayout> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:textAlignment="center" | |||
android:text="菜谱封面"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginBottom="12dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="菜谱名称:"/> | |||
<!--账号输入框--> | |||
<EditText | |||
android:id="@+id/edittext" | |||
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="12dp" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginBottom="12dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="制作时长:"/> | |||
<!--账号输入框--> | |||
<EditText | |||
android:id="@+id/zzsc" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入制作时长" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<CheckBox | |||
android:layout_marginLeft="70dp" | |||
android:id="@+id/check" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:buttonTint="@color/radiusImageView_selected_mask_color" | |||
android:text="默认收藏"/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<!--边框分割细线--> | |||
<LinearLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="1dp" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
android:background="@color/color3" /> | |||
<LinearLayout android:layout_width="match_parent" | |||
android:layout_height="400dp"> | |||
<RelativeLayout | |||
android:layout_width="160dp" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="步骤:"/> | |||
<Button | |||
android:id="@+id/shangyi" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="上移" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:id="@+id/xiayi" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="下移" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</LinearLayout> | |||
<ListView | |||
android:id="@+id/datatab_gxbz" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:divider="#00000000" | |||
android:layout_marginTop="10dp" | |||
android:layout_marginBottom="@dimen/dp_40" | |||
android:dividerHeight="3dp" /> | |||
</LinearLayout> | |||
<Button | |||
android:visibility="gone" | |||
android:id="@+id/caozuomoshi" | |||
android:layout_centerHorizontal="true" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button1" | |||
android:text="操作模式" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<!--边框分割细线--> | |||
<RelativeLayout | |||
android:layout_alignParentLeft="true" | |||
android:layout_width="@dimen/dp_10" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="1dp" | |||
android:layout_height="match_parent" | |||
android:layout_centerInParent="true" | |||
android:layout_marginTop="@dimen/dp_40" | |||
android:layout_marginBottom="@dimen/dp_40" | |||
android:background="@color/color3" /> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="烹饪工序:"/> | |||
<Spinner | |||
android:id="@+id/hrgx" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" | |||
/> | |||
</LinearLayout> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_marginBottom="40dp" | |||
android:layout_marginTop="20dp" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/gxchid" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/add_hrgx" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button1" | |||
android:text="添加" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:id="@+id/update_gx" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="修改" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:id="@+id/delete_gx" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="26dp" | |||
android:background="@drawable/button" | |||
android:text="删除" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="30dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="30dp"> | |||
<LinearLayout | |||
android:layout_centerHorizontal="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<Button | |||
android:id="@+id/shengchengcaipu" | |||
android:layout_width="160dp" | |||
android:layout_height="45dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="修改菜谱" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
<Button | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:id="@+id/shengchengnewcaipu" | |||
android:layout_width="160dp" | |||
android:layout_height="45dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="生成新菜谱" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</ScrollView> | |||
<!-- <RelativeLayout--> | |||
<!-- android:layout_alignParentBottom="true"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_marginLeft="10dp"--> | |||
<!-- android:layout_marginRight="10dp">--> | |||
<!-- <com.youth.banner.Banner--> | |||
<!-- android:id="@+id/Banner_Main"--> | |||
<!-- android:layout_width="match_parent"--> | |||
<!-- android:layout_height="160dp"--> | |||
<!-- android:layout_gravity="center"--> | |||
<!-- app:image_scale_type="fit_xy"--> | |||
<!-- app:indicator_height="10dp"--> | |||
<!-- app:indicator_margin="5dp"--> | |||
<!-- app:indicator_width="10dp" />--> | |||
<!-- </RelativeLayout>--> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,37 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.SzActivity" | |||
android:orientation="vertical" | |||
android:background="@color/app_color_blue" | |||
android:fitsSystemWindows="true"> | |||
<com.google.android.material.bottomnavigation.BottomNavigationView | |||
android:id="@+id/navigation" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/home_tab_height" | |||
android:layout_gravity="top" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
app:itemHorizontalTranslationEnabled="false" | |||
app:labelVisibilityMode="labeled" | |||
app:menu="@menu/system" | |||
android:fitsSystemWindows="true"/> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:layout_marginTop="110dp" | |||
android:id="@+id/viewpager" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="?attr/app_content_bg_color" /> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,36 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.WhActivity" | |||
android:background="@color/app_color_blue"> | |||
<com.google.android.material.bottomnavigation.BottomNavigationView | |||
android:id="@+id/navigation" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="36dp" | |||
android:layout_gravity="top" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
app:itemHorizontalTranslationEnabled="false" | |||
app:labelVisibilityMode="labeled" | |||
app:menu="@menu/maintenance" | |||
app:itemIconTint="@null" | |||
app:itemIconSize="0dp" | |||
android:fitsSystemWindows="true"/> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:id="@+id/viewpager" | |||
android:layout_marginTop="90dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="?attr/app_content_bg_color" /> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -64,11 +64,18 @@ | |||
android:layout_marginTop="50dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="通道校准:" | |||
android:textSize="20dp"/> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
@@ -1,39 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemCsControlFragment"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<ScrollView | |||
android:layout_marginTop="20dp" | |||
android:layout_weight="1" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/plcview" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
</LinearLayout> | |||
<com.qmuiteam.qmui.widget.QMUILoadingView | |||
android:id="@+id/load_view" | |||
android:layout_width="75dp" | |||
android:layout_height="55dp" | |||
android:layout_centerInParent="true" | |||
android:color="@color/colorPrimary" | |||
android:visibility="visible" | |||
tools:ignore="MissingConstraints" /> | |||
</RelativeLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,28 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemCsFltlFragment"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<ScrollView | |||
android:layout_marginTop="20dp" | |||
android:layout_weight="1" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/plcview" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,140 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemCsMonitorFragment"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/activity_background"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginBottom="5dp" | |||
android:text="搅拌电机:" | |||
android:textSize="16sp"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<ImageView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/jbdj"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="100dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true" | |||
android:text="故障信息:"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:id="@+id/jiaobandianji" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true" | |||
android:textColor="@color/color4" | |||
android:text="搅拌电机" | |||
android:textSize="12dp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginBottom="5dp" | |||
android:text="翻转电机:" | |||
android:textSize="16sp"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<ImageView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/fzdj"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="100dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true" | |||
android:text="故障信息:"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<TextView | |||
android:id="@+id/fanzhuandianji" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true" | |||
android:textColor="@color/color4" | |||
android:text="搅拌电机" | |||
android:textSize="12dp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginBottom="5dp" | |||
android:text="炒锅状态:" | |||
android:textSize="16sp"/> | |||
<ScrollView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_height="match_parent" | |||
android:layout_width="match_parent" | |||
android:fadingEdge="vertical" | |||
tools:ignore="Suspicious0dp"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/recycler_view" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"/> | |||
</ScrollView> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,56 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemCsPLCFragment"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<ScrollView | |||
android:layout_marginTop="20dp" | |||
android:layout_weight="1" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/plcview" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
<LinearLayout | |||
android:layout_margin="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="34dp" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal"> | |||
<Button | |||
android:id="@+id/chushihua" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="恢复出厂设置" | |||
android:layout_weight="1" | |||
/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<com.qmuiteam.qmui.widget.QMUILoadingView | |||
android:id="@+id/load_view" | |||
android:layout_width="75dp" | |||
android:layout_height="55dp" | |||
android:layout_centerInParent="true" | |||
android:color="@color/colorPrimary" | |||
android:visibility="visible" | |||
tools:ignore="MissingConstraints" /> | |||
</RelativeLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,240 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemDeviceinFragment"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/main_background" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10"> | |||
<TableLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true"> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备编号:" /> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:gravity="right" | |||
android:text="设备名称:" /> | |||
<EditText | |||
android:id="@+id/edittext2" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备位置:" /> | |||
<EditText | |||
android:id="@+id/edittext3" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:gravity="right" | |||
android:text="联系电话:" /> | |||
<EditText | |||
android:id="@+id/edittext4" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备详细地址:" /> | |||
<EditText | |||
android:id="@+id/edittext5" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="门店编号:" /> | |||
<EditText | |||
android:id="@+id/edittext6" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="门店名称:" /> | |||
<EditText | |||
android:id="@+id/edittext7" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<!-- <TableRow--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_gravity="center"--> | |||
<!-- android:layout_margin="5dp">--> | |||
<!-- <com.qmuiteam.qmui.widget.textview.QMUILinkTextView--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:gravity="right"--> | |||
<!-- android:text="门店LOGO:" />--> | |||
<!-- <ImageView--> | |||
<!-- android:id="@+id/image"--> | |||
<!-- android:layout_width="120dp"--> | |||
<!-- android:layout_height="120dp"--> | |||
<!-- android:layout_marginLeft="5dp"--> | |||
<!-- android:src="@mipmap/loading3" />--> | |||
<!-- </TableRow>--> | |||
</TableLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,112 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/qmui_config_color_white" | |||
tools:context=".modules.home.fragment.from.fragment.systeminternetfragment"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<!-- 本地已存在资源 --> | |||
<LinearLayout | |||
android:background="@color/qmui_config_color_white" | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:paddingLeft="@dimen/dp_10" | |||
android:paddingTop="@dimen/dp_10" | |||
android:paddingRight="@dimen/dp_10" | |||
android:layout_marginBottom="@dimen/dp_10"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="已有图片列表" | |||
android:textSize="@dimen/text_size_16" | |||
/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/rl_yx_file" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:scrollbars="none" | |||
/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<!-- 选择资源 --> | |||
<LinearLayout | |||
android:background="@color/qmui_config_color_white" | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:paddingLeft="@dimen/dp_10" | |||
android:paddingRight="@dimen/dp_10"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="@dimen/text_size_16" | |||
android:text="选择图片列表"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp" | |||
android:layout_marginBottom="@dimen/dp_10"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/rl_file" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:scrollbars="none" | |||
/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="34dp" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal"> | |||
<Button | |||
android:id="@+id/xuanzhewenjian" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="选择文件" | |||
android:layout_weight="1" | |||
/> | |||
<Button | |||
android:id="@+id/baocunbendi" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/button1" | |||
android:text="保存本地" | |||
android:layout_weight="1" | |||
/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,453 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemSeasoningsetFragment"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
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> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/add_wl" | |||
android:layout_width="80dp" | |||
android:layout_height="26dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="100dp" | |||
android:background="@drawable/button1" | |||
android:text="增加" | |||
android:textSize="14dp" /> | |||
<Button | |||
android:id="@+id/synchronous" | |||
android:layout_width="80dp" | |||
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> | |||
</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: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 | |||
android:layout_marginTop="5dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
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="wrap_content"> | |||
<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="120dp" | |||
android:layout_centerVertical="true" | |||
android:textColor="@color/amber_primary_dark" | |||
android:text="" | |||
android:textSize="12dp" /> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/add_gx" | |||
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:visibility="gone" | |||
android:text="增加" | |||
android:textSize="14dp" /> | |||
<Button | |||
android:id="@+id/huifuchuchang" | |||
android:layout_width="100dp" | |||
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> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp" | |||
android:layout_marginBottom="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> | |||
</TableRow> | |||
</TableLayout> | |||
</RelativeLayout> | |||
<!-- 数据 --> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<ListView | |||
android:id="@+id/datatab_gxmx" | |||
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> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -1,175 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
tools:context=".modules.home.fragment.from.fragment.SystemSystemsetFragment"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<RelativeLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<TableLayout | |||
android:layout_centerHorizontal="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="PLC连接地址:" /> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
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_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="PLC连接端口:" /> | |||
<EditText | |||
android:id="@+id/edittext2" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入端口" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
</TableRow> | |||
<!-- Table2--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="商家店铺号:" /> | |||
<EditText | |||
android:id="@+id/edittext3" | |||
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:gravity="right" | |||
android:text="链接环境:" /> | |||
<Spinner | |||
android:id="@+id/environment" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
<!-- Table3--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="商家设备号:" /> | |||
<EditText | |||
android:id="@+id/edittext4" | |||
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_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="版本选择:" /> | |||
<Spinner | |||
android:id="@+id/versionselection" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
<!-- Table3--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="火力最大级别:" /> | |||
<Spinner | |||
android:id="@+id/HuoLi" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
</TableLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:layout_marginRight="@dimen/dp_40" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/StartButton" | |||
android:layout_width="match_parent" | |||
android:layout_height="45dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="保存参数" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |