合并声网代码
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
|
||||
android {
|
||||
@@ -13,7 +14,7 @@ android {
|
||||
versionName rootProject.ext.android.versionName
|
||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||
}
|
||||
|
||||
javaCompileOptions {
|
||||
@@ -248,6 +249,7 @@ dependencies {
|
||||
api 'com.github.FlyJingFish:GradientTextView:1.2.4'
|
||||
//轮播 一屏显示多个
|
||||
api 'com.github.xiaohaibin:XBanner:androidx_v1.2.6'
|
||||
|
||||
|
||||
//声网SDK
|
||||
//api 'io.agora.rtc:agora-special-full:4.2.6.245'
|
||||
api 'com.xj.marqueeView:marqueeView:0.1.20'
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class CommonAppConfig {
|
||||
//是否为插件包模式
|
||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||
public static final String BUILD_TIME = getMetaDataString("BUILD_TIME");
|
||||
public static final boolean IS_SW_RELEASE = getMetaDataBoolean("SW_RELEASE_MODEL");
|
||||
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
@@ -79,7 +80,29 @@ public class CommonAppConfig {
|
||||
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
||||
public static int alert_time = 1;
|
||||
public static int alert_end_time = 1;
|
||||
public static String SWToken = ""; //声网Token
|
||||
public static final String SWChannelPrefix = "g";
|
||||
//测试服
|
||||
public static final String SWAPPId_debug = "4cf0376582d742ac8a96778b25b1079e";
|
||||
//正式服
|
||||
public static final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21";
|
||||
|
||||
public static String getSwAppId() {
|
||||
if (IS_SW_RELEASE) {
|
||||
return SWAPPId;
|
||||
} else {
|
||||
return SWAPPId_debug;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取通道
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getChannelName() {
|
||||
return SWChannelPrefix + getInstance().getUid();
|
||||
}
|
||||
|
||||
private CommonAppConfig() {
|
||||
|
||||
|
||||
@@ -269,7 +269,9 @@ public class Constants {
|
||||
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;//腾讯推流
|
||||
public static final int LIVE_SDK_SW = 2;//声网
|
||||
|
||||
public static final String LIVE_SDK_IS_SW = "liveSdkIsSw"; //是否是聲網
|
||||
|
||||
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
||||
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
||||
|
||||
@@ -435,7 +435,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk),isSw);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -40,12 +40,15 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private final int RECOMMEND = 5;
|
||||
private String liveId;
|
||||
private boolean mIs_shengwang;
|
||||
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
|
||||
public CustomDrawerPopupAdapter(Context mContext) {
|
||||
public CustomDrawerPopupAdapter(Context mContext,boolean mIs_shengwang) {
|
||||
this.mContext = mContext;
|
||||
this.mIs_shengwang = mIs_shengwang;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +117,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
map.put("num", "9");
|
||||
map.put("live_recommend", "sidebar");
|
||||
map.put("refresh", "1");
|
||||
map.put(" is_shengwang", mIs_shengwang?"1":"0");
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
|
||||
public class CheckLiveModel extends BaseModel {
|
||||
|
||||
@@ -13,6 +14,16 @@ public class CheckLiveModel extends BaseModel {
|
||||
private String typeMsg;
|
||||
@SerializedName("live_sdk")
|
||||
private String liveSdk;
|
||||
@SerializedName("is_shengwang")
|
||||
private String isShengwang;
|
||||
|
||||
public String getIsShengwang() {
|
||||
return isShengwang;
|
||||
}
|
||||
|
||||
public void setIsShengwang(String isShengwang) {
|
||||
this.isShengwang = isShengwang;
|
||||
}
|
||||
|
||||
public static CheckLiveModel objectFromData(String str) {
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -59,6 +61,9 @@ public class ConfigBean extends BaseModel {
|
||||
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
||||
private String txVideoUgcKey;
|
||||
private String google_isup;
|
||||
|
||||
private String sud_game_speech;
|
||||
|
||||
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
||||
private String isReturnUser="";
|
||||
@SerializedName("popup_img_url")//弹窗图片地址
|
||||
@@ -182,6 +187,20 @@ public class ConfigBean extends BaseModel {
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
public boolean isSw(){
|
||||
return getSud_game_speech().equals("1");
|
||||
}
|
||||
|
||||
@JSONField(name = "sud_game_speech")
|
||||
public String getSud_game_speech() {
|
||||
return sud_game_speech;
|
||||
}
|
||||
|
||||
public void setSud_game_speech(String sud_game_speech) {
|
||||
this.sud_game_speech = sud_game_speech;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_ver")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
|
||||
@@ -114,6 +114,17 @@ public class EnterRoomInfoModel extends BaseModel {
|
||||
@SerializedName("gift_wall_lighten_total")
|
||||
private String giftWallLightenTotal;
|
||||
|
||||
@SerializedName("connection_info")
|
||||
private LivePkMicModel connectionInfo;
|
||||
|
||||
public LivePkMicModel getConnectionInfo() {
|
||||
return connectionInfo;
|
||||
}
|
||||
|
||||
public void setConnectionInfo(LivePkMicModel connectionInfo) {
|
||||
this.connectionInfo = connectionInfo;
|
||||
}
|
||||
|
||||
public String getGiftWallLightenNumber() {
|
||||
return giftWallLightenNumber;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public class EnterRoomNewModel extends BaseModel {
|
||||
private SudGameDateModel sudGameDateModel;
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||
@SerializedName("sendMoneyLongStatus")
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LivePkMicModel extends BaseModel {
|
||||
@SerializedName("pkuid")
|
||||
private String pkuid;
|
||||
@SerializedName("pkuname")
|
||||
private String pkuname;
|
||||
@SerializedName("pkuimg")
|
||||
private String pkuimg;
|
||||
|
||||
public String getPkuid() {
|
||||
return pkuid;
|
||||
}
|
||||
|
||||
public void setPkuid(String pkuid) {
|
||||
this.pkuid = pkuid;
|
||||
}
|
||||
|
||||
public String getPkuname() {
|
||||
return pkuname;
|
||||
}
|
||||
|
||||
public void setPkuname(String pkuname) {
|
||||
this.pkuname = pkuname;
|
||||
}
|
||||
|
||||
public String getPkuimg() {
|
||||
return pkuimg;
|
||||
}
|
||||
|
||||
public void setPkuimg(String pkuimg) {
|
||||
this.pkuimg = pkuimg;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.text.ParseException;
|
||||
@@ -22,6 +21,8 @@ public class OpenAdModel extends BaseModel {
|
||||
public static final int SHOW_ONE = 3;//3. 仅弹出一次;
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("popup_name")
|
||||
private String name;
|
||||
@SerializedName("popup_location")
|
||||
private int type = TYPE_HOME;
|
||||
@SerializedName("activity_url")
|
||||
@@ -35,24 +36,27 @@ public class OpenAdModel extends BaseModel {
|
||||
@SerializedName("popup_model")
|
||||
private int model = MODEL_SQUARE;
|
||||
@SerializedName("start_show_time")
|
||||
private String startTime;//活动开始时间
|
||||
private String startTime;//活动开始时间 1
|
||||
@SerializedName("end_show_time")
|
||||
private String endTime;//活动结束时间
|
||||
private String endTime;//活动结束时间 5
|
||||
@SerializedName("popup_permission")
|
||||
private int permission;
|
||||
@SerializedName("popup_frequency")
|
||||
private int showModel = SHOW_DEF;//显示模式,1:杀死程序后弹出 2:指定时间内(本机时间) 3:1. 仅弹出一次
|
||||
@SerializedName("popup_frequency_time")
|
||||
private String section = "0";// SHOW_DEF = 2
|
||||
|
||||
private String section = "0";// SHOW_DEF = 2 1
|
||||
@SerializedName("popup_sort")
|
||||
private int popupSort = 1;//弹框类型 1.图片 2.H5
|
||||
@SerializedName("sort")
|
||||
private int sort = 0;
|
||||
|
||||
public OpenAdModel() {
|
||||
}
|
||||
|
||||
public static OpenAdModel createTestData() {
|
||||
OpenAdModel model = new OpenAdModel();
|
||||
model.id=3;
|
||||
model.type=1;
|
||||
model.id = 3;
|
||||
model.type = 1;
|
||||
model.url = "/h5/GuildTournament/20230821/rank.html";
|
||||
model.imageUrl = "https://ceshi.yaoulive.com/data/upload/20230913/1694589490.png";
|
||||
model.showTime = 10;
|
||||
@@ -66,6 +70,30 @@ public class OpenAdModel extends BaseModel {
|
||||
return model;
|
||||
}
|
||||
|
||||
public int getPopupSort() {
|
||||
return popupSort;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public void setPopupSort(int popupSort) {
|
||||
this.popupSort = popupSort;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getShowModel() {
|
||||
return showModel;
|
||||
}
|
||||
@@ -91,12 +119,13 @@ public class OpenAdModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
if (!url.startsWith("http://") || !url.startsWith("https://")) {
|
||||
url = CommonAppConfig.HOST + url;
|
||||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||
url = CommonAppConfig.HOST + (url.startsWith("/") ? url : "/" + url);
|
||||
}
|
||||
return url + "?t=" + System.currentTimeMillis() / 1000;
|
||||
return url;
|
||||
}
|
||||
public String getOriginalUrl(){
|
||||
|
||||
public String getOriginalUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -198,6 +227,7 @@ public class OpenAdModel extends BaseModel {
|
||||
public String toString() {
|
||||
return "OpenAdModel{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", type=" + type +
|
||||
", url='" + url + '\'' +
|
||||
", imageUrl='" + imageUrl + '\'' +
|
||||
@@ -206,7 +236,10 @@ public class OpenAdModel extends BaseModel {
|
||||
", model=" + model +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", permission='" + permission + '\'' +
|
||||
", permission=" + permission +
|
||||
", showModel=" + showModel +
|
||||
", section='" + section + '\'' +
|
||||
", sort=" + popupSort +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
/**
|
||||
* 声网token
|
||||
*/
|
||||
public class SwTokenModel extends BaseModel {
|
||||
private String token;
|
||||
|
||||
public SwTokenModel() {
|
||||
}
|
||||
|
||||
public SwTokenModel(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
@@ -153,8 +154,6 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
.asCustom(new SudGameListSelectPopup(getContext(), 4, customSidebarChildModels, interactionID))
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.room_back),
|
||||
@@ -282,7 +281,11 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (isHome) {
|
||||
dialog.dismiss();
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(data));
|
||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data),true,isHome);
|
||||
}else{
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data),true,isHome);
|
||||
}
|
||||
} else {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
|
||||
|
||||
@@ -21,13 +21,14 @@ import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
|
||||
public class DebugDialog {
|
||||
RecyclerView recyclerView;
|
||||
HashMap<String, View> params;
|
||||
LinkedHashMap<String, View> params;
|
||||
DebugDialogAdapter adapter;
|
||||
private static DebugDialog debugDialog;
|
||||
Context mContext;
|
||||
@@ -70,7 +71,7 @@ public class DebugDialog {
|
||||
this.runnable = runnable;
|
||||
if (params == null) {
|
||||
Log.i("debug弹窗", "DebugDialog: 初始化参数");
|
||||
params = new HashMap<>();
|
||||
params = new LinkedHashMap<>();
|
||||
}
|
||||
init();
|
||||
}
|
||||
@@ -103,6 +104,7 @@ public class DebugDialog {
|
||||
}
|
||||
|
||||
public void show() {
|
||||
if (recyclerView != null) return;
|
||||
if (showPattern == ShowPattern.CURRENT_ACTIVITY) {
|
||||
createView();
|
||||
return;
|
||||
@@ -138,7 +140,7 @@ public class DebugDialog {
|
||||
EasyFloat.updateFloat("debug");
|
||||
}
|
||||
});
|
||||
params.put("debug弹窗", textView);
|
||||
params.put("发包时间:" + CommonAppConfig.BUILD_TIME, textView);
|
||||
params.put("发包时间:" + CommonAppConfig.BUILD_TIME, buildTime);
|
||||
adapter.setParamMap(params);
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -9,12 +13,21 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
private ImageView mImageView;
|
||||
private ImageView mClose;
|
||||
private LinearLayout contentLayout;
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
|
||||
@@ -27,6 +40,11 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.animationDuration(0);
|
||||
builder.hasShadowBg(true);
|
||||
if(model.getPopupSort()==2){
|
||||
builder.dismissOnTouchOutside(false);
|
||||
builder.dismissOnBackPressed(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,8 +69,63 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
mImageView = findViewById(R.id.img);
|
||||
contentLayout = findViewById(R.id.content_layout);
|
||||
mClose = findViewById(R.id.close);
|
||||
if (model.getPopupSort() == 1) {
|
||||
setImage();
|
||||
} else {
|
||||
setWeb();
|
||||
}
|
||||
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||
}
|
||||
}
|
||||
|
||||
private void setWeb() {
|
||||
WebView mWebView = new WebView(mContext);
|
||||
mWebView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext((Activity) mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||
mWebView.setHorizontalScrollBarEnabled(false);
|
||||
mWebView.setVerticalScrollBarEnabled(false);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
L.e("H5-------->" + url);
|
||||
view.loadUrl(url);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
}
|
||||
});
|
||||
String url=model.getUrl();
|
||||
if(url.contains("?")){
|
||||
url+="&uid="+ IMLoginManager.get(mContext).getUserInfo().getId()+"&token="+IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||
}else{
|
||||
url+="?uid="+ IMLoginManager.get(mContext).getUserInfo().getId()+"&token="+IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
contentLayout.addView(mWebView);
|
||||
}
|
||||
|
||||
private void setImage() {
|
||||
int width = ScreenDimenUtil.getInstance().getScreenWdith();
|
||||
int height = (int) (width * 1.4);
|
||||
|
||||
ImageView mImageView = new ImageView(mContext);
|
||||
mImageView.setLayoutParams(new LinearLayout.LayoutParams(width, height));
|
||||
mImageView.setOnClickListener(v -> {
|
||||
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
|
||||
if (mListener != null) {
|
||||
@@ -61,10 +134,12 @@ public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||
}
|
||||
contentLayout.addView(mImageView);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,44 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowInsets;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lzf.easyfloat.enums.ShowPattern;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
private ImageView mImageView;
|
||||
private LinearLayout contentLayout;
|
||||
private ImageView mClose;
|
||||
private OpenAdModel model;
|
||||
private OnItemClickListener<OpenAdModel> mListener;
|
||||
@@ -39,7 +59,8 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
builder.hasShadowBg(false);
|
||||
builder.hasShadowBg(true);
|
||||
builder.shadowBgColor(Color.parseColor("#80000000"));
|
||||
builder.animationDuration(0);
|
||||
}
|
||||
|
||||
@@ -61,12 +82,103 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e("-----弹窗-----", "onCreate: 创建弹窗" );
|
||||
mImageView = findViewById(R.id.img);
|
||||
Log.e("-----弹窗-----", "onCreate: 创建弹窗");
|
||||
contentLayout = findViewById(R.id.content_layout);
|
||||
mClose = findViewById(R.id.close);
|
||||
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
|
||||
|
||||
|
||||
contentLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
boolean isShow = false;
|
||||
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
if (isShow)
|
||||
return;
|
||||
isShow = true;
|
||||
int width = contentLayout.getWidth() - DpUtil.dp2px(20);
|
||||
int height = (int) (width * 1.5);
|
||||
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||
height = (int) (width * 1.2);
|
||||
}
|
||||
Log.i("-----弹窗-----", "高度:" + height + " 宽度:" + width + " 屏幕宽度: " + ScreenDimenUtil.getInstance().getScreenWdith());
|
||||
/*DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() {
|
||||
@Override
|
||||
public void run(DebugDialog dialog) {
|
||||
dialog.setShowPattern(ShowPattern.ALL_TIME);
|
||||
dialog.show();
|
||||
int width = contentLayout.getWidth() - DpUtil.dp2px(10);
|
||||
int height = (int) (width * 1.5);
|
||||
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||
height = (int) (width * 1.2);
|
||||
}
|
||||
Log.i("-----弹窗-----", "弹框debug高宽 高度:" + height + " 宽度:" + width);
|
||||
dialog.setParams(model.getName() + "弹框高宽", "高度:" + height + " 宽度:" + width);
|
||||
}
|
||||
});*/
|
||||
if (model.getPopupSort() == 1) {
|
||||
setImage(model, width, height);
|
||||
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
|
||||
} else {
|
||||
setWeb(model, width, height);
|
||||
}
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(OpenAdCenterDialogPopup.this::dismiss, model.getShowTime());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setWeb(OpenAdModel model, int width, int height) {
|
||||
WebView mWebView = new WebView(mContext);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, height);
|
||||
params.gravity = Gravity.CENTER;
|
||||
mWebView.setLayoutParams(params);
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext((Activity) mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||
mWebView.setHorizontalScrollBarEnabled(false);
|
||||
mWebView.setVerticalScrollBarEnabled(false);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
L.e("H5-------->" + url);
|
||||
view.loadUrl(url);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
}
|
||||
});
|
||||
String url = model.getUrl();
|
||||
if (url.contains("?")) {
|
||||
url += "&uid=" + IMLoginManager.get(mContext).getUserInfo().getId() + "&token=" + IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||
} else {
|
||||
url += "?uid=" + IMLoginManager.get(mContext).getUserInfo().getId() + "&token=" + IMLoginManager.get(mContext).getUserInfo().getToken();
|
||||
}
|
||||
Log.i("-----弹窗-----", "setWeb: " + url);
|
||||
mWebView.loadUrl(url);
|
||||
contentLayout.addView(mWebView);
|
||||
}
|
||||
|
||||
private void setImage(OpenAdModel model, int width, int height) {
|
||||
mImageView = new ImageView(mContext);
|
||||
mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, height);
|
||||
params.gravity = Gravity.CENTER;
|
||||
mImageView.setLayoutParams(params);
|
||||
|
||||
mImageView.setOnClickListener(v -> {
|
||||
if("home_page_banner_battle".equals(model.getOriginalUrl())){
|
||||
if ("home_page_banner_battle".equals(model.getOriginalUrl())) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
dismiss();
|
||||
return;
|
||||
@@ -78,19 +190,12 @@ public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mClose.setOnClickListener(v -> dismiss());
|
||||
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
|
||||
int width = ScreenDimenUtil.getInstance().getScreenWdith() - DpUtil.dp2px(40);
|
||||
int height = (int) (width * 1.4);
|
||||
if (model.getModel() == OpenAdModel.MODEL_SQUARE) {
|
||||
height = width;
|
||||
}
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) mImageView.getLayoutParams();
|
||||
params.width = width;
|
||||
params.height = height;
|
||||
mImageView.setLayoutParams(params);
|
||||
if (model.getShowTime() > 0) {
|
||||
mClose.postDelayed(this::dismiss, model.getShowTime());
|
||||
}
|
||||
contentLayout.addView(mImageView);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,15 @@ public class SudGameSocketImEvent extends BaseModel {
|
||||
private String method;
|
||||
@SerializedName("equipment")
|
||||
private String equipment;
|
||||
private String time;
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
|
||||
@@ -768,7 +768,7 @@ public class LiveHttpUtil {
|
||||
* @param file 封面图片文件
|
||||
* @param callback
|
||||
*/
|
||||
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, int clarityType, HttpCallback callback) {
|
||||
public static void newcreateRoom(String title, int liveClassId, int type, int typeVal, File file, int clarityType,boolean isSw, HttpCallback callback) {
|
||||
|
||||
PostRequest<JsonBean> request = HttpClient.getInstance().post("Live.createRoom2", LiveHttpConsts.CREATE_ROOM)
|
||||
.params("title", title)
|
||||
@@ -777,6 +777,7 @@ public class LiveHttpUtil {
|
||||
.params("landscape", "2")
|
||||
.params("class_type", "0")
|
||||
.params("type_val", typeVal)
|
||||
.params("is_shengwang",isSw?1:0)
|
||||
.params("clarityType", clarityType);
|
||||
if (file != null) {
|
||||
request.params("file", file);
|
||||
@@ -821,6 +822,15 @@ public class LiveHttpUtil {
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否是声网开播
|
||||
* @param callback
|
||||
*/
|
||||
public static void getIsSw(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.setRtcFirm", "Tx.setRtcFirm")
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 腾讯sdk 跟主播连麦时,获取主播的低延时流
|
||||
*/
|
||||
|
||||
@@ -84,6 +84,7 @@ 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.SwTokenModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
@@ -230,7 +231,7 @@ public interface PDLiveApi {
|
||||
);
|
||||
|
||||
/**
|
||||
* 关注主播
|
||||
* 关注主播···································································
|
||||
*
|
||||
* @param liveuid
|
||||
* @return
|
||||
@@ -1376,5 +1377,6 @@ public interface PDLiveApi {
|
||||
@Query("to_uid")String toUid,
|
||||
@Query("payload")String payload
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Tx.getShengwangToken")
|
||||
Observable<ResponseModel<SwTokenModel>> getSwToken();
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ 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.SwTokenModel;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
@@ -3949,6 +3950,30 @@ public class LiveNetManager {
|
||||
}
|
||||
|
||||
|
||||
public void getSwToken( HttpCallback<SwTokenModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getSwToken()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<SwTokenModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<SwTokenModel> 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();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -96,27 +96,27 @@ public class MainNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*
|
||||
* @param num 请求数量
|
||||
* @return
|
||||
*/
|
||||
public void anchorRecommend(String num, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(num)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(anchorRecommendModelResponseModel -> {
|
||||
if (httpCallback != null) {
|
||||
AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
|
||||
httpCallback.onSuccess(model);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (httpCallback != null) {
|
||||
httpCallback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
// /**
|
||||
// * 猜你喜欢
|
||||
// *
|
||||
// * @param num 请求数量
|
||||
// * @return
|
||||
// */
|
||||
// public void anchorRecommend(String num, String is_shengwang,HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
// API.get().pdLiveApi(mContext).anchorRecommend(num,is_shengwang)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(anchorRecommendModelResponseModel -> {
|
||||
// if (httpCallback != null) {
|
||||
// AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
|
||||
// httpCallback.onSuccess(model);
|
||||
// }
|
||||
// }, throwable -> {
|
||||
// if (httpCallback != null) {
|
||||
// httpCallback.onError(throwable.getMessage());
|
||||
// }
|
||||
// }).isDisposed();
|
||||
// }
|
||||
|
||||
public void anchorRecommend(Map<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||
@@ -140,11 +140,12 @@ public class MainNetManager {
|
||||
* @param num 请求数量
|
||||
* @return
|
||||
*/
|
||||
public void anchorRecommendType(String num, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
public void anchorRecommendType(String num, String is_shengwang,HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("num", num);
|
||||
map.put("live_recommend", "slide");
|
||||
map.put("type", "1");
|
||||
map.put(" is_shengwang", is_shengwang);
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import com.lzf.easyfloat.enums.ShowPattern;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.OpenAdModel;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.dialog.OpenAdBottomDialogPopup;
|
||||
import com.yunbao.common.dialog.OpenAdCenterDialogPopup;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class OpenAdManager {
|
||||
public static final int TYPE_HOME = 1;
|
||||
@@ -28,19 +37,34 @@ public class OpenAdManager {
|
||||
private Map<Integer, Boolean> showMap;
|
||||
private List<OpenAdModel> list = null;
|
||||
private Handler handler = new Handler(Looper.getMainLooper());
|
||||
private Map<Integer, AdRunnable> runnableMap = new HashMap<>();
|
||||
private Map<Integer, AdRunnable> runnableMap = new LinkedHashMap<>();
|
||||
private Map<AdRunnable, Integer> waitRunnableMap = new LinkedHashMap<>();//等待运行的弹窗
|
||||
private int showType;
|
||||
private WeakReference<AdRunnable> runNowRunnable;
|
||||
private static final boolean IS_QUEUE_SHOW = true;//是否按队列显示弹窗,true就会等待上一个弹窗关闭后弹出,false就按原逻辑顺序直接弹出
|
||||
|
||||
private OpenAdManager() {
|
||||
showMap = new HashMap<>();
|
||||
init(false);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
public void close() {
|
||||
dismiss();
|
||||
clear();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
runnableMap.clear();
|
||||
showMap.clear();
|
||||
list.clear();
|
||||
waitRunnableMap.clear();
|
||||
list = null;
|
||||
runNowRunnable = null;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
Log.i(TAG, "reset: ");
|
||||
next();
|
||||
}
|
||||
|
||||
private static final class MInstanceHolder {
|
||||
@@ -55,13 +79,14 @@ public class OpenAdManager {
|
||||
if (list != null && list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Context context = CommonAppContext.getTopActivity();
|
||||
Context context = AppManager.getInstance().getMainActivity();
|
||||
if (context == null) {
|
||||
context = CommonAppContext.sInstance;
|
||||
}
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
LiveNetManager.get(context).activityPopup(new HttpCallback<List<OpenAdModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<OpenAdModel> data) {
|
||||
@@ -70,21 +95,34 @@ public class OpenAdManager {
|
||||
list = new ArrayList<>();
|
||||
return;
|
||||
}
|
||||
Collections.sort(data, new AdListComparator());
|
||||
list = data;
|
||||
if (isShow) {
|
||||
show(TYPE_HOME, false);
|
||||
if (showType == 0) {
|
||||
show(TYPE_HOME, false);
|
||||
} else {
|
||||
show(showType, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
System.err.println("弹框列表:" + error);
|
||||
Log.e(TAG, "弹框列表:" + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static long showTime=0;
|
||||
private static long showTime = 0;
|
||||
private OnItemClickListener<String> onItemClickListener=new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
public synchronized void show(int type, boolean isGuard) {
|
||||
showType = type;
|
||||
if(true){
|
||||
//潘多拉不需要彈窗
|
||||
return;
|
||||
@@ -93,16 +131,32 @@ public class OpenAdManager {
|
||||
init(true);
|
||||
return;
|
||||
}
|
||||
if(System.currentTimeMillis()-showTime<100){
|
||||
Log.i(TAG, "show: 调用显示 " + type + " " + isGuard);
|
||||
if (System.currentTimeMillis() - showTime < 100) {
|
||||
return;
|
||||
}
|
||||
showTime=System.currentTimeMillis();
|
||||
showType = type;
|
||||
/*DebugDialog.getInstance(new DebugDialog.DebugDialogRunnable() {
|
||||
@Override
|
||||
public void run(DebugDialog dialog) {
|
||||
dialog.setShowPattern(ShowPattern.ALL_TIME);
|
||||
dialog.show();
|
||||
onItemClickListener = new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
dialog.setParams(bean, "剩余:" + position);
|
||||
}
|
||||
};
|
||||
}
|
||||
});*/
|
||||
showTime = System.currentTimeMillis();
|
||||
waitRunnableMap.clear();
|
||||
runnableMap.clear();
|
||||
runNowRunnable = null;
|
||||
for (OpenAdModel model : list) {
|
||||
if (model.getType() == type) {
|
||||
if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) {
|
||||
/* if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) {
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
if (model.getShowModel() == OpenAdModel.SHOW_ONE) {
|
||||
if (SpUtil.getInstance().getBooleanValue("open_ad_popup_" + model.getId())) {
|
||||
continue;
|
||||
@@ -126,13 +180,22 @@ public class OpenAdManager {
|
||||
|
||||
if (!isShow(model)) {
|
||||
Log.i(TAG, "show: " + model);
|
||||
handler.postDelayed(new AdRunnable(model), model.getDelayShowTime());
|
||||
if (IS_QUEUE_SHOW) {
|
||||
waitRunnableMap.put(new AdRunnable(model), model.getDelayShowTime());
|
||||
} else {
|
||||
handler.postDelayed(new AdRunnable(model), model.getDelayShowTime());
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "notshow: " + model);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Log.i(TAG, "show: 循环完毕,调用next");
|
||||
if (IS_QUEUE_SHOW) {
|
||||
onItemClickListener.onItemClick("接口返回需要展示的弹窗数:", waitRunnableMap.size());
|
||||
next();
|
||||
}
|
||||
Log.i(TAG, "------------------------------");
|
||||
|
||||
}
|
||||
@@ -148,6 +211,9 @@ public class OpenAdManager {
|
||||
}
|
||||
}
|
||||
runnableMap.clear();
|
||||
if (runNowRunnable != null && runNowRunnable.get() != null) {
|
||||
handler.removeCallbacks(runNowRunnable.get());
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized boolean isShow(OpenAdModel type) {
|
||||
@@ -157,11 +223,45 @@ public class OpenAdManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
int getNowType() {
|
||||
Activity lastActivity = AppManager.getInstance().getLastActivity();
|
||||
if (lastActivity == null) {
|
||||
return -1;
|
||||
}
|
||||
if (AppManager.getInstance().isLiveActivity()) {
|
||||
return TYPE_LIVE;
|
||||
} else if (AppManager.getInstance().isMainActivity()) {
|
||||
return TYPE_HOME;
|
||||
}
|
||||
return -2;
|
||||
}
|
||||
|
||||
void next() {
|
||||
Log.i(TAG, "next: 剩余数" + waitRunnableMap.size());
|
||||
if (waitRunnableMap.isEmpty()) return;
|
||||
for (AdRunnable next : waitRunnableMap.keySet()) {
|
||||
Log.i(TAG, "next: " + next.model);
|
||||
if (next.model.getType() == getNowType()) {
|
||||
Integer i = waitRunnableMap.get(next);
|
||||
if (i == null) {
|
||||
i = 0;
|
||||
}
|
||||
onItemClickListener.onItemClick("当前加载id:" + next.model.getId() + " " + next.model.getName() + " 延迟展示时间:" + i, (waitRunnableMap.size() - 1));
|
||||
handler.postDelayed(next, i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class AdRunnable implements Runnable {
|
||||
OpenAdModel model;
|
||||
AdRunnable runnable;
|
||||
|
||||
public AdRunnable(OpenAdModel model) {
|
||||
this.model = model;
|
||||
this.runnable = this;
|
||||
runNowRunnable = new WeakReference<>(this);
|
||||
runnableMap.put(model.getId(), this);
|
||||
}
|
||||
|
||||
@@ -174,37 +274,101 @@ public class OpenAdManager {
|
||||
Log.i(TAG, "run: " + model);
|
||||
if (model == null) {
|
||||
ToastUtil.showDebug("model为空");
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!model.isInTime()) {
|
||||
ToastUtil.showDebug("不在展示时间内:" + model.getStartTime() + "|" + model.getEndTime());
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (isShow(model)) {
|
||||
ToastUtil.showDebug(model.getId() + "|model展示过了");
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (model.getType() != showType) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(isShow(model)){
|
||||
Log.i(TAG,"展示过:"+model);
|
||||
if (isShow(model)) {
|
||||
Log.i(TAG, "展示过:" + model);
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (model.getType() == OpenAdModel.TYPE_HOME && !AppManager.getInstance().isMainActivity()) {
|
||||
Log.i(TAG, "首页类型弹窗,但当前不是首页");
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
if (model.getType() == TYPE_LIVE && !AppManager.getInstance().isLiveActivity()) {
|
||||
Log.i(TAG, "直播类型弹窗,但当前不是直播");
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick("", -2);
|
||||
}
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
|
||||
showMap.put(model.getId(), true);
|
||||
if (model.getShowModel() == OpenAdModel.SHOW_DIY) {
|
||||
String nextTime= String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000));
|
||||
String nextTime = String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000));
|
||||
SpUtil.setStringValue("open_ad_popup_time_" + model.getId(), nextTime);
|
||||
Log.i(TAG, "run: 下一次展示时间:"+nextTime+" | "+model.getSection());
|
||||
showMap.remove(model.getId());
|
||||
}
|
||||
if (model.getModel() == OpenAdModel.MODEL_BOTTOM) {
|
||||
new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> {
|
||||
new OpenAdBottomDialogPopup(AppManager.getInstance().getLastActivity(), model).setListener((bean, position) -> {
|
||||
Log.i(TAG, "run: 弹框回调:" + position + " id = " + model.getId());
|
||||
if (IS_QUEUE_SHOW) {
|
||||
removeList(bean);
|
||||
if (position == 0) {
|
||||
next();
|
||||
}
|
||||
}
|
||||
}).showDialog();
|
||||
} else {
|
||||
new OpenAdCenterDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> {
|
||||
new OpenAdCenterDialogPopup(AppManager.getInstance().getLastActivity(), model).setListener((bean, position) -> {
|
||||
Log.i(TAG, "run: 弹框回调:" + position + " id = " + model.getId());
|
||||
if (IS_QUEUE_SHOW) {
|
||||
removeList(bean);
|
||||
if (position == 0) {
|
||||
next();
|
||||
}
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
}
|
||||
|
||||
void removeList(OpenAdModel model) {
|
||||
Log.i(TAG, "removeList: " + model);
|
||||
for (AdRunnable next : waitRunnableMap.keySet()) {
|
||||
if (next.model.getId() == model.getId()) {
|
||||
waitRunnableMap.remove(next);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AdListComparator implements Comparator<OpenAdModel> {
|
||||
|
||||
@Override
|
||||
public int compare(OpenAdModel openAdModel, OpenAdModel t1) {
|
||||
return openAdModel.getSort() - t1.getSort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ public class RandomPkManager {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
//ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class GameMicManager {
|
||||
public class GameRyMicManager {
|
||||
MeetingCallback mMeetingCallback = null;
|
||||
private RCRTCRoom mRtcRoom = null;
|
||||
private String mRoomID = "";
|
||||
@@ -367,7 +367,7 @@ public class GameMicManager {
|
||||
RCRTCEngine.getInstance().joinRoom("v" + roomId, roomConfig, new IRCRTCResultDataCallback<RCRTCRoom>() {
|
||||
@Override
|
||||
public void onSuccess(final RCRTCRoom rcrtcRoom) {
|
||||
GameMicManager.this.mRtcRoom = rcrtcRoom;
|
||||
GameRyMicManager.this.mRtcRoom = rcrtcRoom;
|
||||
// 注册房间回调
|
||||
rcrtcRoom.registerRoomListener(roomEventsListener);
|
||||
try {
|
||||
@@ -0,0 +1,569 @@
|
||||
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 GameSwMicManager {
|
||||
MeetingCallback mMeetingCallback = null;
|
||||
private RCRTCRoom mRtcRoom = null;
|
||||
private String mRoomID = "";
|
||||
|
||||
public void setmRoomID(String mRoomID) {
|
||||
this.mRoomID = 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<>();
|
||||
if(mRtcRoom!=null){
|
||||
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) {
|
||||
GameSwMicManager.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", "加入成功");
|
||||
enterRoom();
|
||||
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String lastTime = "";
|
||||
|
||||
/**
|
||||
* 处理游戏房Im消息
|
||||
*/
|
||||
public void processingMessage(SudGameSocketImEvent socketImModel) {
|
||||
|
||||
List<SudGameSocketImEvent.MsgDTO> msgDTOS = socketImModel.getMsg();
|
||||
if (msgDTOS.isEmpty()) return;
|
||||
SudGameSocketImEvent.MsgDTO msgDTO = msgDTOS.get(0);
|
||||
|
||||
if(lastTime.equals(msgDTO.getTime())){
|
||||
return;
|
||||
}
|
||||
lastTime = msgDTO.getTime();
|
||||
//正常文字消息
|
||||
if (TextUtils.equals(msgDTO.getMethod(), "SendMsg")) {
|
||||
getView().insertItem(new SudGameChatImModel().setWelcomMessage(false).setNickname(msgDTO.getUname()).setTextMessage(msgDTO.getCt()));
|
||||
} else if (TextUtils.equals(msgDTO.getMethod(), "welcomMessage")) {
|
||||
// 欢迎(用户名)进入房间 Welcome (username) to the room
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
if (WordUtil.isNewZh()) {
|
||||
stringBuffer.append("歡迎 ").append(msgDTO.getCt()).append(" 進入房間");
|
||||
} else {
|
||||
stringBuffer.append("Welcome ").append(msgDTO.getCt()).append(" to enter the room");
|
||||
}
|
||||
|
||||
getView().insertItem(new SudGameChatImModel().setWelcomMessage(true).setNickname(msgDTO.getCt()).setTextMessage(stringBuffer.toString()));
|
||||
} 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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void sendChatMessage(String textMessage, String method) {
|
||||
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(method)
|
||||
.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);
|
||||
RongcloudIMManager.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);
|
||||
sudGameSocketImEvent.getMsg().get(0).setTime("11");
|
||||
processingMessage(sudGameSocketImEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||
Log.i("tx", "发送成功" + errorCode.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送聊天信息
|
||||
*
|
||||
* @param textMessage
|
||||
*/
|
||||
public void sendMessage(String textMessage) {
|
||||
sendChatMessage(textMessage, "SendMsg");
|
||||
}
|
||||
|
||||
/**
|
||||
* 进房间
|
||||
*/
|
||||
public void enterRoom() {
|
||||
IMLoginModel loginModel = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo();
|
||||
sendChatMessage(loginModel.getUserNicename(), "welcomMessage");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class MessageChatCardItemProvider extends BaseMessageItemProvider<Message
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(AppManager.getInstance().getLastActivity(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class MessageChatCardItemProvider extends BaseMessageItemProvider<Message
|
||||
activity.finish();
|
||||
}
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk),isSw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -51,6 +52,24 @@ public class AppManager {
|
||||
|
||||
public void clear() {
|
||||
activityStack.clear();
|
||||
OpenAdManager.getInstance().clear();
|
||||
}
|
||||
|
||||
public boolean isMainActivity() {
|
||||
Activity lastActivity = getLastActivity();
|
||||
if (lastActivity == null) {
|
||||
return false;
|
||||
}
|
||||
return lastActivity.getClass().getSimpleName().contains("MainActivity");
|
||||
}
|
||||
|
||||
//TODO 首页类型没展示完进直播间会不展示直播间的。
|
||||
public boolean isLiveActivity() {
|
||||
Activity lastActivity = getLastActivity();
|
||||
if (lastActivity == null) {
|
||||
return false;
|
||||
}
|
||||
return lastActivity.getClass().getSimpleName().contains("LiveAudienceActivity");
|
||||
}
|
||||
|
||||
public static class SingleApp {
|
||||
|
||||
@@ -522,6 +522,9 @@ public class DialogUitl {
|
||||
if(!isShowCancelButton){
|
||||
btnCancel.setVisibility(View.GONE);
|
||||
}
|
||||
if(!isShowCancelButton){
|
||||
btnCancel.setVisibility(View.GONE);
|
||||
}
|
||||
View.OnClickListener listener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -285,7 +285,7 @@ public class JavascriptInterfaceUtils {
|
||||
liveBean.setGiftId(giftId);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
||||
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
|
||||
@@ -295,7 +295,7 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk),isSw);
|
||||
}
|
||||
androidGoBack();
|
||||
}
|
||||
|
||||
@@ -12,10 +12,18 @@ public class L {
|
||||
|
||||
private final static String TAG = "log--->";
|
||||
|
||||
private final static String TAG_SW = "log--->TAG_SW";
|
||||
|
||||
public static void e(String s) {
|
||||
e(TAG, s);
|
||||
}
|
||||
|
||||
public static void eSw(String s) {
|
||||
if (sDeBug) {
|
||||
Log.e(TAG_SW, s);
|
||||
}
|
||||
}
|
||||
|
||||
public static void e(String tag, String s) {
|
||||
if (sDeBug) {
|
||||
Log.e(tag, s);
|
||||
|
||||
@@ -33,6 +33,7 @@ public class LiveRoomCheckLivePresenter {
|
||||
private LiveBean mLiveBean;
|
||||
private ActionListener mActionListener;
|
||||
private int mLiveSdk;
|
||||
private boolean isSw;
|
||||
//搜索页面不提示密码
|
||||
public static boolean isRoom = false;
|
||||
|
||||
@@ -50,7 +51,7 @@ public class LiveRoomCheckLivePresenter {
|
||||
@Override
|
||||
public void forwardNormalRoom(CheckLiveModel model) {
|
||||
if (actionListener != null) {
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk(),model.getIsShengwang().equals("1"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +75,7 @@ public class LiveRoomCheckLivePresenter {
|
||||
if (model.getTypeMsg().equalsIgnoreCase(password)) {
|
||||
dialog.dismiss();
|
||||
if (actionListener != null) {
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk(),model.getIsShengwang().equals("1"));
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(mContext.getString(R.string.live_password_error));
|
||||
@@ -93,7 +94,7 @@ public class LiveRoomCheckLivePresenter {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
if (actionListener != null) {
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk(),model.getIsShengwang().equals("1"));
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
@@ -139,6 +140,7 @@ public class LiveRoomCheckLivePresenter {
|
||||
mLiveTypeMsg = obj.getString("type_msg");
|
||||
if (CommonAppConfig.LIVE_SDK_CHANGED) {
|
||||
mLiveSdk = obj.getIntValue("live_sdk");
|
||||
isSw= obj.getString("is_shengwang").equals("1");
|
||||
} else {
|
||||
mLiveSdk = CommonAppConfig.LIVE_SDK_USED;
|
||||
}
|
||||
@@ -263,17 +265,16 @@ public class LiveRoomCheckLivePresenter {
|
||||
*/
|
||||
private void enterLiveRoom() {
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onLiveRoomChanged(mLiveBean, mLiveType, mLiveTypeVal, mLiveSdk);
|
||||
mActionListener.onLiveRoomChanged(mLiveBean, mLiveType, mLiveTypeVal, mLiveSdk,isSw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface ActionListener {
|
||||
void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk);
|
||||
void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk,boolean isSw);
|
||||
}
|
||||
|
||||
public interface NewActionListener {
|
||||
void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk);
|
||||
void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw);
|
||||
|
||||
void onCheckError(String contextError);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ public class RouteUtil {
|
||||
public static final String PATH_FEEDBACK_ACTIVITY = "/main/FeedbackActivity";
|
||||
public static final String PATH_FEEDBACK_EDIT_ACTIVITY = "/main/FeedbackEditActivity";
|
||||
|
||||
public static final String PATH_SudSwGameActivity = "/live/SudSwGameActivity";
|
||||
public static final String PATH_SudRyGameActivity = "/live/SudRyGameActivity";
|
||||
|
||||
|
||||
public static void forwardVideoPlayNewActivity(ActiveBean bean) {
|
||||
ARouter.getInstance().build(PATH_VIDEO_NEW_PLAY)
|
||||
.withParcelable("ActiveBean", bean)
|
||||
@@ -100,9 +104,20 @@ public class RouteUtil {
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardSudGameActivity(String CreateSudRoom) {
|
||||
ARouter.getInstance().build(PATH_SudGameActivity)
|
||||
|
||||
public static void forwardSwSudGameActivity(String CreateSudRoom, boolean isAn, boolean isHome) {
|
||||
ARouter.getInstance().build(PATH_SudSwGameActivity)
|
||||
.withString("CreateSudRoom", CreateSudRoom)
|
||||
.withBoolean("CreateIsAn", isAn)
|
||||
.withBoolean("CreateIsHome", isHome)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardRySudGameActivity(String CreateSudRoom, boolean isAn, boolean isHome) {
|
||||
ARouter.getInstance().build(PATH_SudRyGameActivity)
|
||||
.withString("CreateSudRoom", CreateSudRoom)
|
||||
.withBoolean("CreateIsAn", isAn)
|
||||
.withBoolean("CreateIsHome", isHome)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
@@ -289,7 +304,7 @@ public class RouteUtil {
|
||||
/**
|
||||
* 打开直播页面
|
||||
*/
|
||||
public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
|
||||
public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal, boolean isSw) {
|
||||
if (MicStatusManager.getInstance().isMic(mLiveBean.getUid())) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(CommonAppContext.activityWeakReference.get());
|
||||
return;
|
||||
@@ -299,7 +314,9 @@ public class RouteUtil {
|
||||
.withParcelable(Constants.LIVE_BEAN, mLiveBean)
|
||||
.withInt(Constants.LIVE_TYPE, mLiveType)
|
||||
.withInt(Constants.LIVE_SDK, mLiveSDK)
|
||||
.withBoolean(Constants.LIVE_SDK_IS_SW, isSw)
|
||||
.withInt(Constants.LIVE_TYPE_VAL, mLiveTypeVal);
|
||||
|
||||
if (mLiveBean.getParams() != null) {
|
||||
for (String key : mLiveBean.getParams().keySet()) {
|
||||
postcard.withString(key, mLiveBean.getParams().get(key));
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yunbao.common.views;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
@@ -44,6 +45,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
private ProgressBar progressBar;
|
||||
private Activity mContext;
|
||||
private boolean mInside;
|
||||
private DialogInterface.OnDismissListener onDismissListener;
|
||||
|
||||
public APKUpdateCustomPopup(@NonNull Activity context, boolean inside) {
|
||||
super(context);
|
||||
@@ -57,6 +59,11 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
return R.layout.apk_update_custom_popup;
|
||||
}
|
||||
|
||||
public APKUpdateCustomPopup setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
|
||||
this.onDismissListener = onDismissListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
@@ -69,6 +76,14 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
super.onDismiss();
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
if (!mInside) {
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && APKManager.get().getAPKGoogleIsUp() == 1) {
|
||||
|
||||
@@ -68,6 +68,16 @@ public abstract class AbsViewHolder implements LifeCycleListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeView(){
|
||||
if (mParentView != null && mContentView != null) {
|
||||
mParentView.removeView(mContentView);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShow(){
|
||||
return mParentView.indexOfChild(mContentView)>-1;
|
||||
}
|
||||
|
||||
public void removeFromParent() {
|
||||
ViewParent parent = mContentView.getParent();
|
||||
if (parent != null) {
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.List;
|
||||
|
||||
public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
private Context mContext;
|
||||
private boolean mIs_shengwang;
|
||||
|
||||
private RecyclerView drawerList;
|
||||
private CustomDrawerPopupAdapter adapter;
|
||||
@@ -45,9 +46,10 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
return this;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupView(@NonNull Context context) {
|
||||
public CustomDrawerPopupView(@NonNull Context context, boolean is_shengwang) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mIs_shengwang = is_shengwang;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +74,7 @@ public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
|
||||
private void initView() {
|
||||
drawerList = findViewById(R.id.drawerList);
|
||||
adapter = new CustomDrawerPopupAdapter(mContext);
|
||||
adapter = new CustomDrawerPopupAdapter(mContext,mIs_shengwang);
|
||||
adapter.setList(list).setLiveId(liveId);
|
||||
drawerList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
drawerList.setAdapter(adapter);
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
@@ -106,8 +107,11 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
createSudRoomModel.setSudGameName(model.getSudGameName());
|
||||
if (isHome) {
|
||||
if (TextUtils.equals(model.getLiveUid(), "0")) {
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel));
|
||||
|
||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
||||
}else{
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
||||
}
|
||||
} else {
|
||||
String yes = "是";
|
||||
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
@@ -131,8 +135,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(itemView.getContext(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal),isSw);
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -155,8 +159,11 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel));
|
||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
||||
}else{
|
||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
||||
}
|
||||
}
|
||||
})).show();
|
||||
|
||||
|
||||
@@ -1,307 +0,0 @@
|
||||
package com.yunbao.common.views.weight;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.lzf.easyfloat.enums.ShowPattern;
|
||||
import com.lzf.easyfloat.interfaces.FloatCallbacks;
|
||||
import com.lzf.easyfloat.interfaces.OnInvokeView;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
import com.tencent.rtmp.TXLivePlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.dialog.HintDialog;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.floatingview.FloatingMagnetView;
|
||||
import com.yunbao.common.views.floatingview.MagnetViewListener;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
/**
|
||||
* 直播间悬浮窗管理
|
||||
*/
|
||||
public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
|
||||
private static LiveFloatView instance;
|
||||
private LiveOnInvokeView liveOnInvokeView = null;
|
||||
private Activity mContext;
|
||||
private String url;
|
||||
private LiveBean mLiveBean;
|
||||
private int mLiveType;
|
||||
private int mLiveSDK;
|
||||
private int mLiveTypeVal;
|
||||
private FloatCallbacks.Builder builder;
|
||||
private String TAG = "LiveFloatView";
|
||||
private TXLivePlayer mPlayer;
|
||||
|
||||
public static LiveFloatView getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new LiveFloatView();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void builderFloat(Activity mContext, String url, Class<?> back) {
|
||||
this.mContext = mContext;
|
||||
this.url = url;
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
APPEasyFloat.getInstance().layout(R.layout.view_flaot_live)
|
||||
.dragEnable(true)
|
||||
.setAutoMoveToEdge(true)
|
||||
.black(back)
|
||||
.setMagnetViewListener(new MagnetViewListener() {
|
||||
@Override
|
||||
public void invoke(FloatingMagnetView magnetView) {
|
||||
CardView layout = magnetView.findViewById(R.id.layout);
|
||||
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
|
||||
if (mLiveBean.getLandscape() == 1) {
|
||||
cardParams.height = DpUtil.dp2px(190);
|
||||
cardParams.width = DpUtil.dp2px(255);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
TXCloudVideoView videoView = magnetView.findViewById(R.id.video_view);
|
||||
mPlayer = new TXLivePlayer(mContext);
|
||||
mPlayer.setPlayerView(videoView);
|
||||
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
|
||||
mPlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle param) {
|
||||
float videoWidth = param.getInt("EVT_PARAM1", 0);
|
||||
float videoHeight = param.getInt("EVT_PARAM2", 0);
|
||||
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight);
|
||||
if (mLiveBean.getLandscape() != 1){
|
||||
if (videoWidth > 720) {
|
||||
cardParams.height = DpUtil.dp2px(190);
|
||||
cardParams.width = DpUtil.dp2px(255);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
layout.setLayoutParams(cardParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
mPlayer.stopPlay(true);
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
|
||||
HintDialog fragment = new HintDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("close", "1");
|
||||
fragment.setArguments(args);
|
||||
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "HintDialog");
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(videoView, () -> {
|
||||
mPlayer.stopPlay(true);
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
new Handler().post(liveCheck);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemove() {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if (mPlayer != null)
|
||||
mPlayer.stopPlay(true);
|
||||
}
|
||||
})
|
||||
.show(mContext);
|
||||
|
||||
}
|
||||
|
||||
public void builderSystemFloat(Activity mContext, String url) {
|
||||
liveOnInvokeView = new LiveOnInvokeView();
|
||||
this.mContext = mContext;
|
||||
this.url = url;
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
EasyFloat.with(mContext)
|
||||
.setTag(TAG)
|
||||
.setLayout(R.layout.view_flaot_live, liveOnInvokeView)
|
||||
.setShowPattern(ShowPattern.ALL_TIME)
|
||||
.setFilter()
|
||||
.setGravity(Gravity.END | Gravity.CENTER_VERTICAL, 0, 200)
|
||||
.registerCallback(this)
|
||||
.show();
|
||||
}
|
||||
|
||||
public LiveFloatView cacheLiveData(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
|
||||
this.mLiveBean = mLiveBean;
|
||||
this.mLiveType = mLiveType;
|
||||
this.mLiveSDK = mLiveSDK;
|
||||
this.mLiveTypeVal = mLiveTypeVal;
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Unit invoke(FloatCallbacks.Builder builder) {
|
||||
this.builder = builder;
|
||||
builder.createResult((aBoolean, s, view) -> {
|
||||
Log.e("LiveFloatView", "aBoolean:" + aBoolean + "---------------------s:" + s);
|
||||
if (callback != null) {
|
||||
callback.invoke(aBoolean);
|
||||
}
|
||||
builder.dismiss(() -> {
|
||||
if (mPlayer != null && mPlayer.isPlaying()) {
|
||||
mPlayer.stopPlay(true);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
builder.hide(view12 -> {
|
||||
if (mPlayer != null && mPlayer.isPlaying()) {
|
||||
mPlayer.pause();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
return null;
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 悬浮窗布局管理
|
||||
*/
|
||||
private class LiveOnInvokeView implements OnInvokeView {
|
||||
|
||||
@Override
|
||||
public void invoke(View view) {
|
||||
TXCloudVideoView videoView = view.findViewById(R.id.video_view);
|
||||
CardView layout = view.findViewById(R.id.layout);
|
||||
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
|
||||
if (mLiveBean.getLandscape() == 1) {
|
||||
cardParams.height = DpUtil.dp2px(190);
|
||||
cardParams.width = DpUtil.dp2px(255);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
layout.setLayoutParams(cardParams);
|
||||
mPlayer = new TXLivePlayer(mContext);
|
||||
mPlayer.setPlayerView(videoView);
|
||||
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
|
||||
mPlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle param) {
|
||||
float videoWidth = param.getInt("EVT_PARAM1", 0);
|
||||
float videoHeight = param.getInt("EVT_PARAM2", 0);
|
||||
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight);
|
||||
if (mLiveBean.getLandscape() != 1){
|
||||
if (videoWidth > 720) {
|
||||
cardParams.height = DpUtil.dp2px(190);
|
||||
cardParams.width = DpUtil.dp2px(255);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
layout.setLayoutParams(cardParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
mPlayer.stopPlay(true);
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
|
||||
HintDialog fragment = new HintDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("close", "1");
|
||||
fragment.setArguments(args);
|
||||
fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "HintDialog");
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(view, () -> {
|
||||
|
||||
mPlayer.stopPlay(true);
|
||||
new Handler().post(liveCheck);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private LiveFloatViewCallback callback;
|
||||
|
||||
public LiveFloatView setCallback(LiveFloatViewCallback callback) {
|
||||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface LiveFloatViewCallback {
|
||||
void invoke(Boolean aBoolean);
|
||||
|
||||
}
|
||||
|
||||
private Runnable liveCheck = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
HttpClient.getInstance().get("Live.checkLive", "")
|
||||
.params("liveuid", mLiveBean.getUid())
|
||||
.params("stream", mLiveBean.getStream())
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
|
||||
RouteUtil.forwardLiveAudienceActivity(mLiveBean, mLiveType, mLiveSDK, mLiveTypeVal);
|
||||
|
||||
} else {
|
||||
//判断是否有直播悬浮窗,有直接关闭
|
||||
if (EasyFloat.isShow("LiveFloatView")) {
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
} else {
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
9
common/src/main/res/drawable/border_f1f1f1.xml
Normal file
9
common/src/main/res/drawable/border_f1f1f1.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="7dp" />
|
||||
<solid android:color="#fff1f1f1"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -5,16 +5,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img"
|
||||
<LinearLayout
|
||||
android:id="@+id/content_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@mipmap/background_gift_wall" />
|
||||
app:srcCompat="@mipmap/background_gift_wall">
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
@@ -22,7 +25,7 @@
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/img"
|
||||
app:layout_constraintBottom_toTopOf="@+id/content_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@mipmap/ic_open_ad_close" />
|
||||
|
||||
|
||||
@@ -6,26 +6,28 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img"
|
||||
<LinearLayout
|
||||
android:id="@+id/content_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toTopOf="@+id/close"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginBottom="202dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/img"
|
||||
app:layout_constraintStart_toStartOf="@+id/img"
|
||||
android:layout_marginTop="24dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/content_layout"
|
||||
app:layout_constraintStart_toStartOf="@+id/content_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/content_layout"
|
||||
app:srcCompat="@mipmap/ic_open_ad_close" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -25,6 +25,12 @@
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/videoFrameLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
BIN
common/src/main/res/mipmap-xxxhdpi/bg_kirin.png
Normal file
BIN
common/src/main/res/mipmap-xxxhdpi/bg_kirin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
BIN
common/src/main/res/mipmap-xxxhdpi/icon_more_live_menu.png
Normal file
BIN
common/src/main/res/mipmap-xxxhdpi/icon_more_live_menu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
@@ -1547,5 +1547,6 @@
|
||||
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
|
||||
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
|
||||
<string name="main_type_theater">短劇</string>
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
</resources>
|
||||
|
||||
@@ -1547,5 +1547,6 @@
|
||||
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
|
||||
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
|
||||
<string name="main_type_theater">短劇</string>
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
</resources>
|
||||
|
||||
@@ -1545,5 +1545,6 @@
|
||||
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
|
||||
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
|
||||
<string name="main_type_theater">短劇</string>
|
||||
<string name="pking_over">主播正在PK,稍後再試</string>
|
||||
<string name="guard_buy_tips_1">您將花費%s鑽石,為主播開通</string>
|
||||
</resources>
|
||||
|
||||
@@ -1570,4 +1570,5 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="dragon_rule6">2.Users who follow the anchor and participate in the activity will divide the gold beans of the activity after the countdown of five minutes ends;</string>
|
||||
<string name="dragon_rule7">3.The final interpretation of this activity belongs to PDLIVE.</string>
|
||||
<string name="main_type_theater" >Theater</string>
|
||||
<string name="pking_over">The anchor is in PK, please try again later</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user