Merge branch 'dev_6.6.4_战令'
# Conflicts: # common/src/main/res/values-en-rUS/string.xml # common/src/main/res/values-zh-rHK/strings.xml # common/src/main/res/values-zh-rTW/strings.xml # common/src/main/res/values-zh/strings.xml # common/src/main/res/values/strings.xml # config.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"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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'
|
||||
//选择器
|
||||
|
@ -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<UserItemBean> mUserItemList;//个人中心功能列表
|
||||
private SparseArray<LevelBean> mLevelMap;
|
||||
private SparseArray<LevelBean> mAnchorLevelMap;
|
||||
private SparseArray<FansMedalBean> 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<LevelBean> 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<LevelBean> 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;
|
||||
}
|
||||
|
@ -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;//腾讯推流
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
157
common/src/main/java/com/yunbao/common/bean/BattlePassTask.java
Normal file
@ -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<Task> daily;// 每日任务
|
||||
private List<Task> season;// 每期任务
|
||||
|
||||
public BattlePassTask() {
|
||||
}
|
||||
|
||||
public List<Task> getDaily() {
|
||||
return daily;
|
||||
}
|
||||
|
||||
public void setDaily(List<Task> daily) {
|
||||
this.daily = daily;
|
||||
}
|
||||
|
||||
public List<Task> getSeason() {
|
||||
return season;
|
||||
}
|
||||
|
||||
public void setSeason(List<Task> 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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<LiveBattlePassRewardsBean.BattlePassType> live_battle_pass_type;
|
||||
|
||||
public BattlePassUserInfoBean() {
|
||||
}
|
||||
public List<LiveBattlePassRewardsBean.BattlePassType> getLive_battle_pass_type() {
|
||||
return live_battle_pass_type;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_type(List<LiveBattlePassRewardsBean.BattlePassType> 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;
|
||||
}
|
||||
}
|
@ -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<BattlePassType> live_battle_pass_type;
|
||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
||||
|
||||
public LiveBattlePassRewardsBean() {
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public List<BattlePassType> getLive_battle_pass_type() {
|
||||
return live_battle_pass_type;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_type(List<BattlePassType> live_battle_pass_type) {
|
||||
this.live_battle_pass_type = live_battle_pass_type;
|
||||
}
|
||||
|
||||
public Map<Integer,Map<Integer,LiveBattlePassReward>> getLive_battle_pass_rewards() {
|
||||
return live_battle_pass_rewards;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_rewards(Map<Integer,Map<Integer,LiveBattlePassReward>> 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -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<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> 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);
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
builder.animationDuration(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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<OpenAdModel> 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());
|
||||
|
@ -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<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> 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);
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
rule.setText(data.replace("\n","\n\n"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -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<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void onSuccess(ResponseModel<Object> 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);
|
||||
}
|
||||
}
|
@ -70,6 +70,13 @@ public abstract class BaseFragment extends Fragment {
|
||||
* 请求数据
|
||||
*/
|
||||
protected abstract void loadData();
|
||||
public void updateData(){
|
||||
|
||||
}
|
||||
|
||||
protected <T extends View> T findViewById(int id){
|
||||
return contentView.findViewById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
@ -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");
|
||||
//解析粉丝徽章
|
||||
|
@ -350,7 +350,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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 观众跟主播连麦时,获取自己的流地址
|
||||
|
@ -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<ResponseModel<List<String>>> delAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("id") String id
|
||||
@ -663,7 +667,9 @@ public interface PDLiveApi {
|
||||
* 获取收件箱信息
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getContactMsg")
|
||||
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg();
|
||||
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg(
|
||||
@Query("p") int page
|
||||
);
|
||||
|
||||
/**
|
||||
* 删除联系方式信件
|
||||
@ -1091,4 +1097,42 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<Object>> buyTicket(
|
||||
@Field("quantity") String quantity
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.upgradesBattlePass")
|
||||
Observable<ResponseModel<Object>> upgradesBattlePass(@Query("battle_pass_type_id") String battlePassTypeId);
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.buyingExperiencePoint")
|
||||
Observable<ResponseModel<Object>> buyingExperiencePoint(@Query("exp_count") String expCount);
|
||||
|
||||
/**
|
||||
* battle_pass_points_id => 兑换列表ID
|
||||
* count => 兑换物品的数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Livebattlepass.pointsExchange")
|
||||
Observable<ResponseModel<Object>> pointsExchange(
|
||||
@Query("battle_pass_points_id") String battlePassPointsId,
|
||||
@Query("count") String count
|
||||
);
|
||||
@GET("/api/public/?service=Livebattlepass.getBattlePassUserInfo")
|
||||
Observable<ResponseModel<BattlePassUserInfoBean>> getBattlePassUserInfo();
|
||||
|
||||
@GET("/api/public/?service=Livebattlepass.getLiveBattlePassRewards")
|
||||
Observable<ResponseModel<LiveBattlePassRewardsBean>> getLiveBattlePassRewards();
|
||||
@GET("/api/public/?service=Livebattlepass.getRewards")
|
||||
Observable<ResponseModel<List<BaseModel>>> getRewards(
|
||||
@Query("live_battle_pass_level_id")String rewardLevelId,
|
||||
@Query("live_battle_pass_rewards_id")String rewardId
|
||||
);
|
||||
@GET("/api/public/?service=Livebattlepass.getBattlePassTask")
|
||||
Observable<ResponseModel<BattlePassTask>> getBattlePassTask();
|
||||
@GET("/api/public/?service=Livebattlepass.getTask")
|
||||
Observable<ResponseModel<List<BaseModel>>> getTask(@Query("task_id")String taskId);
|
||||
@GET("/api/public/?service=Livebattlepass.getBattlePassPoints")
|
||||
Observable<ResponseModel<List<BattlePassPoints>>> getBattlePassPoints();
|
||||
@GET("/api/public/?service=Livebattlepass.battlePassRule")
|
||||
Observable<ResponseModel<String>> battlePassRule();
|
||||
@GET("/api/public/?service=Livebattlepass.addChatCount")
|
||||
Observable<ResponseModel<List<BaseModel>>> addChatCount();
|
||||
}
|
||||
|
@ -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<List<LiveUserMailBoxModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getContactMsg()
|
||||
private Disposable contactMsgApi;
|
||||
|
||||
public synchronized void getContactMsg(int page, HttpCallback<List<LiveUserMailBoxModel>> 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<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.pointsExchange(battlePassPointsId, count)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.buyingExperiencePoint(expCount)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<ResponseModel<Object>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.upgradesBattlePass(battlePassTypeId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||
public void accept(ResponseModel<Object> objectResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(objectResponseModel);
|
||||
}
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<QuickGiftSendGiftModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.quickGiftSendGift(quickGiftNumber, liveUid, stream)
|
||||
@ -2551,6 +2626,170 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getBattlePassUserInfo(HttpCallback<BattlePassUserInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBattlePassUserInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<LiveBattlePassRewardsBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveBattlePassRewards()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<HttpCallbackModel> 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<Throwable>() {
|
||||
@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<BattlePassTask> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBattlePassTask()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<HttpCallbackModel> 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<Throwable>() {
|
||||
@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<List<BattlePassPoints>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBattlePassPoints()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.battlePassRule()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(checkRemainingBalanceResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(checkRemainingBalanceResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<HttpCallbackModel> 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<Throwable>() {
|
||||
@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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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 {
|
||||
|
@ -45,6 +45,7 @@ public class RouteUtil {
|
||||
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_BattlePassActivity="/main/BattlePassActivity";
|
||||
|
||||
public static void forwardFansActivity(String uid) {
|
||||
ARouter.getInstance().build(PATH_FANSACTIVITY)
|
||||
@ -315,4 +316,12 @@ public class RouteUtil {
|
||||
ARouter.getInstance().build(PATH_SELECT_AVATAR)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* 战令
|
||||
*/
|
||||
public static void forwardBattlePass(){
|
||||
ARouter.getInstance().build(PATH_BattlePassActivity)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
22
common/src/main/res/drawable/background_order_dialog.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="fill_vertical|fill_horizontal"
|
||||
android:src="@drawable/background_order_dialog_out_layout" />
|
||||
</item>
|
||||
<item
|
||||
android:bottom="3dp"
|
||||
android:left="3dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp">
|
||||
<shape>
|
||||
<solid android:color="#F5F5FF" />
|
||||
|
||||
<corners android:radius="10dp" />
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#657FE4" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
After Width: | Height: | Size: 873 KiB |
21
common/src/main/res/drawable/order_level_progress_bg.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#B7AFCD" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip android:clipOrientation="horizontal">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#CE2BFF" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
176
common/src/main/res/layout/activate_elite_battle_order_popup.xml
Normal file
@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginEnd="17dp">
|
||||
<ImageView
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/war_order_close"
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_rule_close" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/elites_image"
|
||||
android:layout_width="211dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="3dp"
|
||||
android:src="@mipmap/icon_activate_the_elite_battle_order"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/enjoy_image"
|
||||
android:layout_width="211dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="3dp"
|
||||
android:src="@mipmap/icon_enjoy_image"
|
||||
android:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/icon_war_order_diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_overvalue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_overvalue"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_overvalue3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_overvalue3"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/icon_order_score" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/more_integral"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@mipmap/icon_war_order_gift" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift3_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/unlock_more_gifts"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/has_reached_level_after_opening"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_war_order"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@mipmap/button_war_order"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/button_war_order_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="123" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/diamond" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
40
common/src/main/res/layout/activity_end_popup.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="218dp"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="75dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/this_activity_is_over"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="33dp"
|
||||
android:background="@mipmap/button_buying_experience"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/edit_one_4"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
@ -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" />
|
||||
|
68
common/src/main/res/layout/liberal_battle_pass_popup.xml
Normal file
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="218dp"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/liberal_battle_pass"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="73dp"
|
||||
android:text="liberal_battle_pass2"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="57dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="19dp"
|
||||
android:background="@mipmap/button_liberal_battle_cancel"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/liberal_battle_sure"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="19dp"
|
||||
android:background="@mipmap/button_liberal_battle_sure"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
182
common/src/main/res/layout/order_level_popup.xml
Normal file
@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="218dp"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/war_order_close"
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_rule_close" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/order_level"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="46dp"
|
||||
android:text="Lv7"
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="221dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="7dp">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="221dp"
|
||||
android:layout_height="6dp"
|
||||
android:max="100"
|
||||
android:progress="10"
|
||||
android:progressDrawable="@drawable/order_level_progress_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exp_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#000"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="500/1000" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/buying_experience_point"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@mipmap/backgroud_tickets_plus_minus">
|
||||
|
||||
<View
|
||||
android:id="@+id/sub"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tickets_plus_minus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:background="@null"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="number"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="#000000"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/add"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/order_level_diamond"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="100"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@mipmap/icon_diamond2" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/balance_diamond"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="100"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@mipmap/icon_diamond2" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buying_experience"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@mipmap/button_buying_experience"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/buying_experience"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
82
common/src/main/res/layout/promotion_elite_popup.xml
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_rule_close" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/upgrade_elite"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/upgrade_elite2"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_quintessence"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:background="@mipmap/bg_dialog_battlepass_btn"
|
||||
android:text="@string/upgrade_elite_type1"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#F36100"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_enjoy"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:background="@mipmap/bg_dialog_battlepass_btn"
|
||||
android:text="@string/upgrade_elite_type2"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#F36100"
|
||||
android:textSize="14sp" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
56
common/src/main/res/layout/rule_of_war_popup.xml
Normal file
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="380dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="111dp"
|
||||
android:layout_height="62.5dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:src="@mipmap/icon_order_rule" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/rule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:textColor="#0D21B2"
|
||||
tools:text="1.戰令開啟時,完成戰令任務,提升戰令等級,可獲得大量等級獎勵。\n2.所有用戶免費解鎖普通版,戰令開啟時隨時可進階為精英版和尊享版,獲得豐厚額外專屬獎勵。\n3.三種戰令都會獎勵積分,可在兌換商城中兌換心儀的寶貝,部分寶貝兌換有戰令等級要求或兌換數量限制。\n4.每日任務0點刷新,未完成任務進度不再累計,每季任務將會在新一季戰令開啟時刷新。\n5.任務達成時需主動領取經驗,未领取經驗將會在任務刷新時過期。\n6.活動最終解釋權歸PDLIVE所有。"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="30dp"
|
||||
android:src="@mipmap/icon_order_rule_close" />
|
||||
|
||||
</LinearLayout>
|
125
common/src/main/res/layout/war_order_exchange_details_popup.xml
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="282dp"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
android:background="@drawable/background_order_dialog"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/war_order_close"
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:src="@mipmap/icon_sud_rule_close" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/exchange_particulars"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="16sp" />
|
||||
<LinearLayout
|
||||
android:background="@mipmap/bg_dialog_battlepass_exchange"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="99dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="19dp">
|
||||
<ImageView
|
||||
android:id="@+id/exchange_particulars"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="99dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/point_exchange_number"
|
||||
android:textColor="#0D21B2"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@mipmap/backgroud_tickets_plus_minus">
|
||||
|
||||
<View
|
||||
android:id="@+id/sub"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tickets_plus_minus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:background="@null"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="number"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="#000000"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/add"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/point_exchange_linear"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="17dp"
|
||||
android:background="@mipmap/button_buying_experience"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/point_exchange"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp"
|
||||
tools:text="123" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:src="@mipmap/ic_integral" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textColor="#E03600"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/point_exchange2" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
After Width: | Height: | Size: 38 KiB |
BIN
common/src/main/res/mipmap-b+en+us/icon_enjoy_image.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
common/src/main/res/mipmap-b+en+us/icon_order_rule.png
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/bg_dialog_battlepass_btn.png
Normal file
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 71 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/button_buying_experience.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/button_enjoy.png
Normal file
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 14 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/button_liberal_battle_sure.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/button_quintessence.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/button_war_order.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_integral.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 32 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_enjoy_image.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_order_rule.png
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_order_rule_close.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_order_score.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_war_order_diamond.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_war_order_gift.png
Normal file
After Width: | Height: | Size: 22 KiB |
@ -411,7 +411,7 @@
|
||||
<string name="live_link_mic_cannot_link_2">Connecting wheat is currently in progress~</string>
|
||||
<string name="live_link_mic_cannot_pk">You are already in PK</string>
|
||||
<string name="live_link_mic_pk_1">We</string>
|
||||
<string name="live_link_mic_pk_2">Other party</string>
|
||||
<string name="live_link_mic_pk_2">Opponent</string>
|
||||
<string name="live_coin_not_enough">The balance is insufficient. Do you want to recharge it?</string>
|
||||
<string name="live_online_anchor">Current online anchor</string>
|
||||
<string name="link_mic_play_game">The other anchor is in the game</string>
|
||||
@ -1393,8 +1393,37 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities.</string>
|
||||
<string name="rule_of_war_hint1">1. When the BattlePass is activated, completing the BattlePass task and increasing the BattlePass level can earn a large amount of level rewards.\n</string>
|
||||
<string name="rule_of_war_hint2">2. All users can unlock the regular version for free, and when the BattlePass is activated, they can upgrade to the elite version and the luxury version at any time, and receive rich additional exclusive rewards.\n</string>
|
||||
|
||||
<string name="pay_cancel">Payment cancellation</string>
|
||||
<string name="pay_suc">Payment successful</string>
|
||||
<string name="pay_fail">Payment failed</string>
|
||||
|
||||
<string name="upgrade_elite">Upgrade Elite/Luxury BattlePass</string>
|
||||
<string name="upgrade_elite_type1">Upgrade Elite BattlePass</string>
|
||||
<string name="upgrade_elite_type2">Upgrade Luxury BattlePass</string>
|
||||
<string name="upgrade_elite2">You can receive a massive amount of points and exchange more rewards</string>
|
||||
<string name="rule_of_war_hint3">3.三種戰令都會獎勵積分,可在兌換商城中兌換心 儀的寶貝,部分寶貝兌換有戰令等級要求或兌換數 量限制。</string>
|
||||
<string name="rule_of_war_hint4">4.每日任務0點刷新,未完成任務進度不再累計, 每季任務將會在新一季戰令開啟時刷新。</string>
|
||||
<string name="rule_of_war_hint5">5.任務達成時需主動領取經驗,未领取經驗將會在 任務刷新時自动领取。</string>
|
||||
<string name="rule_of_war_hint6">6.活動最終解釋權歸PDLIVE所有。</string>
|
||||
<string name="more_integral">More points</string>
|
||||
<string name="gift_overvalue">Gifts worth over 200%</string>
|
||||
<string name="gift_overvalue3">Gifts worth over 300%</string>
|
||||
<string name="unlock_more_gifts">More Rare outfits</string>
|
||||
<string name="unlock_more_gifts2">More Collectible outfits</string>
|
||||
<string name="has_reached_level_after_opening">After opened,the rewards that have reached will be automatically unlocked!</string>
|
||||
<string name="order_level">My level</string>
|
||||
<string name="buying_experience_point">Purchase EXP value:</string>
|
||||
<string name="buying_experience">Buy</string>
|
||||
<string name="this_activity_is_over">This activity has ended. Please collect the unclaimed rewards as soon as possible.Points can be reserved for future use</string>
|
||||
<string name="exchange_particulars">Exchange Details</string>
|
||||
<string name="point_exchange">%s(points) exchange</string>
|
||||
<string name="point_exchange2">exchange</string>
|
||||
<string name="point_exchange_number">Quantity:</string>
|
||||
<string name="battlepass_exchange_buy_integral">Insufficient points</string>
|
||||
<string name="battlepass_exchange_buy_max">The quantity of goods exchanged has reached the upper limit</string>
|
||||
<string name="battlepass_zl_get">Successfully opened</string>
|
||||
<string name="battlepass_buy_max">You have purchased the BattlePass</string>
|
||||
</resources>
|
||||
|
@ -1394,4 +1394,36 @@
|
||||
<string name="pay_cancel">支付取消</string>
|
||||
<string name="pay_suc">支付成功</string>
|
||||
<string name="pay_fail">支付失敗</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
<string name="rule_of_war_hint1">1.戰令開啟時,完成戰令任務,提升戰令等級,可 獲得大量等級獎勵。</string>
|
||||
<string name="rule_of_war_hint2">2.所有用戶免費解鎖普通版,戰令開啟時隨時可進 階為精英版和尊享版,獲得豐厚額外專屬獎勵。</string>
|
||||
<string name="rule_of_war_hint3">3.三種戰令都會獎勵積分,可在兌換商城中兌換心 儀的寶貝,部分寶貝兌換有戰令等級要求或兌換數 量限制。</string>
|
||||
<string name="rule_of_war_hint4">4.每日任務0點刷新,未完成任務進度不再累計, 每季任務將會在新一季戰令開啟時刷新。</string>
|
||||
<string name="rule_of_war_hint5">5.任務達成時需主動領取經驗,未领取經驗將會在 任務刷新時自动领取。</string>
|
||||
<string name="rule_of_war_hint6">6.活動最終解釋權歸PDLIVE所有。</string>
|
||||
|
||||
<string name="upgrade_elite">升級精英/尊享戰令</string>
|
||||
<string name="upgrade_elite_type1">升級精英戰令</string>
|
||||
<string name="upgrade_elite_type2">升級尊享戰令</string>
|
||||
<string name="upgrade_elite2">可領取海量積分,兌換更多獎勵</string>
|
||||
<string name="more_integral">更多積分</string>
|
||||
<string name="gift_overvalue">禮物價值超 200%</string>
|
||||
<string name="gift_overvalue3">禮物價值超 300%</string>
|
||||
<string name="unlock_more_gifts">解鎖更多禮物 和全套珍稀裝扮</string>
|
||||
<string name="unlock_more_gifts2">解鎖更多禮物 和全套典藏裝扮</string>
|
||||
<string name="has_reached_level_after_opening">開通后已達到等級的獎勵將會自動解鎖!</string>
|
||||
<string name="order_level">我的等級</string>
|
||||
<string name="buying_experience_point">購買經驗值:</string>
|
||||
<string name="buying_experience">購買</string>
|
||||
<string name="this_activity_is_over">本期活動已結束,請儘快領取未領取的獎勵積分可保留下次使用</string>
|
||||
<string name="exchange_particulars">兌換詳情</string>
|
||||
<string name="point_exchange">%s(積分) 兌換</string>
|
||||
<string name="point_exchange2">兌換</string>
|
||||
<string name="point_exchange_number">數量:</string>
|
||||
<string name="battlepass_exchange_buy_integral">積分不足</string>
|
||||
<string name="battlepass_exchange_buy_max">商品兌換數量已達到上限</string>
|
||||
<string name="battlepass_zl_get">開通成功</string>
|
||||
<string name="battlepass_buy_max">您已購買該戰令</string>
|
||||
</resources>
|
||||
|
@ -1393,4 +1393,36 @@
|
||||
<string name="pay_cancel">支付取消</string>
|
||||
<string name="pay_suc">支付成功</string>
|
||||
<string name="pay_fail">支付失敗</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
<string name="rule_of_war_hint1">1.戰令開啟時,完成戰令任務,提升戰令等級,可 獲得大量等級獎勵。</string>
|
||||
<string name="rule_of_war_hint2">2.所有用戶免費解鎖普通版,戰令開啟時隨時可進 階為精英版和尊享版,獲得豐厚額外專屬獎勵。</string>
|
||||
<string name="rule_of_war_hint3">3.三種戰令都會獎勵積分,可在兌換商城中兌換心 儀的寶貝,部分寶貝兌換有戰令等級要求或兌換數 量限制。</string>
|
||||
<string name="rule_of_war_hint4">4.每日任務0點刷新,未完成任務進度不再累計, 每季任務將會在新一季戰令開啟時刷新。</string>
|
||||
<string name="rule_of_war_hint5">5.任務達成時需主動領取經驗,未领取經驗將會在 任務刷新時自动领取。</string>
|
||||
<string name="rule_of_war_hint6">6.活動最終解釋權歸PDLIVE所有。</string>
|
||||
|
||||
<string name="upgrade_elite">升級精英/尊享戰令</string>
|
||||
<string name="upgrade_elite_type1">升級精英戰令</string>
|
||||
<string name="upgrade_elite_type2">升級尊享戰令</string>
|
||||
<string name="upgrade_elite2">可領取海量積分,兌換更多獎勵</string>
|
||||
<string name="more_integral">更多積分</string>
|
||||
<string name="gift_overvalue">禮物價值超 200%</string>
|
||||
<string name="gift_overvalue3">禮物價值超 300%</string>
|
||||
<string name="unlock_more_gifts">解鎖更多禮物 和全套珍稀裝扮</string>
|
||||
<string name="unlock_more_gifts2">解鎖更多禮物 和全套典藏裝扮</string>
|
||||
<string name="has_reached_level_after_opening">開通后已達到等級的獎勵將會自動解鎖!</string>
|
||||
<string name="order_level">我的等級</string>
|
||||
<string name="buying_experience_point">購買經驗值:</string>
|
||||
<string name="buying_experience">購買</string>
|
||||
<string name="this_activity_is_over">本期活動已結束,請儘快領取未領取的獎勵積分可保留下次使用</string>
|
||||
<string name="exchange_particulars">兌換詳情</string>
|
||||
<string name="point_exchange">%s(積分) 兌換</string>
|
||||
<string name="point_exchange2">兌換</string>
|
||||
<string name="point_exchange_number">數量:</string>
|
||||
<string name="battlepass_exchange_buy_integral">積分不足</string>
|
||||
<string name="battlepass_exchange_buy_max">商品兌換數量已達到上限</string>
|
||||
<string name="battlepass_zl_get">開通成功</string>
|
||||
<string name="battlepass_buy_max">您已購買該戰令</string>
|
||||
</resources>
|
||||
|
@ -1385,6 +1385,15 @@
|
||||
<string name="conversion_quantity">兌換數量:</string>
|
||||
<string name="conversion_quantity_need">余额 %s</string>
|
||||
<string name="conversion_quantity_need_of_use">兌換&使用規則:</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
<string name="rule_of_war_hint1">1.戰令開啟時,完成戰令任務,提升戰令等級,可 獲得大量等級獎勵。</string>
|
||||
<string name="rule_of_war_hint2">2.所有用戶免費解鎖普通版,戰令開啟時隨時可進 階為精英版和尊享版,獲得豐厚額外專屬獎勵。</string>
|
||||
<string name="rule_of_war_hint3">3.三種戰令都會獎勵積分,可在兌換商城中兌換心 儀的寶貝,部分寶貝兌換有戰令等級要求或兌換數 量限制。</string>
|
||||
<string name="rule_of_war_hint4">4.每日任務0點刷新,未完成任務進度不再累計, 每季任務將會在新一季戰令開啟時刷新。</string>
|
||||
<string name="rule_of_war_hint5">5.任務達成時需主動領取經驗,未领取經驗將會在 任務刷新時自动领取。</string>
|
||||
<string name="rule_of_war_hint6">6.活動最終解釋權歸PDLIVE所有。</string>
|
||||
<string name="conversion_quantity_need_of_use1">一、1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
@ -1393,4 +1402,26 @@
|
||||
<string name="pay_suc">支付成功</string>
|
||||
<string name="pay_fail">支付失敗</string>
|
||||
|
||||
<string name="upgrade_elite">升級精英/尊享戰令</string>
|
||||
<string name="upgrade_elite_type1">升級精英戰令</string>
|
||||
<string name="upgrade_elite_type2">升級尊享戰令</string>
|
||||
<string name="upgrade_elite2">可領取海量積分,兌換更多獎勵</string>
|
||||
<string name="more_integral">更多積分</string>
|
||||
<string name="gift_overvalue">禮物價值超 200%</string>
|
||||
<string name="gift_overvalue3">禮物價值超 300%</string>
|
||||
<string name="unlock_more_gifts">解鎖更多禮物 和全套珍稀裝扮</string>
|
||||
<string name="unlock_more_gifts2">解鎖更多禮物 和全套典藏裝扮</string>
|
||||
<string name="has_reached_level_after_opening">開通后已達到等級的獎勵將會自動解鎖!</string>
|
||||
<string name="order_level">我的等級</string>
|
||||
<string name="buying_experience_point">購買經驗值:</string>
|
||||
<string name="buying_experience">購買</string>
|
||||
<string name="this_activity_is_over">本期活動已結束,請儘快領取未領取的獎勵積分可保留下次使用</string>
|
||||
<string name="exchange_particulars">兌換詳情</string>
|
||||
<string name="point_exchange">%s(積分) 兌換</string>
|
||||
<string name="point_exchange2">兌換</string>
|
||||
<string name="point_exchange_number">數量:</string>
|
||||
<string name="battlepass_exchange_buy_integral">積分不足</string>
|
||||
<string name="battlepass_exchange_buy_max">商品兌換數量已達到上限</string>
|
||||
<string name="battlepass_zl_get">開通成功</string>
|
||||
<string name="battlepass_buy_max">您已購買該戰令</string>
|
||||
</resources>
|
||||
|
@ -411,7 +411,7 @@
|
||||
<string name="live_link_mic_cannot_link_2">Connecting wheat is currently in progress~</string>
|
||||
<string name="live_link_mic_cannot_pk">You are already in PK</string>
|
||||
<string name="live_link_mic_pk_1">We</string>
|
||||
<string name="live_link_mic_pk_2">Other party</string>
|
||||
<string name="live_link_mic_pk_2">Opponent</string>
|
||||
<string name="live_coin_not_enough">The balance is insufficient. Do you want to recharge it?</string>
|
||||
<string name="live_online_anchor">Current online anchor</string>
|
||||
<string name="link_mic_play_game">The other anchor is in the game</string>
|
||||
@ -1400,4 +1400,32 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="pay_cancel">Payment cancellation</string>
|
||||
<string name="pay_suc">Payment successful</string>
|
||||
<string name="pay_fail">Payment failed</string>
|
||||
<string name="upgrade_elite">Upgrade Elite/Luxury BattlePass</string>
|
||||
<string name="upgrade_elite_type1">Upgrade Elite BattlePass</string>
|
||||
<string name="upgrade_elite_type2">Upgrade Luxury BattlePass</string>
|
||||
<string name="upgrade_elite2">You can receive a massive amount of points and exchange more rewards</string>
|
||||
<string name="rule_of_war_hint1">1. When the BattlePass is activated, completing the BattlePass task and increasing the BattlePass level can earn a large amount of level rewards.\n</string>
|
||||
<string name="rule_of_war_hint2">2. All users can unlock the regular version for free, and when the BattlePass is activated, they can upgrade to the elite version and the luxury version at any time, and receive rich additional exclusive rewards.\n</string>
|
||||
<string name="rule_of_war_hint3">3.三種戰令都會獎勵積分,可在兌換商城中兌換心 儀的寶貝,部分寶貝兌換有戰令等級要求或兌換數 量限制。</string>
|
||||
<string name="rule_of_war_hint4">4.每日任務0點刷新,未完成任務進度不再累計, 每季任務將會在新一季戰令開啟時刷新。</string>
|
||||
<string name="rule_of_war_hint5">5.任務達成時需主動領取經驗,未领取經驗將會在 任務刷新時自动领取。</string>
|
||||
<string name="rule_of_war_hint6">6.活動最終解釋權歸PDLIVE所有。</string>
|
||||
<string name="more_integral">More points</string>
|
||||
<string name="gift_overvalue">Gifts worth over 200%</string>
|
||||
<string name="gift_overvalue3">Gifts worth over 300%</string>
|
||||
<string name="unlock_more_gifts">More Rare outfits</string>
|
||||
<string name="unlock_more_gifts2">More Collectible outfits</string>
|
||||
<string name="has_reached_level_after_opening">After opened,the rewards that have reached will be automatically unlocked!</string>
|
||||
<string name="order_level">My level</string>
|
||||
<string name="buying_experience_point">Purchase EXP value:</string>
|
||||
<string name="buying_experience">Buy</string>
|
||||
<string name="this_activity_is_over">This activity has ended. Please collect the unclaimed rewards as soon as possible.Points can be reserved for future use</string>
|
||||
<string name="exchange_particulars">Exchange Details</string>
|
||||
<string name="point_exchange">%s(points) exchange</string>
|
||||
<string name="point_exchange2">exchange</string>
|
||||
<string name="point_exchange_number">Quantity:</string>
|
||||
<string name="battlepass_exchange_buy_integral">Insufficient points</string>
|
||||
<string name="battlepass_exchange_buy_max">The quantity of goods exchanged has reached the upper limit</string>
|
||||
<string name="battlepass_zl_get">Successfully opened</string>
|
||||
<string name="battlepass_buy_max">You have purchased the BattlePass</string>
|
||||
</resources>
|
||||
|
@ -20,11 +20,11 @@ ext {
|
||||
|
||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||
|
||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
||||
isGooglePlay : 3,
|
||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包
|
||||
isGooglePlay : 0,
|
||||
//是否上报异常日志
|
||||
isUploadLog : true,
|
||||
//是否打包成插件包模式
|
||||
isPluginModel : false,
|
||||
isPluginModel : true,
|
||||
]
|
||||
}
|
||||
|
@ -1902,9 +1902,11 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
/**
|
||||
* 检查消息,有未读就要显示红点
|
||||
*/
|
||||
|
||||
private void checkMsgRed() {
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
.getContactMsg(1, new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveUserMailBoxModel> data) {
|
||||
Log.i(TAG, "onSuccess: " + data.size());
|
||||
@ -1927,6 +1929,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
showMsgRed(-1);
|
||||
}
|
||||
});
|
||||
|
@ -9,14 +9,14 @@ import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
@ -24,6 +24,8 @@ import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||
import com.yunbao.live.presenter.UserHomeSharePresenter;
|
||||
import com.yunbao.live.views.LiveRecordPlayViewHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/29.
|
||||
*/
|
||||
@ -82,10 +84,14 @@ public class LiveRecordPlayActivity extends AbsActivity implements
|
||||
mName = (TextView) findViewById(R.id.name);
|
||||
mID = (TextView) findViewById(R.id.id_val);
|
||||
mBtnFollow = findViewById(R.id.btn_follow);
|
||||
ImgLoader.displayAvatar(mContext,mUserBean.getAvatar(), mAvatar);
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext,levelBean.getThumbIcon(), mLevelAnchor);
|
||||
ImgLoader.displayAvatar(mContext, mUserBean.getAvatar(), mAvatar);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= mUserBean.getLevelAnchor() && mUserBean.getLevelAnchor() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getIcon();
|
||||
}
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
}
|
||||
mName.setText(mUserBean.getUserNiceName());
|
||||
mID.setText(mUserBean.getLiangNameTip());
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@ -36,6 +37,7 @@ import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.socket.SocketSendBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@ -287,10 +289,18 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
mName.setText(bean.getUserNiceName());
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.GuardUserBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/6.
|
||||
@ -111,10 +112,18 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mVotes.setText(Html.fromHtml(" <font color='#ffdd00'>" + bean.getContribute() + "</font> " + mVotesName));
|
||||
}
|
||||
}
|
||||
@ -146,10 +155,17 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mVotes.setText(bean.getContribute() + " " + mVotesName);
|
||||
if (bean.getType() == Constants.GUARD_TYPE_DAY) {
|
||||
mIcon.setImageDrawable(mGuardDrawable0);
|
||||
|
@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -18,6 +20,7 @@ import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -106,10 +109,17 @@ public class LiveAdminListAdapter extends RecyclerView.Adapter<LiveAdminListAdap
|
||||
ImgLoader.displayAvatar(mContext,bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext,levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -16,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveShutUpBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -103,10 +106,17 @@ public class LiveBlackAdapter extends RefreshAdapter<LiveShutUpBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,24 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LivePkBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/15.
|
||||
*/
|
||||
@ -39,7 +41,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
}
|
||||
};
|
||||
mLivePkInviteString = "PK";
|
||||
mLivePkInviteString2 =mContext.getString(R.string.live_pk_invite_2);
|
||||
mLivePkInviteString2 = mContext.getString(R.string.live_pk_invite_2);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ -57,7 +59,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mAvatar;
|
||||
TextView mName;
|
||||
TextView mName, leave;
|
||||
ImageView mSex;
|
||||
ImageView mLevel;
|
||||
TextView mBtnInvite;
|
||||
@ -66,6 +68,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
super(itemView);
|
||||
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
|
||||
mName = (TextView) itemView.findViewById(R.id.name);
|
||||
leave = itemView.findViewById(R.id.leave);
|
||||
mSex = (ImageView) itemView.findViewById(R.id.sex);
|
||||
mLevel = (ImageView) itemView.findViewById(R.id.level);
|
||||
mBtnInvite = (TextView) itemView.findViewById(R.id.btn_invite);
|
||||
@ -74,13 +77,22 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
|
||||
void setData(LivePkBean bean) {
|
||||
mBtnInvite.setTag(bean);
|
||||
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext,levelBean.getThumb(), mLevel);
|
||||
|
||||
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
anchorLevel = bean.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
leave.setText(String.valueOf(bean.getLevelAnchor()));
|
||||
ImgLoader.display(itemView.getContext(), imgUrl, mLevel);
|
||||
|
||||
if (bean.isLinkMic()) {
|
||||
mBtnInvite.setText(mLivePkInviteString2);
|
||||
mBtnInvite.setEnabled(false);
|
||||
|
@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -16,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveShutUpBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -103,10 +106,17 @@ public class LiveShutUpAdapter extends RefreshAdapter<LiveShutUpBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
@ -21,28 +22,15 @@ import com.yunbao.common.views.weight.MarqueeTextView;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class LiveUserAnchorMailBoxAdapter extends RefreshAdapter<LiveUserMailBoxModel> {
|
||||
|
||||
public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserAnchorMailBoxAdapter.MailBoxViewHolder> {
|
||||
private Context mContext;
|
||||
private List<LiveUserMailBoxModel> list;
|
||||
OnItemClickListener<LiveUserMailBoxModel> onItemClickListener;
|
||||
DialogInterface.OnDismissListener onWebDismissListener;
|
||||
|
||||
public LiveUserAnchorMailBoxAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
list = new ArrayList<>();
|
||||
public LiveUserAnchorMailBoxAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public void setList(List<LiveUserMailBoxModel> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<LiveUserMailBoxModel> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<LiveUserMailBoxModel> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
@ -56,18 +44,20 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserA
|
||||
@NonNull
|
||||
@Override
|
||||
public MailBoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new MailBoxViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_live_user_mailbox, parent, false));
|
||||
return new MailBoxViewHolder(mInflater.inflate(R.layout.item_live_user_mailbox, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MailBoxViewHolder viewHolder = (MailBoxViewHolder) holder;
|
||||
viewHolder.setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
// @Override
|
||||
// public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
|
||||
// holder.setData(list.get(position), position);
|
||||
// }
|
||||
|
||||
|
||||
public class MailBoxViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView topText;
|
||||
@ -100,9 +90,9 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserA
|
||||
public void onSuccess(String data) {
|
||||
Log.i("刪除信件", "onSuccess:刪除成功 ");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
list.removeIf(it -> it.getId() == box.getId());
|
||||
mList.removeIf(it -> it.getId() == box.getId());
|
||||
}
|
||||
System.err.println("-----> list size = " + list.size());
|
||||
System.err.println("-----> list size = " + mList.size());
|
||||
notifyDataSetChanged();
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(box, position);
|
||||
|
@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@ -24,6 +25,7 @@ import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@ -114,10 +116,17 @@ public class UserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
|
||||
mName.setText(bean.getUserNiceName());
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserRankBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
@ -148,7 +147,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
|
||||
}
|
||||
});
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
|
||||
|
||||
title.setVisibility(View.GONE);
|
||||
title1.setVisibility(View.GONE);
|
||||
@ -285,20 +284,20 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
}
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
if (levelBean != null) {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (bean.isHide() && (type.equals("5") || type.equals("4"))) {
|
||||
mName.setText(R.string.mystery_man);
|
||||
ImgLoader.display2(mContext, R.mipmap.hide, mAvatar);
|
||||
|
@ -205,9 +205,8 @@ public class LiveGiveHotDialogFragment extends AbsDialogFragment {
|
||||
ImgLoader.displayAvatar(mContext, mDatas.get(position).getUser_avatar(), viewHolder.img_head);
|
||||
viewHolder.tv_name.setText(mDatas.get(position).getUser_name());
|
||||
viewHolder.sex.setImageResource(CommonIconUtil.getSexIcon(mDatas.get(position).getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(mDatas.get(position).getLevel());
|
||||
if (levelBean != null) {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
|
||||
new LiveTextRender().getLevelImage(mContext, mDatas.get(position).getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, viewHolder.level);
|
||||
@ -218,7 +217,7 @@ public class LiveGiveHotDialogFragment extends AbsDialogFragment {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String hotStr = mDatas.get(position).getHot_score().substring(0, mDatas.get(position).getHot_score().length() - 3);
|
||||
viewHolder.tv_hot_number.setText(hotStr + "k");
|
||||
viewHolder.tv_hot_time.setText(mDatas.get(position).getHot_score_end_time());
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@ -18,21 +19,20 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.adapter.GuardAdapter;
|
||||
import com.yunbao.live.bean.GuardUserBean;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -45,7 +45,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
private ImageView guardIcon, userSex, userLevel;
|
||||
private ConstraintLayout mRootLayout;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private TextView mBtnBuy, userName, userGuard,tip1, tip2;
|
||||
private TextView mBtnBuy, userName, userGuard, tip1, tip2;
|
||||
private SVGAImageView giftSvga;
|
||||
private LinearLayout userLayout;
|
||||
|
||||
@ -54,7 +54,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
private String mLiveUid;
|
||||
private boolean mIsAnchor;//是否是主播
|
||||
private boolean showBuyView;
|
||||
private List<GuardUserBean> list=new ArrayList<>();
|
||||
private List<GuardUserBean> list = new ArrayList<>();
|
||||
private RelativeLayout relativeLayout;
|
||||
|
||||
@Override
|
||||
@ -95,7 +95,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
}
|
||||
mIsAnchor = bundle.getBoolean(Constants.ANCHOR, false);
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
showBuyView = bundle.getBoolean("showBuyView",true);
|
||||
showBuyView = bundle.getBoolean("showBuyView", true);
|
||||
guardIcon = mRootView.findViewById(R.id.guard_imageView);
|
||||
mRootLayout = mRootView.findViewById(R.id.guard_constraintLayout);
|
||||
mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy);
|
||||
@ -138,8 +138,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
@Override
|
||||
public List<GuardUserBean> processData(String[] info) {
|
||||
List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class);
|
||||
if(!list.isEmpty()){
|
||||
LiveNewGuardListDialogFragment.this.list=list;
|
||||
if (!list.isEmpty()) {
|
||||
LiveNewGuardListDialogFragment.this.list = list;
|
||||
setAdapterData();
|
||||
}
|
||||
return list;
|
||||
@ -167,7 +167,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
});
|
||||
mRefreshView.setRecyclerViewAdapter(mGuardAdapter);
|
||||
mGuardAdapter.notifyDataSetChanged();
|
||||
if(!showBuyView){
|
||||
if (!showBuyView) {
|
||||
relativeLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@ -184,10 +184,11 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
initView();
|
||||
return show;
|
||||
}
|
||||
private void setAdapterData(){
|
||||
|
||||
private void setAdapterData() {
|
||||
if (list.isEmpty()) {
|
||||
userLayout.setVisibility(View.INVISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
GuardUserBean bean = list.get(0);
|
||||
giftSvga.setImageResource(R.mipmap.guardian_img_wings_p);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), guardIcon);
|
||||
@ -196,10 +197,18 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
String guardString = mContext.getString(R.string.guard_week_con);
|
||||
userGuard.setText(guardString + " " + bean.getContribute());
|
||||
userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), userLevel);
|
||||
}
|
||||
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, userLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
if (mLiveGuardInfo != null) {
|
||||
int guardType = mLiveGuardInfo.getMyGuardType();
|
||||
@ -217,7 +226,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setList(List<GuardUserBean> list) {
|
||||
this.list=list;
|
||||
this.list = list;
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,11 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
@ -38,6 +37,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpConsts;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
@ -58,9 +58,6 @@ import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imlib.IRongCoreCallback;
|
||||
import io.rong.imlib.IRongCoreEnum;
|
||||
import io.rong.imlib.chatroom.base.RongChatRoomClient;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
/**
|
||||
@ -406,14 +403,28 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View
|
||||
int levelAnchor = obj.getIntValue("level_anchor");
|
||||
int level = obj.getIntValue("level");
|
||||
mSign.setText(obj.getString("signature"));
|
||||
LevelBean anchorLevelBean = appConfig.getAnchorLevel(obj.getIntValue("level_anchor"));
|
||||
if (anchorLevelBean != null) {
|
||||
ImgLoader.display(mContext, anchorLevelBean.getBgIcon(), mLevelAnchor);
|
||||
}
|
||||
LevelBean levelBean = appConfig.getLevel(obj.getIntValue("level"));
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getBgIcon(), mLevel);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
anchorLevel = obj.getIntValue("level_anchor");
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getIcon();
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
new LiveTextRender().getLevelImage(mContext,obj.getIntValue("level"), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mLevelAnchorText.setText(String.valueOf(levelAnchor));
|
||||
mLevelText.setText(String.valueOf(level));
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(obj.getIntValue("sex")));
|
||||
|
@ -1,33 +1,35 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveUserAnchorMailBoxAdapter;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户获取主播联系方式信箱弹框
|
||||
*/
|
||||
public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
|
||||
private RecyclerView list;
|
||||
private CommonRefreshView list;
|
||||
private LiveUserAnchorMailBoxAdapter adapter;
|
||||
private View empty;
|
||||
|
||||
@ -48,26 +50,84 @@ public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
|
||||
list = findViewById(R.id.mailbox);
|
||||
empty = findViewById(R.id.ic_empty);
|
||||
list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
list.setAdapter(adapter);
|
||||
if (adapter == null) {
|
||||
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
|
||||
}
|
||||
list.setDataHelper(new CommonRefreshView.DataHelper<LiveUserMailBoxModel>() {
|
||||
@Override
|
||||
public RefreshAdapter<LiveUserMailBoxModel> getAdapter() {
|
||||
if (adapter == null) {
|
||||
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
|
||||
}
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, com.yunbao.common.http.HttpCallback callback) {
|
||||
LiveHttpUtil.getContactMsg(p, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LiveUserMailBoxModel> processData(String[] info) {
|
||||
if (info != null) {
|
||||
if (info.length > 0) {
|
||||
empty.setVisibility(View.GONE);
|
||||
list.setVisibility(View.VISIBLE);
|
||||
return JSON.parseArray(Arrays.toString(info), LiveUserMailBoxModel.class);
|
||||
} else {
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setVisibility(GONE);
|
||||
return new ArrayList<LiveUserMailBoxModel>();
|
||||
}
|
||||
|
||||
} else {
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setVisibility(GONE);
|
||||
return new ArrayList<LiveUserMailBoxModel>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<LiveUserMailBoxModel> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<LiveUserMailBoxModel> loadItemList, int loadItemCount) {
|
||||
if (loadItemList.size() > 0)
|
||||
adapter.insertList(loadItemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
list.initData();
|
||||
adapter.setOnItemClickListener((bean, position) -> {
|
||||
if (adapter.getItemCount() == 0) {
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setVisibility(GONE);
|
||||
}
|
||||
});
|
||||
adapter.setOnWebDismissListener(dialog -> initData());
|
||||
initData();
|
||||
// adapter.setOnWebDismissListener(dialog -> initData());
|
||||
// initData();
|
||||
}
|
||||
|
||||
String TAG = "信箱";
|
||||
|
||||
void initData() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getContactMsg(new HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
.getContactMsg(1, new HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveUserMailBoxModel> data) {
|
||||
Log.i(TAG, "onSuccess: " + data.size());
|
||||
|
@ -26,8 +26,8 @@ import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.FansModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.OlineUserlistModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
@ -410,21 +410,33 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
// textGiftWall.setText(mContext.getString(R.string.gift_wall));
|
||||
// valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number")));
|
||||
}
|
||||
LevelBean levelBean;
|
||||
if (isAnchor) {
|
||||
levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
|
||||
userLv.setText("Lv." + mUserBean.getLevelAnchor());
|
||||
mLvDesc.setText(R.string.live_user_level_anchor);
|
||||
|
||||
} else {
|
||||
levelBean = CommonAppConfig.getInstance().getLevel(mUserBean.getLevel());
|
||||
userLv.setText("Lv." + mUserBean.getLevel());
|
||||
mLvDesc.setText(R.string.live_user_card_level);
|
||||
|
||||
}
|
||||
if (isAnchor) {
|
||||
ImgLoader.display2(mContext, obj.getJSONObject("level_thumb").getString("thumb"), mLiveIcon);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
|
||||
anchorLevel = mUserBean.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
mLvVal.setText(obj.getInteger("level_anchor") + "");
|
||||
ImgLoader.display2(mContext, imgUrl, mLiveIcon);
|
||||
|
||||
|
||||
} else {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
new LiveTextRender().getLevelImage(mContext, mUserBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLiveIcon);
|
||||
@ -436,7 +448,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
});
|
||||
}
|
||||
ImgLoader.display(mContext, levelBean.getBgIcon(), mLiveIcon2);
|
||||
|
||||
|
||||
FansModel fansMedalBean = new NewLevelManager(mContext).getFansModel(obj.getIntValue("medal_level"));
|
||||
if (fansMedalBean != null && !isAnchor) {
|
||||
ImgLoader.display(mContext, fansMedalBean.getThumb(), mNoble);
|
||||
|
@ -487,7 +487,8 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
IS_ATTENTION(72, "是否关注主播"),
|
||||
GIFT_WALL(73, "礼物墙"),
|
||||
UPDATE_FANS_TASK_STATUS(74, "更新粉丝任务状态"),
|
||||
SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏");
|
||||
SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏"),
|
||||
PK_RANK_START(76, "PK排位赛开始");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
@ -16,12 +16,13 @@ import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@ -31,7 +32,6 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||
import com.yunbao.live.event.LinkMicTxMixStreamEvent;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
import com.yunbao.live.socket.SocketClient;
|
||||
import com.yunbao.live.socket.SocketLinkMicAnchorUtil;
|
||||
@ -40,6 +40,8 @@ import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/16.
|
||||
* 主播与主播连麦逻辑
|
||||
@ -84,7 +86,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
mPkContainer = linkMicViewHolder.getPkContainer();
|
||||
|
||||
|
||||
mLinkMicWaitString =mContext.getString(R.string.link_mic_wait);
|
||||
mLinkMicWaitString = mContext.getString(R.string.link_mic_wait);
|
||||
mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
@ -174,17 +176,25 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
ImageView avatar = (ImageView) v.findViewById(R.id.avatar);
|
||||
TextView name = (TextView) v.findViewById(R.id.name);
|
||||
ImageView sex = (ImageView) v.findViewById(R.id.sex);
|
||||
ImageView level = (ImageView) v.findViewById(R.id.level);
|
||||
TextView level = (TextView) v.findViewById(R.id.level);
|
||||
ImageView contribute = (ImageView) v.findViewById(R.id.contribute);
|
||||
mLinkMicWaitText = v.findViewById(R.id.wait_text);
|
||||
v.findViewById(R.id.btn_refuse).setOnClickListener(this);
|
||||
v.findViewById(R.id.btn_accept).setOnClickListener(this);
|
||||
ImgLoader.display(mContext, u.getAvatar(), avatar);
|
||||
name.setText(u.getUserNiceName());
|
||||
sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(u.getLevelAnchor());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), level);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
anchorLevel = u.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
level.setText(anchorLevel + "");
|
||||
ImgLoader.display(mContext, imgUrl, contribute);
|
||||
mLinkMicWaitCount = LINK_MIC_COUNT_MAX;
|
||||
mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")...");
|
||||
mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
@ -279,7 +289,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
*/
|
||||
private void acceptLinkMic() {
|
||||
if (((LiveAnchorActivity) mContext).isBgmPlaying()) {
|
||||
DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
((LiveAnchorActivity) mContext).stopBgm();
|
||||
@ -493,10 +503,10 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
*/
|
||||
public void onlinkMicPlayGaming() {
|
||||
mLastApplyLinkMicTime = 0;
|
||||
DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.link_mic_play_game));
|
||||
DialogUitl.showSimpleTipDialog(mContext, mContext.getString(R.string.link_mic_play_game));
|
||||
}
|
||||
|
||||
public void setLiveSdk(int mLiveSDK) {
|
||||
this.mLiveSdk=mLiveSDK;
|
||||
this.mLiveSdk = mLiveSDK;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@ -53,6 +54,7 @@ import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
import com.yunbao.live.interfaces.LivePushListener;
|
||||
import com.yunbao.live.socket.SocketClient;
|
||||
import com.yunbao.live.socket.SocketLinkMicUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder;
|
||||
import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder;
|
||||
import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
||||
@ -631,10 +633,17 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
ImgLoader.display(mContext, u.getAvatar(), avatar);
|
||||
name.setText(u.getUserNiceName());
|
||||
sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(u.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), level);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, u.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mLinkMicWaitCount = LINK_MIC_COUNT_MAX;
|
||||
mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")...");
|
||||
mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
|
@ -6,10 +6,12 @@ import android.util.Log;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@ -128,6 +130,18 @@ public class SocketRyChatUtil {
|
||||
if (SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
|
||||
}
|
||||
LiveNetManager.get(CommonAppContext.sInstance)
|
||||
.addChatCount(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -774,6 +774,21 @@ public class SocketRyClient {
|
||||
systemChatMessage2(stringBuffer.toString());
|
||||
Bus.get().post(new QuickGiftingEvent().setHotNum(sendQuickGiftModel.getHotNum()));
|
||||
break;
|
||||
case Constants.LIVE_PK_RANDOM_START:
|
||||
item = map.getJSONObject("ct");
|
||||
item.getString("text");
|
||||
item.getString("pktt_img");
|
||||
item.getString("uid_win_continuity");
|
||||
item.getString("pkuid_win_continuity");
|
||||
pkRankBean = new PkRankBean();
|
||||
pkRankBean.setBlueVal(item.getString("pkuid_win_continuity"));
|
||||
pkRankBean.setRedVal( item.getString("uid_win_continuity"));
|
||||
pkRankBean.setPkTopImgUrl(item.getString("pktt_img"));
|
||||
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_START)
|
||||
.setObject(pkRankBean));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -31,11 +31,9 @@ import androidx.core.content.ContextCompat;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AiAutomaticSpeechModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.custom.VerticalImageSpan;
|
||||
@ -762,11 +760,14 @@ public class LiveTextRender {
|
||||
}
|
||||
|
||||
private void renderEnterRoomTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean == null) {
|
||||
return;
|
||||
List<NewLevelModel> models = new NewLevelManager(context).getNewLevelModels();
|
||||
String imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() {
|
||||
ImgLoader.displayDrawable(context, imgUrl, new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
if (textView != null) {
|
||||
|
@ -10,9 +10,9 @@ import android.view.animation.LinearInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
@ -20,6 +20,8 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveDanMuBean;
|
||||
import com.yunbao.live.interfaces.IDanmuActionListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/25.
|
||||
* 弹幕
|
||||
@ -87,12 +89,16 @@ public class DanmuViewHolder extends AbsViewHolder {
|
||||
|
||||
public void show(LiveDanMuBean bean, int lineNum) {
|
||||
mLineNum = lineNum;
|
||||
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
mName.setTextColor(Color.parseColor(levelBean.getColor()));
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
|
||||
String imgUrl = "#68F1F4";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getColour();
|
||||
}
|
||||
}
|
||||
mName.setTextColor(Color.parseColor(imgUrl));
|
||||
mContent.setText(bean.getContent());
|
||||
mCanNext = false;
|
||||
mContentView.measure(0, 0);
|
||||
|
@ -12,13 +12,17 @@ import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveDanMuBean;
|
||||
import com.yunbao.live.interfaces.IDanmuActionListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/25.
|
||||
* 弹幕
|
||||
@ -89,10 +93,15 @@ public class FansDanmuViewHolder extends DanmuViewHolder {
|
||||
mLineNum = lineNum;
|
||||
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName()+":");
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
mName.setTextColor(Color.parseColor(levelBean.getColor()));
|
||||
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
|
||||
String imgUrl = "#68F1F4";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getColour();
|
||||
}
|
||||
}
|
||||
mName.setTextColor(Color.parseColor(imgUrl));
|
||||
mContent.setText(bean.getContent());
|
||||
mCanNext = false;
|
||||
mContentView.measure(0, 0);
|
||||
|
@ -74,7 +74,6 @@ import com.yunbao.common.bean.GiftModel;
|
||||
import com.yunbao.common.bean.GuardUserModel;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
@ -85,6 +84,7 @@ import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.NewPeopleTaskModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.RankHourModel;
|
||||
@ -114,6 +114,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.manager.RandomPkManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
@ -1202,11 +1203,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mAvatar = (ImageView) findViewById(R.id.avatar);
|
||||
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
|
||||
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mName = (TextView) findViewById(R.id.name);
|
||||
mID = (TextView) findViewById(R.id.id_val);
|
||||
mBtnFollow = findViewById(R.id.btn_follow);
|
||||
@ -2437,8 +2434,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
private String pkUidTmp = "";
|
||||
private String isLadders;
|
||||
|
||||
public void initPkRank(String isLadders) {
|
||||
this.isLadders = isLadders;
|
||||
//PK状态下,pkuid不能为空
|
||||
if (pkUidTmp.equals(pkUid) && !StringUtil.isEmpty(pkUid)) {
|
||||
return;
|
||||
@ -2449,11 +2448,38 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
pkRankLayout.setTag(mLiveUid);
|
||||
pkUidTmp = pkUid;
|
||||
pkRankLayout.setVisibility(View.GONE);
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1);
|
||||
mRedVal.setVisibility(View.GONE);
|
||||
mBlueVal.setVisibility(View.GONE);
|
||||
mPkRankTopIcon.setVisibility(View.GONE);
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1);
|
||||
|
||||
}
|
||||
|
||||
public void updatePkRankInfo(PkRankBean bean) {
|
||||
pkRankLayout.setVisibility(View.VISIBLE);
|
||||
liveRankPk2.setVisibility(View.VISIBLE);
|
||||
if (Integer.parseInt(bean.getRedVal()) > 2) {
|
||||
mRedVal.setVisibility(View.VISIBLE);
|
||||
mRedVal.setText(bean.getRedVal() + (WordUtil.isNewZh() ? "連勝" : "Win"));
|
||||
}
|
||||
if (Integer.parseInt(bean.getBlueVal()) > 2) {
|
||||
mBlueVal.setVisibility(View.VISIBLE);
|
||||
mBlueVal.setText(bean.getBlueVal() + (WordUtil.isNewZh() ? "連勝" : "Win"));
|
||||
}
|
||||
mPkRankTopIcon.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
|
||||
if (mRedVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams redValLayoutParams = (RelativeLayout.LayoutParams) mRedVal.getLayoutParams();
|
||||
redValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mRedVal.setLayoutParams(redValLayoutParams);
|
||||
}
|
||||
if (mBlueVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams blueValLayoutParams = (RelativeLayout.LayoutParams) mBlueVal.getLayoutParams();
|
||||
blueValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mBlueVal.setLayoutParams(blueValLayoutParams);
|
||||
}
|
||||
}
|
||||
public void initRankPKInfo(String mLiveUid){
|
||||
LiveNetManager.get(mContext)
|
||||
.getRandomPk(mLiveUid, pkUid, new com.yunbao.common.http.base.HttpCallback<PkRankBean>() {
|
||||
@Override
|
||||
@ -2515,6 +2541,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mPkRankTopIcon.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
|
||||
}
|
||||
if (mRedVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams redValLayoutParams = (RelativeLayout.LayoutParams) mRedVal.getLayoutParams();
|
||||
redValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mRedVal.setLayoutParams(redValLayoutParams);
|
||||
}
|
||||
if (mBlueVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams blueValLayoutParams = (RelativeLayout.LayoutParams) mBlueVal.getLayoutParams();
|
||||
blueValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mBlueVal.setLayoutParams(blueValLayoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -2523,7 +2559,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
pkUidTmp = "";
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2818,12 +2853,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* 显示主播等级
|
||||
*/
|
||||
public void setAnchorLevel(int anchorLevel) {
|
||||
if (mLevelAnchor != null) {
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(anchorLevel);
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display2(mContext, levelBean.getThumbIcon(), mLevelAnchor);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getIcon();
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4866,6 +4905,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
case UPDATE_FANS_TASK_STATUS:
|
||||
updateFansMessageRed();
|
||||
break;
|
||||
case PK_RANK_START:
|
||||
updatePkRankInfo((PkRankBean) event.getObject());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@ -5697,25 +5739,32 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
private void checkNewLetter() {
|
||||
LiveNetManager.get(mContext).getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
|
||||
private synchronized void checkNewLetter() {
|
||||
|
||||
LiveNetManager.get(mContext).getContactMsg(1, new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveUserMailBoxModel> data) {
|
||||
for (LiveUserMailBoxModel model : data) {
|
||||
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).showMsgRed(0);
|
||||
return;
|
||||
if (data.size() > 0 && data != null) {
|
||||
for (LiveUserMailBoxModel model : data) {
|
||||
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).showMsgRed(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((LiveAudienceActivity) mContext).showMsgRed(-1);
|
||||
}
|
||||
((LiveAudienceActivity) mContext).showMsgRed(-1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void blindBoxAllServerNotify(AllServerNotifyEvent event) {
|
||||
|
@ -501,6 +501,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.setUserList(data.getEnterRoomInfo().getUserlists());
|
||||
//设置靓号
|
||||
mLiveRoomViewHolder.setAnchorGoodNumber(data.getLiveInfo().getGoodnum());
|
||||
//初始化天梯赛信息
|
||||
mLiveRoomViewHolder.initRankPKInfo(String.valueOf(data.getLiveInfo().getUid()));
|
||||
if (!StringUtil.isEmpty(mLiveBean.getGiftId())) {
|
||||
mLiveRoomViewHolder.openGiftDialog(mLiveBean.getGiftId());
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog_2"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
@ -15,8 +13,7 @@
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
@ -24,48 +21,56 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="15dp"
|
||||
/>
|
||||
android:layout_height="15dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contribute"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/leave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="28dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wait_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="@color/textColor2"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
style="@style/line2"
|
||||
/>
|
||||
<View style="@style/line2" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
>
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_refuse"
|
||||
@ -75,14 +80,12 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/refuse"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray2"
|
||||
/>
|
||||
android:background="@color/gray2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_accept"
|
||||
@ -92,8 +95,7 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/accept"
|
||||
android:textColor="@color/global"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -237,7 +237,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="100dp"
|
||||
|
@ -28,7 +28,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<com.yunbao.common.custom.CommonRefreshView
|
||||
android:id="@+id/mailbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="328dp"
|
||||
@ -40,7 +40,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/bg_top"
|
||||
tools:listitem="@layout/item_live_user_mailbox">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</com.yunbao.common.custom.CommonRefreshView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ic_empty"
|
||||
|
@ -1,12 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
>
|
||||
android:paddingRight="12dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
@ -14,8 +12,7 @@
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
@ -25,8 +22,7 @@
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_toRightOf="@id/avatar"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
@ -34,17 +30,32 @@
|
||||
android:layout_height="15dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@id/name"
|
||||
/>
|
||||
android:layout_toRightOf="@id/name" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
<FrameLayout
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_toRightOf="@id/sex"
|
||||
/>
|
||||
android:layout_toRightOf="@id/sex">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/leave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="28dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_invite"
|
||||
@ -55,11 +66,9 @@
|
||||
android:background="@drawable/bg_btn_live_pk"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/fg_btn_live_pk"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
android:textSize="10sp" />
|
||||
|
||||
<View
|
||||
style="@style/line2"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
@ -43,6 +43,7 @@
|
||||
android:id="@+id/level_anchor"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
||||
|
@ -158,6 +158,7 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.UserAvatarSelectActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.BattlePassActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,240 @@
|
||||
package com.yunbao.main.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow;
|
||||
import com.yunbao.common.dialog.ActivityEndPopupWindow;
|
||||
import com.yunbao.common.dialog.LiberalBattlePassPopupWindow;
|
||||
import com.yunbao.common.dialog.PromotionElitePopupWindow;
|
||||
import com.yunbao.common.dialog.RuleOfWarPopupWindow;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.event.BattlePassTypeEvent;
|
||||
import com.yunbao.main.fragment.BattlePassExchangeFragment;
|
||||
import com.yunbao.main.fragment.BattlePassMissionFragment;
|
||||
import com.yunbao.main.fragment.BattlePassRewardFragment;
|
||||
import com.yunbao.main.interfaces.BattlePassUserInfoListener;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 战令
|
||||
*/
|
||||
@Route(path = RouteUtil.PATH_BattlePassActivity)
|
||||
public class BattlePassActivity extends AbsActivity {
|
||||
ImageView rule, tab1, tab2, tab3;
|
||||
ViewPager2 viewPager;
|
||||
List<BaseFragment> fragments;
|
||||
TextView sessionView;
|
||||
TextView timeView;
|
||||
TextView levelView;
|
||||
TextView expText;
|
||||
ProgressBar levelProgressView;
|
||||
TextView integralView;
|
||||
Button moreIntegralButton;
|
||||
String enjoySpendMoney = "";
|
||||
String quintessenceSpendMoney = "";
|
||||
|
||||
BattlePassUserInfoBean data;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_battlepass;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
super.main(savedInstanceState);
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
fragments = new ArrayList<>();
|
||||
rule = findViewById(R.id.rule);
|
||||
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(() -> data));
|
||||
fragments.add(new BattlePassMissionFragment(() -> data));
|
||||
fragments.add(new BattlePassExchangeFragment(() -> data));
|
||||
viewPager.setAdapter(new FragmentStateAdapter(this) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
});
|
||||
viewPager.setUserInputEnabled(false);
|
||||
ViewClicksAntiShake.clicksAntiShake(tab1, () -> clickView(0));
|
||||
ViewClicksAntiShake.clicksAntiShake(tab2, () -> clickView(1));
|
||||
ViewClicksAntiShake.clicksAntiShake(tab3, () -> clickView(2));
|
||||
|
||||
sessionView = findViewById(R.id.session);
|
||||
timeView = findViewById(R.id.time);
|
||||
levelView = findViewById(R.id.level);
|
||||
levelProgressView = findViewById(R.id.level_progress);
|
||||
integralView = findViewById(R.id.integral);
|
||||
moreIntegralButton = findViewById(R.id.more_integral);
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(moreIntegralButton, () -> {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight(mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new PromotionElitePopupWindow(mContext,
|
||||
enjoySpendMoney,
|
||||
quintessenceSpendMoney,
|
||||
new LiberalBattlePassPopupWindow.LiberalBattlePassCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
ToastUtil.show(msg);
|
||||
fragments.get(viewPager.getCurrentItem()).updateData();
|
||||
}
|
||||
},
|
||||
String.valueOf(data.getLive_battle_pass_type().get(1).getId()),
|
||||
String.valueOf(data.getLive_battle_pass_type().get(2).getId())
|
||||
).setUserData(data)
|
||||
)
|
||||
.show();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(rule, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(BattlePassActivity.this)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight(BattlePassActivity.this) - DpUtil.dp2px(34))
|
||||
.asCustom(new RuleOfWarPopupWindow(
|
||||
BattlePassActivity.this
|
||||
))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void clickView(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
tab1.setImageResource(R.mipmap.ic_zl_tab1);
|
||||
tab2.setImageResource(R.mipmap.ic_zl_tab2_unselect);
|
||||
tab3.setImageResource(R.mipmap.ic_zl_tab3_unselect);
|
||||
break;
|
||||
case 1:
|
||||
tab1.setImageResource(R.mipmap.ic_zl_tab1_unselect);
|
||||
tab2.setImageResource(R.mipmap.ic_zl_tab2);
|
||||
tab3.setImageResource(R.mipmap.ic_zl_tab3_unselect);
|
||||
break;
|
||||
case 2:
|
||||
tab1.setImageResource(R.mipmap.ic_zl_tab1_unselect);
|
||||
tab2.setImageResource(R.mipmap.ic_zl_tab2_unselect);
|
||||
tab3.setImageResource(R.mipmap.ic_zl_tab3);
|
||||
break;
|
||||
}
|
||||
viewPager.setCurrentItem(position, false);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initData() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getBattlePassUserInfo(new HttpCallback<BattlePassUserInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(BattlePassUserInfoBean data) {
|
||||
BattlePassActivity.this.data = data;
|
||||
sessionView.setText(data.getBattlePassName());
|
||||
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() == 0 ? data.getBattlePassExp() : data.getNextLevelExp()));
|
||||
levelProgressView.setMax(data.getNextLevelExp());
|
||||
levelProgressView.setMin(data.getLastLevelExp());
|
||||
levelProgressView.setProgress(data.getBattlePassExp());
|
||||
integralView.setText(String.format(WordUtil.getNewString(R.string.battlepass_user_my_integral), data.getPoints()));
|
||||
|
||||
for (LiveBattlePassRewardsBean.BattlePassType passType : data.getLive_battle_pass_type()) {
|
||||
if (passType.getId() == 2) {
|
||||
quintessenceSpendMoney = String.valueOf(passType.getDiamond_value());
|
||||
}
|
||||
if (passType.getId() == 3) {
|
||||
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
|
||||
new XPopup.Builder(BattlePassActivity.this)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight(BattlePassActivity.this) - DpUtil.dp2px(34))
|
||||
.asCustom(new ActivityEndPopupWindow(
|
||||
BattlePassActivity.this
|
||||
))
|
||||
.show();
|
||||
|
||||
}
|
||||
if (data.isBattlePassStatus()) {
|
||||
SpUtil.getInstance().removeValue("is_battle_pass_status");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void event(BattlePassTypeEvent event) {
|
||||
if (event.getType() == 0) {
|
||||
initData();
|
||||
}
|
||||
}
|
||||
}
|
@ -510,7 +510,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
isfloatBannernet = false;
|
||||
}
|
||||
mViewHolders[index].onResume();
|
||||
});
|
||||
//获取指导员账号
|
||||
ConversationIMListManager.get(this).getUserInstructor(this);
|
||||
|
@ -0,0 +1,151 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.dialog.WarOrderExchangeDetailsPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassExchangeAdapter extends RecyclerView.Adapter<BattlePassExchangeAdapter.VH> {
|
||||
private Context mContext;
|
||||
List<BattlePassPoints> mList = new ArrayList<>();
|
||||
int point;
|
||||
OnItemClickListener<BattlePassPoints> onItemClickListener;
|
||||
|
||||
public BattlePassExchangeAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setPoint(int point) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public void setList(List<BattlePassPoints> mList) {
|
||||
this.mList = mList;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<BattlePassPoints> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public BattlePassExchangeAdapter.VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new BattlePassExchangeAdapter.VH(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_exchange, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BattlePassExchangeAdapter.VH holder, int position) {
|
||||
holder.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
private ImageView icon;
|
||||
private ImageView indicator;
|
||||
private TextView title;
|
||||
private TextView content;
|
||||
private Button submit;
|
||||
private View mark;
|
||||
private TextView markText;
|
||||
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
icon = itemView.findViewById(R.id.tab_1);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
content = itemView.findViewById(R.id.content);
|
||||
submit = itemView.findViewById(R.id.submit);
|
||||
indicator = itemView.findViewById(R.id.indicator);
|
||||
mark = itemView.findViewById(R.id.mark_layout);
|
||||
markText = itemView.findViewById(R.id.mark_text);
|
||||
indicator.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void setData(BattlePassPoints battlePassPoints) {
|
||||
ImgLoader.display(mContext, battlePassPoints.getImageUrl(), icon);
|
||||
title.setText(battlePassPoints.getRewardsName());
|
||||
content.setText(battlePassPoints.getPointsThresholdText());
|
||||
if (StringUtil.isEmpty(battlePassPoints.getExchangeMark())) {
|
||||
mark.setVisibility(View.GONE);
|
||||
} else {
|
||||
mark.setVisibility(View.VISIBLE);
|
||||
markText.setText(battlePassPoints.getExchangeMark());
|
||||
}
|
||||
submit.setOnClickListener(null);
|
||||
if (battlePassPoints.getExchangeStatus() == 1) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_exchange_submit_lock));
|
||||
submit.setBackgroundResource(R.mipmap.bg_zl_battlepass_exchange_btn_lock);
|
||||
submit.setTextColor(Color.parseColor("#E4E5E8"));
|
||||
return;
|
||||
}
|
||||
if (battlePassPoints.getUserQuintyCount() == battlePassPoints.getExchangeQuantity()) {
|
||||
submit.setTextColor(Color.parseColor("#5773B1"));
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_exchange_submit_exchange));
|
||||
submit.setBackgroundResource(R.mipmap.bg_zl_battlepass_exchange_btn_over);
|
||||
return;
|
||||
} else {
|
||||
submit.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
submit.setText(String.format("%s\n(%s/%s)",
|
||||
WordUtil.getNewString(R.string.battlepass_exchange_submit_unexchange),
|
||||
battlePassPoints.getUserQuintyCount(),
|
||||
battlePassPoints.getExchangeQuantity()
|
||||
));
|
||||
submit.setBackgroundResource(R.mipmap.bg_zl_battlepass_exchange_btn_exchange);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(submit, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new WarOrderExchangeDetailsPopupWindow(mContext,
|
||||
battlePassPoints.getExchangeQuantity()-battlePassPoints.getUserQuintyCount(),
|
||||
point,
|
||||
Integer.parseInt(battlePassPoints.getPointsThreshold()),
|
||||
battlePassPoints.getImageUrl(),
|
||||
String.valueOf(battlePassPoints.getId()),
|
||||
new WarOrderExchangeDetailsPopupWindow.WarOrderExchangeDetailsCallback() {
|
||||
@Override
|
||||
public void onCallback(int code, String msg) {
|
||||
ToastUtil.show(msg);
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(battlePassPoints, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.dialog.OrderLevelPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassMissionAdapter extends RecyclerView.Adapter<BattlePassMissionAdapter.VH> {
|
||||
private Context mContext;
|
||||
private List<BattlePassTask.Task> mList = new ArrayList<>();
|
||||
private OnItemClickListener<BattlePassTask.Task> onItemClickListener;
|
||||
|
||||
public BattlePassMissionAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<BattlePassTask.Task> mList) {
|
||||
this.mList = mList;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<BattlePassTask.Task> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (mList.get(position).getId() < 0) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public BattlePassMissionAdapter.VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == 0) {
|
||||
return new BattlePassMissionAdapter.TypeOfTitle(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_mission_type_title, parent, false));
|
||||
}
|
||||
return new BattlePassMissionAdapter.TypeOfMission(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_mission_type_mission, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BattlePassMissionAdapter.VH holder, int position) {
|
||||
holder.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static abstract class VH extends RecyclerView.ViewHolder {
|
||||
protected static final int SUBMIT_BUY = 0;
|
||||
protected static final int SUBMIT_FINISHED = 1;
|
||||
protected static final int SUBMIT_OVER = 2;
|
||||
protected static final int SUBMIT_DEF = 3;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
public abstract void setData(BattlePassTask.Task task);
|
||||
}
|
||||
|
||||
private static class TypeOfTitle extends VH {
|
||||
TextView title;
|
||||
|
||||
public TypeOfTitle(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(BattlePassTask.Task task) {
|
||||
if (task.getId() == -1) {
|
||||
title.setText(WordUtil.getNewString(R.string.battlepass_mission_line_title_daily));
|
||||
} else if (task.getId() == -2) {
|
||||
title.setText(WordUtil.getNewString(R.string.battlepass_mission_line_title_season));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class TypeOfMission extends VH {
|
||||
ImageView icon;
|
||||
TextView title;
|
||||
TextView content;
|
||||
Button submit;
|
||||
|
||||
|
||||
public TypeOfMission(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
icon = itemView.findViewById(R.id.icon);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
content = itemView.findViewById(R.id.content);
|
||||
submit = itemView.findViewById(R.id.submit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(BattlePassTask.Task task) {
|
||||
/* if (task.getId() == 1) {
|
||||
task.setReceivedTask(1);
|
||||
task.setUserTaskSuccess(1);
|
||||
task.setNotReceivedTask(0);
|
||||
}
|
||||
if (task.getId() == 2) {
|
||||
task.setUserTaskSuccess(2);
|
||||
task.setReceivedTask(5);
|
||||
task.setNotReceivedTask(5);
|
||||
}*/
|
||||
if (task.getTaskSuccess() > 0) {
|
||||
title.setText(String.format("%s(%s/%s)",
|
||||
task.getNameText(),
|
||||
task.getUserTaskSuccess(),
|
||||
task.getTaskSuccess())
|
||||
);
|
||||
} else {
|
||||
title.setText(task.getNameText());
|
||||
}
|
||||
content.setText(task.getRemarkText());
|
||||
ImgLoader.display(itemView.getContext(), task.getImagePath(), icon);
|
||||
submit.setTag(SUBMIT_DEF);
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_unfinished));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_unfinished);
|
||||
submit.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
if (task.isBuy()) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_buy));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_buy);
|
||||
submit.setTag(SUBMIT_BUY);
|
||||
} else {
|
||||
if (task.getNotReceivedTask() > 0) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_finished));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_finished);
|
||||
submit.setTag(SUBMIT_FINISHED);
|
||||
}
|
||||
if (task.getNotReceivedTask() == 0 && task.getTaskSuccess() == task.getUserTaskSuccess()) {
|
||||
submit.setText(WordUtil.getNewString(R.string.battlepass_mission_submit_btn_over));
|
||||
submit.setBackgroundResource(R.drawable.bg_battlepass_mission_btn_over);
|
||||
submit.setTag(SUBMIT_OVER);
|
||||
submit.setTextColor(Color.parseColor("#0D21B2"));
|
||||
}
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(submit, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if ((int) submit.getTag() == SUBMIT_FINISHED) {
|
||||
subTask(task);
|
||||
}
|
||||
if ((int) submit.getTag() == SUBMIT_BUY) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(task, -2);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void subTask(BattlePassTask.Task task) {
|
||||
LiveNetManager.get(itemView.getContext())
|
||||
.getBattlePassTaskOver(String.valueOf(task.getId()), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show( data.getMsg());
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(task, data.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(task, -1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,284 @@
|
||||
package com.yunbao.main.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.BattlePassUserInfoBean;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveBattlePassRewardsBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BattlePassRewardAdapter extends RecyclerView.Adapter<BattlePassRewardAdapter.VH> {
|
||||
private Context mContext;
|
||||
private List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> mList = new ArrayList<>();
|
||||
private int userLevel;
|
||||
private BattlePassUserInfoBean userType;
|
||||
private OnItemClickListener<LiveBattlePassRewardsBean.LiveBattlePassReward> onItemClickListener;
|
||||
|
||||
public void setList(List<Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward>> mList) {
|
||||
this.mList = mList;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<LiveBattlePassRewardsBean.LiveBattlePassReward> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public void setUserLevel(int userLevel) {
|
||||
this.userLevel = userLevel;
|
||||
}
|
||||
|
||||
public void setUserType(BattlePassUserInfoBean userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public BattlePassRewardAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new VH(LayoutInflater.from(mContext).inflate(R.layout.item_battlepass_reward_type_top, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
holder.setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public class VH extends RecyclerView.ViewHolder {
|
||||
View lineBg, line, point;
|
||||
View tab1Layout, tab2Layout, tab3Layout;
|
||||
Button lv;
|
||||
ImageView tab1, tab2, tab3;
|
||||
ImageView tab1Unlock, tab2Unlock, tab3Unlock;
|
||||
ImageView tab1Mask, tab2Mask, tab3Mask;
|
||||
ImageView tab1Subscript, tab2Subscript, tab3Subscript;
|
||||
ImageView tab1Received, tab2Received, tab3Received;
|
||||
TextView tab1Title, tab2Title, tab3Title;
|
||||
|
||||
|
||||
Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward> data;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
lineBg = itemView.findViewById(R.id.line_bg);
|
||||
line = itemView.findViewById(R.id.line);
|
||||
point = itemView.findViewById(R.id.point);
|
||||
lv = itemView.findViewById(R.id.reward_lv);
|
||||
tab1Layout = itemView.findViewById(R.id.tab_1_layout);
|
||||
tab2Layout = itemView.findViewById(R.id.tab_2_layout);
|
||||
tab3Layout = itemView.findViewById(R.id.tab_3_layout);
|
||||
tab1 = itemView.findViewById(R.id.tab_1);
|
||||
tab2 = itemView.findViewById(R.id.tab_2);
|
||||
tab3 = itemView.findViewById(R.id.tab_3);
|
||||
tab1Unlock = itemView.findViewById(R.id.tab_1_item_unlock);
|
||||
tab2Unlock = itemView.findViewById(R.id.tab_2_item_unlock);
|
||||
tab3Unlock = itemView.findViewById(R.id.tab_3_item_unlock);
|
||||
tab1Mask = itemView.findViewById(R.id.tab_1_unlock);
|
||||
tab2Mask = itemView.findViewById(R.id.tab_2_unlock);
|
||||
tab3Mask = itemView.findViewById(R.id.tab_3_unlock);
|
||||
tab1Subscript = itemView.findViewById(R.id.tab_1_subscript);
|
||||
tab2Subscript = itemView.findViewById(R.id.tab_2_subscript);
|
||||
tab3Subscript = itemView.findViewById(R.id.tab_3_subscript);
|
||||
tab1Title = itemView.findViewById(R.id.tab_1_title);
|
||||
tab2Title = itemView.findViewById(R.id.tab_2_title);
|
||||
tab3Title = itemView.findViewById(R.id.tab_3_title);
|
||||
tab1Received = itemView.findViewById(R.id.tab_1_item_received);
|
||||
tab2Received = itemView.findViewById(R.id.tab_2_item_received);
|
||||
tab3Received = itemView.findViewById(R.id.tab_3_item_received);
|
||||
}
|
||||
|
||||
int level = 0;
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setData(Map<Integer, LiveBattlePassRewardsBean.LiveBattlePassReward> data, int position) {
|
||||
this.data = data;
|
||||
for (LiveBattlePassRewardsBean.LiveBattlePassReward value : data.values()) {
|
||||
if (value.getId() > 0) {
|
||||
level = value.getLiveBattlePassLevel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (position == 0) {
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) lineBg.getLayoutParams();
|
||||
ConstraintLayout.LayoutParams params1 = (ConstraintLayout.LayoutParams) line.getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(3);
|
||||
params1.topMargin = DpUtil.dp2px(3);
|
||||
} else {
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) lineBg.getLayoutParams();
|
||||
ConstraintLayout.LayoutParams params1 = (ConstraintLayout.LayoutParams) line.getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(0);
|
||||
params1.topMargin = DpUtil.dp2px(0);
|
||||
}
|
||||
setVisibility(View.GONE, -1, tab1Unlock, tab1Unlock, tab1Unlock);
|
||||
setVisibility(View.GONE, -1, tab1Subscript, tab2Subscript, tab3Subscript);
|
||||
setVisibility(View.VISIBLE, -1, tab1Layout, tab2Layout, tab3Layout);
|
||||
setVisibility(View.VISIBLE, -1, tab1, tab2, tab3);
|
||||
setVisibility(View.VISIBLE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
|
||||
line.setVisibility(View.GONE);
|
||||
point.setVisibility(View.GONE);
|
||||
if (userLevel > level && userLevel < userType.getMaxLevel()) {
|
||||
setVisibility(View.GONE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
point.setVisibility(View.GONE);
|
||||
line.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (userLevel == level && userLevel < userType.getMaxLevel()) {
|
||||
setVisibility(View.GONE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) line.getLayoutParams();
|
||||
params.bottomMargin = DpUtil.dp2px(70);
|
||||
line.setVisibility(View.VISIBLE);
|
||||
point.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (userLevel >= userType.getMaxLevel()) {
|
||||
setVisibility(View.GONE, -1, tab1Mask, tab2Mask, tab3Mask);
|
||||
line.setVisibility(View.VISIBLE);
|
||||
point.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
getAllView((reward, view) -> ImgLoader.display(mContext, reward.getImageUrl(), view), tab1, tab2, tab3);
|
||||
getAllView(((reward, view) -> {
|
||||
if (userLevel < level) {
|
||||
view.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (reward.getLock() == 1) {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
view.setVisibility(View.GONE);
|
||||
}
|
||||
}), tab1Unlock, tab2Unlock, tab3Unlock);
|
||||
getAllView(((reward, view) -> {
|
||||
lv.setText("V" + reward.getLiveBattlePassLevel());
|
||||
view.setText(reward.getRewardName());
|
||||
}), tab1Title, tab2Title, tab3Title);
|
||||
getAllView(((reward, view) -> {
|
||||
if (reward.getReceived() == 1) {
|
||||
view.setVisibility(View.GONE);
|
||||
} else {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}), tab1Received, tab2Received, tab3Received);
|
||||
getAllView(((reward, view) -> {
|
||||
ViewClicksAntiShake.clicksAntiShake(view, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
getReward(reward);
|
||||
}
|
||||
});
|
||||
}), tab1, tab2, tab3);
|
||||
|
||||
}
|
||||
|
||||
private void getReward(LiveBattlePassRewardsBean.LiveBattlePassReward reward) {
|
||||
if (userLevel < reward.getLiveBattlePassLevel()) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_reward_item_lock));
|
||||
return;
|
||||
}
|
||||
if (reward.getLock() == 1) {
|
||||
//ToastUtil.show("锁了");
|
||||
return;
|
||||
}
|
||||
if (reward.getReceived() == 2) {
|
||||
return;
|
||||
}
|
||||
switch (reward.getLiveBattlePassTypeId()) {
|
||||
case 1:
|
||||
if (userType.getBattlePassUserRecords1() == 1) {
|
||||
ToastUtil.show("没购买");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (userType.getBattlePassUserRecords2() == 1) {
|
||||
ToastUtil.show("没购买");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (userType.getBattlePassUserRecords3() == 1) {
|
||||
ToastUtil.show("没购买");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.getRewards(String.valueOf(reward.getLiveBattlePassLevel()), String.valueOf(reward.getId()), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.battlepass_reward_item_get));
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(reward, reward.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(reward, reward.getId());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setVisibility(int visibility, int position, View... views) {
|
||||
if (position == -1) {
|
||||
for (View view : views) {
|
||||
view.setVisibility(visibility);
|
||||
}
|
||||
} else {
|
||||
views[position].setVisibility(visibility);
|
||||
}
|
||||
}
|
||||
|
||||
private <T> void getAllView(ViewData<T> viewData, T... views) {
|
||||
getView(1, viewData, views);
|
||||
getView(2, viewData, views);
|
||||
getView(3, viewData, views);
|
||||
}
|
||||
|
||||
private <T> void getView(int type, ViewData<T> viewData, T... views) {
|
||||
if (data.containsKey(type) && data.get(type) != null && Objects.requireNonNull(data.get(type)).getId() != 0) {
|
||||
viewData.onData(data.get(type), views[type - 1]);
|
||||
setVisibility(View.VISIBLE, type - 1, tab1Layout, tab2Layout, tab3Layout);
|
||||
} else {
|
||||
setVisibility(View.INVISIBLE, type - 1, tab1Layout, tab2Layout, tab3Layout);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private interface ViewData<T> {
|
||||
void onData(LiveBattlePassRewardsBean.LiveBattlePassReward reward, T view);
|
||||
}
|
||||
}
|
@ -239,15 +239,15 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
|
||||
mVotes.setText(bean.getTotalCoinFormat() + " ");
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = null;
|
||||
if (mType == TYPE_PROFIT) {
|
||||
levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
|
||||
} else {
|
||||
levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
}
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
// LevelBean levelBean = null;
|
||||
// if (mType == TYPE_PROFIT) {
|
||||
// levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
|
||||
// } else {
|
||||
// levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
// }
|
||||
// if (levelBean != null) {
|
||||
// ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
// }
|
||||
}
|
||||
liveing.setVisibility(View.INVISIBLE);
|
||||
if (bean.getIslive() == 1) {
|
||||
|