6.5.4礼物冠名
This commit is contained in:
@@ -43,6 +43,7 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean2;
|
||||
@@ -222,6 +223,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
sendGift();
|
||||
|
||||
}
|
||||
});
|
||||
// 跳转充值
|
||||
@@ -339,45 +341,27 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
by = bundle.getString("by");
|
||||
isPk = bundle.getBoolean("pk");
|
||||
}
|
||||
|
||||
//判断是否缓存礼物列表
|
||||
String giftListJson = CommonAppConfig.getInstance().getGiftListJson();
|
||||
if (!TextUtils.isEmpty(giftListJson)) {
|
||||
try {
|
||||
liveGiftList = JSON.parseArray(giftListJson);
|
||||
Bus.getOn(this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (liveGiftList == null) {
|
||||
LiveHttpUtil.getNewGiftList(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
liveGiftList = obj.getJSONArray("listarray");
|
||||
CommonAppConfig.getInstance().setGiftListJson(obj.getString("listarray"));
|
||||
getCoin();
|
||||
goldText.setText(obj.getString("gold"));
|
||||
diamondText.setText(obj.getString("coin"));
|
||||
setTitleData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
LiveHttpUtil.getNewGiftList(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
liveGiftList = obj.getJSONArray("listarray");
|
||||
CommonAppConfig.getInstance().setGiftListJson(obj.getString("listarray"));
|
||||
getCoin();
|
||||
// if (mLoading != null) {
|
||||
// mLoading.setVisibility(View.INVISIBLE);
|
||||
// }
|
||||
goldText.setText(obj.getString("gold"));
|
||||
diamondText.setText(obj.getString("coin"));
|
||||
setTitleData();
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getCoin();
|
||||
setTitleData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
getCoin();
|
||||
}
|
||||
});
|
||||
getBlindBoxInfo();
|
||||
loadUserVip();
|
||||
}
|
||||
@@ -508,7 +492,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
String hint = getString(R.string.reach_the_top);
|
||||
String hint = mContext.getString(R.string.reach_the_top);
|
||||
leaveHint.setText(hint);
|
||||
progressBar.setMax(10);
|
||||
progressBar.setProgress(10);
|
||||
@@ -642,6 +626,44 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
lianSongHandler.removeCallbacks(lianSongRunnable);
|
||||
mShowLianBtn = false;
|
||||
getCoin();
|
||||
LiveNetManager.get(mContext)
|
||||
.getGiftNamingInfo(liveGiftModel.getId() + "", new com.yunbao.common.http.base.HttpCallback<GiftNamingInfoModel>() {
|
||||
@Override
|
||||
public void onSuccess(GiftNamingInfoModel data) {
|
||||
liveGiftModel = JSONObject.parseObject(GsonUtils.toJson(data), LiveGiftBean.class);
|
||||
if (!TextUtils.isEmpty(liveGiftModel.getNamingLiveuid()) &&
|
||||
!TextUtils.isEmpty(liveGiftModel.getNamingUid()) &&
|
||||
!TextUtils.equals(liveGiftModel.getNamingLiveuid(), "0") &&
|
||||
!TextUtils.equals(liveGiftModel.getNamingUid(), "0")) {
|
||||
namingLayout.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar);
|
||||
StringBuffer namingNameText = new StringBuffer();
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
namingNameText.append("获取冠名:")
|
||||
.append(liveGiftModel.getNamingUserCoin())
|
||||
.append("个 ");
|
||||
} else {
|
||||
namingNameText.append("Get title: ")
|
||||
.append(liveGiftModel.getNamingUserCoin())
|
||||
.append(" ");
|
||||
}
|
||||
namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor))
|
||||
.append(liveGiftModel.getNamingLiveName())
|
||||
.append(" ")
|
||||
.append(mContext.getText(com.yunbao.live.R.string.the_title_financier))
|
||||
.append(liveGiftModel.getNamingUserName());
|
||||
namingName.setText(namingNameText.toString());
|
||||
} else {
|
||||
namingLayout.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -699,6 +721,14 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
namingLayout.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar);
|
||||
StringBuffer namingNameText = new StringBuffer();
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
namingNameText.append("获取冠名:")
|
||||
.append(liveGiftModel.getNamingUserCoin())
|
||||
.append("个");
|
||||
} else {
|
||||
namingNameText.append("Get title: ")
|
||||
.append(liveGiftModel.getNamingUserCoin());
|
||||
}
|
||||
namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor))
|
||||
.append(liveGiftModel.getNamingLiveName())
|
||||
.append(" ")
|
||||
@@ -738,6 +768,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
operateImage.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(getContext(), liveGiftModel.getOperateImage(), operateImage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
Reference in New Issue
Block a user