修改图片

This commit is contained in:
18401019693 2022-10-29 13:44:48 +08:00
parent cb118e4a9f
commit 7e9d2917b6
12 changed files with 233 additions and 213 deletions

View File

@ -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<Drawable> 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<Drawable> 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<Drawable> 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<Drawable> 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<Drawable>() {
Glide.with(context).asDrawable().load(url).thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> 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<Drawable>() {
Glide.with(context).asDrawable().load(file).thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
@Override
@ -280,6 +292,7 @@ public class ImgLoader {
RequestBuilder<Drawable> 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<Drawable> builder = Glide.with(context)
.load(url)
.thumbnail(thumbnail)
.apply(RequestOptions.bitmapTransform(new BlurTransformation(20)))
.placeholder(R.mipmap.live_bg);
if (width != -1 && height != -1) {

View File

@ -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<LiveUserAdapter.Vh> {
ImageView mWrap;
SVGAImageView gift_svga;
ImageView mAvatar;
ClipPathCircleImage mAvatar;
ImageView mIcon;
ImageView mGuardIcon;
@ -103,7 +104,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter<LiveUserAdapter.Vh> {
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<LiveUserAdapter.Vh> {
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<LiveUserAdapter.Vh> {
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<LiveUserAdapter.Vh> {
e.printStackTrace();
}
} else {
ImgLoader.display(mContext, userBean.getDress().getAvatar_frame(), gift_svga);
ImgLoader.display2(mContext, userBean.getDress().getAvatar_frame(), gift_svga);
}
}
}

View File

@ -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<UserBean> {
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<UserBean> {
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<UserBean> {
}
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);

View File

@ -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) {

View File

@ -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);

View File

@ -21,7 +21,7 @@
android:layout_alignParentBottom="true"
android:scaleType="centerCrop">
<com.makeramen.roundedimageview.RoundedImageView
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/avatar"
android:layout_width="27dp"
android:layout_height="27dp"

View File

@ -14,164 +14,179 @@
android:orientation="vertical"
android:visibility="visible">
<com.yunbao.common.custom.MyRelativeLayout5
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="9dp">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="9dp"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/cover"
<com.yunbao.common.custom.MyRelativeLayout5
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:riv_corner_radius="10dp" />
<com.yunbao.common.custom.RatioRoundImageView
android:id="@+id/bgs"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
android:src="@mipmap/bg_main_item_bottom"
app:ri_ratio="0.5"
app:riv_corner_radius="10dp" />
<ImageView
android:id="@+id/live_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:gravity="center" />
<RelativeLayout
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">
android:layout_height="match_parent">
<ImageView
android:id="@+id/tv_live_ico"
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_centerVertical="true"
android:layout_marginStart="5dp"
android:src="@mipmap/icon_main_rest_work" />
android:id="@+id/cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:riv_corner_radius="10dp" />
<TextView
android:id="@+id/tv_live_state"
<ImageView
android:id="@+id/bgs"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
android:src="@mipmap/bg_main_item_bottom"
app:ri_ratio="0.5" />
<ImageView
android:id="@+id/live_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="8dp"
android:text="休息"
android:textColor="@color/color_white"
android:textSize="10sp" />
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:gravity="center" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
<ImageView
android:id="@+id/type"
android:layout_width="50dp"
android:layout_height="16dp"
android:scaleType="fitXY" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#fff"
android:textSize="13sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp">
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">
<ImageView
android:id="@+id/tv_live_ico"
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_centerVertical="true"
android:layout_marginStart="5dp"
android:src="@mipmap/icon_main_rest_work" />
<TextView
android:id="@+id/name"
android:id="@+id/tv_live_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#fff"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="8dp"
android:text="休息"
android:textColor="@color/color_white"
android:textSize="10sp" />
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawablePadding="4dp"
android:gravity="center"
android:singleLine="true"
android:textColor="#B3ffffff"
android:textSize="10sp"
android:textStyle="bold"
app:dt_left_drawable="@mipmap/icon_main_live_num"
app:dt_left_height="14dp"
app:dt_left_width="14dp" />
</RelativeLayout>
</LinearLayout>
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/pk_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="6dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="50dp"
android:scaleType="centerCrop"
app:riv_border_color="@color/color_white"
app:riv_border_width="0.8dp"
app:riv_corner_radius="2dp" />
<ImageView
android:id="@+id/pk_ico"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="33dp"
android:layout_marginBottom="60dp"
android:src="@mipmap/live_pk" />
<ImageView
android:id="@+id/dr_pk_ico"
android:layout_width="100dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="40dp"
android:src="@mipmap/multiplayerpk" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
</com.yunbao.common.custom.MyRelativeLayout5>
<ImageView
android:id="@+id/type"
android:layout_width="50dp"
android:layout_height="16dp"
android:scaleType="fitXY" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#fff"
android:textSize="13sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#fff"
android:textSize="10sp" />
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawablePadding="4dp"
android:gravity="center"
android:singleLine="true"
android:textColor="#B3ffffff"
android:textSize="10sp"
android:textStyle="bold"
app:dt_left_drawable="@mipmap/icon_main_live_num"
app:dt_left_height="14dp"
app:dt_left_width="14dp" />
</RelativeLayout>
</LinearLayout>
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="6dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="50dp"
app:cardCornerRadius="2dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/pk_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerCrop"
app:riv_border_color="@color/color_white"
app:riv_border_width="0.8dp"
app:riv_corner_radius="2dp" />
</androidx.cardview.widget.CardView>
<ImageView
android:id="@+id/pk_ico"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="33dp"
android:layout_marginBottom="60dp"
android:src="@mipmap/live_pk" />
<ImageView
android:id="@+id/dr_pk_ico"
android:layout_width="100dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="40dp"
android:src="@mipmap/multiplayerpk" />
</com.yunbao.common.custom.MyRelativeLayout5>
</androidx.cardview.widget.CardView>
</LinearLayout>

View File

@ -58,7 +58,7 @@
android:layout_marginLeft="27dp"
android:gravity="center">
<com.makeramen.roundedimageview.RoundedImageView
<com.yunbao.common.views.weight.ClipPathCircleImage
android:id="@+id/avatar"
android:layout_width="48dp"
android:layout_height="48dp"
@ -73,8 +73,6 @@
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
app:autoPlay="true" />

View File

@ -152,7 +152,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
public CountDownTimer countDownTimer;
private void setAction(ImageView imageView, int time, TextView mTitle, TextView name2, List<WeekListBean> 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());

View File

@ -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<LiveBean> {
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<LiveBean> {
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) {

View File

@ -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);

View File

@ -105,7 +105,7 @@ public class MainHomeLiveWeekItemViewHolder<T> 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);