diff --git a/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java b/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java index 4b666f6c1..4ecb0defb 100644 --- a/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java +++ b/common/src/main/java/com/yunbao/common/bean/NewLevelModel.java @@ -9,9 +9,9 @@ public class NewLevelModel extends BaseModel { @SerializedName("id") private String id; - @SerializedName("levemin") + @SerializedName("levelmin") private String levemin; - @SerializedName("levemax") + @SerializedName("levelmax") private String levemax; @SerializedName("thumb") private String thumb; diff --git a/common/src/main/java/com/yunbao/common/bean/UserBean.java b/common/src/main/java/com/yunbao/common/bean/UserBean.java index a9dd62735..2f8df56aa 100644 --- a/common/src/main/java/com/yunbao/common/bean/UserBean.java +++ b/common/src/main/java/com/yunbao/common/bean/UserBean.java @@ -5,6 +5,7 @@ import android.os.Parcelable; import android.text.TextUtils; import com.alibaba.fastjson.annotation.JSONField; +import com.google.gson.annotations.SerializedName; /** * Created by cxf on 2017/8/14. @@ -56,6 +57,8 @@ public class UserBean implements Parcelable { private String mobile; private String front_task; private String is_admin; + @SerializedName("user_love_num") + private int praise; //是否隐藏 private boolean isHide = false; @@ -363,6 +366,14 @@ public class UserBean implements Parcelable { return level; } + public int getPraise() { + return praise; + } + + public void setPraise(int praise) { + this.praise = praise; + } + public void setLevel(int level) { this.level = level; } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index ae38a32c2..90359ef7a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -115,8 +115,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On private ImageView mLiveIcon; private ImageView mLiveIcon2; private ImageView mNoble; + private ImageView mNobleIcon; private ImageView mAvatar; private ImageView shawl; + private ImageView honorIcon; private UserBean mUserBean; private LinearLayout mGuardLayout; private boolean mFollowing; @@ -222,6 +224,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On mReport = mRootView.findViewById(R.id.btn_report); mGuardLayout = mRootView.findViewById(R.id.btn_guard); mGuard = mRootView.findViewById(R.id.guard_val); + mNobleIcon = mRootView.findViewById(R.id.noble_icon); + honorIcon = mRootView.findViewById(R.id.honor_icon); } private void initListener() { @@ -319,13 +323,54 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On } 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()); 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 (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; updateFollow(); //装扮相关 - JSONObject dress = obj.getJSONObject("dress"); + if (dress.getJSONArray("wraps").size() >= 1) { JSONObject display = (JSONObject) dress.getJSONArray("wraps").get(0); ImgLoader.display(mContext, display.getString("display_src"), shawl); diff --git a/live/src/main/res/layout/dialog_new_live_user.xml b/live/src/main/res/layout/dialog_new_live_user.xml index 7dbc7d359..d55e691c4 100644 --- a/live/src/main/res/layout/dialog_new_live_user.xml +++ b/live/src/main/res/layout/dialog_new_live_user.xml @@ -354,9 +354,10 @@ android:gravity="center">