admin
2021-06-05 ddff7888bf7e754d12fb5fc85a58f3012f456490
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
package com.tejia.lijin.app.ui.recommend;
 
import android.content.Context;
import androidx.databinding.BindingAdapter;
import androidx.databinding.DataBindingUtil;
import android.graphics.Paint;
import android.graphics.Typeface;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.RelativeSizeSpan;
import android.text.style.StyleSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
 
import com.bumptech.glide.Glide;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.wpc.library.util.common.DimenUtils;
import com.tejia.lijin.app.R;
import com.tejia.lijin.app.databinding.ItemRecomendCategoryGoodsDatabindingBinding;
import com.tejia.lijin.app.entity.TaoBaoGoodsBrief;
import com.tejia.lijin.app.util.GlideRoundTransform;
 
import java.util.List;
 
/**
 * Created by weikou2015 on 2017/12/5.
 * 首页推荐商品
 */
 
public class RecommendGoodsAdapterBinding extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private RecyclerView mRecyclerView;
 
    private List<TaoBaoGoodsBrief> mList;
    private RecommendFragment mFragment;
    private Context mContext;
 
    private View VIEW_FOOTER;
    private View VIEW_HEADER;
 
    //Type
    private int TYPE_NORMAL = 1000;
    private int TYPE_HEADER = 1001;
    public int TYPE_FOOTER = 1002;
    public int TYPE_PLATFORM = 1003;
 
    private DisplayImageOptions options;
    private String mFrom;
    int goodsType = 1;
 
    public RecommendGoodsAdapterBinding(RecommendFragment fragment, List<TaoBaoGoodsBrief> list, String from) {
        this.mList = list;
        this.mFragment = fragment;
        this.mContext = fragment.getContext();
        this.mFrom = from;
        this.options = new DisplayImageOptions.Builder()
                .showImageForEmptyUri(R.drawable.ic_goods_default)
                .showImageOnFail(R.drawable.ic_goods_default)
                .showImageOnLoading(R.drawable.ic_goods_default)
                .resetViewBeforeLoading(true).cacheInMemory(true)
                .cacheOnDisk(true).imageScaleType(ImageScaleType.EXACTLY)
                .considerExifParams(true)
                .displayer(new RoundedBitmapDisplayer(DimenUtils
                        .dip2px(mContext, 5))).build();
    }
 
 
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == TYPE_FOOTER) {
            return new ViewHolderPlatform(VIEW_FOOTER);
        } else if (viewType == TYPE_HEADER) {
            return new ViewHolderPlatform(VIEW_HEADER);
        } else if (viewType == TYPE_PLATFORM) {
            View view = LayoutInflater.from(mContext).inflate(R.layout.item_recommend_platform, parent, false);
            ViewHolderPlatform holder = new ViewHolderPlatform(view);
            return holder;
        } else {
            ItemRecomendCategoryGoodsDatabindingBinding item = DataBindingUtil.inflate(LayoutInflater.from(mContext),
                    R.layout.item_recomend_category_goods_databinding, parent, false);
//            View view = LayoutInflater.from(mContext).inflate(R.layout.item_recomend_category_goods_databinding, parent, false);
            BindingViewHolder holder = new BindingViewHolder(item.getRoot());
            return holder;
        }
    }
 
    //图片展示  头像展示
    @BindingAdapter({"imageUrl"})
    public static void loadGoodsImg(ImageView view, String url) {
        Glide.with(view.getContext()).load(url).transform(new GlideRoundTransform(view.getContext(), 5)).into(view);
    }
 
    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder1, int position) {
        if (!isHeaderView(position) && !isFooterView(position)) {
            final TaoBaoGoodsBrief info;
            if (haveHeaderView()) {
                info = mList.get(position - 1);
            } else if (haveFooterView() && ((haveHeaderView() && position == mList.size() + 1) ||
                    !haveHeaderView() && position == mList.size())) {
                return;
            } else {
                info = mList.get(position);
            }
 
            if (position == 1) {
                final ViewHolderPlatform holder = (ViewHolderPlatform) holder1;
                clickState(holder.tv_recommend_taobao, holder.v_recommend_taobao, holder.tv_recommend_jingdong, holder.v_recommend_jingdong
                        , holder.tv_recommend_pinduoduo, holder.v_recommend_pinduoduo, false);
                holder.fl_recommend_taobao.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        goodsType = 1;
                        clickState(holder.tv_recommend_taobao, holder.v_recommend_taobao, holder.tv_recommend_jingdong, holder.v_recommend_jingdong
                                , holder.tv_recommend_pinduoduo, holder.v_recommend_pinduoduo, true);
                    }
                });
                holder.fl_recommend_jingdong.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        goodsType = 2;
                        clickState(holder.tv_recommend_taobao, holder.v_recommend_taobao, holder.tv_recommend_jingdong, holder.v_recommend_jingdong
                                , holder.tv_recommend_pinduoduo, holder.v_recommend_pinduoduo, true);
                    }
                });
                holder.fl_recommend_pinduoduo.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        goodsType = 3;
                        clickState(holder.tv_recommend_taobao, holder.v_recommend_taobao, holder.tv_recommend_jingdong, holder.v_recommend_jingdong
                                , holder.tv_recommend_pinduoduo, holder.v_recommend_pinduoduo, true);
                    }
                });
            } else {
                BindingViewHolder holder = (BindingViewHolder) holder1;
                ItemRecomendCategoryGoodsDatabindingBinding binding = DataBindingUtil.
                        getBinding(holder.itemView);
                binding.setInfo(info);
                String disCount;
                if (info.isHasCoupon()) {
                    binding.llCouponBg1.setVisibility(View.VISIBLE);
                    disCount = "¥ " + info.getCouponPrice();
//                    holder.tv_coupon_price1.setText("¥ " + info.getCouponInfo().getAmount());
                } else {
                    disCount = "¥ " + info.getZkPrice();
                    binding.llCouponBg1.setVisibility(View.GONE);
                }
                final int pos = disCount.indexOf(".");
                Spannable span = new SpannableString(disCount);
                span.setSpan(new RelativeSizeSpan(1.4f), 1, pos > 1 ? pos : disCount.length(),
                        Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                span.setSpan(new StyleSpan(Typeface.BOLD), 1, disCount.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                binding.tvPrice1.setText(span);
                binding.tvNormalPrice1.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
                binding.tvSaleNum1.setText("月销 " + info.getSalesCount());
            }
//            {
//                ViewHolder holder = (ViewHolder) holder1;
//                holder.ll_item1.setVisibility(View.VISIBLE);
//                holder.v_left.setVisibility(View.GONE);
//
//                boolean isTop = info.getOtherInfo() == null ? false :
//                        info.getOtherInfo().getReduceHongBao() == null ? false : true;
//                holder.ll_selfbuy_and_reduction.setVisibility(isTop ? View.VISIBLE : View.GONE);
//                holder.tv_favourable1.setVisibility(isTop ? View.GONE : View.VISIBLE);
//                holder.tv_share_red_packet.setVisibility(isTop ? View.VISIBLE : View.GONE);
//
//                if (isTop) {
//                    holder.tv_surplus_num.setText("余 " + info.getOtherInfo().getReduceHongBao().getLeft());
//                    BigDecimal apply = new BigDecimal(info.getOtherInfo().getReduceHongBao().getTotal() -
//                            info.getOtherInfo().getReduceHongBao().getLeft());
//                    BigDecimal total = new BigDecimal(info.getOtherInfo().getReduceHongBao().getTotal());
//                    BigDecimal scale = apply.divide(total, 2, RoundingMode.HALF_UP);
//                    BigDecimal value = scale.multiply(new BigDecimal(100));
//                    holder.pb_selfbuy_and_reduction.setProgress(value.intValue());
//                    holder.tv_share_red_packet.setText(info.getOtherInfo().getReduceHongBao().getName()
//                            + info.getOtherInfo().getReduceHongBao().getMoney());
//                }
//                holder.ll_tab.setVisibility(info.getPictureTag() == null ? View.GONE : View.VISIBLE);
//                if (info.getPictureTag() != null) {
//                    GradientDrawable drawable = new GradientDrawable();
//                    drawable.setCornerRadii(new float[]{DimenUtils.dip2px(mContext, 5),
//                            DimenUtils.dip2px(mContext, 5), 0, 0, 0, 0, 0, 0});
//                    drawable.setColor(Color.parseColor(info.getPictureTag().getBottomColor()));
//                    holder.ll_tab.setBackgroundDrawable(drawable);
//                    holder.tv_tab.setText(info.getPictureTag().getContent());
//                    holder.tv_tab.setTextColor(Color.parseColor(info.getPictureTag().getColor()));
//                }
//
//                if (info.getLabels() != null && info.getLabels().size() > 0) {
//                    holder.ll_labels.setVisibility(View.VISIBLE);
//                    holder.ll_labels.removeAllViews();
//                    SetLabels.addLabel(mContext, holder.ll_labels,
//                            info.getLabels());
//                } else {
//                    holder.ll_labels.setVisibility(View.GONE);
//                }
//
//                ImageUtil.showImageFace(mContext, info.getTitle(), info.getShopType(), holder.tv_name1);
//
//                holder.tv_normal_price1.setText("¥" + info.getZkPrice());
//                holder.tv_normal_price1.setPaintFlags(holder.tv_normal_price1.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
//                // 图片
////            Glide.with(mContext).load(info.getPictUrl()).
////                    placeholder(R.drawable.ic_goods_default).error(R.drawable.ic_goods_default).
////                    transform(new GlideRoundTransform(mContext, 5)).into(holder.iv_pic1);
//                ImageLoader.getInstance().displayImage(info.getPicUrl(), holder.iv_pic1, options);
//                holder.ll_shop1.setVisibility(View.GONE);
//                holder.tv_price1.setTextColor(mContext.getResources().getColor(R.color.main_text_color));
//                if (info.getMoneyInfo().getMoneyType() == 1) {
//                    holder.tv_favourable1.setBackgroundResource(R.drawable.shape_goods_list_price_fan);
//                    holder.tv_favourable1.setText("返 " + info.getMoneyInfo().getFanliMoney());
//                } else {
//                    holder.tv_favourable1.setBackgroundResource(R.drawable.shape_goods_list_price_reward);
//                    holder.tv_favourable1.setText("奖 " + info.getMoneyInfo().getFanliMoney());
//                }
//                String disCount;
//                if (info.isHasCoupon()) {
//                    holder.ll_coupon_bg1.setVisibility(View.VISIBLE);
//                    disCount = "¥" + info.getCouponPrice();
//                    holder.tv_coupon_price1.setText("¥ " + info.getCouponInfo().getAmount());
//                } else {
//                    disCount = "¥" + info.getZkPrice();
//                    holder.ll_coupon_bg1.setVisibility(View.GONE);
//                }
//
//                final int pos = disCount.indexOf(".");
//                Spannable span = new SpannableString(disCount);
//                span.setSpan(new RelativeSizeSpan(1.4f), 1, pos > 1 ? pos : disCount.length(),
//                        Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
////            span.setSpan(new StyleSpan(Typeface.BOLD), 1, disCount.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//                holder.tv_price1.setText(span);
//
//                holder.tv_sale_num1.setTextColor((info.getSalesType() == 1 || info.getSalesType() == 4) ?
//                        mContext.getResources().getColor(R.color.gray5) : info.getSalesType() == 2 ?
//                        mContext.getResources().getColor(R.color.goods_sale_num_text_color_orange) :
//                        mContext.getResources().getColor(R.color.goods_sale_num_text_color_blue));
//                holder.tv_sale_num1.setText(info.getSalesType() == 1 ? "月销 " + info.getSalesCount() :
//                        info.getSalesType() == 2 ? "2小时销量 " + info.getSalesCount() : info.getSalesType() == 3 ?
//                                "今日销量 " + info.getSalesCount() : "总销量 " + info.getSalesCount());
//                holder.iv_close.setVisibility(info.isRecommend() ? View.VISIBLE : View.GONE);
//
//                holder.ll_item1.setOnClickListener(new View.OnClickListener() {
//                    @Override
//                    public void onClick(View v) {
//                        Intent intent;
//                        if ((mFrom.equalsIgnoreCase("jingxuan") && info.getOtherInfo() != null && info.getOtherInfo().getReduceHongBao() != null)
//                                || mFrom.equalsIgnoreCase("taolijin_buy")) {
//                            intent = new Intent(mContext, ShareExplosionsGoodsDetailActivity.class);
//                            intent.putExtra("from", "taolijin_buy");
//                        } else {
//                            if (info.getGoodsType() == 1) {
//                                intent = new Intent(mContext, GoodsDetailActivityTB.class);
//                            } else if (info.getGoodsType() == 2) {
//                                intent = new Intent(mContext, GoodsDetailActivityJD.class);
//                            } else {
//                                intent = new Intent(mContext, GoodsDetailActivityPDD.class);
//                            }
//                            intent.putExtra("from", mFrom);
//                        }
//                        intent.putExtra("title", info.getTitle());
//                        intent.putExtra("id", info.getGoodsId());
//                        mContext.startActivity(intent);
//                    }
//                });
//                holder.iv_close.setOnClickListener(new View.OnClickListener() {
//                    @Override
//                    public void onClick(View v) {
//                        SharedPreferences sp = mContext.getSharedPreferences("user", Context.MODE_PRIVATE);
//                        String delete_goods_reasons = sp.getString("delete_goods_reasons", "");
//                        List<String> reasons = null;
//                        if (!StringUtils.isEmpty(delete_goods_reasons)) {
//                            Gson gson = new GsonBuilder().serializeNulls().create();
//                            reasons = gson.fromJson(delete_goods_reasons, new TypeToken<List<String>>() {
//                            }.getType());
//                        }
//                        NotLikeGoodsDialog.Builder builder = new NotLikeGoodsDialog.Builder(mContext);
//                        builder.setGoodsId(info.getGoodsId()).setReasons(reasons)
//                                .setGoodsType(info.getGoodsType()).setPositiveButton("", new DialogInterface.OnClickListener() {
//                            @Override
//                            public void onClick(DialogInterface dialog, int which) {
//                                mList.remove(info);
//                                notifyDataSetChanged();
//                                dialog.dismiss();
//                            }
//                        }).create().show();
//
//                    }
//                });
//            }
        }
    }
 
    /**
     * 点击状态变化
     */
    private void clickState(TextView tv_recommend_taobao, View v_recommend_taobao,
                            TextView tv_recommend_jingdong, View v_recommend_jingdong,
                            TextView tv_recommend_pinduoduo, View v_recommend_pinduoduo,
                            boolean isChange) {
        tv_recommend_taobao.setTextColor(mContext.getResources().getColor
                (goodsType == 1 ? R.color.share_single_img_copy_ambush : R.color.text_black_1));
        v_recommend_taobao.setVisibility(goodsType == 1 ? View.VISIBLE : View.GONE);
        tv_recommend_taobao.setCompoundDrawablesWithIntrinsicBounds(goodsType == 1 ?
                R.drawable.ic_recommend_tb_selected :
                R.drawable.ic_recommend_tb_unselected, 0, 0, 0);
        tv_recommend_jingdong.setTextColor(mContext.getResources().getColor
                (goodsType == 2 ? R.color.red_recommend_jd : R.color.text_black_1));
        v_recommend_jingdong.setVisibility(goodsType == 2 ? View.VISIBLE : View.GONE);
        tv_recommend_jingdong.setCompoundDrawablesWithIntrinsicBounds(goodsType == 2 ?
                R.drawable.ic_recommend_jd_selected :
                R.drawable.ic_recommend_jd_unselected, 0, 0, 0);
        tv_recommend_pinduoduo.setTextColor(mContext.getResources().getColor
                (goodsType == 3 ? R.color.red_recommend_pdd : R.color.text_black_1));
        v_recommend_pinduoduo.setVisibility(goodsType == 3 ? View.VISIBLE : View.GONE);
        tv_recommend_pinduoduo.setCompoundDrawablesWithIntrinsicBounds(goodsType == 3 ?
                R.drawable.ic_recommend_pdd_selected :
                R.drawable.ic_recommend_pdd_unselected, 0, 0, 0);
        if (isChange) {
            mFragment.goodsType = goodsType;
        }
    }
 
    protected void setGoodsType(int goodsType) {
        this.goodsType = goodsType;
    }
 
    @Override
    public int getItemCount() {
        int count = (mList == null ? 0 : mList.size());
        if (VIEW_FOOTER != null) {
            count++;
        }
 
        if (VIEW_HEADER != null) {
            count++;
        }
        return count;
    }
 
    @Override
    public int getItemViewType(int position) {
        if (isHeaderView(position)) {
            return TYPE_HEADER;
        } else if (isFooterView(position)) {
            return TYPE_FOOTER;
        } else if (position == 1) {
            return TYPE_PLATFORM;
        } else {
            return TYPE_NORMAL;
        }
    }
 
    @Override
    public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        try {
            if (mRecyclerView == null && mRecyclerView != recyclerView) {
                mRecyclerView = recyclerView;
            }
            ifGridLayoutManager();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    private View getLayout(int layoutId) {
        return LayoutInflater.from(mContext).inflate(layoutId, null);
    }
 
    public void addHeaderView(View headerView) {
        if (haveHeaderView()) {
            throw new IllegalStateException("hearview has already exists!");
        } else {
            //避免出现宽度自适应
            ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            headerView.setLayoutParams(params);
            VIEW_HEADER = headerView;
            ifGridLayoutManager();
            notifyItemInserted(0);
        }
 
    }
 
    public void addFooterView(View footerView) {
        if (haveFooterView()) {
            throw new IllegalStateException("footerView has already exists!");
        } else {
            ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            footerView.setLayoutParams(params);
            VIEW_FOOTER = footerView;
            ifGridLayoutManager();
            notifyItemInserted(getItemCount() - 1);
        }
    }
 
    private void ifGridLayoutManager() {
        if (mRecyclerView == null) return;
        final RecyclerView.LayoutManager layoutManager = mRecyclerView.getLayoutManager();
        if (layoutManager instanceof GridLayoutManager) {
            ((GridLayoutManager) layoutManager).setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
                @Override
                public int getSpanSize(int position) {
                    if (isHeaderView(position) || isFooterView(position)) {
                        return ((GridLayoutManager) layoutManager).getSpanCount();
                    } else {
                        return 1;
                    }
                }
            });
        }
    }
 
    private boolean haveHeaderView() {
        return VIEW_HEADER != null;
    }
 
    public boolean haveFooterView() {
        return VIEW_FOOTER != null;
    }
 
    private boolean isHeaderView(int position) {
        return haveHeaderView() && position == 0;
    }
 
    private boolean isFooterView(int position) {
        return haveFooterView() && position >= getItemCount() - 1;
    }
 
 
    class BindingViewHolder extends RecyclerView.ViewHolder {
//        View v_left;
//        LinearLayout ll_item1;
//        LinearLayout ll_labels;
//        LinearLayout ll_coupon_bg1;
//        TextView tv_name1;
//        TextView tv_price1;
//        TextView tv_coupon_price1;
//        TextView tv_shop_name1;
//        LinearLayout ll_shop1;
//        TextView tv_normal_price1;
//        TextView tv_favourable1;//红包,券后价
//        TextView tv_sale_num1;
//        ImageView iv_pic1;
//        ImageView iv_close;
//        TextView tv_share_red_packet;
//        LinearLayout ll_selfbuy_and_reduction;
//        ProgressBar pb_selfbuy_and_reduction;
//        TextView tv_surplus_num;
//        LinearLayout ll_tab;
//        TextView tv_tab;
 
        public BindingViewHolder(View itemView) {
            super(itemView);
//            v_left = convertView.findViewById(R.id.v_left);
//            ll_item1 = convertView.findViewById(R.id.ll_horizontal_item);
//            ll_labels = convertView.findViewById(R.id.ll_labels);
//            ll_coupon_bg1 = convertView.findViewById(R.id.ll_coupon_bg1);
//            iv_pic1 = convertView
//                    .findViewById(R.id.iv_movie_cover1);
//            tv_normal_price1 = convertView
//                    .findViewById(R.id.tv_normal_price1);
//            tv_shop_name1 = convertView
//                    .findViewById(R.id.tv_shop_name1);
//            tv_name1 = convertView
//                    .findViewById(R.id.tv_movie_title1);
//            tv_price1 = convertView.findViewById(R.id.tv_price1);
//            tv_coupon_price1 = convertView.findViewById(R.id.tv_coupon_price1);
//            tv_favourable1 = convertView.findViewById(R.id.tv_favourable1);
//            tv_sale_num1 = convertView.findViewById(R.id.tv_sale_num1);
//            ll_shop1 = convertView.findViewById(R.id.ll_shop1);
//            iv_close = convertView.findViewById(R.id.iv_close);
//            tv_share_red_packet = convertView.findViewById(R.id.tv_share_red_packet);
//            ll_selfbuy_and_reduction = convertView.findViewById(R.id.ll_selfbuy_and_reduction);
//            pb_selfbuy_and_reduction = convertView.findViewById(R.id.pb_selfbuy_and_reduction);
//            tv_surplus_num = convertView.findViewById(R.id.tv_surplus_num);
//            ll_tab = convertView.findViewById(R.id.ll_tab);
//            tv_tab = convertView.findViewById(R.id.tv_tab);
        }
    }
 
    class ViewHolderPlatform extends RecyclerView.ViewHolder {
        LinearLayout ll_recommend_platform;
        FrameLayout fl_recommend_taobao, fl_recommend_jingdong, fl_recommend_pinduoduo;
        TextView tv_recommend_taobao, tv_recommend_jingdong, tv_recommend_pinduoduo;
        View v_recommend_taobao, v_recommend_jingdong, v_recommend_pinduoduo;
 
        public ViewHolderPlatform(View convertView) {
            super(convertView);
            ll_recommend_platform = convertView
                    .findViewById(R.id.ll_recommend_platform);
            fl_recommend_taobao = convertView
                    .findViewById(R.id.fl_recommend_taobao);
            fl_recommend_jingdong = convertView
                    .findViewById(R.id.fl_recommend_jingdong);
            fl_recommend_pinduoduo = convertView
                    .findViewById(R.id.fl_recommend_pinduoduo);
            tv_recommend_taobao = convertView
                    .findViewById(R.id.tv_recommend_taobao);
            tv_recommend_jingdong = convertView
                    .findViewById(R.id.tv_recommend_jingdong);
            tv_recommend_pinduoduo = convertView
                    .findViewById(R.id.tv_recommend_pinduoduo);
            v_recommend_taobao = convertView
                    .findViewById(R.id.v_recommend_taobao);
            v_recommend_jingdong = convertView
                    .findViewById(R.id.v_recommend_jingdong);
            v_recommend_pinduoduo = convertView
                    .findViewById(R.id.v_recommend_pinduoduo);
        }
    }
 
}