Merge branch 'master' into master_sud

# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
#	common/src/main/res/values-en-rUS/string.xml
#	common/src/main/res/values-zh-rHK/strings.xml
#	common/src/main/res/values-zh-rTW/strings.xml
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
#	config.gradle
This commit is contained in:
18401019693 2023-10-07 14:46:22 +08:00
commit c3d4cb8d62
58 changed files with 1184 additions and 157 deletions

View File

@ -229,8 +229,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
} else {
checkUidAndToken();
}
}else{
ToastUtil.show(getString(R.string.net_error));
}
}
});
}

View File

@ -0,0 +1,169 @@
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;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class OpenAdModel extends BaseModel {
public static final int TYPE_HOME = 1;//主页
public static final int TYPE_LIVE = 2;//直播间
public static final int TYPE_LIVE_DELAY = 3;//直播间延迟
public static final int MODEL_SQUARE = 1;//正方形
public static final int MODEL_RECTANGLE = 2;//长方形
public static final int MODEL_BOTTOM = 3;//底部
@SerializedName("id")
private int id;
@SerializedName("popup_location")
private int type = TYPE_HOME;
@SerializedName("activity_url")
private String url;
@SerializedName("image_url")
private String imageUrl;
@SerializedName("display_time")
private int showTime; //持续展示时间
@SerializedName("delay_show_time")
private int delayShowTime;//延迟展示时间
@SerializedName("popup_model")
private int model = MODEL_SQUARE;
@SerializedName("start_show_time")
private String startTime;//活动开始时间
@SerializedName("end_show_time")
private String endTime;//活动结束时间
@SerializedName("popup_permission")
private int permission;
public OpenAdModel() {
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getUrl() {
if (!url.startsWith("http://") || !url.startsWith("https://")) {
url = CommonAppConfig.HOST + url;
}
return url + "?t=" + System.currentTimeMillis() / 1000;
}
public void setUrl(String url) {
this.url = url;
}
public int getShowTime() {
return showTime * 1000;
}
public void setShowTime(int showTime) {
this.showTime = showTime;
}
public int getDelayShowTime() {
return delayShowTime * 1000;
}
public void setDelayShowTime(int delayShowTime) {
this.delayShowTime = delayShowTime;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public int getModel() {
return model;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public void setModel(int model) {
this.model = model;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getPermission() {
return permission;
}
public void setPermission(int permission) {
this.permission = permission;
}
public boolean isInTime() {
if (StringUtil.isEmpty(startTime, endTime)) {
return true;
}
Date startTime = null;
Date endTime = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
try {
startTime = sdf.parse(this.startTime);
endTime = sdf.parse(this.endTime);
} catch (ParseException e) {
e.printStackTrace();
}
long time = System.currentTimeMillis();
return startTime.getTime() <= time && time <= endTime.getTime();
}
public boolean userIsPermission(boolean isGuard) {
if (permission == 4 && !isGuard) {//守护不可见
return false;
}
return true;
}
@Override
public String toString() {
return "OpenAdModel{" +
"id=" + id +
", type=" + type +
", url='" + url + '\'' +
", imageUrl='" + imageUrl + '\'' +
", showTime=" + showTime +
", delayShowTime=" + delayShowTime +
", model=" + model +
", startTime='" + startTime + '\'' +
", endTime='" + endTime + '\'' +
", permission='" + permission + '\'' +
'}';
}
}

View File

@ -23,6 +23,8 @@ public class PkRankBean extends BaseModel {
public String clickUrl;
@SerializedName("vs_img")
public String vsImgUrl;
@SerializedName("new_rank_name_en")
public String newRankNameEn;
public int getId() {
return id;
@ -94,6 +96,14 @@ public class PkRankBean extends BaseModel {
this.vsImgUrl = vsImgUrl;
}
public String getNewRankNameEn() {
return newRankNameEn;
}
public void setNewRankNameEn(String newRankNameEn) {
this.newRankNameEn = newRankNameEn;
}
@Override
public String toString() {
return "PkRankBean{" +
@ -105,6 +115,7 @@ public class PkRankBean extends BaseModel {
", pkTopImgUrl='" + pkTopImgUrl + '\'' +
", clickUrl='" + clickUrl + '\'' +
", vsImgUrl='" + vsImgUrl + '\'' +
", newRankNameEn='" + newRankNameEn + '\'' +
'}';
}
}

View File

@ -0,0 +1,39 @@
package com.yunbao.common.dialog;
import android.content.Context;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.impl.FullScreenPopupView;
/**
* 居中弹窗
*/
public abstract class AbsDialogFullScreenPopupWindow extends FullScreenPopupView {
public final Context mContext;
public AbsDialogFullScreenPopupWindow(@NonNull Context context) {
super(context);
this.mContext = context;
}
/**
* <a href="https://github.com/li-xiaojun/XPopup/wiki/5.-%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE">参考配置</a>
*/
public abstract void buildDialog(XPopup.Builder builder);
public abstract int bindLayoutId();
@Override
protected int getImplLayoutId() {
return bindLayoutId();
}
public void showDialog() {
XPopup.Builder builder = new XPopup.Builder(mContext);
builder.isDestroyOnDismiss(true);
builder.enableDrag(false);
buildDialog(builder);
builder.asCustom(this).show();
}
}

View File

@ -0,0 +1,70 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.widget.ImageView;
import androidx.annotation.NonNull;
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.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
public class OpenAdBottomDialogPopup extends AbsDialogPopupWindow {
private ImageView mImageView;
private ImageView mClose;
private OpenAdModel model;
private OnItemClickListener<OpenAdModel> mListener;
public OpenAdBottomDialogPopup(@NonNull Context context, OpenAdModel model) {
super(context);
this.model = model;
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_open_bottom_ad;
}
@Override
public void dismiss() {
super.dismiss();
if (mListener != null) {
mListener.onItemClick(model, 0);
mListener = null;
}
}
public OpenAdBottomDialogPopup setListener(OnItemClickListener<OpenAdModel> mListener) {
this.mListener = mListener;
return this;
}
@Override
protected void onCreate() {
super.onCreate();
mImageView = findViewById(R.id.img);
mClose = findViewById(R.id.close);
mImageView.setOnClickListener(v -> {
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
if (mListener != null) {
mListener.onItemClick(model, 1);
mListener = null;
}
dismiss();
});
mClose.setOnClickListener(v -> dismiss());
ImgLoader.display(mContext, model.getImageUrl(), mImageView);
if (model.getShowTime() > 0) {
mClose.postDelayed(this::dismiss, model.getShowTime());
}
}
}

View File

@ -0,0 +1,82 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
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.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ScreenDimenUtil;
public class OpenAdCenterDialogPopup extends AbsDialogFullScreenPopupWindow {
private ImageView mImageView;
private ImageView mClose;
private OpenAdModel model;
private OnItemClickListener<OpenAdModel> mListener;
public OpenAdCenterDialogPopup(@NonNull Context context, OpenAdModel model) {
super(context);
this.model = model;
}
public OpenAdCenterDialogPopup setListener(OnItemClickListener<OpenAdModel> mListener) {
this.mListener = mListener;
return this;
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_open_center_ad;
}
@Override
public void dismiss() {
super.dismiss();
if (mListener != null) {
mListener.onItemClick(model, 0);
mListener = null;
}
}
@Override
protected void onCreate() {
super.onCreate();
mImageView = findViewById(R.id.img);
mClose = findViewById(R.id.close);
findViewById(R.id.layout).setOnClickListener(v -> dismiss());
mImageView.setOnClickListener(v -> {
WebViewActivity.forward(mContext, model.getUrl(), model.getType() != OpenAdModel.TYPE_HOME);
if (mListener != null) {
mListener.onItemClick(model, 1);
mListener = null;
}
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());
}
}
}

View File

@ -21,6 +21,7 @@ import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.HintCustomPopup;
import com.yunbao.common.views.LiveNewWishGiftPopup;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -149,7 +150,7 @@ public class LiveNewWishListFragment extends BaseFragment {
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show("修改成功");
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
}
@Override
@ -181,7 +182,7 @@ public class LiveNewWishListFragment extends BaseFragment {
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show("修改成功");
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
}
@Override
@ -200,7 +201,7 @@ public class LiveNewWishListFragment extends BaseFragment {
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show("修改成功");
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
}
@Override

View File

@ -13,6 +13,7 @@ import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.PostRequest;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.R;
import com.yunbao.common.activity.ErrorActivity;
import com.yunbao.common.bean.ConfigBean;
@ -260,6 +261,8 @@ public class CommonHttpUtil {
AppManager.getInstance().AppExit();
}
}).build().show();
} else {
ToastUtil.show(CommonAppContext.getTopActivity().getString(R.string.net_error) + "code:" + code + " msg:" + msg);
}
}

View File

@ -42,6 +42,7 @@ import com.yunbao.common.bean.MsgSwitchDetailModel;
import com.yunbao.common.bean.NewPeopleInfo;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.OpenAdModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankHttpTurntableBean;
@ -1033,5 +1034,11 @@ public interface PDLiveApi {
@Query("room_id") String roomId
);
/**
* 活动弹窗
*/
@GET("/api/public/?service=Home.activityPopup")
Observable<ResponseModel<List<OpenAdModel>>> activityPopup();
}

View File

@ -40,6 +40,7 @@ import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.bean.MedalAchievementModel;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.OpenAdModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankHttpTurntableBean;
@ -2197,6 +2198,29 @@ public class LiveNetManager {
}).isDisposed();
}
public void activityPopup(HttpCallback<List<OpenAdModel>> callback) {
API.get().pdLiveApi(mContext)
.activityPopup()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<OpenAdModel>>>() {
@Override
public void accept(ResponseModel<List<OpenAdModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void getCode(HttpCallback<List<SudgameCodeModel>> callback) {
API.get().pdLiveApi(mContext)
.getCode()

View File

@ -6,6 +6,7 @@ import android.os.Handler;
import android.os.Looper;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList;
import java.util.List;
@ -100,7 +101,11 @@ public class IMRTCManager {
public void onSuccess() {
callback.onSuccess();
if (!RandomPkManager.getInstance().isRandomModel()) {
ToastUtil.show("发起邀请成功");
if(WordUtil.isNewZh()) {
ToastUtil.show("发起邀请成功");
}else{
ToastUtil.show("successful");
}
}
requestUid.add(liveUid);
startRequestTimeoutTask(liveUid);
@ -109,7 +114,11 @@ public class IMRTCManager {
@Override
public void onFailed(RTCErrorCode errorCode) {
if (!RandomPkManager.getInstance().isRandomModel()) {
ToastUtil.show("邀请失败 " + errorCode.getValue());
if(WordUtil.isNewZh()) {
ToastUtil.show("邀请失败 " + errorCode.getValue());
}else{
ToastUtil.show("invite failed:" +errorCode.getValue());
}
}
if (RandomPkManager.getInstance().isRequestPk()) {
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);

View File

@ -0,0 +1,178 @@
package com.yunbao.common.manager;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.OpenAdModel;
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.utils.ToastUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class OpenAdManager {
public static final int TYPE_HOME = 1;
public static final int TYPE_LIVE = 2;
private static final String TAG = "-----弹窗-----";
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 int showType;
private OpenAdManager() {
showMap = new HashMap<>();
init(false);
}
public void reset() {
dismiss();
runnableMap.clear();
showMap.clear();
list.clear();
}
private static final class MInstanceHolder {
static final OpenAdManager mInstance = new OpenAdManager();
}
public static OpenAdManager getInstance() {
return MInstanceHolder.mInstance;
}
private void init(boolean isShow) {
if (list != null && list.isEmpty()) {
return;
}
if(CommonAppContext.getTopActivity()==null){
return;
}
LiveNetManager.get(CommonAppContext.getTopActivity())
.activityPopup(new HttpCallback<List<OpenAdModel>>() {
@Override
public void onSuccess(List<OpenAdModel> data) {
if (data == null || data.isEmpty()) {
Log.i(TAG, "onSuccess: 没有数据");
list = new ArrayList<>();
return;
}
list = data;
if (isShow) {
show(TYPE_HOME, false);
}
}
@Override
public void onError(String error) {
System.err.println("弹框列表:" + error);
}
});
}
public synchronized void show(int type, boolean isGuard) {
if (list == null) {
init(true);
return;
}
showType = type;
for (OpenAdModel model : list) {
if (model.getType() == type) {
if (type == OpenAdModel.TYPE_LIVE && !model.userIsPermission(isGuard)) {
continue;
}
if (runnableMap.containsKey(model.getId())) {
AdRunnable runnable = runnableMap.get(model.getId());
if (runnable != null) {
Log.d(TAG, "reset: " + model);
handler.removeCallbacks(runnable);
runnableMap.remove(model.getId());
}
}
if (!isShow(model)) {
Log.i(TAG, "show: " + model);
handler.postDelayed(new AdRunnable(model), model.getDelayShowTime());
} else {
Log.i(TAG, "notshow: " + model);
}
}
}
Log.i(TAG, "------------------------------");
}
public synchronized void dismiss() {
Log.d(TAG, "准备dismiss:" + runnableMap.size());
for (Integer model : runnableMap.keySet()) {
AdRunnable runnable = runnableMap.get(model);
Log.d(TAG, "dismiss:" + runnable);
if (runnable != null) {
runnable.dismiss();
handler.removeCallbacks(runnable);
}
}
runnableMap.clear();
}
private synchronized boolean isShow(OpenAdModel type) {
if (showMap.containsKey(type.getId()) && showMap.get(type.getId()) != null) {
return Boolean.TRUE.equals(showMap.get(type.getId()));
}
return false;
}
private class AdRunnable implements Runnable {
OpenAdModel model;
public AdRunnable(OpenAdModel model) {
this.model = model;
runnableMap.put(model.getId(), this);
}
public void dismiss() {
Log.e(TAG, "dismiss: " + model);
}
@Override
public synchronized void run() {
Log.i(TAG, "run: " + model);
if (model == null) {
ToastUtil.showDebug("model为空");
return;
}
if (!model.isInTime()) {
ToastUtil.showDebug("不在展示时间内:" + model.getStartTime() + "|" + model.getEndTime());
return;
}
if (isShow(model)) {
ToastUtil.showDebug(model.getId() + "|model展示过了");
return;
}
if (model.getType() != showType) {
return;
}
showMap.put(model.getId(), true);
if (model.getModel() == OpenAdModel.MODEL_BOTTOM) {
new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model)
.setListener((bean, position) -> {
})
.showDialog();
} else {
new OpenAdCenterDialogPopup(CommonAppContext.getTopActivity(), model)
.setListener((bean, position) -> {
})
.showDialog();
}
}
}
}

View File

@ -4,6 +4,7 @@ import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Activity;
import android.app.Dialog;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
@ -643,4 +644,19 @@ public class JavascriptInterfaceUtils {
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidCancelAnchorAttention"));
}
@JavascriptInterface
public void androidLnsufficientBalanceClick(String msg){
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
}
}

View File

@ -30,7 +30,7 @@ public class NobleUtil {
case 1:return "男爵";
case 2:return "子爵";
case 3:return "侯爵";
case 4:return "公爵";
case 4:return "公爵";
case 5:return "国王";
case 6:return "皇帝";
case 7:return "超皇";
@ -39,15 +39,15 @@ public class NobleUtil {
}
public static String nobleIdToStringNameForEn(int id){
switch (id){
case 1:return "baron";
case 2:return "viscount";
case 3:return "marquis";
case 4:return "duke";
case 5:return "king";
case 6:return "emperor";
case 7:return "SuperEmperor";
case 1:return "Baron";
case 2:return "Viscount";
case 3:return "Marquis";
case 4:return "Duke";
case 5:return "King";
case 6:return "Emperor";
case 7:return "SuperKing";
}
return "Not Opened";
return "Not opened";
}
public static int getNobleBackgroundId(int id){
switch (id){

View File

@ -49,17 +49,17 @@ public class PluginManager {
}
public boolean isDownloadApk() {
if(!CommonAppConfig.IS_PLUGIN_MODEL){
if (!CommonAppConfig.IS_PLUGIN_MODEL) {
return true;
}
return new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin_download" + File.separator + "anchorPlugin.apk").exists();
return new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin_download" + File.separator + "anchorPlugin.apk.lock").exists();
}
/**
* 加载主播插件
*/
public void loadAnchorPlugin(DialogInterface.OnDismissListener dismissListener) {
if(!CommonAppConfig.IS_PLUGIN_MODEL){
if (!CommonAppConfig.IS_PLUGIN_MODEL) {
dismissListener.onDismiss(null);
return;
}
@ -73,7 +73,8 @@ public class PluginManager {
e.printStackTrace();
}
File sdk = new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin_download" + File.separator + "anchorPlugin.apk");
if (!sdk.exists()) {
if (!new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin_download" + File.separator + "anchorPlugin.apk.lock").exists() || !sdk.exists()) {
Log.i(TAG, "loadAnchorPlugin: 插件未下载");
if (StringUtil.isEmpty(anchorPluginDownloadUrl)) {
Log.e(TAG, "主播下载地址为空");
return;
@ -97,8 +98,12 @@ public class PluginManager {
* @param outDir 解压路径
*/
private void loadFaceSo(File plugin, String outDir) {
if(!new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin"+File.separator+"lib").exists()) {
unzip(plugin.getAbsolutePath(), outDir, ".so");
if (!new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin" + File.separator + "lib.lock").exists()) {
Log.i(TAG, "loadFaceSo: lib插件未解压");
if (unzip(plugin.getAbsolutePath(), outDir, ".so")) {
new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin" + File.separator + "lib.lock").mkdirs();
Log.i(TAG, "loadFaceSo: lib插件解压");
}
}
String[] abis = Build.SUPPORTED_ABIS;
String abi = Arrays.asList(abis).contains("arm64-v8a") ? "arm64-v8a" : "armeabi-v7a";
@ -108,8 +113,8 @@ public class PluginManager {
try {
Field field = Class.forName("com.faceunity.wrapper.faceunity$LoadConfig").getDeclaredField("sLoadedLibrary");
field.setAccessible(true);
field.set(null,true);
}catch (Exception e){
field.set(null, true);
} catch (Exception e) {
e.printStackTrace();
}
}
@ -121,8 +126,12 @@ public class PluginManager {
* @param outDir 解压路径
*/
private void loadFaceBundle(File plugin, String outDir) {
if(!new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin"+File.separator+"assets").exists()) {
unzip(plugin.getAbsolutePath(), outDir, ".bundle");
if (!new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin" + File.separator + "assets.lock").exists()) {
Log.i(TAG, "loadFaceBundle: bundle未解压");
if (unzip(plugin.getAbsolutePath(), outDir, ".bundle")) {
Log.i(TAG, "loadFaceBundle: bundle解压");
new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin" + File.separator + "assets.lock").mkdirs();
}
}
try {
Object BUNDLE_AI_FACE = Class.forName("com.yunbao.faceunity.utils.FURenderer").getField("BUNDLE_AI_FACE").get(null);
@ -131,6 +140,7 @@ public class PluginManager {
Class.forName("com.yunbao.faceunity.utils.FaceUnityConfig").getField("BUNDLE_FACE_BEAUTIFICATION").set(null, outDir + File.separator + "assets" + File.separator + BUNDLE_FACE_BEAUTIFICATION);
} catch (Exception e) {
e.printStackTrace();
new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin" + File.separator + "assets.lock").delete();
}
}
@ -143,10 +153,12 @@ public class PluginManager {
private void loadSo(File dir, String file) {
file += ".so";
if (new File(dir.getAbsolutePath() + File.separator + file).exists()) {
Log.d(TAG, "加载 " + dir.getAbsolutePath() + File.separator + file);
System.load(dir + File.separator + file);
Log.d(TAG, "加载成功 " + dir + File.separator + file);
} else {
Log.e(TAG, "不存在 " + dir + File.separator + file);
new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin" + File.separator + "lib.lock").delete();
}
}
@ -159,6 +171,7 @@ public class PluginManager {
@Override
public void onSuccess(File file) {
Log.d(TAG, "下载成功 " + file);
new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin_download" + File.separator + "anchorPlugin.apk.lock").mkdirs();
loadAnchorPlugin(dismissListener);
}
@ -169,7 +182,7 @@ public class PluginManager {
@Override
public void onError(Throwable e) {
downloadAnchorSdk(dismissListener);
}
});
}
@ -186,13 +199,14 @@ public class PluginManager {
FileOutputStream out;
byte buffer[] = new byte[1024];
try {
Log.i(TAG, "unzip: " + outDir);
ZipInputStream zis = new ZipInputStream(new FileInputStream(zip));
ZipEntry entry = zis.getNextEntry();
while (entry != null) {
String name = entry.getName();
if (entry.isDirectory()) {
File newDir = new File(outDir + entry.getName());
newDir.mkdir();
newDir.mkdirs();
} else if (name.endsWith(suffix)) {
File outputFile = new File(outDir + File.separator + name);
String outputPath = outputFile.getCanonicalPath();
@ -205,7 +219,7 @@ public class PluginManager {
outputFile = new File(outputPath, name);
outputFile.createNewFile();
out = new FileOutputStream(outputFile);
Log.i(TAG, "unzip: >>" + outputFile.getAbsolutePath());
int tmp = 0;
while ((tmp = zis.read(buffer)) > 0) {
out.write(buffer, 0, tmp);

View File

@ -43,7 +43,7 @@ public class ToastUtil {
public static void show(int res) {
show(WordUtil.getString(res));
show(WordUtil.getNewString(res));
}
/**
@ -80,7 +80,7 @@ public class ToastUtil {
}
public static void showDebug(String s){
if(BuildConfig.DEBUG){
show(s);
show("开发模式:"+s);
}
}
public static void showDebug(int s){
@ -92,6 +92,7 @@ public class ToastUtil {
if (TextUtils.isEmpty(s)) {
return;
}
Log.i("Toast", "Toast show: "+s);
Log.i("ts","ll");
Toast.makeText(CommonAppContext.sInstance,s,Toast.LENGTH_SHORT).show();
Log.i("ts","22");

View File

@ -14,6 +14,7 @@ import com.lxj.xpopup.animator.PopupAnimator;
import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.R;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
/**
@ -85,7 +86,7 @@ public class InputCustomPopup extends CenterPopupView {
public void onViewClicks() {
String textContent = content.getText().toString();
if (TextUtils.isEmpty(textContent)) {
ToastUtil.show("输入内容不可为空");
ToastUtil.show(WordUtil.isNewZh()?"输入内容不可为空":"The input cannot be empty");
return;
}
if (listener != null) {

View File

@ -32,6 +32,7 @@ import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import org.greenrobot.eventbus.Subscribe;
@ -332,7 +333,7 @@ public class LiveNewWishListPopup extends BottomPopupView {
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show("修改成功");
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
}
@Override

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:adjustViewBounds="true"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@mipmap/background_gift_wall" />
<ImageView
android:id="@+id/close"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="14dp"
android:layout_marginBottom="12dp"
app:layout_constraintBottom_toTopOf="@+id/img"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@mipmap/ic_open_ad_close" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="12dp"
android:scaleType="fitEnd"
app:layout_constraintBottom_toTopOf="@+id/close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/type1" />
<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"
app:srcCompat="@mipmap/ic_open_ad_close" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -56,14 +56,14 @@
<string name="coin_qq_not_install">No QQ installed</string>
<string name="copy_link">Replication link</string>
<string name="copy_success">Replication success</string>
<string name="edit_profile">Editing materials</string>
<string name="edit_profile_avatar">Head portrait</string>
<string name="edit_profile_nickname">Nickname</string>
<string name="edit_profile">Edit</string>
<string name="edit_profile_avatar">Photo</string>
<string name="edit_profile_nickname">Name</string>
<string name="edit_profile_update_nickname">ModifyName</string>
<string name="edit_profile_update_remarks">Modify remarks</string>
<string name="edit_profile_remarks">Please enter comments~</string>
<string name="edit_profile_update_sign">Signature</string>
<string name="edit_profile_sign">autograph</string>
<string name="edit_profile_sign">Bio</string>
<string name="bind_phone">Binding phone</string>
<string name="task1">TASK1</string>
<string name="task2">TASK2</string>
@ -242,8 +242,8 @@
<string name="login_tip_2">Service and privacy terms</string>
<string name="login_other_type">Other login methods</string>
<string name="login_tip_3">More exciting experience after registering!</string>
<string name="login_input_phone">Please enter your mobile number</string>
<string name="login_input_pwd">Please input a password</string>
<string name="login_input_phone">Phone Number</string>
<string name="login_input_pwd">Password</string>
<string name="login_immediately_login">Login immediately</string>
<string name="login_ing">Logon</string>
<string name="login_immediately_register">Immediate registration</string>
@ -254,9 +254,9 @@
<string name="login_auth_failure">privilege grant failed</string>
<string name="login_auth_cancle">Authorization cancelled</string>
<string name="live">Live broadcast</string>
<string name="login_tip_4">Login</string>
<string name="login_tip_4">Log in</string>
<string name="shopmall">shopmall</string>
<string name="recomment">Recomm</string>
<string name="recomment">Recommend</string>
<string name="cust_server">CSD</string>
<string name="live_anchor">Anchor</string>
<string name="live_start">Live broadcast</string>
@ -289,7 +289,7 @@
<string name="live_zg">Trickster</string>
<string name="live_dr">MultiplayerPK</string>
<string name="live_mic">Voice Link</string>
<string name="live_wks">Start</string>
<string name="live_wks">billboard</string>
<string name="live_zslk">LeaveTemporarily</string>
<string name="live_zslk1">ResumeLive</string>
<string name="live_flash">Flash lamp</string>
@ -491,11 +491,11 @@
<string name="reg_register">register</string>
<string name="reg_input_phone">Please enter your mobile number</string>
<string name="reg_input_code">Please enter the verification code</string>
<string name="reg_input_pwd_1">Please fill in the password</string>
<string name="reg_input_pwd_2">Please confirm the password</string>
<string name="reg_input_pwd_3">Fill in the invitation code (optional)</string>
<string name="reg_input_pwd_1">Password</string>
<string name="reg_input_pwd_2">Password Again</string>
<string name="reg_input_pwd_3">Invite Code(Optional)</string>
<string name="reg_register_and_login">Register and log in</string>
<string name="reg_get_code">Get verification code</string>
<string name="reg_get_code">Get Code</string>
<string name="reg_get_code_again">Regain</string>
<string name="reg_pwd_error">Passwords are inconsistent</string>
<string name="reg_register_ing">In registration</string>
@ -659,7 +659,7 @@
<string name="save">Preservation</string>
<string name="reg">Register</string>
<string name="no_more_mic">No one is currently in the voice link</string>
<string name="welcome_pdlive">Welcome to PDLIVE</string>
<string name="welcome_pdlive">Welcome to PDLive</string>
<string name="newcomer">Newcomer Bonus</string>
<string name="exp">EXP</string>
<string name="new_rewards">Complete newcomer tasks for more rewards</string>
@ -683,7 +683,7 @@
<string name="live_user_shut_up">Banned users</string>
<string name="live_user_shut_up_list">List of forbidden users</string>
<string name="live_admin_room">Live room of</string>
<string name="live_admin_shut_up_cancel">Lifting of the ban</string>
<string name="live_admin_shut_up_cancel">Remove</string>
<string name="live_user_black_list">Blacklist of users</string>
<string name="live_no_shut_up">No banned users</string>
<string name="live_no_black">No blacklisted users</string>
@ -829,8 +829,8 @@
<string name="live_issend">You can only speak after completing the previous task</string>
<string name="live_hot_give">Heat addition</string>
<string name="live_hot_time">Hot &#38; Time</string>
<string name="live_hot_give">HEATING</string>
<string name="live_hot_time">Heat &#38; Time</string>
<string name="live_hot_ruletext1">The popularity can increase the exposure to the anchor\'s room. The higher the live broadcast room, the more popular on the homepage, which will bring more users in the house and help the anchor to quickly increase the room heat in a period of time. Immediately after the delivery Effective.</string>
<string name="live_hot_ruletext2">How to get the heat card?</string>
@ -888,7 +888,7 @@ Limited ride And limited avatar frame</string>
<string name="online_service">Online Service</string>
<string name="popular_tickets">Hot Ticket</string>
<string name="register_and_log_in">Register and log in</string>
<string name="sign_up_for">Sign up for PD LIVE</string>
<string name="sign_up_for">Sign in PDlive</string>
<string name="tell_the_world">Tell the world</string>
<string name="better_emperor_hint">Tell the world! %s recommends anchor %s to everyone!</string>
<string name="emperor_hint">Tell the world! %s recommends the anchor %s to everyone, and the splendid glance is amazing</string>
@ -956,7 +956,7 @@ Limited ride And limited avatar frame</string>
<string name="chat_chat">Chat</string>
<string name="lucky_angel">Congratulations %s have won %s in the Lucky Angel! The next lucky angel will be you!</string>
<string name="lucky_100">Congratulations on %s winning %s in Luck 100 %%! Go pass on the good luck!</string>
<string name="user_card_guard">Guardian %s</string>
<string name="user_card_guard">guard %s</string>
<string name="to_receive">receive</string>
<string name="to_complete">To finish</string>
<string name="already_collected">Already collected</string>
@ -1018,7 +1018,7 @@ Limited ride And limited avatar frame</string>
<string name="live_user_ban_fhd">There is no choice, the anchor is not turned on FHD live.</string>
<string name="live_user_ban_hd">There is no choice, the anchor is not turned on HD live.</string>
<string name="function_is_suspended">Sorry, this feature is on hold.</string>
<string name="phone_number">phone</string>
<string name="phone_number">Phone Number</string>
<string name="broadcast_data">Broadcast</string>
<string name="click_to_view">Click To View</string>
<string name="anchor_task">Anchor Task</string>
@ -1047,10 +1047,10 @@ Limited ride And limited avatar frame</string>
<string name="go_to_the_sign">Go to the sign-in center</string>
<string name="confirm_pick_up">Confirm pick up</string>
<string name="customer_service2">Unable to login? Click here to contact customer service</string>
<string name="next_step_is_consent">By logging in, you agree to the Terms of</string>
<string name="user_protocol2"> Service</string>
<string name="and">and</string>
<string name="privacy_terms">Privacy</string>
<string name="next_step_is_consent">By continuing, you are agree to our Terms of </string>
<string name="user_protocol2"> use</string>
<string name="and">&amp;</string>
<string name="privacy_terms">Privacy Policy</string>
<string name="terms_and_policies">Terms and policies</string>
<string name="install_the_application">For details, please read the following message to install the application:</string>
<string name="treat_and_protect">Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
@ -1084,7 +1084,7 @@ Limited ride And limited avatar frame</string>
<string name="live_become_fans_medal">One-time gift ≥2000 diamonds), can obtain fan privilege yo</string>
<string name="live_go_charge">Top up</string>
<string name="live_user_card_level">User level</string>
<string name="live_noble_level_anchor">aristocracy</string>
<string name="live_noble_level_anchor">Noble\nLevel</string>
<string name="live_noble_fens_anchor">Fan club</string>
<string name="live_anchor_open_mic">Voice connection is not enabled</string>
<string name="live_honor_number_anchor">Wall of honor</string>
@ -1126,7 +1126,7 @@ Limited ride And limited avatar frame</string>
<string name="unfollow_cancel">unfollow</string>
<string name="unfollow"> Where is the host doing badly~\nBrother, are you sure you want to unfollow?</string>
<string name="unfollow_confrim">follow</string>
<string name="heat_add">Heat Add</string>
<string name="heat_add">Heating</string>
<string name="live_room_chat_fount_size_low">LOW</string>
<string name="live_room_chat_fount_size_def">DEFAULT</string>
<string name="live_room_chat_fount_size_high">HIGH</string>
@ -1150,7 +1150,7 @@ Limited ride And limited avatar frame</string>
<string name="delete_account1">Do you want to delete the account</string>
<string name="delete_account2">After clicking delete, it will take effect immediately and cannot be restored. Are you sure you want to continue?</string>
<string name="delete_account3">Confirm deletion</string>
<string name="complete_information">Fill And gift</string>
<string name="complete_information">Fill for Gift</string>
<string name="complete_information_consumable">Fill in the \'*\' option to complete</string>
<string name="love_powder">True love powder\nPhoto Frame(7 days)</string>
<string name="golden_beans_128">128 Golden Beans</string>
@ -1211,6 +1211,7 @@ Limited ride And limited avatar frame</string>
<string name="red_packet_info_residue_none">None</string>
<string name="red_packet_info_residue_back">Return to account</string>
<string name="red_packet_user_tips2">Popularity Red packet</string>
<string name="main_tabs_red_packet">Earn Cash</string>
<string name="main_tabs_red_packet">Game</string>
<string name="save_popular_red_packets">Popular red packets</string>
<string name="amount">amount</string>
@ -1318,6 +1319,10 @@ Limited ride And limited avatar frame</string>
<string name="trial_coupon">Whether to use trial coupons</string>
<string name="use_diamonds">Use diamonds</string>
<string name="live_send_red_packge_fans_group">Join a fans club</string>
<string name="live_pk_link_error">Sorry, your network failed to pull the other party.</string>
<string name="live_user_dialog_tips">say something</string>
<string name="live_free_pk_empty_tips">No match was found</string>
<string name="live_gift_dialog_select_add">Add</string>
<string name="interactive_game">Interactive Games</string>
<string name="interactive_game_room_list">Room list</string>
<string name="interactive_game_room_game">Game:</string>

View File

@ -1314,6 +1314,11 @@
<string name="trial_coupon">是否使用試用劵</string>
<string name="use_diamonds">使用鑽石</string>
<string name="live_send_red_packge_fans_group">加入粉絲團</string>
<string name="live_pk_link_error">抱歉,您的網絡不佳拉取對方畫面失敗</string>
<string name="live_user_dialog_tips">這家夥很懶,什麽都沒留下</string>
<string name="live_free_pk_empty_tips">沒有找到匹配結果~</string>
<string name="live_gift_dialog_select_add">確定添加</string>
<string name="interactive_game">互動遊戲</string>
<string name="interactive_game_room_list">房間列表</string>
<string name="interactive_game_room_game">游戲:</string>

View File

@ -1313,6 +1313,11 @@
<string name="live_mic_anchor_to_user_dialog">主播:</string>
<string name="trial_coupon">是否使用試用劵</string>
<string name="use_diamonds">使用鑽石</string>
<string name="live_pk_link_error">抱歉,您的網絡不佳拉取對方畫面失敗</string>
<string name="live_user_dialog_tips">這家夥很懶,什麽都沒留下</string>
<string name="live_free_pk_empty_tips">沒有找到匹配結果~</string>
<string name="live_gift_dialog_select_add">確定添加</string>
<string name="interactive_game">互動遊戲</string>
<string name="interactive_game_room_list">房間列表</string>
<string name="interactive_game_room_game">游戲:</string>

View File

@ -1314,6 +1314,10 @@
<string name="live_mic_anchor_to_user_dialog">主播:</string>
<string name="live_send_red_packge_fans_group">加入粉絲團</string>
<string name="live_pk_link_error">抱歉,您的網絡不佳拉取對方畫面失敗</string>
<string name="live_user_dialog_tips">這家夥很懶,什麽都沒留下</string>
<string name="live_free_pk_empty_tips">沒有找到匹配結果~</string>
<string name="live_gift_dialog_select_add">確定添加</string>
<string name="interactive_game">互動遊戲</string>
<string name="interactive_game_room_list">房間列表</string>
<string name="interactive_game_room_game">游戲:</string>

View File

@ -56,14 +56,14 @@
<string name="coin_qq_not_install">No QQ installed</string>
<string name="copy_link">Replication link</string>
<string name="copy_success">Replication success</string>
<string name="edit_profile">Editing materials</string>
<string name="edit_profile_avatar">Head portrait</string>
<string name="edit_profile_nickname">Nickname</string>
<string name="edit_profile">Edit</string>
<string name="edit_profile_avatar">Photo</string>
<string name="edit_profile_nickname">Name</string>
<string name="edit_profile_update_nickname">ModifyName</string>
<string name="edit_profile_update_remarks">Modify remarks</string>
<string name="edit_profile_remarks">Please enter comments~</string>
<string name="edit_profile_update_sign">Signature</string>
<string name="edit_profile_sign">autograph</string>
<string name="edit_profile_sign">Bio</string>
<string name="bind_phone">Binding phone</string>
<string name="task1">TASK1</string>
<string name="task2">TASK2</string>
@ -242,8 +242,8 @@
<string name="login_tip_2">Service and privacy terms</string>
<string name="login_other_type">Other login methods</string>
<string name="login_tip_3">More exciting experience after registering!</string>
<string name="login_input_phone">Please enter your mobile number</string>
<string name="login_input_pwd">Please input a password</string>
<string name="login_input_phone">Phone Number</string>
<string name="login_input_pwd">Password</string>
<string name="login_immediately_login">Login immediately</string>
<string name="login_ing">Logon</string>
<string name="login_immediately_register">Immediate registration</string>
@ -254,9 +254,9 @@
<string name="login_auth_failure">privilege grant failed</string>
<string name="login_auth_cancle">Authorization cancelled</string>
<string name="live">Live broadcast</string>
<string name="login_tip_4">Login</string>
<string name="login_tip_4">Log in</string>
<string name="shopmall">shopmall</string>
<string name="recomment">Recomm</string>
<string name="recomment">Recommend</string>
<string name="cust_server">CSD</string>
<string name="live_anchor">Anchor</string>
<string name="live_start">Live broadcast</string>
@ -289,7 +289,7 @@
<string name="live_zg">Trickster</string>
<string name="live_dr">MultiplayerPK</string>
<string name="live_mic">Voice Link</string>
<string name="live_wks">Start</string>
<string name="live_wks">billboard</string>
<string name="live_zslk">LeaveTemporarily</string>
<string name="live_zslk1">ResumeLive</string>
<string name="live_flash">Flash lamp</string>
@ -491,11 +491,11 @@
<string name="reg_register">register</string>
<string name="reg_input_phone">Please enter your mobile number</string>
<string name="reg_input_code">Please enter the verification code</string>
<string name="reg_input_pwd_1">Please fill in the password</string>
<string name="reg_input_pwd_2">Please confirm the password</string>
<string name="reg_input_pwd_3">Fill in the invitation code (optional)</string>
<string name="reg_input_pwd_1">Password</string>
<string name="reg_input_pwd_2">Password Again</string>
<string name="reg_input_pwd_3">Invite Code(Optional)</string>
<string name="reg_register_and_login">Register and log in</string>
<string name="reg_get_code">Get verification code</string>
<string name="reg_get_code">Get Code</string>
<string name="reg_get_code_again">Regain</string>
<string name="reg_pwd_error">Passwords are inconsistent</string>
<string name="reg_register_ing">In registration</string>
@ -659,7 +659,7 @@
<string name="save">Preservation</string>
<string name="reg">Register</string>
<string name="no_more_mic">No one is currently in the voice link</string>
<string name="welcome_pdlive">Welcome to PDLIVE</string>
<string name="welcome_pdlive">Welcome to PDLive</string>
<string name="newcomer">Newcomer Bonus</string>
<string name="exp">EXP</string>
<string name="new_rewards">Complete newcomer tasks for more rewards</string>
@ -683,7 +683,7 @@
<string name="live_user_shut_up">Banned users</string>
<string name="live_user_shut_up_list">List of forbidden users</string>
<string name="live_admin_room">Live room of</string>
<string name="live_admin_shut_up_cancel">Lifting of the ban</string>
<string name="live_admin_shut_up_cancel">Remove</string>
<string name="live_user_black_list">Blacklist of users</string>
<string name="live_no_shut_up">No banned users</string>
<string name="live_no_black">No blacklisted users</string>
@ -829,8 +829,8 @@
<string name="live_issend">You can only speak after completing the previous task</string>
<string name="live_hot_give">Heat addition</string>
<string name="live_hot_time">Hot &#38; Time</string>
<string name="live_hot_give">HEATING</string>
<string name="live_hot_time">Heat &#38; Time</string>
<string name="live_hot_ruletext1">The popularity can increase the exposure to the anchor\'s room. The higher the live broadcast room, the more popular on the homepage, which will bring more users in the house and help the anchor to quickly increase the room heat in a period of time. Immediately after the delivery Effective.</string>
<string name="live_hot_ruletext2">How to get the heat card?</string>
@ -888,7 +888,7 @@ Limited ride And limited avatar frame</string>
<string name="online_service">Online Service</string>
<string name="popular_tickets">Hot Ticket</string>
<string name="register_and_log_in">Register and log in</string>
<string name="sign_up_for">Sign up for PD LIVE</string>
<string name="sign_up_for">Sign in PDlive</string>
<string name="tell_the_world">Tell the world</string>
<string name="better_emperor_hint">Tell the world! %s recommends anchor %s to everyone!</string>
<string name="emperor_hint">Tell the world! %s recommends the anchor %s to everyone, and the splendid glance is amazing</string>
@ -956,7 +956,7 @@ Limited ride And limited avatar frame</string>
<string name="chat_chat">Chat</string>
<string name="lucky_angel">Congratulations %s have won %s in the Lucky Angel! The next lucky angel will be you!</string>
<string name="lucky_100">Congratulations on %s winning %s in Luck 100 %%! Go pass on the good luck!</string>
<string name="user_card_guard">Guardian %s </string>
<string name="user_card_guard">guard %s </string>
<string name="to_receive">receive</string>
<string name="to_complete">To finish</string>
<string name="already_collected">Already collected</string>
@ -1018,7 +1018,7 @@ Limited ride And limited avatar frame</string>
<string name="live_user_ban_fhd">There is no choice, the anchor is not turned on FHD live.</string>
<string name="live_user_ban_hd">There is no choice, the anchor is not turned on HD live.</string>
<string name="function_is_suspended">Sorry, this feature is on hold.</string>
<string name="phone_number">phone</string>
<string name="phone_number">Phone Number</string>
<string name="broadcast_data">Broadcast</string>
<string name="click_to_view">Click To View</string>
<string name="anchor_task">Anchor Task</string>
@ -1047,10 +1047,10 @@ Limited ride And limited avatar frame</string>
<string name="go_to_the_sign">Go to the sign-in center</string>
<string name="confirm_pick_up">Confirm pick up</string>
<string name="customer_service2">Unable to login? Click here to contact customer service</string>
<string name="next_step_is_consent">By logging in, you agree to the Terms of</string>
<string name="user_protocol2"> Service</string>
<string name="and">and</string>
<string name="privacy_terms">Privacy</string>
<string name="next_step_is_consent">By continuing, you are agree to our Terms of </string>
<string name="user_protocol2"> use</string>
<string name="and">&amp;</string>
<string name="privacy_terms">Privacy Policy</string>
<string name="terms_and_policies">Terms and policies</string>
<string name="install_the_application">For details, please read the following message to install the application:</string>
<string name="treat_and_protect">Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection.</string>
@ -1084,7 +1084,7 @@ Limited ride And limited avatar frame</string>
<string name="live_become_fans_medal">One-time gift ≥2000 diamonds), can obtain fan privilege yo</string>
<string name="live_go_charge">Top up</string>
<string name="live_user_card_level">User level</string>
<string name="live_noble_level_anchor">aristocracy</string>
<string name="live_noble_level_anchor">Noble\nLevel</string>
<string name="live_noble_fens_anchor">Fan club</string>
<string name="live_anchor_open_mic">Voice connection is not enabled</string>
<string name="live_honor_number_anchor">Wall of honor</string>
@ -1126,7 +1126,7 @@ Limited ride And limited avatar frame</string>
<string name="unfollow_cancel">unfollow</string>
<string name="unfollow"> Where is the host doing badly~\nBrother, are you sure you want to unfollow?</string>
<string name="unfollow_confrim">follow</string>
<string name="heat_add">Heat Add</string>
<string name="heat_add">Heating</string>
<string name="live_room_chat_fount_size_low">LOW</string>
<string name="live_room_chat_fount_size_def">DEFAULT</string>
<string name="live_room_chat_fount_size_high">HIGH</string>
@ -1168,7 +1168,7 @@ Limited ride And limited avatar frame</string>
<string name="live_vote_hide_text">VOTE</string>
<string name="live_room_vote_over_tip">%s <br /> box disappears after %s seconds</string>
<string name="live_anchor_vote_tip">Please complete the form.</string>
<string name="complete_information">Fill And gift</string>
<string name="complete_information">Fill for Gift</string>
<string name="complete_information_consumable">Fill in the \'*\' option to complete</string>
<string name="love_powder">True love powder\nPhoto Frame(7 days)</string>
<string name="golden_beans_128">128 Golden Beans</string>
@ -1212,6 +1212,7 @@ Limited ride And limited avatar frame</string>
<string name="red_packet_info_residue_none">None</string>
<string name="red_packet_info_residue_back">Return to account</string>
<string name="red_packet_user_tips2">Popularity Red packet</string>
<string name="main_tabs_red_packet">Earn Cash</string>
<string name="main_tabs_red_packet">Game</string>
<string name="save_popular_red_packets">Popular red packets</string>
<string name="amount">amount</string>
@ -1320,6 +1321,11 @@ Limited ride And limited avatar frame</string>
<string name="live_mic_anchor_to_user_dialog">Anchor:</string>
<string name="live_send_red_packge_fans_group">Join a fans club</string>
<string name="live_pk_link_error">Sorry, your network failed to pull the other party.</string>
<string name="live_user_dialog_tips">say something</string>
<string name="live_free_pk_empty_tips">No match was found</string>
<string name="live_gift_dialog_select_add">Add</string>
<string name="interactive_game">Interactive Games</string>
<string name="interactive_game_room_list">Room list</string>
<string name="interactive_game_room_game">Game:</string>

View File

@ -1,5 +1,7 @@
package com.yunbao.live.activity;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
@ -15,6 +17,7 @@ import android.widget.TextView;
import androidx.fragment.app.DialogFragment;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
@ -36,6 +39,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.KeyBoardHeightUtil2;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ProcessImageUtil;
@ -899,7 +903,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
@Override
public void onClick(View v) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1";
WebViewActivity.forward(mContext, url,true);
WebViewActivity.forward(mContext, url, true);
dialog.dismiss();
}
});
@ -925,7 +929,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
if (!mIsAnchor) {
UserBean u = CommonAppConfig.getInstance().getUserBean();
if (u != null && u.getLevel() < mDanMuLevel) {
ToastUtil.show(String.format(mContext.getString(R.string.live_level_danmu_limit), mDanMuLevel+""));
ToastUtil.show(String.format(mContext.getString(R.string.live_level_danmu_limit), mDanMuLevel + ""));
return;
}
}
@ -946,7 +950,20 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
onCoinChanged(coin);
}
String[] data = new String[]{obj.getString("barragetoken")};
SocketRyChatUtil.sendDanmuMessage(mLiveUid, contents,obj.getIntValue("level_fans"));
SocketRyChatUtil.sendDanmuMessage(mLiveUid, contents, obj.getIntValue("level_fans"));
} else if (code==1001) {
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
} else {
ToastUtil.show(msg);
}
@ -962,7 +979,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
if (!mIsAnchor) {
UserBean u = CommonAppConfig.getInstance().getUserBean();
if (u != null && u.getLevel() < mChatLevel) {
ToastUtil.show(String.format(mContext.getString(R.string.live_level_chat_limit), mChatLevel+""));
ToastUtil.show(String.format(mContext.getString(R.string.live_level_chat_limit), mChatLevel + ""));
return;
}
}
@ -1276,9 +1293,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
} else {
bundle.putString(Constants.URL, CommonAppConfig.HOST + "/h5/live/fansClub.html" + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + uid);
}
bundle.putString("liveUid",mLiveUid);
bundle.putString("anchorName",mAncherName);
bundle.putString("mStream",mStream);
bundle.putString("liveUid", mLiveUid);
bundle.putString("anchorName", mAncherName);
bundle.putString("mStream", mStream);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
}

View File

@ -80,6 +80,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.OpenAdManager;
import com.yunbao.common.pay.PayCallback;
import com.yunbao.common.pay.PayPresenter;
import com.yunbao.common.utils.Bus;
@ -100,6 +101,7 @@ import com.yunbao.live.R;
import com.yunbao.live.adapter.VerticalPagerAdapter;
import com.yunbao.live.bean.ImUserBean;
import com.yunbao.live.bean.LiveChatBean;
import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.dialog.LiveFansFragment;
import com.yunbao.live.dialog.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveGiftPopup;
@ -561,6 +563,7 @@ public class LiveAudienceActivity extends LiveActivity {
@Override
public void onBackPressed() {
MobclickAgent.onEvent(mContext, "live_room_close", "退出直播间");
OpenAdManager.getInstance().dismiss();
try {
manager.onBackPressed();
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
@ -777,6 +780,10 @@ public class LiveAudienceActivity extends LiveActivity {
}
}
GiftCacheUtil.getInstance().restart();
if (manager.isEnterRoom()) {
new Handler(Looper.getMainLooper()).postDelayed(() -> OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE,
LiveGuardInfo.isGuard(mLiveGuardInfo)), 400);
}
}
@Override

View File

@ -70,6 +70,7 @@ import com.yunbao.common.utils.LogUtil;
import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.LiveNewWishListPopup;
import com.yunbao.common.views.LiveRobotSettingCustomPopup;
import com.yunbao.faceunity.FaceManager;
@ -1244,7 +1245,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
});
//todo 安卓端状态码说明文档https://docs.rongcloud.cn/v4/views/rtc/call/code/android.html
Log.e("ry", rtcErrorCode + "aaaaaa" + CommonAppConfig.getInstance().getUid() + "VDSSSS" + pkUid);
ToastUtil.show("邀请 " + pkUid + " 发送失败 " + rtcErrorCode);
if(WordUtil.isNewZh()) {
ToastUtil.show("邀请 " + pkUid + " 发送失败 " + rtcErrorCode);
}else{
ToastUtil.show("invite " + pkUid + " failed:"+rtcErrorCode);
}
}
});
@ -1293,7 +1298,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
@Override
public void onSuccess() {
if (!extra.equals(SOCKET_LIVE_DRPK_RANDOM)) {
ToastUtil.show("邀请 " + pkUid + " 发送成功");
if(WordUtil.isNewZh()) {
ToastUtil.show("邀请 " + pkUid + " 发送成功");
}else{
ToastUtil.show("invite " + pkUid + " successful");
}
}
runOnUiThread(new Runnable() {
@Override

View File

@ -221,9 +221,15 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
}
if (bean.getType() == TYPE_MIC_REQUEST) {
mBtn.setText("同意");
if(!WordUtil.isNewZh()){
mBtn.setText("agree");
}
mBtn.setBackgroundResource(R.drawable.bg_anchor_mic_info_btn_ok);
} else if (bean.getType() == TYPE_MIC_INVITE) {
mBtn.setText("邀请");
if (!WordUtil.isNewZh()) {
mBtn.setText("invite");
}
mBtn.setBackgroundResource(R.drawable.bg_anchor_mic_info_btn_invite);
}
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);

View File

@ -3,6 +3,8 @@ package com.yunbao.live.bean;
import android.os.Parcel;
import android.os.Parcelable;
import com.yunbao.common.Constants;
/**
* Created by cxf on 2018/11/14.
*/
@ -72,5 +74,8 @@ public class LiveGuardInfo implements Parcelable {
}
};
public static boolean isGuard(LiveGuardInfo info){
return info != null && info.getMyGuardType() != Constants.GUARD_TYPE_NONE;
}
}

View File

@ -130,13 +130,13 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl
}
});
if(!WordUtil.isNewZh()){
mPkNumText.setText("Free PK remaining number");
mPkNumText.setText("Free PK number");
((TextView)findViewById(R.id.tmp_text2)).setText("Updated daily at 6am");
}
if (mDrPkNum != -1) {
mPkNumText.setText("多人PK剩余次數");
if(!WordUtil.isNewZh()){
mPkNumText.setText("multi-user PK remaining number");
mPkNumText.setText("multi-user PK number");
}
}
initRecycler();

View File

@ -1,5 +1,7 @@
package com.yunbao.live.dialog;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Dialog;
import android.os.Bundle;
import android.text.Html;
@ -19,6 +21,7 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.makeramen.roundedimageview.RoundedImageView;
@ -34,6 +37,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
@ -462,7 +466,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
private void buy() {
DialogUitl.showSimpleDialog(mContext,
String.format(mContext.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName(getContext())),
String.format(mContext.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin()+"", mCoinName, mTargetBuyBean.getShopName(getContext())),
new DialogUitl.SimpleCallback() {
@Override
@ -499,6 +503,20 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
}
((LiveActivity) mContext).sendBuyGuardMessage2(votes, guardNum, guardType, ancherName, liveuid);
dismiss();
}else if(code==1002){
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
return;
}
ToastUtil.show(msg);
}

View File

@ -22,6 +22,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
@ -118,7 +119,7 @@ public class LiveNewWishListDialogFragment extends AbsDialogFragment implements
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
ToastUtil.show("修改成功");
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
dismiss();
} else {
ToastUtil.show("修改失败" + (msg.isEmpty() ? "" : msg));

View File

@ -18,6 +18,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
@ -117,7 +118,7 @@ public class LiveWishListDialogFragment extends AbsDialogFragment implements OnI
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
ToastUtil.show("修改成功");
ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success");
dismiss();
} else {
ToastUtil.show("修改失败" + (msg.isEmpty() ? "" : msg));

View File

@ -57,6 +57,7 @@ import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
@ -642,6 +643,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.i("ry", "订阅资源失败: " + rtcErrorCode.getReason());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -768,6 +770,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.i("ry", "订阅资源失败: " + rtcErrorCode.getReason());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -855,7 +858,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onSuccess(RCRTCOtherRoom rcrtcOtherRoom) {
rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener);
ToastUtil.show("接受成功");
ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success");
new Handler(Looper.getMainLooper()).post(new Runnable() {
public void run() {
for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) {
@ -924,6 +927,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.i("ry", "订阅资源失败: " + rtcErrorCode);
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -973,7 +977,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onSuccess(RCRTCOtherRoom rcrtcOtherRoom) {
rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener);
ToastUtil.show("接受成功");
ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success");
new Handler(Looper.getMainLooper()).post(new Runnable() {
public void run() {
Log.e("ry", liveid + "来了!!!!" + rcrtcOtherRoom.getRemoteUsers().size());
@ -1000,6 +1004,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.e("ry", "订阅资源失败: " + rtcErrorCode);
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -1655,7 +1660,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
}
Log.e("ry", "多人接受成功" + mApplyUid);
ToastUtil.show("接受成功");
ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success");
//遍历远端用户列表
for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) {
Log.e("ry", rcrtcOtherRoom.getRemoteUsers().get(i).getUserId() + "收到rcrtcOtherRoom" + rcrtcOtherRoom.getRemoteUsers().size());
@ -1773,6 +1778,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.i("ry", "订阅资源失败: " + rtcErrorCode.getReason());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
//2. 合流画布设置
@ -1963,6 +1969,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.i("ry", "订阅资源失败: " + rtcErrorCode.getReason());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});

View File

@ -650,6 +650,7 @@ public class SocketRyClient {
pkRankBean.setId(Integer.parseInt(item.getString("new_rank_id")));
pkRankBean.setName(item.getString("new_rank_name"));
pkRankBean.setImg(item.getString("new_rank_img"));
pkRankBean.setNewRankNameEn(item.getString("new_rank_name_en"));
EventBus.getDefault().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_UPDATE)
.setObject(pkRankBean));

View File

@ -1,10 +1,12 @@
package com.yunbao.live.utils;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -18,9 +20,14 @@ import com.google.android.exoplayer2.analytics.AnalyticsListener;
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
import com.google.android.exoplayer2.ui.StyledPlayerView;
import com.google.android.exoplayer2.video.VideoSize;
import com.lzf.easyfloat.EasyFloat;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import java.util.Timer;
import java.util.TimerTask;
/**
* 直播间播放器管理器
* 通过预加载子播放器来实现无缝切换分辨率功能
@ -40,6 +47,9 @@ public class LiveExoPlayerManager {
private static double log_buffer_time = 0, log_buffer_max_time;
private String url = "";
private Context mContext;
private TimerTask task;
TextView debugText;
public LiveExoPlayerManager(Context mContext) {
this.mContext = mContext;
@ -59,6 +69,109 @@ public class LiveExoPlayerManager {
handler = new Handler(Looper.getMainLooper());
setListener();
setAnalyticsListener();
// createDeBugDialog();
}
int index = 0;
private void createTask() {
if (task != null) {
return;
}
task = new TimerTask() {
@Override
public void run() {
handler.post(new Runnable() {
@Override
public void run() {
try {
if (index > 5 && !player1.isPlaying() && !player2.isPlaying()) {
index = 0;
Log.i(TAG, "5秒内播放器没有播放重新播放");
ToastUtil.showDebug("强制重播");
handler.removeCallbacks(buffRunnable);
replay();
cancel();
} else if (player1.isPlaying() || player2.isPlaying()) {
index = 0;
} else {
index++;
}
} catch (Exception e) {
e.printStackTrace();
cancel();
task = null;
}
}
});
}
};
new Timer().schedule(task, 0, 1000);
}
private TimerTask debugTask;
private void createDeBugDialog() {
debugText = new TextView(mContext);
debugText.setText(getDebugText());
debugText.setBackgroundColor(Color.WHITE);
debugText.setTextColor(Color.BLACK);
EasyFloat.with(mContext)
.setTag("debug")
.setLayout(debugText)
.show();
debugTask = new TimerTask() {
@Override
public void run() {
updateDebug();
}
};
new Timer().schedule(debugTask, 0, 500);
}
private String getDebugText() {
StringBuilder sb = new StringBuilder();
try {
sb.append("player1: ").append(getPlayStateText(player1)).append("|").append(player1.isPlaying()).append("\n");
sb.append("player2: ").append(getPlayStateText(player2)).append("|").append(player2.isPlaying()).append("\n");
sb.append("卡顿计数器:").append(playBufferIndex).append("\n");
sb.append("强制播放计时器:").append(index).append("\n");
} catch (Exception e) {
e.printStackTrace();
EasyFloat.dismiss("debug");
debugTask.cancel();
}
return sb.toString();
}
private void updateDebug() {
handler.post(new Runnable() {
@Override
public void run() {
debugText.setText(getDebugText());
}
});
}
private String getPlayStateText(ExoPlayer player) {
switch (player.getPlaybackState()) {
case Player.STATE_READY:
return "STATE_READY";
case Player.STATE_BUFFERING:
return "STATE_BUFFERING";
case Player.STATE_ENDED:
return "STATE_ENDED";
case Player.STATE_IDLE:
return "STATE_IDLE";
default:
return player.getPlaybackState() + "";
}
}
@ -171,6 +284,7 @@ public class LiveExoPlayerManager {
if (listener != null) {
listener.onIsPlayingChanged(true);
}
createTask();
}
}
@ -245,6 +359,7 @@ public class LiveExoPlayerManager {
if (listener != null) {
listener.onIsPlayingChanged(true);
}
createTask();
}
}
@ -279,7 +394,12 @@ public class LiveExoPlayerManager {
* @param url 地址
*/
public void startUrl(String url) {
if (url != null && url.equals(this.url)) return;
if (!StringUtil.isEmpty(url) && url.equals(this.url)) return;
if (task != null) {
task.cancel();
task = null;
}
Log.i(TAG, "startUrl: " + url + " > " + mainView.getResizeMode());
handler.removeCallbacks(buffRunnable);
this.url = url;
@ -302,7 +422,11 @@ public class LiveExoPlayerManager {
* @param url 地址
*/
public void switchUrl(String url) {
if (url != null && url.equals(this.url)) return;
if (!StringUtil.isEmpty(url) && url.equals(this.url)) return;
if (task != null) {
task.cancel();
task = null;
}
Log.i(TAG, "switchUrl: " + url + " src : " + this.url);
this.url = url;
playBufferIndex = 0;
@ -351,6 +475,10 @@ public class LiveExoPlayerManager {
if (getNextPlayer() != null && getNextPlayer().isPlaying()) {
getNextPlayer().stop();
}
if (task != null) {
task.cancel();
task = null;
}
clearUrl();
}
@ -369,6 +497,14 @@ public class LiveExoPlayerManager {
if (getNextPlayer() != null) {
getNextPlayer().stop();
}
if (listener != null) {
listener.onPlaybackStateChanged(Player.STATE_IDLE);
}
handler.removeCallbacks(buffRunnable);
if (task != null) {
task.cancel();
task = null;
}
String tmp = url;
url = null;
startUrl(tmp);
@ -394,6 +530,13 @@ public class LiveExoPlayerManager {
player2.clearVideoSurface();
player2.release();
}
if (task != null) {
task.cancel();
task = null;
}
if (debugTask != null) {
debugTask.cancel();
}
player1 = null;
player2 = null;
mainView.setKeepContentOnPlayerReset(false);

View File

@ -157,7 +157,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.i("女神说", "倒计时状态:" + s);
if (mTime.getVisibility() == View.VISIBLE) {
if (mTime.getVisibility() == View.VISIBLE && !s.toString().contains(mContext.getString(R.string.live_pk_time_2))) {
EventBus.getDefault().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING));
}
@ -218,7 +218,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
if (mTime != null) {
Log.i("vvvs", content);
if (content.trim().equals("00:00")) {
mTime.setText("結算中");
mTime.setText(WordUtil.isNewZh()?"結算中":"waiting");
} else {
mTime.setText(content);
}

View File

@ -689,13 +689,13 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
}
});
} else if ("inviteMic".equals(str)) {
String content="邀請您進行語音連麥";
String confirm="接受";
String cancel="拒絕";
if(!WordUtil.isNewZh()){
content="You are invited to join the voice connection";
confirm="accept";
cancel="cancel";
String content = "邀請您進行語音連麥";
String confirm = "接受";
String cancel = "拒絕";
if (!WordUtil.isNewZh()) {
content = "You are invited to join the voice connection";
confirm = "accept";
cancel = "cancel";
}
DialogUitl.Builder builder = new DialogUitl.Builder(mContext)
.setContent(content)
@ -708,12 +708,12 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void onConfirmClick(Dialog dialog, String content) {
String[] permissions;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
permissions=new String[]{
permissions = new String[]{
Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.RECORD_AUDIO
};
}else{
permissions=new String[]{
} else {
permissions = new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.RECORD_AUDIO
@ -780,9 +780,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
onPrepared();
rcrtcRoom = null;
MicStatusManager.getInstance().clear();
if(WordUtil.isNewZh()) {
if (WordUtil.isNewZh()) {
ToastUtil.show("已成功退出語音連麥");
}else{
} else {
ToastUtil.show("You have successfully exited the voice connection");
}
resumePlay();
@ -867,10 +867,10 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
}
private void showToast() {
if(WordUtil.isNewZh()) {
if (WordUtil.isNewZh()) {
DialogUitl.showToast(mContext, "設置成功\n" +
"正在為你轉換中", 3000);
}else{
} else {
DialogUitl.showToast(mContext, "successful\n" +
"It's being converted for you", 3000);
}
@ -1007,7 +1007,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", userinputStreamList.size() + LiveActivity.mLiveUid + "订阅失败" + errorCode.toString());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
@Override
@ -1045,6 +1045,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.e("ry", "远端失败" + list.size());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -1197,6 +1198,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.e("ry", "订阅资源失败: " + rtcErrorCode.getReason());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -1285,6 +1287,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
Player.Listener.super.onIsPlayingChanged(isPlaying);
if (isPlaying) {
hideCover();
mLoading.setVisibility(View.INVISIBLE);
Log.i(TAG, "onIsPlayingChanged: 开始播放 | waitNextUrl = " + waitNextUrl);
OkDownload.getInstance().startAll();
if (loadingListener != null) {

View File

@ -76,6 +76,7 @@ import cn.rongcloud.rtc.api.RCRTCMixConfig;
import cn.rongcloud.rtc.api.RCRTCRemoteUser;
import cn.rongcloud.rtc.api.RCRTCRoom;
import cn.rongcloud.rtc.api.RCRTCRoomConfig;
import cn.rongcloud.rtc.api.callback.IRCRTCEngineEventListener;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
@ -85,6 +86,7 @@ import cn.rongcloud.rtc.api.stream.RCRTCVideoStreamConfig;
import cn.rongcloud.rtc.api.stream.RCRTCVideoView;
import cn.rongcloud.rtc.base.RCRTCParamsType;
import cn.rongcloud.rtc.base.RCRTCRoomType;
import cn.rongcloud.rtc.base.RCRTCVideoEventCode;
import cn.rongcloud.rtc.base.RTCErrorCode;
import cn.rongcloud.rtc.core.CameraVideoCapturer;
import cn.rongcloud.rtc.core.RendererCommon;
@ -123,6 +125,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
private ImageView avatarOther;
private LinearLayout goto_room_view;
private boolean isPk = false;
private boolean isNeedOpenCamera = false;
//修改上面主播的头像
@Subscribe(threadMode = ThreadMode.MAIN)
@ -175,7 +178,8 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.e("ry", "远端失败" + list.size());
Log.e("ry", "远端失败" + list.size() + "|errorCode:" + rtcErrorCode.toString());
ToastUtil.show(mContext.getString(R.string.live_pk_link_error));
}
});
}
@ -494,9 +498,10 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
btn_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DialogUitl.showSimpleDialog(mContext, "是否要斷開連麥?", new DialogUitl.SimpleCallback() {
DialogUitl.showSimpleDialog(mContext, WordUtil.isNewZh() ? "是否要斷開連麥?" : "Do you want to disconnect Link?", new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
Log.i("PK----->", "updateSub: " + isPk + "|");
aheadOfScheduleEndPK(mPkUid, CommonAppConfig.getInstance().getUserBean().getUserNiceName(), (String) tv_avatarOther_name.getTag());
//断开连麦
LiveRyAnchorActivity.isDRPK = 0;
@ -693,10 +698,34 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
//设置摄像头最大缩放比例
boolean zoom = RCRTCEngine.getInstance().getDefaultVideoStream().setCameraZoomFactor(1.0f);
// ToastUtil.show("设置比例="+zoom);
Log.i("摄像头", "onSuccess: 打开摄像头");
isNeedOpenCamera = false;
}
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.i("摄像头", "onFailed: 打开摄像头失败 " + errorCode);
}
});
RCRTCEngine.getInstance().registerEventListener(new IRCRTCEngineEventListener() {
@Override
public void onKicked(String roomId, RCRTCParamsType.RCRTCKickedReason kickedReason) {
}
@Override
public void onError(RTCErrorCode errorCode) {
super.onError(errorCode);
Log.i("摄像头", "onError: 错误码" + errorCode);
}
@Override
public void onLocalVideoEventNotify(RCRTCVideoEventCode event) {
super.onLocalVideoEventNotify(event);
Log.i("摄像头", "onLocalVideoEventNotify: 本地视频事件" + event.code);
if (event == RCRTCVideoEventCode.END_CAMERA_ERROR_UNKNOWN) {
isNeedOpenCamera = true;
}
}
});
//设置摄像头最大缩放比例
@ -916,6 +945,24 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
@Override
public void onResume() {
mPaused = false;
Log.i("摄像头", "onResume: " + isNeedOpenCamera);
if(isNeedOpenCamera){
RCRTCEngine.getInstance().getDefaultVideoStream().startCamera(new IRCRTCResultDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean data) {
//设置摄像头最大缩放比例
boolean zoom = RCRTCEngine.getInstance().getDefaultVideoStream().setCameraZoomFactor(1.0f);
// ToastUtil.show("设置比例="+zoom);
Log.i("摄像头", "onSuccess: 打开摄像头");
isNeedOpenCamera = false;
}
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.i("摄像头", "onFailed: 打开摄像头失败 " + errorCode);
}
});
}
}
@Override
@ -1055,5 +1102,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
} else if (event.getType() == LIVE_PK_ING) {
isPk = true;
}
Log.i("PK----->", "updateSub: " + isPk + "|" + event.getType());
}
}

View File

@ -36,6 +36,7 @@ import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.common.http.LiveHttpConsts;
@ -103,7 +104,7 @@ public class LivePushTxViewHolder extends AbsLivePushViewHolder implements ITXLi
btn_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DialogUitl.showSimpleDialog(mContext, "是否要斷開連麥?", new DialogUitl.SimpleCallback() {
DialogUitl.showSimpleDialog(mContext, WordUtil.isNewZh()?"是否要斷開連麥?":"Do you want to disconnect Link?", new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
//断开连麦

View File

@ -462,7 +462,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
} else if ("checkNewLetter".equals(str)) {
checkNewLetter();
}else if("exitFansGroup".equals(str)){
} else if ("exitFansGroup".equals(str)) {
setFansGroup("0");
}
}
@ -1818,7 +1818,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
}
if (htmlUrl.toString().contains("StarChallenge")){
if (htmlUrl.toString().contains("StarChallenge")) {
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("link", htmlUrl.toString());
MobclickAgent.onEvent(mContext, "live_room_star", map_ekv);
@ -1890,7 +1890,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.append("&isZh=")
.append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
}
if (htmlUrl.toString().contains("StarChallenge")){
if (htmlUrl.toString().contains("StarChallenge")) {
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("link", htmlUrl.toString());
MobclickAgent.onEvent(mContext, "live_room_star", map_ekv);
@ -2341,11 +2341,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
if (Integer.parseInt(bean.getRedVal()) > 2) {
mRedVal.setVisibility(View.VISIBLE);
mRedVal.setText(bean.getRedVal() + "連勝");
mRedVal.setText(bean.getRedVal() + (WordUtil.isNewZh()?"連勝":"Win"));
}
if (Integer.parseInt(bean.getBlueVal()) > 2) {
mBlueVal.setVisibility(View.VISIBLE);
mBlueVal.setText(bean.getBlueVal() + "連勝");
mBlueVal.setText(bean.getBlueVal() + (WordUtil.isNewZh()?"連勝":"Win"));
}
mPkRankTopIcon.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
@ -2392,7 +2392,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
private void updatePkRank(PkRankBean bean) {
mPkRankText.setText(bean.getName());
if (WordUtil.isNewZh()) {
mPkRankText.setText(bean.getName());
} else {
mPkRankText.setText(bean.getNewRankNameEn());
}
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);
}
@ -4160,7 +4164,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override
public void onBannerClick(List datas, int p) {
if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())){
if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())) {
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("link", mBannerList4.get(p).getLink());

View File

@ -64,6 +64,7 @@ import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.OpenAdManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
@ -271,6 +272,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void run() {
loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE, LiveGuardInfo.isGuard(mLiveGuardInfo));
}
};
final Runnable loadTimeoutRunnableGone = new Runnable() {
@ -302,7 +304,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRyLinkMicPkPresenter.release();
mLiveRyLinkMicPkPresenter = null;
}
OpenAdManager.getInstance().dismiss();
mLiveBean = data;
mLiveSDK = liveSdk;
mLiveType = liveType;
@ -690,7 +692,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
AppManager.runDebugCode(() -> {
liveHandler.postDelayed(loadTimeoutRunnableGone, 1_000);
// liveHandler.postDelayed(loadTimeoutRunnableGone, 1_000);
});
liveHandler.postDelayed(loadTimeoutRunnableGone, 15_000);
if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) {
@ -2119,4 +2121,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setGiftWall(giftWallLightenNumber, giftWallLightenTotal);
}
}
public boolean isEnterRoom() {
return isEnterRoom;
}
}

View File

@ -48,15 +48,17 @@
<TextView
android:id="@+id/giftInfo"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="9dp"
android:layout_marginEnd="32dp"
android:text="@string/live_fans_group_buy_info"
android:textColor="#B3000000"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/giftName"
android:text="@string/live_fans_group_buy_info" />
app:layout_constraintTop_toBottomOf="@+id/giftName" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/giftList"

View File

@ -29,7 +29,7 @@
android:layout_marginBottom="8dp"
android:background="@drawable/bg_live_prank_gift_add"
android:gravity="center"
android:text="确定添加"
android:text="@string/live_gift_dialog_select_add"
android:textColor="#FFF"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -326,7 +326,7 @@
android:id="@+id/sign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="這家夥很懶,什麽都沒留下"
android:text="@string/live_user_dialog_tips"
android:textColor="#B1B1B1"
android:textSize="14sp" />
@ -504,13 +504,15 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="5dp"
android:layout_marginStart="2dp"
android:layout_marginStart="7dp"
android:src="@mipmap/img_fans_default"
android:visibility="invisible" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="340dp"
android:layout_height="75dp"
android:layout_height="wrap_content"
android:minHeight="75dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@mipmap/bg_funs_live_anchor_start">
@ -9,7 +10,7 @@
<com.yunbao.common.custom.RatioRoundImageView
android:id="@+id/avatar"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp"
@ -34,12 +35,16 @@
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/main_anchor_live_notify_info"
android:textSize="13sp"
android:textColor="#CCFFFFFF"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/liveGo"
app:layout_constraintStart_toStartOf="@+id/anchorName"
app:layout_constraintTop_toBottomOf="@+id/anchorName" />

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rl_root"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -159,17 +160,19 @@
<TextView
android:id="@+id/time"
android:layout_width="72dp"
android:layout_height="20dp"
android:layout_height="wrap_content"
android:layout_above="@id/bottom"
android:layout_centerHorizontal="true"
android:layout_marginBottom="8dp"
android:background="@mipmap/bg_time_box"
android:minHeight="20dp"
android:gravity="center"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:textColor="@color/white"
android:textSize="11sp"
android:visibility="invisible" />
android:visibility="invisible"
tools:visibility="visible" />
<ImageView
android:id="@+id/result"

View File

@ -190,7 +190,7 @@
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="結束連麥"
android:text="@string/live_link_mic_3"
android:textColor="@color/color_white"
android:textSize="13sp"
android:visibility="gone" />

View File

@ -135,7 +135,7 @@
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="結束連麥"
android:text="@string/live_link_mic_3"
android:textColor="@color/color_white"
android:textSize="13sp"
android:visibility="gone" />

View File

@ -19,7 +19,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:text="沒有找到匹配結果~"
android:text="@string/live_free_pk_empty_tips"
android:textColor="#C4C4C4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -8,7 +8,7 @@
<FrameLayout
android:id="@+id/wish_list_layout"
android:layout_width="70dp"
android:layout_width="75dp"
android:layout_height="20dp"
android:orientation="horizontal"
android:visibility="visible">
@ -28,14 +28,13 @@
<TextView
android:id="@+id/wish_list"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="20dp"
android:layout_marginEnd="6dp"
android:ellipsize="end"
android:gravity="center"
android:maxLength="7"
android:text="@string/noble_seat"
android:textColor="#FFFFFF"
android:textSize="10sp" />

View File

@ -45,7 +45,7 @@
<string name="release_cancel_send" >Release cancel send</string>
<string name="more_than" >No recording has been recognized in over 10 seconds</string>
<string name="live_role_title" >Identity privilege</string>
<string name="noble_seat" >Nobleman\'s seat</string>
<string name="noble_seat" >VIP seats</string>
<string name="live_mic_user_apply" >%s applies for connected wheat. Check whether</string>
<string name="live_mic_user_down" >The wheat has been kicked off</string>
<string name="live_mic_invite" >An invitation has been sent and is waiting for the user to accept</string>

View File

@ -88,6 +88,7 @@ import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.APKManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.NoviceInstructorManager;
import com.yunbao.common.manager.OpenAdManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
@ -210,13 +211,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
protected void onPause() {
super.onPause();
OpenAdManager.getInstance().dismiss();
}
@Override
protected void main() {
ActivityCompat.postponeEnterTransition(this);
ConversationIMListManager.get(this);
OpenAdManager.getInstance();
//在请求一下这个接口给我后台版本号
CommonHttpUtil.getConfig(mContext, new CommonCallback<ConfigBean>() {
@Override
@ -526,7 +528,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
//获取指导员账号
ConversationIMListManager.get(this).getUserInstructor(this);
checkVersion();
}
@Override
@ -875,7 +876,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
NoviceInstructorManager.get(mContext).getNoviceInstructor();
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
initAnchorRecommendBanner();
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
}
/**
@ -1074,6 +1075,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (EasyFloat.isShow("LiveFloatView")) {
EasyFloat.dismiss("LiveFloatView", true);
}
OpenAdManager.getInstance().reset();
super.onBackPressed();
}
}

View File

@ -1,11 +1,16 @@
package com.yunbao.main.dialog;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@ -16,12 +21,14 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.Constants;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.main.R;
@ -265,8 +272,23 @@ public class EncourageDialog extends AbsDialogFragment implements View.OnClickLi
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
dismiss();
} else if (code == 1001) {
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
} else {
ToastUtil.show(msg);
}
ToastUtil.show(msg);
}
});

View File

@ -244,7 +244,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback);
});
} else {
String tips="需要下载开播插件,是否下载";
String tips="需要下載開播插件,是否下載";
if(!WordUtil.isNewZh()){
tips="You need to download the plug-in, whether to download";
}