Merge remote-tracking branch 'origin/dev_6.6.4_战令' into dev_6.6.4_战令

This commit is contained in:
zlzw 2024-01-04 10:36:22 +08:00
commit 17506f6cbf
32 changed files with 666 additions and 500 deletions

View File

@ -110,7 +110,6 @@ public class CommonAppConfig {
private String mJPushAppKey;//极光推送的AppKey
private List<UserItemBean> mUserItemList;//个人中心功能列表
private SparseArray<LevelBean> mLevelMap;
private SparseArray<LevelBean> mAnchorLevelMap;
private SparseArray<FansMedalBean> mAnchorFansMedalMap;
private String mGiftListJson;
private String mWrapListJson;
@ -541,25 +540,6 @@ public class CommonAppConfig {
}
}
/**
* 保存主播等级信息
*/
public void setAnchorLevel(String anchorLevelJson) {
if (TextUtils.isEmpty(anchorLevelJson)) {
return;
}
List<LevelBean> list = JSON.parseArray(anchorLevelJson, LevelBean.class);
if (list == null || list.size() == 0) {
return;
}
if (mAnchorLevelMap == null) {
mAnchorLevelMap = new SparseArray<>();
}
mAnchorLevelMap.clear();
for (LevelBean bean : list) {
mAnchorLevelMap.put(bean.getLevel(), bean);
}
}
/**
* 保存主播粉丝徽章信息
@ -616,22 +596,6 @@ public class CommonAppConfig {
return mLevelMap.get(level);
}
/**
* 获取主播等级
*/
public LevelBean getAnchorLevel(int level) {
if (mAnchorLevelMap == null) {
String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG);
if (!TextUtils.isEmpty(configString)) {
JSONObject obj = JSON.parseObject(configString);
setAnchorLevel(obj.getString("levelanchor"));
}
}
if (mAnchorLevelMap == null || mAnchorLevelMap.size() == 0) {
return null;
}
return mAnchorLevelMap.get(level);
}
public String getGiftListJson() {
return mGiftListJson;

View File

@ -181,8 +181,6 @@ public class CommonHttpUtil {
JSONObject obj = JSON.parseObject(info[0]);
ConfigBean bean = JSON.toJavaObject(obj, ConfigBean.class);
CommonAppConfig.getInstance().setConfig(bean);
CommonAppConfig.getInstance().setLevel(obj.getString("level"));
CommonAppConfig.getInstance().setAnchorLevel(obj.getString("levelanchor"));
CommonAppConfig.getInstance().alert_time = obj.getInteger("alert_time");
CommonAppConfig.getInstance().alert_end_time = obj.getInteger("alert_end_time");
//解析粉丝徽章

View File

@ -350,7 +350,11 @@ public class LiveHttpUtil {
.params("p", p)
.execute(callback);
}
public static void getContactMsg(int page, HttpCallback callback) {
HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg")
.params("p", page)
.execute(callback);
}
/**
* 观众跟主播连麦时获取自己的流地址

View File

@ -667,7 +667,9 @@ public interface PDLiveApi {
* 获取收件箱信息
*/
@GET("/api/public/?service=Live.getContactMsg")
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg();
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg(
@Query("p") int page
);
/**
* 删除联系方式信件

View File

@ -1267,20 +1267,25 @@ public class LiveNetManager {
*
* @param callback 回调
*/
public void getContactMsg(HttpCallback<List<LiveUserMailBoxModel>> callback) {
API.get().pdLiveApi(mContext)
.getContactMsg()
private Disposable contactMsgApi;
public synchronized void getContactMsg(int page, HttpCallback<List<LiveUserMailBoxModel>> callback) {
contactMsgApi = API.get().pdLiveApi(mContext)
.getContactMsg(page)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
contactMsgApi = null;
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
contactMsgApi = null;
});
}
/**
@ -2619,6 +2624,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getBattlePassUserInfo(HttpCallback<BattlePassUserInfoBean> callback) {
API.get().pdLiveApi(mContext)
.getBattlePassUserInfo()
@ -2638,6 +2644,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getLiveBattlePassRewards(HttpCallback<LiveBattlePassRewardsBean> callback) {
API.get().pdLiveApi(mContext)
.getLiveBattlePassRewards()
@ -2658,7 +2665,7 @@ public class LiveNetManager {
}).isDisposed();
}
public void getRewards(String rewardLevelId,String rewardId,HttpCallback<HttpCallbackModel> callback) {
public void getRewards(String rewardLevelId, String rewardId, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.getRewards(rewardLevelId, rewardId)
.subscribeOn(Schedulers.io())
@ -2679,6 +2686,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getBattlePassTask(HttpCallback<BattlePassTask> callback) {
API.get().pdLiveApi(mContext)
.getBattlePassTask()
@ -2698,7 +2706,8 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getBattlePassTaskOver(String taskId,HttpCallback<HttpCallbackModel> callback) {
public void getBattlePassTaskOver(String taskId, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.getTask(taskId)
.subscribeOn(Schedulers.io())
@ -2719,6 +2728,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getBattlePassPoints(HttpCallback<List<BattlePassPoints>> callback) {
API.get().pdLiveApi(mContext)
.getBattlePassPoints()
@ -2738,6 +2748,7 @@ public class LiveNetManager {
}
}).isDisposed();
}
public void getBattlePassRule(HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.battlePassRule()
@ -2791,5 +2802,8 @@ public class LiveNetManager {
if (randomPkApi != null) {
randomPkApi.dispose();
}
if (contactMsgApi != null) {
contactMsgApi.dispose();
}
}
}

View File

@ -1902,9 +1902,11 @@ public class LiveAudienceActivity extends LiveActivity {
/**
* 检查消息有未读就要显示红点
*/
private void checkMsgRed() {
LiveNetManager.get(mContext)
.getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
.getContactMsg(1, new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
@Override
public void onSuccess(List<LiveUserMailBoxModel> data) {
Log.i(TAG, "onSuccess: " + data.size());
@ -1927,6 +1929,8 @@ public class LiveAudienceActivity extends LiveActivity {
return;
}
}
showMsgRed(-1);
}
});

View File

@ -9,14 +9,14 @@ import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.live.R;
import com.yunbao.live.bean.SearchUserBean;
@ -24,6 +24,8 @@ import com.yunbao.live.dialog.LiveShareDialogFragment;
import com.yunbao.live.presenter.UserHomeSharePresenter;
import com.yunbao.live.views.LiveRecordPlayViewHolder;
import java.util.List;
/**
* Created by cxf on 2018/10/29.
*/
@ -82,10 +84,14 @@ public class LiveRecordPlayActivity extends AbsActivity implements
mName = (TextView) findViewById(R.id.name);
mID = (TextView) findViewById(R.id.id_val);
mBtnFollow = findViewById(R.id.btn_follow);
ImgLoader.displayAvatar(mContext,mUserBean.getAvatar(), mAvatar);
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
if (levelBean != null) {
ImgLoader.display(mContext,levelBean.getThumbIcon(), mLevelAnchor);
ImgLoader.displayAvatar(mContext, mUserBean.getAvatar(), mAvatar);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= mUserBean.getLevelAnchor() && mUserBean.getLevelAnchor() <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getIcon();
}
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
}
mName.setText(mUserBean.getUserNiceName());
mID.setText(mUserBean.getLiangNameTip());

View File

@ -1,22 +1,24 @@
package com.yunbao.live.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.yunbao.common.CommonAppConfig;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.bean.LivePkBean;
import java.util.List;
/**
* Created by cxf on 2018/11/15.
*/
@ -39,7 +41,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
}
};
mLivePkInviteString = "PK";
mLivePkInviteString2 =mContext.getString(R.string.live_pk_invite_2);
mLivePkInviteString2 = mContext.getString(R.string.live_pk_invite_2);
}
@NonNull
@ -57,7 +59,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
class Vh extends RecyclerView.ViewHolder {
ImageView mAvatar;
TextView mName;
TextView mName, leave;
ImageView mSex;
ImageView mLevel;
TextView mBtnInvite;
@ -66,6 +68,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
super(itemView);
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
mName = (TextView) itemView.findViewById(R.id.name);
leave = itemView.findViewById(R.id.leave);
mSex = (ImageView) itemView.findViewById(R.id.sex);
mLevel = (ImageView) itemView.findViewById(R.id.level);
mBtnInvite = (TextView) itemView.findViewById(R.id.btn_invite);
@ -74,13 +77,22 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
void setData(LivePkBean bean) {
mBtnInvite.setTag(bean);
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName());
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
if (levelBean != null) {
ImgLoader.display(mContext,levelBean.getThumb(), mLevel);
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = bean.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
leave.setText(String.valueOf(bean.getLevelAnchor()));
ImgLoader.display(itemView.getContext(), imgUrl, mLevel);
if (bean.isLinkMic()) {
mBtnInvite.setText(mLivePkInviteString2);
mBtnInvite.setEnabled(false);

View File

@ -12,6 +12,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
@ -21,28 +22,15 @@ import com.yunbao.common.views.weight.MarqueeTextView;
import com.yunbao.live.R;
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
import java.util.ArrayList;
import java.util.List;
public class LiveUserAnchorMailBoxAdapter extends RefreshAdapter<LiveUserMailBoxModel> {
public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserAnchorMailBoxAdapter.MailBoxViewHolder> {
private Context mContext;
private List<LiveUserMailBoxModel> list;
OnItemClickListener<LiveUserMailBoxModel> onItemClickListener;
DialogInterface.OnDismissListener onWebDismissListener;
public LiveUserAnchorMailBoxAdapter(Context mContext) {
this.mContext = mContext;
list = new ArrayList<>();
public LiveUserAnchorMailBoxAdapter(Context context) {
super(context);
}
public void setList(List<LiveUserMailBoxModel> list) {
this.list = list;
notifyDataSetChanged();
}
public List<LiveUserMailBoxModel> getList() {
return list;
}
public void setOnItemClickListener(OnItemClickListener<LiveUserMailBoxModel> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
@ -56,18 +44,20 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserA
@NonNull
@Override
public MailBoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new MailBoxViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_live_user_mailbox, parent, false));
return new MailBoxViewHolder(mInflater.inflate(R.layout.item_live_user_mailbox, parent, false));
}
@Override
public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
holder.setData(list.get(position), position);
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
MailBoxViewHolder viewHolder = (MailBoxViewHolder) holder;
viewHolder.setData(mList.get(position), position);
}
@Override
public int getItemCount() {
return list.size();
}
// @Override
// public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
// holder.setData(list.get(position), position);
// }
public class MailBoxViewHolder extends RecyclerView.ViewHolder {
TextView topText;
@ -100,9 +90,9 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserA
public void onSuccess(String data) {
Log.i("刪除信件", "onSuccess:刪除成功 ");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
list.removeIf(it -> it.getId() == box.getId());
mList.removeIf(it -> it.getId() == box.getId());
}
System.err.println("-----> list size = " + list.size());
System.err.println("-----> list size = " + mList.size());
notifyDataSetChanged();
if (onItemClickListener != null) {
onItemClickListener.onItemClick(box, position);

View File

@ -23,12 +23,11 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.event.LiveRoomChangeEvent;
@ -38,6 +37,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
@ -58,9 +58,6 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum;
import io.rong.imlib.chatroom.base.RongChatRoomClient;
import pl.droidsonroids.gif.GifImageView;
/**
@ -406,10 +403,19 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View
int levelAnchor = obj.getIntValue("level_anchor");
int level = obj.getIntValue("level");
mSign.setText(obj.getString("signature"));
LevelBean anchorLevelBean = appConfig.getAnchorLevel(obj.getIntValue("level_anchor"));
if (anchorLevelBean != null) {
ImgLoader.display(mContext, anchorLevelBean.getBgIcon(), mLevelAnchor);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = obj.getIntValue("level_anchor");
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getIcon();
}
}
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
LevelBean levelBean = appConfig.getLevel(obj.getIntValue("level"));
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getBgIcon(), mLevel);

View File

@ -1,33 +1,35 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.Bus;
import com.yunbao.live.R;
import com.yunbao.live.adapter.LiveUserAnchorMailBoxAdapter;
import com.yunbao.live.event.LiveAudienceEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 用户获取主播联系方式信箱弹框
*/
public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
private RecyclerView list;
private CommonRefreshView list;
private LiveUserAnchorMailBoxAdapter adapter;
private View empty;
@ -48,26 +50,84 @@ public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
@Override
protected void onCreate() {
super.onCreate();
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
list = findViewById(R.id.mailbox);
empty = findViewById(R.id.ic_empty);
list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
list.setAdapter(adapter);
if (adapter == null) {
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
}
list.setDataHelper(new CommonRefreshView.DataHelper<LiveUserMailBoxModel>() {
@Override
public RefreshAdapter<LiveUserMailBoxModel> getAdapter() {
if (adapter == null) {
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
}
return adapter;
}
@Override
public void loadData(int p, com.yunbao.common.http.HttpCallback callback) {
LiveHttpUtil.getContactMsg(p, callback);
}
@Override
public List<LiveUserMailBoxModel> processData(String[] info) {
if (info != null) {
if (info.length > 0) {
empty.setVisibility(View.GONE);
list.setVisibility(View.VISIBLE);
return JSON.parseArray(Arrays.toString(info), LiveUserMailBoxModel.class);
} else {
empty.setVisibility(VISIBLE);
list.setVisibility(GONE);
return new ArrayList<LiveUserMailBoxModel>();
}
} else {
empty.setVisibility(VISIBLE);
list.setVisibility(GONE);
return new ArrayList<LiveUserMailBoxModel>();
}
}
@Override
public void onRefreshSuccess(List<LiveUserMailBoxModel> list, int listCount) {
}
@Override
public void onRefreshFailure() {
}
@Override
public void onLoadMoreSuccess(List<LiveUserMailBoxModel> loadItemList, int loadItemCount) {
if (loadItemList.size() > 0)
adapter.insertList(loadItemList);
}
@Override
public void onLoadMoreFailure() {
}
});
list.initData();
adapter.setOnItemClickListener((bean, position) -> {
if (adapter.getItemCount() == 0) {
empty.setVisibility(VISIBLE);
list.setVisibility(GONE);
}
});
adapter.setOnWebDismissListener(dialog -> initData());
initData();
// adapter.setOnWebDismissListener(dialog -> initData());
// initData();
}
String TAG = "信箱";
void initData() {
LiveNetManager.get(getContext())
.getContactMsg(new HttpCallback<List<LiveUserMailBoxModel>>() {
.getContactMsg(1, new HttpCallback<List<LiveUserMailBoxModel>>() {
@Override
public void onSuccess(List<LiveUserMailBoxModel> data) {
Log.i(TAG, "onSuccess: " + data.size());

View File

@ -22,14 +22,12 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.FansModel;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.OlineUserlistModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.AbsDialogFragment;
@ -65,9 +63,6 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum;
import io.rong.imlib.chatroom.base.RongChatRoomClient;
import pl.droidsonroids.gif.GifImageView;
/**
@ -415,21 +410,33 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
// textGiftWall.setText(mContext.getString(R.string.gift_wall));
// valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number")));
}
LevelBean levelBean;
if (isAnchor) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
userLv.setText("Lv." + mUserBean.getLevelAnchor());
mLvDesc.setText(R.string.live_user_level_anchor);
} else {
levelBean = CommonAppConfig.getInstance().getLevel(mUserBean.getLevel());
userLv.setText("Lv." + mUserBean.getLevel());
mLvDesc.setText(R.string.live_user_card_level);
}
if (isAnchor) {
ImgLoader.display2(mContext, obj.getJSONObject("level_thumb").getString("thumb"), mLiveIcon);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = mUserBean.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
mLvVal.setText(obj.getInteger("level_anchor") + "");
ImgLoader.display2(mContext, imgUrl, mLiveIcon);
} else {
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
new LiveTextRender().getLevelImage(mContext, mUserBean.getLevel(), new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLiveIcon);
@ -441,7 +448,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
}
});
}
ImgLoader.display(mContext, levelBean.getBgIcon(), mLiveIcon2);
FansModel fansMedalBean = new NewLevelManager(mContext).getFansModel(obj.getIntValue("medal_level"));
if (fansMedalBean != null && !isAnchor) {
ImgLoader.display(mContext, fansMedalBean.getThumb(), mNoble);

View File

@ -16,12 +16,13 @@ import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
@ -31,7 +32,6 @@ import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.event.LinkMicTxMixStreamEvent;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
import com.yunbao.live.socket.SocketClient;
import com.yunbao.live.socket.SocketLinkMicAnchorUtil;
@ -40,6 +40,8 @@ import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
import org.greenrobot.eventbus.EventBus;
import java.util.List;
/**
* Created by cxf on 2018/11/16.
* 主播与主播连麦逻辑
@ -84,7 +86,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
mPkContainer = linkMicViewHolder.getPkContainer();
mLinkMicWaitString =mContext.getString(R.string.link_mic_wait);
mLinkMicWaitString = mContext.getString(R.string.link_mic_wait);
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
@ -174,17 +176,25 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
ImageView avatar = (ImageView) v.findViewById(R.id.avatar);
TextView name = (TextView) v.findViewById(R.id.name);
ImageView sex = (ImageView) v.findViewById(R.id.sex);
ImageView level = (ImageView) v.findViewById(R.id.level);
TextView level = (TextView) v.findViewById(R.id.level);
ImageView contribute = (ImageView) v.findViewById(R.id.contribute);
mLinkMicWaitText = v.findViewById(R.id.wait_text);
v.findViewById(R.id.btn_refuse).setOnClickListener(this);
v.findViewById(R.id.btn_accept).setOnClickListener(this);
ImgLoader.display(mContext, u.getAvatar(), avatar);
name.setText(u.getUserNiceName());
sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(u.getLevelAnchor());
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), level);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = u.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
level.setText(anchorLevel + "");
ImgLoader.display(mContext, imgUrl, contribute);
mLinkMicWaitCount = LINK_MIC_COUNT_MAX;
mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")...");
mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true);
@ -279,7 +289,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
*/
private void acceptLinkMic() {
if (((LiveAnchorActivity) mContext).isBgmPlaying()) {
DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() {
DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
((LiveAnchorActivity) mContext).stopBgm();
@ -493,10 +503,10 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
*/
public void onlinkMicPlayGaming() {
mLastApplyLinkMicTime = 0;
DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.link_mic_play_game));
DialogUitl.showSimpleTipDialog(mContext, mContext.getString(R.string.link_mic_play_game));
}
public void setLiveSdk(int mLiveSDK) {
this.mLiveSdk=mLiveSDK;
this.mLiveSdk = mLiveSDK;
}
}

View File

@ -74,7 +74,6 @@ import com.yunbao.common.bean.GiftModel;
import com.yunbao.common.bean.GuardUserModel;
import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LinkMicUserBean;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.LiveAnchorSayModel;
@ -85,6 +84,7 @@ import com.yunbao.common.bean.LiveRoomVoteModel;
import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.NewPeopleTaskModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.RankHourModel;
@ -114,6 +114,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
@ -1202,11 +1203,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mAvatar = (ImageView) findViewById(R.id.avatar);
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
mName = (TextView) findViewById(R.id.name);
mID = (TextView) findViewById(R.id.id_val);
mBtnFollow = findViewById(R.id.btn_follow);
@ -1826,6 +1823,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 重置数据
*/
public void resetView() {
contactMsgPage = -1;
svgaImageViewHashMap.clear();
pa_pao_layout.removeAllViews();
timeHandler.removeCallbacks(timeRunnable);
@ -2855,12 +2853,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 显示主播等级
*/
public void setAnchorLevel(int anchorLevel) {
if (mLevelAnchor != null) {
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(anchorLevel);
if (levelBean != null) {
ImgLoader.display2(mContext, levelBean.getThumbIcon(), mLevelAnchor);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getIcon();
}
}
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
}
/**
@ -4129,6 +4131,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
public void clearData() {
contactMsgPage = -1;
svgaImageViewHashMap.clear();
pa_pao_layout.removeAllViews();
timeHandler.removeCallbacks(timeRunnable);
@ -5532,6 +5535,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
public void initTopBanner() {
contactMsgPage = 1;
checkNewLetter();
if (mTopBannerList == null) {
mTopBannerList = new ArrayList<>();
@ -5733,25 +5737,37 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
});
}
private void checkNewLetter() {
LiveNetManager.get(mContext).getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
@Override
public void onSuccess(List<LiveUserMailBoxModel> data) {
for (LiveUserMailBoxModel model : data) {
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).showMsgRed(0);
return;
private int contactMsgPage = 1;
private synchronized void checkNewLetter() {
if (contactMsgPage > 0) {
LiveNetManager.get(mContext).getContactMsg(contactMsgPage, new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
@Override
public void onSuccess(List<LiveUserMailBoxModel> data) {
if (data.size() > 0 && data != null) {
for (LiveUserMailBoxModel model : data) {
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).showMsgRed(0);
return;
}
}
contactMsgPage = contactMsgPage + 1;
checkNewLetter();
} else {
((LiveAudienceActivity) mContext).showMsgRed(-1);
contactMsgPage = 1;
}
}
((LiveAudienceActivity) mContext).showMsgRed(-1);
}
@Override
public void onError(String error) {
contactMsgPage = 1;
}
});
}
@Override
public void onError(String error) {
}
});
}
public void blindBoxAllServerNotify(AllServerNotifyEvent event) {

View File

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog_2"
android:gravity="center_horizontal"
android:orientation="vertical"
>
android:orientation="vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
@ -15,8 +13,7 @@
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:scaleType="centerCrop"
app:riv_oval="true"
/>
app:riv_oval="true" />
<TextView
android:id="@+id/name"
@ -24,48 +21,56 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/textColor"
android:textSize="16sp"
/>
android:textSize="16sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="15dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"
>
android:orientation="horizontal">
<ImageView
android:id="@+id/sex"
android:layout_width="18dp"
android:layout_height="15dp"
/>
android:layout_height="15dp" />
<FrameLayout
android:layout_width="55dp"
android:layout_height="19dp">
<ImageView
android:id="@+id/contribute"
android:layout_width="55dp"
android:layout_height="19dp" />
<TextView
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="28dp"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</FrameLayout>
<ImageView
android:id="@+id/level"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_marginLeft="5dp"
/>
</LinearLayout>
<TextView
android:id="@+id/wait_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="8dp"
android:textColor="@color/textColor2"
android:textSize="14sp"
/>
android:textSize="14sp" />
<View
style="@style/line2"
/>
<View style="@style/line2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
>
android:layout_height="40dp">
<TextView
android:id="@+id/btn_refuse"
@ -75,14 +80,12 @@
android:gravity="center"
android:text="@string/refuse"
android:textColor="@color/textColor"
android:textSize="14sp"
/>
android:textSize="14sp" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/gray2"
/>
android:background="@color/gray2" />
<TextView
android:id="@+id/btn_accept"
@ -92,8 +95,7 @@
android:gravity="center"
android:text="@string/accept"
android:textColor="@color/global"
android:textSize="14sp"
/>
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>

View File

@ -237,7 +237,7 @@
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:visibility="gone">
android:visibility="visible">
<FrameLayout
android:layout_width="100dp"

View File

@ -28,7 +28,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
<com.yunbao.common.custom.CommonRefreshView
android:id="@+id/mailbox"
android:layout_width="match_parent"
android:layout_height="328dp"
@ -40,7 +40,7 @@
app:layout_constraintTop_toBottomOf="@+id/bg_top"
tools:listitem="@layout/item_live_user_mailbox">
</androidx.recyclerview.widget.RecyclerView>
</com.yunbao.common.custom.CommonRefreshView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ic_empty"

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="60dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
>
android:paddingRight="12dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
@ -14,8 +12,7 @@
android:layout_height="40dp"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
app:riv_oval="true"
/>
app:riv_oval="true" />
<TextView
android:id="@+id/name"
@ -25,8 +22,7 @@
android:layout_marginLeft="15dp"
android:layout_toRightOf="@id/avatar"
android:textColor="@color/textColor"
android:textSize="16sp"
/>
android:textSize="16sp" />
<ImageView
android:id="@+id/sex"
@ -34,17 +30,32 @@
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/name"
/>
android:layout_toRightOf="@id/name" />
<ImageView
android:id="@+id/level"
android:layout_width="30dp"
android:layout_height="15dp"
<FrameLayout
android:layout_width="55dp"
android:layout_height="19dp"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/sex"
/>
android:layout_toRightOf="@id/sex">
<ImageView
android:id="@+id/level"
android:layout_width="55dp"
android:layout_height="19dp" />
<TextView
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="28dp"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</FrameLayout>
<TextView
android:id="@+id/btn_invite"
@ -55,11 +66,9 @@
android:background="@drawable/bg_btn_live_pk"
android:gravity="center"
android:textColor="@color/fg_btn_live_pk"
android:textSize="10sp"
/>
android:textSize="10sp" />
<View
style="@style/line2"
android:layout_alignParentBottom="true"
/>
android:layout_alignParentBottom="true" />
</RelativeLayout>

View File

@ -43,6 +43,7 @@
android:id="@+id/level_anchor"
android:layout_width="13dp"
android:layout_height="13dp"
android:visibility="gone"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" />
</RelativeLayout>

View File

@ -239,15 +239,15 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
mVotes.setText(bean.getTotalCoinFormat() + " ");
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = null;
if (mType == TYPE_PROFIT) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
} else {
levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
}
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
}
// LevelBean levelBean = null;
// if (mType == TYPE_PROFIT) {
// levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
// } else {
// levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
// }
// if (levelBean != null) {
// ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
// }
}
liveing.setVisibility(View.INVISIBLE);
if (bean.getIslive() == 1) {

View File

@ -16,15 +16,17 @@ import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.custom.MyRadioButton;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.bean.SearchUserBean;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.main.R;
import java.util.List;
@ -47,8 +49,8 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
public SearchAdapter(Context context, int from) {
super(context);
mFrom = from;
mFollow =mContext.getString(R.string.follow);
mFollowing =mContext.getString(R.string.following);
mFollow = mContext.getString(R.string.follow);
mFollowing = mContext.getString(R.string.following);
mFollowClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -117,7 +119,7 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
class Vh extends RecyclerView.ViewHolder {
ImageView mAvatar;
TextView mName;
TextView mName, leave;
TextView mSign;
ImageView mSex;
ImageView mLevelAnchor;
@ -130,6 +132,7 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
mName = (TextView) itemView.findViewById(R.id.name);
mSign = (TextView) itemView.findViewById(R.id.sign);
leave = (TextView) itemView.findViewById(R.id.leave);
mSex = (ImageView) itemView.findViewById(R.id.sex);
mLevelAnchor = (ImageView) itemView.findViewById(R.id.level_anchor);
mLevel = (ImageView) itemView.findViewById(R.id.level);
@ -158,31 +161,24 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
gotoLive(bean.getId());
}
});
LevelBean anchorLevelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
if (anchorLevelBean != null) {
ImgLoader.display(mContext, CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), mLevelAnchor);
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = bean.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
leave.setText(bean.getLevelAnchor() + "");
ImgLoader.display(itemView.getContext(), imgUrl, mLevelAnchor);
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
}
}
// if (mUid.equals(bean.getId())) {
// if (mBtnFollow.getVisibility() == View.VISIBLE) {
// mBtnFollow.setVisibility(View.INVISIBLE);
// }
// } else {
// if (mBtnFollow.getVisibility() != View.VISIBLE) {
// mBtnFollow.setVisibility(View.VISIBLE);
// }
// if (bean.getAttention() == 1) {
// mBtnFollow.doChecked(true);
// mBtnFollow.setText(mFollowing);
// } else {
// mBtnFollow.doChecked(false);
// mBtnFollow.setText(mFollow);
// }
// }
}
}
@ -200,7 +196,7 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
}
@Override

View File

@ -2,15 +2,10 @@ package com.yunbao.main.dialog;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@ -21,10 +16,15 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
@ -32,6 +32,7 @@ import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.main.R;
import com.yunbao.main.adapter.MainHomeRemFollLiveAdapter;
import com.yunbao.main.bean.EncourageGiftBean;
import com.yunbao.main.http.MainHttpUtil;
@ -46,7 +47,7 @@ public class EncourageDialog extends AbsDialogFragment implements View.OnClickLi
private View v_encourage, v_encourage_list, v_close;
private ImageView img_gift1, img_gift2, img_gift3;
private LinearLayout lt_gift1, lt_gift2, lt_gift3, lt_lt1, lt_lt2, lt_no_data;
private RecyclerView rc_encourage;
private CommonRefreshView rc_encourage;
private EncourageAdapter encourageAdapter;
private List<EncourageGiftBean> encourageList;
private List<EncourageGiftBean> encourageList2;
@ -151,30 +152,68 @@ public class EncourageDialog extends AbsDialogFragment implements View.OnClickLi
}
private void getDataList() {
MainHttpUtil.getDynamicSendGiftList(id, new HttpCallback() {
gridLayoutManager = new GridLayoutManager(getContext(), 1);
rc_encourage.setLayoutManager(gridLayoutManager);
lt_no_data.setVisibility(View.GONE);
rc_encourage.setVisibility(View.VISIBLE);
rc_encourage.setDataHelper(new CommonRefreshView.DataHelper<EncourageGiftBean>() {
@Override
public void onSuccess(int code, String msg, String[] info) {
public RefreshAdapter<EncourageGiftBean> getAdapter() {
if (encourageAdapter == null) {
encourageAdapter = new EncourageAdapter(mContext);
}
return encourageAdapter;
}
@Override
public void loadData(int p, HttpCallback callback) {
MainHttpUtil.getDynamicSendGiftList(id, p, callback);
}
@Override
public List<EncourageGiftBean> processData(String[] info) {
if (info != null) {
if (info.length > 0) {
lt_no_data.setVisibility(View.GONE);
rc_encourage.setVisibility(View.VISIBLE);
encourageList = JSON.parseArray(Arrays.toString(info), EncourageGiftBean.class);
encourageAdapter = new EncourageAdapter(getContext(), encourageList);
gridLayoutManager = new GridLayoutManager(getContext(), 1);
rc_encourage.setLayoutManager(gridLayoutManager);
rc_encourage.setAdapter(encourageAdapter);
return JSON.parseArray(Arrays.toString(info), EncourageGiftBean.class);
} else {
lt_no_data.setVisibility(View.VISIBLE);
rc_encourage.setVisibility(View.GONE);
return new ArrayList<EncourageGiftBean>();
}
} else {
lt_no_data.setVisibility(View.VISIBLE);
rc_encourage.setVisibility(View.GONE);
return new ArrayList<EncourageGiftBean>();
}
}
@Override
public void onRefreshSuccess(List<EncourageGiftBean> list, int listCount) {
}
@Override
public void onRefreshFailure() {
}
@Override
public void onLoadMoreSuccess(List<EncourageGiftBean> loadItemList, int loadItemCount) {
if (loadItemList.size() > 0)
encourageAdapter.insertList(loadItemList);
}
@Override
public void onLoadMoreFailure() {
}
});
rc_encourage.initData();
}
private void initView() {
@ -193,7 +232,7 @@ public class EncourageDialog extends AbsDialogFragment implements View.OnClickLi
lt_gift3 = (LinearLayout) findViewById(R.id.lt_gift3);
lt_lt1 = (LinearLayout) findViewById(R.id.lt_lt1);
lt_lt2 = (LinearLayout) findViewById(R.id.lt_lt2);
rc_encourage = (RecyclerView) findViewById(R.id.rc_encourage);
rc_encourage = (CommonRefreshView) findViewById(R.id.rc_encourage);
img_gift1 = (ImageView) findViewById(R.id.img_gift1);
img_gift2 = (ImageView) findViewById(R.id.img_gift2);
@ -344,16 +383,10 @@ public class EncourageDialog extends AbsDialogFragment implements View.OnClickLi
}
}
public class EncourageAdapter extends RecyclerView.Adapter<EncourageAdapter.ViewHolder> {
private LayoutInflater mInflater;
private List<EncourageGiftBean> mDatas;
public class EncourageAdapter extends RefreshAdapter<EncourageGiftBean> {
/**
*
*/
public EncourageAdapter(Context context, List<EncourageGiftBean> datats) {
mInflater = LayoutInflater.from(context);
mDatas = datats;
public EncourageAdapter(Context context) {
super(context);
}
public class ViewHolder extends RecyclerView.ViewHolder {
@ -374,43 +407,24 @@ public class EncourageDialog extends AbsDialogFragment implements View.OnClickLi
}
}
@Override
public int getItemCount() {
return mDatas.size();
}
/**
* 创建ViewHolder
*/
@Override
public EncourageAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view;
view = mInflater.inflate(R.layout.item_encourage_list,
viewGroup, false);
EncourageAdapter.ViewHolder viewHolder = new EncourageAdapter.ViewHolder(view);
return viewHolder;
return new EncourageAdapter.ViewHolder(mInflater.inflate(R.layout.item_encourage_list, viewGroup, false));
}
/**
* 设置值
*/
@Override
public void onBindViewHolder(final EncourageAdapter.ViewHolder viewHolder, @SuppressLint("RecyclerView") final int position) {
ImgLoader.displayAvatar(mContext, mDatas.get(position).getUser_avatar(), viewHolder.avatar);
// LevelBean anchorLevelBean = CommonAppConfig.getInstance().getAnchorLevel(mDatas.getLevelAnchor());
// if (anchorLevelBean != null) {
// ImgLoader.display(mContext, CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), viewHolder.level_anchor);
// }
// LevelBean levelBean = CommonAppConfig.getInstance().getLevel(mDatas.getLevel());
// if (levelBean != null) {
// ImgLoader.display(mContext, levelBean.getThumb(), viewHolder.level);
// }
ImgLoader.display(mContext, mDatas.get(position).getGift_img(), viewHolder.tv_gift_pic);
viewHolder.name.setText(mDatas.get(position).getUser_name());
viewHolder.tv_gift_num.setText(mDatas.get(position).getGift_num());
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
ViewHolder viewHolder = (ViewHolder) holder;
ImgLoader.displayAvatar(mContext, mList.get(position).getUser_avatar(), viewHolder.avatar);
ImgLoader.display(mContext, mList.get(position).getGift_img(), viewHolder.tv_gift_pic);
viewHolder.name.setText(mList.get(position).getUser_name());
viewHolder.tv_gift_num.setText(mList.get(position).getGift_num());
}
}
}

View File

@ -692,12 +692,15 @@ public class MainHttpUtil {
/**
* 社区动态礼物信息列表
*/
public static void getDynamicSendGiftList(String id, HttpCallback callback) {
public static void getDynamicSendGiftList(String id, int page, HttpCallback callback) {
HttpClient.getInstance().get("Community.getDynamicSendGiftList", MainHttpConsts.GET_DYNAMICSENDGIFTLIST)
.params("dynamic_id", id)
.params("page", page)
.execute(callback);
}
/**
* 是否是主播
*/

View File

@ -251,10 +251,10 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
coin.setText(coins);
}
BigDecimal yuanbao = new BigDecimal(yuanbaos);
String yuanbaoStr =String.valueOf(yuanbao.intValue());
String yuanbaoStr = String.valueOf(yuanbao.intValue());
if (yuanbaoStr.length() > 9) {
star_coin.setText(yuanbaoStr.substring(0,yuanbaoStr.length() - 6) + "M");
} else if (yuanbaoStr.length()>7) {
star_coin.setText(yuanbaoStr.substring(0, yuanbaoStr.length() - 6) + "M");
} else if (yuanbaoStr.length() > 7) {
star_coin.setText(yuanbaoStr.substring(0, yuanbaoStr.length() - 3) + "K");
} else {
star_coin.setText(yuanbaos);
@ -326,7 +326,6 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
}
signature.setText(singnature);
CommonAppConfig appConfig = CommonAppConfig.getInstance();
LevelBean anchorLevelBean = appConfig.getAnchorLevel(u.getLevelAnchor());
if (u.getDress().getAvatar_frame() != null) {
if (u.getDress().getAvatar_frame().contains("svga")) {
@ -360,20 +359,20 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
if ("C".equals(u.getUsers_type())) {
Constants.isAnchor = true;
good_nub_ico.setImageResource(R.mipmap.usercard_good_nub);
if (anchorLevelBean != null) {
ImgLoader.display(mContext, CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), mLevel);
ImgLoader.display(mContext, R.mipmap.icon_zhubolv, img_lv_pic);
//主播等级
tv_level.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MobclickAgent.onEvent(mContext, "my_top_level", "个人中心最上面的等级");
String url = CommonAppConfig.HOST + "/h5/Grade/index.html?" + "token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&for";
ZhuangBanActivity.forward(mContext, url);
}
});
tv_level.setText(anchorLevelBean.getLevel() + "");
}
ImgLoader.display(mContext, R.mipmap.icon_zhubolv, img_lv_pic);
//主播等级
tv_level.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MobclickAgent.onEvent(mContext, "my_top_level", "个人中心最上面的等级");
String url = CommonAppConfig.HOST + "/h5/Grade/index.html?" + "token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&for";
ZhuangBanActivity.forward(mContext, url);
}
});
tv_level.setText(u.getLevel() + "");
} else {
Constants.isAnchor = false;
LevelBean levelBean = appConfig.getLevel(u.getLevel());

View File

@ -23,11 +23,13 @@ import com.yunbao.common.Constants;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.GoogleBean;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.UserItemBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.WordUtil;
@ -77,7 +79,7 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
private View v_noble;
// private LinearLayout btnUserNoble;
private ImageView user_noble_ico, good_nub_ico;
private TextView user_noble_text;
private TextView user_noble_text,leave;
private UserItemBean beanStetting = null, beanKefu = null;
private boolean firstInto = true;
@ -124,6 +126,7 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
btnCopy = (TextView) findViewById(R.id.btn_copy);
// btnUserNoble = (LinearLayout) findViewById(R.id.btn_user_noble);
user_noble_text = (TextView) findViewById(R.id.user_noble_text);
leave = (TextView) findViewById(R.id.leave);
img_kefu = (ImageView) findViewById(R.id.img_kefu);
img_setting = (ImageView) findViewById(R.id.img_setting);
@ -258,7 +261,7 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
gold.setText(u.getCoin());
signature.setText(u.getSignature());
CommonAppConfig appConfig = CommonAppConfig.getInstance();
LevelBean anchorLevelBean = appConfig.getAnchorLevel(u.getLevelAnchor());
if (u.getDress().getAvatar_frame() != null) {
if (u.getDress().getAvatar_frame().contains("svga")) {
@ -290,9 +293,20 @@ public class MainMeViewHolder1 extends AbsMainViewHolder implements OnItemClickL
user_noble_ico.setImageResource(R.mipmap.df_nobe);
}
if (anchorLevelBean != null) {
ImgLoader.display(mContext, CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), mLevelAnchor);
}
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = u.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
leave.setText(String.valueOf(u.getLevelAnchor()));
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
LevelBean levelBean = appConfig.getLevel(u.getLevel());
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);

View File

@ -4,9 +4,6 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import com.google.android.material.appbar.AppBarLayout;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.ViewPager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@ -16,24 +13,29 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.ViewPager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.android.material.appbar.AppBarLayout;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.activity.LiveContributeActivity;
import com.yunbao.live.activity.LiveGuardListActivity;
import com.yunbao.live.activity.SystemMessageActivity;
@ -87,7 +89,7 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
private AppBarLayout mAppBarLayout;
private ImageView mAvatarBg;
private ImageView mAvatar;
private TextView mName;
private TextView mName, leave;
private ImageView mSex;
private ImageView mLevelAnchor;
private ImageView mLevel;
@ -158,6 +160,7 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
mAvatarBg = (ImageView) findViewById(R.id.bg_avatar);
mAvatar = (ImageView) findViewById(R.id.avatar);
mName = (TextView) findViewById(R.id.name);
leave = (TextView) findViewById(R.id.leave);
mSex = (ImageView) findViewById(R.id.sex);
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
mLevel = (ImageView) findViewById(R.id.level);
@ -205,8 +208,8 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
}
});
mVideoString =mContext.getString(R.string.video);
mLiveString =mContext.getString(R.string.live);
mVideoString = mContext.getString(R.string.video);
mLiveString = mContext.getString(R.string.live);
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
final String[] titles = new String[]{mVideoString, mLiveString};
CommonNavigator commonNavigator = new CommonNavigator(mContext);
@ -354,15 +357,26 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
mTitleView.setText(toName);
mSex.setImageResource(CommonIconUtil.getSexIcon(userBean.getSex()));
CommonAppConfig appConfig = CommonAppConfig.getInstance();
LevelBean levelAnchor = appConfig.getAnchorLevel(userBean.getLevelAnchor());
ImgLoader.display(mContext, levelAnchor.getThumb(), mLevelAnchor);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = userBean.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
leave.setText(String.valueOf(anchorLevel));
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
LevelBean level = appConfig.getLevel(userBean.getLevel());
ImgLoader.display(mContext, level.getThumb(), mLevel);
mID.setText(userBean.getLiangNameTip());
String fansNum = StringUtil.toWan(userBean.getFans());
mBtnFans.setText(fansNum + " " +mContext.getString(R.string.fans));
mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " +mContext.getString(R.string.follow));
mBtnFans.setText(fansNum + " " + mContext.getString(R.string.fans));
mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " + mContext.getString(R.string.follow));
mSign.setText(userBean.getSignature());
mBtnFollow2.setText(obj.getIntValue("isattention") == 1 ? R.string.following : R.string.follow);
mBtnBlack.setText(obj.getIntValue("isblack") == 1 ? R.string.black_ing : R.string.black);
@ -374,7 +388,7 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
mLiveCountTextView.setText(mLiveString + " " + obj.getString("livenums"));
}
showImpress(obj.getString("label"));
mVotesName.setText(appConfig.getVotesName() +mContext.getString(R.string.live_user_home_con));
mVotesName.setText(appConfig.getVotesName() + mContext.getString(R.string.live_user_home_con));
mUserHomeSharePresenter.setToUid(mToUid).setToName(toName).setAvatarThumb(userBean.getAvatarThumb()).setFansNum(fansNum);
showContribute(obj.getString("contribute"));
showGuardList(obj.getString("guardlist"));
@ -396,7 +410,7 @@ public class UserHomeViewHolder extends AbsLivePageViewHolder implements AppBarL
}
if (!mSelf) {
ImpressBean lastBean = new ImpressBean();
lastBean.setName("+ " +mContext.getString(R.string.impress_add));
lastBean.setName("+ " + mContext.getString(R.string.impress_add));
lastBean.setColor("#ffdd00");
list.add(lastBean);
} else {

View File

@ -35,15 +35,21 @@ import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.event.UpdateFieldEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.manager.NewLevelManager;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
@ -52,10 +58,6 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.activity.LiveReportActivity;
import com.yunbao.live.bean.SearchUserBean;
import com.yunbao.live.dialog.LiveShareDialogFragment;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.live.presenter.UserHomeSharePresenter;
import com.yunbao.live.views.AbsLivePageViewHolder;
import com.yunbao.live.views.AbsUserHomeViewHolder;
@ -112,7 +114,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
private ImageView mLevel;
private TextView mID;
private View mBtnLive;
private TextView mBtnFans;
private TextView mBtnFans , leave;;
private TextView mBtnFollow;
private ImageView mFollowImage;
private int isblack;
@ -166,7 +168,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
}
String s =mContext.getString(R.string.black);
String s = mContext.getString(R.string.black);
@Override
public void init() {
@ -266,6 +268,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
mID = (TextView) findViewById(R.id.id_val);
good_nub_ico = (ImageView) findViewById(R.id.good_nub_ico);
mBtnFans = (TextView) findViewById(R.id.btn_fans);
leave = (TextView) findViewById(R.id.leave);
mBtnFollow = (TextView) findViewById(R.id.btn_follow);
gift_svga = (SVGAImageView) findViewById(com.yunbao.live.R.id.gift_svga);
mAvatar = (ImageView) findViewById(R.id.avatar);
@ -316,8 +319,8 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
}
});
mVideoString =mContext.getString(R.string.video);
mLiveString =mContext.getString(R.string.honor);
mVideoString = mContext.getString(R.string.video);
mLiveString = mContext.getString(R.string.honor);
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
final String[] titles = new String[]{mContext.getString(R.string.live_user_home_detail), mLiveString, mVideoString,};
// final String[] titles = new String[]{mContext.getString(R.string.live_user_home_detail), mVideoString}; //mxj update 2019-9-19
@ -500,9 +503,20 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
mName.setText(toName);
mSex.setImageResource(CommonIconUtil.getSexIcon(userBean.getSex()));
CommonAppConfig appConfig = CommonAppConfig.getInstance();
LevelBean levelAnchor = appConfig.getAnchorLevel(userBean.getLevelAnchor());
Log.i("Tag", CommonAppConfig.getInstance().HOST + levelAnchor.getThumb());
ImgLoader.display(mContext, CommonAppConfig.getInstance().HOST + levelAnchor.getThumb(), mLevelAnchor);
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
int anchorLevel = 0;
anchorLevel = userBean.getLevelAnchor();
String imgUrl = "";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getThumb();
}
}
leave.setText(String.valueOf(userBean.getLevelAnchor()));
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
LevelBean level = appConfig.getLevel(userBean.getLevel());
ImgLoader.display(mContext, level.getThumb(), mLevel);
//修改靓号图标 个人中心子页面
@ -515,8 +529,8 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
}
// mID.setText(" "+userBean.getLiangNameTip());
String fansNum = StringUtil.toWan(userBean.getFans());
mBtnFans.setText(fansNum + " " +mContext.getString(R.string.fans));
mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " +mContext.getString(R.string.follow));
mBtnFans.setText(fansNum + " " + mContext.getString(R.string.fans));
mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " + mContext.getString(R.string.follow));
if (obj.getIntValue("isattention") == 1) {
if (mFollowImage != null) {
@ -774,7 +788,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
if (mFromLiveRoom) {
if(MicStatusManager.getInstance().isMic(liveUid)){
if (MicStatusManager.getInstance().isMic(liveUid)) {
MicStatusManager.getInstance().showDownMicDialog(mContext);
return;
}
@ -864,8 +878,8 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
mSex.setImageResource(CommonIconUtil.getSexIcon(userBean.getSex()));
mID.setText(userBean.getLiangNameTip());
String fansNum = StringUtil.toWan(userBean.getFans());
mBtnFans.setText(fansNum + " " +mContext.getString(R.string.fans));
mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " +mContext.getString(R.string.follow));
mBtnFans.setText(fansNum + " " + mContext.getString(R.string.fans));
mBtnFollow.setText(StringUtil.toWan(userBean.getFollows()) + " " + mContext.getString(R.string.follow));
if (mDetailViewHolder != null) {
mDetailViewHolder.refreshData(userBean, obj);
}

View File

@ -406,7 +406,7 @@
android:orientation="vertical"
android:visibility="visible">
<androidx.recyclerview.widget.RecyclerView
<com.yunbao.common.custom.CommonRefreshView
android:id="@+id/rc_encourage"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="60dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
>
android:paddingRight="15dp">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
@ -15,8 +13,7 @@
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:scaleType="centerCrop"
app:riv_oval="true"
/>
app:riv_oval="true" />
<TextView
android:id="@+id/name"
@ -28,8 +25,7 @@
android:maxWidth="130dp"
android:singleLine="true"
android:textColor="@color/textColor"
android:textSize="16sp"
/>
android:textSize="16sp" />
<TextView
android:id="@+id/sign"
@ -41,17 +37,16 @@
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/gray3"
android:textSize="14sp"
/>
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/name"
android:layout_alignTop="@id/name"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@id/name"
android:orientation="horizontal">
<ImageView
@ -59,18 +54,33 @@
android:layout_width="18dp"
android:layout_height="15dp" />
<ImageView
android:id="@+id/level_anchor"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_marginLeft="5dp"/>
<FrameLayout
android:layout_width="55dp"
android:layout_height="19dp">
<ImageView
android:id="@+id/level_anchor"
android:layout_width="55dp"
android:layout_height="19dp" />
<TextView
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="28dp"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</FrameLayout>
<ImageView
android:id="@+id/level"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_marginLeft="5dp"
/>
android:layout_marginLeft="5dp" />
</LinearLayout>
@ -86,23 +96,21 @@
android:gravity="center"
android:textColor="@color/fg_btn_follow"
android:textSize="11sp"
android:visibility="gone"
/>
android:visibility="gone" />
<pl.droidsonroids.gif.GifImageView
android:id="@+id/btn_live"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:visibility="gone"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@mipmap/icon_user_home_living"/>
android:adjustViewBounds="true"
android:src="@mipmap/icon_user_home_living"
android:visibility="gone" />
<View
style="@style/line2"
android:layout_alignParentBottom="true"
/>
android:layout_alignParentBottom="true" />
</RelativeLayout>

View File

@ -1,28 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
>
android:background="@color/white">
<FrameLayout
android:id="@+id/bottom"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_alignParentBottom="true"
>
android:layout_alignParentBottom="true">
<View
style="@style/line2"
/>
<View style="@style/line2" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
android:orientation="horizontal">
<TextView
android:id="@+id/btn_follow_2"
@ -33,16 +27,14 @@
android:text="@string/follow"
android:textColor="@color/textColor2"
android:textSize="15sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="@color/gray2"
/>
android:layout_marginBottom="10dp"
android:background="@color/gray2" />
<TextView
android:id="@+id/btn_pri_msg"
@ -53,16 +45,14 @@
android:text="@string/pri_msg"
android:textColor="@color/textColor2"
android:textSize="15sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="@color/gray2"
/>
android:layout_marginBottom="10dp"
android:background="@color/gray2" />
<TextView
android:id="@+id/btn_black"
@ -73,8 +63,7 @@
android:text="@string/black"
android:textColor="@color/textColor2"
android:textSize="15sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
</LinearLayout>
</FrameLayout>
@ -82,8 +71,7 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bottom"
>
android:layout_above="@id/bottom">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
@ -92,45 +80,39 @@
android:background="@color/transparent"
android:fadingEdge="none"
app:elevation="0dp"
app:layout_behavior="com.yunbao.common.custom.FixAppBarLayoutBehavior"
>
app:layout_behavior="com.yunbao.common.custom.FixAppBarLayoutBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="65dp"
android:orientation="vertical"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
>
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="220dp"
>
android:layout_height="220dp">
<ImageView
android:id="@+id/bg_avatar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
/>
android:scaleType="centerCrop" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#b3000000"
/>
android:background="#b3000000" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="20dp"
android:layout_marginTop="70dp"
android:layout_marginRight="20dp"
android:scaleType="centerCrop"
app:riv_oval="true"
/>
app:riv_oval="true" />
<TextView
android:id="@+id/name"
@ -140,35 +122,48 @@
android:layout_toRightOf="@id/avatar"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<ImageView
android:id="@+id/sex"
android:layout_width="18dp"
android:layout_height="15dp"
android:layout_below="@id/name"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/avatar"
/>
android:layout_marginRight="5dp"
android:layout_toRightOf="@id/avatar" />
<ImageView
android:id="@+id/level_anchor"
android:layout_width="30dp"
android:layout_height="15dp"
<FrameLayout
android:layout_width="55dp"
android:layout_height="19dp"
android:layout_alignTop="@id/sex"
android:layout_marginRight="5dp"
android:layout_toRightOf="@id/sex"
/>
android:layout_toRightOf="@id/sex">
<ImageView
android:id="@+id/level_anchor"
android:layout_width="55dp"
android:layout_height="19dp" />
<TextView
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="28dp"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</FrameLayout>
<ImageView
android:id="@+id/level"
android:layout_width="30dp"
android:layout_height="15dp"
android:layout_alignTop="@id/sex"
android:layout_toRightOf="@id/level_anchor"
/>
android:layout_toRightOf="@id/level_anchor" />
<TextView
android:id="@+id/id_val"
@ -178,8 +173,7 @@
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/avatar"
android:textColor="@color/white"
android:textSize="14sp"
/>
android:textSize="14sp" />
<TextView
android:id="@+id/btn_fans"
@ -189,21 +183,19 @@
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:textColor="@color/white"
android:textSize="14sp"
/>
android:textSize="14sp" />
<View
android:id="@+id/line"
android:layout_width="1dp"
android:layout_height="12dp"
android:layout_alignTop="@id/btn_fans"
android:layout_below="@id/avatar"
android:layout_alignTop="@id/btn_fans"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="3dp"
android:layout_marginRight="15dp"
android:layout_toRightOf="@id/btn_fans"
android:background="@color/white"
/>
android:background="@color/white" />
<TextView
android:id="@+id/btn_follow"
@ -212,8 +204,7 @@
android:layout_alignTop="@id/btn_fans"
android:layout_toRightOf="@id/line"
android:textColor="@color/white"
android:textSize="14sp"
/>
android:textSize="14sp" />
<TextView
android:id="@+id/sign"
@ -221,38 +212,34 @@
android:layout_height="wrap_content"
android:layout_below="@id/btn_fans"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="12dp"
android:layout_marginRight="15dp"
android:singleLine="true"
android:textColor="#fff"
android:textSize="14sp"
/>
android:textSize="14sp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:text="@string/impress"
android:textColor="@color/textColor2"
android:textSize="15dp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginLeft="15dp"
>
android:layout_marginLeft="15dp">
<LinearLayout
android:id="@+id/impress_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
/>
android:orientation="horizontal" />
<TextView
android:id="@+id/no_impress_tip"
@ -262,16 +249,14 @@
android:text="@string/impress_tip_3"
android:textColor="@color/gray3"
android:textSize="14sp"
android:visibility="invisible"
/>
android:visibility="invisible" />
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginTop="5dp"
android:background="@color/gray2"
/>
android:background="@color/gray2" />
<LinearLayout
android:id="@+id/con_group_wrap"
@ -280,14 +265,12 @@
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp"
>
android:paddingRight="15dp">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/icon_live_user_home_1"
/>
android:src="@mipmap/icon_live_user_home_1" />
<TextView
android:id="@+id/votes_name"
@ -295,8 +278,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:textSize="15sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<LinearLayout
@ -307,21 +289,17 @@
android:layout_marginRight="10dp"
android:layout_weight="1"
android:gravity="right"
android:orientation="horizontal"
/>
android:orientation="horizontal" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:src="@mipmap/icon_arrow_right"
/>
android:src="@mipmap/icon_arrow_right" />
</LinearLayout>
<View
style="@style/line2"
/>
<View style="@style/line2" />
<LinearLayout
android:id="@+id/guard_group_wrap"
@ -330,14 +308,12 @@
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp"
>
android:paddingRight="15dp">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/icon_live_user_home_2"
/>
android:src="@mipmap/icon_live_user_home_2" />
<TextView
android:layout_width="wrap_content"
@ -345,8 +321,7 @@
android:layout_marginLeft="8dp"
android:text="@string/guard_list"
android:textSize="15sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<LinearLayout
android:id="@+id/guard_group"
@ -356,14 +331,12 @@
android:layout_marginRight="10dp"
android:layout_weight="1"
android:gravity="right"
android:orientation="horizontal"
/>
android:orientation="horizontal" />
<ImageView
android:layout_width="16dp"
android:layout_height="18dp"
android:src="@mipmap/icon_arrow_right"
/>
android:src="@mipmap/icon_arrow_right" />
</LinearLayout>
@ -372,14 +345,12 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/gray2"
/>
android:background="@color/gray2" />
<net.lucode.hackware.magicindicator.MagicIndicator
@ -387,13 +358,10 @@
android:layout_width="wrap_content"
android:layout_height="33dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
/>
android:layout_marginBottom="5dp" />
<View
style="@style/line2"
/>
<View style="@style/line2" />
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
@ -403,8 +371,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@ -412,8 +379,7 @@
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="65dp"
android:clickable="true"
>
android:clickable="true">
<TextView
android:id="@+id/titleView"
@ -425,8 +391,7 @@
android:paddingTop="30dp"
android:textColor="@color/textColor"
android:textSize="18sp"
android:textStyle="bold"
/>
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_back"
@ -436,20 +401,18 @@
android:layout_marginBottom="3dp"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/white"
/>
android:tint="@color/white" />
<ImageView
android:id="@+id/btn_share"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="3dp"
android:padding="8dp"
android:src="@mipmap/icon_user_home_share"
android:tint="@color/white"
/>
android:tint="@color/white" />
</RelativeLayout>
</RelativeLayout>

View File

@ -219,10 +219,27 @@
android:gravity="bottom"
android:orientation="horizontal">
<ImageView
android:id="@+id/level_anchor"
android:layout_width="30dp"
android:layout_height="15dp" />
<FrameLayout
android:layout_width="55dp"
android:layout_height="19dp">
<ImageView
android:id="@+id/level_anchor"
android:layout_width="55dp"
android:layout_height="19dp" />
<TextView
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="28dp"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</FrameLayout>
<ImageView
android:id="@+id/level"

View File

@ -126,12 +126,30 @@
android:layout_height="15dp"
android:src="@mipmap/icon_userlv" />
<ImageView
android:id="@+id/level_anchor"
android:layout_width="30dp"
android:layout_height="15dp"
<FrameLayout
android:id="@+id/level_anchor_la"
android:layout_width="55dp"
android:layout_height="19dp"
android:layout_marginLeft="5dp"
android:visibility="gone" />
android:visibility="gone">
<ImageView
android:id="@+id/level_anchor"
android:layout_width="55dp"
android:layout_height="19dp" />
<TextView
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="28dp"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</FrameLayout>
<ImageView
android:id="@+id/level"