Ver Fonte

fix: game send

tongmengxiao há 6 meses atrás
pai
commit
f1ce65af40

+ 13 - 24
home/src/main/java/com/swago/home/ChatDetailActivity.kt

@@ -47,14 +47,6 @@ class ChatDetailActivity  : BaseXActivity<ActivityChatDetailBinding>() {
     @JvmField
     var chatName: String = ""
 
-    @Autowired(required = true)
-    @JvmField
-    var chatSpecial: String = ""
-
-    @Autowired(required = true)
-    @JvmField
-    var headSpecial: String = ""
-
     private var svgaParser:SVGAParser? = null
 
     private var messageRecyclerView:MessageLayout?=null
@@ -69,13 +61,15 @@ class ChatDetailActivity  : BaseXActivity<ActivityChatDetailBinding>() {
     }
 
     override fun loadData() {
-
     }
 
     override fun initOther() {
         ARouter.getInstance().inject(this)
 
         svgaParser = SVGAParser(this)
+        if (!TextUtils.isEmpty(account)){
+            userVm.getOtherUserInfo(account,"")
+        }
         val chatInfo = ChatInfo()
         chatInfo.type = V2TIMConversation.V2TIM_C2C
         chatInfo.chatName = chatName
@@ -139,24 +133,19 @@ class ChatDetailActivity  : BaseXActivity<ActivityChatDetailBinding>() {
             }
         }
 
-        if (!TextUtils.isEmpty(chatSpecial)){
-            DianJiuUtil.loadDian9Tu(this ,chatSpecial){ drawable ->
-                drawable?.let {
-                    messageRecyclerView?.leftBubble = it
-                }
-            }
-        }
+        userVm.otherUserInfoLiveData.observe(this){
+            if (!TextUtils.isEmpty(it.android_head_special)){
+                svgaParser?.decodeFromURL(URL(it.android_head_special), object :SVGAParser.ParseCompletion{
+                    override fun onComplete(videoItem: SVGAVideoEntity) {
+                        messageRecyclerView?.leftSvgaAvatar = videoItem
+                    }
 
-        if (!TextUtils.isEmpty(headSpecial)){
-            svgaParser?.decodeFromURL(URL(headSpecial), object :SVGAParser.ParseCompletion{
-                override fun onComplete(videoItem: SVGAVideoEntity) {
-                    messageRecyclerView?.leftSvgaAvatar = videoItem
-                }
+                    override fun onError() {
 
-                override fun onError() {
+                    }
+                })
 
-                }
-            })
+            }
         }
 
         if (UserInfo.getUserInfo() != null && !TextUtils.isEmpty(UserInfo.getUserInfo()?.android_head_special)){

+ 5 - 33
home/src/main/java/com/swago/home/MessageFragment.kt

@@ -28,10 +28,7 @@ import com.tencent.qcloud.tim.uikit.modules.conversation.base.ConversationInfo
  *description:
  */
 class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
-    private val userVm by viewModels<UserVm>()
     private val officialVm by activityViewModels<OfficialVm>()
-    private var conversationInfo: ConversationInfo ?= null
-    private var jumpDetail = true
 
     override fun loadData() {
         officialVm.getMsgSum()
@@ -44,8 +41,11 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
                 .permissions(Manifest.permission.RECORD_AUDIO,Manifest.permission.CAMERA)
                 .request { allGranted, grantedList, deniedList ->
                     if (allGranted) {
-                        conversationInfo = messageInfo
-                        userVm.getOtherUserInfo(messageInfo.id,"")
+                        ARouter.getInstance().build(ARouteConstant.Home.chatDetail)
+                            .withInt("type", V2TIMConversation.V2TIM_C2C)
+                            .withString("account", messageInfo?.id)
+                            .withString("chatName", messageInfo?.title)
+                            .navigation()
                     } else {
                         Toast.makeText(
                             AppContext.getContext(),
@@ -91,33 +91,5 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
                 binding.tvCount.visibility = View.VISIBLE
             }
         }
-        userVm.otherUserInfoLiveData.observe(this){
-            LogUtil.d("otherUserInfoLiveData")
-            if (it != null && jumpDetail){
-                jumpDetail = false
-                ARouter.getInstance().build(ARouteConstant.Home.chatDetail)
-                    .withInt("type", V2TIMConversation.V2TIM_C2C)
-                    .withString("account", conversationInfo?.id)
-                    .withString("chatName", conversationInfo?.title)
-                    .withString("chatSpecial" , it.android_chat_special)
-                    .withString("headSpecial" , it.android_head_special)
-                    .navigation()
-
-//                if (!it.android_chat_special.isNullOrEmpty()){
-//                    DianJiuUtil.loadDian9Tu(AppContext.getContext() ,it.android_head_special){}
-//                }
-//                if (!UserInfo.getUserInfo()?.android_chat_special.isNullOrEmpty()){
-//                    UserInfo.getUserInfo()?.android_chat_special?.let {chatUrl ->
-//                        DianJiuUtil.loadDian9Tu(AppContext.getContext() ,chatUrl){}
-//                    }
-//                }
-            }
-
-        }
-    }
-
-    override fun onResume() {
-        super.onResume()
-        jumpDetail = true
     }
 }

BIN
home/src/main/res/mipmap-xxhdpi/icon_my_store.png


+ 17 - 9
room/src/main/java/com/swago/room/game/GamePlayDialog.kt

@@ -4,14 +4,16 @@ import android.graphics.Color
 import android.os.Bundle
 import android.view.Gravity
 import android.view.ViewGroup
-import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
-import android.webkit.*
-import android.widget.FrameLayout
-import com.alibaba.android.arouter.launcher.ARouter
+import android.webkit.JavascriptInterface
+import android.webkit.WebResourceError
+import android.webkit.WebResourceRequest
+import android.webkit.WebView
+import android.webkit.WebViewClient
 import android.widget.ImageView
 import androidx.constraintlayout.widget.ConstraintLayout
 import androidx.constraintlayout.widget.ConstraintSet
 import androidx.lifecycle.lifecycleScope
+import com.alibaba.android.arouter.launcher.ARouter
 import com.google.gson.Gson
 import com.swago.baseswago.baseroom.IRoomActiveListener
 import com.swago.baseswago.baseroom.IRoomInfo
@@ -19,20 +21,24 @@ import com.swago.baseswago.baseroom.SwagoRoomManager
 import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.constant.UrlConstant
 import com.swago.baseswago.dialog.BaseXDFragment
-import com.swago.baseswago.dialog.PayDialog
 import com.swago.baseswago.im.IMGroupNewMsgListener
 import com.swago.baseswago.im.ImConstant
 import com.swago.baseswago.im.ImConstant.beauty_game_grab_host
 import com.swago.baseswago.im.ImConstant.beauty_game_grab_host_two
 import com.swago.baseswago.model.im.BeautyHostGameData
 import com.swago.baseswago.model.im.CusNewMsgBean
-import com.swago.baseswago.model.im.FollowSuccessMsgBean
 import com.swago.baseswago.model.im.GameData
 import com.swago.baseswago.model.live.game.GameInfoModel
-import com.swago.baseswago.util.*
+import com.swago.baseswago.util.DpPxUtil
+import com.swago.baseswago.util.FileUtil
+import com.swago.baseswago.util.MD5Util
+import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.baseswago.util.SwagoInfo
+import com.swago.baseswago.util.UserInfo
 import com.swago.room.R
 import com.swago.room.bean.UserRoomModel
 import com.swago.room.databinding.DialogGamePlayBinding
+import com.tencent.qcloud.tim.uikit.utils.ScreenUtil
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
@@ -120,9 +126,11 @@ class GamePlayDialog : BaseXDFragment<DialogGamePlayBinding>(), IRoomActiveListe
                 imageViewLayoutParams.leftToLeft = R.id.cl
                 imageViewLayoutParams.leftMargin = DpPxUtil.dip2px(10f)
                 if (gameType == "9"){
-                    imageViewLayoutParams.bottomMargin = DpPxUtil.dip2px(390f)
+                    imageViewLayoutParams.bottomMargin =
+                        ScreenUtil.getScreenWidth(getActivity())
                 } else {
-                    imageViewLayoutParams.bottomMargin = DpPxUtil.dip2px(340f)
+                    imageViewLayoutParams.bottomMargin =
+                        ScreenUtil.getScreenWidth(getActivity()) - ScreenUtil.getPxByDp(40f)
                 }
                 val imageView = ImageView(activity)
                 imageView.setBackgroundResource(R.drawable.shape_80000000_20)

+ 2 - 1
tuikit/src/main/java/com/tencent/qcloud/tim/uikit/modules/chat/base/ChatManagerKit.java

@@ -466,7 +466,8 @@ public abstract class ChatManagerKit extends V2TIMAdvancedMsgListener implements
         v2TIMOfflinePushInfo.setExt(new Gson().toJson(containerBean).getBytes());
         // OPPO必须设置ChannelID才可以收到推送消息,这个channelID需要和控制台一致
         v2TIMOfflinePushInfo.setAndroidOPPOChannelID("tuikit");
-        V2TIMMessage v2TIMMessage = message.getTimMessage();
+
+        final V2TIMMessage v2TIMMessage = message.getTimMessage();
         if (!isGroup) {
             v2TIMMessage.setExcludedFromUnreadCount(TUIKitConfigs.getConfigs().getGeneralConfig().isExcludedFromUnreadCount());
         } else if (!TextUtils.isEmpty(groupType) &&

+ 4 - 4
tuikit/src/main/java/com/tencent/qcloud/tim/uikit/modules/chat/layout/input/InputLayout.java

@@ -546,7 +546,7 @@ public class InputLayout extends InputLayoutUI implements View.OnClickListener,
                     if (UserInfo.INSTANCE.getUserInfo().getPrivate_msg_status()==1){
                         Toast.makeText(AppContext.getContext(), AppContext.getContext().getResources().getString(R.string.you_are_been_forbid), Toast.LENGTH_SHORT).show();
                     }else {
-//                        if (Integer.parseInt(UserInfo.INSTANCE.getUserInfo().getUser_level()) >=5 || Integer.parseInt(UserInfo.INSTANCE.getUserInfo().getUser_wealth_level()) >=5 || UserInfo.INSTANCE.getUserInfo().getIs_recharge() ==1){
+                        if (Integer.parseInt(UserInfo.INSTANCE.getUserInfo().getUser_level()) >=5 || Integer.parseInt(UserInfo.INSTANCE.getUserInfo().getUser_wealth_level()) >=5 || UserInfo.INSTANCE.getUserInfo().getIs_recharge() ==1){
                             if (mMessageHandler != null) {
                                 if(mChatLayout.getChatInfo().getType() == V2TIMConversation.V2TIM_GROUP && !atUserInfoMap.isEmpty()) {
                                     //发送时通过获取输入框匹配上@的昵称list,去从map中获取ID list。
@@ -560,9 +560,9 @@ public class InputLayout extends InputLayoutUI implements View.OnClickListener,
                                     mMessageHandler.sendMessage(MessageInfoUtil.buildTextMessage(mTextInput.getText().toString().trim()));
                                 }
                             }
-//                        } else {
-//                            showLevelDialog();
-//                        }
+                        } else {
+                            showLevelDialog();
+                        }
 
                     }
                 }else {

+ 0 - 4
tuikit/src/main/java/com/tencent/qcloud/tim/uikit/modules/chat/layout/message/holder/MessageContentHolder.java

@@ -70,13 +70,9 @@ public abstract class MessageContentHolder extends MessageEmptyHolder {
         if (msg.isSelf()) {
             leftUserIcon.setVisibility(View.GONE);
             rightUserIcon.setVisibility(View.VISIBLE);
-            leftSvgaImage.setVisibility(View.INVISIBLE);
-            rightSvgaImage.setVisibility(View.VISIBLE);
         } else {
             leftUserIcon.setVisibility(View.VISIBLE);
             rightUserIcon.setVisibility(View.GONE);
-            leftSvgaImage.setVisibility(View.VISIBLE);
-            rightSvgaImage.setVisibility(View.INVISIBLE);
         }
 
         //// 用户昵称设置

+ 0 - 18
tuikit/src/main/java/com/tencent/qcloud/tim/uikit/modules/message/MessageInfo.java

@@ -148,8 +148,6 @@ public class MessageInfo implements IBaseInfo, Serializable {
     private boolean peerRead;
     private boolean isIgnoreShow = false;
     private V2TIMMessage timMessage;
-    private String android_chat_special;
-    private String ios_chat_special;
 
     /**
      * 获取消息唯一标识
@@ -482,20 +480,4 @@ public class MessageInfo implements IBaseInfo, Serializable {
     public boolean getIsIgnoreShow() {
         return isIgnoreShow;
     }
-
-    public String getAndroid_chat_special() {
-        return android_chat_special;
-    }
-
-    public void setAndroid_chat_special(String android_chat_special) {
-        this.android_chat_special = android_chat_special;
-    }
-
-    public String getIos_chat_special() {
-        return ios_chat_special;
-    }
-
-    public void setIos_chat_special(String ios_chat_special) {
-        this.ios_chat_special = ios_chat_special;
-    }
 }