测试修改

This commit is contained in:
18401019693 2022-11-15 10:24:37 +08:00
parent 5f210af804
commit 8e89fdfa65
11 changed files with 160 additions and 121 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorPrimary">#FF8D41</color>
<color name="colorPrimaryDark">#FF8D41</color>
<color name="colorAccent">#FF8D41</color>
<!--fulive demo 主配色-->
<color name="primary_background">#050F14</color>

View File

@ -6,9 +6,11 @@ import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.provider.MediaStore;
import com.bumptech.glide.Glide;
@ -195,4 +197,24 @@ public class BitmapUtil {
canvas.drawBitmap(bitmap, 0, 0, paint);
return bm;
}
/**
* 镜像Bitmap
*
* @param bitmap
* @return
*/
public Bitmap convertMirror(Bitmap bitmap) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
Bitmap newb = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);// 创建一个新的和SRC长度宽度一样的位图
Canvas cv = new Canvas(newb);
Matrix m = new Matrix();
//m.postScale(1, -1); //镜像垂直翻转
m.postScale(-1, 1); //镜像水平翻转
//m.postRotate(-90); //旋转-90度
Bitmap new2 = Bitmap.createBitmap(bitmap, 0, 0, w, h, m, true);
cv.drawBitmap(new2, new Rect(0, 0, new2.getWidth(), new2.getHeight()), new Rect(0, 0, w, h), null);
return newb;
}
}

View File

@ -7,7 +7,10 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.FragmentActivity;
import com.lzf.easyfloat.EasyFloat;
@ -17,6 +20,8 @@ import com.lzf.easyfloat.interfaces.OnInvokeView;
import com.tencent.live2.V2TXLivePlayer;
import com.tencent.live2.V2TXLivePlayerObserver;
import com.tencent.live2.impl.V2TXLivePlayerImpl;
import com.tencent.rtmp.ITXLivePlayListener;
import com.tencent.rtmp.TXLivePlayer;
import com.tencent.rtmp.ui.TXCloudVideoView;
import com.yunbao.common.R;
import com.yunbao.common.bean.LiveBean;
@ -24,6 +29,8 @@ import com.yunbao.common.dialog.HintDialog;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.floatingview.APPEasyFloat;
@ -51,7 +58,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
private int mLiveTypeVal;
private FloatCallbacks.Builder builder;
private String TAG = "LiveFloatView";
private V2TXLivePlayer mPlayer;
private TXLivePlayer mPlayer;
public static LiveFloatView getInstance() {
if (instance == null) {
@ -72,30 +79,37 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
.setMagnetViewListener(new MagnetViewListener() {
@Override
public void invoke(FloatingMagnetView magnetView) {
CardView layout = magnetView.findViewById(R.id.layout);
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
if (mLiveBean.getLandscape() == 1) {
cardParams.height = DpUtil.dp2px(130);
cardParams.width = DpUtil.dp2px(230);
} else {
cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126);
}
TXCloudVideoView videoView = magnetView.findViewById(R.id.video_view);
mPlayer = new V2TXLivePlayerImpl(mContext);
mPlayer.setRenderView(videoView);
mPlayer.startPlay(url);
mPlayer.setObserver(new V2TXLivePlayerObserver() {
mPlayer = new TXLivePlayer(mContext);
mPlayer.setPlayerView(videoView);
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
mPlayer.setPlayListener(new ITXLivePlayListener() {
@Override
public void onWarning(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onWarning(player, code, msg, extraInfo);
Log.e(TAG, msg + "==============" + code);
public void onPlayEvent(int event, Bundle param) {
float videoWidth = param.getInt("EVT_PARAM1", 0);
float videoHeight = param.getInt("EVT_PARAM2", 0);
}
@Override
public void onError(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onError(player, code, msg, extraInfo);
Log.e(TAG, msg + "==============" + code);
public void onNetStatus(Bundle bundle) {
}
});
ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mPlayer.stopPlay();
mPlayer.stopPlay(true);
APPEasyFloat.getInstance().dismiss(mContext);
if (IMLoginManager.get(mContext).isHint2()) {
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog();
Bundle args = new Bundle();
args.putString("close", "1");
@ -104,8 +118,8 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
}
}
});
ViewClicksAntiShake.clicksAntiShake(magnetView, () -> {
mPlayer.stopPlay();
ViewClicksAntiShake.clicksAntiShake(videoView, () -> {
mPlayer.stopPlay(true);
APPEasyFloat.getInstance().dismiss(mContext);
new Handler().post(liveCheck);
@ -121,7 +135,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override
public void dismiss() {
if (mPlayer != null)
mPlayer.stopPlay();
mPlayer.stopPlay(true);
}
})
.show(mContext);
@ -160,15 +174,14 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
callback.invoke(aBoolean);
}
builder.dismiss(() -> {
if (mPlayer != null && mPlayer.isPlaying() == 1) {
mPlayer.stopPlay();
if (mPlayer != null && mPlayer.isPlaying()) {
mPlayer.stopPlay(true);
}
return null;
});
builder.hide(view12 -> {
if (mPlayer != null && mPlayer.isPlaying() == 1) {
mPlayer.pauseAudio();
mPlayer.pauseVideo();
if (mPlayer != null && mPlayer.isPlaying()) {
mPlayer.pause();
}
return null;
});
@ -186,14 +199,23 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override
public void invoke(View view) {
TXCloudVideoView videoView = view.findViewById(R.id.video_view);
mPlayer = new V2TXLivePlayerImpl(mContext);
mPlayer.setRenderView(videoView);
mPlayer.startPlay(url);
CardView layout = view.findViewById(R.id.layout);
mPlayer = new TXLivePlayer(mContext);
mPlayer.setPlayerView(videoView);
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
if (mLiveBean.getLandscape() == 1) {
cardParams.height = DpUtil.dp2px(130);
cardParams.width = DpUtil.dp2px(230);
} else {
cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126);
}
layout.setLayoutParams(cardParams);
ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mPlayer.stopPlay();
mPlayer.stopPlay(true);
EasyFloat.dismiss("LiveFloatView", true);
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog();
@ -206,7 +228,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
});
ViewClicksAntiShake.clicksAntiShake(view, () -> {
mPlayer.stopPlay();
mPlayer.stopPlay(true);
new Handler().post(liveCheck);

View File

@ -1,10 +1,11 @@
<?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"
android:layout_width="210dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/layout"
android:layout_width="230dp"
android:layout_height="130dp"
android:layout_marginStart="25dp"

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme" parent="Base.Theme.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorBackground">@color/background</item>
<item name="android:windowAnimationStyle">@style/Animation</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" >@color/colorPrimary</item>
</style>
<style name="dialog" parent="AppTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>

View File

@ -14,6 +14,8 @@ import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
@ -21,21 +23,22 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.lzy.okgo.callback.Callback;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.base.Request;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.opensource.svgaplayer.SVGAImageView;
import com.tencent.trtc.TRTCCloudDef;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.NotCancelableDialog;
import com.yunbao.common.event.LoginInvalidEvent;
@ -45,6 +48,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.JsonBean;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.BitmapUtil;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DateFormatUtil;
import com.yunbao.common.utils.DialogUitl;
@ -55,12 +59,9 @@ import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.WishlistModel;
import com.yunbao.live.dialog.LiveBeautyDialogFragment;
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
@ -71,7 +72,6 @@ import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.interfaces.LiveFunctionClickListener;
import com.yunbao.live.interfaces.LivePushListener;
import com.yunbao.live.momo.BeautyManager;
import com.yunbao.live.music.LiveMusicDialogFragment;
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
import com.yunbao.live.presenter.LiveLinkMicPresenter;
@ -94,6 +94,7 @@ import java.util.List;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.base.RCRTCRect;
import cn.rongcloud.rtc.base.RTCErrorCode;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.RongIMClient;
@ -103,7 +104,6 @@ import io.rong.message.TextMessage;
import pl.droidsonroids.gif.GifImageView;
/**
* Created by cxf on 2018/10/7.
* 主播直播间
@ -142,7 +142,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
public static int backIndex = 0;//0=未判断1=已判断
@Override
protected int getLayoutId() {
return R.layout.activity_live_anchor;
@ -230,15 +229,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
break;
case Constants.LIVE_FUNC_MIC://語音
ToastUtil.show("開發中,敬請期待");
/* //连麦说是有问题暂时隐藏
LiveMicUserDialogFragment fragment = new LiveMicUserDialogFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", "1");
fragment.setArguments(bundle);
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveUserMoreDialogFragment");
LiveMicUserDialogFragment.activity = ((LiveRyAnchorActivity) mContext);*/
break;
case Constants.LIVE_FUNC_DR://多人PK
if (isDRPK != 1) {
@ -349,60 +339,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
openRedPackSendWindow();
break;
case Constants.LIVE_FUNC_ZSLK://暫時離開
if (leave == 0) {
leave = 1;
mLivePushViewHolder.leave.setVisibility(View.VISIBLE);
sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave));
} else {
leave = 0;
mLivePushViewHolder.leave.setVisibility(View.GONE);
sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
}
HttpClient.getInstance().get("Live.isLeave", "Live.isLeave")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("isleave", leave)
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new Callback<JsonBean>() {
@Override
public void onStart(Request<JsonBean, ? extends Request> request) {
}
@Override
public void onSuccess(Response<JsonBean> response) {
}
@Override
public void onCacheSuccess(Response<JsonBean> response) {
}
@Override
public void onError(Response<JsonBean> response) {
}
@Override
public void onFinish() {
}
@Override
public void uploadProgress(Progress progress) {
}
@Override
public void downloadProgress(Progress progress) {
}
@Override
public JsonBean convertResponse(okhttp3.Response response) throws Throwable {
return null;
}
});
leaveLive();
break;
case Constants.LIVE_FUNC_WKS:
String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
@ -434,6 +371,45 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
}
/**
* 主播展示离开直播间
*/
private void leaveLive() {
RCRTCRect rect = new RCRTCRect(0f, 0f, 1.0f);
if (leave == 0) {
leave = 1;
Glide.with(mContext).asBitmap().load(R.mipmap.zslk).into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(BitmapUtil.getInstance().convertMirror(resource), rect);
sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave));
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
} else if (leave == 1) {
leave = 0;
// 清除水印
boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(null, rect);
sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
}
HttpClient.getInstance().get("Live.isLeave", "Live.isLeave")
.params("uid", CommonAppConfig.getInstance().getUid())
.params("isleave", leave)
.params("token", CommonAppConfig.getInstance().getToken())
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
}
});
}
/**
* 打开心愿单窗口
@ -478,12 +454,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
if (mLiveReadyViewHolder != null) {
mLiveReadyViewHolder.hide();
}
if(mLiveRoomViewHolder!=null){
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.changeFaceUnityView();
}
/* LiveBeautyDialogFragment fragment = new LiveBeautyDialogFragment();
fragment.setiBeautyModule(BeautyManager.iBeautyModule, BeautyManager.iLookupModule, BeautyManager.iBeautyBodyModule);
fragment.show(getSupportFragmentManager(), "LiveBeautyDialogFragment");*/
}
/**
@ -491,7 +464,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
*/
public void light() {
if (mLiveRoomViewHolder != null) {
// mLiveRoomViewHolder.playLightAnim();
}
}
@ -548,7 +520,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
hasGame = mGameList.size() > 0;
}
bundle.putBoolean(Constants.HAS_GAME, hasGame);
bundle.putInt("leave",leave);
bundle.putInt("leave", leave);
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
fragment.setArguments(bundle);
fragment.setFunctionClickListener(this);
@ -869,18 +841,18 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
protected void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.ANCHOR_CHECK_LIVE);
super.onDestroy();
if(mLivePushViewHolder!=null) {
if (mLivePushViewHolder != null) {
mLivePushViewHolder.onDestroy();
}
if(mLiveReadyViewHolder!=null){
if (mLiveReadyViewHolder != null) {
mLiveReadyViewHolder.onDestroy();
}
if(mLiveAnchorViewHolder!=null){
if (mLiveAnchorViewHolder != null) {
mLiveAnchorViewHolder.onDestroy();
}
mLivePushViewHolder=null;
mLiveReadyViewHolder=null;
mLiveAnchorViewHolder=null;
mLivePushViewHolder = null;
mLiveReadyViewHolder = null;
mLiveAnchorViewHolder = null;
L.e("LiveAnchorActivity-------onDestroy------->");
Bus.getOff(this);
}
@ -1269,6 +1241,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
L.e(TAG, content);
LogUtil.print(mLogFile, content);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onOpenDrawer(LiveAudienceEvent event) {
Bundle bundle = new Bundle();

View File

@ -21,6 +21,7 @@ import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechError;
import com.iflytek.cloud.SpeechRecognizer;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.utils.WordsTypeUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity;
@ -130,6 +131,7 @@ public class VoiceDialog extends AbsDialogFragment {
* 上划取消
*/
public void withdraw() {
mIat.stopListening();
if (!isDetached()) {
voiceFluctuations.setVisibility(View.GONE);
gifView.setVisibility(View.GONE);
@ -143,6 +145,7 @@ public class VoiceDialog extends AbsDialogFragment {
* 上划取消
*/
public void notWithdraw() {
startRecognize();
if (!isDetached()) {
if (TextUtils.isEmpty(sendMessage())) {
if (gifView.getVisibility() != View.VISIBLE)
@ -284,7 +287,8 @@ public class VoiceDialog extends AbsDialogFragment {
endOfSpeech();
}
builder.append(text);
voiceChat.setText(builder);
voiceChat.setText(WordsTypeUtil.changeTraditional(builder.toString()));
} catch (JSONException e) {
e.printStackTrace();
}

View File

@ -12,6 +12,7 @@ import com.yunbao.common.http.JsonBean;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.VersionUtil;
import java.io.File;
@ -40,6 +41,7 @@ public class LiveHttpUtil {
.params("stream", stream)
.params("type", type)
.params("p", p)
.params("version", "" + VersionUtil.getVersion())
.execute(callback);
}

View File

@ -10,6 +10,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.utils.ToastUtil;

View File

@ -41,6 +41,7 @@ import com.google.firebase.messaging.FirebaseMessaging;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jakewharton.rxbinding3.view.RxView;
import com.lzf.easyfloat.EasyFloat;
import com.lzf.easyfloat.interfaces.OnPermissionResult;
import com.lzf.easyfloat.permission.PermissionUtils;
import com.tencent.imsdk.v2.V2TIMCallback;
@ -88,6 +89,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.VersionUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.floatingview.APPEasyFloat;
import com.yunbao.common.views.weight.LiveFloatView;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.activity.LiveAudienceActivity;
@ -936,7 +938,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mMainHomeCommunityViewHolder.loadNewUrl();
}
}
@Override
public void onBackPressed() {
if (isTabClose && isWebClose) {
@ -948,6 +949,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
ToastUtil.show(R.string.main_click_next_exit);
return;
}
APPEasyFloat.getInstance().dismiss(mContext);
//判断是否有直播悬浮窗有直接关闭
if (EasyFloat.isShow("LiveFloatView")) {
EasyFloat.dismiss("LiveFloatView", true);
}
super.onBackPressed();
}
}

View File

@ -92,10 +92,17 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:layout_weight="1"
android:gravity="right">