调整战令奖励列表的渲染
更改战令获取金币接口
This commit is contained in:
parent
2857127285
commit
a8a1aa2e71
@ -173,4 +173,27 @@ public class BattlePassUserInfoBean extends BaseModel{
|
|||||||
public void setMaxLevel(int maxLevel) {
|
public void setMaxLevel(int maxLevel) {
|
||||||
this.maxLevel = maxLevel;
|
this.maxLevel = maxLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "BattlePassUserInfoBean{" +
|
||||||
|
"uid='" + uid + '\'' +
|
||||||
|
", points=" + points +
|
||||||
|
", battlePassExp=" + battlePassExp +
|
||||||
|
", battlePassUserRecords1=" + battlePassUserRecords1 +
|
||||||
|
", battlePassUserRecords2=" + battlePassUserRecords2 +
|
||||||
|
", battlePassUserRecords3=" + battlePassUserRecords3 +
|
||||||
|
", level=" + level +
|
||||||
|
", lastLevelExp=" + lastLevelExp +
|
||||||
|
", nextLevelExp=" + nextLevelExp +
|
||||||
|
", id='" + id + '\'' +
|
||||||
|
", battlePassName='" + battlePassName + '\'' +
|
||||||
|
", startTime='" + startTime + '\'' +
|
||||||
|
", endTime='" + endTime + '\'' +
|
||||||
|
", battlePassStatus=" + battlePassStatus +
|
||||||
|
", maxLevelExp=" + maxLevelExp +
|
||||||
|
", maxLevel=" + maxLevel +
|
||||||
|
", live_battle_pass_type=" + live_battle_pass_type +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,5 +158,18 @@ public class LiveBattlePassRewardsBean extends BaseModel{
|
|||||||
public void setReceived(int received) {
|
public void setReceived(int received) {
|
||||||
this.received = received;
|
this.received = received;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LiveBattlePassReward{" +
|
||||||
|
"id=" + id +
|
||||||
|
", liveBattlePassLevel=" + liveBattlePassLevel +
|
||||||
|
", liveBattlePassTypeId=" + liveBattlePassTypeId +
|
||||||
|
", rewardName='" + rewardName + '\'' +
|
||||||
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
|
", lock=" + lock +
|
||||||
|
", received=" + received +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,15 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||||
import com.yunbao.common.http.ResponseModel;
|
import com.yunbao.common.http.ResponseModel;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
@ -30,6 +33,7 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
|||||||
private OrderLevelCallback orderLevelCallback;
|
private OrderLevelCallback orderLevelCallback;
|
||||||
private long maxExp;
|
private long maxExp;
|
||||||
private BattlePassUserInfoBean userInfoBean;
|
private BattlePassUserInfoBean userInfoBean;
|
||||||
|
|
||||||
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
|
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
|
||||||
int mCurrentExperience, int mTotalExperience,
|
int mCurrentExperience, int mTotalExperience,
|
||||||
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
|
||||||
@ -107,18 +111,30 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
|||||||
|
|
||||||
if (orderLevelCallback != null) {
|
if (orderLevelCallback != null) {
|
||||||
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
|
||||||
}dialog.dismiss();
|
}
|
||||||
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
if (orderLevelCallback != null) {
|
if (orderLevelCallback != null) {
|
||||||
orderLevelCallback.onCallback(102, error);
|
orderLevelCallback.onCallback(102, error);
|
||||||
} dialog.dismiss();
|
}
|
||||||
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
IMLoginManager.get(getContext())
|
||||||
|
.updateUserCoin(new OnItemClickListener<JSONObject>() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(JSONObject bean, int position) {
|
||||||
|
if (bean != null) {
|
||||||
|
balance = bean.getString("coin");
|
||||||
|
balanceDiamond.setText(balance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OrderLevelCallback {
|
public interface OrderLevelCallback {
|
||||||
|
@ -17,6 +17,7 @@ import com.yunbao.common.bean.IMLoginModel;
|
|||||||
import com.yunbao.common.event.DataUserInfoEvent;
|
import com.yunbao.common.event.DataUserInfoEvent;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
@ -527,5 +528,22 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public void updateUserCoin(OnItemClickListener<JSONObject> listener){
|
||||||
|
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||||
|
.execute(new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
JSONObject obj = JSONObject.parseObject(info[0]);
|
||||||
|
listener.onItemClick(obj,0);
|
||||||
|
String golds = obj.getString("gold");
|
||||||
|
String coins = obj.getString("coin");
|
||||||
|
String yuanbaos = obj.getString("yuanbao");
|
||||||
|
userInfo.setCoin(obj.getLong("coin"));
|
||||||
|
userInfo.setGold(obj.getLong("gold"));
|
||||||
|
userInfo.setYuanbao(yuanbaos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import android.annotation.SuppressLint;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -165,6 +166,9 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
|
|||||||
setVisibility(View.VISIBLE, -1, tab1Layout, tab2Layout, tab3Layout);
|
setVisibility(View.VISIBLE, -1, tab1Layout, tab2Layout, tab3Layout);
|
||||||
setVisibility(View.VISIBLE, -1, tab1, tab2, tab3);
|
setVisibility(View.VISIBLE, -1, tab1, tab2, tab3);
|
||||||
setVisibility(View.VISIBLE, -1, tab1Mask, tab2Mask, tab3Mask);
|
setVisibility(View.VISIBLE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||||
|
ConstraintLayout.LayoutParams _params = (ConstraintLayout.LayoutParams) line.getLayoutParams();
|
||||||
|
_params.bottomMargin = DpUtil.dp2px(0);
|
||||||
|
line.setLayoutParams(_params);
|
||||||
|
|
||||||
line.setVisibility(View.GONE);
|
line.setVisibility(View.GONE);
|
||||||
point.setVisibility(View.GONE);
|
point.setVisibility(View.GONE);
|
||||||
@ -200,6 +204,7 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
|
|||||||
}), tab1Unlock, tab2Unlock, tab3Unlock);
|
}), tab1Unlock, tab2Unlock, tab3Unlock);
|
||||||
getAllView(((reward, view) -> {
|
getAllView(((reward, view) -> {
|
||||||
lv.setText("V" + reward.getLiveBattlePassLevel());
|
lv.setText("V" + reward.getLiveBattlePassLevel());
|
||||||
|
lv.setTag(reward);
|
||||||
view.setText(reward.getRewardName());
|
view.setText(reward.getRewardName());
|
||||||
}), tab1Title, tab2Title, tab3Title);
|
}), tab1Title, tab2Title, tab3Title);
|
||||||
getAllView(((reward, view) -> {
|
getAllView(((reward, view) -> {
|
||||||
|
@ -112,7 +112,6 @@ public class BattlePassMissionFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
Bus.get().post(new BattlePassTypeEvent(0));
|
Bus.get().post(new BattlePassTypeEvent(0));
|
||||||
IMLoginManager.get(getContext()).updateUserCoin();
|
|
||||||
updateData();
|
updateData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user