|
1 | 1 | package com.stone.pile.activity; |
2 | 2 |
|
3 | 3 | import android.content.Context; |
| 4 | +import android.util.Log; |
4 | 5 | import android.view.LayoutInflater; |
5 | 6 | import android.view.View; |
6 | 7 | import android.view.ViewGroup; |
7 | 8 | import android.widget.ImageView; |
8 | 9 | import android.widget.Toast; |
9 | 10 |
|
10 | 11 | import com.bumptech.glide.Glide; |
| 12 | +import com.google.gson.Gson; |
11 | 13 | import com.stone.pile.R; |
12 | 14 | import com.stone.pile.entity.ItemEntity; |
13 | 15 | import com.uis.stackview.StackViewLayout; |
@@ -46,7 +48,7 @@ public int getItemViewType(int position) { |
46 | 48 |
|
47 | 49 | @Override |
48 | 50 | public int getItemCount() { |
49 | | - return 20; |
| 51 | + return 3; |
50 | 52 | } |
51 | 53 |
|
52 | 54 | private ArrayList<ItemEntity> initDataList(Context context) { |
@@ -99,10 +101,10 @@ public void bindView(View view, int position) { |
99 | 101 | ViewHolder viewHolder = (ViewHolder) view.getTag(); |
100 | 102 | if (viewHolder == null) { |
101 | 103 | viewHolder = new ViewHolder(); |
102 | | - viewHolder.imageView = (ImageView) view.findViewById(R.id.imageView); |
| 104 | + viewHolder.imageView = view.findViewById(R.id.imageView); |
103 | 105 | view.setTag(viewHolder); |
104 | 106 | } |
105 | | - |
| 107 | + //Log.e("xx","binderVH: " + position + ",data: " + new Gson().toJson(dataList.get(position))); |
106 | 108 | Glide.with(itemView.getContext()) |
107 | 109 | .load(dataList.get(position).getCoverImageUrl()).into(viewHolder.imageView); |
108 | 110 | } |
|
0 commit comments