Merge branch 'master' into pdlive_samsung

# Conflicts:
#	config.gradle
#	live/src/main/java/com/yunbao/live/views/SystemMessageViewHolder.java
This commit is contained in:
hch 2024-01-18 14:56:27 +08:00
commit 6ff6cbbe6b
294 changed files with 11538 additions and 1647 deletions

View File

@ -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"
}
}

View File

@ -23,6 +23,7 @@ import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.Utils;
import com.facebook.appevents.AppEventsLogger;
import com.fm.openinstall.OpenInstall;
import com.google.gson.Gson;
import com.shayu.phonelive.utils.LogUtils;
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMManager;
@ -36,12 +37,14 @@ import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.AnchorStartLiveBean;
import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.event.SudGameSocketImEvent;
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.GoogleUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.SpUtil;
@ -210,6 +213,11 @@ public class AppContext extends CommonAppContext {
SocketReceiveBean received = JSON.parseObject(content.getContent(), SocketReceiveBean.class);
JSONObject map = received.getMsg().getJSONObject(0);
sendStartAnchorLive(map);
} else if (message.getTargetId().contains("v")) {
String contentJson = ((TextMessage) message.getContent()).getContent();
Log.e("wewe", contentJson);
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
Bus.get().post(sudGameSocketImEvent);
}
//主播页面
if (TextUtils.isEmpty(PortraitLiveManager.liveID) && SocketRyClient.mSocketHandler != null) {

View File

@ -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'
//
@ -209,6 +209,8 @@ dependencies {
// ()
api 'tech.sud.mgp:SudASR:1.3.3.1158'
//
api 'com.yanzhenjie.recyclerview:x:1.3.2'
//
//api project(':lib_huawei')

View File

@ -56,9 +56,7 @@
<activity
android:name="com.yunbao.common.activity.SelectImageActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.yunbao.common.activity.SudGameActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.yunbao.common.activity.PreviewImageActivity"

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

View File

@ -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;
}

View File

@ -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;//腾讯推流

View File

@ -1,214 +0,0 @@
package com.yunbao.common.activity;
import android.app.Activity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.lifecycle.Observer;
import com.google.gson.Gson;
import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CheckRemainingBalance;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.sud.QuickStartGameViewModel;
import com.yunbao.common.sud.model.GameConfigModel;
import com.yunbao.common.sud.state.SudMGPMGState;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.LiveSudGameHistoryPopup;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class SudGameActivity extends AbsActivity {
private FrameLayout gameContainer;
private long mInteractionID;
private String mLiveUid;
private final QuickStartGameViewModel gameViewModel = new QuickStartGameViewModel(); // 创建ViewModel
private CreateSudRoomModel mCreateSudRoomModel;
private TextView gameTitle, roomName, roomNumber;
private RoundedImageView mAvatar;
@Override
protected int getLayoutId() {
return R.layout.activity_sud_game;
}
@Override
protected void main() {
Bus.getOn(this);
super.main();
initView();
initDate();
}
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
private void initDate() {
LiveNetManager.get(mContext)
.getCustomSidebarInfo("1", new HttpCallback<List<CustomSidebarInfoModel>>() {
@Override
public void onSuccess(List<CustomSidebarInfoModel> data) {
for (CustomSidebarInfoModel datum : data) {
if (datum.getType().equals("6")) {
customSidebarChildModels = datum.getChild();
return;
}
}
}
@Override
public void onError(String error) {
}
});
}
@Override
protected void onDestroy() {
Bus.getOff(this);
super.onDestroy();
}
private void initView() {
String createSudRoomJson = getIntent().getStringExtra("CreateSudRoom");
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
gameContainer = findViewById(R.id.game_container);
gameTitle = findViewById(R.id.game_title);
roomName = findViewById(R.id.room_name);
roomNumber = findViewById(R.id.room_number);
mAvatar = findViewById(R.id.avatar);
if (mCreateSudRoomModel != null) {
gameTitle.setText(mCreateSudRoomModel.getSudGameName());
roomName.setText(mCreateSudRoomModel.getRoomName());
roomNumber.setText(mCreateSudRoomModel.getSudGameRoomId());
ImgLoader.display(mContext, mCreateSudRoomModel.getAvatar(), mAvatar);
}
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
gameViewModel.onDestroy();
finish();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(mContext)
.enableDrag(false)
.asCustom(new LiveSudGameHistoryPopup(mContext, customSidebarChildModels)).show();
}
});
gameViewModel.gameViewLiveData.observe(this, new Observer<View>() {
@Override
public void onChanged(View view) {
if (view == null) { // 在关闭游戏时把游戏View给移除
gameContainer.removeAllViews();
} else { // 把游戏View添加到容器内
gameContainer.addView(view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
}
}
});
// 加载游戏参数定义可查看BaseGameViewModel.switchGame()方法注释
// 游戏配置
GameConfigModel gameConfigModel = gameViewModel.getGameConfigModel();
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
gameConfigModel.ui.lobby_players.custom = true;
gameConfigModel.ui.join_btn.custom = true;
gameConfigModel.ui.game_settle_again_btn.custom = true;
gameConfigModel.ui.start_btn.custom = true;
// SudMGP平台64bit游戏ID
gameViewModel.switchGame((Activity) mContext, mLiveUid, mInteractionID);
// gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, -1, true, 1);
// gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfCaptain(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
// ViewClicksAntiShake.clicksAntiShake(gameTitle, new ViewClicksAntiShake.ViewClicksCallBack() {
// @Override
// public void onViewClicks() {
//
// }
// });
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
switch (event.getSudMGPMGState()) {
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
@Override
public void onSuccess(CheckRemainingBalance data) {
if (data.getGoldenBeanRemainingBalance() == 1) {
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
} else {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("貨幣数量不足 ");
} else {
ToastUtil.show("Shortage of money");
}
}
}
@Override
public void onError(String error) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("貨幣数量不足 ");
} else {
ToastUtil.show("Shortage of money");
}
}
});
break;
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
break;
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
LiveNetManager.get(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
mCreateSudRoomModel.getSudGameRoomId(), new
HttpCallback<CheckRemainingBalance>() {
@Override
public void onSuccess(CheckRemainingBalance data) {
if (data.getStatus()==1){
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfPlaying(true);
}else {
}
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
break;
case SudMGPMGState.MG_COMMON_GAME_STATE:
LiveNetManager.get(mContext).deductMoney( mCreateSudRoomModel.getSudGameRoomId());
break;
}
}
}

View File

@ -67,6 +67,13 @@ public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
}
}
public void refreshDel(){
if (mRecyclerView != null) {
notifyDataSetChanged();
}
}
public void refreshData(List<T> list) {
if (mRecyclerView != null && list != null) {
mList.clear();

View File

@ -0,0 +1,122 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.SudGameChatImModel;
import com.yunbao.common.views.SudGameChatViewHolder;
import java.util.ArrayList;
import java.util.List;
public class SudGameChatAdapter extends RecyclerView.Adapter {
private boolean isBottom = false;
List<SudGameChatImModel> sudGameChatImModels = new ArrayList<>();
private RecyclerView mRecyclerView;
private LinearLayoutManager mLayoutManager;
private int mRecyclerViewScrolledDy;
private Context mContext;
public SudGameChatAdapter(Context mContext) {
this.mContext = mContext;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_game_chat_item_holder, parent, false);
return new SudGameChatViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (holder instanceof SudGameChatViewHolder) {
SudGameChatViewHolder itemViewHolder = (SudGameChatViewHolder) holder;
itemViewHolder.sudGameChat(sudGameChatImModels.get(position));
}
}
@Override
public int getItemCount() {
return sudGameChatImModels.size();
}
@Override
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
mRecyclerView = recyclerView;
mLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (isBottom && dy >= 0) return;
mRecyclerViewScrolledDy = dy;
isBottom = false;
}
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == 0 && isSlideToBottom(recyclerView)) {
mRecyclerViewScrolledDy = 0;
scrollToBottom();
isBottom = true;
} else if (newState == 0) {
isBottom = false;
}
}
});
}
public synchronized void insertItem(SudGameChatImModel bean) {
if (bean == null) {
return;
}
int size = sudGameChatImModels.size();
//设置最大展示99条消息
if (size >= 100 && (isBottom || mRecyclerViewScrolledDy == 0)) {
sudGameChatImModels.subList(0, 50).clear();
notifyItemRangeRemoved(0, 50);
}
sudGameChatImModels.add(bean);
if (getItemCount() == 1) {
notifyDataSetChanged();
} else {
notifyItemInserted(getItemCount());
}
if (isBottom || mRecyclerViewScrolledDy == 0) {
scrollToBottom();
}
}
/**
* 判断是否滚到底部
*
* @param recyclerView
* @return
*/
public boolean isSlideToBottom(RecyclerView recyclerView) {
if (recyclerView == null) return false;
if (recyclerView.computeVerticalScrollExtent() + recyclerView.computeVerticalScrollOffset() >= recyclerView.computeVerticalScrollRange())
return true;
return false;
}
public void scrollToBottom() {
if (sudGameChatImModels.size() > 0) {
mRecyclerView.smoothScrollToPosition(getItemCount());
}
mRecyclerViewScrolledDy = 0;
}
}

View File

@ -0,0 +1,135 @@
package com.yunbao.common.adapter;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.views.SudGameUserListViewHolder;
import java.util.ArrayList;
import java.util.List;
public class SudGameUserListAdapter extends RecyclerView.Adapter {
private List<SudGameUserModel> gameUserModels = new ArrayList<>();
private boolean micMax = false;
public SudGameUserListAdapter(List<SudGameUserModel> gameUserModels) {
if (gameUserModels.size() < 7) {
this.gameUserModels.addAll(gameUserModels);
for (int i = 0; i < this.gameUserModels.size(); i++) {
this.gameUserModels.get(i).setNullUser(false);
}
int size = 7 - gameUserModels.size();
for (int i = 0; i < size; i++) {
this.gameUserModels.add(new SudGameUserModel().setNullUser(true));
}
} else if (gameUserModels.size() == 7) {
this.gameUserModels.addAll(gameUserModels);
for (int i = 0; i < this.gameUserModels.size(); i++) {
this.gameUserModels.get(i).setNullUser(false);
}
} else {
for (int i = 0; i < 7; i++) {
this.gameUserModels.add(gameUserModels.get(i).setNullUser(false));
}
}
}
public void refreshSudGameUserList(List<SudGameUserModel> gameUserModels, List<String> muteUser) {
this.gameUserModels.clear();
if (gameUserModels.size() < 7) {
micMax = false;
this.gameUserModels.addAll(gameUserModels);
for (int i = 0; i < this.gameUserModels.size(); i++) {
for (String userID : muteUser) {
if (TextUtils.equals(userID, String.valueOf(this.gameUserModels.get(i).getId()))) {
this.gameUserModels.get(i).setMute(true);
}
}
this.gameUserModels.get(i).setNullUser(false);
}
int size = 7 - gameUserModels.size();
for (int i = 0; i < size; i++) {
this.gameUserModels.add(new SudGameUserModel().setNullUser(true));
}
} else if (gameUserModels.size() == 7) {
micMax = true;
this.gameUserModels.addAll(gameUserModels);
for (int i = 0; i < this.gameUserModels.size(); i++) {
this.gameUserModels.get(i).setNullUser(false);
}
} else {
micMax = true;
for (int i = 0; i < 7; i++) {
for (String userID : muteUser) {
if (TextUtils.equals(userID, String.valueOf(this.gameUserModels.get(i).getId()))) {
this.gameUserModels.get(i).setMute(true);
}
}
this.gameUserModels.add(gameUserModels.get(i).setNullUser(false));
}
}
notifyDataSetChanged();
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_game_user_list_holder, parent, false);
return new SudGameUserListViewHolder(herdView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
SudGameUserListViewHolder sudGameUserListViewHolder = (SudGameUserListViewHolder) holder;
sudGameUserListViewHolder.upData(gameUserModels.get(position), sudGameSmallCallBack, position);
}
@Override
public int getItemCount() {
return gameUserModels.size();
}
public boolean isMicMax() {
return micMax;
}
public void muteUser(String userID, boolean mute, int position) {
for (int i = 0; i < gameUserModels.size(); i++) {
SudGameUserModel sudGameUserModel = gameUserModels.get(i);
if (!sudGameUserModel.isNullUser()) {
if (TextUtils.equals(userID, String.valueOf(sudGameUserModel.getId()))) {
gameUserModels.get(i).setMute(mute);
}
}
}
notifyItemChanged(position);
}
private SudGameSmallCallBack sudGameSmallCallBack;
public SudGameUserListAdapter setSudGameSmallCallBack(SudGameSmallCallBack sudGameSmallCallBack) {
this.sudGameSmallCallBack = sudGameSmallCallBack;
return this;
}
public interface SudGameSmallCallBack {
void unMute(String userID, int position);
void mute(String userID, int position);
void viewInformation(SudGameUserModel sudGameUserModel);
}
}

View File

@ -20,6 +20,12 @@ public class AnchorRecommendModel extends BaseModel {
@SerializedName("red_packet_show")
private int showRedPacket = 0;//是否显示首页红包浮窗
//是否支持换一批0=不支持 1=支持
@SerializedName("live_battle_pass_show_status")
private int showWarOrder = 0;//是否显示首页戰令
//是否支持换一批0=不支持 1=支持
@SerializedName("up_show")
private int upShow = 0;
@SerializedName("list")
@ -40,6 +46,14 @@ public class AnchorRecommendModel extends BaseModel {
return this;
}
public int getShowWarOrder() {
return showWarOrder;
}
public void setShowWarOrder(int showWarOrder) {
this.showWarOrder = showWarOrder;
}
public int getListShow() {
return listShow;
}

View File

@ -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;
}
}

View 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;
}
}
}

View File

@ -0,0 +1,199 @@
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;
}
@Override
public String toString() {
return "BattlePassUserInfoBean{" +
"uid='" + uid + '\'' +
", points=" + points +
", battlePassExp=" + battlePassExp +
", battlePassUserRecords1=" + battlePassUserRecords1 +
", battlePassUserRecords2=" + battlePassUserRecords2 +
", battlePassUserRecords3=" + battlePassUserRecords3 +
", level=" + level +
", lastLevelExp=" + lastLevelExp +
", nextLevelExp=" + nextLevelExp +
", id='" + id + '\'' +
", battlePassName='" + battlePassName + '\'' +
", startTime='" + startTime + '\'' +
", endTime='" + endTime + '\'' +
", battlePassStatus=" + battlePassStatus +
", maxLevelExp=" + maxLevelExp +
", maxLevel=" + maxLevel +
", live_battle_pass_type=" + live_battle_pass_type +
'}';
}
}

View File

@ -36,4 +36,13 @@ public class CheckRemainingBalance extends BaseModel {
public void setGoldenBeanRemainingBalance(int goldenBeanRemainingBalance) {
this.goldenBeanRemainingBalance = goldenBeanRemainingBalance;
}
@Override
public String toString() {
return "CheckRemainingBalance{" +
"goldenBeanRemainingBalance=" + goldenBeanRemainingBalance +
", status=" + status +
", deductMoneyKey='" + deductMoneyKey + '\'' +
'}';
}
}

View File

@ -0,0 +1,175 @@
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;
}
@Override
public String toString() {
return "LiveBattlePassReward{" +
"id=" + id +
", liveBattlePassLevel=" + liveBattlePassLevel +
", liveBattlePassTypeId=" + liveBattlePassTypeId +
", rewardName='" + rewardName + '\'' +
", imageUrl='" + imageUrl + '\'' +
", lock=" + lock +
", received=" + received +
'}';
}
}
}

View File

@ -20,6 +20,14 @@ public class LiveClassBean {
@SerializedName("channel_show")
private int channel_show;
public LiveClassBean() {
}
public LiveClassBean(String chinese, String english) {
this.chinese = chinese;
this.english = english;
}
public String getChinese() {
return chinese;
}

View File

@ -3,6 +3,7 @@ package com.yunbao.common.bean;
import android.view.View;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
/**
* Created by cxf on 2018/10/12.
@ -18,6 +19,8 @@ public class LiveGiftBean {
// public static final int MARK_LUCK = 3;
private int id;
@SerializedName("gift_id")
private int gift_id;//包裹礼物id
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团 5盲盒礼物
private int mark;// 0 普通 1热门 2守护 3幸运
private String name;
@ -34,6 +37,7 @@ public class LiveGiftBean {
private String isweek;
private String end_time;
private String tag;
private boolean isPageGift;
@JSONField(name = "blind_box_type")
private int blind_box_type = 0;
//礼物角标
@ -71,6 +75,14 @@ public class LiveGiftBean {
@JSONField(name = "blind_box_ticket_id")
private int blindBoxTicketId;
public boolean isPageGift() {
return isPageGift;
}
public void setPageGift(boolean pageGift) {
isPageGift = pageGift;
}
public int getBlindBoxTicketId() {
return blindBoxTicketId;
}
@ -80,6 +92,14 @@ public class LiveGiftBean {
return this;
}
public int getGift_id() {
return gift_id;
}
public void setGift_id(int gift_id) {
this.gift_id = gift_id;
}
public int getBlindBoxTicket() {
return blindBoxTicket;
}

View File

@ -0,0 +1,27 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class RoomMicStatusModel extends BaseModel{
@SerializedName("mic_status")
private String micStatus;
@SerializedName("im_status")
private String imStatus;
public String getMicStatus() {
return micStatus;
}
public void setMicStatus(String micStatus) {
this.micStatus = micStatus;
}
public String getImStatus() {
return imStatus;
}
public void setImStatus(String imStatus) {
this.imStatus = imStatus;
}
}

View File

@ -0,0 +1,26 @@
package com.yunbao.common.bean;
public class SudGameChatImModel extends BaseModel {
//昵称
private String nickname;
//文字消息
private String textMessage;
public String getNickname() {
return nickname;
}
public SudGameChatImModel setNickname(String nickname) {
this.nickname = nickname;
return this;
}
public String getTextMessage() {
return textMessage;
}
public SudGameChatImModel setTextMessage(String textMessage) {
this.textMessage = textMessage;
return this;
}
}

View File

@ -0,0 +1,82 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class SudGameUserModel extends BaseModel {
private boolean nullUser;
@SerializedName("user_nicename")
private String userNicename;
@SerializedName("avatar")
private String avatar;
@SerializedName("sex")
private int sex;
@SerializedName("id")
private int id;
@SerializedName("mic_status")
private int micStatus; //麦克风状态 2.打开麦克风 3.关闭麦克风
private boolean mute = false;
public boolean isMute() {
return mute;
}
public SudGameUserModel setMute(boolean mute) {
this.mute = mute;
return this;
}
public boolean isNullUser() {
return nullUser;
}
public SudGameUserModel setNullUser(boolean nullUser) {
this.nullUser = nullUser;
return this;
}
public String getUserNicename() {
return userNicename;
}
public SudGameUserModel setUserNicename(String userNicename) {
this.userNicename = userNicename;
return this;
}
public String getAvatar() {
return avatar;
}
public SudGameUserModel setAvatar(String avatar) {
this.avatar = avatar;
return this;
}
public int getSex() {
return sex;
}
public SudGameUserModel setSex(int sex) {
this.sex = sex;
return this;
}
public int getId() {
return id;
}
public SudGameUserModel setId(int id) {
this.id = id;
return this;
}
public int getMicStatus() {
return micStatus;
}
public SudGameUserModel setMicStatus(int micStatus) {
this.micStatus = micStatus;
return this;
}
}

View File

@ -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();
}
});
}
}

View File

@ -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();
}
});
}
}

View File

@ -21,7 +21,6 @@ import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView;
import com.lxj.xpopup.enums.PopupPosition;
import com.yunbao.common.R;
import com.yunbao.common.activity.SudGameActivity;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.CustomSidebarChildModel;
import com.yunbao.common.event.CheckCurrencyModel;
@ -33,6 +32,7 @@ import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -279,9 +279,7 @@ public class CreateSudGamePopup extends BottomPopupView {
public void onSuccess(CreateSudRoomModel data) {
if (isHome) {
dialog.dismiss();
Intent intent = new Intent(getContext(), SudGameActivity.class);
intent.putExtra("CreateSudRoom", new Gson().toJson(data));
getContext().startActivity(intent);
RouteUtil.forwardSudGameActivity(new Gson().toJson(data));
} else {
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));

View File

@ -0,0 +1,101 @@
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.manager.IMLoginManager;
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());
}
IMLoginManager.get(getContext()).upDataUserInfo();
IMLoginManager.get(getContext()).updateUserCoin();
}
@Override
public void onError(String error) {
dialog.dismiss();
if (mPassCallback != null) {
mPassCallback.onCallback(102, error);
}
}
});
}
});
}
public interface LiberalBattlePassCallback {
void onCallback(int code, String msg);
}
}

View File

@ -26,7 +26,7 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
@Override
public void buildDialog(XPopup.Builder builder) {
builder.animationDuration(0);
}
@Override

View File

@ -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());

View File

@ -0,0 +1,143 @@
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.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.R;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
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;
private BattlePassUserInfoBean userInfoBean;
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
int mCurrentExperience, int mTotalExperience,
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
super(context);
this.userInfoBean = userInfoBean;
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", userInfoBean.getBattlePassExp(), userInfoBean.getNextLevelExp()));
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();
}
});
}
});
IMLoginManager.get(getContext())
.updateUserCoin(new OnItemClickListener<JSONObject>() {
@Override
public void onItemClick(JSONObject bean, int position) {
if (bean != null) {
balance = bean.getString("coin");
balanceDiamond.setText(balance);
}
}
});
}
public interface OrderLevelCallback {
void onCallback(int code, String msg);
}
}

View File

@ -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();
}
});
}
}

View File

@ -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) {
}
});
}
}

View File

@ -0,0 +1,82 @@
package com.yunbao.common.dialog;
import static android.content.Context.INPUT_METHOD_SERVICE;
import android.content.Context;
import android.text.TextUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.BottomPopupView;
import com.yunbao.common.R;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
/***
* 游戏房字体输入
*/
public class SudGameInputPopupWindow extends BottomPopupView {
private EditText textMessage;
private SudGameInputCallBack sudGameInputCallBack;
private InputMethodManager imm;
public SudGameInputPopupWindow(@NonNull Context context, SudGameInputCallBack sudGameInputCallBack) {
super(context);
this.sudGameInputCallBack = sudGameInputCallBack;
}
// 返回自定义弹窗的布局
@Override
protected int getImplLayoutId() {
return R.layout.dialog_sud_game_input;
}
// 执行初始化操作比如findView设置点击或者任何你弹窗内的业务逻辑
@Override
protected void onCreate() {
super.onCreate();
initView();
initDate();
}
private void initView() {
imm = (InputMethodManager) getContext().getSystemService(INPUT_METHOD_SERVICE);
textMessage = findViewById(R.id.text_message);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.send), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (sudGameInputCallBack != null) {
String textMessageStr = textMessage.getText().toString().trim();
if (!TextUtils.isEmpty(textMessageStr)) {
if (textMessageStr.length() > 100) {
ToastUtil.show(WordUtil.isNewZh() ? "超出字數限制" : "Exceed word limit");
} else {
sudGameInputCallBack.sendMessage(textMessageStr);
}
dialog.dismiss();
} else {
ToastUtil.show(WordUtil.getNewString(R.string.cannot_be_empty));
}
}
}
});
textMessage.postDelayed(() -> {
//软键盘弹出
imm.showSoftInput(textMessage, InputMethodManager.SHOW_FORCED);
textMessage.requestFocus();
}, 200);
}
private void initDate() {
}
public interface SudGameInputCallBack {
void sendMessage(String textMessage);
}
}

View File

@ -0,0 +1,79 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class SudGameSmallPopupPindow extends AttachPopupView {
private TextView viewUnMute;
private boolean mute;
private SudGameUserModel sudGameUserModel;
private SudGameSmallCallBack sudGameSmallCallBack;
public SudGameSmallPopupPindow(@NonNull Context context, SudGameUserModel sudGameUserModel, boolean mute, SudGameSmallCallBack sudGameSmallCallBack) {
super(context);
this.mute = mute;
this.sudGameUserModel = sudGameUserModel;
this.sudGameSmallCallBack = sudGameSmallCallBack;
}
@Override
protected int getImplLayoutId() {
return R.layout.view_sud_game_small;
}
@Override
protected void onCreate() {
viewUnMute = findViewById(R.id.view_un_mute);
if (mute) {
viewUnMute.setText(WordUtil.isNewZh() ? "取消靜音" : "Unmute");
} else {
viewUnMute.setText(WordUtil.isNewZh() ? "靜音" : "Mute");
}
ViewClicksAntiShake.clicksAntiShake(viewUnMute, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.equals(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()), String.valueOf(sudGameUserModel.getId()))) {
ToastUtil.show(WordUtil.isNewZh() ? "無法對本人靜音" : "Unable to mute myself");
return;
}
if (sudGameUserModel.getMicStatus() == 3) {
ToastUtil.show(WordUtil.isNewZh() ? "對方未開麥!" : "The other side did not turn on the microphone");
return;
}
if (!mute) {
sudGameSmallCallBack.mute();
} else {
sudGameSmallCallBack.unMute();
}
dismiss();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.view_information), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
sudGameSmallCallBack.viewInformation(sudGameUserModel);
dismiss();
}
});
}
public interface SudGameSmallCallBack {
void unMute();
void mute();
void viewInformation(SudGameUserModel sudGameUserModel);
}
}

View File

@ -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);
}
}

View File

@ -0,0 +1,120 @@
package com.yunbao.common.event;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.bean.BaseModel;
import java.util.List;
public class SudGameSocketImEvent extends BaseModel {
@SerializedName("msg")
private List<MsgDTO> msg;
@SerializedName("retcode")
private String retcode;
@SerializedName("retmsg")
private String retmsg;
public List<MsgDTO> getMsg() {
return msg;
}
public void setMsg(List<MsgDTO> msg) {
this.msg = msg;
}
public String getRetcode() {
return retcode;
}
public void setRetcode(String retcode) {
this.retcode = retcode;
}
public String getRetmsg() {
return retmsg;
}
public void setRetmsg(String retmsg) {
this.retmsg = retmsg;
}
public static class MsgDTO {
@SerializedName("action")
private String action;
@SerializedName("uid")
private String uid;
@SerializedName("roomnum")
private String roomnum;
@SerializedName("ct")
private String ct;
@SerializedName("uname")
private String uname;
@SerializedName("_method_")
private String method;
@SerializedName("equipment")
private String equipment;
public String getAction() {
return action;
}
public MsgDTO setAction(String action) {
this.action = action;
return this;
}
public String getUid() {
return uid;
}
public MsgDTO setUid(String uid) {
this.uid = uid;
return this;
}
public String getRoomnum() {
return roomnum;
}
public MsgDTO setRoomnum(String roomnum) {
this.roomnum = roomnum;
return this;
}
public String getCt() {
return ct;
}
public MsgDTO setCt(String ct) {
this.ct = ct;
return this;
}
public String getUname() {
return uname;
}
public MsgDTO setUname(String uname) {
this.uname = uname;
return this;
}
public String getMethod() {
return method;
}
public MsgDTO setMethod(String method) {
this.method = method;
return this;
}
public String getEquipment() {
return equipment;
}
public MsgDTO setEquipment(String equipment) {
this.equipment = equipment;
return this;
}
}
}

View File

@ -0,0 +1,17 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.SudGameUserModel;
public class SudGameUserEvent extends BaseModel {
private SudGameUserModel sudGameUserModel;
public SudGameUserModel getSudGameUserModel() {
return sudGameUserModel;
}
public SudGameUserEvent setSudGameUserModel(SudGameUserModel sudGameUserModel) {
this.sudGameUserModel = sudGameUserModel;
return this;
}
}

View File

@ -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() {

View File

@ -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");
//解析粉丝徽章

View File

@ -11,6 +11,7 @@ import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.VersionUtil;
import com.yunbao.common.utils.WordUtil;
import java.io.File;
@ -350,7 +351,11 @@ public class LiveHttpUtil {
.params("p", p)
.execute(callback);
}
public static void getContactMsg(int page, HttpCallback callback) {
HttpClient.getInstance().get("Live.getContactMsg", "getContactMsg")
.params("p", page)
.execute(callback);
}
/**
* 观众跟主播连麦时获取自己的流地址
@ -640,7 +645,40 @@ public class LiveHttpUtil {
.params("appVersion", CommonAppConfig.getInstance().getVersion())
.execute(callback);
}
/**
* 观众给主播送礼物 - 包裹
*
* @param isContactGift 是否为联系方式礼物
*/
public static void sendGiftForPage(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
HttpClient.getInstance().get("Live.sendPackGift", LiveHttpConsts.SEND_GIFT)
.params("liveuid", liveUid)
.params("stream", stream)
.params("giftid", giftId)
.params("isContactGift", isContactGift)
.params("giftcount", giftCount)
.params("isprank", by)
.params("fans_exclusive_pack", isFansGroupGift ? "1" : "0")
.params("appVersion", CommonAppConfig.getInstance().getVersion())
.execute(callback);
}
/**
* 观众给主播送礼物 - 粉丝团
*
* @param isContactGift 是否为联系方式礼物
*/
public static void sendGiftForFansGroup(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) {
HttpClient.getInstance().get("Live.fansExclusivePack", LiveHttpConsts.SEND_GIFT)
.params("liveuid", liveUid)
.params("stream", stream)
.params("giftid", giftId)
.params("isContactGift", isContactGift)
.params("giftcount", giftCount)
.params("isprank", by)
.params("fans_exclusive_pack", isFansGroupGift ? "1" : "0")
.params("appVersion", CommonAppConfig.getInstance().getVersion())
.execute(callback);
}
public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) {
HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT)
.params("liveuid", liveUid)
@ -999,5 +1037,13 @@ public class LiveHttpUtil {
.execute(callback);
}
/**
* 获取短剧Url
*/
public static void getCoolydrama(HttpCallback callback){
HttpClient.getInstance().get("cool.register", "Home.getFollow")
.params("lang", WordUtil.isNewZh()?"zh_CN":"en")
.execute(callback);
}
}

View File

@ -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;
@ -54,10 +58,12 @@ import com.yunbao.common.bean.RedPacketDetailsBean;
import com.yunbao.common.bean.RedPacketGiftModel;
import com.yunbao.common.bean.RedPacketInfoModel;
import com.yunbao.common.bean.RedPacketListBean;
import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SearchModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.SlideInBannerModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.bean.SudRoomListModel;
import com.yunbao.common.bean.SudgameCodeModel;
import com.yunbao.common.bean.UserAreaBean;
@ -555,7 +561,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 +669,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 +1099,67 @@ 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(@Query("stream") String stream);
@GET("/api/public/?service=Sudgameserver.joinMic")
Observable<ResponseModel<List<BaseModel>>> joinMic(@Query("room_id") String roomId);
@GET("/api/public/?service=Sudgameserver.onMic")
Observable<ResponseModel<List<BaseModel>>> onMic(@Query("room_id") String roomId);
@GET("/api/public/?service=Sudgameserver.offMic")
Observable<ResponseModel<List<BaseModel>>> offMic(@Query("room_id") String roomId);
@GET("/api/public/?service=Sudgameserver.leaveMic")
Observable<ResponseModel<List<BaseModel>>> leaveMic(@Query("room_id") String roomId);
@GET("/api/public/?service=Sudgameserver.getRoomMicData")
Observable<ResponseModel<List<SudGameUserModel>>> getRoomMicData(@Query("room_id") String roomId);
@GET("/api/public/?service=Sudgameserver.getRoomMicStatus")
Observable<ResponseModel<RoomMicStatusModel>> getRoomMicStatus();
}

View File

@ -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;
@ -52,8 +56,10 @@ import com.yunbao.common.bean.RedPacketDetailsBean;
import com.yunbao.common.bean.RedPacketGiftModel;
import com.yunbao.common.bean.RedPacketInfoModel;
import com.yunbao.common.bean.RedPacketListBean;
import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.bean.SudRoomListModel;
import com.yunbao.common.bean.SudgameCodeModel;
import com.yunbao.common.bean.UserAreaBean;
@ -481,7 +487,7 @@ public class LiveNetManager {
* @param liveUid
*/
public void leaveRoomNew(String stream, String liveUid, HttpCallback<String> callback) {
Log.e("观看时长","leaveRoomNew-----------------------"+liveUid);
Log.e("观看时长", "leaveRoomNew-----------------------" + liveUid);
API.get().pdLiveApi(mContext)
.leaveRoomNew("g" + liveUid, stream)
.subscribeOn(Schedulers.io())
@ -1264,20 +1270,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 +2472,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 +2628,309 @@ 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) {
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(String stream,HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.addChatCount(stream)
.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 joinMic(String roomId, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.joinMic(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
@Override
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.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 onMic(String roomId, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.onMic(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
@Override
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.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 offMic(String roomId, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.offMic(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
@Override
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.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 leaveMic(String roomId, HttpCallback<HttpCallbackModel> callback) {
API.get().pdLiveApi(mContext)
.leaveMic(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
@Override
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.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 getRoomMicData(String roomId, HttpCallback<List<SudGameUserModel>> callback) {
API.get().pdLiveApi(mContext)
.getRoomMicData(roomId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<SudGameUserModel>>>() {
@Override
public void accept(ResponseModel<List<SudGameUserModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.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 getRoomMicStatus(HttpCallback<RoomMicStatusModel> callback) {
API.get().pdLiveApi(mContext)
.getRoomMicStatus()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<RoomMicStatusModel>>() {
@Override
public void accept(ResponseModel<RoomMicStatusModel> roomMicStatusModelResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(roomMicStatusModelResponseModel.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();
}
/**
* 直播间取消网络请求
*/
@ -2564,5 +2944,8 @@ public class LiveNetManager {
if (randomPkApi != null) {
randomPkApi.dispose();
}
if (contactMsgApi != null) {
contactMsgApi.dispose();
}
}
}

View File

@ -8,6 +8,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat;
import com.umeng.analytics.MobclickAgent;
@ -16,6 +17,7 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.DataUserInfoEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.base.BaseCacheManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
@ -509,5 +511,39 @@ public class IMLoginManager extends BaseCacheManager {
}
});
}
public void updateUserCoin(){
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
JSONObject obj = JSONObject.parseObject(info[0]);
String golds = obj.getString("gold");
String coins = obj.getString("coin");
String yuanbaos = obj.getString("yuanbao");
userInfo.setCoin(obj.getLong("coin"));
userInfo.setGold(obj.getLong("gold"));
userInfo.setYuanbao(yuanbaos);
}
}
});
}
public void updateUserCoin(OnItemClickListener<JSONObject> listener){
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
JSONObject obj = JSONObject.parseObject(info[0]);
listener.onItemClick(obj,0);
String golds = obj.getString("gold");
String coins = obj.getString("coin");
String yuanbaos = obj.getString("yuanbao");
userInfo.setCoin(obj.getLong("coin"));
userInfo.setGold(obj.getLong("gold"));
userInfo.setYuanbao(yuanbaos);
}
}
});
}
}

View File

@ -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));

View File

@ -0,0 +1,535 @@
package com.yunbao.common.manager.imrongcloud;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.SudGameChatImModel;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.event.SudGameSocketImEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList;
import java.util.List;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.RCRTCRemoteUser;
import cn.rongcloud.rtc.api.RCRTCRoom;
import cn.rongcloud.rtc.api.RCRTCRoomConfig;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
import cn.rongcloud.rtc.base.RCRTCParamsType;
import cn.rongcloud.rtc.base.RCRTCRoomType;
import cn.rongcloud.rtc.base.RTCErrorCode;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.chatroom.base.RongChatRoomClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.Message;
import io.rong.message.TextMessage;
public class GameMicManager {
MeetingCallback mMeetingCallback = null;
private RCRTCRoom mRtcRoom = null;
private String mRoomID = "";
private final IRCRTCRoomEventsListener roomEventsListener = new IRCRTCRoomEventsListener() {
/**
* 房间内用户发布资源
*
* @param rcrtcRemoteUser 远端用户
* @param list 发布的资源
*/
@Override
public void onRemoteUserPublishResource(RCRTCRemoteUser rcrtcRemoteUser, final List<RCRTCInputStream> list) {
// subscribeAVStream();
}
@Override
public void onRemoteUserMuteAudio(RCRTCRemoteUser rcrtcRemoteUser, RCRTCInputStream rcrtcInputStream, boolean b) {
}
@Override
public void onRemoteUserMuteVideo(RCRTCRemoteUser rcrtcRemoteUser, RCRTCInputStream rcrtcInputStream, boolean b) {
}
@Override
public void onRemoteUserUnpublishResource(RCRTCRemoteUser rcrtcRemoteUser, List<RCRTCInputStream> list) {
}
/**
* 用户加入房间
*
* @param rcrtcRemoteUser 远端用户
*/
@Override
public void onUserJoined(final RCRTCRemoteUser rcrtcRemoteUser) {
try {
getView().onUserJoined(rcrtcRemoteUser);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
/**
* 用户离开房间
*
* @param rcrtcRemoteUser 远端用户
*/
@Override
public void onUserLeft(RCRTCRemoteUser rcrtcRemoteUser) {
try {
getView().onUserLeft(rcrtcRemoteUser);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onUserOffline(RCRTCRemoteUser rcrtcRemoteUser) {
}
@Override
public void onPublishLiveStreams(List<RCRTCInputStream> list) {
}
@Override
public void onUnpublishLiveStreams(List<RCRTCInputStream> list) {
}
/**
* 自己退出房间 例如断网退出等
* @param i 状态码
*/
@Override
public void onLeaveRoom(int i) {
}
};
protected MeetingCallback getView() {
if (mMeetingCallback == null) {
throw new IllegalStateException("view is not attached");
} else {
return mMeetingCallback;
}
}
public void attachView(MeetingCallback callback) {
mMeetingCallback = callback;
}
public void detachView() {
mMeetingCallback = null;
}
/**
* 主动订阅远端用户发布的流
* 视频流需要用户设置用于显示载体的videoview
*/
public void subscribeAVStream() {
if (mRtcRoom == null || mRtcRoom.getRemoteUsers() == null) {
return;
}
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
for (final RCRTCRemoteUser remoteUser : mRtcRoom.getRemoteUsers()) {
if (remoteUser.getStreams().size() == 0) {
continue;
}
inputStreams.addAll(remoteUser.getStreams());
}
if (inputStreams.size() == 0) {
return;
}
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
try {
getView().onSubscribeSuccess(inputStreams);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onFailed(RTCErrorCode errorCode) {
try {
getView().onSubscribeFailed();
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
});
}
public void refreshStreams(List<SudGameUserModel> personList) {
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
for (SudGameUserModel sudGameUserModel : personList) {
List<RCRTCRemoteUser> rcrtcRemoteUsers = mRtcRoom.getRemoteUsers();
for (RCRTCRemoteUser rcrtcRemoteUser : rcrtcRemoteUsers) {
if (TextUtils.equals(rcrtcRemoteUser.getUserId(), String.valueOf(sudGameUserModel.getId()))) {
for (RCRTCInputStream rcrtcInputStream : rcrtcRemoteUser.getStreams()) {
rcrtcInputStream.mute(sudGameUserModel.getMicStatus() == 3);
}
inputStreams.addAll(rcrtcRemoteUser.getStreams());
}
}
}
if (inputStreams.size() == 0) {
return;
}
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
try {
getView().onSubscribeSuccess(inputStreams);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onFailed(RTCErrorCode errorCode) {
try {
getView().onSubscribeFailed();
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
});
}
public void refreshStreams(String userID, boolean mute, int position) {
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
List<RCRTCRemoteUser> rcrtcRemoteUsers = mRtcRoom.getRemoteUsers();
for (RCRTCRemoteUser rcrtcRemoteUser : rcrtcRemoteUsers) {
if (TextUtils.equals(rcrtcRemoteUser.getUserId(), String.valueOf(userID))) {
for (RCRTCInputStream rcrtcInputStream : rcrtcRemoteUser.getStreams()) {
rcrtcInputStream.mute(mute);
}
inputStreams.addAll(rcrtcRemoteUser.getStreams());
}
}
if (inputStreams.size() == 0) {
return;
}
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
try {
getView().onSubscribeSuccess(userID, mute, position);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onFailed(RTCErrorCode errorCode) {
try {
getView().onSubscribeFailed(userID);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
});
}
public void unPublishStreams() {
if (mRtcRoom == null) {
return;
}
mRtcRoom.getLocalUser().unpublishStream(RCRTCEngine.getInstance().getDefaultAudioStream(), new IRCRTCResultCallback() {
@Override
public void onSuccess() {
try {
getView().onUnPublishStreamsSuccess();
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onFailed(RTCErrorCode errorCode) {
try {
getView().onUnPublishStreamsFailed();
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
});
}
/**
* 发布默认流
*/
public void publishDefaultAVStream() {
if (mRtcRoom == null) {
return;
}
mRtcRoom.getLocalUser().publishStream(RCRTCEngine.getInstance().getDefaultAudioStream(), new IRCRTCResultCallback() {
@Override
public void onSuccess() {
try {
getView().onPublishSuccess();
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
try {
getView().onPublishFailed();
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
});
}
/**
* 配置rtc sdk
*/
public void config(Context context) {
// RCRTCConfig.Builder configBuilder = RCRTCConfig.Builder.create();
// // 是否硬解码
// configBuilder.enableHardwareDecoder(true);
// // 是否硬编码
// configBuilder.enableHardwareEncoder(true);
//
// // init 需结合 uninit 使用否则有些配置无法重新初始化
// RCRTCEngine.getInstance().unInit();
// RCRTCEngine.getInstance().init(context, configBuilder.build());
// RCRTCVideoStreamConfig.Builder videoConfigBuilder = RCRTCVideoStreamConfig.Builder.create();
// // 设置分辨率
// videoConfigBuilder.setVideoResolution(RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_720_1280);
// // 设置帧率
// videoConfigBuilder.setVideoFps(RCRTCParamsType.RCRTCVideoFps.Fps_30);
// /**
// * 设置最小码率可根据分辨率RCRTCVideoResolution设置
// * {@link RCRTCParamsType.RCRTCVideoResolution)}
// */
// videoConfigBuilder.setMinRate(250);
// /**
// * 设置最大码率可根据分辨率RCRTCVideoResolution设置
// * {@link RCRTCParamsType.RCRTCVideoResolution)}
// */
// videoConfigBuilder.setMaxRate(2200);
// RCRTCEngine.getInstance().getDefaultVideoStream().setVideoConfig(videoConfigBuilder.build());
//打开扬声器
RCRTCEngine.getInstance().enableSpeaker(true);
// 启用耳返功能
RCRTCEngine.getInstance().getDefaultAudioStream().enableEarMonitoring(true);
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(false);
RCRTCEngine.getInstance().getDefaultAudioStream().setAudioQuality(RCRTCParamsType.AudioQuality.MUSIC_HIGH, RCRTCParamsType.AudioScenario.MUSIC_CHATROOM);
}
public void joinRoom(String roomId, boolean imOff) {
mRoomID = roomId;
if (imOff) {
RCRTCRoomConfig roomConfig = RCRTCRoomConfig.Builder.create()
// 根据实际场景选择音视频直播LIVE_AUDIO_VIDEO 或音频直播LIVE_AUDIO
.setRoomType(RCRTCRoomType.MEETING)
.build();
RCRTCEngine.getInstance().joinRoom("v" + roomId, roomConfig, new IRCRTCResultDataCallback<RCRTCRoom>() {
@Override
public void onSuccess(final RCRTCRoom rcrtcRoom) {
GameMicManager.this.mRtcRoom = rcrtcRoom;
// 注册房间回调
rcrtcRoom.registerRoomListener(roomEventsListener);
try {
getView().onJoinRoomSuccess(rcrtcRoom);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
try {
getView().onJoinRoomFailed(rtcErrorCode);
} catch (IllegalStateException e) {
e.printStackTrace();
}
}
});
}
RongChatRoomClient.getInstance().joinChatRoom("v" + roomId, -1, new IRongCoreCallback.OperationCallback() {
@Override
public void onSuccess() {
Log.i("tx", "加入成功");
}
@Override
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
Log.i("tx", "加入" + "失败" + coreErrorCode);
if (WordUtil.isNewZh()) {
ToastUtil.show("網絡不佳無法連接,請重新進入");
} else {
ToastUtil.show("The network is not connected, please re-enter");
}
}
});
}
public void leaveRoom() {
RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
}
@Override
public void onSuccess() {
}
});
RongChatRoomClient.getInstance().quitChatRoom("v" + mRoomID, new IRongCoreCallback.OperationCallback() {
@Override
public void onSuccess() {
Log.i("tx", "退出成功");
}
@Override
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
Log.i("tx", "退出" + "" + coreErrorCode);
}
});
}
/**
* 处理游戏房Im消息
*/
public void processingMessage(SudGameSocketImEvent socketImModel) {
List<SudGameSocketImEvent.MsgDTO> msgDTOS = socketImModel.getMsg();
if (msgDTOS.isEmpty()) return;
SudGameSocketImEvent.MsgDTO msgDTO = msgDTOS.get(0);
//正常文字消息
if (TextUtils.equals(msgDTO.getMethod(), "SendMsg")) {
getView().insertItem(new SudGameChatImModel().setNickname(msgDTO.getUname()).setTextMessage(msgDTO.getCt()));
} else if (TextUtils.equals(msgDTO.getMethod(), "sudGameRoomVoiceList")) {
List<SudGameUserModel> personList = new Gson().fromJson(msgDTO.getCt(), new TypeToken<List<SudGameUserModel>>() {
}.getType());
getView().refreshSudGameUserList(personList);
refreshStreams(personList);
}
}
/**
* 发送聊天信息
*
* @param textMessage
*/
public void sendMessage(String textMessage) {
IMLoginModel loginModel = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo();
SudGameSocketImEvent sudGameSocketImEvent = new SudGameSocketImEvent();
sudGameSocketImEvent.setRetcode("000000");
sudGameSocketImEvent.setRetmsg("ok");
SudGameSocketImEvent.MsgDTO msgDTO = new SudGameSocketImEvent.MsgDTO();
msgDTO.setAction("0")
.setCt(textMessage)
.setEquipment("app")
.setUid(String.valueOf(loginModel.getId()))
.setMethod("SendMsg")
.setUname(loginModel.getUserNicename())
.setRoomnum(mRoomID);
List<SudGameSocketImEvent.MsgDTO> msgDTOS = new ArrayList<>();
msgDTOS.add(msgDTO);
sudGameSocketImEvent.setMsg(msgDTOS);
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
TextMessage messageContent = TextMessage.obtain(new Gson().toJson(sudGameSocketImEvent));
Message message = Message.obtain("v" + mRoomID, conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override
public void onAttached(Message message) {
}
@Override
public void onSuccess(Message message) {
Log.i("tx", "发送成功");
String contentJson = ((TextMessage) message.getContent()).getContent();
Log.e("wewe", contentJson);
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
processingMessage(sudGameSocketImEvent);
}
@Override
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
Log.i("tx", "发送成功"+errorCode.toString());
}
});
}
/**
* activity相关回调
*/
public interface MeetingCallback {
void onJoinRoomSuccess(RCRTCRoom rcrtcRoom);
void onJoinRoomFailed(RTCErrorCode rtcErrorCode);
void onPublishSuccess();
void onPublishFailed();
void onUnPublishStreamsSuccess();
void onUnPublishStreamsFailed();
void onSubscribeSuccess(List<RCRTCInputStream> inputStreamList);
void onSubscribeFailed();
void onSubscribeSuccess(String userID, boolean mute, int position);
void onSubscribeFailed(String userID);
void onUserJoined(RCRTCRemoteUser rcrtcRemoteUser);
void onUserLeft(RCRTCRemoteUser rcrtcRemoteUser);
void insertItem(SudGameChatImModel sudGameChatImModel);
void refreshSudGameUserList(List<SudGameUserModel> personList);
}
}

View File

@ -52,6 +52,10 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
*/
public GameViewInfoModel.GameViewRectModel gameViewRectModel;
public GameViewInfoModel.GameViewRectModel getGameViewRectModel() {
return gameViewRectModel;
}
/**
* 游戏的语言代码
*/

View File

@ -0,0 +1,6 @@
package com.yunbao.common.sud.audio;
public enum AudioEngineUpdateType {
ADD,
DELETE
}

View File

@ -0,0 +1,8 @@
package com.yunbao.common.sud.audio;
import java.nio.ByteBuffer;
public class AudioPCMData {
public ByteBuffer data;
public int dataLength;
}

View File

@ -0,0 +1,34 @@
package com.yunbao.common.sud.audio;
/**
* 语聊房房间状态
*/
public enum AudioRoomState {
DISCONNECTED(0),
CONNECTING(1),
CONNECTED(2);
private int value;
private AudioRoomState(int value) {
this.value = value;
}
public int value() {
return this.value;
}
public static AudioRoomState getZegoRoomState(int value) {
try {
if (DISCONNECTED.value == value) {
return DISCONNECTED;
} else if (CONNECTING.value == value) {
return CONNECTING;
} else {
return CONNECTED.value == value ? CONNECTED : null;
}
} catch (Exception var2) {
throw new RuntimeException("The enumeration cannot be found");
}
}
}

View File

@ -0,0 +1,7 @@
package com.yunbao.common.sud.audio;
public class AudioStream {
public String userID;
public String streamID;
public String extraInfo;
}

View File

@ -0,0 +1,121 @@
package com.yunbao.common.sud.audio;
import android.view.View;
import com.yunbao.common.sud.model.AudioJoinRoomModel;
public interface ISudAudioEngine {
// region 1. 初始化销毁SDK 设置IAudioEventHandler回调
/**
* 设置事件处理器
*
* @param listener 事件处理实例
*/
void setEventListener(ISudAudioEventListener listener);
/**
* 销毁引擎SDK
*/
void destroy();
// endregion
// region 2. 登录房间退出房间
/**
* 加入房间, 登录成功后 默认不推流 默认拉流
*
* @param model roomId
*/
void joinRoom(AudioJoinRoomModel model);
/**
* 离开房间
*/
void leaveRoom();
// endregion
// region 3. 开启推流停止推流
/**
* 开启推流
*/
void startPublishStream();
/**
* 停止推流
*/
void stopPublishStream();
// endregion
// region 4. 开启拉流停止拉流
/**
* 开启拉流进入房间默认订阅拉流
*/
void startSubscribingStream();
/**
* 停止拉流
*/
void stopSubscribingStream();
// endregion
// region 5. 开始音频流监听关闭音频流监听
/**
* 开始音频流监听
*/
void startPCMCapture();
/**
* 关闭音频流监听
*/
void stopPCMCapture();
// endregion
// region 6. 是否使用扬声器作为音频通道
/**
* 切换扬声器作为音频通道
*/
void setAudioRouteToSpeaker(boolean enabled);
// endregion
// region 7. 发送信令
/**
* 发送信令
*
* @param command 信令内容
* @param listener 回调
*/
void sendCommand(String command, SendCommandListener listener);
/**
* 发送指令回调接口
*/
interface SendCommandListener {
void onResult(int value);
}
// endregion
// region 8. 直播接口
/**
* 观众开始拉流
*
* @param streamID
* @param view
* @param mediaViewMode 图像拉伸
*/
void startPlayingStream(String streamID, MediaViewMode mediaViewMode, View view);
/**
* 观众停止拉流
*
* @param streamID
*/
void stopPlayingStream(String streamID);
}

View File

@ -0,0 +1,95 @@
package com.yunbao.common.sud.audio;
import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.List;
public interface ISudAudioEventListener {
/**
* 捕获本地音量变化, 可用于展示自己说话音浪大小
*
* @param soundLevel 本地音量级别取值范围[0, 100]
*/
void onCapturedSoundLevelUpdate(float soundLevel);
/**
* 捕获远程音流音量变化, 可用于展示远端说话音浪大小
*
* @param soundLevels [userId: 音量]音量取值范围[0, 100]
*/
void onRemoteSoundLevelUpdate(HashMap<String, Float> soundLevels);
/**
* 房间流更新 可用于知道当前推流人数
*
* @param roomId 房间id
* @param type 流更新类型
* @param streamList 变动流列表
* @param extendedData 扩展信息
*/
void onRoomStreamUpdate(String roomId, AudioEngineUpdateType type, List<AudioStream> streamList, JSONObject extendedData);
/**
* 接收自定义指令信息回调
*
* @param fromUserID 用户
* @param command 指令内容
*/
void onRecvCommand(String fromUserID, String command);
/**
* 接收跨房指令信息回调
*
* @param fromRoomID 消息的房间 ID
* @param fromUserID 消息的用户 ID
* @param command 指令内容
*/
void onRecvXRoomCommand(String fromRoomID, String fromUserID, String command);
/**
* 房间内当前在线用户数量回调
*
* @param count 人数
*/
void onRoomOnlineUserCountUpdate(int count);
/**
* 房间状态变化
*
* @param state 状态
* @param errorCode 错误码
* @param extendedData 扩展信息
*/
void onRoomStateUpdate(AudioRoomState state, int errorCode, JSONObject extendedData);
/**
* 监听音频PCM流回调
*
* @param audioPCMData 音频流数据
*/
void onCapturedPCMData(AudioPCMData audioPCMData);
/**
* 观众拉流成功通知
*
* @param streamID
*/
void onPlayingStreamingAdd(String streamID);
/**
* 观众拉流结束通知
*
* @param streamID
*/
void onPlayingStreamingDelete(String streamID);
/**
* 拉流分辨率变更通知
*
* @param streamID 流id
* @param width
* @param height
*/
void onPlayerVideoSizeChanged(String streamID, int width, int height);
}

View File

@ -0,0 +1,7 @@
package com.yunbao.common.sud.audio;
public enum MediaViewMode {
ASPECT_FIT, // 等比缩放可能有黑边
ASPECT_FILL, // 等比缩放填充整个 View可能有部分被裁减
SCALE_TO_FILL; // 填充整个 View图像可能被拉伸
}

View File

@ -0,0 +1,16 @@
package com.yunbao.common.sud.model;
public class AudioJoinRoomModel {
public String userID;
public String userName;
public String roomID;
public String token;
public long timestamp;
public String appId;
}

View File

@ -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 {

View File

@ -1,5 +1,7 @@
package com.yunbao.common.utils;
import com.yunbao.common.http.Data;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -13,10 +15,13 @@ public class DateFormatUtil {
private static SimpleDateFormat sFormat2;
private static SimpleDateFormat sFormat3;
private static SimpleDateFormat sFormat4;
static {
sFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
sFormat2 = new SimpleDateFormat("yyyyMMdd_HHmmss_SSS");
sFormat3 = new SimpleDateFormat("MM.dd-HH:mm:ss");
sFormat4 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
}
@ -24,6 +29,14 @@ public class DateFormatUtil {
return sFormat.format(new Date());
}
public static String getTimeString(long time) {
Date date = new Date(time); // 创建Date对象并传入时间戳参数
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 设置日期格式
String formattedDate = sdf.format(date); // 格式化日期字符串
return formattedDate;
}
public static String getVideoCurTimeString() {
return sFormat2.format(new Date());
}

View File

@ -69,7 +69,8 @@ public class DialogUitl {
}
return dialog;
}
public static void showToast(Context context,String content,long delayMillis){
public static void showToast(Context context, String content, long delayMillis) {
Dialog dialog = new Dialog(context, R.style.dialog);
dialog.setContentView(R.layout.dialog_toast);
dialog.setCancelable(false);
@ -82,7 +83,7 @@ public class DialogUitl {
}
}
dialog.show();
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss, delayMillis);
}
@ -121,6 +122,38 @@ public class DialogUitl {
dialog.show();
}
public static void showDelSysMsg(Context context, String content, SimpleCallback simpleCallback) {
if (context instanceof Activity) {
if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
return;
}
}
final Dialog dialog = new Dialog(context, R.style.dialog2);
dialog.setContentView(R.layout.dialog_del_sys_msg);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
if (!TextUtils.isEmpty(content)) {
TextView contentTextView = (TextView) dialog.findViewById(R.id.content);
contentTextView.setText(content);
}
dialog.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.findViewById(R.id.btn_confirm).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
simpleCallback.onConfirmClick(dialog, "");
dialog.dismiss();
}
});
dialog.show();
}
public static void showSimpleDialog(Context context, String content, SimpleCallback callback) {
showSimpleDialog(context, content, false, callback);
}
@ -135,13 +168,7 @@ public class DialogUitl {
return;
}
}
new Builder(context)
.setTitle(title)
.setContent(content)
.setCancelable(cancelable)
.setClickCallback(callback)
.build()
.show();
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback(callback).build().show();
}
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) {
@ -150,13 +177,7 @@ public class DialogUitl {
return;
}
}
new Builder(context)
.setTitle(title)
.setContent(content)
.setCancelable(cancelable)
.setClickCallback3(callback)
.build()
.show();
new Builder(context).setTitle(title).setContent(content).setCancelable(cancelable).setClickCallback3(callback).build().show();
}
public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) {
@ -165,15 +186,7 @@ public class DialogUitl {
return;
}
}
new Builder(context).setTitle(title)
.setCancelable(true)
.setInput(true)
.setHint(hint)
.setInputType(inputType)
.setLength(length)
.setClickCallback(callback)
.build()
.show();
new Builder(context).setTitle(title).setCancelable(true).setInput(true).setHint(hint).setInputType(inputType).setLength(length).setClickCallback(callback).build().show();
}
@ -483,8 +496,8 @@ public class DialogUitl {
mClickCallback3.onConfirmClick(dialog);
}
if (mSimpleCallbackView != null) {
mSimpleCallbackView.onConfirmClick(dialog,titleView, content, btnConfirm, btnCancel);
}else{
mSimpleCallbackView.onConfirmClick(dialog, titleView, content, btnConfirm, btnCancel);
} else {
dialog.dismiss();
}
@ -501,8 +514,8 @@ public class DialogUitl {
((SimpleCallback2) mClickCallback).onCancelClick();
}
if (mSimpleCallbackView != null) {
mSimpleCallbackView.onCancel(dialog,titleView, content, btnConfirm, btnCancel);
}else{
mSimpleCallbackView.onCancel(dialog, titleView, content, btnConfirm, btnCancel);
} else {
dialog.dismiss();
}
}
@ -510,17 +523,17 @@ public class DialogUitl {
}
}
};
if(btnConfirm!=null) {
if (btnConfirm != null) {
btnConfirm.setOnClickListener(listener);
}
if(btnCancel!=null) {
if (btnCancel != null) {
btnCancel.setOnClickListener(listener);
}
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialogInterface) {
if (mSimpleCallbackView != null) {
mSimpleCallbackView.onShow(dialog,titleView, content, btnConfirm, btnCancel);
mSimpleCallbackView.onShow(dialog, titleView, content, btnConfirm, btnCancel);
}
}
});
@ -563,8 +576,7 @@ public class DialogUitl {
/**
* 城市选择
*/
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list,
String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
public static void showCityChooseDialog(Activity activity, ArrayList<Province> list, String province, String city, String district, AddressPicker.OnAddressPickListener listener) {
AddressPicker picker = new AddressPicker(activity, list);
picker.setTextColor(0xff323232);
picker.setDividerColor(0xffdcdcdc);

View File

@ -44,7 +44,7 @@ public class GoogleUtils {
public boolean getGoogleService() {
boolean flag;
boolean flag =false;
try {
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage");
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);

View File

@ -607,7 +607,7 @@ public class JavascriptInterfaceUtils {
public void androidClickToTaskPage() {
ARouter.getInstance().build(PATH_REWARD).withString("url",
CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index" + "&uid=" + CommonAppConfig.getInstance().getUid()
+ "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
+ "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")).navigation();
}
@JavascriptInterface
@ -678,4 +678,8 @@ public class JavascriptInterfaceUtils {
});
}
@JavascriptInterface
public void androidGotoCustomerService(String url) {
RouteUtil.forwardCustomerService(url);
}
}

View File

@ -0,0 +1,108 @@
package com.yunbao.common.utils;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.NinePatch;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.os.Build;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.yunbao.common.manager.IMLoginManager;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class LoadDian9TuUtilSud {
private static final List<Bitmap> BITMAP_CACHE = new ArrayList<>();//.9图Bitmap缓存
public void loadDian9TuAssets(Context context, View imageView, int position) {
if (TextUtils.isEmpty(IMLoginManager.get(context).getKeyDefaultBubbleUrl())) {
Bitmap bitmap = getImageFromAssetsFile(context, "chat_message_bg.png");
BITMAP_CACHE.add(bitmap);
setNinePathImage(context, imageView, bitmap, position);
} else {
String url = IMLoginManager.get(context).getKeyDefaultBubbleUrl();
LoadDian9Tu(context, imageView, url, 1);
}
}
public void setNinePathImage(Context context, View imageView, Bitmap bitmap, int position) {
if (bitmap == null)
return;
byte[] chunk = bitmap.getNinePatchChunk();
if (NinePatch.isNinePatchChunk(chunk)) {
NinePatchDrawable patchy = new NinePatchDrawable(context.getResources(), bitmap, chunk, NinePatchChunk.deserialize(chunk, position).mPaddings, null);
imageView.setBackground(patchy);
}
}
public void LoadDian9Tu(Context context, View imageView, String imgUrl, int position) {
if (context == null) {
return;
}
if (context instanceof Activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (((Activity) context).isDestroyed()) {
return;
}
}
}
Glide.with(context)
.asFile()
.load(imgUrl)
.into(new CustomTarget<File>() {
@Override
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) {
try {
FileInputStream is = new FileInputStream(resource);
Bitmap bitmap = BitmapFactory.decodeStream(is);
BITMAP_CACHE.add(bitmap);
setNinePathImage(context, imageView, bitmap, position);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
/**
* 从Assets中读取图片
*
* @param fileName
* @return
*/
private Bitmap getImageFromAssetsFile(Context context, String fileName) {
Bitmap image = null;
AssetManager am = context.getResources().getAssets();
try {
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return image;
}
}

View File

@ -1,4 +1,4 @@
package com.yunbao.live.utils;
package com.yunbao.common.utils;
import android.graphics.Rect;

View File

@ -1,5 +1,6 @@
package com.yunbao.common.utils;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@ -30,6 +31,7 @@ public class RouteUtil {
public static final String PATH_LIVEREPORT = "/live/LiveReportActivity";
public static final String PATH_MYWEBVIEWACTIVTITY = "/main/MyWebViewActivity";
public static final String PATH_ZHUANGBANACTIVITY = "/main/ZhuangBanActivity";
public static final String PATH_COMPENSATE_ACTIVITY = "/live/CompensateActivity";
public static final String PATH_LiveZHUANGBANACTIVITY = "/live/ZhuangBanActivity";
public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity";
public static final String PATH_MAIN = "/main/MainActivity";
@ -45,12 +47,19 @@ 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 final String PATH_SudGameActivity="/live/SudGameActivity";
public static void forwardFansActivity(String uid) {
ARouter.getInstance().build(PATH_FANSACTIVITY)
.withString(Constants.TO_UID, uid)
.navigation();
}
public static void forwardSudGameActivity(String CreateSudRoom) {
ARouter.getInstance().build(PATH_SudGameActivity)
.withString("CreateSudRoom", CreateSudRoom)
.navigation();
}
public static void forwardMyWebViewActivity2(String url) {
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY2)
@ -127,6 +136,23 @@ public class RouteUtil {
.navigation();
}
/**
* 跳转到
*/
public static void forwardLiveCompensateActivity(Context context, String msgid, String banner, String title, String content, String time, String link, boolean receive) {
ARouter.getInstance().build(PATH_COMPENSATE_ACTIVITY)
.withString("msgid", msgid)
.withString("banner", banner)
.withString("title", title)
.withString("content", content)
.withString("time", time)
.withString("link", link)
.withBoolean("receive", receive)
.navigation();
}
/**
* 跳转到装扮
*/
@ -311,8 +337,16 @@ public class RouteUtil {
/**
* 系统头像选择
*/
public static void forwardUserAvatarSelect(){
public static void forwardUserAvatarSelect() {
ARouter.getInstance().build(PATH_SELECT_AVATAR)
.navigation();
}
/**
* 战令
*/
public static void forwardBattlePass(){
ARouter.getInstance().build(PATH_BattlePassActivity)
.navigation();
}
}

View File

@ -33,10 +33,12 @@ public class SpUtil {
public static final String BEAUTY_SDK_TYPE = "beautySdkType";
public static final String TURNTABLE_ENABLE = "turntableEnable";
public static final String BEAUTY_360_TIEZHI_URL = "beauty360TiezhiUrl";
public static final String BEAUTY_360_TIEZHI_EXIST = "beauty360TiezhiExist";
public static final String ANCHOR_PK_TIME = "anchorPkTime";
public static final String BEAUTY_360_TIEZHI_EXIST = "beauty360TiezhiExist";
public static final String ANCHOR_PK_TIME = "anchorPkTime";
//播放短视频上下滑动引导页
public static final String READ_VIDEO_GUIDE = "readVideoGuide";
public static final String READ_VIDEO_GUIDE = "readVideoGuide";
public static final String MESSAGE_SYS_DEL = "FIRST_DEL";
public SpUtil() {
@ -73,8 +75,8 @@ public class SpUtil {
/**
* 判断一个值是否存在
*/
public boolean isExists(String key){
return mSharedPreferences.contains(key);
public boolean isExists(String key) {
return mSharedPreferences.contains(key);
}
/**

View File

@ -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) {

View File

@ -98,8 +98,10 @@ public class LiveSudGamePopup extends BottomPopupView {
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
gameViewModel.onDestroy();
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(2));
dismiss();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {

View File

@ -0,0 +1,42 @@
package com.yunbao.common.views;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.core.AttachPopupView;
import com.yunbao.common.R;
import com.yunbao.common.event.CustomDrawerPopupEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class MsgSysDelPopupView extends AttachPopupView {
ItemDelListener itemDelListener;
public MsgSysDelPopupView(@NonNull Context context, ItemDelListener itemDelListener) {
super(context);
this.itemDelListener = itemDelListener;
}
@Override
protected int getImplLayoutId() {
return R.layout.view_msg_sys_del;
}
@Override
protected void onCreate() {
//特效设置
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.del), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
itemDelListener.onItemDel();
}
});
}
public interface ItemDelListener {
void onItemDel();
}
}

View File

@ -0,0 +1,49 @@
package com.yunbao.common.views;
import android.graphics.Color;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R;
import com.yunbao.common.bean.SudGameChatImModel;
import com.yunbao.common.utils.LoadDian9TuUtilSud;
public class SudGameChatViewHolder extends RecyclerView.ViewHolder {
private LinearLayout mBg;
private TextView chatMessage;
public SudGameChatViewHolder(@NonNull View itemView) {
super(itemView);
mBg = (LinearLayout) itemView.findViewById(R.id.bg);
chatMessage = itemView.findViewById(R.id.chat_message);
}
/**
* 幸运100%活动
*/
public void sudGameChat(SudGameChatImModel msgModel) {
new LoadDian9TuUtilSud().loadDian9TuAssets(itemView.getContext(), mBg, 1);
StringBuffer buffer = new StringBuffer();
String userName = msgModel.getNickname() + ":";
buffer.append(userName)
.append(" ")
.append(msgModel.getTextMessage());
String msg = buffer.toString();
int unameIndexOf = msg.indexOf(userName);
int unameSize = userName.length();
SpannableStringBuilder builder = new SpannableStringBuilder();
builder.append(msg);
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBD0D")), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
chatMessage.setText(builder);
}
}

View File

@ -15,7 +15,6 @@ import com.google.gson.Gson;
import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.activity.SudGameActivity;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.SudRoomListModel;
@ -107,9 +106,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
createSudRoomModel.setSudGameName(model.getSudGameName());
if (isHome) {
if (TextUtils.equals(model.getLiveUid(), "0")) {
Intent intent = new Intent(itemView.getContext(), SudGameActivity.class);
intent.putExtra("CreateSudRoom", new Gson().toJson(createSudRoomModel));
itemView.getContext().startActivity(intent);
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel));
} else {
String yes = "";
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
@ -158,9 +156,7 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
@Override
public void onCancel() {
Intent intent = new Intent(itemView.getContext(), SudGameActivity.class);
intent.putExtra("CreateSudRoom", new Gson().toJson(createSudRoomModel));
itemView.getContext().startActivity(intent);
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel));
}
})).show();

View File

@ -0,0 +1,101 @@
package com.yunbao.common.views;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.enums.PopupPosition;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.adapter.SudGameUserListAdapter;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.dialog.SudGameSmallPopupPindow;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class SudGameUserListViewHolder extends RecyclerView.ViewHolder {
private ImageView vacancy_sud_game, mic_status;
private FrameLayout user_layout;
private RoundedImageView sud_game_user;
private LinearLayout layout;
public SudGameUserListViewHolder(@NonNull View itemView) {
super(itemView);
vacancy_sud_game = itemView.findViewById(R.id.vacancy_sud_game);
sud_game_user = itemView.findViewById(R.id.sud_game_user);
user_layout = itemView.findViewById(R.id.user_layout);
mic_status = itemView.findViewById(R.id.mic_status);
layout = itemView.findViewById(R.id.layout);
}
public void upData(SudGameUserModel sudGameUserModel, SudGameUserListAdapter.SudGameSmallCallBack sudGameSmallCallBack, int position) {
// layout.post(new Runnable() {
// @Override
// public void run() {
// RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// params.width = DeviceUtils.getScreenWidth((Activity) itemView.getContext()) / 7;
// layout.setLayoutParams(params);
// }
// });
if (sudGameUserModel.isNullUser()) {
vacancy_sud_game.setVisibility(View.VISIBLE);
user_layout.setVisibility(View.GONE);
ViewClicksAntiShake.clicksAntiShake(vacancy_sud_game, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
Bus.get().post(sudGameUserModel);
}
});
} else {
vacancy_sud_game.setVisibility(View.GONE);
user_layout.setVisibility(View.VISIBLE);
ImgLoader.display2(itemView.getContext(), sudGameUserModel.getAvatar(), sud_game_user);
if (sudGameUserModel.getMicStatus() == 2) {
ImgLoader.display2(itemView.getContext(), R.mipmap.icon_game_open_wheat, mic_status);
} else if (sudGameUserModel.getMicStatus() == 3) {
ImgLoader.display2(itemView.getContext(), R.mipmap.icon_game_close_wheat, mic_status);
}
if (sudGameUserModel.isMute()) {
ImgLoader.display2(itemView.getContext(), R.mipmap.icon_game_close_wheat_mute, mic_status);
}
ViewClicksAntiShake.clicksAntiShake(user_layout, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
XPopup.Builder builder = new XPopup.Builder(itemView.getContext()).atView(user_layout);
builder.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Bottom)
.asCustom(new SudGameSmallPopupPindow(itemView.getContext(),
sudGameUserModel,
sudGameUserModel.isMute(),
new SudGameSmallPopupPindow.SudGameSmallCallBack() {
@Override
public void unMute() {
sudGameSmallCallBack.unMute(sudGameUserModel.getId() + "", position);
}
@Override
public void mute() {
sudGameSmallCallBack.mute(sudGameUserModel.getId() + "", position);
}
@Override
public void viewInformation(SudGameUserModel sudGameUserModel) {
sudGameSmallCallBack.viewInformation(sudGameUserModel);
}
})).show();
}
});
}
}
}

View File

@ -1,4 +1,4 @@
package com.yunbao.live.custom;
package com.yunbao.common.views;
import android.graphics.Canvas;
import android.graphics.Color;

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topRightRadius="12dp" android:topLeftRadius="12dp"/>
<solid android:color="#E6E9E9E9" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp"/>
<solid android:color="#fff" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp" />
<solid android:color="#CC414141" />
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomRightRadius="20dp"
android:topRightRadius="20dp" />
<solid android:color="#333333" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="19dp" />
<solid android:color="#B3414141" />
</shape>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_selected="false">
<shape>
<solid android:color="#0000" />
</shape>
</item>
<item android:state_selected="true">
<shape>
<solid android:color="#252525" />
</shape>
</item>
</selector>

View 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>

View 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>

View 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>

View File

@ -1,57 +1,10 @@
<?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"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#201E1A"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="44dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/game_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:text="@string/interactive_game_create_room"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="16dp"
android:src="@mipmap/icon_interactive_game_create_room_seats"
android:visibility="gone" />
<ImageView
android:id="@+id/sud_history"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="14dp"
android:src="@mipmap/icon_sud_history_live" />
<TextView
android:id="@+id/exit"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/bg_live_sud_game_back"
android:gravity="center"
android:text="@string/video_exit"
android:textColor="#FFFFFF"
android:textSize="8sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -61,73 +14,149 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="175dp"
android:layout_height="50dp"
android:layout_marginStart="15dp"
android:layout_marginTop="16dp"
android:background="@drawable/bg_live_sud_game_top"
android:gravity="center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="6dp"
android:scaleType="centerCrop"
android:visibility="gone"
app:riv_oval="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="4dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_number"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginStart="23dp"
android:layout_marginTop="25dp"
android:background="@drawable/bg_live_sud_game_top_new"
android:gravity="center">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/room_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ID:"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/room_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/interactive_game_create_room_number"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="29dp"
android:layout_marginEnd="20dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/sud_history"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="14dp"
android:src="@mipmap/icon_sud_history_live_new" />
<TextView
android:id="@+id/exit"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/bg_live_sud_game_back_new"
android:gravity="center"
android:text="@string/video_exit"
android:textColor="#FFFFFF"
android:textSize="8sp" />
</LinearLayout>
<LinearLayout
android:layout_width="137dp"
android:layout_height="34dp"
android:layout_gravity="bottom"
android:layout_marginStart="12dp"
android:layout_marginBottom="35dp">
<TextView
android:id="@+id/game_review_input"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_live_sud_game_bottom_input"
android:gravity="center"
android:text="@string/game_review_input"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="12dp"
android:layout_marginBottom="35dp"
android:animateLayoutChanges="true">
<ImageView
android:id="@+id/game_close_wheat"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/icon_game_close_wheat" />
<ImageView
android:id="@+id/game_seat"
android:layout_width="34dp"
android:layout_height="34dp"
android:src="@mipmap/icon_game_seat" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/chat_list"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_gravity="bottom"
android:layout_marginBottom="75dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="80dp"
android:gravity="center">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_list"
android:layout_width="wrap_content"
android:layout_height="50dp" />
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginBottom="50dp"
android:gravity="center_horizontal"
android:padding="20dp"
android:text="@string/dialog_tip"
android:textColor="@color/textColor"
android:textSize="15sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="30dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_cancel"
android:layout_width="100dp"
android:layout_height="35dp"
android:background="@mipmap/icon_del_sys_confirm"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/sys_msg_cancel"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/btn_confirm"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginLeft="30dp"
android:background="@mipmap/icon_del_sys_cancel"
android:gravity="center"
android:paddingBottom="2dp"
android:text="@string/confirm"
android:textColor="@color/yellow_ff6c00"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

View File

@ -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" />

View File

@ -0,0 +1,30 @@
<?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="51dp"
android:background="@drawable/background_sud_game_input">
<EditText
android:id="@+id/text_message"
android:layout_width="match_parent"
android:layout_marginEnd="100dp"
android:layout_height="38dp"
android:layout_marginStart="15dp"
android:paddingStart="8dp"
android:layout_gravity="center_vertical"
android:background="@drawable/background_sud_game_input_edit_text"
android:hint="@string/live_say_something"
android:textColorHint="@color/gray3" />
<TextView
android:id="@+id/send"
android:layout_width="60dp"
android:layout_height="38dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="20dp"
android:background="@mipmap/icon_send_game"
android:gravity="center"
android:text="@string/send"
android:textColor="@color/white"
android:textSize="16sp" />
</FrameLayout>

View 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>

View 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>

View 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>

View 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>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="50dp"
android:layout_height="25dp"
app:cardBackgroundColor="#0F0B14"
app:cardCornerRadius="4dp"
app:cardElevation="16dp">
<TextView
android:id="@+id/del"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/delete"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</androidx.cardview.widget.CardView>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="283dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp">
<TextView
android:id="@+id/chat_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="9dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="70dp"
android:layout_height="110dp"
android:background="@mipmap/backgroud_sud_game_small_window"
android:orientation="vertical">
<TextView
android:id="@+id/view_information"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="8dp"
android:background="@drawable/bg_live_sud_list_select_item2"
android:gravity="center"
android:text="@string/game_review_view_information"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/view_un_mute"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="2dp"
android:background="@drawable/bg_live_sud_list_select_item2"
android:gravity="center"
android:text="@string/game_review_view_unmute"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<ImageView
android:id="@+id/vacancy_sud_game"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginStart="12dp"
android:src="@mipmap/icon_vacancy_sud_game"
android:visibility="visible" />
<FrameLayout
android:id="@+id/user_layout"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:visibility="visible">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/sud_game_user"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_vacancy_sud_game"
app:riv_oval="true" />
<ImageView
android:id="@+id/mic_status"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:src="@mipmap/icon_game_close_wheat_mute" />
</FrameLayout>
</LinearLayout>

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Some files were not shown because too many files have changed in this diff Show More