diff --git a/app/build.gradle b/app/build.gradle index 2846a3d21..33f632e69 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -166,21 +166,21 @@ android { } } variant.outputs.all { - def isGoogle = "link" + def isGoogle = "链接" if (rootProject.ext.manifestPlaceholders.isGooglePlay == 1) { - isGoogle = "Google" + isGoogle = "谷歌" } else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) { isGoogle = "Huawei" } - def isPlugin = "all" + def isPlugin = "完整" if (rootProject.ext.manifestPlaceholders.isPluginModel) { - isPlugin = "plugin" + isPlugin = "插件" } def isTest = "测试服" if (rootProject.ext.manifestPlaceholders.serverHost == "https://napi.yaoulive.com") { isTest = "正式服" } - outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk" + outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk" } } diff --git a/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java index 5c96f8984..7a64b2d97 100644 --- a/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java @@ -49,14 +49,14 @@ public class ActivateEliteBattleOrderPopupWindow extends CenterPopupView { findViewById(R.id.enjoy_image).setVisibility(GONE); findViewById(R.id.elites_image).setVisibility(VISIBLE); findViewById(R.id.gift_overvalue).setVisibility(VISIBLE); - ((TextView)findViewById(R.id.gift3_text)).setText(WordUtil.getNewString(R.string.gift_overvalue)); + ((TextView)findViewById(R.id.gift3_text)).setText(WordUtil.getNewString(R.string.unlock_more_gifts)); } else { findViewById(R.id.gift_overvalue).setVisibility(GONE); findViewById(R.id.gift_overvalue3).setVisibility(VISIBLE); findViewById(R.id.enjoy_image).setVisibility(VISIBLE); findViewById(R.id.elites_image).setVisibility(GONE); findViewById(R.id.gift_overvalue).setVisibility(GONE); - ((TextView)findViewById(R.id.gift3_text)).setText(WordUtil.getNewString(R.string.gift_overvalue3)); + ((TextView)findViewById(R.id.gift3_text)).setText(WordUtil.getNewString(R.string.unlock_more_gifts2)); } ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() { @Override diff --git a/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java index 9adbd3f05..84321a2f9 100644 --- a/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java @@ -1,6 +1,7 @@ package com.yunbao.common.dialog; import android.content.Context; +import android.view.View; import android.widget.TextView; import androidx.annotation.NonNull; @@ -25,6 +26,12 @@ public class RuleOfWarPopupWindow extends CenterPopupView { protected void onCreate() { super.onCreate(); rule=findViewById(R.id.rule); + findViewById(R.id.close).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + dismiss(); + } + }); initData(); } private void initData(){ @@ -32,7 +39,7 @@ public class RuleOfWarPopupWindow extends CenterPopupView { .getBattlePassRule(new HttpCallback() { @Override public void onSuccess(String data) { - rule.setText(data); + rule.setText(data.replace("\n","\n\n")); } @Override diff --git a/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java index 610c57a7c..75a49e067 100644 --- a/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java @@ -13,6 +13,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -89,6 +90,10 @@ public class WarOrderExchangeDetailsPopupWindow extends CenterPopupView { orderLevel.setText(buyExp); BigDecimal needExpBigDecimal = buyExpBigDecimal.multiply(new BigDecimal(mScale)); pointExchange.setText(String.format("%s",needExpBigDecimal)); + }else if(exp >= mLimitQuantity){ + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_exchange_buy_max)); + }else { + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_exchange_buy_integral)); } } }); diff --git a/common/src/main/res/layout/order_level_popup.xml b/common/src/main/res/layout/order_level_popup.xml index f7ffef01b..435ecde21 100644 --- a/common/src/main/res/layout/order_level_popup.xml +++ b/common/src/main/res/layout/order_level_popup.xml @@ -54,8 +54,10 @@ @@ -83,10 +85,10 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="2" - android:gravity="center" - android:inputType="number" - android:imeOptions="actionSend" android:background="@null" + android:gravity="center" + android:imeOptions="actionSend" + android:inputType="number" android:singleLine="true" android:text="0" android:textColor="#000000" diff --git a/common/src/main/res/layout/rule_of_war_popup.xml b/common/src/main/res/layout/rule_of_war_popup.xml index 2f4bffdeb..b57f0eec2 100644 --- a/common/src/main/res/layout/rule_of_war_popup.xml +++ b/common/src/main/res/layout/rule_of_war_popup.xml @@ -14,8 +14,8 @@ android:orientation="vertical"> More Collectible outfits After opened,the rewards that have reached will be automatically unlocked! My level - Purchase experience value: + Purchase EXP value: Buy This activity has ended. Please collect the unclaimed rewards as soon as possible.Points can be reserved for future use Exchange Details %s(points) exchange exchange Quantity: + Insufficient points + The quantity of goods exchanged has reached the upper limit diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 908bb1b7b..a08ff9554 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1415,4 +1415,6 @@ %s(積分) 兌換 兌換 數量: + 積分不足 + 商品兌換數量已達到上限 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index d80923bed..63a9a830d 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1414,4 +1414,6 @@ %s(積分) 兌換 兌換 數量: + 積分不足 + 商品兌換數量已達到上限 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index b42b77437..437d384f4 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1414,4 +1414,6 @@ %s(積分) 兌換 兌換 數量: + 積分不足 + 商品兌換數量已達到上限 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index d3992181d..7fde8ac10 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1413,12 +1413,14 @@ Limited ride And limited avatar frame More Collectible outfits After opened,the rewards that have reached will be automatically unlocked! My level - Purchase experience value: + Purchase EXP value: Buy This activity has ended. Please collect the unclaimed rewards as soon as possible.Points can be reserved for future use Exchange Details %s(points) exchange exchange Quantity: + Insufficient points + The quantity of goods exchanged has reached the upper limit 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 a29f1d712..d30054aa0 100644 --- a/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java @@ -59,6 +59,7 @@ public class BattlePassActivity extends AbsActivity { TextView sessionView; TextView timeView; TextView levelView; + TextView expText; ProgressBar levelProgressView; TextView integralView; Button moreIntegralButton; @@ -92,6 +93,7 @@ public class BattlePassActivity extends AbsActivity { tab1 = findViewById(R.id.tab_1); tab2 = findViewById(R.id.tab_2); tab3 = findViewById(R.id.tab_3); + expText = findViewById(R.id.exp_text); viewPager = findViewById(R.id.context_layout); fragments.add(new BattlePassRewardFragment()); fragments.add(new BattlePassMissionFragment()); @@ -121,7 +123,8 @@ public class BattlePassActivity extends AbsActivity { moreIntegralButton = findViewById(R.id.more_integral); ViewClicksAntiShake.clicksAntiShake(moreIntegralButton, () -> { - if(data.getBattlePassUserRecords3()==2){ + if (data.getBattlePassUserRecords3() == 2) { + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); return; } new XPopup.Builder(mContext) @@ -133,7 +136,7 @@ public class BattlePassActivity extends AbsActivity { new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() { @Override public void onCallback(int code, String msg) { - System.out.println("code = " + code + ", msg = " + msg); + ToastUtil.show(msg); fragments.get(viewPager.getCurrentItem()).updateData(); } }, @@ -185,8 +188,13 @@ public class BattlePassActivity extends AbsActivity { public void onSuccess(BattlePassUserInfoBean data) { BattlePassActivity.this.data = data; sessionView.setText(data.getBattlePassName()); - timeView.setText(data.getStartTime() + " - " + data.getEndTime()); + timeView.setText(String.format("%s %s - %s", + WordUtil.getNewString(R.string.battlepass_user_time), + data.getStartTime(), + data.getEndTime() + )); levelView.setText("Lv." + data.getLevel()); + expText.setText(data.getBattlePassExp() + "/" + data.getNextLevelExp()); levelProgressView.setMax(data.getNextLevelExp()); levelProgressView.setMin(data.getLastLevelExp()); levelProgressView.setProgress(data.getBattlePassExp()); @@ -200,8 +208,8 @@ public class BattlePassActivity extends AbsActivity { enjoySpendMoney = String.valueOf(passType.getDiamond_value()); } } - if(!data.isBattlePassStatus() && !SpUtil.getInstance().getBooleanValue("is_battle_pass_status")){ - SpUtil.getInstance().setBooleanValue("is_battle_pass_status",true);//ActivityEndPopupWindow + if (!data.isBattlePassStatus() && !SpUtil.getInstance().getBooleanValue("is_battle_pass_status")) { + SpUtil.getInstance().setBooleanValue("is_battle_pass_status", true);//ActivityEndPopupWindow new XPopup.Builder(BattlePassActivity.this) .enableDrag(false) .maxWidth(DeviceUtils.getScreenHeight(BattlePassActivity.this) - DpUtil.dp2px(34)) @@ -211,7 +219,7 @@ public class BattlePassActivity extends AbsActivity { .show(); } - if(data.isBattlePassStatus()){ + if (data.isBattlePassStatus()) { SpUtil.getInstance().removeValue("is_battle_pass_status"); } @@ -226,7 +234,7 @@ public class BattlePassActivity extends AbsActivity { @Subscribe(threadMode = ThreadMode.MAIN) public void event(BattlePassTypeEvent event) { - if(event.getType()==0){ + if (event.getType() == 0) { initData(); } } diff --git a/main/src/main/java/com/yunbao/main/adapter/BattlePassExchangeAdapter.java b/main/src/main/java/com/yunbao/main/adapter/BattlePassExchangeAdapter.java index affaf5d7b..ebad54ee5 100644 --- a/main/src/main/java/com/yunbao/main/adapter/BattlePassExchangeAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/BattlePassExchangeAdapter.java @@ -99,6 +99,7 @@ public class BattlePassExchangeAdapter extends RecyclerView.Adapter> mList = new ArrayList<>(); private int userLevel; - private int userType; + private BattlePassUserInfoBean userType; private OnItemClickListener onItemClickListener; public void setList(List> mList) { @@ -50,7 +50,7 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter ImgLoader.display(mContext, reward.getImageUrl(), view), tab1, tab2, tab3); getAllView(((reward, view) -> { - { if (userLevel < (position + 1)) { view.setVisibility(View.GONE); return; @@ -163,7 +162,6 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter { view.setText(reward.getRewardName()); @@ -194,11 +192,27 @@ public class BattlePassRewardAdapter extends RecyclerView.Adapter() { @Override 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 dc919393f..977302424 100644 --- a/main/src/main/java/com/yunbao/main/fragment/BattlePassMissionFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/BattlePassMissionFragment.java @@ -86,6 +86,7 @@ public class BattlePassMissionFragment extends BaseFragment { 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 0b843c0a7..93f74d49b 100644 --- a/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java @@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; +import com.yunbao.common.bean.BattlePassUserInfoBean; import com.yunbao.common.bean.LiveBattlePassRewardsBean; import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow; import com.yunbao.common.dialog.LiberalBattlePassPopupWindow; @@ -22,6 +23,7 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DeviceUtils; 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.adapter.BattlePassRewardAdapter; @@ -29,11 +31,8 @@ import com.yunbao.main.event.BattlePassTypeEvent; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.TreeSet; public class BattlePassRewardFragment extends BaseFragment { ImageView tab1; @@ -86,7 +85,8 @@ public class BattlePassRewardFragment extends BaseFragment { recyclerView.setAdapter(adapter); ViewClicksAntiShake.clicksAntiShake(tab2, () -> { - if(tab2.getTag()!=null){ + if (tab2.getTag() != null) { + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); return; } new XPopup.Builder(getContext()) @@ -109,7 +109,8 @@ public class BattlePassRewardFragment extends BaseFragment { .show(); }); ViewClicksAntiShake.clicksAntiShake(tab3, () -> { - if(tab3.getTag()!=null){ + if (tab3.getTag() != null) { + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); return; } new XPopup.Builder(getContext()) @@ -121,6 +122,7 @@ public class BattlePassRewardFragment extends BaseFragment { new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() { @Override public void onCallback(int code, String msg) { + ToastUtil.show(msg); loadData(); Bus.get().post(new BattlePassTypeEvent(0)); } @@ -133,13 +135,13 @@ public class BattlePassRewardFragment extends BaseFragment { @Override protected void loadData() { + LiveNetManager.get(getContext()) .getLiveBattlePassRewards(new HttpCallback() { @Override public void onSuccess(LiveBattlePassRewardsBean data) { int level = data.getLevel(); - int type = 1; for (LiveBattlePassRewardsBean.BattlePassType passType : data.getLive_battle_pass_type()) { if (passType.getId() == 2) { quintessenceSpendMoney = String.valueOf(passType.getDiamond_value()); @@ -147,9 +149,7 @@ public class BattlePassRewardFragment extends BaseFragment { if (passType.getId() == 3) { enjoySpendMoney = String.valueOf(passType.getDiamond_value()); } - if (passType.getLock() == 2) { - type = passType.getId(); - } + } Collection> values = data.getLive_battle_pass_rewards().values(); List> list = new ArrayList<>(values); @@ -158,10 +158,24 @@ public class BattlePassRewardFragment extends BaseFragment { list.get(1).get(2).setLock(2); type = 1; level = 3;*/ - setTab(type); adapter.setUserLevel(level); - adapter.setUserType(type); adapter.setList(list); + initData(); + } + + @Override + public void onError(String error) { + + } + }); + } + private void initData() { + LiveNetManager.get(getContext()) + .getBattlePassUserInfo(new HttpCallback() { + @Override + public void onSuccess(BattlePassUserInfoBean data) { + setTab(data); + adapter.setUserType(data); adapter.notifyDataSetChanged(); } @@ -171,25 +185,20 @@ public class BattlePassRewardFragment extends BaseFragment { } }); } - - private void setTab(int type) { - if (type == 1) { + private void setTab(BattlePassUserInfoBean data) { + tab1.setImageResource(R.mipmap.ic_reward_tab_normal); + tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade_unselect); + tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate_unselect); + if(data.getBattlePassUserRecords1()==2){ tab1.setTag(true); tab1.setImageResource(R.mipmap.ic_reward_tab_normal); - tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade_unselect); - tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate_unselect); - } else if (type == 2) { - tab1.setTag(true); + } + if(data.getBattlePassUserRecords2()==2){ tab2.setTag(true); - tab1.setImageResource(R.mipmap.ic_reward_tab_normal); tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade); - tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate_unselect); - } else { - tab1.setTag(true); - tab2.setTag(true); + } + if(data.getBattlePassUserRecords3()==2){ tab3.setTag(true); - tab1.setImageResource(R.mipmap.ic_reward_tab_normal); - tab2.setImageResource(R.mipmap.ic_reward_tab_upgrade); tab3.setImageResource(R.mipmap.ic_reward_tab_ultimate); } } diff --git a/main/src/main/res/layout/activity_battlepass.xml b/main/src/main/res/layout/activity_battlepass.xml index 86ee1a41e..98eb8812c 100644 --- a/main/src/main/res/layout/activity_battlepass.xml +++ b/main/src/main/res/layout/activity_battlepass.xml @@ -80,11 +80,13 @@ android:layout_height="wrap_content" android:src="@mipmap/ic_zl_tab3_unselect" /> + + android:layout_height="wrap_content" + android:layout_marginTop="32dp" /> + @@ -95,6 +97,7 @@ android:layout_height="31dp" android:layout_marginTop="10dp" android:autoSizeTextType="uniform" + android:textAllCaps="false" android:background="@mipmap/bg_zl_battlepass_exchange_btn_exchange" android:text="兌換\n(0/10)" android:textColor="#FFF" diff --git a/main/src/main/res/layout/item_battlepass_mission_type_mission.xml b/main/src/main/res/layout/item_battlepass_mission_type_mission.xml index 727804658..820190c5e 100644 --- a/main/src/main/res/layout/item_battlepass_mission_type_mission.xml +++ b/main/src/main/res/layout/item_battlepass_mission_type_mission.xml @@ -37,13 +37,14 @@ @@ -53,6 +54,7 @@ android:layout_height="30dp" android:layout_marginEnd="12dp" android:text="@string/battlepass_mission_submit_btn_unfinished" + android:textAllCaps="false" android:textColor="#FFFFFF" android:background="@drawable/bg_battlepass_mission_btn_unfinished" android:textSize="14sp" diff --git a/main/src/main/res/layout/view_battlepass_user.xml b/main/src/main/res/layout/view_battlepass_user.xml index df570a330..16a99bcf4 100644 --- a/main/src/main/res/layout/view_battlepass_user.xml +++ b/main/src/main/res/layout/view_battlepass_user.xml @@ -1,5 +1,7 @@ @@ -21,12 +23,14 @@ android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content"/> + + - - + > + + + + + 暫未達到等級 領取成功 開通成功 + 您已購買該戰令 \ No newline at end of file diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index cbda7a324..2b652a2ec 100644 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -19,4 +19,5 @@ Not yet reached level Successfully claimed Successfully opened + You have purchased the BattlePass