调整个人名片卡主播显示主播等级底图

This commit is contained in:
zlzw 2022-11-18 14:42:12 +08:00
parent c99d139940
commit 2371ef1dee
2 changed files with 45 additions and 12 deletions

View File

@ -114,6 +114,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
private TextView mUnion; private TextView mUnion;
private TextView mHonorVal; private TextView mHonorVal;
private TextView mNobleTitleVal; private TextView mNobleTitleVal;
private TextView mLvVal;
private ImageView mFollowImage; private ImageView mFollowImage;
private ImageView mSex; private ImageView mSex;
private ImageView good_nub_ico; private ImageView good_nub_ico;
@ -246,6 +247,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
mHonorLayout = mRootView.findViewById(R.id.honor_layout); mHonorLayout = mRootView.findViewById(R.id.honor_layout);
mTitleBg = mRootView.findViewById(R.id.title_bg); mTitleBg = mRootView.findViewById(R.id.title_bg);
mSetting = mRootView.findViewById(R.id.btn_setting); mSetting = mRootView.findViewById(R.id.btn_setting);
mLvVal = mRootView.findViewById(R.id.user_card_lv_val);
mNobleIconLayout.setOnClickListener(this); mNobleIconLayout.setOnClickListener(this);
mSetting.setOnClickListener(this); mSetting.setOnClickListener(this);
mHonorLayout.setOnClickListener(v -> forwardHomePage()); mHonorLayout.setOnClickListener(v -> forwardHomePage());
@ -363,6 +365,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
userLv.setText("Lv." + mUserBean.getLevel()); userLv.setText("Lv." + mUserBean.getLevel());
mLvDesc.setText(R.string.live_user_card_level); mLvDesc.setText(R.string.live_user_card_level);
} }
if(isAnchor){
ImgLoader.display2(mContext,obj.getJSONObject("level_thumb").getString("thumb"),mLiveIcon);
mLvVal.setText(obj.getInteger("level_anchor")+"");
}else {
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() { new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
@ -374,6 +380,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
} }
}); });
}
ImgLoader.display(mContext, levelBean.getBgIcon(), mLiveIcon2); ImgLoader.display(mContext, levelBean.getBgIcon(), mLiveIcon2);
FansMedalBean fansMedalBean = CommonAppConfig.getInstance().getAnchorFansMedal(obj.getIntValue("medal_level")); FansMedalBean fansMedalBean = CommonAppConfig.getInstance().getAnchorFansMedal(obj.getIntValue("medal_level"));
if (fansMedalBean != null && !isAnchor) { if (fansMedalBean != null && !isAnchor) {

View File

@ -232,12 +232,38 @@
android:layout_height="17dp" android:layout_height="17dp"
android:layout_marginLeft="4dp" /> android:layout_marginLeft="4dp" />
<ImageView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/user_card_lv_icon" android:orientation="horizontal"
android:layout_width="46.5dp" android:layout_width="46.5dp"
android:layout_height="17.5dp" android:layout_height="17.5dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="6dp" /> android:layout_marginStart="6dp">
<ImageView
android:id="@+id/user_card_lv_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/user_card_lv_val"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout <LinearLayout
android:id="@+id/btn_union" android:id="@+id/btn_union"