Merge remote-tracking branch 'origin/master'

# Conflicts:
#	config.gradle
This commit is contained in:
18401019693 2024-01-18 13:38:34 +08:00
commit 3d1c4466e0
21 changed files with 292 additions and 79 deletions

View File

@ -173,4 +173,27 @@ public class BattlePassUserInfoBean extends BaseModel{
public void setMaxLevel(int 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 +
'}';
}
}

View File

@ -158,5 +158,18 @@ public class LiveBattlePassRewardsBean extends BaseModel{
public void setReceived(int received) {
this.received = received;
}
@Override
public String toString() {
return "LiveBattlePassReward{" +
"id=" + id +
", liveBattlePassLevel=" + liveBattlePassLevel +
", liveBattlePassTypeId=" + liveBattlePassTypeId +
", rewardName='" + rewardName + '\'' +
", imageUrl='" + imageUrl + '\'' +
", lock=" + lock +
", received=" + received +
'}';
}
}
}

View File

@ -77,6 +77,7 @@ public class LiberalBattlePassPopupWindow extends CenterPopupView {
mPassCallback.onCallback(data.getData().getCode(), data.getData().getMsg());
}
IMLoginManager.get(getContext()).upDataUserInfo();
IMLoginManager.get(getContext()).updateUserCoin();
}
@Override

View File

@ -7,11 +7,15 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.R;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.http.base.HttpCallback;
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.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -22,22 +26,24 @@ import java.math.BigDecimal;
* 战令等级 经验
*/
public class OrderLevelPopupWindow extends CenterPopupView {
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current,expText;
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current, expText;
private int currentExperience, totalExperience;//当前经验全部经验
private String buyExp = "100", currentLevel, balance;
private ProgressBar progressBar;
private OrderLevelCallback orderLevelCallback;
private long maxExp;
private BattlePassUserInfoBean userInfoBean;
public OrderLevelPopupWindow(@NonNull Context context,
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
int mCurrentExperience, int mTotalExperience,
String mCurrentLevel, String mBalance,long maxExp, OrderLevelCallback mOrderLevelCallback) {
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
super(context);
this.userInfoBean = userInfoBean;
currentExperience = mCurrentExperience;
totalExperience = mTotalExperience;
currentLevel = mCurrentLevel;
balance = mBalance;
this.maxExp=maxExp;
this.maxExp = maxExp;
orderLevelCallback = mOrderLevelCallback;
}
@ -59,7 +65,7 @@ public class OrderLevelPopupWindow extends CenterPopupView {
orderLevel.setText(buyExp);
progressBar.setMax(totalExperience);
progressBar.setProgress(currentExperience);
expText.setText(String.format("%s/%s", currentExperience, totalExperience));
expText.setText(String.format("%s/%s", userInfoBean.getBattlePassExp(), userInfoBean.getNextLevelExp()));
current.setText(String.format("Lv%s", currentLevel));
balanceDiamond.setText(balance);
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
@ -83,8 +89,8 @@ public class OrderLevelPopupWindow extends CenterPopupView {
buyExp = String.valueOf(buyExpBigDecimal.intValue());
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
orderLevel.setText(buyExp);
}else if(exp>=maxExp){
ToastUtil.show(WordUtil.isNewZh()?"经验已滿":"Experience full");
} else if (exp >= maxExp) {
ToastUtil.show(WordUtil.isNewZh() ? "经验已滿" : "Experience full");
}
}
@ -102,20 +108,33 @@ public class OrderLevelPopupWindow extends CenterPopupView {
.buyingExperiencePoint(buyExp, new HttpCallback<ResponseModel<Object>>() {
@Override
public void onSuccess(ResponseModel<Object> data) {
if (orderLevelCallback != null) {
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
}dialog.dismiss();
}
dialog.dismiss();
}
@Override
public void onError(String error) {
if (orderLevelCallback != null) {
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 {

View File

@ -2674,11 +2674,9 @@ public class LiveNetManager {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(responseModel -> {
if (callback != null) {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {

View File

@ -8,6 +8,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat;
import com.umeng.analytics.MobclickAgent;
@ -16,6 +17,7 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.DataUserInfoEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.base.BaseCacheManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
@ -509,5 +511,39 @@ public class IMLoginManager extends BaseCacheManager {
}
});
}
public void updateUserCoin(){
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]);
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);
}
}
});
}
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);
}
}
});
}
}

View File

@ -26,26 +26,26 @@
android:orientation="horizontal">
<TextView
android:id="@+id/btn_confirm"
android:id="@+id/btn_cancel"
android:layout_width="100dp"
android:layout_height="35dp"
android:background="@mipmap/icon_del_sys_confirm"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/confirm"
android:text="@string/sys_msg_cancel"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/btn_cancel"
android:id="@+id/btn_confirm"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginLeft="30dp"
android:background="@mipmap/icon_del_sys_cancel"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/cancel"
android:text="@string/confirm"
android:textColor="@color/yellow_ff6c00"
android:textSize="14sp"
android:textStyle="bold" />

View File

@ -1445,4 +1445,6 @@ Limited ride And limited avatar frame</string>
<string name="game_review_view_information">Information</string>
<string name="game_review_view_unmute">Unmute</string>
<string name="game_review_view_sound_off">Mute</string>
<string name="sys_msg_cancel">Cancel</string>
</resources>

View File

@ -1444,4 +1444,5 @@
<string name="main_suspension_war_order">直播通行證</string>
<string name="sys_msg_cancel">取消</string>
</resources>

View File

@ -1443,4 +1443,6 @@
<string name="main_suspension_war_order">直播通行證</string>
<string name="sys_msg_cancel">取消</string>
</resources>

View File

@ -1440,4 +1440,6 @@
<string name="main_suspension_war_order">直播通行證</string>
<string name="sys_msg_cancel">取消</string>
</resources>

View File

@ -1449,4 +1449,6 @@ Limited ride And limited avatar frame</string>
<string name="main_suspension_war_order">BattlePass</string>
<string name="sys_msg_cancel">Cancel</string>
</resources>

View File

@ -5,13 +5,13 @@ ext {
minSdkVersion : 21,
targetSdkVersion : 33,
versionCode : 460,
versionName : "6.6.3"
versionName : "6.6.4"
]
manifestPlaceholders = [
//
serverHost : "https://napi.yaoulive.com",
//
// serverHost : " https://ceshi.yaoulive.com",
//serverHost : " https://ceshi.yaoulive.com",
//
@ -21,8 +21,8 @@ ext {
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
// true表示谷歌支付 false 0 1 2 3 samsung包
isGooglePlay : 3,
//0
isGooglePlay : 0,
//
isUploadLog : true,
//
isPluginModel : true,

View File

@ -6,6 +6,7 @@ import android.text.format.DateUtils;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
@ -22,6 +23,7 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.RouteUtil;
@ -51,7 +53,6 @@ import java.util.Map;
@Route(path = RouteUtil.PATH_COMPENSATE_ACTIVITY)
public class CompensateActivity extends AbsActivity {
Banner banner_me;
TextView content;
TextView time;
RecyclerView recyclerView;
@ -59,6 +60,8 @@ public class CompensateActivity extends AbsActivity {
String msgId, mBanner, mContent, link;
Button submit;
ImageView imgContent;
@Override
protected int getLayoutId() {
return R.layout.activity_compensate;
@ -75,6 +78,7 @@ public class CompensateActivity extends AbsActivity {
content = findViewById(R.id.content);
submit = findViewById(R.id.submit);
time = findViewById(R.id.time);
imgContent = findViewById(R.id.img_content);
recyclerView = findViewById(R.id.hor_recycler);
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
@ -94,13 +98,6 @@ public class CompensateActivity extends AbsActivity {
time.setText(sdf.format(currenTimeZone));
content.setText(mContent);
banner_me = findViewById(R.id.banner_me);
banner_me.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
}
});
if (!getIntent().getBooleanExtra("receive", false)) {
submit.setBackground(mContext.getDrawable(R.mipmap.icon_sys_received));
submit.setText(getString(R.string.receive2));
@ -130,13 +127,21 @@ public class CompensateActivity extends AbsActivity {
getMessageGiftInfo();
if (!StringUtils.isEmpty(mBanner)) {
List<SlideBean> mBannerList = new ArrayList<>();
SlideBean slideBean = new SlideBean();
slideBean.setSlide_pic(mBanner);
slideBean.setSlide_url(link);
mBannerList.add(slideBean);
showBanner(mBannerList);
ImgLoader.display(mContext, mBanner, imgContent);
findViewById(R.id.lt_advertisement).setVisibility(View.VISIBLE);
if (!StringUtils.isEmpty(link)) {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
StringBuffer urlBuffer = new StringBuffer();
urlBuffer.append(link).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
findViewById(R.id.lt_advertisement).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString()));
}
});
}
}
}
@ -149,25 +154,4 @@ public class CompensateActivity extends AbsActivity {
}
});
}
private void showBanner(List<SlideBean> mBannerList) {
banner_me.setAutoPlay(true).setPages(mBannerList, new CustomMyViewHolder()).setDelayTime(3000).setBannerStyle(BannerConfig.NOT_INDICATOR).setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onBannerClick(List datas, int p) {
if (mBannerList != null) {
if (p >= 0 && p < mBannerList.size()) {
SlideBean bean = mBannerList.get(p);
if (!bean.getSlide_url().equals("")) {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
StringBuffer urlBuffer = new StringBuffer();
urlBuffer.append(bean.getSlide_url()).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString()));
}
}
}
}
}).start();
}
}

View File

@ -80,13 +80,13 @@
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
<com.ms.banner.Banner
android:id="@+id/banner_me"
<ImageView
android:id="@+id/img_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:delay_time="5000"
app:indicator_height="8dp"
app:indicator_width="8dp" />
android:layout_height="87dp"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop" />
</androidx.cardview.widget.CardView>
</LinearLayout>

View File

@ -1,5 +1,7 @@
package com.yunbao.main.activity;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
@ -15,6 +17,7 @@ import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.BattlePassUserInfoBean;
@ -133,6 +136,19 @@ public class BattlePassActivity extends AbsActivity {
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
@Override
public void onCallback(int code, String msg) {
if (code == 1001) {
new DialogUitl.Builder(mContext)
.setView(com.yunbao.live.R.layout.dialog_live_unfollow)
.setConfirmString(getString(com.yunbao.live.R.string.charge))
.setContent(getString(com.yunbao.live.R.string.insufficient_balance))
.setClickCallback(new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
}).build().show();
return;
}
ToastUtil.show(msg);
initData();
}

View File

@ -1,7 +1,12 @@
package com.yunbao.main.adapter;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -13,18 +18,26 @@ import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow;
import com.yunbao.common.dialog.LiberalBattlePassPopupWindow;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.main.R;
import com.yunbao.main.event.BattlePassTypeEvent;
import java.util.ArrayList;
import java.util.List;
@ -36,6 +49,7 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
private List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> mList = new ArrayList<>();
private int userLevel;
private BattlePassUserInfoBean userType;
private String quintessenceSpendMoney,enjoySpendMoney;
private OnItemClickListener<LiveBattlePassRewardsBean.LiveBattlePassReward> onItemClickListener;
public void setList(List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> mList) {
@ -74,6 +88,14 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
return mList.size();
}
public void setQuintessenceSpendMoney(String quintessenceSpendMoney) {
this.quintessenceSpendMoney=quintessenceSpendMoney;
}
public void setEnjoySpendMoney(String enjoySpendMoney) {
this.enjoySpendMoney=enjoySpendMoney;
}
public class VH extends RecyclerView.ViewHolder {
View lineBg, line, point;
View tab1Layout, tab2Layout, tab3Layout;
@ -144,6 +166,9 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
setVisibility(View.VISIBLE, -1, tab1Layout, tab2Layout, tab3Layout);
setVisibility(View.VISIBLE, -1, tab1, tab2, tab3);
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);
point.setVisibility(View.GONE);
@ -179,6 +204,7 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
}), tab1Unlock, tab2Unlock, tab3Unlock);
getAllView(((reward, view) -> {
lv.setText("V" + reward.getLiveBattlePassLevel());
lv.setTag(reward);
view.setText(reward.getRewardName());
}), tab1Title, tab2Title, tab3Title);
getAllView(((reward, view) -> {
@ -206,6 +232,11 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
}
if (reward.getLock() == 1) {
//ToastUtil.show("锁了");
if(reward.getLiveBattlePassTypeId()==2){
showBuyType(true);
}else{
showBuyType(false);
}
return;
}
if (reward.getReceived() == 2) {
@ -236,7 +267,7 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
.getRewards(String.valueOf(reward.getLiveBattlePassLevel()), String.valueOf(reward.getId()), new HttpCallback<HttpCallbackModel>() {
@Override
public void onSuccess(HttpCallbackModel data) {
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_reward_item_get));
ToastUtil.show(data.getMsg());
if (onItemClickListener != null) {
onItemClickListener.onItemClick(reward, reward.getId());
}
@ -275,7 +306,38 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewa
setVisibility(View.INVISIBLE, type - 1, tab1Layout, tab2Layout, tab3Layout);
}
}
private void showBuyType(boolean is){
new XPopup.Builder(itemView.getContext())
.enableDrag(false)
.maxWidth(DeviceUtils.getScreenHeight((Activity) itemView.getContext()) - DpUtil.dp2px(34))
.asCustom(new ActivateEliteBattleOrderPopupWindow(
itemView.getContext(),
is?quintessenceSpendMoney:enjoySpendMoney,
is,
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
@Override
public void onCallback(int code, String msg) {
if (code == 1001) {
new DialogUitl.Builder(itemView.getContext())
.setView(com.yunbao.live.R.layout.dialog_live_unfollow)
.setConfirmString(itemView.getContext().getString(com.yunbao.live.R.string.charge))
.setContent(itemView.getContext().getString(com.yunbao.live.R.string.insufficient_balance))
.setClickCallback(new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
}).build().show();
return;
}
ToastUtil.show(msg);
Bus.get().post(new BattlePassTypeEvent(0));
}
},
"2"
))
.show();
}
}
private interface ViewData<T> {

View File

@ -1,6 +1,9 @@
package com.yunbao.main.fragment;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -8,6 +11,7 @@ import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.BattlePassTask;
import com.yunbao.common.bean.BattlePassUserInfoBean;
@ -20,6 +24,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
@ -83,18 +88,31 @@ public class BattlePassMissionFragment extends BaseFragment {
.enableDrag(false)
.maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34))
.asCustom(new OrderLevelPopupWindow(getContext(),
userInfoBean.getBattlePassExp() - userInfoBean.getLastLevelExp(),
userInfoBean.getNextLevelExp() - userInfoBean.getLastLevelExp(),
userInfoBean,
userInfoBean.getBattlePassExp()-userInfoBean.getLastLevelExp(),
userInfoBean.getNextLevelExp()-userInfoBean.getLastLevelExp(),
String.valueOf(userInfoBean.getLevel()),
String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getCoin()),
maxExp,
new OrderLevelPopupWindow.OrderLevelCallback() {
@Override
public void onCallback(int code, String msg) {
if (code == 1001) {
new DialogUitl.Builder(getContext())
.setView(com.yunbao.live.R.layout.dialog_live_unfollow)
.setConfirmString(getString(com.yunbao.live.R.string.charge))
.setContent(getString(com.yunbao.live.R.string.insufficient_balance))
.setClickCallback(new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
}).build().show();
return;
}
ToastUtil.show(msg);
Bus.get().post(new BattlePassTypeEvent(0));
updateData();
IMLoginManager.get(getContext()).upDataUserInfo();
}
}
)

View File

@ -1,6 +1,9 @@
package com.yunbao.main.fragment;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -10,6 +13,7 @@ import android.widget.ImageView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
@ -21,6 +25,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
@ -104,6 +109,19 @@ public class BattlePassRewardFragment extends BaseFragment {
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
@Override
public void onCallback(int code, String msg) {
if (code == 1001) {
new DialogUitl.Builder(getContext())
.setView(com.yunbao.live.R.layout.dialog_live_unfollow)
.setConfirmString(getString(com.yunbao.live.R.string.charge))
.setContent(getString(com.yunbao.live.R.string.insufficient_balance))
.setClickCallback(new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
}).build().show();
return;
}
ToastUtil.show(msg);
updateData();
Bus.get().post(new BattlePassTypeEvent(0));
@ -127,6 +145,19 @@ public class BattlePassRewardFragment extends BaseFragment {
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
@Override
public void onCallback(int code, String msg) {
if (code == 1001) {
new DialogUitl.Builder(getContext())
.setView(com.yunbao.live.R.layout.dialog_live_unfollow)
.setConfirmString(getString(com.yunbao.live.R.string.charge))
.setContent(getString(com.yunbao.live.R.string.insufficient_balance))
.setClickCallback(new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
}).build().show();
return;
}
ToastUtil.show(msg);
updateData();
Bus.get().post(new BattlePassTypeEvent(0));
@ -151,9 +182,11 @@ public class BattlePassRewardFragment extends BaseFragment {
for (LiveBattlePassRewardsBean.BattlePassType passType : data.getLive_battle_pass_type()) {
if (passType.getId() == 2) {
quintessenceSpendMoney = String.valueOf(passType.getDiamond_value());
adapter.setQuintessenceSpendMoney(quintessenceSpendMoney);
}
if (passType.getId() == 3) {
enjoySpendMoney = String.valueOf(passType.getDiamond_value());
adapter.setEnjoySpendMoney(enjoySpendMoney);
}
}

View File

@ -85,13 +85,13 @@
layout="@layout/view_battlepass_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp" />
android:layout_marginTop="16dp" />
<androidx.viewpager2.widget.ViewPager2
android:layout_marginTop="26dp"
android:id="@+id/context_layout"
android:layout_width="match_parent"
android:background="@drawable/background_order_dialog"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:background="@drawable/background_order_dialog" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -122,13 +122,10 @@
android:layout_marginTop="8dp"
android:text="甜蜜氣球\n&amp;積分30"
android:textColor="#0D21B2"
android:textSize="14sp"
android:textSize="12sp"
android:textStyle="bold"
android:maxLines="2"
app:autoSizeMaxTextSize="14sp"
app:autoSizeMinTextSize="5sp"
app:autoSizeStepGranularity="1sp"
app:autoSizeTextType="uniform"
android:maxLines="1"
android:ellipsize="end"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tab_1_bg" />
@ -199,7 +196,9 @@
android:layout_marginTop="8dp"
android:text="甜蜜氣球\n&amp;積分30"
android:textColor="#0D21B2"
android:textSize="14sp"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -263,12 +262,14 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tab_3_title"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="甜蜜氣球\n&amp;積分30"
android:textColor="#0D21B2"
android:textSize="14sp"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"