Merge branch 'dev_hour_rank'
This commit is contained in:
@@ -56,6 +56,7 @@ import com.yunbao.live.dialog.LiveGuardDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveInputDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveMoreDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewGuardBuyDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewGuardListDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveRedPackListDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveRedPackSendDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||
@@ -118,6 +119,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
protected int mSocketUserType;//socket用户类型 30 普通用户 40 管理员 50 主播 60超管
|
||||
public static String mStream;
|
||||
protected String mAncherName;
|
||||
protected String mAncherIcon;
|
||||
public static String mLiveUid;
|
||||
protected String mDanmuPrice;//弹幕价格
|
||||
protected String mCoinName;//钻石名称
|
||||
@@ -133,6 +135,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
private LiveChatRoomDialogFragment mLiveChatRoomDialogFragment;//私信聊天窗口
|
||||
protected LiveGuardInfo mLiveGuardInfo;
|
||||
private HashSet<DialogFragment> mDialogFragmentSet;
|
||||
private LiveEnterRoomBean userBean;//用户信息
|
||||
// public static boolean isRy = true;
|
||||
|
||||
@Override
|
||||
@@ -260,6 +263,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
mLiveRoomViewHolder.onEnterRoom(bean);
|
||||
}
|
||||
}
|
||||
public void setEnterRoomData(LiveEnterRoomBean bean){
|
||||
userBean=bean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -1251,6 +1257,18 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
|
||||
}
|
||||
/**
|
||||
* 守护列表弹窗
|
||||
*/
|
||||
public void openNewGuardListWindow() {
|
||||
LiveNewGuardListDialogFragment fragment = new LiveNewGuardListDialogFragment();
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putBoolean(Constants.ANCHOR, mIsAnchor);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
|
||||
}
|
||||
|
||||
/**
|
||||
* 打開粉絲團
|
||||
@@ -1315,6 +1333,8 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_ANCHER_NAME, mAncherName);
|
||||
bundle.putString(Constants.STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_ANCHER_ICON,mAncherIcon);
|
||||
bundle.putString(Constants.USER_ICON,userBean.getUserBean().getAvatar());
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
|
||||
}
|
||||
|
||||
@@ -275,6 +275,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
mLiveUid = mLiveBean.getUid();
|
||||
mStream = mLiveBean.getStream();
|
||||
mAncherName = liveBean.getUserNiceName();
|
||||
mAncherIcon = liveBean.getAvatar();
|
||||
|
||||
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
|
||||
//加载当前页面数据
|
||||
@@ -552,6 +553,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
mLiveUid = liveBean.getUid();
|
||||
mStream = liveBean.getStream();
|
||||
mAncherName = liveBean.getUserNiceName();
|
||||
mAncherIcon = liveBean.getAvatar();
|
||||
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -35,9 +37,11 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
private Drawable mGuardDrawable0;
|
||||
private Drawable mGuardDrawable1;
|
||||
private Drawable mGuardDrawable2;
|
||||
private boolean isShowTitle;
|
||||
|
||||
public GuardAdapter(Context context, boolean dialog) {
|
||||
public GuardAdapter(Context context, boolean dialog, boolean isShowTitle) {
|
||||
super(context);
|
||||
this.isShowTitle = isShowTitle;
|
||||
mDialog = dialog;
|
||||
mVotesName = CommonAppConfig.getInstance().getVotesName();
|
||||
mWeekContributeString = WordUtil.getString(R.string.guard_week_con);
|
||||
@@ -46,9 +50,15 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
mGuardDrawable2 = ContextCompat.getDrawable(context, R.mipmap.icon_guard_type_2);
|
||||
}
|
||||
|
||||
public GuardAdapter(Context context, boolean dialog) {
|
||||
this(context, dialog, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if(!isShowTitle){
|
||||
return NORMAL;
|
||||
}
|
||||
if (position == 0) {
|
||||
return HEAD;
|
||||
}
|
||||
@@ -105,7 +115,7 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
mVotes.setText(Html.fromHtml( " <font color='#ffdd00'>" + bean.getContribute() + "</font> " + mVotesName));
|
||||
mVotes.setText(Html.fromHtml(" <font color='#ffdd00'>" + bean.getContribute() + "</font> " + mVotesName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +152,7 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
mIcon.setImageDrawable(mGuardDrawable0);
|
||||
} else if (bean.getType() == Constants.GUARD_TYPE_MONTH) {
|
||||
mIcon.setImageDrawable(mGuardDrawable1);
|
||||
} else if (bean.getType() == Constants.GUARD_TYPE_YEAR){
|
||||
} else if (bean.getType() == Constants.GUARD_TYPE_YEAR) {
|
||||
mIcon.setImageDrawable(mGuardDrawable2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -16,10 +20,13 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
@@ -48,17 +55,27 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
|
||||
|
||||
private RecyclerView mRights;//权益列表
|
||||
private RecyclerView mBuys;//购买列表
|
||||
private RoundedImageView userIcon, userIconOne, userIconTwo;
|
||||
private SVGAImageView iconCover;
|
||||
private TextView anchorName;
|
||||
private TextView guardCoin2;
|
||||
private TextView guardBuy;
|
||||
private TextView guard_tips;
|
||||
private Button submit;
|
||||
private LinearLayout buy2;
|
||||
private RelativeLayout buy1;
|
||||
private TextView mCoin;
|
||||
private String mCoinName;
|
||||
private TextView mCoinNameTextView;
|
||||
private View mBtnBuy;
|
||||
private List<GuardRightBean> mRightList=new ArrayList<>();//权限列表
|
||||
private List<GuardRightBean> mRightList = new ArrayList<>();//权限列表
|
||||
private List<GuardBuyBean> mBuyList;//商品列表
|
||||
private long mCoinVal;//余额
|
||||
private String mLiveUid;
|
||||
private String mStream;
|
||||
private String mAncherName;
|
||||
private String mAncherIcon;
|
||||
private String mUserIcon;
|
||||
private LiveGuardInfo mLiveGuardInfo;
|
||||
private GuardBuyBean mTargetBuyBean;
|
||||
|
||||
@@ -105,11 +122,26 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
|
||||
mRights = mRootView.findViewById(R.id.guard_rights);
|
||||
mBuys = mRootView.findViewById(R.id.guard_buys);
|
||||
anchorName = mRootView.findViewById(R.id.guard_anchor_name);
|
||||
userIcon = mRootView.findViewById(R.id.guard_imageView);
|
||||
userIconOne = mRootView.findViewById(R.id.guard_imageView_one);
|
||||
userIconTwo = mRootView.findViewById(R.id.guard_imageView_two);
|
||||
iconCover = mRootView.findViewById(R.id.gift_svga);
|
||||
guardCoin2 = mRootView.findViewById(R.id.guard_coin2);
|
||||
guardBuy = mRootView.findViewById(R.id.guard_buy);
|
||||
submit = mRootView.findViewById(R.id.guard_submit);
|
||||
buy1 = mRootView.findViewById(R.id.buy1);
|
||||
buy2 = mRootView.findViewById(R.id.buy2);
|
||||
guard_tips = mRootView.findViewById(R.id.guard_textView2);
|
||||
|
||||
iconCover.setImageResource(R.drawable.guardian_img_wings);
|
||||
|
||||
mBtnBuy.setOnClickListener(this);
|
||||
submit.setOnClickListener(this);
|
||||
guardBuy.setOnClickListener(this);
|
||||
mRights.setHasFixedSize(true);
|
||||
mRights.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
mBuys.setHasFixedSize(true);
|
||||
mBuys.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false){
|
||||
mBuys.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false) {
|
||||
@Override
|
||||
public boolean canScrollHorizontally() {//购买列表禁止滑动
|
||||
return false;
|
||||
@@ -127,10 +159,13 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
|
||||
if (bundle != null) {
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
mStream = bundle.getString(Constants.STREAM);
|
||||
mAncherName=bundle.getString(Constants.LIVE_ANCHER_NAME);
|
||||
mAncherName = bundle.getString(Constants.LIVE_ANCHER_NAME);
|
||||
mAncherIcon = bundle.getString(Constants.LIVE_ANCHER_ICON);
|
||||
mUserIcon = bundle.getString(Constants.USER_ICON);
|
||||
String coinName = WordUtil.getString(R.string.diamond);
|
||||
mCoinName = coinName;
|
||||
mCoinNameTextView.setText(WordUtil.getString(R.string.guard_my) + coinName + ":");
|
||||
// mCoinNameTextView.setText(WordUtil.getString(R.string.guard_my) + coinName + ":");
|
||||
mCoinNameTextView.setText("快为您喜欢的主播开通守护吧");
|
||||
anchorName.setText(String.format("成爲%s的守護", mAncherName));
|
||||
}
|
||||
LiveHttpUtil.getGuardBuyList(new HttpCallback() {
|
||||
@@ -146,6 +181,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
|
||||
e.printStackTrace();
|
||||
}
|
||||
mCoin.setText(String.valueOf(mCoinVal));
|
||||
guardCoin2.setText(WordUtil.getString(R.string.guard_my) + mCoinName + ":" + mCoinVal);
|
||||
buyItemsAdapter.setItems(mBuyList);
|
||||
mGuardRightAdapter.setList(mRightList);
|
||||
buyItemsAdapter.notifyDataSetChanged();
|
||||
@@ -157,13 +193,46 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
|
||||
}
|
||||
}
|
||||
});
|
||||
setIcon();
|
||||
}
|
||||
|
||||
private void setIcon() {
|
||||
int guardType = mLiveGuardInfo.getMyGuardType();
|
||||
if (guardType == Constants.GUARD_TYPE_NONE) {
|
||||
iconCover.setBackgroundResource(R.drawable.guardian_img_wings);
|
||||
buy1.setVisibility(View.VISIBLE);
|
||||
buy2.setVisibility(View.GONE);
|
||||
} else {
|
||||
buy2.setVisibility(View.VISIBLE);
|
||||
buy1.setVisibility(View.GONE);
|
||||
userIconOne.setVisibility(View.VISIBLE);
|
||||
userIconTwo.setVisibility(View.VISIBLE);
|
||||
iconCover.setImageResource(R.drawable.guardian_img_two);
|
||||
ImgLoader.display(mContext, mAncherIcon, userIconOne);
|
||||
ImgLoader.display(mContext, mUserIcon, userIconTwo);
|
||||
String title = "";
|
||||
switch (guardType) {
|
||||
case Constants.GUARD_TYPE_DAY:
|
||||
title = "您是當前主播的周守護";
|
||||
break;
|
||||
case Constants.GUARD_TYPE_MONTH:
|
||||
title = "您是當前主播的月守護";
|
||||
break;
|
||||
case Constants.GUARD_TYPE_YEAR:
|
||||
title = "您是當前主播的年守護";
|
||||
break;
|
||||
}
|
||||
anchorName.setText(title);
|
||||
guard_tips.setText("守護日期截止到:"+ mLiveGuardInfo.getMyGuardEndTime());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void refreshList(int index) {
|
||||
if (!mRightList.isEmpty()) {
|
||||
GuardBuyBean guardBuyBean = mBuyList.get(index - 1);
|
||||
mTargetBuyBean=guardBuyBean;
|
||||
mTargetBuyBean = guardBuyBean;
|
||||
for (GuardRightBean bean : mRightList) {
|
||||
bean.setChecked(false);
|
||||
}
|
||||
@@ -177,18 +246,15 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int i = view.getId();
|
||||
if (i == R.id.guard_btn_buy) {
|
||||
if (i == R.id.guard_btn_buy || i == R.id.guard_submit) {
|
||||
clickBuyGuard();
|
||||
} else if (i == R.id.guard_buy) {
|
||||
forwardMyCoin();
|
||||
|
||||
}
|
||||
// else if (i == R.id.coin) {
|
||||
// forwardMyCoin();
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.adapter.GuardAdapter;
|
||||
import com.yunbao.live.bean.GuardUserBean;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements View.OnClickListener {
|
||||
private ImageView guardIcon, userSex, userLevel;
|
||||
private ConstraintLayout mRootLayout;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private TextView mBtnBuy, userName, userGuard,tip1, tip2;
|
||||
private SVGAImageView giftSvga;
|
||||
private LinearLayout userLayout;
|
||||
|
||||
private GuardAdapter mGuardAdapter;
|
||||
private LiveGuardInfo mLiveGuardInfo;
|
||||
private String mLiveUid;
|
||||
private boolean mIsAnchor;//是否是主播
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_new_guard_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canCancel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setLiveGuardInfo(LiveGuardInfo info) {
|
||||
mLiveGuardInfo = info;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
Bundle bundle = getArguments();
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
mIsAnchor = bundle.getBoolean(Constants.ANCHOR, false);
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
guardIcon = mRootView.findViewById(R.id.guard_imageView);
|
||||
mRootLayout = mRootView.findViewById(R.id.guard_constraintLayout);
|
||||
mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy);
|
||||
giftSvga = mRootView.findViewById(R.id.gift_svga);
|
||||
mRefreshView = mRootView.findViewById(R.id.refreshView);
|
||||
userName = mRootView.findViewById(R.id.list_guard_list_user_name);
|
||||
userGuard = mRootView.findViewById(R.id.list_guard_list_user_guard);
|
||||
userLevel = mRootView.findViewById(R.id.list_guard_list_user_level);
|
||||
userSex = mRootView.findViewById(R.id.list_guard_list_user_sex);
|
||||
userLayout = mRootView.findViewById(R.id.guard_linearLayout);
|
||||
tip1 = mRootView.findViewById(R.id.guard_tip1);
|
||||
tip2 = mRootView.findViewById(R.id.guard_tip2);
|
||||
mBtnBuy.setOnClickListener(this);
|
||||
mBtnBuy.setEnabled(true);
|
||||
mBtnBuy.setText(R.string.guard_buy_2);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mRefreshView.setEmptyLayoutId(mIsAnchor ? R.layout.view_no_data_guard_anc : R.layout.view_no_data_guard_aud);
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<GuardUserBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<GuardUserBean> getAdapter() {
|
||||
if (mGuardAdapter == null) {
|
||||
mGuardAdapter = new GuardAdapter(mContext, true, false);
|
||||
}
|
||||
return mGuardAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
LiveHttpUtil.getGuardList(mLiveUid, p, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GuardUserBean> processData(String[] info) {
|
||||
List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class);
|
||||
if (list.isEmpty()) {
|
||||
userLayout.setVisibility(View.INVISIBLE);
|
||||
}else {
|
||||
GuardUserBean bean = list.get(0);
|
||||
giftSvga.setImageResource(R.drawable.guardian_img_wings_p);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), guardIcon);
|
||||
guardIcon.setVisibility(View.VISIBLE);
|
||||
userName.setText(bean.getUserNiceName());
|
||||
String guardString = WordUtil.getString(R.string.guard_week_con);
|
||||
userGuard.setText(guardString + " " + bean.getContribute());
|
||||
userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), userLevel);
|
||||
}
|
||||
}
|
||||
if (mLiveGuardInfo != null) {
|
||||
int guardType = mLiveGuardInfo.getMyGuardType();
|
||||
if (guardType == Constants.GUARD_TYPE_NONE) {
|
||||
tip1.setText(R.string.guard_tip_0);
|
||||
} else if (guardType == Constants.GUARD_TYPE_DAY) {
|
||||
tip1.setText(WordUtil.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime());
|
||||
mBtnBuy.setText(R.string.guard_buy_3);
|
||||
} else if (guardType == Constants.GUARD_TYPE_MONTH) {
|
||||
tip1.setText(WordUtil.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime());
|
||||
mBtnBuy.setText(R.string.guard_buy_3);
|
||||
} else if (guardType == Constants.GUARD_TYPE_YEAR) {
|
||||
tip1.setText(WordUtil.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime());
|
||||
mBtnBuy.setText(R.string.guard_buy_3);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<GuardUserBean> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<GuardUserBean> loadItemList, int loadItemCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openNewBuyGuardWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int show(@NonNull FragmentTransaction transaction, @Nullable String tag) {
|
||||
int show = super.show(transaction, tag);
|
||||
initView();
|
||||
return show;
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
||||
((LiveActivity) mContext).openLuckGiftTip();
|
||||
} else if (Tips.equals("2")) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openGuardListWindow();
|
||||
((LiveActivity) mContext).openNewGuardListWindow();
|
||||
} else if (Tips.equals("3")) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openFansWindow();
|
||||
|
||||
@@ -112,6 +112,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
@@ -1059,8 +1060,32 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
wishListFlipper.startFlipping();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化小时榜。
|
||||
* 等待接口
|
||||
* TextView得独立出来用来替换数字
|
||||
*/
|
||||
protected void initHourRankList(){
|
||||
((Activity)mContext).runOnUiThread(()->{
|
||||
ViewFlipper flipper= (ViewFlipper) findViewById(R.id.hour_rank_list);
|
||||
for (int i = 0; i < 2; i++) {
|
||||
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(DpUtil.dp2px(44),DpUtil.dp2px(16));
|
||||
View wish = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
|
||||
ImageView wishPic = wish.findViewById(R.id.wish_pic);
|
||||
TextView wishIndex = wish.findViewById(R.id.wish_index);
|
||||
if(i==0) {
|
||||
wishPic.setImageResource(R.drawable.live_tags_hot);
|
||||
}else{
|
||||
wishPic.setImageResource(R.drawable.live_tags_hour_list);
|
||||
}
|
||||
wishPic.setLayoutParams(params);
|
||||
wishIndex.setText(new Random().nextInt(5000)+"");
|
||||
flipper.addView(wish);
|
||||
}
|
||||
flipper.startFlipping();
|
||||
});
|
||||
}
|
||||
|
||||
//点击头像
|
||||
@@ -1476,7 +1501,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
//直播间 粉丝排行榜
|
||||
openMedalRankWindow();
|
||||
} else if (i == R.id.btn_guard) {
|
||||
((LiveActivity) mContext).openGuardListWindow();
|
||||
((LiveActivity) mContext).openNewGuardListWindow();
|
||||
} else if (i == R.id.btn_red_pack) {
|
||||
((LiveActivity) mContext).openRedPackListWindow();
|
||||
|
||||
@@ -1496,7 +1521,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
((LiveActivity) mContext).openHotListWindow(1);
|
||||
} else if (i == R.id.user_guard) {
|
||||
// ((LiveActivity) mContext).openUserMoreListWindow(2, true);
|
||||
((LiveActivity) mContext).openGuardListWindow();
|
||||
((LiveActivity) mContext).openNewGuardListWindow();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1771,6 +1796,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
if (bean == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mLiveEnterRoomAnimPresenter != null) {
|
||||
mLiveEnterRoomAnimPresenter.enterRoom(bean);
|
||||
}
|
||||
@@ -1785,6 +1811,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
setGuardIcon(tmp);
|
||||
}
|
||||
((LiveActivity)mContext).setEnterRoomData(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -267,6 +267,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
enterRoom();
|
||||
}
|
||||
});
|
||||
mLiveRoomViewHolder.initHourRankList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user