|
@@ -10,9 +10,13 @@ import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
|
|
import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
|
|
|
import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
|
|
import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.Lp;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
|
|
+import com.sheep.gamegroup.util.ListUtil;
|
|
|
|
|
+import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
|
|
|
|
|
import java.util.ArrayList; /**
|
|
import java.util.ArrayList; /**
|
|
|
* Created by realicing on 2018/7/5.
|
|
* Created by realicing on 2018/7/5.
|
|
@@ -28,9 +32,12 @@ public class ImageListHelper {
|
|
|
@Override
|
|
@Override
|
|
|
public void convert(ViewHolder viewHolder, String url, final int position) {
|
|
public void convert(ViewHolder viewHolder, String url, final int position) {
|
|
|
View view = viewHolder.getView(R.id.img_detail);
|
|
View view = viewHolder.getView(R.id.img_detail);
|
|
|
|
|
+ boolean isFirstPosition = position == 0;
|
|
|
|
|
+ boolean isLastPosition = position + 1 == ListUtil.size(pictureList);
|
|
|
|
|
+ LayoutParamsUtil.resetLayoutParams(view, new Lp(G.DENSITY).setLeftMargin(isFirstPosition ? 12 : 6).setRightMargin(isLastPosition ? 12 : 6));
|
|
|
if (view instanceof ImageView) {
|
|
if (view instanceof ImageView) {
|
|
|
try {
|
|
try {
|
|
|
- Glide.with(SheepApp.getInstance()).load(url).apply(new RequestOptions().centerCrop()).into((ImageView) view);
|
|
|
|
|
|
|
+ Glide.with(SheepApp.getInstance()).load(url).into((ImageView) view);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|