|
|
@@ -92,7 +92,7 @@ public class PhotoStaggeredAdapter extends RecyclerView.Adapter<PhotoStaggeredAd
|
92
|
92
|
}
|
93
|
93
|
|
94
|
94
|
@Override
|
95
|
|
- public void onBindViewHolder(MyViewHolder holder, int position) {
|
|
95
|
+ public void onBindViewHolder(MyViewHolder holder, final int position) {
|
96
|
96
|
final GroupPhotoItem item = photoList.get(position);
|
97
|
97
|
int height ;
|
98
|
98
|
if(item.thumbnailWidth>0){
|
|
|
@@ -107,8 +107,18 @@ public class PhotoStaggeredAdapter extends RecyclerView.Adapter<PhotoStaggeredAd
|
107
|
107
|
@Override
|
108
|
108
|
public void onClick(View v) {
|
109
|
109
|
Intent intent = new Intent(context, PhotoDetailsActivity.class);
|
|
110
|
+ ArrayList<GroupPhotoItem> groupPhotoList = new ArrayList<>();
|
|
111
|
+ if(photoList.size()<200){
|
|
112
|
+ groupPhotoList.addAll(photoList);
|
|
113
|
+ }else{
|
|
114
|
+ if(position>10){
|
|
115
|
+ groupPhotoList.addAll(photoList.subList(position-9,position+190>photoList.size()?photoList.size():position+190));
|
|
116
|
+ }else{
|
|
117
|
+ groupPhotoList.addAll(photoList.subList(0,200));
|
|
118
|
+ }
|
|
119
|
+ }
|
110
|
120
|
intent.putExtra("photo_item",item);
|
111
|
|
- intent.putExtra("list",photoList);
|
|
121
|
+ intent.putExtra("list",groupPhotoList);
|
112
|
122
|
intent.putExtra("fromGroup",true);
|
113
|
123
|
context.startActivity(intent);
|
114
|
124
|
}
|