From 2102acd9e51b72ef854f24e3e20034ef0ae0dd65 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 1 Nov 2022 16:10:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/bean/IMLoginModel.java | 11 +++++++++++ config.gradle | 4 ++-- .../java/com/yunbao/live/activity/LiveActivity.java | 3 ++- .../java/com/yunbao/main/activity/MainActivity.java | 7 +++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java b/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java index 5bd325be8..e7cbf396a 100644 --- a/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java +++ b/common/src/main/java/com/yunbao/common/bean/IMLoginModel.java @@ -1,5 +1,7 @@ package com.yunbao.common.bean; +import android.text.TextUtils; + import com.google.gson.annotations.SerializedName; import java.util.List; @@ -679,6 +681,15 @@ public class IMLoginModel extends BaseModel { return usersType; } + /** + * usersType ==C 是主播身份 + * + * @return + */ + public boolean anchorUserType() { + return TextUtils.equals("C", usersType); + } + public IMLoginModel setUsersType(String usersType) { this.usersType = usersType; return this; diff --git a/config.gradle b/config.gradle index 65bb82468..42071dc0e 100644 --- a/config.gradle +++ b/config.gradle @@ -10,9 +10,9 @@ ext { manifestPlaceholders = [ //正式 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", //測試 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 80aa7c7d5..767539044 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -32,6 +32,7 @@ import com.yunbao.common.event.FollowEvent; 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.KeyBoardHeightUtil2; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ProcessImageUtil; @@ -948,7 +949,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL } } int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE; - SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType, atUserID, atUserName); + SocketRyChatUtil.sendChatMessage(mLiveUid, content, IMLoginManager.get(mContext).getUserInfo().anchorUserType(), mSocketUserType, guardType, atUserID, atUserName); } diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 65683ecf3..527df2269 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -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; @@ -948,6 +950,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(); } }