diff --git a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java index 4557699e2..3c26b148e 100644 --- a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java +++ b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java @@ -2,9 +2,7 @@ package com.yunbao.common.glide; import android.app.Activity; import android.content.Context; -import android.graphics.Bitmap; import android.graphics.drawable.Drawable; -import android.media.ThumbnailUtils; import android.net.Uri; import android.text.TextUtils; import android.widget.ImageView; @@ -16,7 +14,6 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.CustomTarget; -import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.transition.Transition; import com.yunbao.common.R; @@ -29,9 +26,10 @@ import jp.wasabeef.glide.transformations.BlurTransformation; */ public class ImgLoader { - private static final boolean SKIP_MEMORY_CACHE = false; + private static final boolean SKIP_MEMORY_CACHE = true; private static BlurTransformation sBlurTransformation; + private final static float thumbnail = 0.1f; static { sBlurTransformation = new BlurTransformation(25); @@ -47,14 +45,15 @@ public class ImgLoader { } RequestBuilder builder = Glide.with(context) .load(url); + if (width != -1 && height != -1) { builder = builder.override(width, height); } - builder.into(imageView); + builder.thumbnail(thumbnail).into(imageView); } public static void display2(Context context, String url, ImageView imageView) { - display2(context, url, imageView, -1, -1); + display2(context, url, imageView, 320, 320); } /** @@ -71,6 +70,8 @@ public class ImgLoader { } RequestBuilder builder = Glide.with(context) .load(url) + + .thumbnail(thumbnail) .dontAnimate() .placeholder(imageView.getDrawable()); if (width != -1 && height != -1) { @@ -86,6 +87,8 @@ public class ImgLoader { Glide.with(context) .asDrawable() .load(url) + + .thumbnail(thumbnail) .placeholder(imageView.getDrawable()) .dontAnimate() .skipMemoryCache(SKIP_MEMORY_CACHE) @@ -106,6 +109,7 @@ public class ImgLoader { RequestBuilder builder = Glide.with(context) .load(url) + .thumbnail(thumbnail) .error(errorRes); if (width != -1 && height != -1) { builder = builder.override(width, height); @@ -120,7 +124,7 @@ public class ImgLoader { if (imageView == null) { return; } - Glide.with(context).asDrawable().load(url).error(errorRes).skipMemoryCache(SKIP_MEMORY_CACHE).into(imageView); + Glide.with(context).asDrawable().load(url).thumbnail(thumbnail).error(errorRes).skipMemoryCache(SKIP_MEMORY_CACHE).into(imageView); } public static void displayAvatar(Context context, String url, ImageView imageView) { @@ -137,6 +141,8 @@ public class ImgLoader { RequestBuilder builder = Glide.with(context) .load(url) + .thumbnail(thumbnail) + .error(R.mipmap.icon_avatar_placeholder); if (width != -1 && height != -1) { builder = builder.override(width, height); @@ -159,6 +165,8 @@ public class ImgLoader { Glide.with(context) .asDrawable() .load(file) + + .thumbnail(thumbnail) .skipMemoryCache(SKIP_MEMORY_CACHE) .into(imageView); } @@ -170,6 +178,8 @@ public class ImgLoader { Glide.with(context) .asDrawable() .load(res) + + .thumbnail(thumbnail) .skipMemoryCache(SKIP_MEMORY_CACHE) .into(imageView); } @@ -184,6 +194,7 @@ public class ImgLoader { Glide.with(context) .asDrawable() .load(Uri.fromFile(new File(videoPath))) + .thumbnail(thumbnail) .skipMemoryCache(SKIP_MEMORY_CACHE) .into(imageView); } @@ -198,6 +209,7 @@ public class ImgLoader { Glide.with(context) .asGif() .load(videoPath) + .thumbnail(thumbnail) .skipMemoryCache(SKIP_MEMORY_CACHE) .into(imageView); } @@ -208,7 +220,7 @@ public class ImgLoader { if (callback != null) callback.onLoadFailed(); } else { - Glide.with(context).asDrawable().load(url).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget() { + Glide.with(context).asDrawable().load(url).thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget() { @Override public void onResourceReady(@NonNull Drawable resource, @Nullable Transition transition) { @@ -239,7 +251,7 @@ public class ImgLoader { if (!contextIsExist(context)) { return; } - Glide.with(context).asDrawable().load(file).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget() { + Glide.with(context).asDrawable().load(file).thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget() { @Override @@ -280,6 +292,7 @@ public class ImgLoader { RequestBuilder builder = Glide.with(context) .load(url) + .thumbnail(thumbnail) .apply(RequestOptions.bitmapTransform(sBlurTransformation)); if (width != -1 && height != -1) { builder = builder.override(width, height); @@ -300,6 +313,7 @@ public class ImgLoader { } RequestBuilder builder = Glide.with(context) .load(url) + .thumbnail(thumbnail) .apply(RequestOptions.bitmapTransform(new BlurTransformation(20))) .placeholder(R.mipmap.live_bg); if (width != -1 && height != -1) { diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java index 395e63200..7354f79fb 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveUserAdapter.java @@ -22,6 +22,7 @@ import com.yunbao.common.bean.UserBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.SVGAViewUtils; +import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.live.R; import com.yunbao.live.bean.LiveUserGiftBean; @@ -95,7 +96,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter { ImageView mWrap; SVGAImageView gift_svga; - ImageView mAvatar; + ClipPathCircleImage mAvatar; ImageView mIcon; ImageView mGuardIcon; @@ -103,7 +104,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter { super(itemView); mWrap = (ImageView) itemView.findViewById(R.id.wrap); gift_svga = (SVGAImageView) itemView.findViewById(R.id.gift_svga); - mAvatar = (ImageView) itemView.findViewById(R.id.avatar); + mAvatar = (ClipPathCircleImage) itemView.findViewById(R.id.avatar); mIcon = (ImageView) itemView.findViewById(R.id.icon); mGuardIcon = (ImageView) itemView.findViewById(R.id.guard_icon); itemView.setOnClickListener(mOnClickListener); @@ -113,8 +114,8 @@ public class LiveUserAdapter extends RecyclerView.Adapter { itemView.setTag(position); if (payload == null) { - ImgLoader.displayAvatar(mContext, userBean.getAvatar(), mAvatar,64,64); - // ImageLoadUtils.loadUrl(userBean.getAvatar(),32,32,mAvatar); + ImgLoader.display2(mContext, userBean.getAvatar(), mAvatar); + // ImageLoadUtils.loadUrl(userBean.getAvatar(),32,32,mAvatar); } if (userBean.getDress() != null) { @@ -126,7 +127,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter { public void onComplete(SVGAVideoEntity videoItem) { SVGADrawable drawable = new SVGADrawable(videoItem); gift_svga.setImageDrawable(drawable); - SVGAViewUtils.playEndClear(gift_svga,false); + SVGAViewUtils.playEndClear(gift_svga, false); } @Override @@ -137,7 +138,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter { e.printStackTrace(); } } else { - ImgLoader.display(mContext, userBean.getDress().getAvatar_frame(), gift_svga); + ImgLoader.display2(mContext, userBean.getDress().getAvatar_frame(), gift_svga); } } } diff --git a/live/src/main/java/com/yunbao/live/adapter/UserMoreInfoAdapter.java b/live/src/main/java/com/yunbao/live/adapter/UserMoreInfoAdapter.java index ac3168698..509f813f1 100644 --- a/live/src/main/java/com/yunbao/live/adapter/UserMoreInfoAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/UserMoreInfoAdapter.java @@ -32,6 +32,7 @@ import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.bean.LiveUserGiftBean; @@ -102,7 +103,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter { class Vh extends RecyclerView.ViewHolder { TextView title, title1; ImageView mIcon; - ImageView mAvatar; + ClipPathCircleImage mAvatar; TextView mName, tvName; ImageView mNoble; ImageView mSex; @@ -122,7 +123,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter { tvName = (TextView) itemView.findViewById(R.id.tvName); ivIcon = (ImageView) itemView.findViewById(R.id.ivIcon); mIcon = (ImageView) itemView.findViewById(R.id.icon); - mAvatar = (ImageView) itemView.findViewById(R.id.avatar); + mAvatar = (ClipPathCircleImage) itemView.findViewById(R.id.avatar); mName = (TextView) itemView.findViewById(R.id.name); mSex = (ImageView) itemView.findViewById(R.id.sex); mLevel = (ImageView) itemView.findViewById(R.id.level); @@ -282,11 +283,11 @@ public class UserMoreInfoAdapter extends RefreshAdapter { } if (bean.isHide() && (type.equals("5") || type.equals("4"))) { mName.setText(R.string.mystery_man); - ImgLoader.display(mContext, R.mipmap.hide, mAvatar); + ImgLoader.display2(mContext, R.mipmap.hide, mAvatar); itemView.findViewById(R.id.state).setVisibility(View.GONE); gift_svga.setVisibility(View.GONE); } else { - ImgLoader.display(mContext, bean.getAvatar(), mAvatar); + ImgLoader.display2(mContext, bean.getAvatar(), mAvatar); mName.setText(bean.getUserNiceName()); itemView.findViewById(R.id.state).setVisibility(View.VISIBLE); gift_svga.setVisibility(View.VISIBLE); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 2b2514d04..f667d1f5b 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -334,15 +334,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (j == 1) { mic_view.setVisibility(View.VISIBLE); mic_ids.add(mic.getString("id")); - ImgLoader.display(Contexts, mic.getString("avatar"), mic_ico); + ImgLoader.display2(Contexts, mic.getString("avatar"), mic_ico); } else if (j == 2) { mic_view1.setVisibility(View.VISIBLE); mic_ids.add(mic.getString("id")); - ImgLoader.display(Contexts, mic.getString("avatar"), mic_ico1); + ImgLoader.display2(Contexts, mic.getString("avatar"), mic_ico1); } else if (j == 3) { mic_view2.setVisibility(View.VISIBLE); mic_ids.add(mic.getString("id")); - ImgLoader.display(Contexts, mic.getString("avatar"), mic_ico2); + ImgLoader.display2(Contexts, mic.getString("avatar"), mic_ico2); } } mic_view.setOnClickListener(new View.OnClickListener() { @@ -515,31 +515,31 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (j == 0) { pkText1.setText("" + formatBigNum.formatBigNum2(new_drPkbeans.get(j).getScore() + "")); pk_text11.setText("" + new_drPkbeans.get(j).getScore()); - ImgLoader.display(Contexts, new_drPkbeans.get(j).getAvatar(), avatar1); + ImgLoader.display2(Contexts, new_drPkbeans.get(j).getAvatar(), avatar1); pk1Name.setText(new_drPkbeans.get(j).getUser_nicename()); px(pk1Ico, new_drPkbeans.get(j).getPaiming()); } else if (j == 1) { pkText2.setText("" + formatBigNum.formatBigNum2(new_drPkbeans.get(j).getScore() + "")); pk_text22.setText("" + new_drPkbeans.get(j).getScore()); - ImgLoader.display(Contexts, new_drPkbeans.get(j).getAvatar(), avatar2); + ImgLoader.display2(Contexts, new_drPkbeans.get(j).getAvatar(), avatar2); pk2Name.setText(new_drPkbeans.get(j).getUser_nicename()); px(pk2Ico, new_drPkbeans.get(j).getPaiming()); } else if (j == 2) { pkText3.setText("" + formatBigNum.formatBigNum2(new_drPkbeans.get(j).getScore() + "")); pk_text33.setText("" + new_drPkbeans.get(j).getScore()); - ImgLoader.display(Contexts, new_drPkbeans.get(j).getAvatar(), avatar3); + ImgLoader.display2(Contexts, new_drPkbeans.get(j).getAvatar(), avatar3); pk3Name.setText(new_drPkbeans.get(j).getUser_nicename()); px(pk3Ico, new_drPkbeans.get(j).getPaiming()); } else if (j == 3) { pkText4.setText("" + formatBigNum.formatBigNum2(new_drPkbeans.get(j).getScore() + "")); pk_text44.setText("" + new_drPkbeans.get(j).getScore()); - ImgLoader.display(Contexts, new_drPkbeans.get(j).getAvatar(), avatar4); + ImgLoader.display2(Contexts, new_drPkbeans.get(j).getAvatar(), avatar4); pk4Name.setText(new_drPkbeans.get(j).getUser_nicename()); px(pk4Ico, new_drPkbeans.get(j).getPaiming()); } else if (j == 4) { pkText5.setText("" + formatBigNum.formatBigNum2(new_drPkbeans.get(j).getScore() + "")); pk_text55.setText("" + new_drPkbeans.get(j).getScore()); - ImgLoader.display(Contexts, new_drPkbeans.get(j).getAvatar(), avatar5); + ImgLoader.display2(Contexts, new_drPkbeans.get(j).getAvatar(), avatar5); pk5Name.setText(new_drPkbeans.get(j).getUser_nicename()); px(pk5Ico, new_drPkbeans.get(j).getPaiming()); } @@ -1411,7 +1411,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis wish.setTag(wishlist.get(i).getId()); ImageView wishPic = wish.findViewById(R.id.wish_pic); TextView wishIndex = wish.findViewById(R.id.wish_index); - ImgLoader.display(mContext, wishlist.get(i).getWishlistIcon(), wishPic); + ImgLoader.display2(mContext, wishlist.get(i).getWishlistIcon(), wishPic); wishIndex.setText(wishlist.get(i).getWishlistNumP()); if (wishListFlipper != null) { wishListFlipper.addView(wish); @@ -1632,14 +1632,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis Boolean idB = true; if (livePKUserListBean.getRed_one() != null && livePKUserListBean.getBlue_one() != null) { if (mLiveuid.equals(livePKUserListBean.getRed_one().getLiveuid())) { - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getRed_one().getImg(), avatar_l1); - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getBlue_one().getImg(), avatar_r1); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getRed_one().getImg(), avatar_l1); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getBlue_one().getImg(), avatar_r1); uidL1 = livePKUserListBean.getRed_one().getUid(); uidR1 = livePKUserListBean.getBlue_one().getUid(); idB = true; } else { - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getRed_one().getImg(), avatar_r1); - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getBlue_one().getImg(), avatar_l1); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getRed_one().getImg(), avatar_r1); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getBlue_one().getImg(), avatar_l1); uidR1 = livePKUserListBean.getRed_one().getUid(); uidL1 = livePKUserListBean.getBlue_one().getUid(); idB = false; @@ -1647,26 +1647,26 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } if (livePKUserListBean.getRed_two() != null && livePKUserListBean.getBlue_two() != null) { if (idB) { - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getRed_two().getImg(), avatar_l2); - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getBlue_two().getImg(), avatar_r2); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getRed_two().getImg(), avatar_l2); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getBlue_two().getImg(), avatar_r2); uidL2 = livePKUserListBean.getRed_two().getUid(); uidR2 = livePKUserListBean.getBlue_two().getUid(); } else { - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getRed_two().getImg(), avatar_r2); - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getBlue_two().getImg(), avatar_l2); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getRed_two().getImg(), avatar_r2); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getBlue_two().getImg(), avatar_l2); uidR2 = livePKUserListBean.getRed_two().getUid(); uidL2 = livePKUserListBean.getBlue_two().getUid(); } } if (livePKUserListBean.getRed_three() != null && livePKUserListBean.getBlue_three() != null) { if (idB) { - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getRed_three().getImg(), avatar_l3); - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getBlue_three().getImg(), avatar_r3); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getRed_three().getImg(), avatar_l3); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getBlue_three().getImg(), avatar_r3); uidL3 = livePKUserListBean.getRed_three().getUid(); uidR3 = livePKUserListBean.getBlue_three().getUid(); } else { - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getRed_three().getImg(), avatar_r3); - ImgLoader.display((LiveActivity) Contexts, livePKUserListBean.getBlue_three().getImg(), avatar_l3); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getRed_three().getImg(), avatar_r3); + ImgLoader.display2((LiveActivity) Contexts, livePKUserListBean.getBlue_three().getImg(), avatar_l3); uidR3 = livePKUserListBean.getRed_three().getUid(); uidL3 = livePKUserListBean.getBlue_three().getUid(); } @@ -1685,12 +1685,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis lt_pk_line.setVisibility(View.VISIBLE); img_pk_fist_l.setBackgroundResource(R.mipmap.icon_red_no1); img_pk_fist_r.setBackgroundResource(R.mipmap.icon_blue_no1); - ImgLoader.display((LiveActivity) Contexts, "", avatar_l1); - ImgLoader.display((LiveActivity) Contexts, "", avatar_l2); - ImgLoader.display((LiveActivity) Contexts, "", avatar_l3); - ImgLoader.display((LiveActivity) Contexts, "", avatar_r1); - ImgLoader.display((LiveActivity) Contexts, "", avatar_r2); - ImgLoader.display((LiveActivity) Contexts, "", avatar_r3); + ImgLoader.display2((LiveActivity) Contexts, "", avatar_l1); + ImgLoader.display2((LiveActivity) Contexts, "", avatar_l2); + ImgLoader.display2((LiveActivity) Contexts, "", avatar_l3); + ImgLoader.display2((LiveActivity) Contexts, "", avatar_r1); + ImgLoader.display2((LiveActivity) Contexts, "", avatar_r2); + ImgLoader.display2((LiveActivity) Contexts, "", avatar_r3); uidL1 = ""; uidL2 = ""; @@ -1723,7 +1723,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (mLevelAnchor != null) { LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(anchorLevel); if (levelBean != null) { - ImgLoader.display(mContext, levelBean.getThumbIcon(), mLevelAnchor); + ImgLoader.display2(mContext, levelBean.getThumbIcon(), mLevelAnchor); } } } @@ -2086,7 +2086,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (conversation.getUnreadMessageCount() != 0) { UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(conversation.getTargetId()); if (userInfo != null) { - ImgLoader.display(mContext, userInfo.getPortraitUri().toString(), msgUserIcon); + ImgLoader.display2(mContext, userInfo.getPortraitUri().toString(), msgUserIcon); } return; } @@ -2168,7 +2168,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis dialog.setCanceledOnTouchOutside(true); if (!TextUtils.isEmpty(avatar)) { RoundedImageView titleView = (RoundedImageView) dialog.findViewById(R.id.avatar); - ImgLoader.display(context, avatar, titleView); + ImgLoader.display2(context, avatar, titleView); } if (!TextUtils.isEmpty(name)) { TextView nameTextView = (TextView) dialog.findViewById(R.id.name); @@ -2746,7 +2746,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 获取是否有热度卡加成 */ public static void getIsHot() { - ImgLoader.display(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif); + ImgLoader.display2(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif); LiveHttpUtil.isHotCard(mLiveUid, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { diff --git a/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java b/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java index 2569f8cf4..8dd83998e 100644 --- a/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java @@ -1,7 +1,6 @@ package com.yunbao.live.views; import android.content.Context; -import android.text.TextUtils; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -10,20 +9,15 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.squareup.picasso.Picasso; -import com.yunbao.common.Constants; import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.SearchModel; -import com.yunbao.common.custom.RatioRoundImageView; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.Bus; -import com.yunbao.common.utils.formatBigNum; import com.yunbao.live.R; import com.yunbao.live.event.JumpUserHomeEvent; -import com.yunbao.live.utils.MainIconUtil; public class SearchRecommendBodyItemViewHolder extends RecyclerView.ViewHolder { private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar; - private RatioRoundImageView bgs; private View views; private TextView mLiveState, mTitle, mName, mNum; @@ -33,7 +27,6 @@ public class SearchRecommendBodyItemViewHolder extends RecyclerView.ViewHolder { itemView.findViewById(R.id.live_info_view).setVisibility(View.VISIBLE); itemView.findViewById(R.id.lt_week_list).setVisibility(View.GONE); mCover = itemView.findViewById(R.id.cover); - bgs = itemView.findViewById(R.id.bgs); liveType = itemView.findViewById(R.id.live_type); views = itemView.findViewById(R.id.views); mLiveIco = (ImageView) itemView.findViewById(R.id.tv_live_ico); diff --git a/live/src/main/res/layout/item_live_user.xml b/live/src/main/res/layout/item_live_user.xml index 2bc5ed703..b7d2e4a27 100644 --- a/live/src/main/res/layout/item_live_user.xml +++ b/live/src/main/res/layout/item_live_user.xml @@ -21,7 +21,7 @@ android:layout_alignParentBottom="true" android:scaleType="centerCrop"> - - + - - - - - - - - - + android:layout_height="match_parent"> + android:id="@+id/cover" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="centerCrop" + app:riv_corner_radius="10dp" /> - + + + android:layout_marginLeft="8dp" + android:layout_marginTop="8dp" + android:gravity="center" /> - - - - - - - - - + android:id="@+id/views" + android:layout_width="46dp" + android:layout_height="16dp" + android:layout_alignParentRight="true" + android:layout_marginTop="8dp" + android:layout_marginRight="8dp" + android:background="@mipmap/live_zt"> + + + - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/live/src/main/res/layout/item_user_more_info.xml b/live/src/main/res/layout/item_user_more_info.xml index 493646708..2cc3cdca0 100644 --- a/live/src/main/res/layout/item_user_more_info.xml +++ b/live/src/main/res/layout/item_user_more_info.xml @@ -58,7 +58,7 @@ android:layout_marginLeft="27dp" android:gravity="center"> - diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java index 777b47a2d..4f58b217e 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java @@ -152,7 +152,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter { public CountDownTimer countDownTimer; private void setAction(ImageView imageView, int time, TextView mTitle, TextView name2, List mWeekListBean) { - ImgLoader.display2(mContext, mWeekListBean.get(weekListIndex).getAnchor_avatar(), imageView); + ImgLoader.display(mContext, mWeekListBean.get(weekListIndex).getAnchor_avatar(), imageView); name2.setText(mWeekListBean.get(weekListIndex).getAnchor_name()); diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java index a9bc1426b..461ec6c9f 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java @@ -17,10 +17,9 @@ import com.squareup.picasso.Picasso; import com.xj.marqueeview.MarqueeView; import com.yunbao.common.Constants; import com.yunbao.common.adapter.RefreshAdapter; -import com.yunbao.common.custom.RatioRoundImageView; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.formatBigNum; -import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.utils.MainIconUtil; @@ -79,7 +78,7 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter { ImageView Pkico; ImageView dr_pk_ico; View views; - RatioRoundImageView bgs; + ImageView bgs; public Vh(View itemView) { super(itemView); @@ -140,14 +139,14 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter { live_type.setImageDrawable(null); viewBg.setVisibility(View.GONE); //皇帝 - if(bean.getRecommendcardtype().equals("1")){ + if (bean.getRecommendcardtype().equals("1")) { viewBg.setImageResource(R.mipmap.emperor_recommendation); viewBg.setVisibility(View.VISIBLE); //超皇 - }else if(bean.getRecommendcardtype().equals("2")){ + } else if (bean.getRecommendcardtype().equals("2")) { viewBg.setImageResource(R.mipmap.superemperor_recommendation); viewBg.setVisibility(View.VISIBLE); - }else{ + } else { viewBg.setVisibility(View.GONE); } if (bean.getContent_pic_size_two() != null && !bean.getContent_pic_size_two().equals("") && Height <= 1920) { diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java index 27c60eba2..740648c33 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -12,11 +12,10 @@ import androidx.recyclerview.widget.RecyclerView; import com.jakewharton.rxbinding3.view.RxView; import com.squareup.picasso.Picasso; import com.yunbao.common.Constants; -import com.yunbao.common.custom.RatioRoundImageView; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.formatBigNum; -import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.utils.MainIconUtil; @@ -31,7 +30,7 @@ import kotlin.Unit; */ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar, viewBg; - private RatioRoundImageView bgs; + private ImageView bgs; private View views; private TextView mLiveState, mTitle, mName, mNum; @@ -77,7 +76,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { .load(bean.getContent_pic_size_three()) .into(liveType); } - ImgLoader.display(itemView.getContext(), bean.getThumb(), mCover,300,300); + ImgLoader.display(itemView.getContext(), bean.getThumb(), mCover, 400, 400); bgs.setVisibility(View.VISIBLE); pkico.setVisibility(View.GONE); pkAvatar.setVisibility(View.GONE); @@ -86,7 +85,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { drPkIco.setVisibility(View.VISIBLE); } if (bean.getPk_avatar_thumb() != null && !bean.getPk_avatar_thumb().equals("")) { - ImgLoader.display(mContext, bean.getPk_avatar_thumb(), pkAvatar); + ImgLoader.display2(mContext, bean.getPk_avatar_thumb(), pkAvatar); pkico.setVisibility(View.VISIBLE); pkAvatar.setVisibility(View.VISIBLE); } @@ -128,7 +127,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { liveType.setVisibility(View.VISIBLE); Picasso.with(mContext) .load(bean.getRecommendCardIcon()) - .resize(DpUtil.dp2px(80),DpUtil.dp2px(33)) + .resize(DpUtil.dp2px(80), DpUtil.dp2px(33)) .into(liveType); } viewBg.setImageResource(R.mipmap.emperor_recommendation); @@ -140,7 +139,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { Picasso.with(mContext) .load(bean.getRecommendCardIcon()) - .resize(DpUtil.dp2px(80),DpUtil.dp2px(33)) + .resize(DpUtil.dp2px(80), DpUtil.dp2px(33)) .into(liveType); } viewBg.setImageResource(R.mipmap.superemperor_recommendation); diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java index 7da0d137c..7c00a8cb9 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java @@ -105,7 +105,7 @@ public class MainHomeLiveWeekItemViewHolder extends RecyclerView.ViewHolder { TextView textView = rootView.findViewById(R.id.name2); TextView title = rootView.findViewById(R.id.title); ImageView imageView = rootView.findViewById(R.id.week_live); - ImgLoader.display2(itemView.getContext(), model.getAnchor_avatar(), imageView); + ImgLoader.display2(itemView.getContext(), model.getAnchor_avatar(), imageView,400,400); textView.setText(model.getAnchor_name()); title.setText(model.getContent()); viewflipperBanner.addView(rootView);