diff --git a/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java b/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java index f6fb0f17c..12ef62d04 100644 --- a/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java +++ b/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java @@ -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 + + '}'; + } } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java b/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java index 942e5d34d..3deed7e93 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java @@ -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 + + '}'; + } } } diff --git a/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java index d01dc42a7..fb0a87a5e 100644 --- a/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java @@ -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 diff --git a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java index e9d0ae11c..0d64fa8c4 100644 --- a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java @@ -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>() { @Override public void onSuccess(ResponseModel 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() { + @Override + public void onItemClick(JSONObject bean, int position) { + if (bean != null) { + balance = bean.getString("coin"); + balanceDiamond.setText(balance); + } + } + }); } public interface OrderLevelCallback { diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 70354f0e5..9b4321c7a 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -2675,9 +2675,7 @@ public class LiveNetManager { .observeOn(AndroidSchedulers.mainThread()) .subscribe(responseModel -> { if (callback != null) { - if (callback != null) { - callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg())); - } + callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg())); } }, new Consumer() { @Override diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 7920c8b1c..cb7684922 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -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 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); + } + } + }); + } } diff --git a/common/src/main/res/layout/dialog_del_sys_msg.xml b/common/src/main/res/layout/dialog_del_sys_msg.xml index 3ef23ead4..691d65d14 100644 --- a/common/src/main/res/layout/dialog_del_sys_msg.xml +++ b/common/src/main/res/layout/dialog_del_sys_msg.xml @@ -26,26 +26,26 @@ android:orientation="horizontal"> diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 52ccbcbbf..1a4af54ee 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1445,4 +1445,6 @@ Limited ride And limited avatar frame Information Unmute Mute + + Cancel diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 46ff1fc27..d10050f16 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1444,4 +1444,5 @@ 直播通行證 + 取消 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index e17bbbf4f..1018b7ee1 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1443,4 +1443,6 @@ 直播通行證 + 取消 + diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 472ac39c6..7649f4799 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1440,4 +1440,6 @@ 直播通行證 + 取消 + diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 1b5e11e88..e40c4c050 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1449,4 +1449,6 @@ Limited ride And limited avatar frame BattlePass + Cancel + diff --git a/config.gradle b/config.gradle index 8853bfc05..26fb307cc 100644 --- a/config.gradle +++ b/config.gradle @@ -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, diff --git a/live/src/main/java/com/yunbao/live/activity/CompensateActivity.java b/live/src/main/java/com/yunbao/live/activity/CompensateActivity.java index d6d8371bb..b49b023bd 100644 --- a/live/src/main/java/com/yunbao/live/activity/CompensateActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/CompensateActivity.java @@ -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 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 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(); - } } diff --git a/live/src/main/res/layout/activity_compensate.xml b/live/src/main/res/layout/activity_compensate.xml index a4dafaf6e..890092289 100644 --- a/live/src/main/res/layout/activity_compensate.xml +++ b/live/src/main/res/layout/activity_compensate.xml @@ -80,13 +80,13 @@ app:cardCornerRadius="10dp" app:cardElevation="0dp"> - + android:layout_height="87dp" + android:layout_centerHorizontal="true" + android:scaleType="centerCrop" /> + diff --git a/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java b/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java index 8bc19b420..c6c5e3392 100644 --- a/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java @@ -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(); } diff --git a/main/src/main/java/com/yunbao/main/adapter/BattlePassRewardAdapter.java b/main/src/main/java/com/yunbao/main/adapter/BattlePassRewardAdapter.java index f411b65c6..f862fb108 100644 --- a/main/src/main/java/com/yunbao/main/adapter/BattlePassRewardAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/BattlePassRewardAdapter.java @@ -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> mList = new ArrayList<>(); private int userLevel; private BattlePassUserInfoBean userType; + private String quintessenceSpendMoney,enjoySpendMoney; private OnItemClickListener onItemClickListener; public void setList(List> mList) { @@ -74,6 +88,14 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter { 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() { @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 { diff --git a/main/src/main/java/com/yunbao/main/fragment/BattlePassMissionFragment.java b/main/src/main/java/com/yunbao/main/fragment/BattlePassMissionFragment.java index bfa6b0d28..dd55d1c92 100644 --- a/main/src/main/java/com/yunbao/main/fragment/BattlePassMissionFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/BattlePassMissionFragment.java @@ -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(); } } ) diff --git a/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java b/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java index 099f6431f..389c7b1b7 100644 --- a/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java @@ -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); } } diff --git a/main/src/main/res/layout/activity_battlepass.xml b/main/src/main/res/layout/activity_battlepass.xml index 98eb8812c..bf646eb73 100644 --- a/main/src/main/res/layout/activity_battlepass.xml +++ b/main/src/main/res/layout/activity_battlepass.xml @@ -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" /> + android:layout_height="match_parent" + android:layout_marginTop="10dp" + android:background="@drawable/background_order_dialog" /> \ No newline at end of file diff --git a/main/src/main/res/layout/item_battlepass_reward_type_top.xml b/main/src/main/res/layout/item_battlepass_reward_type_top.xml index 7afc6a5af..10ddef773 100644 --- a/main/src/main/res/layout/item_battlepass_reward_type_top.xml +++ b/main/src/main/res/layout/item_battlepass_reward_type_top.xml @@ -122,13 +122,10 @@ android:layout_marginTop="8dp" android:text="甜蜜氣球\n&積分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&積分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" />