diff --git a/app/build.gradle b/app/build.gradle index 6a5cb886f..4a5890d4b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -166,23 +166,23 @@ 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" }else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) { isGoogle = "Samsung" } - 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/build.gradle b/common/build.gradle index 73f54e530..cc8b9746c 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -191,7 +191,7 @@ dependencies { api 'com.github.princekin-f:EasyFloat:2.0.4' api files('libs/Msc.jar') - api 'com.github.li-xiaojun:XPopup:2.9.1' + api 'com.github.li-xiaojun:XPopup:2.10.0' api 'com.github.shenbengit:PagerGridLayoutManager:1.1.7' //选择器 diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index 08715be7d..6b1a7119d 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -12,7 +12,6 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.bean.FansMedalBean; -import com.yunbao.common.bean.LevelBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserItemBean; import com.yunbao.common.http.CommonHttpUtil; @@ -29,7 +28,6 @@ import java.util.Map; /** * Created by cxf on 2017/8/4. */ - public class CommonAppConfig { //域名 public static final String HOST = getMetaDataString("SERVER_HOST"); @@ -109,8 +107,6 @@ public class CommonAppConfig { private boolean mLaunched;//App是否启动了 private String mJPushAppKey;//极光推送的AppKey private List mUserItemList;//个人中心功能列表 - private SparseArray mLevelMap; - private SparseArray mAnchorLevelMap; private SparseArray mAnchorFansMedalMap; private String mGiftListJson; private String mWrapListJson; @@ -521,46 +517,6 @@ public class CommonAppConfig { } - /** - * 保存用户等级信息 - */ - public void setLevel(String levelJson) { - if (TextUtils.isEmpty(levelJson)) { - return; - } - List list = JSON.parseArray(levelJson, LevelBean.class); - if (list == null || list.size() == 0) { - return; - } - if (mLevelMap == null) { - mLevelMap = new SparseArray<>(); - } - mLevelMap.clear(); - for (LevelBean bean : list) { - mLevelMap.put(bean.getLevel(), bean); - } - } - - /** - * 保存主播等级信息 - */ - public void setAnchorLevel(String anchorLevelJson) { - if (TextUtils.isEmpty(anchorLevelJson)) { - return; - } - List list = JSON.parseArray(anchorLevelJson, LevelBean.class); - if (list == null || list.size() == 0) { - return; - } - if (mAnchorLevelMap == null) { - mAnchorLevelMap = new SparseArray<>(); - } - mAnchorLevelMap.clear(); - for (LevelBean bean : list) { - mAnchorLevelMap.put(bean.getLevel(), bean); - } - } - /** * 保存主播粉丝徽章信息 */ @@ -599,40 +555,6 @@ public class CommonAppConfig { } - /** - * 获取用户等级 - */ - public LevelBean getLevel(int level) { - if (mLevelMap == null) { - String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG); - if (!TextUtils.isEmpty(configString)) { - JSONObject obj = JSON.parseObject(configString); - setLevel(obj.getString("level")); - } - } - if (mLevelMap == null || mLevelMap.size() == 0) { - return null; - } - return mLevelMap.get(level); - } - - /** - * 获取主播等级 - */ - public LevelBean getAnchorLevel(int level) { - if (mAnchorLevelMap == null) { - String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG); - if (!TextUtils.isEmpty(configString)) { - JSONObject obj = JSON.parseObject(configString); - setAnchorLevel(obj.getString("levelanchor")); - } - } - if (mAnchorLevelMap == null || mAnchorLevelMap.size() == 0) { - return null; - } - return mAnchorLevelMap.get(level); - } - public String getGiftListJson() { return mGiftListJson; } diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index 6f9ed2090..a0ea5df91 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -263,6 +263,8 @@ public class Constants { public static final String LIVE_SDK = "liveSdk"; public static final String LIVE_KSY_CONFIG = "liveKsyConfig"; + + public static final String LIVE_PK_RANDOM_START="RankingStartRandomPK"; public static final int LIVE_SDK_KSY = 0;//金山推流 public static final int LIVE_SDK_TX = 1;//腾讯推流 diff --git a/common/src/main/java/com/yunbao/common/bean/BattlePassPoints.java b/common/src/main/java/com/yunbao/common/bean/BattlePassPoints.java new file mode 100644 index 000000000..add65fdb2 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/BattlePassPoints.java @@ -0,0 +1,175 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class BattlePassPoints extends BaseModel{ + private int id; + private int type; + @SerializedName("rewards_name") + private String rewardsName; + @SerializedName("rewards_id") + private int rewardsId; + @SerializedName("image_url") + private String imageUrl; + @SerializedName("points_threshold") + private String pointsThreshold; + @SerializedName("points_threshold_text") + private String pointsThresholdText; + @SerializedName("rewards_value") + private String rewardsValue; + @SerializedName("battle_pass_level") + private int battlePassLevel; + @SerializedName("exchange_quantity") + private int exchangeQuantity; + @SerializedName("live_battle_pass_type_id") + private int liveBattlePassTypeId; + private String description; + @SerializedName("restrict_time") + private int restrictTime; + private int sort; + @SerializedName("exchange_status") + private int exchangeStatus; + @SerializedName("user_quinty_count") + private int userQuintyCount; + @SerializedName("exchange_status_remark") + private String exchangeMark; + + public BattlePassPoints() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getRewardsName() { + return rewardsName; + } + + public void setRewardsName(String rewardsName) { + this.rewardsName = rewardsName; + } + + public int getRewardsId() { + return rewardsId; + } + + public void setRewardsId(int rewardsId) { + this.rewardsId = rewardsId; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public String getPointsThreshold() { + return pointsThreshold; + } + + public void setPointsThreshold(String pointsThreshold) { + this.pointsThreshold = pointsThreshold; + } + + public String getRewardsValue() { + return rewardsValue; + } + + public void setRewardsValue(String rewardsValue) { + this.rewardsValue = rewardsValue; + } + + public int getBattlePassLevel() { + return battlePassLevel; + } + + public void setBattlePassLevel(int battlePassLevel) { + this.battlePassLevel = battlePassLevel; + } + + public int getExchangeQuantity() { + return exchangeQuantity; + } + + public void setExchangeQuantity(int exchangeQuantity) { + this.exchangeQuantity = exchangeQuantity; + } + + public int getLiveBattlePassTypeId() { + return liveBattlePassTypeId; + } + + public void setLiveBattlePassTypeId(int liveBattlePassTypeId) { + this.liveBattlePassTypeId = liveBattlePassTypeId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getRestrictTime() { + return restrictTime; + } + + public void setRestrictTime(int restrictTime) { + this.restrictTime = restrictTime; + } + + public int getSort() { + return sort; + } + + public void setSort(int sort) { + this.sort = sort; + } + + public int getExchangeStatus() { + return exchangeStatus; + } + + public void setExchangeStatus(int exchangeStatus) { + this.exchangeStatus = exchangeStatus; + } + + public int getUserQuintyCount() { + return userQuintyCount; + } + + public void setUserQuintyCount(int userQuintyCount) { + this.userQuintyCount = userQuintyCount; + } + + public String getExchangeMark() { + return exchangeMark; + } + + public void setExchangeMark(String exchangeMark) { + this.exchangeMark = exchangeMark; + } + + public String getPointsThresholdText() { + return pointsThresholdText; + } + + public void setPointsThresholdText(String pointsThresholdText) { + this.pointsThresholdText = pointsThresholdText; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/BattlePassTask.java b/common/src/main/java/com/yunbao/common/bean/BattlePassTask.java new file mode 100644 index 000000000..ae19dfe6c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/BattlePassTask.java @@ -0,0 +1,157 @@ +package com.yunbao.common.bean; + +import android.content.Context; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.utils.WordUtil; + +import java.util.List; + +public class BattlePassTask extends BaseModel { + private List daily;// 每日任务 + private List season;// 每期任务 + + public BattlePassTask() { + } + + public List getDaily() { + return daily; + } + + public void setDaily(List daily) { + this.daily = daily; + } + + public List getSeason() { + return season; + } + + public void setSeason(List season) { + this.season = season; + } + + public static class Task { + private int id;// 任务ID + private String type;// 任务类型 + @SerializedName("task_success") + private int taskSuccess;// 任务可以重复的次数 + @SerializedName("name_en") + private String nameEn;// 任务名称英文 + @SerializedName("remark_en") + private String remarkEn;// 任务备注英文 + private String name;// 任务名称中文 + private String remark; // 任务备注中文 + @SerializedName("image_path") + private String imagePath;// 图标path + @SerializedName("user_task_success") + private int userTaskSuccess;// 用户完成的任务次数 + @SerializedName("received_task") + private int receivedTask;// 用户已经领取的任务数量 + @SerializedName("not_received_task") + private int notReceivedTask; // 用户未领取的任务数量 + public boolean isBuy(){ + return taskSuccess==0; + } + public String getNameText(){ + return WordUtil.isNewZh()?name:nameEn; + } + public String getRemarkText(){ + return WordUtil.isNewZh()?remark:remarkEn; + } + + public Task() { + } + + public Task(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getTaskSuccess() { + return taskSuccess; + } + + public void setTaskSuccess(int taskSuccess) { + this.taskSuccess = taskSuccess; + } + + public String getNameEn() { + return nameEn; + } + + public void setNameEn(String nameEn) { + this.nameEn = nameEn; + } + + public String getRemarkEn() { + return remarkEn; + } + + public void setRemarkEn(String remarkEn) { + this.remarkEn = remarkEn; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getImagePath() { + return imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } + + public int getUserTaskSuccess() { + return userTaskSuccess; + } + + public void setUserTaskSuccess(int userTaskSuccess) { + this.userTaskSuccess = userTaskSuccess; + } + + public int getReceivedTask() { + return receivedTask; + } + + public void setReceivedTask(int receivedTask) { + this.receivedTask = receivedTask; + } + + public int getNotReceivedTask() { + return notReceivedTask; + } + + public void setNotReceivedTask(int notReceivedTask) { + this.notReceivedTask = notReceivedTask; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java b/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java new file mode 100644 index 000000000..f6fb0f17c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/BattlePassUserInfoBean.java @@ -0,0 +1,176 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class BattlePassUserInfoBean extends BaseModel{ + private String uid; + private int points; + @SerializedName("battle_pass_exp") + private int battlePassExp; + @SerializedName("battle_pass_user_records_1") + private int battlePassUserRecords1; + @SerializedName("battle_pass_user_records_2") + private int battlePassUserRecords2; + @SerializedName("battle_pass_user_records_3") + private int battlePassUserRecords3; + private int level; + @SerializedName("last_level_exp") + private int lastLevelExp; + @SerializedName("next_level_exp") + private int nextLevelExp; + private String id; + @SerializedName("battle_pass_name") + private String battlePassName; + @SerializedName("start_time") + private String startTime; + @SerializedName("end_time") + private String endTime; + @SerializedName("battle_pass_status") + private boolean battlePassStatus; + @SerializedName("max_level_exp") + private long maxLevelExp; + @SerializedName("max_level") + private int maxLevel; + + private List live_battle_pass_type; + + public BattlePassUserInfoBean() { + } + public List getLive_battle_pass_type() { + return live_battle_pass_type; + } + + public void setLive_battle_pass_type(List live_battle_pass_type) { + this.live_battle_pass_type = live_battle_pass_type; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public int getPoints() { + return points; + } + + public void setPoints(int points) { + this.points = points; + } + + public int getBattlePassExp() { + return battlePassExp; + } + + public void setBattlePassExp(int battlePassExp) { + this.battlePassExp = battlePassExp; + } + + public int getBattlePassUserRecords1() { + return battlePassUserRecords1; + } + + public void setBattlePassUserRecords1(int battlePassUserRecords1) { + this.battlePassUserRecords1 = battlePassUserRecords1; + } + + public int getBattlePassUserRecords2() { + return battlePassUserRecords2; + } + + public void setBattlePassUserRecords2(int battlePassUserRecords2) { + this.battlePassUserRecords2 = battlePassUserRecords2; + } + + public int getBattlePassUserRecords3() { + return battlePassUserRecords3; + } + + public void setBattlePassUserRecords3(int battlePassUserRecords3) { + this.battlePassUserRecords3 = battlePassUserRecords3; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public int getLastLevelExp() { + return lastLevelExp; + } + + public void setLastLevelExp(int lastLevelExp) { + this.lastLevelExp = lastLevelExp; + } + + public int getNextLevelExp() { + return nextLevelExp; + } + + public void setNextLevelExp(int nextLevelExp) { + this.nextLevelExp = nextLevelExp; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getBattlePassName() { + return battlePassName; + } + + public void setBattlePassName(String battlePassName) { + this.battlePassName = battlePassName; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public boolean isBattlePassStatus() { + return battlePassStatus; + } + + public void setBattlePassStatus(boolean battlePassStatus) { + this.battlePassStatus = battlePassStatus; + } + + public long getMaxLevelExp() { + return maxLevelExp; + } + + public void setMaxLevelExp(long maxLevelExp) { + this.maxLevelExp = maxLevelExp; + } + + public int getMaxLevel() { + return maxLevel; + } + + public void setMaxLevel(int maxLevel) { + this.maxLevel = maxLevel; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java b/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java new file mode 100644 index 000000000..942e5d34d --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java @@ -0,0 +1,162 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; +import java.util.Map; + +public class LiveBattlePassRewardsBean extends BaseModel{ + private int level; + private List live_battle_pass_type; + private Map> live_battle_pass_rewards; + + public LiveBattlePassRewardsBean() { + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public List getLive_battle_pass_type() { + return live_battle_pass_type; + } + + public void setLive_battle_pass_type(List live_battle_pass_type) { + this.live_battle_pass_type = live_battle_pass_type; + } + + public Map> getLive_battle_pass_rewards() { + return live_battle_pass_rewards; + } + + public void setLive_battle_pass_rewards(Map> live_battle_pass_rewards) { + this.live_battle_pass_rewards = live_battle_pass_rewards; + } + + public static class BattlePassType extends BaseModel{ + private int id; + private String battle_pass_name; + private int sort; + private int diamond_value; + private int lock; + + public BattlePassType() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getBattle_pass_name() { + return battle_pass_name; + } + + public void setBattle_pass_name(String battle_pass_name) { + this.battle_pass_name = battle_pass_name; + } + + public int getSort() { + return sort; + } + + public void setSort(int sort) { + this.sort = sort; + } + + public int getDiamond_value() { + return diamond_value; + } + + public void setDiamond_value(int diamond_value) { + this.diamond_value = diamond_value; + } + + public int getLock() { + return lock; + } + + public void setLock(int lock) { + this.lock = lock; + } + } + public static class LiveBattlePassReward extends BaseModel{ + private int id; + @SerializedName("live_battle_pass_level") + private int liveBattlePassLevel; + @SerializedName("live_battle_pass_type_id") + private int liveBattlePassTypeId; + @SerializedName("reward_name") + private String rewardName; + @SerializedName("image_url") + private String imageUrl; + private int lock; + private int received; + + public LiveBattlePassReward() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getLiveBattlePassLevel() { + return liveBattlePassLevel; + } + + public void setLiveBattlePassLevel(int liveBattlePassLevel) { + this.liveBattlePassLevel = liveBattlePassLevel; + } + + public int getLiveBattlePassTypeId() { + return liveBattlePassTypeId; + } + + public void setLiveBattlePassTypeId(int liveBattlePassTypeId) { + this.liveBattlePassTypeId = liveBattlePassTypeId; + } + + public String getRewardName() { + return rewardName; + } + + public void setRewardName(String rewardName) { + this.rewardName = rewardName; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public int getLock() { + return lock; + } + + public void setLock(int lock) { + this.lock = lock; + } + + public int getReceived() { + return received; + } + + public void setReceived(int received) { + this.received = received; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java b/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java index 3ff79aa6f..b83db90a2 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveClassBean.java @@ -20,6 +20,14 @@ public class LiveClassBean { @SerializedName("channel_show") private int channel_show; + public LiveClassBean() { + } + + public LiveClassBean(String chinese, String english) { + this.chinese = chinese; + this.english = english; + } + public String getChinese() { return chinese; } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java index 31c65e757..ee8b51204 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java @@ -3,6 +3,7 @@ package com.yunbao.common.bean; import android.view.View; import com.alibaba.fastjson.annotation.JSONField; +import com.google.gson.annotations.SerializedName; /** * Created by cxf on 2018/10/12. @@ -18,6 +19,8 @@ public class LiveGiftBean { // public static final int MARK_LUCK = 3; private int id; + @SerializedName("gift_id") + private int gift_id;//包裹礼物id private int type;//0 普通礼物 1是贵族 2守护 3粉丝团 5盲盒礼物 private int mark;// 0 普通 1热门 2守护 3幸运 private String name; @@ -34,6 +37,7 @@ public class LiveGiftBean { private String isweek; private String end_time; private String tag; + private boolean isPageGift; @JSONField(name = "blind_box_type") private int blind_box_type = 0; //礼物角标 @@ -71,6 +75,14 @@ public class LiveGiftBean { @JSONField(name = "blind_box_ticket_id") private int blindBoxTicketId; + public boolean isPageGift() { + return isPageGift; + } + + public void setPageGift(boolean pageGift) { + isPageGift = pageGift; + } + public int getBlindBoxTicketId() { return blindBoxTicketId; } @@ -80,6 +92,14 @@ public class LiveGiftBean { return this; } + public int getGift_id() { + return gift_id; + } + + public void setGift_id(int gift_id) { + this.gift_id = gift_id; + } + public int getBlindBoxTicket() { return blindBoxTicket; } diff --git a/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java new file mode 100644 index 000000000..cfe1e3c4e --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/ActivateEliteBattleOrderPopupWindow.java @@ -0,0 +1,88 @@ +package com.yunbao.common.dialog; + +import android.app.Activity; +import android.content.Context; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.style.ImageSpan; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class ActivateEliteBattleOrderPopupWindow extends CenterPopupView { + private boolean elites;//是否精英战令 + private String spendMoney;//花费钱 + private View buttonWarOrder; + private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback; + private String mBattlePassTypeId; + + public ActivateEliteBattleOrderPopupWindow(@NonNull Context context, String mSpendMoney, + boolean elites, + LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback + , String battlePassTypeId) { + super(context); + this.elites = elites; + spendMoney = mSpendMoney; + mPassCallback=passCallback; + mBattlePassTypeId = battlePassTypeId; + } + + @Override + protected int getImplLayoutId() { + return R.layout.activate_elite_battle_order_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + buttonWarOrder = findViewById(R.id.button_war_order); + if (elites) { + findViewById(R.id.gift_overvalue).setVisibility(VISIBLE); + findViewById(R.id.gift_overvalue3).setVisibility(GONE); + 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.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.unlock_more_gifts2)); + } + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + //中文按钮文字 + + ((TextView)findViewById(R.id.button_war_order_text)).setText(spendMoney); + + ViewClicksAntiShake.clicksAntiShake(buttonWarOrder, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + new XPopup.Builder(getContext()) + .enableDrag(false) + .maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34)) + .asCustom(new LiberalBattlePassPopupWindow(getContext(), spendMoney, elites,mPassCallback,mBattlePassTypeId)) + .show(); + } + }); + + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/ActivityEndPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/ActivityEndPopupWindow.java new file mode 100644 index 000000000..3993f2911 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/ActivityEndPopupWindow.java @@ -0,0 +1,35 @@ +package com.yunbao.common.dialog; + +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +/** + * 活动结束 + */ +public class ActivityEndPopupWindow extends CenterPopupView { + public ActivityEndPopupWindow(@NonNull Context context) { + super(context); + } + + @Override + protected int getImplLayoutId() { + return R.layout.activity_end_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.confirm), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java new file mode 100644 index 000000000..dd57c1503 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/LiberalBattlePassPopupWindow.java @@ -0,0 +1,98 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.graphics.Color; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.style.ForegroundColorSpan; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +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.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class LiberalBattlePassPopupWindow extends CenterPopupView { + private String spendMoney;//花费钱 + private boolean mElites;//是否精英战令 + private TextView liberalBattlePass; + private LiberalBattlePassCallback mPassCallback; + private String mBattlePassTypeId; + + public LiberalBattlePassPopupWindow(@NonNull Context context, String mSpendMoney, boolean elites, LiberalBattlePassCallback passCallback, String battlePassTypeId) { + super(context); + spendMoney = mSpendMoney; + mElites = elites; + mPassCallback = passCallback; + mBattlePassTypeId = battlePassTypeId; + } + + protected int getImplLayoutId() { + return R.layout.liberal_battle_pass_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + liberalBattlePass = findViewById(R.id.liberal_battle_pass); + //中文版 + StringBuffer liberalBattlePassHint = new StringBuffer(); + liberalBattlePassHint.append(WordUtil.isNewZh()?"是否花費":"Did you spend "); + liberalBattlePassHint.append(spendMoney).append(mElites ? + WordUtil.isNewZh()?"鑽石開通精英戰令!":"diamonds to activate the Elite BattlePass": + WordUtil.isNewZh()?"鑽石開通尊享戰令!":"diamonds to activate the Luxury BattlePass"); + //英文版 + + //设置样式 + String liberalBattlePassStr = liberalBattlePassHint.toString(); + SpannableStringBuilder builder = new SpannableStringBuilder(); + builder.append(liberalBattlePassStr); + int spendMoneyIndex = liberalBattlePassStr.indexOf(spendMoney); + int spendMoneySize = spendMoneyIndex + spendMoney.length(); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#CE2BFF")), spendMoneyIndex, spendMoneySize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + liberalBattlePass.setText(builder); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cancel), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.liberal_battle_sure), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + LiveNetManager.get(getContext()). + upgradesBattlePass(mBattlePassTypeId, new HttpCallback>() { + @Override + public void onSuccess(ResponseModel data) { + + dialog.dismiss(); + if (mPassCallback != null) { + mPassCallback.onCallback(data.getData().getCode(), data.getData().getMsg()); + } + } + + @Override + public void onError(String error) { + + dialog.dismiss(); + if (mPassCallback != null) { + mPassCallback.onCallback(102, error); + } + } + }); + + } + }); + + } + + public interface LiberalBattlePassCallback { + void onCallback(int code, String msg); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/OpenAdBottomDialogPopup.java b/common/src/main/java/com/yunbao/common/dialog/OpenAdBottomDialogPopup.java index b4f0dc002..072ab97a8 100644 --- a/common/src/main/java/com/yunbao/common/dialog/OpenAdBottomDialogPopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/OpenAdBottomDialogPopup.java @@ -26,7 +26,7 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow { @Override public void buildDialog(XPopup.Builder builder) { - + builder.animationDuration(0); } @Override diff --git a/common/src/main/java/com/yunbao/common/dialog/OpenAdCenterDialogPopup.java b/common/src/main/java/com/yunbao/common/dialog/OpenAdCenterDialogPopup.java index 5e92f5f10..122cf2568 100644 --- a/common/src/main/java/com/yunbao/common/dialog/OpenAdCenterDialogPopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/OpenAdCenterDialogPopup.java @@ -1,6 +1,7 @@ package com.yunbao.common.dialog; import android.content.Context; +import android.util.Log; import android.widget.ImageView; import androidx.annotation.NonNull; @@ -21,6 +22,10 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow { private OpenAdModel model; private OnItemClickListener mListener; + public OpenAdCenterDialogPopup(@NonNull Context context) { + super(context); + } + public OpenAdCenterDialogPopup(@NonNull Context context, OpenAdModel model) { super(context); this.model = model; @@ -33,6 +38,8 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow { @Override public void buildDialog(XPopup.Builder builder) { + builder.hasShadowBg(false); + builder.animationDuration(0); } @Override @@ -53,6 +60,7 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow { @Override protected void onCreate() { super.onCreate(); + Log.e("-----弹窗-----", "onCreate: 创建弹窗" ); mImageView = findViewById(R.id.img); mClose = findViewById(R.id.close); findViewById(R.id.layout).setOnClickListener(v -> dismiss()); diff --git a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java new file mode 100644 index 000000000..e9d0ae11c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java @@ -0,0 +1,124 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.view.View; +import android.widget.ProgressBar; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +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; + +import java.math.BigDecimal; + +/** + * 战令等级 经验 + */ +public class OrderLevelPopupWindow extends CenterPopupView { + 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; + + public OrderLevelPopupWindow(@NonNull Context context, + int mCurrentExperience, int mTotalExperience, + String mCurrentLevel, String mBalance,long maxExp, OrderLevelCallback mOrderLevelCallback) { + super(context); + currentExperience = mCurrentExperience; + totalExperience = mTotalExperience; + currentLevel = mCurrentLevel; + balance = mBalance; + this.maxExp=maxExp; + orderLevelCallback = mOrderLevelCallback; + } + + @Override + protected int getImplLayoutId() { + return R.layout.order_level_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + orderLevel = findViewById(R.id.tickets_plus_minus); + orderLevelDiamond = findViewById(R.id.order_level_diamond); + balanceDiamond = findViewById(R.id.balance_diamond); + current = findViewById(R.id.current); + progressBar = findViewById(R.id.progressBar); + expText = findViewById(R.id.exp_text); + orderLevel.setText(buyExp); + progressBar.setMax(totalExperience); + progressBar.setProgress(currentExperience); + expText.setText(String.format("%s/%s", currentExperience, totalExperience)); + current.setText(String.format("Lv%s", currentLevel)); + balanceDiamond.setText(balance); + findViewById(R.id.sub).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + float exp = new BigDecimal(buyExp).floatValue(); + if (exp > 100) { + BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("100")); + buyExp = String.valueOf(buyExpBigDecimal.intValue()); + orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue())); + orderLevel.setText(buyExp); + } + } + }); + findViewById(R.id.add).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + float exp = new BigDecimal(buyExp).floatValue(); + if (exp < maxExp && exp < 10000) { + BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100")); + buyExp = String.valueOf(buyExpBigDecimal.intValue()); + orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue())); + orderLevel.setText(buyExp); + }else if(exp>=maxExp){ + ToastUtil.show(WordUtil.isNewZh()?"经验已滿":"Experience full"); + } + + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.war_order_close), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.buying_experience), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + LiveNetManager.get(getContext()) + .buyingExperiencePoint(buyExp, new HttpCallback>() { + @Override + public void onSuccess(ResponseModel data) { + if (orderLevelCallback != null) { + orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg()); + }dialog.dismiss(); + } + + @Override + public void onError(String error) { + if (orderLevelCallback != null) { + orderLevelCallback.onCallback(102, error); + } dialog.dismiss(); + } + }); + } + }); + } + + public interface OrderLevelCallback { + void onCallback(int code, String msg); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java new file mode 100644 index 000000000..c16a17cfb --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java @@ -0,0 +1,91 @@ +package com.yunbao.common.dialog; + +import android.app.Activity; +import android.content.Context; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.core.BasePopupView; +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.bean.BattlePassUserInfoBean; +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; + +/** + * 升級精英/尊享戰令 + */ +public class PromotionElitePopupWindow extends CenterPopupView { + private String enjoySpendMoney, quintessenceSpendMoney;//花费钱 + private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback; + private String elitesTypeId,enjoyTypeId; + private BattlePassUserInfoBean data; + + public PromotionElitePopupWindow(@NonNull Context context, String mEnjoySpendMoney, + String mQuintessenceSpendMoney, LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback, + String elitesTypeId, String enjoyTypeId) { + super(context); + enjoySpendMoney = mEnjoySpendMoney; + quintessenceSpendMoney = mQuintessenceSpendMoney; + mPassCallback = passCallback; + this.elitesTypeId = elitesTypeId; + this.enjoyTypeId = enjoyTypeId; + } + public PromotionElitePopupWindow setUserData(BattlePassUserInfoBean data) { + this.data=data; + return this; + } + + @Override + protected int getImplLayoutId() { + return R.layout.promotion_elite_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dialog.dismiss(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.button_quintessence), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if(data!=null && data.getBattlePassUserRecords2()==2){ + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); + return; + } + dialog.dismiss(); + new XPopup.Builder(getContext()) + .enableDrag(false) + .maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34)) + .asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), quintessenceSpendMoney, true, mPassCallback, elitesTypeId)) + .show(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.button_enjoy), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if(data!=null && data.getBattlePassUserRecords3()==2){ + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); + return; + } + dialog.dismiss(); + new XPopup.Builder(getContext()) + .enableDrag(false) + .maxWidth(DeviceUtils.getScreenHeight((Activity) getContext()) - DpUtil.dp2px(34)) + .asCustom(new ActivateEliteBattleOrderPopupWindow(getContext(), enjoySpendMoney, false, mPassCallback, enjoyTypeId)) + .show(); + } + }); + } + + +} diff --git a/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java new file mode 100644 index 000000000..84321a2f9 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/RuleOfWarPopupWindow.java @@ -0,0 +1,51 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; + +public class RuleOfWarPopupWindow extends CenterPopupView { + public RuleOfWarPopupWindow(@NonNull Context context) { + super(context); + } + private TextView rule; + @Override + protected int getImplLayoutId() { + return R.layout.rule_of_war_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + 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(){ + LiveNetManager.get(getContext()) + .getBattlePassRule(new HttpCallback() { + @Override + public void onSuccess(String data) { + rule.setText(data.replace("\n","\n\n")); + } + + @Override + public void onError(String error) { + + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java new file mode 100644 index 000000000..75a49e067 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/WarOrderExchangeDetailsPopupWindow.java @@ -0,0 +1,134 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.R; +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; + +import java.math.BigDecimal; + +/** + * 战令兑换详情 + */ +public class WarOrderExchangeDetailsPopupWindow extends CenterPopupView { + private TextView orderLevel, pointExchange; + private String buyExp = "1"; + private int mPoint, mLimitQuantity, mScale; + private String mImageUrl; + private ImageView exchangeParticulars; + private String battlePassPointsId; + private WarOrderExchangeDetailsCallback orderExchangeDetailsCallback; + + /*** + * + * @param context + * @param limitQuantity 最大限制数量 + * @param point 自己的积分 + * @param scale 兑换比例 + * @param imageUrl 物品图片的url + */ + public WarOrderExchangeDetailsPopupWindow(@NonNull Context context, int limitQuantity, + int point, int scale, String imageUrl, String battlePassPointsId, WarOrderExchangeDetailsCallback orderExchangeDetailsCallback) { + super(context); + mPoint = point; + mLimitQuantity = limitQuantity; + mScale = scale; + mImageUrl = imageUrl; + this.battlePassPointsId = battlePassPointsId; + this.orderExchangeDetailsCallback = orderExchangeDetailsCallback; + } + + @Override + protected int getImplLayoutId() { + return R.layout.war_order_exchange_details_popup; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + orderLevel = findViewById(R.id.tickets_plus_minus); + exchangeParticulars = findViewById(R.id.exchange_particulars); + pointExchange = findViewById(R.id.point_exchange); + orderLevel.setText(buyExp); + BigDecimal needExpBigDecimal = new BigDecimal(buyExp).multiply(new BigDecimal(mScale)); + pointExchange.setText(String.format("%s",needExpBigDecimal)); + ImgLoader.display(getContext(), mImageUrl, exchangeParticulars); + findViewById(R.id.sub).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + float exp = new BigDecimal(buyExp).floatValue(); + if (exp > 1) { + BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("1")); + buyExp = String.valueOf(buyExpBigDecimal.intValue()); + orderLevel.setText(buyExp); + BigDecimal needExpBigDecimal = buyExpBigDecimal.multiply(new BigDecimal(mScale)); + pointExchange.setText(String.format("%s",needExpBigDecimal)); + } + } + }); + findViewById(R.id.add).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + int number = new BigDecimal(mScale).multiply(new BigDecimal(buyExp)).intValue(); + int exp = new BigDecimal(buyExp).intValue(); + if (exp < mLimitQuantity && number < mPoint) { + BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("1")); + buyExp = String.valueOf(buyExpBigDecimal.intValue()); + 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)); + } + } + }); + findViewById(R.id.war_order_close).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + dismiss(); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.point_exchange_linear), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + LiveNetManager.get(getContext()) + .pointsExchange(battlePassPointsId, buyExp, new HttpCallback>() { + @Override + public void onSuccess(ResponseModel data) { + dialog.dismiss(); + if (orderExchangeDetailsCallback != null) { + orderExchangeDetailsCallback.onCallback(data.getData().getCode(), data.getData().getMsg()); + } + } + + @Override + public void onError(String error) { + dialog.dismiss(); + if (orderExchangeDetailsCallback != null) { + orderExchangeDetailsCallback.onCallback(102, error); + } + } + }); + } + }); + } + + public interface WarOrderExchangeDetailsCallback { + void onCallback(int code, String msg); + } +} diff --git a/common/src/main/java/com/yunbao/common/fragment/BaseFragment.java b/common/src/main/java/com/yunbao/common/fragment/BaseFragment.java index f2fefa3eb..63e419780 100644 --- a/common/src/main/java/com/yunbao/common/fragment/BaseFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/BaseFragment.java @@ -70,6 +70,13 @@ public abstract class BaseFragment extends Fragment { * 请求数据 */ protected abstract void loadData(); + public void updateData(){ + + } + + protected T findViewById(int id){ + return contentView.findViewById(id); + } @Override public void onDestroy() { diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index db17a7499..07f5b0021 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -181,8 +181,6 @@ public class CommonHttpUtil { JSONObject obj = JSON.parseObject(info[0]); ConfigBean bean = JSON.toJavaObject(obj, ConfigBean.class); CommonAppConfig.getInstance().setConfig(bean); - CommonAppConfig.getInstance().setLevel(obj.getString("level")); - CommonAppConfig.getInstance().setAnchorLevel(obj.getString("levelanchor")); CommonAppConfig.getInstance().alert_time = obj.getInteger("alert_time"); CommonAppConfig.getInstance().alert_end_time = obj.getInteger("alert_end_time"); //解析粉丝徽章 diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java index e496f63c7..616a2d0f7 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java @@ -11,6 +11,7 @@ import com.yunbao.common.utils.L; import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.VersionUtil; +import com.yunbao.common.utils.WordUtil; import java.io.File; @@ -350,7 +351,11 @@ public class LiveHttpUtil { .params("p", p) .execute(callback); } - + public static void getContactMsg(int page, HttpCallback callback) { + HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg") + .params("p", page) + .execute(callback); + } /** * 观众跟主播连麦时,获取自己的流地址 @@ -640,7 +645,40 @@ public class LiveHttpUtil { .params("appVersion", CommonAppConfig.getInstance().getVersion()) .execute(callback); } - + /** + * 观众给主播送礼物 - 包裹 + * + * @param isContactGift 是否为联系方式礼物 + */ + public static void sendGiftForPage(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) { + HttpClient.getInstance().get("Live.sendPackGift", LiveHttpConsts.SEND_GIFT) + .params("liveuid", liveUid) + .params("stream", stream) + .params("giftid", giftId) + .params("isContactGift", isContactGift) + .params("giftcount", giftCount) + .params("isprank", by) + .params("fans_exclusive_pack", isFansGroupGift ? "1" : "0") + .params("appVersion", CommonAppConfig.getInstance().getVersion()) + .execute(callback); + } + /** + * 观众给主播送礼物 - 粉丝团 + * + * @param isContactGift 是否为联系方式礼物 + */ + public static void sendGiftForFansGroup(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) { + HttpClient.getInstance().get("Live.fansExclusivePack", LiveHttpConsts.SEND_GIFT) + .params("liveuid", liveUid) + .params("stream", stream) + .params("giftid", giftId) + .params("isContactGift", isContactGift) + .params("giftcount", giftCount) + .params("isprank", by) + .params("fans_exclusive_pack", isFansGroupGift ? "1" : "0") + .params("appVersion", CommonAppConfig.getInstance().getVersion()) + .execute(callback); + } public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) { HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT) .params("liveuid", liveUid) @@ -999,5 +1037,13 @@ public class LiveHttpUtil { .execute(callback); } + /** + * 获取短剧Url + */ + public static void getCoolydrama(HttpCallback callback){ + HttpClient.getInstance().get("cool.register", "Home.getFollow") + .params("lang", WordUtil.isNewZh()?"zh_CN":"en") + .execute(callback); + } } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index b0f7ca437..b6e092d7e 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -5,6 +5,9 @@ import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.BattlePassPoints; +import com.yunbao.common.bean.BattlePassTask; +import com.yunbao.common.bean.BattlePassUserInfoBean; import com.yunbao.common.bean.BlindBoxInfoModel; import com.yunbao.common.bean.CheckLiveModel; import com.yunbao.common.bean.CheckRemainingBalance; @@ -31,6 +34,7 @@ import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveAnchorCallMeModel; import com.yunbao.common.bean.LiveAnchorSayModel; +import com.yunbao.common.bean.LiveBattlePassRewardsBean; import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; @@ -555,7 +559,7 @@ public interface PDLiveApi { /** * 机器人删除话术 */ - @GET("/api/public/?service=Live.delAiAutomaticSpeech ") + @GET("/api/public/?service=Live.delAiAutomaticSpeech") Observable>> delAiAutomaticSpeech( @Query("type") String type, @Query("id") String id @@ -663,7 +667,9 @@ public interface PDLiveApi { * 获取收件箱信息 */ @GET("/api/public/?service=Live.getContactMsg") - Observable>> getContactMsg(); + Observable>> getContactMsg( + @Query("p") int page + ); /** * 删除联系方式信件 @@ -1091,4 +1097,42 @@ public interface PDLiveApi { Observable> buyTicket( @Field("quantity") String quantity ); + + @GET("/api/public/?service=Livebattlepass.upgradesBattlePass") + Observable> upgradesBattlePass(@Query("battle_pass_type_id") String battlePassTypeId); + + @GET("/api/public/?service=Livebattlepass.buyingExperiencePoint") + Observable> buyingExperiencePoint(@Query("exp_count") String expCount); + + /** + * battle_pass_points_id => 兑换列表ID + * count => 兑换物品的数量 + * + * @return + */ + @GET("/api/public/?service=Livebattlepass.pointsExchange") + Observable> pointsExchange( + @Query("battle_pass_points_id") String battlePassPointsId, + @Query("count") String count + ); + @GET("/api/public/?service=Livebattlepass.getBattlePassUserInfo") + Observable> getBattlePassUserInfo(); + + @GET("/api/public/?service=Livebattlepass.getLiveBattlePassRewards") + Observable> getLiveBattlePassRewards(); + @GET("/api/public/?service=Livebattlepass.getRewards") + Observable>> getRewards( + @Query("live_battle_pass_level_id")String rewardLevelId, + @Query("live_battle_pass_rewards_id")String rewardId + ); + @GET("/api/public/?service=Livebattlepass.getBattlePassTask") + Observable> getBattlePassTask(); + @GET("/api/public/?service=Livebattlepass.getTask") + Observable>> getTask(@Query("task_id")String taskId); + @GET("/api/public/?service=Livebattlepass.getBattlePassPoints") + Observable>> getBattlePassPoints(); + @GET("/api/public/?service=Livebattlepass.battlePassRule") + Observable> battlePassRule(); + @GET("/api/public/?service=Livebattlepass.addChatCount") + Observable>> addChatCount(); } 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 b562973be..ba14573fa 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 @@ -8,6 +8,9 @@ import com.yunbao.common.Constants; import com.yunbao.common.R; import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.BattlePassPoints; +import com.yunbao.common.bean.BattlePassTask; +import com.yunbao.common.bean.BattlePassUserInfoBean; import com.yunbao.common.bean.BlindBoxInfoModel; import com.yunbao.common.bean.CheckLiveModel; import com.yunbao.common.bean.CheckRemainingBalance; @@ -31,6 +34,7 @@ import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveAnchorCallMeModel; import com.yunbao.common.bean.LiveAnchorSayModel; +import com.yunbao.common.bean.LiveBattlePassRewardsBean; import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; @@ -1264,20 +1268,25 @@ public class LiveNetManager { * * @param callback 回调 */ - public void getContactMsg(HttpCallback> callback) { - API.get().pdLiveApi(mContext) - .getContactMsg() + private Disposable contactMsgApi; + + public synchronized void getContactMsg(int page, HttpCallback> callback) { + contactMsgApi = API.get().pdLiveApi(mContext) + .getContactMsg(page) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(listResponseModel -> { if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); } + contactMsgApi = null; }, throwable -> { if (callback != null) { callback.onError(throwable.getMessage()); } - }).isDisposed(); + contactMsgApi = null; + }); } /** @@ -2461,6 +2470,72 @@ public class LiveNetManager { }).isDisposed(); } + public void pointsExchange(String battlePassPointsId, String count, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .pointsExchange(battlePassPointsId, count) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel objectResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(objectResponseModel); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void buyingExperiencePoint(String expCount, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .buyingExperiencePoint(expCount) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel objectResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(objectResponseModel); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void upgradesBattlePass(String battlePassTypeId, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .upgradesBattlePass(battlePassTypeId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + public void accept(ResponseModel objectResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(objectResponseModel); + } + + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + public void quickGiftSendGift(String quickGiftNumber, String liveUid, String stream, HttpCallback callback) { API.get().pdLiveApi(mContext) .quickGiftSendGift(quickGiftNumber, liveUid, stream) @@ -2551,6 +2626,170 @@ public class LiveNetManager { }).isDisposed(); } + public void getBattlePassUserInfo(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getBattlePassUserInfo() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(checkRemainingBalanceResponseModel -> { + if (callback != null) { + callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getLiveBattlePassRewards(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getLiveBattlePassRewards() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(checkRemainingBalanceResponseModel -> { + if (callback != null) { + callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getRewards(String rewardLevelId, String rewardId, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getRewards(rewardLevelId, rewardId) + .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() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getBattlePassTask(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getBattlePassTask() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(checkRemainingBalanceResponseModel -> { + if (callback != null) { + callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getBattlePassTaskOver(String taskId, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getTask(taskId) + .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() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getBattlePassPoints(HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getBattlePassPoints() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(checkRemainingBalanceResponseModel -> { + if (callback != null) { + callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void getBattlePassRule(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .battlePassRule() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(checkRemainingBalanceResponseModel -> { + if (callback != null) { + callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + public void addChatCount(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .addChatCount() + .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() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } /** * 直播间取消网络请求 */ @@ -2564,5 +2803,8 @@ public class LiveNetManager { if (randomPkApi != null) { randomPkApi.dispose(); } + if (contactMsgApi != null) { + contactMsgApi.dispose(); + } } } diff --git a/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java b/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java index 6856890dd..46242290d 100644 --- a/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java +++ b/common/src/main/java/com/yunbao/common/manager/OpenAdManager.java @@ -83,12 +83,16 @@ public class OpenAdManager { }); } - + private static long showTime=0; public synchronized void show(int type, boolean isGuard) { if (list == null) { init(true); return; } + if(System.currentTimeMillis()-showTime<100){ + return; + } + showTime=System.currentTimeMillis(); showType = type; for (OpenAdModel model : list) { if (model.getType() == type) { @@ -179,6 +183,10 @@ public class OpenAdManager { if (model.getType() != showType) { return; } + if(isShow(model)){ + Log.i(TAG,"展示过:"+model); + return; + } showMap.put(model.getId(), true); if (model.getShowModel() == OpenAdModel.SHOW_DIY) { String nextTime= String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000)); diff --git a/common/src/main/java/com/yunbao/common/utils/AndroidBug5497Workaround.java b/common/src/main/java/com/yunbao/common/utils/AndroidBug5497Workaround.java index a52dc7781..bcc191cad 100644 --- a/common/src/main/java/com/yunbao/common/utils/AndroidBug5497Workaround.java +++ b/common/src/main/java/com/yunbao/common/utils/AndroidBug5497Workaround.java @@ -1,9 +1,12 @@ package com.yunbao.common.utils; import android.app.Activity; +import android.content.Context; import android.graphics.Rect; import android.view.View; +import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.inputmethod.InputMethodManager; import android.widget.FrameLayout; /** @@ -15,12 +18,13 @@ public class AndroidBug5497Workaround { // For more information, see https://issuetracker.google.com/issues/36911528 // To use this class, simply invoke assistActivity() on an Activity that already has its content view set. - public static void assistActivity (Activity activity) { + public static void assistActivity(Activity activity) { new AndroidBug5497Workaround(activity); } private View mChildOfContent; private int usableHeightPrevious; + private int defHeight = ViewGroup.LayoutParams.MATCH_PARENT; private FrameLayout.LayoutParams frameLayoutParams; private AndroidBug5497Workaround(Activity activity) { @@ -29,8 +33,14 @@ public class AndroidBug5497Workaround { mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { possiblyResizeChildOfContent(); + int heightDiff = mChildOfContent.getRootView().getHeight() - mChildOfContent.getHeight(); + if (heightDiff < 100) { + frameLayoutParams.height = defHeight; + mChildOfContent.requestLayout(); + } } }); + frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams(); } @@ -39,7 +49,7 @@ public class AndroidBug5497Workaround { if (usableHeightNow != usableHeightPrevious) { int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight(); int heightDifference = usableHeightSansKeyboard - usableHeightNow; - if (heightDifference > (usableHeightSansKeyboard/4)) { + if (heightDifference > (usableHeightSansKeyboard / 4)) { // keyboard probably just became visible frameLayoutParams.height = usableHeightSansKeyboard - heightDifference; } else { diff --git a/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java b/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java index 079fcecda..5fadf48e3 100644 --- a/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java @@ -44,7 +44,7 @@ public class GoogleUtils { public boolean getGoogleService() { - boolean flag; + boolean flag =false; try { Class clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage"); googlePay = clz.getConstructor(Activity.class).newInstance(mActivity); diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 8918e70e0..8f013b898 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -607,7 +607,7 @@ public class JavascriptInterfaceUtils { public void androidClickToTaskPage() { ARouter.getInstance().build(PATH_REWARD).withString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid() - + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation(); + + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation(); } @JavascriptInterface @@ -678,4 +678,8 @@ public class JavascriptInterfaceUtils { }); } + @JavascriptInterface + public void androidGotoCustomerService(String url) { + RouteUtil.forwardCustomerService(url); + } } diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index ea92f5cc5..a1395186e 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -32,8 +32,6 @@ public class RouteUtil { public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity"; public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity"; public static final String PATH_LiveZHUANGBANACTIVITY = "/live/ZhuangBanActivity"; - - public static final String PATH_COMPENSATE_ACTIVITY = "/live/CompensateActivity"; public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity"; public static final String PATH_MAIN = "/main/MainActivity"; public static final String PATH_ENTRY = "/main/EntryActivity"; @@ -47,7 +45,7 @@ public class RouteUtil { public static final String PATH_RED_PACKET_LIST = "/main/RedPacketListActivity"; public static final String PATH_RED_PACKET_INFO = "/main/RedPacketInfoActivity"; public static final String PATH_RED_PACKET_USER = "/main/RedPacketUsersActivity"; - public static final String PATH_SELECT_AVATAR = "/main/UserAvatarSelectActivity"; + public static final String PATH_SELECT_AVATAR="/main/UserAvatarSelectActivity"; public static void forwardFansActivity(String uid) { ARouter.getInstance().build(PATH_FANSACTIVITY) @@ -150,21 +148,6 @@ public class RouteUtil { .navigation(); } - /** - * 跳转到 - */ - public static void forwardLiveCompensateActivity(Context context, String msgid, String banner, String title, String content, String time, String link, boolean receive) { - ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY) - .withString("msgid", msgid) - .withString("banner", banner) - .withString("title", title) - .withString("content", content) - .withString("time", time) - .withString("link", link) - .withBoolean("receive", receive) - .navigation(); - } - /** * 跳转到装扮 */ @@ -201,7 +184,7 @@ public class RouteUtil { * 跳转到充值页面 */ public static void forwardMyCoin(Context context) { - String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=zhifu&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); + String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=zhifu&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); ARouter.getInstance().build(PATH_COIN).withString("url", url).navigation(); } @@ -252,14 +235,14 @@ public class RouteUtil { postcard.navigation(); } - public static void forwardGiftWallActivity(String mStream, String mAnchorName, String mLiveUid, String mAvatarUrl, int isAttention, boolean isLive) { + public static void forwardGiftWallActivity(String mStream, String mAnchorName, String mLiveUid, String mAvatarUrl, int isAttention,boolean isLive) { ARouter.getInstance().build(PATH_GIFT_WALL) .withString(Constants.LIVE_UID, mLiveUid) .withString(Constants.STREAM, mStream) .withString("mAnchorName", mAnchorName) .withString("mAvatarUrl", mAvatarUrl) .withInt("isAttention", isAttention) - .withBoolean("isLive", isLive) + .withBoolean("isLive",isLive) .navigation(); } @@ -333,4 +316,12 @@ public class RouteUtil { ARouter.getInstance().build(PATH_SELECT_AVATAR) .navigation(); } + + /** + * 战令 + */ + public static void forwardBattlePass(){ + ARouter.getInstance().build(PATH_BattlePassActivity) + .navigation(); + } } diff --git a/common/src/main/java/com/yunbao/common/utils/WordUtil.java b/common/src/main/java/com/yunbao/common/utils/WordUtil.java index 2c48546a4..52f651070 100644 --- a/common/src/main/java/com/yunbao/common/utils/WordUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/WordUtil.java @@ -34,7 +34,8 @@ public class WordUtil { } public static boolean isNewZh() { - return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE; + return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE + || IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE ; } public static String getNewString(int res) { diff --git a/common/src/main/res/drawable/background_order_dialog.xml b/common/src/main/res/drawable/background_order_dialog.xml new file mode 100644 index 000000000..51b11b8ab --- /dev/null +++ b/common/src/main/res/drawable/background_order_dialog.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/background_order_dialog_out_layout.png b/common/src/main/res/drawable/background_order_dialog_out_layout.png new file mode 100644 index 000000000..571cb8b81 Binary files /dev/null and b/common/src/main/res/drawable/background_order_dialog_out_layout.png differ diff --git a/common/src/main/res/drawable/order_level_progress_bg.xml b/common/src/main/res/drawable/order_level_progress_bg.xml new file mode 100644 index 000000000..587aa4c17 --- /dev/null +++ b/common/src/main/res/drawable/order_level_progress_bg.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/activate_elite_battle_order_popup.xml b/common/src/main/res/layout/activate_elite_battle_order_popup.xml new file mode 100644 index 000000000..19e1e0051 --- /dev/null +++ b/common/src/main/res/layout/activate_elite_battle_order_popup.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/activity_end_popup.xml b/common/src/main/res/layout/activity_end_popup.xml new file mode 100644 index 000000000..09a2d5882 --- /dev/null +++ b/common/src/main/res/layout/activity_end_popup.xml @@ -0,0 +1,40 @@ + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_open_center_ad.xml b/common/src/main/res/layout/dialog_open_center_ad.xml index d32b5e485..dd60e83a6 100644 --- a/common/src/main/res/layout/dialog_open_center_ad.xml +++ b/common/src/main/res/layout/dialog_open_center_ad.xml @@ -13,7 +13,7 @@ android:layout_marginStart="20dp" android:layout_marginEnd="20dp" android:layout_marginBottom="12dp" - android:scaleType="fitEnd" + android:scaleType="fitCenter" app:layout_constraintBottom_toTopOf="@+id/close" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> diff --git a/common/src/main/res/layout/liberal_battle_pass_popup.xml b/common/src/main/res/layout/liberal_battle_pass_popup.xml new file mode 100644 index 000000000..222928af4 --- /dev/null +++ b/common/src/main/res/layout/liberal_battle_pass_popup.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/order_level_popup.xml b/common/src/main/res/layout/order_level_popup.xml new file mode 100644 index 000000000..987c2ae67 --- /dev/null +++ b/common/src/main/res/layout/order_level_popup.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/promotion_elite_popup.xml b/common/src/main/res/layout/promotion_elite_popup.xml new file mode 100644 index 000000000..7165f16bd --- /dev/null +++ b/common/src/main/res/layout/promotion_elite_popup.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + +