This commit is contained in:
zlzw 2022-11-08 16:50:37 +08:00
parent 96f21643b4
commit 5ed5b15737
4 changed files with 63 additions and 5 deletions

View File

@ -9,9 +9,9 @@ public class NewLevelModel extends BaseModel {
@SerializedName("id") @SerializedName("id")
private String id; private String id;
@SerializedName("levemin") @SerializedName("levelmin")
private String levemin; private String levemin;
@SerializedName("levemax") @SerializedName("levelmax")
private String levemax; private String levemax;
@SerializedName("thumb") @SerializedName("thumb")
private String thumb; private String thumb;

View File

@ -5,6 +5,7 @@ import android.os.Parcelable;
import android.text.TextUtils; import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
/** /**
* Created by cxf on 2017/8/14. * Created by cxf on 2017/8/14.
@ -56,6 +57,8 @@ public class UserBean implements Parcelable {
private String mobile; private String mobile;
private String front_task; private String front_task;
private String is_admin; private String is_admin;
@SerializedName("user_love_num")
private int praise;
//是否隐藏 //是否隐藏
private boolean isHide = false; private boolean isHide = false;
@ -363,6 +366,14 @@ public class UserBean implements Parcelable {
return level; return level;
} }
public int getPraise() {
return praise;
}
public void setPraise(int praise) {
this.praise = praise;
}
public void setLevel(int level) { public void setLevel(int level) {
this.level = level; this.level = level;
} }

View File

@ -115,8 +115,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
private ImageView mLiveIcon; private ImageView mLiveIcon;
private ImageView mLiveIcon2; private ImageView mLiveIcon2;
private ImageView mNoble; private ImageView mNoble;
private ImageView mNobleIcon;
private ImageView mAvatar; private ImageView mAvatar;
private ImageView shawl; private ImageView shawl;
private ImageView honorIcon;
private UserBean mUserBean; private UserBean mUserBean;
private LinearLayout mGuardLayout; private LinearLayout mGuardLayout;
private boolean mFollowing; private boolean mFollowing;
@ -222,6 +224,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
mReport = mRootView.findViewById(R.id.btn_report); mReport = mRootView.findViewById(R.id.btn_report);
mGuardLayout = mRootView.findViewById(R.id.btn_guard); mGuardLayout = mRootView.findViewById(R.id.btn_guard);
mGuard = mRootView.findViewById(R.id.guard_val); mGuard = mRootView.findViewById(R.id.guard_val);
mNobleIcon = mRootView.findViewById(R.id.noble_icon);
honorIcon = mRootView.findViewById(R.id.honor_icon);
} }
private void initListener() { private void initListener() {
@ -319,13 +323,54 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
} }
mGuard.setText(String.format(mGuard.getText().toString(), guardNumber)); mGuard.setText(String.format(mGuard.getText().toString(), guardNumber));
mFansVal.setText(WordUtil.getString(R.string.fans) + ":" + mUserBean.getFans()); mFansVal.setText(WordUtil.getString(R.string.fans) + ":" + mUserBean.getFans());
mPraise.setText(WordUtil.getString(R.string.praise) + ":" + mUserBean.getPraise());
mSignDesc.setText(mUserBean.getSignature()); mSignDesc.setText(mUserBean.getSignature());
mNobleVal.setText(NobleUtil.nobleIdToStringName(Integer.parseInt(mUserBean.getNoble_id()))); mNobleVal.setText(NobleUtil.nobleIdToStringName(Integer.parseInt(mUserBean.getNoble_id())));
ImgLoader.displayAvatar(mContext, obj.getString("avatar"), mAvatar); ImgLoader.displayAvatar(mContext, obj.getString("avatar"), mAvatar);
JSONObject dress = obj.getJSONObject("dress");
if (obj.containsKey("level_thumb")) {
ImgLoader.display(mContext, obj.getJSONObject("level_thumb").getString("icon"), mLiveIcon2);
}else{
mLiveIcon2.setVisibility(View.INVISIBLE);
}
if (dress.containsKey("medal")) {
JSONObject item = null;
for (Object medal : dress.getJSONArray("medal")) {
JSONObject _item = (JSONObject) medal;
if (_item.getInteger("is_use") == 1) {
item = _item;
break;
}
}
if (item != null) {
String url = item.getString("display_src");
if(url!=null) {
url = url.replace("qny.shayucm.com", "downs.yaoulive.com");
ImgLoader.display(mContext, url, mNobleIcon);
}else{
mNobleIcon.setVisibility(View.INVISIBLE);
}
}
}else{
mNobleIcon.setVisibility(View.INVISIBLE);
}
if (obj.containsKey("medal_no")) {
JSONObject item = null;
if (obj.getJSONArray("medal_no").size() > 0) {
item = obj.getJSONArray("medal_no").getJSONObject(0);
String url=item.getString("display_src");
url = url.replace("qny.shayucm.com", "downs.yaoulive.com");
ImgLoader.display(mContext, url, honorIcon);
}
}else{
honorIcon.setVisibility(View.INVISIBLE);
}
mFollowing = obj.getIntValue("isattention") == 1; mFollowing = obj.getIntValue("isattention") == 1;
updateFollow(); updateFollow();
//装扮相关 //装扮相关
JSONObject dress = obj.getJSONObject("dress");
if (dress.getJSONArray("wraps").size() >= 1) { if (dress.getJSONArray("wraps").size() >= 1) {
JSONObject display = (JSONObject) dress.getJSONArray("wraps").get(0); JSONObject display = (JSONObject) dress.getJSONArray("wraps").get(0);
ImgLoader.display(mContext, display.getString("display_src"), shawl); ImgLoader.display(mContext, display.getString("display_src"), shawl);

View File

@ -354,9 +354,10 @@
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/noble_icon"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:visibility="invisible" android:visibility="visible"
android:src="@mipmap/icon_chat_face" /> android:src="@mipmap/icon_chat_face" />
<LinearLayout <LinearLayout
@ -390,9 +391,10 @@
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/honor_icon"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:visibility="invisible" android:visibility="visible"
android:src="@mipmap/icon_chat_face"/> android:src="@mipmap/icon_chat_face"/>
<LinearLayout <LinearLayout