直播间开通贵族结束

This commit is contained in:
18401019693 2022-09-19 17:59:15 +08:00
parent 1935ac14f0
commit 86735ab81f
4 changed files with 63 additions and 39 deletions

View File

@ -3,6 +3,7 @@ package com.yunbao.common.views.weight;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@ -51,8 +52,8 @@ public class NobleNoticeView extends FrameLayout {
private SVGAImageView svagaBc;
private RelativeLayout rootLayout;
private long animationTime = 8000;
private TextView gotoRoomView, nobleNickname, userName, anchorNickname;
private String mSvgaName, uhead, anchorUid;
private TextView gotoRoomView, nobleNickname, userName, anchorNickname, openNoble;
private String mSvgaName, uhead, anchorNicknameStr;
private RoleType roleType;
private HorizontalScrollView contextLayout;
private RelativeLayout scrollLayout;
@ -83,6 +84,7 @@ public class NobleNoticeView extends FrameLayout {
scrollLayout = rootView.findViewById(R.id.scroll_layout);
nobleIcon = rootView.findViewById(R.id.noble_icon);
nobleNickname = rootView.findViewById(R.id.noble_nickname);
openNoble = rootView.findViewById(R.id.open_noble);
userName = rootView.findViewById(R.id.user_name);
anchorNickname = rootView.findViewById(R.id.anchor_nickname);
contextLayout.setVisibility(GONE);
@ -99,9 +101,20 @@ public class NobleNoticeView extends FrameLayout {
public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid) {
this.uhead = uHead;
this.anchorUid = anchorUid;
this.anchorNicknameStr = anchorNicknameStr.trim();
userName.setText(userNameStr);
anchorNickname.setText(anchorNicknameStr);
anchorNickname.setText(anchorNicknameStr.trim());
if (TextUtils.isEmpty(anchorNicknameStr.trim())) {
gotoRoomView.setVisibility(GONE);
findViewById(R.id.in).setVisibility(GONE);
findViewById(R.id.anchor_nickname).setVisibility(GONE);
openNoble.setText(mContext.getString(R.string.open_noble2));
}else {
gotoRoomView.setVisibility(VISIBLE);
findViewById(R.id.in).setVisibility(VISIBLE);
findViewById(R.id.anchor_nickname).setVisibility(VISIBLE);
openNoble.setText(mContext.getString(R.string.open_noble));
}
return this;
}
@ -348,8 +361,13 @@ public class NobleNoticeView extends FrameLayout {
}
gotoRoomView.setLayoutParams(layoutParams);
contextLayout.setLayoutParams(contextLayoutParams);
contextLayout.setVisibility(VISIBLE);
if (!TextUtils.isEmpty(anchorNicknameStr)) {
gotoRoomView.setVisibility(VISIBLE);
findViewById(R.id.in).setVisibility(VISIBLE);
findViewById(R.id.anchor_nickname).setVisibility(VISIBLE);
}
contextLayout.setVisibility(VISIBLE);
});

View File

@ -50,13 +50,20 @@
android:textColor="#F7FF74"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/live_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/user_name"
android:visibility="visible">
<TextView
android:id="@+id/in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="7.5dp"
android:layout_toEndOf="@id/user_name"
android:text="@string/in"
android:textColor="@color/white"
android:textSize="14sp" />
@ -65,10 +72,8 @@
android:id="@+id/anchor_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="6.5dp"
android:layout_toEndOf="@id/in"
android:text="主播昵称"
android:textColor="#F7FF74"
android:textSize="14sp" />
@ -76,19 +81,19 @@
android:id="@+id/open_noble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="4.5dp"
android:layout_toEndOf="@id/anchor_nickname"
android:text="@string/open_noble"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="@+id/noble_icon"
android:layout_width="25dp"
android:layout_height="24dp"
android:layout_marginStart="4.5dp"
android:layout_toEndOf="@id/open_noble"
android:layout_toEndOf="@id/live_layout"
android:scaleType="fitCenter"
android:src="@mipmap/icon_open_chaohuang" />

View File

@ -907,5 +907,6 @@
<string name="better_emperor_hint">昭告天下! %s 向所有人推薦了主播 %s , 一眼萬年情之所鐘!</string>
<string name="emperor_hint">昭告天下! %s 向所有人推薦了主播 %s , 灼灼風華一瞥驚鴻!</string>
<string name="try_again_later">數據加載失敗,請稍後再試</string>
<string name="open_noble2">開通了</string>
</resources>

View File

@ -2273,7 +2273,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.BARON)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
@ -2281,7 +2281,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.VISCOUNT)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
@ -2289,7 +2289,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.MARQUIS)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
@ -2297,7 +2297,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.DUKE)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
@ -2305,7 +2305,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.KING)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
@ -2313,7 +2313,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.EMPEROR)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
@ -2321,7 +2321,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
bean.getRoomnum())
.setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;