|
|
@@ -6,18 +6,30 @@ import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.AsyncTask;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
+import android.support.v7.widget.DividerItemDecoration;
|
|
|
+import android.support.v7.widget.LinearLayoutManager;
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.KeyEvent;
|
|
|
+import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.Window;
|
|
|
+import android.view.inputmethod.EditorInfo;
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.PopupWindow;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.android.volley.Request;
|
|
|
+import com.android.volley.toolbox.StringRequest;
|
|
|
+import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
+import com.chad.library.adapter.base.BaseViewHolder;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
import com.uas.hy_electronic.R;
|
|
|
import com.uas.hy_electronic.activity.FunctionActivity;
|
|
|
@@ -31,6 +43,12 @@ import com.uas.hy_electronic.tools.GsonUtil;
|
|
|
import com.uas.hy_electronic.tools.VolleyUtil;
|
|
|
import com.uas.hy_electronic.util.CameraUtil;
|
|
|
import com.uas.hy_electronic.util.CommonUtil;
|
|
|
+import com.uas.hy_electronic.util.FastjsonUtil;
|
|
|
+import com.uas.hy_electronic.util.HttpCallback;
|
|
|
+import com.uas.hy_electronic.util.HttpParams;
|
|
|
+import com.uas.hy_electronic.util.LogUtil;
|
|
|
+import com.uas.hy_electronic.util.StringUtil;
|
|
|
+import com.uas.hy_electronic.util.VollyRequest;
|
|
|
import com.uas.hy_electronic.view.ClearableEditText;
|
|
|
import com.uas.hy_electronic.view.ConfirmDialog;
|
|
|
import com.uuzuche.lib_zxing.activity.CaptureActivity;
|
|
|
@@ -40,8 +58,11 @@ import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import razerdp.basepopup.BasePopupWindow;
|
|
|
+
|
|
|
/**
|
|
|
* @note:物料库存核查Fragment
|
|
|
*/
|
|
|
@@ -58,6 +79,18 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
private ListView lvDetail;
|
|
|
private ImageView mScanImageView;
|
|
|
private int mFocusId;
|
|
|
+ private TextView tv_barprodcode;
|
|
|
+ private String pi_type;
|
|
|
+ private ArrayList<ComDataBean> ComDataBeanList;
|
|
|
+ private ClearableEditText edit_et;
|
|
|
+ private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
|
|
|
+ private RecyclerView rv_line_ip_port_data;
|
|
|
+ private String sc_name;
|
|
|
+ private String sc_code;
|
|
|
+ private PopupWindow editPW;
|
|
|
+ private StringRequest mStringRequest;
|
|
|
+ private ImageView iv_search;
|
|
|
+ private TextView tv_pr_qty;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -85,8 +118,11 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
//->信息显示
|
|
|
tvPrDetail = (TextView) root.findViewById(R.id.tv_pr_detail);
|
|
|
tvPrSpec = (TextView) root.findViewById(R.id.tv_pr_spec);
|
|
|
+ tv_pr_qty = (TextView) root.findViewById(R.id.tv_pr_qty);
|
|
|
+ tv_barprodcode = (TextView) root.findViewById(R.id.tv_barprodcode);
|
|
|
|
|
|
mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
|
|
|
+ iv_search = (ImageView) mActivity.findViewById(R.id.iv_search);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -131,6 +167,12 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ iv_search.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ getRepairStep("");
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -138,6 +180,7 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
editTextGetFocus(etProdcode);
|
|
|
//->Actionbar
|
|
|
((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(R.string.title_makematerial_whmm);
|
|
|
+ ComDataBeanList = new ArrayList<>();
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -285,10 +328,14 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
//修改信息显示区域的信息
|
|
|
String strDetail = detailItemList.get(0).getPR_DETAIL();
|
|
|
String strSpec = detailItemList.get(0).getPR_SPEC();
|
|
|
+ String bar_prodcode = detailItemList.get(0).getBAR_PRODCODE();
|
|
|
+ String qty = detailItemList.get(0).getQTY();
|
|
|
|
|
|
//信息区域显示
|
|
|
+ tv_barprodcode.setText("" + bar_prodcode);
|
|
|
tvPrDetail.setText("" + strDetail);
|
|
|
tvPrSpec.setText("" + strSpec);
|
|
|
+ tv_pr_qty.setText("" + qty);
|
|
|
|
|
|
//table数据源修改
|
|
|
adapter.notifyDataSetChanged();
|
|
|
@@ -324,6 +371,325 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
// requestType, strPrcode, strWhcode, strLocation);
|
|
|
// }
|
|
|
|
|
|
+ private void getRepairStep(String trim) {
|
|
|
+// if (pi_type.equals("良品")){
|
|
|
+// pi_type = "";
|
|
|
+// }
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_PDAIO_IN_GETWHCODE)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(TAG + "getMaCode")
|
|
|
+ .addParam("condition",trim)
|
|
|
+ .addParam("piclass","")
|
|
|
+ .addParam("pi_type","")
|
|
|
+ .flag(0)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
|
|
|
+ com.alibaba.fastjson.JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
|
|
|
+ if (isSuccess){
|
|
|
+ if (dataArray == null){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
|
|
|
+ }else {
|
|
|
+ handleFeededlineData(dataArray,trim);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void handleFeededlineData(com.alibaba.fastjson.JSONArray dataArray, String trim) {
|
|
|
+ ComDataBean bean;
|
|
|
+ ComDataBeanList.clear();
|
|
|
+ for (Object index : dataArray) {
|
|
|
+ com.alibaba.fastjson.JSONObject data = (com.alibaba.fastjson.JSONObject) index;
|
|
|
+ bean= new ComDataBean();
|
|
|
+ bean.setItemName(data.getString("WH_DESCRIPTION"));
|
|
|
+ bean.setItemremark(data.getString("WH_CODE"));
|
|
|
+ ComDataBeanList.add(bean);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (trim.isEmpty()){
|
|
|
+ initresourcesPopupWindow();
|
|
|
+ }else {
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+ ipAndResourcesPortAdapter.setmList(ComDataBeanList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ private void initresourcesPopupWindow() {
|
|
|
+ View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_recycle_item, null);
|
|
|
+ edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
|
+ TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
|
|
|
+ TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
|
|
|
+ ImageView search_im = contView.findViewById(R.id.search_im);
|
|
|
+ LinearLayout line_top = contView.findViewById(R.id.line_top);
|
|
|
+ rv_line_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
|
|
|
+ rv_line_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
|
|
|
+ rv_line_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+ ipAndResourcesPortAdapter.setmList(ComDataBeanList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ setlineAdapter(ComDataBeanList);
|
|
|
+// edit_et.setText(ct_qty.getText().toString().trim());
|
|
|
+
|
|
|
+ edit_et.requestFocus();
|
|
|
+ editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
+ editPW.setTouchable(true);
|
|
|
+ editPW.setBackgroundDrawable(new BitmapDrawable());
|
|
|
+ editPW.setOnDismissListener(new BasePopupWindow.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss() {
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ View parentView = mActivity.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
|
|
|
+ editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
|
|
|
+ edit_et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
+ @Override
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_DONE
|
|
|
+ || actionId == EditorInfo.IME_ACTION_SEND
|
|
|
+ || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
+ String mSearchStr = edit_et.getText().toString().trim();
|
|
|
+ if (!mSearchStr.isEmpty()) {
|
|
|
+ List<ComDataBean> thisList = new ArrayList<>();
|
|
|
+ for(int i=0;i<ComDataBeanList.size();i++){
|
|
|
+ if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
|
|
|
+ thisList.add(ComDataBeanList.get(i));
|
|
|
+ }
|
|
|
+ if(i == ComDataBeanList.size() -1){
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
+
|
|
|
+ }
|
|
|
+ List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+ for (int j = 0; j < lineCodeEntities.size(); j++) {
|
|
|
+ lineCodeEntities.get(j).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+ for (int i = 0; i < lineCodeEntities.size(); i++) {
|
|
|
+ lineCodeEntities.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ }
|
|
|
+ ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+ List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+ sc_name = ipAndPortBeans.get(position).getItemName();
|
|
|
+ sc_code = ipAndPortBeans.get(position).getItemremark();
|
|
|
+ for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+ ipAndPortBeans.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndPortBeans.get(position).setChecked(true);
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ search_im.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ String mSearchStr = edit_et.getText().toString().trim();
|
|
|
+ if (!mSearchStr.isEmpty()) {
|
|
|
+ List<ComDataBean> thisList = new ArrayList<>();
|
|
|
+ for(int i=0;i<ComDataBeanList.size();i++){
|
|
|
+ if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
|
|
|
+ thisList.add(ComDataBeanList.get(i));
|
|
|
+ }
|
|
|
+ if(i == ComDataBeanList.size() -1){
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
+
|
|
|
+ }
|
|
|
+ List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+ for (int j = 0; j < lineCodeEntities.size(); j++) {
|
|
|
+ lineCodeEntities.get(j).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+ for (int i = 0; i < lineCodeEntities.size(); i++) {
|
|
|
+ lineCodeEntities.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ }
|
|
|
+// getRepairStep(mSearchStr);
|
|
|
+ ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+ List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+ sc_name = ipAndPortBeans.get(position).getItemName();
|
|
|
+ sc_code = ipAndPortBeans.get(position).getItemremark();
|
|
|
+ for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+ ipAndPortBeans.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndPortBeans.get(position).setChecked(true);
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<String> list=new ArrayList<>();
|
|
|
+ //确定
|
|
|
+ sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ list.clear();
|
|
|
+
|
|
|
+ if (StringUtil.isEmpty(sc_code)){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"请选择工序");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ etWhcode.setText(sc_code);
|
|
|
+ etWhcode.requestFocus();
|
|
|
+ etWhcode.setSelection(etWhcode.getText().length());
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //取消
|
|
|
+ cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ String mSearchStr = edit_et.getText().toString().trim();
|
|
|
+ if (mSearchStr.isEmpty()) {
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+ for (int i = 0; i < lineCodeEntities.size(); i++) {
|
|
|
+ lineCodeEntities.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+ List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+ sc_name = ipAndPortBeans.get(position).getItemName();
|
|
|
+ sc_code = ipAndPortBeans.get(position).getItemremark();
|
|
|
+ for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+ ipAndPortBeans.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndPortBeans.get(position).setChecked(true);
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+// edit_et.addTextChangedListener(new TextWatcher() {
|
|
|
+// @Override
|
|
|
+// public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
|
|
+// @Override
|
|
|
+// public void onTextChanged(CharSequence s, int start, int before, int count) { }
|
|
|
+// @Override
|
|
|
+// public void afterTextChanged(Editable s) {
|
|
|
+// if (ComDataBeanList.isEmpty()){
|
|
|
+// getfuzzySearchSourceData(edit_et.getText().toString().trim(),"不良");
|
|
|
+// }
|
|
|
+// if (s.length() >= 0) {
|
|
|
+// String mSearchStr = s.toString().trim();
|
|
|
+// LogUtil.i("mSearchStr",mSearchStr);
|
|
|
+// List<ComDataBean> thisList = new ArrayList<>();
|
|
|
+// for(int i=0;i<ComDataBeanList.size();i++){
|
|
|
+// if(ComDataBeanList.get(i).getSC_CODE().contains(mSearchStr)){
|
|
|
+// thisList.add(ComDataBeanList.get(i));
|
|
|
+// }
|
|
|
+// if(i == ComDataBeanList.size() -1){
|
|
|
+// ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
|
|
|
+// rv_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+//
|
|
|
+// } else {
|
|
|
+//
|
|
|
+// ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+// rv_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+//
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+// List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+// for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+// ipAndPortBeans.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndPortBeans.get(position).setChecked(true);
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+//
|
|
|
+// });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setlineAdapter(ArrayList<ComDataBean> mList) {
|
|
|
+ LogUtil.i("mList", JSON.toJSONString(mList));
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(mList);
|
|
|
+ ipAndResourcesPortAdapter.setmList(ComDataBeanList);
|
|
|
+ ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+ rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void closeListPopupWindow() {
|
|
|
+ if (editPW != null) {
|
|
|
+ editPW.dismiss();
|
|
|
+ editPW = null;
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 1f);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
disposeOnClickEnter();
|
|
|
@@ -405,4 +771,66 @@ public class WHCheckMakeMaterialFragment extends BaseFragment implements View.On
|
|
|
public boolean onFragmentBackPressed() {
|
|
|
return false;
|
|
|
}
|
|
|
+ private class IpAndResourcesPortAdapter extends BaseQuickAdapter<ComDataBean, BaseViewHolder> {
|
|
|
+ private List<ComDataBean> mmmmList;
|
|
|
+
|
|
|
+ public List<ComDataBean> getmList() {
|
|
|
+ return mmmmList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setmList(List<ComDataBean> mList) {
|
|
|
+ this.mmmmList = mList;
|
|
|
+ }
|
|
|
+ public ComDataBean getBeanByPositon(int position){
|
|
|
+ return mmmmList.get(position);
|
|
|
+ }
|
|
|
+
|
|
|
+ private IpAndResourcesPortAdapter(@Nullable List<ComDataBean> data) {
|
|
|
+ super(R.layout.fuzzy_ipandport_item, data);
|
|
|
+ this.mmmmList = data;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ protected void convert(BaseViewHolder helper, ComDataBean item) {
|
|
|
+ helper.setText(R.id.macode_ip__Tv,item.getItemremark()+"-("+item.getItemName()+")");
|
|
|
+ LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
|
|
|
+ if (item.getChecked()) {
|
|
|
+ line_true.setSelected(true);
|
|
|
+ } else {
|
|
|
+ line_true.setSelected(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private class ComDataBean{
|
|
|
+ String itemName = null;
|
|
|
+ String itemremark = null;
|
|
|
+ boolean Checked;
|
|
|
+
|
|
|
+ public boolean getChecked() {
|
|
|
+ return Checked;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setChecked(boolean checked) {
|
|
|
+ Checked = checked;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getItemName() {
|
|
|
+ return itemName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setItemName(String itemName) {
|
|
|
+ this.itemName = itemName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getItemremark() {
|
|
|
+ return itemremark;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setItemremark(String itemremark) {
|
|
|
+ this.itemremark = itemremark;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|