完成新个人名片

完成直播间主播靓号标识
This commit is contained in:
zlzw 2022-11-09 11:00:49 +08:00
parent 5ed5b15737
commit 71713e5b37
8 changed files with 128 additions and 46 deletions

View File

@ -479,6 +479,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
mLiveRoomViewHolder.setAvatar(u.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(u.getLevelAnchor());
mLiveRoomViewHolder.setLiveUid(u.getId());
mLiveRoomViewHolder.setAnchorGoodNumber(u.getGoodName());
}
mLiveRoomViewHolder.initHourRankList();
mLiveRoomViewHolder.startAnchorLight();

View File

@ -46,7 +46,6 @@ import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.JsonBean;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.BitmapUtil;
import com.yunbao.common.utils.Bus;
@ -597,6 +596,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.setName(u.getUserNiceName());
mLiveRoomViewHolder.setAvatar(u.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(u.getLevelAnchor());
mLiveRoomViewHolder.setAnchorGoodNumber(u.getGoodName());
mLiveRoomViewHolder.initHourRankList();
}
mLiveRoomViewHolder.startAnchorLight();

View File

@ -42,6 +42,7 @@ import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.NobleUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
@ -109,6 +110,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
private TextView mNobleVal;
private TextView mReport;
private TextView mGuard;
private TextView mUnion;
private TextView mHonorVal;
private ImageView mFollowImage;
private ImageView mSex;
private ImageView good_nub_ico;
@ -121,6 +124,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
private ImageView honorIcon;
private UserBean mUserBean;
private LinearLayout mGuardLayout;
private LinearLayout mUnionLayout;
private boolean mFollowing;
GifImageView btn_live;
SVGAImageView gift_svga;
@ -226,6 +230,9 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
mGuard = mRootView.findViewById(R.id.guard_val);
mNobleIcon = mRootView.findViewById(R.id.noble_icon);
honorIcon = mRootView.findViewById(R.id.honor_icon);
mUnionLayout = mRootView.findViewById(R.id.btn_union);
mUnion = mRootView.findViewById(R.id.union_val);
mHonorVal = mRootView.findViewById(R.id.honor_val);
}
private void initListener() {
@ -274,6 +281,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
private void showData(String data) {
Log.i(TAG, "showData: " + data);
boolean isAnchor = mLiveUid.equals(mToUid);
JSONObject obj = JSON.parseObject(data);
mUserBean = JSON.toJavaObject(obj, UserBean.class);
if (mUserBean.getIslive().equals("1")) {
@ -281,8 +289,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
} else {
btn_live.setVisibility(View.GONE);
}
if (mLiveUid.equals(mToUid)) {
if (isAnchor) {
mGuardLayout.setVisibility(View.VISIBLE);
if (obj.containsKey("user_president_name") && !StringUtil.isEmpty(obj.getString("user_president_name"))) {
mUnion.setText(obj.getString("user_president_name"));
mUnionLayout.setVisibility(View.VISIBLE);
}
mNoble.setVisibility(View.GONE);
}
mName.setText(obj.getString("user_nicename"));
if (mUserBean.getGoodnum() != null && !mUserBean.getGoodnum().equals("")) {
@ -316,19 +329,20 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
});
ImgLoader.display(mContext, levelBean.getBgIcon(), mLiveIcon2);
FansMedalBean fansMedalBean = CommonAppConfig.getInstance().getAnchorFansMedal(obj.getIntValue("medal_level"));
if (fansMedalBean != null) {
if (fansMedalBean != null && !isAnchor) {
ImgLoader.display(mContext, fansMedalBean.getThumb(), mNoble);
} else {
mNoble.setVisibility(View.INVISIBLE);
mNoble.setVisibility(View.GONE);
}
mGuard.setText(String.format(mGuard.getText().toString(), guardNumber));
mFansVal.setText(WordUtil.getString(R.string.fans) + ":" + mUserBean.getFans());
mPraise.setText(WordUtil.getString(R.string.praise) + ":" + mUserBean.getPraise());
mPraise.setText(WordUtil.getString(R.string.praise) + ":" + obj.getInteger("user_love_num"));
mSignDesc.setText(mUserBean.getSignature());
mNobleVal.setText(NobleUtil.nobleIdToStringName(Integer.parseInt(mUserBean.getNoble_id())));
ImgLoader.displayAvatar(mContext, obj.getString("avatar"), mAvatar);
JSONObject dress = obj.getJSONObject("dress");
mHonorVal.setText(dress.getInteger("medal_num") + "");
if (obj.containsKey("level_thumb")) {
ImgLoader.display(mContext, obj.getJSONObject("level_thumb").getString("icon"), mLiveIcon2);
} else {
@ -345,8 +359,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
}
if (item != null) {
String url = item.getString("display_src");
if (item.containsKey("noble_medal") && !isAnchor) {
mNoble.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, item.getString("noble_medal"), mNoble);
}
if (url != null) {
url = url.replace("qny.shayucm.com", "downs.yaoulive.com");
mNobleIcon.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, url, mNobleIcon);
} else {
mNobleIcon.setVisibility(View.INVISIBLE);
@ -355,12 +374,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
} else {
mNobleIcon.setVisibility(View.INVISIBLE);
}
if (obj.containsKey("medal_no")) {
if (dress.containsKey("medal_no")) {
JSONObject item = null;
if (obj.getJSONArray("medal_no").size() > 0) {
item = obj.getJSONArray("medal_no").getJSONObject(0);
if (dress.getJSONArray("medal_no").size() > 0) {
item = dress.getJSONArray("medal_no").getJSONObject(0);
String url = item.getString("display_src");
url = url.replace("qny.shayucm.com", "downs.yaoulive.com");
honorIcon.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, url, honorIcon);
}
} else {

View File

@ -125,7 +125,6 @@ import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
import com.yunbao.live.dialog.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveOldUserDialogFragment;
import com.yunbao.live.dialog.LiveUserDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
import com.yunbao.live.event.LiveAudienceEvent;
@ -299,6 +298,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private List<WishlistItemModel> wishlist = new ArrayList<>();
private TextView mHourRank, mHotText;
private LinearLayout msg; //默认悬浮窗布局
private LinearLayout mAnchorLayout;
private ImageView mGoodNumberIcon;
private View msg2; //悬浮窗来私信的布局
private ConstraintLayout msgLayout; //悬浮窗
private TextView msgNumber;//悬浮窗左上角数标
@ -766,6 +767,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
fans = (TextView) findViewById(R.id.fans);
fans_btn = (LinearLayout) findViewById(R.id.fans_btn);
wishListLayout = (LinearLayout) findViewById(R.id.wish_list_layout);
mAnchorLayout = (LinearLayout) findViewById(R.id.group_1);
mGoodNumberIcon = (ImageView) findViewById(R.id.good_nub_ico);
if (LivePushTxViewHolder.mTRTCCloud != null || LivePushRyViewHolder.rtcRoom != null) {
fans_btn.setVisibility(View.GONE);
@ -1051,6 +1054,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
Log.e("PortraitLiveManager", error);
}
});
}
public synchronized void showStart(StarChallengeStatusModel data) {
@ -2878,6 +2882,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
fragment.show(((LiveActivity) mContext).getSupportFragmentManager(), "faceUi");
}
public void setAnchorGoodNumber(String goodNumber) {
if (!StringUtil.isEmpty(goodNumber) && !goodNumber.equals("0")) {
mAnchorLayout.setBackgroundResource(R.drawable.bg_live_anchor_goodnum);
mGoodNumberIcon.setVisibility(View.VISIBLE);
}
}
private static class LiveRoomHandler extends Handler {
private LiveRoomViewHolder mLiveRoomViewHolder;

View File

@ -263,6 +263,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setName(data.getUserNiceName());
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
mLiveRoomViewHolder.setTitle(data.getTitle());
mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum());
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="142dp" android:height="34dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#abafb3ff" />
<gradient android:type="linear" android:useLevel="true" android:startColor="#b8b2a4ff" android:endColor="#80722cff" android:angle="90" />
<corners android:radius="17dp" />
</shape>
</item>
</selector>

View File

@ -221,6 +221,27 @@
android:layout_gravity="center"
android:layout_marginStart="6dp"/>
<LinearLayout
android:id="@+id/btn_union"
android:layout_width="88dp"
android:layout_height="23dp"
android:layout_marginStart="6dp"
android:background="@drawable/bg_user_card_guard"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/union_val"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="1dp"
android:text="@string/user_card_guard"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:id="@+id/user_card_noble"

View File

@ -68,6 +68,20 @@
android:textColor="@color/white"
android:textSize="12sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/good_nub_ico"
android:layout_width="18dp"
android:layout_height="15dp"
android:layout_marginEnd="2dp"
android:src="@mipmap/good_nub"
android:visibility="gone" />
<TextView
android:id="@+id/id_val"
android:layout_width="wrap_content"
@ -76,6 +90,8 @@
android:text="1111"
android:textColor="@color/white"
android:textSize="8sp" />
</LinearLayout>
</LinearLayout>
@ -389,8 +405,8 @@
android:layout_height="wrap_content"
android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginStart="10dp"
android:visibility="visible"
android:layout_toEndOf="@id/live_wks_layout">
android:layout_toEndOf="@id/live_wks_layout"
android:visibility="visible">
<include layout="@layout/view_noble_seat" />
</LinearLayout>
@ -2042,6 +2058,7 @@
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_event4"
android:layout_width="67dp"
@ -2067,6 +2084,7 @@
app:indicator_width="8dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_event3"
android:layout_width="67dp"