悬浮窗关闭

This commit is contained in:
18401019693 2022-11-01 16:12:16 +08:00
parent 06079c7e9c
commit 283de1047c

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;
@ -946,6 +948,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (curTime - mLastClickBackTime > 2000) {
mLastClickBackTime = curTime;
ToastUtil.show(R.string.main_click_next_exit);
APPEasyFloat.getInstance().dismiss(mContext);
//判断是否有直播悬浮窗有直接关闭
if (EasyFloat.isShow("LiveFloatView")) {
EasyFloat.dismiss("LiveFloatView", true);
}
return;
}
super.onBackPressed();