update 个人名片

This commit is contained in:
zlzw 2022-11-07 17:39:52 +08:00
parent ab953b4785
commit 40532a0972
4 changed files with 61 additions and 7 deletions

View File

@ -22,4 +22,16 @@ public class NobleUtil {
}
return -1;
}
public static String nobleIdToStringName(int id){
switch (id){
case 1:return "男爵";
case 2:return "子爵";
case 3:return "侯爵";
case 4:return "公爵";
case 5:return "国王";
case 6:return "皇帝";
case 7:return "超皇";
}
return "";
}
}

View File

@ -38,6 +38,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.utils.CommonIconUtil;
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.ToastUtil;
@ -98,12 +99,16 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
private TextView userLv;
private TextView mLvDesc;
private TextView mFansVal;
private TextView mPraise;
private TextView mSignDesc;
private TextView mNobleVal;
private ImageView mFollowImage;
private ImageView mSex;
private ImageView good_nub_ico;
private ImageView mLiveIcon;
private ImageView mLiveIcon2;
private ImageView mNoble;
private ImageView mAvatar;
private UserBean mUserBean;
GifImageView btn_live;
SVGAImageView gift_svga;
@ -198,6 +203,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
mLiveIcon2 = mRootView.findViewById(R.id.live_icon);
mNoble = mRootView.findViewById(R.id.user_card_noble);
mFansVal = mRootView.findViewById(R.id.fans_val);
mPraise = mRootView.findViewById(R.id.praise_val);
mSignDesc = mRootView.findViewById(R.id.sign);
mAvatar = mRootView.findViewById(R.id.avatar);
mNobleVal = mRootView.findViewById(R.id.noble_val);
}
private void initListener() {
@ -262,11 +271,11 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
LevelBean levelBean;
if (mLiveUid.equals(mUserBean.getId())) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
userLv.setText(mUserBean.getLevelAnchor() + "");
userLv.setText("Lv."+mUserBean.getLevelAnchor() );
mLvDesc.setText(R.string.live_user_level_anchor);
} else {
levelBean = CommonAppConfig.getInstance().getLevel(mUserBean.getLevel());
userLv.setText(mUserBean.getLevel() + "");
userLv.setText("Lv."+mUserBean.getLevel());
mLvDesc.setText(R.string.live_user_card_level);
}
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
@ -287,9 +296,40 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
} else {
mNoble.setVisibility(View.INVISIBLE);
}
mFansVal.setText(mUserBean.getFans()+"");
mFansVal.setText(WordUtil.getString(R.string.fans)+":"+mUserBean.getFans());
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");
if (dress.getJSONArray("avatar_frame").size() == 1) {
JSONObject ico = (JSONObject) dress.getJSONArray("avatar_frame").get(0);
if (ico.getString("effect_src") != null) {
if (ico.getString("effect_src").contains("svga")) {
try {
new SVGAParser(mContext).parse(new URL(ico.getString("effect_src")), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
gift_svga.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(gift_svga);
}
@Override
public void onError() {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
} else {
Log.e("eee", ico.getString("effect_src"));
ImgLoader.display(mContext, ico.getString("effect_src"), gift_svga);
}
}
}
}

View File

@ -161,7 +161,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingRight="10dp"
android:textColor="@color/textColor"
android:textColor="#B1B1B1"
android:textSize="13sp" />
<View
@ -178,7 +178,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingRight="10dp"
android:textColor="@color/textColor"
android:textColor="#B1B1B1"
android:textSize="13sp" />
<View
@ -195,7 +195,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingRight="10dp"
android:textColor="@color/textColor"
android:textColor="#B1B1B1"
android:textSize="13sp" />
</LinearLayout>
@ -235,7 +235,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:textColor="@color/textColor2"
android:textColor="#B1B1B1"
android:textSize="14sp" />
<LinearLayout
@ -423,6 +423,7 @@
<FrameLayout
android:id="@+id/bottom_container"
android:layout_marginTop="13dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

View File

@ -11,6 +11,7 @@
<string name="views_rank">觀眾</string>
<string name="gurad_rank">觀眾</string>
<string name="fans">粉絲</string>
<string name="praise">獲讚</string>
<string name="room_msg">私信</string>
<string name="live_room_title">選擇房間類型</string>
<string name="live_room_public">公開房</string>