| | |
| | | import android.graphics.Paint; |
| | | import android.graphics.Typeface; |
| | | import android.graphics.drawable.GradientDrawable; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import android.text.Spannable; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.TextUtils; |
| | | import android.text.style.RelativeSizeSpan; |
| | | import android.view.Gravity; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.WindowManager; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.GridView; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.PopupWindow; |
| | |
| | | info = mList.get(position); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(info.getHongBaoTypePic())) { |
| | | viewHolder.ll_no_data.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_place_order_time.setVisibility(View.GONE); |
| | | viewHolder.ll_content.setVisibility(View.GONE); |
| | | viewHolder.tv_no_data_hint.setGravity(Gravity.CENTER_HORIZONTAL); |
| | | info.setRewardDetail(null); |
| | | |
| | | } else { |
| | | viewHolder.ll_no_data.setVisibility(View.GONE); |
| | | |
| | | viewHolder.ll_no_data.setVisibility(View.GONE); |
| | | viewHolder.tv_place_order_time.setVisibility(View.VISIBLE); |
| | | viewHolder.ll_content.setVisibility(View.VISIBLE); |
| | | if (position == 0 || (position > 0 && !isSameDay(new Date(Long.parseLong(info.getObtainTime())), new Date(Long.parseLong(mList.get(position - 1).getObtainTime()))))) { |
| | | viewHolder.tv_place_order_time.setVisibility(View.VISIBLE); |
| | | viewHolder.ll_content.setVisibility(View.VISIBLE); |
| | | if (position == 0 || (position > 0 && !isSameDay(new Date(Long.parseLong(info.getObtainTime())), new Date(Long.parseLong(mList.get(position - 1).getObtainTime()))))) { |
| | | viewHolder.tv_place_order_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_place_order_time.setText(TimeUtils.millisToLifeString1(Long.parseLong(info.getObtainTime()))); |
| | | viewHolder.tv_place_order_time.setText(TimeUtils.millisToLifeString1(Long.parseLong(info.getObtainTime()))); |
| | | } else { |
| | | viewHolder.tv_place_order_time.setVisibility(View.GONE); |
| | | } |
| | | |
| | | GradientDrawable shopTypeBg = GradientDrawableUtil.getShopTypeBackground(mContext, info.getShopType().getBorderColor()); |
| | | viewHolder.tv_order_shop_form.setBackground(shopTypeBg); |
| | | viewHolder.tv_order_shop_form.setText(info.getShopType().getContent()); |
| | | viewHolder.tv_order_shop_form.setTextColor(Color.parseColor(info.getShopType().getColor())); |
| | | |
| | | if (info.getWeiQuanInfo() == null) { |
| | | viewHolder.ll_weiquan.setVisibility(View.GONE); |
| | | } else { |
| | | viewHolder.ll_weiquan.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_estimate_reward_original.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG); |
| | | viewHolder.tv_estimate_reward_original.setText(info.getWeiQuanInfo().getOldHongBao()); |
| | | viewHolder.tv_weiquan_money.setText(info.getWeiQuanInfo().getWqHongBao()); |
| | | } |
| | | |
| | | if (viewHolder.ll_order_img.getChildCount() > 0) |
| | | viewHolder.ll_order_img.removeAllViews(); |
| | | |
| | | TextView tv_order_type = new TextView(mContext); |
| | | tv_order_type.setTextColor(Color.WHITE); |
| | | tv_order_type.setTextSize(12); |
| | | tv_order_type.setPadding(DimenUtils.dip2px(mContext, 7), 0, DimenUtils.dip2px(mContext, 7), DimenUtils.dip2px(mContext, 1)); |
| | | tv_order_type.setGravity(Gravity.CENTER); |
| | | switch (info.getOrderOrigin()) { |
| | | //返利订单 |
| | | case 1: |
| | | tv_order_type.setBackground(GradientDrawableUtil.getOrderType(mContext, "#55BE00")); |
| | | tv_order_type.setText("返利订单"); |
| | | break; |
| | | //分享订单 |
| | | case 2: |
| | | tv_order_type.setBackground(GradientDrawableUtil.getOrderType(mContext, "#3BAEFF")); |
| | | tv_order_type.setText("分享订单"); |
| | | break; |
| | | //邀请订单 |
| | | case 3: |
| | | tv_order_type.setBackground(GradientDrawableUtil.getOrderType(mContext, "#BC34FB")); |
| | | tv_order_type.setText("邀请订单"); |
| | | break; |
| | | } |
| | | viewHolder.ll_order_img.addView(tv_order_type); |
| | | |
| | | viewHolder.tv_order_state.setText(info.getOrderState().getContent()); |
| | | viewHolder.tv_order_state.setTextColor(Color.parseColor(info.getOrderState().getFontColor())); |
| | | viewHolder.tv_order_state.setVisibility(View.GONE); |
| | | if (viewHolder.ll_goods_info.getChildCount() > 0) |
| | | viewHolder.ll_goods_info.removeAllViews(); |
| | | for (int i = 0; i < info.getListOrderGoods().size(); i++) { |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_filter_order_goods, null); |
| | | ImageView iv_goods_img = view.findViewById(R.id.iv_goods_img); |
| | | TextView tv_goods_title = view.findViewById(R.id.tv_goods_title); |
| | | TextView tv_goods_consume = view.findViewById(R.id.tv_goods_consume); |
| | | TextView tv_goods_num = view.findViewById(R.id.tv_goods_num); |
| | | TextView tv_order_time = view.findViewById(R.id.tv_order_time); |
| | | TextView tv_pay_state = view.findViewById(R.id.tv_pay_state); |
| | | ImageView iv_goods_img_cover = view.findViewById(R.id.iv_goods_img_cover); |
| | | final OrderGoods oInfo = info.getListOrderGoods().get(i); |
| | | tv_goods_consume.setText(oInfo.getActualPay()); |
| | | tv_goods_num.setText(oInfo.getActualCount()); |
| | | if (info.getOrderOrigin() == 3) { |
| | | Glide |
| | | .with(mContext) |
| | | .load(oInfo.getPicture()) |
| | | .apply(new RequestOptions() |
| | | .transform(new CenterCrop() { |
| | | @Override |
| | | protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) { |
| | | Bitmap bitmap = super.transform(pool, toTransform, outWidth, outHeight); |
| | | return BlurBitmapUtil.instance().blurBitmap(mContext, bitmap, 20, (int) (outWidth * 0.5), (int) (outHeight * 0.5)); |
| | | } |
| | | })) |
| | | .into(iv_goods_img); |
| | | |
| | | iv_goods_img_cover.setVisibility(View.VISIBLE); |
| | | tv_goods_title.setPadding(DimenUtils.dip2px(mContext, 5), |
| | | DimenUtils.dip2px(mContext, 5), |
| | | DimenUtils.dip2px(mContext, 5), |
| | | DimenUtils.dip2px(mContext, 5)); |
| | | tv_goods_title.setMaxLines(1); |
| | | tv_goods_title.setEllipsize(TextUtils.TruncateAt.END); |
| | | tv_goods_title.setText(oInfo.getGoodsTitle().getContent()); |
| | | tv_goods_title.setTextColor(Color.parseColor(oInfo.getGoodsTitle().getFontColor())); |
| | | tv_goods_title.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.shape_order_goods_title_bg)); |
| | | } else { |
| | | viewHolder.tv_place_order_time.setVisibility(View.GONE); |
| | | } |
| | | |
| | | GradientDrawable shopTypeBg = GradientDrawableUtil.getShopTypeBackground(mContext, info.getShopType().getBorderColor()); |
| | | viewHolder.tv_order_shop_form.setBackground(shopTypeBg); |
| | | viewHolder.tv_order_shop_form.setText(info.getShopType().getContent()); |
| | | viewHolder.tv_order_shop_form.setTextColor(Color.parseColor(info.getShopType().getColor())); |
| | | |
| | | if (info.getWeiQuanInfo() == null) { |
| | | viewHolder.ll_weiquan.setVisibility(View.GONE); |
| | | } else { |
| | | viewHolder.ll_weiquan.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_estimate_reward_original.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG); |
| | | viewHolder.tv_estimate_reward_original.setText(info.getWeiQuanInfo().getOldHongBao()); |
| | | viewHolder.tv_weiquan_money.setText(info.getWeiQuanInfo().getWqHongBao()); |
| | | } |
| | | |
| | | if (viewHolder.ll_order_img.getChildCount() > 0) |
| | | viewHolder.ll_order_img.removeAllViews(); |
| | | |
| | | if (info.getSignList().size() > 0) { |
| | | for (int i = 0; i < info.getSignList().size(); i++) { |
| | | ImageView iv_order_type = new ImageView(mContext); |
| | | LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT); |
| | | params1.gravity = Gravity.CENTER; |
| | | params1.rightMargin = 8; |
| | | // params1.setMargins(DimenUtils.dip2px(mContext, 8), 0, 0, 0); |
| | | iv_order_type.setLayoutParams(params1); |
| | | Glide.with(mContext).load(info.getSignList().get(i)).into(iv_order_type); |
| | | viewHolder.ll_order_img.addView(iv_order_type); |
| | | } |
| | | } |
| | | |
| | | viewHolder.tv_order_state.setText(info.getOrderState().getContent()); |
| | | viewHolder.tv_order_state.setTextColor(Color.parseColor(info.getOrderState().getFontColor())); |
| | | if (viewHolder.ll_goods_info.getChildCount() > 0) |
| | | viewHolder.ll_goods_info.removeAllViews(); |
| | | for (int i = 0; i < info.getListOrderGoods().size(); i++) { |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_filter_order_goods, null); |
| | | ImageView iv_goods_img = view.findViewById(R.id.iv_goods_img); |
| | | TextView tv_goods_title = view.findViewById(R.id.tv_goods_title); |
| | | TextView tv_goods_consume = view.findViewById(R.id.tv_goods_consume); |
| | | TextView tv_goods_num = view.findViewById(R.id.tv_goods_num); |
| | | ImageView iv_goods_img_cover = view.findViewById(R.id.iv_goods_img_cover); |
| | | final OrderGoods oInfo = info.getListOrderGoods().get(i); |
| | | tv_goods_consume.setText(oInfo.getActualPay()); |
| | | tv_goods_num.setText(oInfo.getActualCount()); |
| | | if (info.getOrderOrigin() == 3) { |
| | | Glide |
| | | .with(mContext) |
| | | .load(oInfo.getPicture()) |
| | | .apply(new RequestOptions() |
| | | .transform(new CenterCrop() { |
| | | @Override |
| | | protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) { |
| | | Bitmap bitmap = super.transform(pool, toTransform, outWidth, outHeight); |
| | | return BlurBitmapUtil.instance().blurBitmap(mContext, bitmap, 20, (int) (outWidth * 0.5), (int) (outHeight * 0.5)); |
| | | } |
| | | })) |
| | | .into(iv_goods_img); |
| | | |
| | | iv_goods_img_cover.setVisibility(View.VISIBLE); |
| | | tv_goods_title.setPadding(DimenUtils.dip2px(mContext, 5), |
| | | DimenUtils.dip2px(mContext, 5), |
| | | DimenUtils.dip2px(mContext, 5), |
| | | DimenUtils.dip2px(mContext, 5)); |
| | | tv_goods_title.setMaxLines(1); |
| | | tv_goods_title.setEllipsize(TextUtils.TruncateAt.END); |
| | | tv_goods_title.setText(oInfo.getGoodsTitle().getContent()); |
| | | tv_goods_title.setTextColor(Color.parseColor(oInfo.getGoodsTitle().getFontColor())); |
| | | tv_goods_title.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.shape_order_goods_title_bg)); |
| | | } else { |
| | | Glide.with(mContext).load(oInfo.getPicture()).into(iv_goods_img); |
| | | iv_goods_img_cover.setVisibility(View.GONE); |
| | | tv_goods_title.setPadding(0, 0, 0, 0); |
| | | tv_goods_title.setText(oInfo.getTitle()); |
| | | view.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | UserCustomEvent.userOrderGoodsdetail(mContext); |
| | | |
| | | if (StringUtils.isEmpty(oInfo.getGoodsId())||"0".equalsIgnoreCase(oInfo.getGoodsId())) { |
| | | return; |
| | | } |
| | | |
| | | Intent intent= new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", oInfo.getGoodsId()); |
| | | intent.putExtra("goodsType", oInfo.getGoodsType()); |
| | | |
| | | intent.putExtra("title", oInfo.getTitle()); |
| | | intent.putExtra("id", oInfo.getGoodsId()); |
| | | intent.putExtra("from", "order"); |
| | | if (!StringUtils.isEmpty(oInfo.getGoodsId())) |
| | | mContext.startActivity(intent); |
| | | } |
| | | }); |
| | | } |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( |
| | | ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | int topMargin = DimenUtils.dip2px(mContext, 5); |
| | | int bottomMargin = DimenUtils.dip2px(mContext, 5); |
| | | if (info.getListOrderGoods().size() == 1) { |
| | | topMargin = 0; |
| | | bottomMargin = 0; |
| | | } else if (info.getListOrderGoods().size() > 1 && i == 0) { |
| | | topMargin = 0; |
| | | } else if (info.getListOrderGoods().size() > 1 && |
| | | i == info.getListOrderGoods().size() - 1) { |
| | | bottomMargin = 0; |
| | | } |
| | | params.topMargin = topMargin; |
| | | params.bottomMargin = bottomMargin; |
| | | view.setLayoutParams(params); |
| | | viewHolder.ll_goods_info.addView(view); |
| | | } |
| | | String orderNo = info.getOrderNo().replaceAll(" ", ""); |
| | | viewHolder.tv_copy.setVisibility(orderNo.endsWith("*") ? View.GONE : View.VISIBLE); |
| | | viewHolder.tv_order_num.setText("订单号:" + info.getOrderNo()); |
| | | viewHolder.tv_order_time.setText(info.getDownTime()); |
| | | if (StringUtils.isEmpty(info.getReceiveTime())) { |
| | | viewHolder.tv_take_over_time.setVisibility(View.GONE); |
| | | } else { |
| | | viewHolder.tv_take_over_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_take_over_time.setText(info.getReceiveTime()); |
| | | } |
| | | if (!StringUtils.isEmpty(info.getOrderDesc())) { |
| | | viewHolder.tv_vip_info.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_vip_info.setText(info.getOrderDesc()); |
| | | } else { |
| | | viewHolder.tv_vip_info.setVisibility(View.GONE); |
| | | } |
| | | if (info.getRewardDetail() == null && StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.GONE); |
| | | } else if (info.getRewardDetail() == null && !StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail.setVisibility(View.GONE); |
| | | viewHolder.tv_arrived_account_time.setText(info.getHongBaoDate()); |
| | | } else if (info.getRewardDetail() != null && !StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setText(info.getHongBaoDate()); |
| | | |
| | | } else if (info.getRewardDetail() != null && StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setVisibility(View.GONE); |
| | | } |
| | | |
| | | if (info.getRewardDetail() != null) { |
| | | viewHolder.tv_order_detailtxt.setText(info.getRewardDetail().getText().getContent()); |
| | | viewHolder.tv_order_detailtxt.setTextColor(Color.parseColor(info.getRewardDetail().getText().getColor())); |
| | | viewHolder.tv_order_detail.setOnClickListener(new View.OnClickListener() { |
| | | Glide.with(mContext).load(oInfo.getPicture()).into(iv_goods_img); |
| | | iv_goods_img_cover.setVisibility(View.GONE); |
| | | tv_goods_title.setPadding(0, 0, 0, 0); |
| | | tv_goods_title.setText(oInfo.getTitle()); |
| | | view.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (info.getRewardDetail().getJump() != null) |
| | | if (info.getRewardDetail().getJump().getType() == 1) { |
| | | JumpActivityUtil.jumpActivity(mContext, info.getRewardDetail().getJump().getJumpDetail(), |
| | | info.getRewardDetail().getJump().getParams()); |
| | | } else if (info.getRewardDetail().getJump().getType() == 2) { |
| | | getGoodsCouponList(info); |
| | | } |
| | | UserCustomEvent.userOrderGoodsdetail(mContext); |
| | | |
| | | if (StringUtils.isEmpty(oInfo.getGoodsId()) || "0".equalsIgnoreCase(oInfo.getGoodsId())) { |
| | | return; |
| | | } |
| | | |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", oInfo.getGoodsId()); |
| | | intent.putExtra("goodsType", oInfo.getGoodsType()); |
| | | |
| | | intent.putExtra("title", oInfo.getTitle()); |
| | | intent.putExtra("id", oInfo.getGoodsId()); |
| | | intent.putExtra("from", "order"); |
| | | if (!StringUtils.isEmpty(oInfo.getGoodsId())) |
| | | mContext.startActivity(intent); |
| | | } |
| | | }); |
| | | if (info.getRewardDetail().getTicking() != null) {//显示使用奖励券 倒计时 |
| | | viewHolder.tv_order_detail1.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail2.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail3.setVisibility(View.VISIBLE); |
| | | if (info.getRewardDetail().getTicking().get(0) != null) { |
| | | viewHolder.tv_order_detail1.setText(info.getRewardDetail().getTicking().get(0).getContent()); |
| | | viewHolder.tv_order_detail1.setTextColor(Color.parseColor(info.getRewardDetail().getTicking().get(0).getColor())); |
| | | float size = 10 * Float.parseFloat(info.getRewardDetail().getTicking().get(0).getFontSize()); |
| | | viewHolder.tv_order_detail1.setTextSize(size); |
| | | } |
| | | |
| | | if (info.getRewardDetail().getTicking().get(1) != null) { |
| | | viewHolder.tv_order_detail2.setText(info.getRewardDetail().getTicking().get(1).getContent()); |
| | | viewHolder.tv_order_detail2.setTextColor(Color.parseColor(info.getRewardDetail().getTicking().get(1).getColor())); |
| | | float size = 10 * Float.parseFloat(info.getRewardDetail().getTicking().get(1).getFontSize()); |
| | | viewHolder.tv_order_detail2.setTextSize(size); |
| | | viewHolder.tv_order_detail2.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); |
| | | } |
| | | |
| | | if (info.getRewardDetail().getTicking().get(2) != null) { |
| | | viewHolder.tv_order_detail3.setText(info.getRewardDetail().getTicking().get(2).getContent()); |
| | | viewHolder.tv_order_detail3.setTextColor(Color.parseColor(info.getRewardDetail().getTicking().get(2).getColor())); |
| | | float size = 10 * Float.parseFloat(info.getRewardDetail().getTicking().get(2).getFontSize()); |
| | | viewHolder.tv_order_detail3.setTextSize(size); |
| | | } |
| | | } else { |
| | | viewHolder.tv_order_detail1.setVisibility(View.GONE); |
| | | viewHolder.tv_order_detail2.setVisibility(View.GONE); |
| | | viewHolder.tv_order_detail3.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | viewHolder.tv_estimate_reward.setText(info.getHongBaoInfo().getContent());//奖金 |
| | | viewHolder.tv_estimate_reward.setTextColor(Color.parseColor(info.getHongBaoInfo().getFontColor())); |
| | | viewHolder.tv_reward_state.setText(info.getAccountState().getContent());//到账状态 |
| | | viewHolder.tv_reward_state.setTextColor(Color.parseColor(info.getAccountState().getFontColor())); |
| | | if (!StringUtils.isEmpty(info.getRebateLink())) {//能进入订单详情 |
| | | viewHolder.tv_estimate_in.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_estimate_in.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (!StringUtils.isEmpty(info.getRebateLink())) |
| | | mContext.startActivity(new Intent(mContext, ShareBrowserActivity.class).putExtra("url", info.getRebateLink())); |
| | | } |
| | | }); |
| | | tv_order_time.setText("下单时间:" + oInfo.getPlaceOrderTime()); |
| | | tv_pay_state.setText(oInfo.getPayState()); |
| | | |
| | | viewHolder.tv_estimate_reward.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (!StringUtils.isEmpty(info.getRebateLink())) |
| | | mContext.startActivity(new Intent(mContext, ShareBrowserActivity.class).putExtra("url", info.getRebateLink())); |
| | | } |
| | | }); |
| | | } else {//不能进入订单详情 |
| | | viewHolder.tv_estimate_in.setVisibility(View.GONE); |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( |
| | | ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | int topMargin = DimenUtils.dip2px(mContext, 5); |
| | | int bottomMargin = DimenUtils.dip2px(mContext, 5); |
| | | if (info.getListOrderGoods().size() == 1) { |
| | | topMargin = 0; |
| | | bottomMargin = 0; |
| | | } else if (info.getListOrderGoods().size() > 1 && i == 0) { |
| | | topMargin = 0; |
| | | } else if (info.getListOrderGoods().size() > 1 && |
| | | i == info.getListOrderGoods().size() - 1) { |
| | | bottomMargin = 0; |
| | | } |
| | | viewHolder.tv_copy.setOnClickListener(new View.OnClickListener() { |
| | | params.topMargin = topMargin; |
| | | params.bottomMargin = bottomMargin; |
| | | view.setLayoutParams(params); |
| | | viewHolder.ll_goods_info.addView(view); |
| | | } |
| | | |
| | | String orderNo = info.getOrderNo().replaceAll(" ", ""); |
| | | viewHolder.tv_copy.setVisibility(orderNo.endsWith("*") ? View.GONE : View.VISIBLE); |
| | | viewHolder.tv_order_num.setText("订单号:" + info.getOrderNo()); |
| | | viewHolder.tv_order_time.setText(info.getDownTime()); |
| | | viewHolder.tv_order_time.setVisibility(View.GONE); |
| | | if (StringUtils.isEmpty(info.getReceiveTime())) { |
| | | viewHolder.tv_take_over_time.setVisibility(View.GONE); |
| | | } else { |
| | | viewHolder.tv_take_over_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_take_over_time.setText(info.getReceiveTime()); |
| | | } |
| | | if (!StringUtils.isEmpty(info.getOrderDesc())) { |
| | | viewHolder.tv_vip_info.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_vip_info.setText(info.getOrderDesc()); |
| | | } else { |
| | | viewHolder.tv_vip_info.setVisibility(View.GONE); |
| | | } |
| | | if (info.getRewardDetail() == null && StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.GONE); |
| | | } else if (info.getRewardDetail() == null && !StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail.setVisibility(View.GONE); |
| | | viewHolder.tv_arrived_account_time.setText(info.getHongBaoDate()); |
| | | } else if (info.getRewardDetail() != null && !StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setText(info.getHongBaoDate()); |
| | | |
| | | } else if (info.getRewardDetail() != null && StringUtils.isEmpty(info.getHongBaoDate())) { |
| | | viewHolder.fl_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_arrived_account_time.setVisibility(View.GONE); |
| | | } |
| | | |
| | | if (info.getRewardDetail() != null) { |
| | | viewHolder.tv_order_detailtxt.setText(info.getRewardDetail().getText().getContent()); |
| | | viewHolder.tv_order_detailtxt.setTextColor(Color.parseColor(info.getRewardDetail().getText().getColor())); |
| | | viewHolder.tv_order_detail.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | UserCustomEvent.userOrderCopyOrderId(mContext); |
| | | ClipboardUtil.copy(mContext, info.getOrderNo()); |
| | | |
| | | Toast.makeText(mContext, "复制订单成功", |
| | | Toast.LENGTH_SHORT).show(); |
| | | if (info.getRewardDetail().getJump() != null) |
| | | if (info.getRewardDetail().getJump().getType() == 1) { |
| | | JumpActivityUtil.jumpActivity(mContext, info.getRewardDetail().getJump().getJumpDetail(), |
| | | info.getRewardDetail().getJump().getParams()); |
| | | } else if (info.getRewardDetail().getJump().getType() == 2) { |
| | | getGoodsCouponList(info); |
| | | } |
| | | } |
| | | }); |
| | | if (info.getRewardDetail().getTicking() != null) {//显示使用奖励券 倒计时 |
| | | viewHolder.tv_order_detail1.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail2.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_order_detail3.setVisibility(View.VISIBLE); |
| | | if (info.getRewardDetail().getTicking().get(0) != null) { |
| | | viewHolder.tv_order_detail1.setText(info.getRewardDetail().getTicking().get(0).getContent()); |
| | | viewHolder.tv_order_detail1.setTextColor(Color.parseColor(info.getRewardDetail().getTicking().get(0).getColor())); |
| | | float size = 10 * Float.parseFloat(info.getRewardDetail().getTicking().get(0).getFontSize()); |
| | | viewHolder.tv_order_detail1.setTextSize(size); |
| | | } |
| | | |
| | | if (info.getRewardDetail().getTicking().get(1) != null) { |
| | | viewHolder.tv_order_detail2.setText(info.getRewardDetail().getTicking().get(1).getContent()); |
| | | viewHolder.tv_order_detail2.setTextColor(Color.parseColor(info.getRewardDetail().getTicking().get(1).getColor())); |
| | | float size = 10 * Float.parseFloat(info.getRewardDetail().getTicking().get(1).getFontSize()); |
| | | viewHolder.tv_order_detail2.setTextSize(size); |
| | | viewHolder.tv_order_detail2.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); |
| | | } |
| | | |
| | | if (info.getRewardDetail().getTicking().get(2) != null) { |
| | | viewHolder.tv_order_detail3.setText(info.getRewardDetail().getTicking().get(2).getContent()); |
| | | viewHolder.tv_order_detail3.setTextColor(Color.parseColor(info.getRewardDetail().getTicking().get(2).getColor())); |
| | | float size = 10 * Float.parseFloat(info.getRewardDetail().getTicking().get(2).getFontSize()); |
| | | viewHolder.tv_order_detail3.setTextSize(size); |
| | | } |
| | | } else { |
| | | viewHolder.tv_order_detail1.setVisibility(View.GONE); |
| | | viewHolder.tv_order_detail2.setVisibility(View.GONE); |
| | | viewHolder.tv_order_detail3.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | int startIndex = info.getHongBaoInfo().getContent().indexOf("¥"); |
| | | Spannable span = new SpannableString(info.getHongBaoInfo().getContent()); |
| | | span.setSpan(new RelativeSizeSpan(1.667f), startIndex + 1, info.getHongBaoInfo().getContent().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | viewHolder.tv_estimate_reward.setText(span);//奖金 |
| | | // viewHolder.tv_estimate_reward.setTextColor(Color.parseColor(info.getHongBaoInfo().getFontColor())); |
| | | |
| | | |
| | | viewHolder.tv_reward_state.setText(info.getAccountState().getContent());//到账状态 |
| | | // viewHolder.tv_reward_state.setTextColor(Color.parseColor(info.getAccountState().getFontColor())); |
| | | // if (!StringUtils.isEmpty(info.getRebateLink())) {//能进入订单详情 |
| | | // viewHolder.tv_estimate_in.setVisibility(View.VISIBLE); |
| | | // viewHolder.tv_estimate_in.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View view) { |
| | | // if (!StringUtils.isEmpty(info.getRebateLink())) |
| | | // mContext.startActivity(new Intent(mContext, ShareBrowserActivity.class).putExtra("url", info.getRebateLink())); |
| | | // } |
| | | // }); |
| | | // |
| | | // viewHolder.tv_estimate_reward.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View view) { |
| | | // if (!StringUtils.isEmpty(info.getRebateLink())) |
| | | // mContext.startActivity(new Intent(mContext, ShareBrowserActivity.class).putExtra("url", info.getRebateLink())); |
| | | // } |
| | | // }); |
| | | // } else {//不能进入订单详情 |
| | | // viewHolder.tv_estimate_in.setVisibility(View.GONE); |
| | | // } |
| | | |
| | | viewHolder.tv_estimate_in.setVisibility(View.GONE); |
| | | viewHolder.tv_copy.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | UserCustomEvent.userOrderCopyOrderId(mContext); |
| | | ClipboardUtil.copy(mContext, info.getOrderNo()); |
| | | |
| | | Toast.makeText(mContext, "复制订单成功", |
| | | Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |