删除老的用户等级主播等级的图标

This commit is contained in:
18401019693 2024-01-04 15:07:12 +08:00
parent 418073f07e
commit aad607ace8
22 changed files with 298 additions and 187 deletions

View File

@ -12,7 +12,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.FansMedalBean; import com.yunbao.common.bean.FansMedalBean;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.UserItemBean; import com.yunbao.common.bean.UserItemBean;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
@ -29,7 +28,6 @@ import java.util.Map;
/** /**
* Created by cxf on 2017/8/4. * Created by cxf on 2017/8/4.
*/ */
public class CommonAppConfig { public class CommonAppConfig {
//域名 //域名
public static final String HOST = getMetaDataString("SERVER_HOST"); public static final String HOST = getMetaDataString("SERVER_HOST");
@ -109,7 +107,6 @@ public class CommonAppConfig {
private boolean mLaunched;//App是否启动了 private boolean mLaunched;//App是否启动了
private String mJPushAppKey;//极光推送的AppKey private String mJPushAppKey;//极光推送的AppKey
private List<UserItemBean> mUserItemList;//个人中心功能列表 private List<UserItemBean> mUserItemList;//个人中心功能列表
private SparseArray<LevelBean> mLevelMap;
private SparseArray<FansMedalBean> mAnchorFansMedalMap; private SparseArray<FansMedalBean> mAnchorFansMedalMap;
private String mGiftListJson; private String mGiftListJson;
private String mWrapListJson; private String mWrapListJson;
@ -520,27 +517,6 @@ public class CommonAppConfig {
} }
/**
* 保存用户等级信息
*/
public void setLevel(String levelJson) {
if (TextUtils.isEmpty(levelJson)) {
return;
}
List<LevelBean> list = JSON.parseArray(levelJson, LevelBean.class);
if (list == null || list.size() == 0) {
return;
}
if (mLevelMap == null) {
mLevelMap = new SparseArray<>();
}
mLevelMap.clear();
for (LevelBean bean : list) {
mLevelMap.put(bean.getLevel(), bean);
}
}
/** /**
* 保存主播粉丝徽章信息 * 保存主播粉丝徽章信息
*/ */
@ -579,24 +555,6 @@ public class CommonAppConfig {
} }
/**
* 获取用户等级
*/
public LevelBean getLevel(int level) {
if (mLevelMap == null) {
String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG);
if (!TextUtils.isEmpty(configString)) {
JSONObject obj = JSON.parseObject(configString);
setLevel(obj.getString("level"));
}
}
if (mLevelMap == null || mLevelMap.size() == 0) {
return null;
}
return mLevelMap.get(level);
}
public String getGiftListJson() { public String getGiftListJson() {
return mGiftListJson; return mGiftListJson;
} }

View File

@ -1,6 +1,7 @@
package com.yunbao.live.adapter; package com.yunbao.live.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
@ -36,6 +37,7 @@ import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.socket.SocketSendBean; import com.yunbao.live.socket.SocketSendBean;
import com.yunbao.live.utils.LiveTextRender;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
@ -287,11 +289,19 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<UserBean> {
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
} }
} }

View File

@ -22,6 +22,7 @@ import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.GuardUserBean; import com.yunbao.live.bean.GuardUserBean;
import com.yunbao.live.utils.LiveTextRender;
/** /**
* Created by cxf on 2018/11/6. * Created by cxf on 2018/11/6.
@ -111,10 +112,18 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar); ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
if (levelBean != null) { new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); @Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
mVotes.setText(Html.fromHtml(" <font color='#ffdd00'>" + bean.getContribute() + "</font> " + mVotesName)); mVotes.setText(Html.fromHtml(" <font color='#ffdd00'>" + bean.getContribute() + "</font> " + mVotesName));
} }
} }
@ -146,10 +155,17 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar); ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
mVotes.setText(bean.getContribute() + " " + mVotesName); mVotes.setText(bean.getContribute() + " " + mVotesName);
if (bean.getType() == Constants.GUARD_TYPE_DAY) { if (bean.getType() == Constants.GUARD_TYPE_DAY) {
mIcon.setImageDrawable(mGuardDrawable0); mIcon.setImageDrawable(mGuardDrawable0);

View File

@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
import android.content.Context; import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -18,6 +20,7 @@ import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.live.utils.LiveTextRender;
import java.util.List; import java.util.List;
@ -106,10 +109,17 @@ public class LiveAdminListAdapter extends RecyclerView.Adapter<LiveAdminListAdap
ImgLoader.displayAvatar(mContext,bean.getAvatar(), mAvatar); ImgLoader.displayAvatar(mContext,bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext,levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
} }
} }

View File

@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
import android.content.Context; import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -16,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.LiveShutUpBean; import com.yunbao.live.bean.LiveShutUpBean;
import com.yunbao.live.utils.LiveTextRender;
import java.util.List; import java.util.List;
@ -103,10 +106,17 @@ public class LiveBlackAdapter extends RefreshAdapter<LiveShutUpBean> {
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar); ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
} }
} }

View File

@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
import android.content.Context; import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -16,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.LiveShutUpBean; import com.yunbao.live.bean.LiveShutUpBean;
import com.yunbao.live.utils.LiveTextRender;
import java.util.List; import java.util.List;
@ -103,10 +106,17 @@ public class LiveShutUpAdapter extends RefreshAdapter<LiveShutUpBean> {
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar); ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
} }
} }

View File

@ -5,6 +5,7 @@ import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.graphics.drawable.Drawable;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
@ -24,6 +25,7 @@ import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.common.bean.MicUserBean; import com.yunbao.common.bean.MicUserBean;
import com.yunbao.live.utils.LiveTextRender;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
@ -114,10 +116,17 @@ public class UserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
} }

View File

@ -24,7 +24,6 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.LiveUserRankBean; import com.yunbao.common.bean.LiveUserRankBean;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
@ -148,7 +147,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
} }
}); });
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
title.setVisibility(View.GONE); title.setVisibility(View.GONE);
title1.setVisibility(View.GONE); title1.setVisibility(View.GONE);
@ -285,8 +284,8 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
} }
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
if (levelBean != null) {
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() { new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel); ImgLoader.display2(mContext, drawable, mLevel);
@ -298,7 +297,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
} }
}); });
}
if (bean.isHide() && (type.equals("5") || type.equals("4"))) { if (bean.isHide() && (type.equals("5") || type.equals("4"))) {
mName.setText(R.string.mystery_man); mName.setText(R.string.mystery_man);
ImgLoader.display2(mContext, R.mipmap.hide, mAvatar); ImgLoader.display2(mContext, R.mipmap.hide, mAvatar);

View File

@ -205,9 +205,8 @@ public class LiveGiveHotDialogFragment extends AbsDialogFragment {
ImgLoader.displayAvatar(mContext, mDatas.get(position).getUser_avatar(), viewHolder.img_head); ImgLoader.displayAvatar(mContext, mDatas.get(position).getUser_avatar(), viewHolder.img_head);
viewHolder.tv_name.setText(mDatas.get(position).getUser_name()); viewHolder.tv_name.setText(mDatas.get(position).getUser_name());
viewHolder.sex.setImageResource(CommonIconUtil.getSexIcon(mDatas.get(position).getSex())); viewHolder.sex.setImageResource(CommonIconUtil.getSexIcon(mDatas.get(position).getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(mDatas.get(position).getLevel());
if (levelBean != null) { new LiveTextRender().getLevelImage(mContext, mDatas.get(position).getLevel(), new ImgLoader.DrawableCallback() {
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, viewHolder.level); ImgLoader.display2(mContext, drawable, viewHolder.level);
@ -218,7 +217,7 @@ public class LiveGiveHotDialogFragment extends AbsDialogFragment {
} }
}); });
}
String hotStr = mDatas.get(position).getHot_score().substring(0, mDatas.get(position).getHot_score().length() - 3); String hotStr = mDatas.get(position).getHot_score().substring(0, mDatas.get(position).getHot_score().length() - 3);
viewHolder.tv_hot_number.setText(hotStr + "k"); viewHolder.tv_hot_number.setText(hotStr + "k");
viewHolder.tv_hot_time.setText(mDatas.get(position).getHot_score_end_time()); viewHolder.tv_hot_time.setText(mDatas.get(position).getHot_score_end_time());

View File

@ -1,5 +1,6 @@
package com.yunbao.live.dialog; package com.yunbao.live.dialog;
import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
@ -18,21 +19,20 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.adapter.GuardAdapter; import com.yunbao.live.adapter.GuardAdapter;
import com.yunbao.live.bean.GuardUserBean; import com.yunbao.live.bean.GuardUserBean;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.live.utils.LiveTextRender;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -45,7 +45,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
private ImageView guardIcon, userSex, userLevel; private ImageView guardIcon, userSex, userLevel;
private ConstraintLayout mRootLayout; private ConstraintLayout mRootLayout;
private CommonRefreshView mRefreshView; private CommonRefreshView mRefreshView;
private TextView mBtnBuy, userName, userGuard,tip1, tip2; private TextView mBtnBuy, userName, userGuard, tip1, tip2;
private SVGAImageView giftSvga; private SVGAImageView giftSvga;
private LinearLayout userLayout; private LinearLayout userLayout;
@ -54,7 +54,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
private String mLiveUid; private String mLiveUid;
private boolean mIsAnchor;//是否是主播 private boolean mIsAnchor;//是否是主播
private boolean showBuyView; private boolean showBuyView;
private List<GuardUserBean> list=new ArrayList<>(); private List<GuardUserBean> list = new ArrayList<>();
private RelativeLayout relativeLayout; private RelativeLayout relativeLayout;
@Override @Override
@ -95,7 +95,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
} }
mIsAnchor = bundle.getBoolean(Constants.ANCHOR, false); mIsAnchor = bundle.getBoolean(Constants.ANCHOR, false);
mLiveUid = bundle.getString(Constants.LIVE_UID); mLiveUid = bundle.getString(Constants.LIVE_UID);
showBuyView = bundle.getBoolean("showBuyView",true); showBuyView = bundle.getBoolean("showBuyView", true);
guardIcon = mRootView.findViewById(R.id.guard_imageView); guardIcon = mRootView.findViewById(R.id.guard_imageView);
mRootLayout = mRootView.findViewById(R.id.guard_constraintLayout); mRootLayout = mRootView.findViewById(R.id.guard_constraintLayout);
mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy); mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy);
@ -138,8 +138,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
@Override @Override
public List<GuardUserBean> processData(String[] info) { public List<GuardUserBean> processData(String[] info) {
List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class); List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class);
if(!list.isEmpty()){ if (!list.isEmpty()) {
LiveNewGuardListDialogFragment.this.list=list; LiveNewGuardListDialogFragment.this.list = list;
setAdapterData(); setAdapterData();
} }
return list; return list;
@ -167,7 +167,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
}); });
mRefreshView.setRecyclerViewAdapter(mGuardAdapter); mRefreshView.setRecyclerViewAdapter(mGuardAdapter);
mGuardAdapter.notifyDataSetChanged(); mGuardAdapter.notifyDataSetChanged();
if(!showBuyView){ if (!showBuyView) {
relativeLayout.setVisibility(View.GONE); relativeLayout.setVisibility(View.GONE);
} }
} }
@ -184,10 +184,11 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
initView(); initView();
return show; return show;
} }
private void setAdapterData(){
private void setAdapterData() {
if (list.isEmpty()) { if (list.isEmpty()) {
userLayout.setVisibility(View.INVISIBLE); userLayout.setVisibility(View.INVISIBLE);
}else { } else {
GuardUserBean bean = list.get(0); GuardUserBean bean = list.get(0);
giftSvga.setImageResource(R.mipmap.guardian_img_wings_p); giftSvga.setImageResource(R.mipmap.guardian_img_wings_p);
ImgLoader.display(mContext, bean.getAvatar(), guardIcon); ImgLoader.display(mContext, bean.getAvatar(), guardIcon);
@ -196,10 +197,18 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
String guardString = mContext.getString(R.string.guard_week_con); String guardString = mContext.getString(R.string.guard_week_con);
userGuard.setText(guardString + " " + bean.getContribute()); userGuard.setText(guardString + " " + bean.getContribute());
userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
if (levelBean != null) { new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
ImgLoader.display(mContext, levelBean.getThumb(), userLevel); @Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, userLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
if (mLiveGuardInfo != null) { if (mLiveGuardInfo != null) {
int guardType = mLiveGuardInfo.getMyGuardType(); int guardType = mLiveGuardInfo.getMyGuardType();
@ -217,7 +226,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
} }
} }
} }
public void setList(List<GuardUserBean> list) { public void setList(List<GuardUserBean> list) {
this.list=list; this.list = list;
} }
} }

View File

@ -414,12 +414,17 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View
} }
} }
ImgLoader.display(mContext, imgUrl, mLevelAnchor); ImgLoader.display(mContext, imgUrl, mLevelAnchor);
new LiveTextRender().getLevelImage(mContext,obj.getIntValue("level"), new ImgLoader.DrawableCallback() {
@Override
LevelBean levelBean = appConfig.getLevel(obj.getIntValue("level")); public void onLoadSuccess(Drawable drawable) {
if (levelBean != null) { ImgLoader.display2(mContext, drawable, mLevel);
ImgLoader.display(mContext, levelBean.getBgIcon(), mLevel);
} }
@Override
public void onLoadFailed() {
}
});
mLevelAnchorText.setText(String.valueOf(levelAnchor)); mLevelAnchorText.setText(String.valueOf(levelAnchor));
mLevelText.setText(String.valueOf(level)); mLevelText.setText(String.valueOf(level));
mSex.setImageResource(CommonIconUtil.getSexIcon(obj.getIntValue("sex"))); mSex.setImageResource(CommonIconUtil.getSexIcon(obj.getIntValue("sex")));

View File

@ -5,6 +5,7 @@ import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -53,6 +54,7 @@ import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
import com.yunbao.live.interfaces.LivePushListener; import com.yunbao.live.interfaces.LivePushListener;
import com.yunbao.live.socket.SocketClient; import com.yunbao.live.socket.SocketClient;
import com.yunbao.live.socket.SocketLinkMicUtil; import com.yunbao.live.socket.SocketLinkMicUtil;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder; import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder;
import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder; import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder;
import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder; import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
@ -631,10 +633,17 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
ImgLoader.display(mContext, u.getAvatar(), avatar); ImgLoader.display(mContext, u.getAvatar(), avatar);
name.setText(u.getUserNiceName()); name.setText(u.getUserNiceName());
sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex())); sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(u.getLevel()); new LiveTextRender().getLevelImage(mContext, u.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), level); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, level);
} }
@Override
public void onLoadFailed() {
}
});
mLinkMicWaitCount = LINK_MIC_COUNT_MAX; mLinkMicWaitCount = LINK_MIC_COUNT_MAX;
mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")..."); mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")...");
mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true); mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true);

View File

@ -31,11 +31,9 @@ import androidx.core.content.ContextCompat;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition; import com.bumptech.glide.request.transition.Transition;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.AiAutomaticSpeechModel;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.NewLevelModel; import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.custom.VerticalImageSpan; import com.yunbao.common.custom.VerticalImageSpan;
@ -762,11 +760,14 @@ public class LiveTextRender {
} }
private void renderEnterRoomTMP(Context context, final TextView textView, final LiveChatBean bean) { private void renderEnterRoomTMP(Context context, final TextView textView, final LiveChatBean bean) {
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); List<NewLevelModel> models = new NewLevelManager(context).getNewLevelModels();
if (levelBean == null) { String imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
return; for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
} }
ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() { }
ImgLoader.displayDrawable(context, imgUrl, new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
if (textView != null) { if (textView != null) {

View File

@ -10,9 +10,9 @@ import android.view.animation.LinearInterpolator;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.AbsViewHolder;
@ -20,6 +20,8 @@ import com.yunbao.live.R;
import com.yunbao.live.bean.LiveDanMuBean; import com.yunbao.live.bean.LiveDanMuBean;
import com.yunbao.live.interfaces.IDanmuActionListener; import com.yunbao.live.interfaces.IDanmuActionListener;
import java.util.List;
/** /**
* Created by cxf on 2017/8/25. * Created by cxf on 2017/8/25.
* 弹幕 * 弹幕
@ -87,12 +89,16 @@ public class DanmuViewHolder extends AbsViewHolder {
public void show(LiveDanMuBean bean, int lineNum) { public void show(LiveDanMuBean bean, int lineNum) {
mLineNum = lineNum; mLineNum = lineNum;
ImgLoader.display(mContext,bean.getAvatar(), mAvatar); ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()); mName.setText(bean.getUserNiceName());
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
if (levelBean != null) { String imgUrl = "#68F1F4";
mName.setTextColor(Color.parseColor(levelBean.getColor())); for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getColour();
} }
}
mName.setTextColor(Color.parseColor(imgUrl));
mContent.setText(bean.getContent()); mContent.setText(bean.getContent());
mCanNext = false; mCanNext = false;
mContentView.measure(0, 0); mContentView.measure(0, 0);

View File

@ -12,13 +12,17 @@ import android.widget.TextView;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.LevelBean; import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.LiveDanMuBean; import com.yunbao.live.bean.LiveDanMuBean;
import com.yunbao.live.interfaces.IDanmuActionListener; import com.yunbao.live.interfaces.IDanmuActionListener;
import java.util.List;
/** /**
* Created by cxf on 2017/8/25. * Created by cxf on 2017/8/25.
* 弹幕 * 弹幕
@ -89,10 +93,15 @@ public class FansDanmuViewHolder extends DanmuViewHolder {
mLineNum = lineNum; mLineNum = lineNum;
ImgLoader.display(mContext,bean.getAvatar(), mAvatar); ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName()+":"); mName.setText(bean.getUserNiceName()+":");
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
if (levelBean != null) { List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
mName.setTextColor(Color.parseColor(levelBean.getColor())); String imgUrl = "#68F1F4";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getColour();
} }
}
mName.setTextColor(Color.parseColor(imgUrl));
mContent.setText(bean.getContent()); mContent.setText(bean.getContent());
mCanNext = false; mCanNext = false;
mContentView.measure(0, 0); mContentView.measure(0, 0);

View File

@ -1,6 +1,7 @@
package com.yunbao.main.adapter; package com.yunbao.main.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -27,6 +28,7 @@ import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.bean.SearchUserBean; import com.yunbao.live.bean.SearchUserBean;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.main.R; import com.yunbao.main.R;
import java.util.List; import java.util.List;
@ -172,11 +174,17 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
} }
leave.setText(bean.getLevelAnchor() + ""); leave.setText(bean.getLevelAnchor() + "");
ImgLoader.display(itemView.getContext(), imgUrl, mLevelAnchor); ImgLoader.display(itemView.getContext(), imgUrl, mLevelAnchor);
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); @Override
if (levelBean != null) { public void onLoadSuccess(Drawable drawable) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
} }
} }

View File

@ -5,6 +5,7 @@ import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Outline; import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
@ -34,7 +35,6 @@ import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.GoogleBean; import com.yunbao.common.bean.GoogleBean;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.UserItemBean; import com.yunbao.common.bean.UserItemBean;
import com.yunbao.common.event.CompleteInformationEvent; import com.yunbao.common.event.CompleteInformationEvent;
@ -55,6 +55,7 @@ import com.yunbao.live.activity.LiveRecordActivity;
import com.yunbao.live.activity.RoomManageActivity; import com.yunbao.live.activity.RoomManageActivity;
import com.yunbao.live.activity.WebViewActivityMedal; import com.yunbao.live.activity.WebViewActivityMedal;
import com.yunbao.live.bean.SlideBean; import com.yunbao.live.bean.SlideBean;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.live.views.CustomMyViewHolder; import com.yunbao.live.views.CustomMyViewHolder;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.activity.EditProfileActivity; import com.yunbao.main.activity.EditProfileActivity;
@ -375,9 +376,17 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
} else { } else {
Constants.isAnchor = false; Constants.isAnchor = false;
LevelBean levelBean = appConfig.getLevel(u.getLevel()); new LiveTextRender().getLevelImage(mContext, u.getLevel(), new ImgLoader.DrawableCallback() {
if (levelBean != null) { @Override
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
}
@Override
public void onLoadFailed() {
}
});
//用户等级 //用户等级
tv_level.setOnClickListener(new View.OnClickListener() { tv_level.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -387,8 +396,8 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
ZhuangBanActivity.forward(mContext, url); ZhuangBanActivity.forward(mContext, url);
} }
}); });
tv_level.setText(levelBean.getLevel() + ""); tv_level.setText(u.getLevel() + "");
}
} }
//修改靓号图标 个人中心 //修改靓号图标 个人中心
if (u.getGoodnum() != null && !u.getGoodnum().equals("")) { if (u.getGoodnum() != null && !u.getGoodnum().equals("")) {

View File

@ -3,8 +3,7 @@ package com.yunbao.main.views;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import androidx.recyclerview.widget.GridLayoutManager; import android.graphics.drawable.Drawable;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
@ -14,6 +13,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.opensource.svgaplayer.SVGADrawable; import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAParser;
@ -22,7 +24,6 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.GoogleBean; import com.yunbao.common.bean.GoogleBean;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel; import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.UserItemBean; import com.yunbao.common.bean.UserItemBean;
@ -37,6 +38,7 @@ import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.live.activity.LiveRecordActivity; import com.yunbao.live.activity.LiveRecordActivity;
import com.yunbao.live.activity.RoomManageActivity; import com.yunbao.live.activity.RoomManageActivity;
import com.yunbao.live.activity.WebViewActivityMedal; import com.yunbao.live.activity.WebViewActivityMedal;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.activity.EditProfileActivity; import com.yunbao.main.activity.EditProfileActivity;
import com.yunbao.main.activity.FansActivity; import com.yunbao.main.activity.FansActivity;
@ -79,7 +81,7 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
private View v_noble; private View v_noble;
// private LinearLayout btnUserNoble; // private LinearLayout btnUserNoble;
private ImageView user_noble_ico, good_nub_ico; private ImageView user_noble_ico, good_nub_ico;
private TextView user_noble_text,leave; private TextView user_noble_text, leave;
private UserItemBean beanStetting = null, beanKefu = null; private UserItemBean beanStetting = null, beanKefu = null;
private boolean firstInto = true; private boolean firstInto = true;
@ -151,16 +153,16 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
mLevelAnchor.setOnClickListener(new View.OnClickListener() { mLevelAnchor.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Level&a=index" + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0") + "&for"; String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Level&a=index" + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0") + "&for";
WebViewActivity.forward(mContext, url,false); WebViewActivity.forward(mContext, url, false);
} }
}); });
//用户等级 //用户等级
mLevel.setOnClickListener(new View.OnClickListener() { mLevel.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Level&a=index" + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0"); String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Level&a=index" + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
WebViewActivity.forward(mContext, url,false); WebViewActivity.forward(mContext, url, false);
} }
}); });
@ -306,11 +308,17 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
} }
leave.setText(String.valueOf(u.getLevelAnchor())); leave.setText(String.valueOf(u.getLevelAnchor()));
ImgLoader.display(mContext, imgUrl, mLevelAnchor); ImgLoader.display(mContext, imgUrl, mLevelAnchor);
new LiveTextRender().getLevelImage(mContext, u.getLevel(), new ImgLoader.DrawableCallback() {
LevelBean levelBean = appConfig.getLevel(u.getLevel()); @Override
if (levelBean != null) { public void onLoadSuccess(Drawable drawable) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel); ImgLoader.display2(mContext, drawable, mLevel);
} }
@Override
public void onLoadFailed() {
}
});
//修改靓号图标 个人中心 //修改靓号图标 个人中心
if (u.getGoodnum() != null && !u.getGoodnum().equals("")) { if (u.getGoodnum() != null && !u.getGoodnum().equals("")) {
good_nub_ico.setVisibility(View.VISIBLE); good_nub_ico.setVisibility(View.VISIBLE);
@ -387,7 +395,7 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
Log.i("tsa", url); Log.i("tsa", url);
RewardActivity.forward(mContext, url); RewardActivity.forward(mContext, url);
} else { } else {
WebViewActivity.forward(mContext, url,false); WebViewActivity.forward(mContext, url, false);
} }
} }
@ -415,12 +423,12 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
} else if (i == R.id.btn_gold) { } else if (i == R.id.btn_gold) {
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0)); mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0));
} else if (i == R.id.rt_kefu) { } else if (i == R.id.rt_kefu) {
WebViewActivity.forward(mContext, beanKefu.getHref(),false); WebViewActivity.forward(mContext, beanKefu.getHref(), false);
} else if (i == R.id.rt_setting) { } else if (i == R.id.rt_setting) {
forwardSetting(); forwardSetting();
} else if (i == R.id.v_noble) { } else if (i == R.id.v_noble) {
UserBean u = CommonAppConfig.getInstance().getUserBean(); UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
ZhuangBanActivity.forward(mContext, url, false); ZhuangBanActivity.forward(mContext, url, false);
} }

View File

@ -1,5 +1,6 @@
package com.yunbao.main.views; package com.yunbao.main.views;
import android.graphics.drawable.Drawable;
import android.text.Html; import android.text.Html;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;
@ -13,8 +14,6 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel; import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.SearchModel; import com.yunbao.common.bean.SearchModel;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
@ -23,6 +22,7 @@ import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.WordsTypeUtil; import com.yunbao.common.utils.WordsTypeUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.event.JumpUserHomeEvent; import com.yunbao.main.event.JumpUserHomeEvent;
@ -72,14 +72,22 @@ public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
ImgLoader.displayAvatar(itemView.getContext(), model.getAvatar(), avatar); ImgLoader.displayAvatar(itemView.getContext(), model.getAvatar(), avatar);
Glide.with(itemView.getContext()) Glide.with(itemView.getContext())
.asGif() .asGif()
.load(WordUtil.isNewZh()?R.mipmap.icon_user_home_living:R.mipmap.icon_user_home_living_en).skipMemoryCache(false) .load(WordUtil.isNewZh() ? R.mipmap.icon_user_home_living : R.mipmap.icon_user_home_living_en).skipMemoryCache(false)
.into(isLive); .into(isLive);
//用戶直接隱藏 //用戶直接隱藏
if (type == 3) { if (type == 3) {
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(Integer.parseInt(model.getLevel()));
if (levelBean != null) { new LiveTextRender().getLevelImage(itemView.getContext(), Integer.parseInt(model.getLevel()), new ImgLoader.DrawableCallback() {
ImgLoader.display(itemView.getContext(), levelBean.getThumb(), contribute); @Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(itemView.getContext(), drawable, contribute);
} }
@Override
public void onLoadFailed() {
}
});
isLive.setVisibility(View.GONE); isLive.setVisibility(View.GONE);
} else { } else {
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels(); List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();

View File

@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -23,7 +24,6 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.ViewPagerAdapter; import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel; import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.FollowEvent; import com.yunbao.common.event.FollowEvent;
@ -44,6 +44,7 @@ import com.yunbao.live.bean.SearchUserBean;
import com.yunbao.live.custom.MyTextView; import com.yunbao.live.custom.MyTextView;
import com.yunbao.live.dialog.LiveShareDialogFragment; import com.yunbao.live.dialog.LiveShareDialogFragment;
import com.yunbao.live.presenter.UserHomeSharePresenter; import com.yunbao.live.presenter.UserHomeSharePresenter;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.live.views.AbsLivePageViewHolder; import com.yunbao.live.views.AbsLivePageViewHolder;
import com.yunbao.live.views.AbsUserHomeViewHolder; import com.yunbao.live.views.AbsUserHomeViewHolder;
import com.yunbao.live.views.LiveRecordViewHolder; import com.yunbao.live.views.LiveRecordViewHolder;
@ -368,11 +369,17 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
} }
leave.setText(String.valueOf(anchorLevel)); leave.setText(String.valueOf(anchorLevel));
ImgLoader.display(mContext, imgUrl, mLevelAnchor); ImgLoader.display(mContext, imgUrl, mLevelAnchor);
new LiveTextRender().getLevelImage(mContext, userBean.getLevel(), new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
}
@Override
public void onLoadFailed() {
LevelBean level = appConfig.getLevel(userBean.getLevel()); }
ImgLoader.display(mContext, level.getThumb(), mLevel); });
mID.setText(userBean.getLiangNameTip()); mID.setText(userBean.getLiangNameTip());
String fansNum = StringUtil.toWan(userBean.getFans()); String fansNum = StringUtil.toWan(userBean.getFans());
mBtnFans.setText(fansNum + " " + mContext.getString(R.string.fans)); mBtnFans.setText(fansNum + " " + mContext.getString(R.string.fans));

View File

@ -59,6 +59,7 @@ import com.yunbao.live.activity.LiveReportActivity;
import com.yunbao.live.bean.SearchUserBean; import com.yunbao.live.bean.SearchUserBean;
import com.yunbao.live.dialog.LiveShareDialogFragment; import com.yunbao.live.dialog.LiveShareDialogFragment;
import com.yunbao.live.presenter.UserHomeSharePresenter; import com.yunbao.live.presenter.UserHomeSharePresenter;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.live.views.AbsLivePageViewHolder; import com.yunbao.live.views.AbsLivePageViewHolder;
import com.yunbao.live.views.AbsUserHomeViewHolder; import com.yunbao.live.views.AbsUserHomeViewHolder;
import com.yunbao.live.views.LiveRecordViewHolder; import com.yunbao.live.views.LiveRecordViewHolder;
@ -516,9 +517,17 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
} }
leave.setText(String.valueOf(userBean.getLevelAnchor())); leave.setText(String.valueOf(userBean.getLevelAnchor()));
ImgLoader.display(mContext, imgUrl, mLevelAnchor); ImgLoader.display(mContext, imgUrl, mLevelAnchor);
new LiveTextRender().getLevelImage(mContext, userBean.getLevel(), new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel);
}
LevelBean level = appConfig.getLevel(userBean.getLevel()); @Override
ImgLoader.display(mContext, level.getThumb(), mLevel); public void onLoadFailed() {
}
});
//修改靓号图标 个人中心子页面 //修改靓号图标 个人中心子页面
if (userBean.getGoodnum() != null && !userBean.getGoodnum().equals("")) { if (userBean.getGoodnum() != null && !userBean.getGoodnum().equals("")) {
good_nub_ico.setVisibility(View.VISIBLE); good_nub_ico.setVisibility(View.VISIBLE);

View File

@ -56,23 +56,24 @@
<FrameLayout <FrameLayout
android:layout_width="55dp" android:layout_width="30dp"
android:layout_height="19dp"> android:layout_marginStart="5dp"
android:layout_height="15dp">
<ImageView <ImageView
android:id="@+id/level_anchor" android:id="@+id/level_anchor"
android:layout_width="55dp" android:layout_width="30dp"
android:layout_height="19dp" /> android:layout_height="15dp" />
<TextView <TextView
android:id="@+id/leave" android:id="@+id/leave"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="28dp" android:layout_marginStart="13dp"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="10sp" android:textSize="8sp"
android:textStyle="bold" /> android:textStyle="bold" />
</FrameLayout> </FrameLayout>