Commit 459cf275 authored by linfeng's avatar linfeng

bug修复

parent 3052d304
...@@ -41,6 +41,7 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryRecomme ...@@ -41,6 +41,7 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryRecomme
DiscoveryRecommendBean.DataBeanX.DataBean.Body body = item.getBody(); DiscoveryRecommendBean.DataBeanX.DataBean.Body body = item.getBody();
if (body != null) { if (body != null) {
if (body.getImages() != null && body.getImages().size() > 0) { if (body.getImages() != null && body.getImages().size() > 0) {
Glide.with(mContext) Glide.with(mContext)
.asBitmap()//强制Glide返回一个Bitmap对象 .asBitmap()//强制Glide返回一个Bitmap对象
.load(body.getImages().get(0).getOurl()) .load(body.getImages().get(0).getOurl())
...@@ -48,7 +49,7 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryRecomme ...@@ -48,7 +49,7 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryRecomme
@Override @Override
public void onResourceReady(@NonNull Bitmap bitmap, @Nullable Transition<? super Bitmap> transition) { public void onResourceReady(@NonNull Bitmap bitmap, @Nullable Transition<? super Bitmap> transition) {
ViewGroup.LayoutParams lp =helper.getView(R.id.iv_icon_pat).getLayoutParams(); ViewGroup.LayoutParams lp =helper.getView(R.id.iv_icon_pat).getLayoutParams();
lp.height = bitmap.getHeight() * (int) (display.getWidth() / 2 - 60 ) / bitmap.getWidth() ; lp.height = bitmap.getHeight() * (int) (display.getWidth() / 2) / bitmap.getWidth() ;
helper.getView(R.id.iv_icon_pat).setLayoutParams(lp); helper.getView(R.id.iv_icon_pat).setLayoutParams(lp);
} }
}); });
......
...@@ -93,7 +93,6 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Sim ...@@ -93,7 +93,6 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Sim
mAdapter.setEnableLoadMore(true); mAdapter.setEnableLoadMore(true);
mAdapter.disableLoadMoreIfNotFullPage(); mAdapter.disableLoadMoreIfNotFullPage();
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment