Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
android-m-live
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yichen
android-m-live
Commits
814b47f7
Commit
814b47f7
authored
Feb 18, 2022
by
Dell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、加入禁言
2、加入开屏广告内容
parent
4b6c74ff
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
207 additions
and
90 deletions
+207
-90
Constants.kt
app/src/main/java/com/hupu/tv/player/app/app/Constants.kt
+4
-0
LiveActivity.kt
...n/java/com/hupu/tv/player/app/ui/activity/LiveActivity.kt
+3
-1
MainActivity.kt
...n/java/com/hupu/tv/player/app/ui/activity/MainActivity.kt
+10
-0
SplashActivityContact.kt
...om/hupu/tv/player/app/ui/contact/SplashActivityContact.kt
+2
-0
ChatFragment.java
...java/com/hupu/tv/player/app/ui/fragment/ChatFragment.java
+5
-1
CustomEaseChatFragment.java
...upu/tv/player/app/ui/fragment/CustomEaseChatFragment.java
+1
-0
LiveConversationFragment.kt
...upu/tv/player/app/ui/fragment/LiveConversationFragment.kt
+3
-1
SplashActivityPresenter.kt
...upu/tv/player/app/ui/presenter/SplashActivityPresenter.kt
+27
-12
DialogUtils.kt
...src/main/java/com/hupu/tv/player/app/utils/DialogUtils.kt
+11
-4
CustomEaseChatLayout.java
...a/com/hupu/tv/player/app/widget/CustomEaseChatLayout.java
+112
-58
CustomChatPrimaryMenu.java
...u/tv/player/app/widget/danmuku/CustomChatPrimaryMenu.java
+5
-13
ad_dialog.xml
app/src/main/res/layout/ad_dialog.xml
+24
-0
No files found.
app/src/main/java/com/hupu/tv/player/app/app/Constants.kt
View file @
814b47f7
...
@@ -416,6 +416,7 @@ object Constants {
...
@@ -416,6 +416,7 @@ object Constants {
const
val
FOLLOW_ORDER_TEXT
=
"预约"
const
val
FOLLOW_ORDER_TEXT
=
"预约"
const
val
BANNER_LIST
=
"banner_list"
const
val
BANNER_LIST
=
"banner_list"
const
val
MAIN_BANNER
=
"main_banner"
const
val
NEWS_HEAD_LIST
=
"news_head_list"
const
val
NEWS_HEAD_LIST
=
"news_head_list"
const
val
ROOM_ID
=
"room_id"
const
val
ROOM_ID
=
"room_id"
const
val
SPORT_ID
=
"sport_id"
const
val
SPORT_ID
=
"sport_id"
...
@@ -432,6 +433,9 @@ object Constants {
...
@@ -432,6 +433,9 @@ object Constants {
const
val
USER_NICK
=
"user_nick"
const
val
USER_NICK
=
"user_nick"
const
val
LIVE_ROOM_USER_NAME
=
"live_room_user_name"
const
val
LIVE_ROOM_USER_NAME
=
"live_room_user_name"
const
val
USER_LEVEL
=
"user_level"
const
val
USER_LEVEL
=
"user_level"
const
val
MESSAGE_USER_ID
=
"user_id"
const
val
MESSAGE_USER_RID
=
"user_rid"
const
val
USER_HX_ID
=
"user_hx_id"
const
val
GIFT_BEAN
=
"gift_bean"
const
val
GIFT_BEAN
=
"gift_bean"
const
val
SPORT_TYPE
=
"sport_type"
const
val
SPORT_TYPE
=
"sport_type"
...
...
app/src/main/java/com/hupu/tv/player/app/ui/activity/LiveActivity.kt
View file @
814b47f7
...
@@ -57,6 +57,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
...
@@ -57,6 +57,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
private
var
isDestory
=
false
private
var
isDestory
=
false
private
var
isFollow
=
false
private
var
isFollow
=
false
private
var
LiveRoomUserName
=
""
private
var
LiveRoomUserName
=
""
private
var
liveUserHxId
=
""
private
var
roomCover
=
""
private
var
roomCover
=
""
private
var
matchId
=
""
private
var
matchId
=
""
override
fun
loadData
()
{
override
fun
loadData
()
{
...
@@ -237,7 +238,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
...
@@ -237,7 +238,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
private
fun
initTabLayout
()
{
private
fun
initTabLayout
()
{
mFragment
.
add
(
LiveConversationFragment
.
newInstance
(
roomId
,
notice
,
LiveRoomUserName
))
mFragment
.
add
(
LiveConversationFragment
.
newInstance
(
roomId
,
notice
,
LiveRoomUserName
,
liveUserHxId
))
mFragment
.
add
(
LiveAnchorFragment
.
newInstance
(
roomId
))
mFragment
.
add
(
LiveAnchorFragment
.
newInstance
(
roomId
))
mFragment
.
add
(
LiveRankFragment
.
newInstance
(
roomId
))
mFragment
.
add
(
LiveRankFragment
.
newInstance
(
roomId
))
mFragment
.
add
(
LiveRedListFragment
.
newInstance
(
matchId
))
mFragment
.
add
(
LiveRedListFragment
.
newInstance
(
matchId
))
...
@@ -348,6 +349,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
...
@@ -348,6 +349,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
initPlayer
(
bean
?.
hotNum
.
toString
(),
bean
?.
roomName
?:
""
,
bean
?.
liveUrl
?:
""
)
initPlayer
(
bean
?.
hotNum
.
toString
(),
bean
?.
roomName
?:
""
,
bean
?.
liveUrl
?:
""
)
}
}
LiveRoomUserName
=
bean
?.
userName
?:
""
LiveRoomUserName
=
bean
?.
userName
?:
""
liveUserHxId
=
bean
?.
huanXinUserId
.
orEmpty
()
initIm
(
bean
?.
huanXinUserId
?:
""
)
initIm
(
bean
?.
huanXinUserId
?:
""
)
// initTabLayoutNoConversation()
// initTabLayoutNoConversation()
}
}
...
...
app/src/main/java/com/hupu/tv/player/app/ui/activity/MainActivity.kt
View file @
814b47f7
...
@@ -26,6 +26,7 @@ import com.softgarden.baselibrary.utils.ToastUtil
...
@@ -26,6 +26,7 @@ import com.softgarden.baselibrary.utils.ToastUtil
import
com.hupu.tv.player.app.R
import
com.hupu.tv.player.app.R
import
com.hupu.tv.player.app.app.Constants
import
com.hupu.tv.player.app.app.Constants
import
com.hupu.tv.player.app.base.RefreshActivity
import
com.hupu.tv.player.app.base.RefreshActivity
import
com.hupu.tv.player.app.bean.BannerBean
import
com.hupu.tv.player.app.bean.BoardBean
import
com.hupu.tv.player.app.bean.BoardBean
import
com.hupu.tv.player.app.bean.TabEntityBean
import
com.hupu.tv.player.app.bean.TabEntityBean
import
com.hupu.tv.player.app.event.ExitLoginEvent
import
com.hupu.tv.player.app.event.ExitLoginEvent
...
@@ -33,6 +34,7 @@ import com.hupu.tv.player.app.ui.contact.MainActivityContact
...
@@ -33,6 +34,7 @@ import com.hupu.tv.player.app.ui.contact.MainActivityContact
import
com.hupu.tv.player.app.ui.fragment.*
import
com.hupu.tv.player.app.ui.fragment.*
import
com.hupu.tv.player.app.ui.presenter.MainActivityPresenter
import
com.hupu.tv.player.app.ui.presenter.MainActivityPresenter
import
com.hupu.tv.player.app.utils.DialogUtils
import
com.hupu.tv.player.app.utils.DialogUtils
import
com.hupu.tv.player.app.utils.GlideUtils
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.activity_main.*
import
me.jessyan.autosize.AutoSizeConfig
import
me.jessyan.autosize.AutoSizeConfig
import
org.greenrobot.eventbus.EventBus
import
org.greenrobot.eventbus.EventBus
...
@@ -67,6 +69,7 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
...
@@ -67,6 +69,7 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
setStatusColor
(
R
.
color
.
white
)
setStatusColor
(
R
.
color
.
white
)
StatusBarUtil
.
setStatusBarLightMode
(
this
,
3
)
StatusBarUtil
.
setStatusBarLightMode
(
this
,
3
)
// isMineFragment(false)
// isMineFragment(false)
showAdDialog
()
initTabLayout
()
initTabLayout
()
DialogSettings
.
modalDialog
=
true
DialogSettings
.
modalDialog
=
true
DialogSettings
.
init
()
DialogSettings
.
init
()
...
@@ -75,6 +78,13 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
...
@@ -75,6 +78,13 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
}
}
private
fun
showAdDialog
()
{
val
main
=
SPUtil
.
getSerializableObject
<
ArrayList
<
BannerBean
>>(
Constants
.
MAIN_BANNER
)
if
(
main
?.
isNotEmpty
()
==
true
)
{
DialogUtils
.
showAdDialog
(
this
)
}
}
private
fun
isMineFragment
(
isMineFragment
:
Boolean
)
{
private
fun
isMineFragment
(
isMineFragment
:
Boolean
)
{
val
top
=
if
(
isMineFragment
)
{
val
top
=
if
(
isMineFragment
)
{
setStatusColor
(
R
.
color
.
transparent
)
setStatusColor
(
R
.
color
.
transparent
)
...
...
app/src/main/java/com/hupu/tv/player/app/ui/contact/SplashActivityContact.kt
View file @
814b47f7
...
@@ -19,5 +19,6 @@ interface SplashActivityContact {
...
@@ -19,5 +19,6 @@ interface SplashActivityContact {
fun
getAvatarUrl
()
fun
getAvatarUrl
()
fun
getBannerList
()
fun
getBannerList
()
}
}
}
}
\ No newline at end of file
app/src/main/java/com/hupu/tv/player/app/ui/fragment/ChatFragment.java
View file @
814b47f7
...
@@ -53,17 +53,19 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
...
@@ -53,17 +53,19 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
private
Dialog
dialog
;
private
Dialog
dialog
;
private
CustomChatPrimaryMenu
customChatPrimaryMenu
;
private
CustomChatPrimaryMenu
customChatPrimaryMenu
;
private
CustomChatRoomListener
customChatRoomListener
;
private
CustomChatRoomListener
customChatRoomListener
;
private
String
userHxId
=
""
;
@Override
@Override
public
void
initView
()
{
public
void
initView
()
{
super
.
initView
();
super
.
initView
();
userHxId
=
getArguments
().
getString
(
Constants
.
USER_HX_ID
,
""
);
liveUserName
=
getArguments
().
getString
(
Constants
.
LIVE_ROOM_USER_NAME
);
liveUserName
=
getArguments
().
getString
(
Constants
.
LIVE_ROOM_USER_NAME
);
chatLayout
.
getChatMessageListLayout
().
setItemShowType
(
EaseChatMessageListLayout
.
ShowType
.
LEFT
);
chatLayout
.
getChatMessageListLayout
().
setItemShowType
(
EaseChatMessageListLayout
.
ShowType
.
LEFT
);
customChatPrimaryMenu
=
new
CustomChatPrimaryMenu
(
getContext
());
customChatPrimaryMenu
=
new
CustomChatPrimaryMenu
(
getContext
());
chatLayout
.
getChatInputMenu
().
setCustomPrimaryMenu
(
customChatPrimaryMenu
);
chatLayout
.
getChatInputMenu
().
setCustomPrimaryMenu
(
customChatPrimaryMenu
);
clipboard
=
(
ClipboardManager
)
getActivity
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
clipboard
=
(
ClipboardManager
)
getActivity
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
LiveConversationFragment
parentFragment
=
(
LiveConversationFragment
)
getParentFragment
();
LiveConversationFragment
parentFragment
=
(
LiveConversationFragment
)
getParentFragment
();
c
ustomChatPrimaryMenu
.
setOnSendMessageListener
(
message
->
parentFragment
.
sendDanmu
(
message
,
true
));
c
hatLayout
.
setOnSendMessageListener
(
message
->
parentFragment
.
sendDanmu
(
message
,
true
));
setShowChatPrimaryMenu
();
setShowChatPrimaryMenu
();
}
}
...
@@ -87,6 +89,8 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
...
@@ -87,6 +89,8 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
LiveUserBean
liveUserBean
=
SPUtil
.
Companion
.
getSerializableObject
(
Constants
.
LIVE_USER_BEAN
);
LiveUserBean
liveUserBean
=
SPUtil
.
Companion
.
getSerializableObject
(
Constants
.
LIVE_USER_BEAN
);
if
(
liveUserBean
!=
null
)
{
if
(
liveUserBean
!=
null
)
{
message
.
setAttribute
(
Constants
.
USER_NICK
,
liveUserBean
.
getUserName
());
message
.
setAttribute
(
Constants
.
USER_NICK
,
liveUserBean
.
getUserName
());
message
.
setAttribute
(
Constants
.
MESSAGE_USER_RID
,
liveUserBean
.
getId
());
message
.
setAttribute
(
Constants
.
MESSAGE_USER_ID
,
userHxId
);
message
.
setAttribute
(
Constants
.
USER_LEVEL
,
liveUserBean
.
getLevel
());
message
.
setAttribute
(
Constants
.
USER_LEVEL
,
liveUserBean
.
getLevel
());
}
}
}
}
...
...
app/src/main/java/com/hupu/tv/player/app/ui/fragment/CustomEaseChatFragment.java
View file @
814b47f7
...
@@ -348,6 +348,7 @@ public class CustomEaseChatFragment extends EaseBaseFragment implements OnChatLa
...
@@ -348,6 +348,7 @@ public class CustomEaseChatFragment extends EaseBaseFragment implements OnChatLa
}
}
@Override
@Override
public
boolean
onMenuItemClick
(
MenuItemBean
item
,
EMMessage
message
)
{
public
boolean
onMenuItemClick
(
MenuItemBean
item
,
EMMessage
message
)
{
return
false
;
return
false
;
...
...
app/src/main/java/com/hupu/tv/player/app/ui/fragment/LiveConversationFragment.kt
View file @
814b47f7
...
@@ -37,9 +37,10 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
...
@@ -37,9 +37,10 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
companion
object
{
companion
object
{
@JvmStatic
@JvmStatic
fun
newInstance
(
conversationId
:
String
,
notice
:
String
,
userName
:
String
):
LiveConversationFragment
{
fun
newInstance
(
conversationId
:
String
,
notice
:
String
,
userName
:
String
,
userHxId
:
String
):
LiveConversationFragment
{
val
args
=
Bundle
()
val
args
=
Bundle
()
args
.
putString
(
EaseConstant
.
EXTRA_CONVERSATION_ID
,
conversationId
)
args
.
putString
(
EaseConstant
.
EXTRA_CONVERSATION_ID
,
conversationId
)
args
.
putString
(
Constants
.
USER_HX_ID
,
userHxId
)
args
.
putInt
(
EaseConstant
.
EXTRA_CHAT_TYPE
,
EaseConstant
.
CHATTYPE_CHATROOM
)
args
.
putInt
(
EaseConstant
.
EXTRA_CHAT_TYPE
,
EaseConstant
.
CHATTYPE_CHATROOM
)
args
.
putBoolean
(
EaseConstant
.
EXTRA_IS_ROAM
,
false
)
args
.
putBoolean
(
EaseConstant
.
EXTRA_IS_ROAM
,
false
)
args
.
putString
(
Constants
.
LIVE_NOTICE
,
notice
)
args
.
putString
(
Constants
.
LIVE_NOTICE
,
notice
)
...
@@ -99,6 +100,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
...
@@ -99,6 +100,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
bundle
.
putInt
(
EaseConstant
.
EXTRA_CHAT_TYPE
,
EaseConstant
.
CHATTYPE_CHATROOM
)
bundle
.
putInt
(
EaseConstant
.
EXTRA_CHAT_TYPE
,
EaseConstant
.
CHATTYPE_CHATROOM
)
bundle
.
putBoolean
(
EaseConstant
.
EXTRA_IS_ROAM
,
false
)
bundle
.
putBoolean
(
EaseConstant
.
EXTRA_IS_ROAM
,
false
)
bundle
.
putString
(
Constants
.
LIVE_ROOM_USER_NAME
,
liveUserName
)
bundle
.
putString
(
Constants
.
LIVE_ROOM_USER_NAME
,
liveUserName
)
bundle
.
putString
(
Constants
.
USER_HX_ID
,
arguments
?.
getString
(
Constants
.
USER_HX_ID
))
chatFragment
=
ChatFragment
()
chatFragment
=
ChatFragment
()
chatFragment
?.
arguments
=
bundle
chatFragment
?.
arguments
=
bundle
childFragmentManager
.
beginTransaction
().
replace
(
R
.
id
.
fl_fragment
,
chatFragment
!!
,
"chat"
).
commit
()
childFragmentManager
.
beginTransaction
().
replace
(
R
.
id
.
fl_fragment
,
chatFragment
!!
,
"chat"
).
commit
()
...
...
app/src/main/java/com/hupu/tv/player/app/ui/presenter/SplashActivityPresenter.kt
View file @
814b47f7
...
@@ -43,11 +43,26 @@ class SplashActivityPresenter : IBasePresenter, SplashActivityContact.Presenter
...
@@ -43,11 +43,26 @@ class SplashActivityPresenter : IBasePresenter, SplashActivityContact.Presenter
override
fun
getAvatarUrl
()
{
override
fun
getAvatarUrl
()
{
RetrofitClient
.
retrofitService
RetrofitClient
.
retrofitService
.
getAvatarUrl
()
.
getAvatarUrl
()
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
subscribe
(
object
:
RxCallback
<
String
>()
{
.
subscribe
(
object
:
RxCallback
<
String
>()
{
override
fun
onSuccess
(
data
:
String
?)
{
override
fun
onSuccess
(
data
:
String
?)
{
SPUtil
.
put
(
Constants
.
AVATAR_URL
,
data
)
SPUtil
.
put
(
Constants
.
AVATAR_URL
,
data
)
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求头像成功:$data"
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求头像成功:$data"
getMainBanner
()
}
})
}
private
fun
getMainBanner
()
{
RetrofitClient
.
retrofitService
.
getBannerList
(
JsonUtils
.
toRequestBody
(
hashMapOf
<
String
,
Any
>().
apply
{
put
(
"adType"
,
7
)
}))
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
subscribe
(
object
:
RxCallback
<
ArrayList
<
BannerBean
>>()
{
override
fun
onSuccess
(
data
:
ArrayList
<
BannerBean
>?)
{
SPUtil
.
putSerializableObject
(
Constants
.
MAIN_BANNER
,
data
)
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求广告成功"
getBannerList
()
getBannerList
()
}
}
})
})
...
@@ -55,11 +70,11 @@ class SplashActivityPresenter : IBasePresenter, SplashActivityContact.Presenter
...
@@ -55,11 +70,11 @@ class SplashActivityPresenter : IBasePresenter, SplashActivityContact.Presenter
override
fun
getBannerList
()
{
override
fun
getBannerList
()
{
RetrofitClient
.
retrofitService
RetrofitClient
.
retrofitService
.
getBannerList
(
JsonUtils
.
toRequestBody
(
hashMapOf
<
String
,
Any
>()))
.
getBannerList
(
JsonUtils
.
toRequestBody
(
hashMapOf
<
String
,
Any
>()))
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
subscribe
(
object
:
RxCallback
<
ArrayList
<
BannerBean
>>()
{
.
subscribe
(
object
:
RxCallback
<
ArrayList
<
BannerBean
>>()
{
override
fun
onSuccess
(
data
:
ArrayList
<
BannerBean
>?)
{
override
fun
onSuccess
(
data
:
ArrayList
<
BannerBean
>?)
{
SPUtil
.
putSerializableObject
(
Constants
.
BANNER_LIST
,
data
)
SPUtil
.
putSerializableObject
(
Constants
.
BANNER_LIST
,
data
)
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求Banner成功"
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求Banner成功"
getNewsList
()
getNewsList
()
}
}
...
@@ -68,26 +83,26 @@ class SplashActivityPresenter : IBasePresenter, SplashActivityContact.Presenter
...
@@ -68,26 +83,26 @@ class SplashActivityPresenter : IBasePresenter, SplashActivityContact.Presenter
private
fun
getNewsList
()
{
private
fun
getNewsList
()
{
RetrofitClient
.
retrofitService
RetrofitClient
.
retrofitService
.
getNewsHeadList
(
JsonUtils
.
toRequestBody
(
hashMapOf
<
String
,
Any
>().
apply
{
.
getNewsHeadList
(
JsonUtils
.
toRequestBody
(
hashMapOf
<
String
,
Any
>().
apply
{
put
(
"adType"
,
2
)
put
(
"adType"
,
2
)
}))
}))
.
compose
(
NetworkTransformer
(
mView
))
.
compose
(
NetworkTransformer
(
mView
))
.
subscribe
(
object
:
RxCallback
<
List
<
BannerBean
>>()
{
.
subscribe
(
object
:
RxCallback
<
List
<
BannerBean
>>()
{
override
fun
onSuccess
(
data
:
List
<
BannerBean
>?)
{
override
fun
onSuccess
(
data
:
List
<
BannerBean
>?)
{
SPUtil
.
putSerializableObject
(
Constants
.
NEWS_HEAD_LIST
,
data
)
SPUtil
.
putSerializableObject
(
Constants
.
NEWS_HEAD_LIST
,
data
)
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求HeadList成功"
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求HeadList成功"
getShareConfig
()
getShareConfig
()
}
}
})
})
}
}
private
fun
getShareConfig
(){
private
fun
getShareConfig
()
{
RetrofitClient
.
retrofitService
RetrofitClient
.
retrofitService
.
getShareConfig
()
.
getShareConfig
()
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
compose
(
NetworkTransformer
(
mView
,
false
))
.
subscribe
(
object
:
RxCallback
<
ShareBean
>()
{
.
subscribe
(
object
:
RxCallback
<
ShareBean
>()
{
override
fun
onSuccess
(
data
:
ShareBean
?)
{
override
fun
onSuccess
(
data
:
ShareBean
?)
{
SPUtil
.
putSerializableObject
(
Constants
.
COMMON_SHARE_BEAN
,
data
)
SPUtil
.
putSerializableObject
(
Constants
.
COMMON_SHARE_BEAN
,
data
)
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求shareConfig成功"
mTvMessage
?.
text
=
mTvMessage
?.
text
.
toString
()
+
"\n"
+
"请求shareConfig成功"
mView
?.
onAvatarUrlRequest
()
mView
?.
onAvatarUrlRequest
()
}
}
...
...
app/src/main/java/com/hupu/tv/player/app/utils/DialogUtils.kt
View file @
814b47f7
...
@@ -23,10 +23,7 @@ import com.softgarden.baselibrary.utils.SPUtil
...
@@ -23,10 +23,7 @@ import com.softgarden.baselibrary.utils.SPUtil
import
com.softgarden.baselibrary.utils.ToastUtil
import
com.softgarden.baselibrary.utils.ToastUtil
import
com.hupu.tv.player.app.R
import
com.hupu.tv.player.app.R
import
com.hupu.tv.player.app.app.Constants
import
com.hupu.tv.player.app.app.Constants
import
com.hupu.tv.player.app.bean.GiftBean
import
com.hupu.tv.player.app.bean.*
import
com.hupu.tv.player.app.bean.LiveUserBean
import
com.hupu.tv.player.app.bean.MatchLiveBean
import
com.hupu.tv.player.app.bean.UserBean
import
com.hupu.tv.player.app.event.GiftEvent
import
com.hupu.tv.player.app.event.GiftEvent
import
com.hupu.tv.player.app.ui.activity.LoginActivity
import
com.hupu.tv.player.app.ui.activity.LoginActivity
import
com.hupu.tv.player.app.ui.adapter.GiftAdapter
import
com.hupu.tv.player.app.ui.adapter.GiftAdapter
...
@@ -61,6 +58,16 @@ object DialogUtils {
...
@@ -61,6 +58,16 @@ object DialogUtils {
}
}
}
}
fun
showAdDialog
(
activity
:
AppCompatActivity
?){
CustomDialog
.
show
(
activity
,
R
.
layout
.
ad_dialog
)
{
dialog
:
CustomDialog
,
v
:
View
->
setView
(
dialog
)
val
main
=
SPUtil
.
getSerializableObject
<
ArrayList
<
BannerBean
>>(
Constants
.
MAIN_BANNER
)
if
(
main
?.
isNotEmpty
()
==
true
){
GlideUtils
.
loadImage
(
activity
,
main
[
0
].
picPath
,
v
.
findViewById
(
R
.
id
.
iv_img
))
}
}
}
fun
showGiftList
(
activity
:
AppCompatActivity
?)
{
fun
showGiftList
(
activity
:
AppCompatActivity
?)
{
val
list
=
SPUtil
.
getSerializableObject
<
ArrayList
<
GiftBean
>>(
Constants
.
GIFT_BEAN
)
val
list
=
SPUtil
.
getSerializableObject
<
ArrayList
<
GiftBean
>>(
Constants
.
GIFT_BEAN
)
if
(
list
!=
null
&&
list
.
size
!=
0
)
{
if
(
list
!=
null
&&
list
.
size
!=
0
)
{
...
...
app/src/main/java/com/hupu/tv/player/app/widget/CustomEaseChatLayout.java
View file @
814b47f7
...
@@ -20,9 +20,11 @@ import android.widget.RelativeLayout;
...
@@ -20,9 +20,11 @@ import android.widget.RelativeLayout;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.blankj.utilcode.util.ToastUtils
;
import
com.hupu.tv.player.app.R
;
import
com.hupu.tv.player.app.R
;
import
com.hupu.tv.player.app.event.RefreshPageEvent
;
import
com.hupu.tv.player.app.event.RefreshPageEvent
;
import
com.hupu.tv.player.app.event.ReportEvent
;
import
com.hupu.tv.player.app.event.ReportEvent
;
import
com.hyphenate.EMCallBack
;
import
com.hyphenate.EMConversationListener
;
import
com.hyphenate.EMConversationListener
;
import
com.hyphenate.EMMessageListener
;
import
com.hyphenate.EMMessageListener
;
import
com.hyphenate.chat.EMChatManager
;
import
com.hyphenate.chat.EMChatManager
;
...
@@ -30,6 +32,7 @@ import com.hyphenate.chat.EMClient;
...
@@ -30,6 +32,7 @@ import com.hyphenate.chat.EMClient;
import
com.hyphenate.chat.EMCmdMessageBody
;
import
com.hyphenate.chat.EMCmdMessageBody
;
import
com.hyphenate.chat.EMConversation
;
import
com.hyphenate.chat.EMConversation
;
import
com.hyphenate.chat.EMMessage
;
import
com.hyphenate.chat.EMMessage
;
import
com.hyphenate.chat.EMMessageBody
;
import
com.hyphenate.chat.EMTextMessageBody
;
import
com.hyphenate.chat.EMTextMessageBody
;
import
com.hyphenate.chat.adapter.EMAChatRoomManagerListener
;
import
com.hyphenate.chat.adapter.EMAChatRoomManagerListener
;
import
com.hyphenate.easeui.EaseIM
;
import
com.hyphenate.easeui.EaseIM
;
...
@@ -64,6 +67,7 @@ import com.hyphenate.easeui.widget.EaseAlertDialog;
...
@@ -64,6 +67,7 @@ import com.hyphenate.easeui.widget.EaseAlertDialog;
import
com.hyphenate.easeui.widget.EaseVoiceRecorderView
;
import
com.hyphenate.easeui.widget.EaseVoiceRecorderView
;
import
com.hyphenate.exceptions.HyphenateException
;
import
com.hyphenate.exceptions.HyphenateException
;
import
com.hyphenate.util.EMLog
;
import
com.hyphenate.util.EMLog
;
import
com.softgarden.baselibrary.utils.ToastUtil
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.EventBus
;
...
@@ -123,6 +127,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -123,6 +127,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
private
EasePopupWindowHelper
menuHelper
;
private
EasePopupWindowHelper
menuHelper
;
private
ClipboardManager
clipboard
;
private
ClipboardManager
clipboard
;
private
OnMenuChangeListener
menuChangeListener
;
private
OnMenuChangeListener
menuChangeListener
;
private
OnSendMessageListener
sendMessageListener
;
/**
/**
* 撤回监听
* 撤回监听
*/
*/
...
@@ -155,7 +161,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -155,7 +161,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
public
CustomEaseChatLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
CustomEaseChatLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
super
(
context
,
attrs
,
defStyleAttr
);
presenter
=
new
EaseHandleMessagePresenterImpl
();
presenter
=
new
EaseHandleMessagePresenterImpl
();
if
(
context
instanceof
AppCompatActivity
)
{
if
(
context
instanceof
AppCompatActivity
)
{
((
AppCompatActivity
)
context
).
getLifecycle
().
addObserver
(
presenter
);
((
AppCompatActivity
)
context
).
getLifecycle
().
addObserver
(
presenter
);
}
}
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
custom_ease_layout_chat
,
this
);
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
custom_ease_layout_chat
,
this
);
...
@@ -185,6 +191,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -185,6 +191,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 初始化
* 初始化
*
* @param username 环信id
* @param username 环信id
* @param chatType 聊天类型,单聊,群聊或者聊天室
* @param chatType 聊天类型,单聊,群聊或者聊天室
*/
*/
...
@@ -194,6 +201,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -194,6 +201,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 初始化
* 初始化
*
* @param loadDataType 加载数据模式
* @param loadDataType 加载数据模式
* @param conversationId 会话id,可能是对方环信id,也可能是群id或者聊天室id
* @param conversationId 会话id,可能是对方环信id,也可能是群id或者聊天室id
* @param chatType 聊天类型,单聊,群聊或者聊天室
* @param chatType 聊天类型,单聊,群聊或者聊天室
...
@@ -203,10 +211,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -203,10 +211,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
this
.
chatType
=
chatType
;
this
.
chatType
=
chatType
;
messageListLayout
.
init
(
loadDataType
,
this
.
conversationId
,
chatType
);
messageListLayout
.
init
(
loadDataType
,
this
.
conversationId
,
chatType
);
presenter
.
setupWithToUser
(
chatType
,
this
.
conversationId
);
presenter
.
setupWithToUser
(
chatType
,
this
.
conversationId
);
if
(
isChatRoomCon
())
{
if
(
isChatRoomCon
())
{
chatRoomListener
=
new
ChatRoomListener
();
chatRoomListener
=
new
ChatRoomListener
();
EMClient
.
getInstance
().
chatroomManager
().
addChatRoomChangeListener
(
chatRoomListener
);
EMClient
.
getInstance
().
chatroomManager
().
addChatRoomChangeListener
(
chatRoomListener
);
}
else
if
(
isGroupCon
())
{
}
else
if
(
isGroupCon
())
{
EaseAtMessageHelper
.
get
().
removeAtMeGroup
(
conversationId
);
EaseAtMessageHelper
.
get
().
removeAtMeGroup
(
conversationId
);
groupListener
=
new
GroupListener
();
groupListener
=
new
GroupListener
();
EMClient
.
getInstance
().
groupManager
().
addGroupChangeListener
(
groupListener
);
EMClient
.
getInstance
().
groupManager
().
addGroupChangeListener
(
groupListener
);
...
@@ -216,6 +224,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -216,6 +224,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 初始化历史消息搜索模式
* 初始化历史消息搜索模式
*
* @param toChatUsername
* @param toChatUsername
* @param chatType
* @param chatType
*/
*/
...
@@ -238,15 +247,16 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -238,15 +247,16 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
messageListLayout
.
loadData
(
msgId
);
messageListLayout
.
loadData
(
msgId
);
}
}
private
void
initTypingHandler
()
{
private
void
initTypingHandler
()
{
typingHandler
=
new
Handler
()
{
typingHandler
=
new
Handler
()
{
@Override
@Override
public
void
handleMessage
(
@NonNull
Message
msg
)
{
public
void
handleMessage
(
@NonNull
Message
msg
)
{
switch
(
msg
.
what
)
{
switch
(
msg
.
what
)
{
case
MSG_TYPING_HEARTBEAT
:
case
MSG_TYPING_HEARTBEAT:
setTypingBeginMsg
(
this
);
setTypingBeginMsg
(
this
);
break
;
break
;
case
MSG_TYPING_END
:
case
MSG_TYPING_END:
setTypingEndMsg
(
this
);
setTypingEndMsg
(
this
);
break
;
break
;
case
MSG_OTHER_TYPING_END:
case
MSG_OTHER_TYPING_END:
...
@@ -255,8 +265,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -255,8 +265,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
}
}
}
}
};
};
if
(!
turnOnTyping
)
{
if
(!
turnOnTyping
)
{
if
(
typingHandler
!=
null
)
{
if
(
typingHandler
!=
null
)
{
typingHandler
.
removeCallbacksAndMessages
(
null
);
typingHandler
.
removeCallbacksAndMessages
(
null
);
}
}
}
}
...
@@ -269,9 +279,9 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -269,9 +279,9 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
* (2)如果是多端设备,另一端将会收到channel ack的回调,SDK内部将会把该会话置为已读。
* (2)如果是多端设备,另一端将会收到channel ack的回调,SDK内部将会把该会话置为已读。
*/
*/
private
void
sendChannelAck
()
{
private
void
sendChannelAck
()
{
if
(
EaseIM
.
getInstance
().
getConfigsManager
().
enableSendChannelAck
())
{
if
(
EaseIM
.
getInstance
().
getConfigsManager
().
enableSendChannelAck
())
{
EMConversation
conversation
=
EMClient
.
getInstance
().
chatManager
().
getConversation
(
conversationId
);
EMConversation
conversation
=
EMClient
.
getInstance
().
chatManager
().
getConversation
(
conversationId
);
if
(
conversation
==
null
||
conversation
.
getUnreadMsgCount
()
<=
0
)
{
if
(
conversation
==
null
||
conversation
.
getUnreadMsgCount
()
<=
0
)
{
return
;
return
;
}
}
try
{
try
{
...
@@ -284,6 +294,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -284,6 +294,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 对方输入状态中止
* 对方输入状态中止
*
* @param handler
* @param handler
*/
*/
private
void
setOtherTypingEnd
(
Handler
handler
)
{
private
void
setOtherTypingEnd
(
Handler
handler
)
{
...
@@ -294,13 +305,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -294,13 +305,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
if
(
chatType
!=
EaseConstant
.
CHATTYPE_SINGLE
)
if
(
chatType
!=
EaseConstant
.
CHATTYPE_SINGLE
)
return
;
return
;
handler
.
removeMessages
(
MSG_OTHER_TYPING_END
);
handler
.
removeMessages
(
MSG_OTHER_TYPING_END
);
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onOtherTyping
(
ACTION_TYPING_END
);
listener
.
onOtherTyping
(
ACTION_TYPING_END
);
}
}
}
}
/**
/**
* 处理“正在输入”开始
* 处理“正在输入”开始
*
* @param handler
* @param handler
*/
*/
private
void
setTypingBeginMsg
(
Handler
handler
)
{
private
void
setTypingBeginMsg
(
Handler
handler
)
{
...
@@ -315,6 +327,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -315,6 +327,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 处理“正在输入”结束
* 处理“正在输入”结束
*
* @param handler
* @param handler
*/
*/
private
void
setTypingEndMsg
(
Handler
handler
)
{
private
void
setTypingEndMsg
(
Handler
handler
)
{
...
@@ -333,6 +346,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -333,6 +346,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 是否是聊天室
* 是否是聊天室
*
* @return
* @return
*/
*/
public
boolean
isChatRoomCon
()
{
public
boolean
isChatRoomCon
()
{
...
@@ -341,6 +355,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -341,6 +355,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 是否是群聊
* 是否是群聊
*
* @return
* @return
*/
*/
public
boolean
isGroupCon
()
{
public
boolean
isGroupCon
()
{
...
@@ -365,7 +380,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -365,7 +380,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
turnOnTypingMonitor
(
boolean
turnOn
)
{
public
void
turnOnTypingMonitor
(
boolean
turnOn
)
{
this
.
turnOnTyping
=
turnOn
;
this
.
turnOnTyping
=
turnOn
;
if
(!
turnOn
)
{
if
(!
turnOn
)
{
isNotFirstSend
=
false
;
isNotFirstSend
=
false
;
}
}
}
}
...
@@ -475,6 +490,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -475,6 +490,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 发送逻辑:如果正在输入,第一次发送一条cmd消息,然后每隔10s发送一次;
* 发送逻辑:如果正在输入,第一次发送一条cmd消息,然后每隔10s发送一次;
* 如果停止发送超过10s后,则状态需重置。
* 如果停止发送超过10s后,则状态需重置。
*
* @param s
* @param s
* @param start
* @param start
* @param before
* @param before
...
@@ -482,12 +498,12 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -482,12 +498,12 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
*/
*/
@Override
@Override
public
void
onTyping
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
public
void
onTyping
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onTextChanged
(
s
,
start
,
before
,
count
);
listener
.
onTextChanged
(
s
,
start
,
before
,
count
);
}
}
if
(
turnOnTyping
)
{
if
(
turnOnTyping
)
{
if
(
typingHandler
!=
null
)
{
if
(
typingHandler
!=
null
)
{
if
(!
isNotFirstSend
)
{
if
(!
isNotFirstSend
)
{
isNotFirstSend
=
true
;
isNotFirstSend
=
true
;
typingHandler
.
sendEmptyMessage
(
MSG_TYPING_HEARTBEAT
);
typingHandler
.
sendEmptyMessage
(
MSG_TYPING_HEARTBEAT
);
}
}
...
@@ -504,14 +520,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -504,14 +520,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onExpressionClicked
(
Object
emojicon
)
{
public
void
onExpressionClicked
(
Object
emojicon
)
{
if
(
emojicon
instanceof
EaseEmojicon
)
{
if
(
emojicon
instanceof
EaseEmojicon
)
{
presenter
.
sendBigExpressionMessage
(((
EaseEmojicon
)
emojicon
).
getName
(),
((
EaseEmojicon
)
emojicon
).
getIdentityCode
());
presenter
.
sendBigExpressionMessage
(((
EaseEmojicon
)
emojicon
).
getName
(),
((
EaseEmojicon
)
emojicon
).
getIdentityCode
());
}
}
}
}
@Override
@Override
public
boolean
onPressToSpeakBtnTouch
(
View
v
,
MotionEvent
event
)
{
public
boolean
onPressToSpeakBtnTouch
(
View
v
,
MotionEvent
event
)
{
if
(
recordTouchListener
!=
null
&&
recordTouchListener
.
onRecordTouch
(
v
,
event
))
{
if
(
recordTouchListener
!=
null
&&
recordTouchListener
.
onRecordTouch
(
v
,
event
))
{
return
recordTouchListener
.
onRecordTouch
(
v
,
event
);
return
recordTouchListener
.
onRecordTouch
(
v
,
event
);
}
}
return
voiceRecorder
.
onPressToSpeakBtnTouch
(
v
,
event
,
(
this
::
sendVoiceMessage
));
return
voiceRecorder
.
onPressToSpeakBtnTouch
(
v
,
event
,
(
this
::
sendVoiceMessage
));
...
@@ -519,7 +535,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -519,7 +535,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onChatExtendMenuItemClick
(
int
itemId
,
View
view
)
{
public
void
onChatExtendMenuItemClick
(
int
itemId
,
View
view
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onChatExtendMenuItemClick
(
view
,
itemId
);
listener
.
onChatExtendMenuItemClick
(
view
,
itemId
);
}
}
}
}
...
@@ -547,24 +563,25 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -547,24 +563,25 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
refresh
=
true
;
refresh
=
true
;
}
}
}
}
if
(
refresh
)
{
if
(
refresh
)
{
getChatMessageListLayout
().
refreshToLatest
();
getChatMessageListLayout
().
refreshToLatest
();
}
}
}
}
/**
/**
* 发送群组已读回执
* 发送群组已读回执
*
* @param message
* @param message
*/
*/
public
void
sendReadAck
(
EMMessage
message
)
{
public
void
sendReadAck
(
EMMessage
message
)
{
if
(
EaseIM
.
getInstance
().
getConfigsManager
().
enableSendChannelAck
())
{
if
(
EaseIM
.
getInstance
().
getConfigsManager
().
enableSendChannelAck
())
{
//是接收的消息,未发送过read ack消息且是单聊
//是接收的消息,未发送过read ack消息且是单聊
if
(
message
.
direct
()
==
EMMessage
.
Direct
.
RECEIVE
if
(
message
.
direct
()
==
EMMessage
.
Direct
.
RECEIVE
&&
!
message
.
isAcked
()
&&
!
message
.
isAcked
()
&&
message
.
getChatType
()
==
EMMessage
.
ChatType
.
Chat
)
{
&&
message
.
getChatType
()
==
EMMessage
.
ChatType
.
Chat
)
{
EMMessage
.
Type
type
=
message
.
getType
();
EMMessage
.
Type
type
=
message
.
getType
();
//视频,语音及文件需要点击后再发送
//视频,语音及文件需要点击后再发送
if
(
type
==
EMMessage
.
Type
.
VIDEO
||
type
==
EMMessage
.
Type
.
VOICE
||
type
==
EMMessage
.
Type
.
FILE
)
{
if
(
type
==
EMMessage
.
Type
.
VIDEO
||
type
==
EMMessage
.
Type
.
VOICE
||
type
==
EMMessage
.
Type
.
FILE
)
{
return
;
return
;
}
}
try
{
try
{
...
@@ -578,10 +595,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -578,10 +595,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 发送群组已读回执
* 发送群组已读回执
*
* @param message
* @param message
*/
*/
private
void
sendGroupReadAck
(
EMMessage
message
)
{
private
void
sendGroupReadAck
(
EMMessage
message
)
{
if
(
message
.
isNeedGroupAck
()
&&
message
.
isUnread
())
{
if
(
message
.
isNeedGroupAck
()
&&
message
.
isUnread
())
{
try
{
try
{
EMClient
.
getInstance
().
chatManager
().
ackGroupMessageRead
(
message
.
getTo
(),
message
.
getMsgId
(),
""
);
EMClient
.
getInstance
().
chatManager
().
ackGroupMessageRead
(
message
.
getTo
(),
message
.
getMsgId
(),
""
);
}
catch
(
HyphenateException
e
)
{
}
catch
(
HyphenateException
e
)
{
...
@@ -593,6 +611,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -593,6 +611,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* 接收到正在输入动作的处理逻辑:
* 接收到正在输入动作的处理逻辑:
* 如果接收到正在输入的消息,则开始计时,5s内如果没有接收到新的消息,则输入状态结束
* 如果接收到正在输入的消息,则开始计时,5s内如果没有接收到新的消息,则输入状态结束
*
* @param messages
* @param messages
*/
*/
@Override
@Override
...
@@ -602,11 +621,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -602,11 +621,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
final
EMCmdMessageBody
body
=
(
EMCmdMessageBody
)
msg
.
getBody
();
final
EMCmdMessageBody
body
=
(
EMCmdMessageBody
)
msg
.
getBody
();
EMLog
.
i
(
TAG
,
"Receive cmd message: "
+
body
.
action
()
+
" - "
+
body
.
isDeliverOnlineOnly
());
EMLog
.
i
(
TAG
,
"Receive cmd message: "
+
body
.
action
()
+
" - "
+
body
.
isDeliverOnlineOnly
());
EaseThreadManager
.
getInstance
().
runOnMainThread
(()
->
{
EaseThreadManager
.
getInstance
().
runOnMainThread
(()
->
{
if
(
TextUtils
.
equals
(
msg
.
getFrom
(),
conversationId
))
{
if
(
TextUtils
.
equals
(
msg
.
getFrom
(),
conversationId
))
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onOtherTyping
(
body
.
action
());
listener
.
onOtherTyping
(
body
.
action
());
}
}
if
(
typingHandler
!=
null
)
{
if
(
typingHandler
!=
null
)
{
typingHandler
.
removeMessages
(
MSG_OTHER_TYPING_END
);
typingHandler
.
removeMessages
(
MSG_OTHER_TYPING_END
);
typingHandler
.
sendEmptyMessageDelayed
(
MSG_OTHER_TYPING_END
,
OTHER_TYPING_SHOW_TIME
);
typingHandler
.
sendEmptyMessageDelayed
(
MSG_OTHER_TYPING_END
,
OTHER_TYPING_SHOW_TIME
);
}
}
...
@@ -627,7 +646,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -627,7 +646,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onMessageRecalled
(
List
<
EMMessage
>
messages
)
{
public
void
onMessageRecalled
(
List
<
EMMessage
>
messages
)
{
if
(
getChatMessageListLayout
()
!=
null
)
{
if
(
getChatMessageListLayout
()
!=
null
)
{
getChatMessageListLayout
().
refreshMessages
();
getChatMessageListLayout
().
refreshMessages
();
}
}
}
}
...
@@ -638,7 +657,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -638,7 +657,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
}
}
private
void
refreshMessage
(
EMMessage
message
)
{
private
void
refreshMessage
(
EMMessage
message
)
{
if
(
getChatMessageListLayout
()
!=
null
)
{
if
(
getChatMessageListLayout
()
!=
null
)
{
getChatMessageListLayout
().
refreshMessage
(
message
);
getChatMessageListLayout
().
refreshMessage
(
message
);
}
}
}
}
...
@@ -656,7 +675,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -656,7 +675,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
createThumbFileFail
(
String
message
)
{
public
void
createThumbFileFail
(
String
message
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onChatError
(-
1
,
message
);
listener
.
onChatError
(-
1
,
message
);
}
}
}
}
...
@@ -664,33 +683,62 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -664,33 +683,62 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
addMsgAttrBeforeSend
(
EMMessage
message
)
{
public
void
addMsgAttrBeforeSend
(
EMMessage
message
)
{
//发送消息前,添加消息属性,比如设置ext
//发送消息前,添加消息属性,比如设置ext
if
(
sendMsgEvent
!=
null
&&
sendMsgEvent
.
addMsgAttrsBeforeSend
(
message
))
{
if
(
sendMsgEvent
!=
null
&&
sendMsgEvent
.
addMsgAttrsBeforeSend
(
message
))
{
sendMsgEvent
.
addMsgAttrsBeforeSend
(
message
);
sendMsgEvent
.
addMsgAttrsBeforeSend
(
message
);
}
}
}
}
@Override
@Override
public
void
sendMessageFail
(
String
message
)
{
public
void
sendMessageFail
(
String
message
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onChatError
(-
1
,
message
);
listener
.
onChatError
(-
1
,
message
);
}
}
}
}
@Override
@Override
public
void
sendMessageFinish
(
EMMessage
message
)
{
public
void
sendMessageFinish
(
EMMessage
message
)
{
if
(
getChatMessageListLayout
()
!=
null
)
{
message
.
setMessageStatusCallback
(
new
EMCallBack
()
{
@Override
public
void
onSuccess
()
{
if
(
sendMessageListener
!=
null
)
{
if
(
message
.
getBody
()
instanceof
EMTextMessageBody
)
{
EMTextMessageBody
body
=
(
EMTextMessageBody
)
message
.
getBody
();
sendMessageListener
.
send
(
body
.
getMessage
());
}
}
if
(
getChatMessageListLayout
()
!=
null
)
{
getChatMessageListLayout
().
refreshToLatest
();
getChatMessageListLayout
().
refreshToLatest
();
}
}
}
}
@Override
@Override
public
void
onError
(
int
code
,
String
error
)
{
if
(
code
==
215
)
{
ToastUtil
.
Companion
.
s
(
"您已被禁言"
);
}
}
@Override
public
void
onProgress
(
int
progress
,
String
status
)
{
}
});
}
public
void
setOnSendMessageListener
(
OnSendMessageListener
onSendMessageListener
)
{
sendMessageListener
=
onSendMessageListener
;
}
@Override
public
void
deleteLocalMessageSuccess
(
EMMessage
message
)
{
public
void
deleteLocalMessageSuccess
(
EMMessage
message
)
{
messageListLayout
.
removeMessage
(
message
);
messageListLayout
.
removeMessage
(
message
);
}
}
@Override
@Override
public
void
recallMessageFinish
(
EMMessage
message
)
{
public
void
recallMessageFinish
(
EMMessage
message
)
{
if
(
recallMessageListener
!=
null
)
{
if
(
recallMessageListener
!=
null
)
{
recallMessageListener
.
recallSuccess
(
message
);
recallMessageListener
.
recallSuccess
(
message
);
}
}
messageListLayout
.
refreshMessages
();
messageListLayout
.
refreshMessages
();
...
@@ -698,10 +746,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -698,10 +746,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
recallMessageFail
(
int
code
,
String
message
)
{
public
void
recallMessageFail
(
int
code
,
String
message
)
{
if
(
recallMessageListener
!=
null
)
{
if
(
recallMessageListener
!=
null
)
{
recallMessageListener
.
recallFail
(
code
,
message
);
recallMessageListener
.
recallFail
(
code
,
message
);
}
}
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onChatError
(
code
,
message
);
listener
.
onChatError
(
code
,
message
);
}
}
}
}
...
@@ -720,7 +768,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -720,7 +768,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
boolean
onBubbleClick
(
EMMessage
message
)
{
public
boolean
onBubbleClick
(
EMMessage
message
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
return
listener
.
onBubbleClick
(
message
);
return
listener
.
onBubbleClick
(
message
);
}
}
return
false
;
return
false
;
...
@@ -743,14 +791,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -743,14 +791,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
boolean
onBubbleLongClick
(
View
v
,
EMMessage
message
)
{
public
boolean
onBubbleLongClick
(
View
v
,
EMMessage
message
)
{
if
(
showDefaultMenu
)
{
if
(
showDefaultMenu
)
{
showDefaultMenu
(
v
,
message
);
showDefaultMenu
(
v
,
message
);
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
return
listener
.
onBubbleLongClick
(
v
,
message
);
return
listener
.
onBubbleLongClick
(
v
,
message
);
}
}
return
true
;
return
true
;
}
}
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
return
listener
.
onBubbleLongClick
(
v
,
message
);
return
listener
.
onBubbleLongClick
(
v
,
message
);
}
}
return
false
;
return
false
;
...
@@ -758,7 +806,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -758,7 +806,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onUserAvatarClick
(
String
username
)
{
public
void
onUserAvatarClick
(
String
username
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onUserAvatarClick
(
username
);
listener
.
onUserAvatarClick
(
username
);
}
}
}
}
...
@@ -767,7 +815,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -767,7 +815,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
public
void
onUserAvatarLongClick
(
String
username
)
{
public
void
onUserAvatarLongClick
(
String
username
)
{
EMLog
.
i
(
TAG
,
"onUserAvatarLongClick"
);
EMLog
.
i
(
TAG
,
"onUserAvatarLongClick"
);
inputAtUsername
(
username
,
true
);
inputAtUsername
(
username
,
true
);
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onUserAvatarLongClick
(
username
);
listener
.
onUserAvatarLongClick
(
username
);
}
}
}
}
...
@@ -787,7 +835,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -787,7 +835,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onMessageError
(
EMMessage
message
,
int
code
,
String
error
)
{
public
void
onMessageError
(
EMMessage
message
,
int
code
,
String
error
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onChatError
(
code
,
error
);
listener
.
onChatError
(
code
,
error
);
}
}
}
}
...
@@ -800,7 +848,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -800,7 +848,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onChatError
(
int
code
,
String
errorMsg
)
{
public
void
onChatError
(
int
code
,
String
errorMsg
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onChatError
(
code
,
errorMsg
);
listener
.
onChatError
(
code
,
errorMsg
);
}
}
}
}
...
@@ -848,20 +896,21 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -848,20 +896,21 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* input @
* input @
* only for group chat
* only for group chat
*
* @param username
* @param username
*/
*/
public
void
inputAtUsername
(
String
username
,
boolean
autoAddAtSymbol
){
public
void
inputAtUsername
(
String
username
,
boolean
autoAddAtSymbol
)
{
if
(
EMClient
.
getInstance
().
getCurrentUser
().
equals
(
username
)
||
if
(
EMClient
.
getInstance
().
getCurrentUser
().
equals
(
username
)
||
!
messageListLayout
.
isGroupChat
()){
!
messageListLayout
.
isGroupChat
())
{
return
;
return
;
}
}
EaseAtMessageHelper
.
get
().
addAtUser
(
username
);
EaseAtMessageHelper
.
get
().
addAtUser
(
username
);
EaseUser
user
=
EaseUserUtils
.
getUserInfo
(
username
);
EaseUser
user
=
EaseUserUtils
.
getUserInfo
(
username
);
if
(
user
!=
null
){
if
(
user
!=
null
)
{
username
=
user
.
getNickname
();
username
=
user
.
getNickname
();
}
}
EditText
editText
=
inputMenu
.
getPrimaryMenu
().
getEditText
();
EditText
editText
=
inputMenu
.
getPrimaryMenu
().
getEditText
();
if
(
autoAddAtSymbol
)
if
(
autoAddAtSymbol
)
insertText
(
editText
,
AT_PREFIX
+
username
+
AT_SUFFIX
);
insertText
(
editText
,
AT_PREFIX
+
username
+
AT_SUFFIX
);
else
else
insertText
(
editText
,
username
+
AT_SUFFIX
);
insertText
(
editText
,
username
+
AT_SUFFIX
);
...
@@ -869,13 +918,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -869,13 +918,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/**
/**
* insert text to EditText
* insert text to EditText
*
* @param edit
* @param edit
* @param text
* @param text
*/
*/
private
void
insertText
(
EditText
edit
,
String
text
)
{
private
void
insertText
(
EditText
edit
,
String
text
)
{
if
(
edit
.
isFocused
())
{
if
(
edit
.
isFocused
())
{
edit
.
getText
().
insert
(
edit
.
getSelectionStart
(),
text
);
edit
.
getText
().
insert
(
edit
.
getSelectionStart
(),
text
);
}
else
{
}
else
{
edit
.
getText
().
insert
(
edit
.
getText
().
length
()
-
1
,
text
);
edit
.
getText
().
insert
(
edit
.
getText
().
length
()
-
1
,
text
);
}
}
}
}
...
@@ -888,14 +938,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -888,14 +938,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
menuHelper
.
addItemMenu
(
bean
);
menuHelper
.
addItemMenu
(
bean
);
menuHelper
.
setOutsideTouchable
(
true
);
menuHelper
.
setOutsideTouchable
(
true
);
setMenuByMsgType
(
message
);
setMenuByMsgType
(
message
);
if
(
menuChangeListener
!=
null
)
{
if
(
menuChangeListener
!=
null
)
{
menuChangeListener
.
onPreMenu
(
menuHelper
,
message
);
menuChangeListener
.
onPreMenu
(
menuHelper
,
message
);
}
}
menuHelper
.
setOnPopupMenuItemClickListener
(
item
->
{
menuHelper
.
setOnPopupMenuItemClickListener
(
item
->
{
if
(
menuChangeListener
!=
null
&&
menuChangeListener
.
onMenuItemClick
(
item
,
message
))
{
if
(
menuChangeListener
!=
null
&&
menuChangeListener
.
onMenuItemClick
(
item
,
message
))
{
return
true
;
return
true
;
}
}
if
(
showDefaultMenu
)
{
if
(
showDefaultMenu
)
{
int
itemId
=
item
.
getItemId
();
int
itemId
=
item
.
getItemId
();
if
(
itemId
==
R
.
id
.
action_ban_member
)
{
if
(
itemId
==
R
.
id
.
action_ban_member
)
{
EventBus
.
getDefault
().
post
(
new
ReportEvent
());
EventBus
.
getDefault
().
post
(
new
ReportEvent
());
...
@@ -915,7 +965,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -915,7 +965,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
return
false
;
return
false
;
});
});
menuHelper
.
setOnPopupMenuDismissListener
(
menu
->
{
menuHelper
.
setOnPopupMenuDismissListener
(
menu
->
{
if
(
menuChangeListener
!=
null
)
{
if
(
menuChangeListener
!=
null
)
{
menuChangeListener
.
onDismiss
(
menu
);
menuChangeListener
.
onDismiss
(
menu
);
}
}
});
});
...
@@ -950,7 +1000,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -950,7 +1000,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
break
;
break
;
}
}
if
(
message
.
direct
()
==
EMMessage
.
Direct
.
RECEIVE
)
{
if
(
message
.
direct
()
==
EMMessage
.
Direct
.
RECEIVE
)
{
menuHelper
.
findItemVisible
(
R
.
id
.
action_chat_recall
,
false
);
menuHelper
.
findItemVisible
(
R
.
id
.
action_chat_recall
,
false
);
}
}
}
}
...
@@ -964,10 +1014,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -964,10 +1014,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override
@Override
public
void
onRemovedFromChatRoom
(
int
reason
,
String
roomId
,
String
roomName
,
String
participant
)
{
public
void
onRemovedFromChatRoom
(
int
reason
,
String
roomId
,
String
roomName
,
String
participant
)
{
if
(!
TextUtils
.
equals
(
roomId
,
conversationId
))
{
if
(!
TextUtils
.
equals
(
roomId
,
conversationId
))
{
return
;
return
;
}
}
if
(
reason
==
EMAChatRoomManagerListener
.
BE_KICKED
)
{
if
(
reason
==
EMAChatRoomManagerListener
.
BE_KICKED
)
{
finishCurrent
();
finishCurrent
();
}
}
}
}
...
@@ -1003,10 +1053,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
...
@@ -1003,10 +1053,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
* finish current activity
* finish current activity
*/
*/
private
void
finishCurrent
()
{
private
void
finishCurrent
()
{
if
(
getContext
()
instanceof
Activity
)
{
if
(
getContext
()
instanceof
Activity
)
{
((
Activity
)
getContext
()).
finish
();
((
Activity
)
getContext
()).
finish
();
}
}
}
}
public
interface
OnSendMessageListener
{
void
send
(
String
message
);
}
}
}
app/src/main/java/com/hupu/tv/player/app/widget/danmuku/CustomChatPrimaryMenu.java
View file @
814b47f7
...
@@ -49,7 +49,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
...
@@ -49,7 +49,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
private
ImageView
faceChecked
;
private
ImageView
faceChecked
;
private
CheckBox
buttonMore
;
private
CheckBox
buttonMore
;
private
Button
buttonSend
;
private
Button
buttonSend
;
private
OnSendMessageListener
sendMessageListener
;
private
EaseChatPrimaryMenuListener
listener
;
private
EaseChatPrimaryMenuListener
listener
;
private
EaseInputMenuStyle
menuType
=
EaseInputMenuStyle
.
All
;
//菜单展示形式
private
EaseInputMenuStyle
menuType
=
EaseInputMenuStyle
.
All
;
//菜单展示形式
...
@@ -72,9 +72,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
...
@@ -72,9 +72,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
initViews
();
initViews
();
}
}
public
void
setOnSendMessageListener
(
OnSendMessageListener
onSendMessageListener
)
{
sendMessageListener
=
onSendMessageListener
;
}
private
void
initViews
()
{
private
void
initViews
()
{
rlBottom
=
findViewById
(
R
.
id
.
rl_bottom
);
rlBottom
=
findViewById
(
R
.
id
.
rl_bottom
);
...
@@ -285,9 +283,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
...
@@ -285,9 +283,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
String
s
=
editText
.
getText
().
toString
();
String
s
=
editText
.
getText
().
toString
();
editText
.
setText
(
""
);
editText
.
setText
(
""
);
listener
.
onSendBtnClicked
(
s
);
listener
.
onSendBtnClicked
(
s
);
if
(
sendMessageListener
!=
null
)
{
sendMessageListener
.
send
(
s
);
}
}
}
}
else
if
(
id
==
R
.
id
.
btn_set_mode_voice
)
{
//切换到语音模式
}
else
if
(
id
==
R
.
id
.
btn_set_mode_voice
)
{
//切换到语音模式
// showVoiceStatus();
// showVoiceStatus();
...
@@ -359,9 +355,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
...
@@ -359,9 +355,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
public
void
onClickKeyboardSendBtn
(
String
content
)
{
public
void
onClickKeyboardSendBtn
(
String
content
)
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
onSendBtnClicked
(
content
);
listener
.
onSendBtnClicked
(
content
);
if
(
sendMessageListener
!=
null
)
{
sendMessageListener
.
send
(
content
);
}
}
}
}
}
...
@@ -466,8 +460,6 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
...
@@ -466,8 +460,6 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
Log
.
e
(
"TAG"
,
this
.
getClass
().
getSimpleName
()
+
" afterTextChanged s:"
+
s
);
Log
.
e
(
"TAG"
,
this
.
getClass
().
getSimpleName
()
+
" afterTextChanged s:"
+
s
);
}
}
public
interface
OnSendMessageListener
{
void
send
(
String
message
);
}
}
}
app/src/main/res/layout/ad_dialog.xml
0 → 100644
View file @
814b47f7
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/shape_bg_dialog_white"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_gravity=
"center"
android:layout_width=
"260dp"
android:layout_height=
"300dp"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_img"
android:scaleType=
"centerCrop"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment