ValidateTemplate(Label lb2, boolean iflag) {
作者:互联网
public static ValidateLabelBean ValidateTemplate(Label lb2, boolean iflag) { Label lb = lb2; LogUtils.i("vv", "=========================================================>"); boolean flag = false; ValidateLabelBean bean = new ValidateLabelBean(); StringBuffer sb1 = new StringBuffer(); StringBuffer sb2 = new StringBuffer(); for (int i = 0; i < DrawAreaYY.dragView.lb.Elements.size(); i++) { sb1.append(DrawAreaYY.dragView.lb.Elements.get(i)._content); } for (int i = 0; i < lb.Elements.size(); i++) { sb2.append(lb.Elements.get(i)._content); } if ((DrawAreaYY.dragView.lb.printInfo.PageType == lb.printInfo.PageType) && (TextUtils.isEmpty(sb1.toString()) || TextUtils.isEmpty(sb2.toString()))&&(DrawAreaYY.dragView.lb.Elements.size()==0||lb.Elements.size()==0)) { LogUtils.i("vv", "00"); if((!TextUtils.isEmpty(sb1.toString()) || TextUtils.isEmpty(sb2.toString()))){ DrawAreaYY.dragView.lb.baseImgUrl = lb.baseImgUrl; try { lb = DrawAreaYY.dragView.lb.clone(); // lb2.baseImgUrl = lb.baseImgUrl; }catch(Exception e){ LogUtils.e("NewActivityYY","ValidateTemplate e:"+e); } } flag = true; } else if (DrawAreaYY.dragView.lb.printInfo.PageType == 2 && lb.printInfo.PageType == 2 && DrawAreaYY.dragView.lb.Height == lb.Height&&DrawAreaYY.dragView.lb.Width == lb.Width) { LogUtils.i("vv", "11"); flag = true; } else if (DrawAreaYY.dragView.lb.printInfo.PageType == 1 && lb.printInfo.PageType == 1 && DrawAreaYY.dragView.lb.Height == lb.Height && DrawAreaYY.dragView.lb.Width == lb.Width&&(sb1.toString().trim().equals(sb2.toString().trim()))&&(DrawAreaYY.dragView.lb.printInfo.PrintInterval==lb.printInfo.PrintInterval)) { LogUtils.i("vv", "22"); flag = true; } /*if(iflag&&SharePreUtil.getTheme() == R.style.YYTheme){ flag = true; }*/ else if ((!TextUtils.isEmpty(lb.baseImgUrl))&&(!TextUtils.isEmpty(DrawAreaYY.dragView.lb.baseImgUrl))&& CConst.lastWidth == lb.Width && CConst.lastHeight == lb.Height&&(lb.printInfo.PrintDirect==DrawAreaYY.dragView.lb.printInfo.PrintDirect)&&DrawAreaYY.dragView.lb.baseImgUrl.trim().equals(lb.baseImgUrl.trim())) {//CConst.lastHeight != 0 && LogUtils.i("vv", "33"); LogUtils.i("vv","sb1.equals(sb2)):"+sb1.equals(sb2)); if(sb1.toString().replaceAll(" ","").equals(sb2.toString().replaceAll(" ",""))) flag = true; } CConst.lastWidth = lb.Width; CConst.lastHeight = lb.Height; bean.setFlag(flag); bean.setLabel(lb); return bean; }
标签:sb2,lb2,lb,printInfo,DrawAreaYY,dragView,boolean,&&,ValidateTemplate 来源: https://www.cnblogs.com/pengmn/p/15557342.html