Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
杨凯
YDL-Component-Medical
Commits
ca3a5007
Commit
ca3a5007
authored
Dec 20, 2019
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态bug修复
im模块4.0.20内容增加 basecommand字段修改
parent
e9d92d27
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
2094 additions
and
641 deletions
+2094
-641
DemoAppLifecycles.java
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
+3
-1
config.gradle
config.gradle
+2
-2
TrendsDetailInfoBean.java
m-dynamic/src/main/java/com/yidianling/dynamic/model/TrendsDetailInfoBean.java
+1
-2
TrendsDetailActivity.java
m-dynamic/src/main/java/com/yidianling/dynamic/trendsDetail/TrendsDetailActivity.java
+12
-11
TrendsHomeFragment.java
m-dynamic/src/main/java/com/yidianling/dynamic/trendsHome/TrendsHomeFragment.java
+0
-1
HomePresenterImpl.kt
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+1
-1
UserTypeBean.kt
m-im/src/main/java/com/yidianling/im/bean/UserTypeBean.kt
+13
-0
MsgPushEvent.java
m-im/src/main/java/com/yidianling/im/event/MsgPushEvent.java
+25
-0
IMUtil.java
m-im/src/main/java/com/yidianling/im/helper/IMUtil.java
+153
-42
ImObserversHelper.kt
m-im/src/main/java/com/yidianling/im/helper/ImObserversHelper.kt
+89
-43
ImRetrofitApi.kt
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
+2
-5
OrderAction.java
m-im/src/main/java/com/yidianling/im/session/action/OrderAction.java
+1
-1
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+203
-31
ChatStatusCacheHelper.java
m-im/src/main/java/com/yidianling/uikit/business/session/helper/ChatStatusCacheHelper.java
+32
-0
MessageListPanelEx.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
+1
-1
CollectInfoPopupWindow.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectInfoPopupWindow.kt
+84
-0
CollectInfoStyleAdapter.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectInfoStyleAdapter.kt
+41
-0
CollectUserInformationView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectUserInformationView.kt
+248
-0
CommonQuestionAdapter.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CommonQuestionAdapter.kt
+34
-0
CommonQuestionItemView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CommonQuestionItemView.kt
+51
-0
CommonQuestionView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CommonQuestionView.kt
+68
-0
ServiceApi.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
+26
-3
ServiceImpl.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
+34
-0
CommonQuestionBean.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/response/CommonQuestionBean.kt
+11
-0
SubmitUserInfoBean.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/SubmitUserInfoBean.java
+14
-0
UserQuestInfoBean.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/response/UserQuestInfoBean.kt
+11
-0
im_ico_default_avatar.png
m-im/src/main/res_uikit/drawable-xhdpi/im_ico_default_avatar.png
+0
-0
im_background_chat_collect_info_question_style.xml
m-im/src/main/res_uikit/drawable/im_background_chat_collect_info_question_style.xml
+9
-0
im_background_chat_collect_info_send.xml
m-im/src/main/res_uikit/drawable/im_background_chat_collect_info_send.xml
+9
-0
im_background_chat_common_question.xml
m-im/src/main/res_uikit/drawable/im_background_chat_common_question.xml
+9
-0
im_background_collect_info_bottom_gender.xml
m-im/src/main/res_uikit/drawable/im_background_collect_info_bottom_gender.xml
+10
-0
im_background_collect_info_bottom_start.xml
m-im/src/main/res_uikit/drawable/im_background_collect_info_bottom_start.xml
+13
-0
im_background_collect_info_left.xml
m-im/src/main/res_uikit/drawable/im_background_collect_info_left.xml
+12
-0
im_background_collect_info_right.xml
m-im/src/main/res_uikit/drawable/im_background_collect_info_right.xml
+12
-0
im_item_collect_info_question_style.xml
m-im/src/main/res_uikit/layout/im_item_collect_info_question_style.xml
+15
-0
im_item_view_common_question.xml
m-im/src/main/res_uikit/layout/im_item_view_common_question.xml
+33
-0
im_view_collect_user_infomation.xml
m-im/src/main/res_uikit/layout/im_view_collect_user_infomation.xml
+247
-0
im_view_common_question.xml
m-im/src/main/res_uikit/layout/im_view_common_question.xml
+38
-0
im_ydl_nim_message_fragment.xml
m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
+520
-491
BaseCommand.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/BaseCommand.kt
+7
-6
No files found.
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
View file @
ca3a5007
...
...
@@ -8,6 +8,7 @@ import android.os.Build;
import
android.os.Process
;
import
android.support.annotation.RequiresApi
;
import
com.facebook.stetho.Stetho
;
import
com.meituan.android.walle.WalleChannelReader
;
import
com.netease.nimlib.sdk.util.NIMUtil
;
import
com.tencent.bugly.crashreport.CrashReport
;
...
...
@@ -15,7 +16,6 @@ import com.umeng.analytics.MobclickAgent;
import
com.umeng.commonsdk.UMConfigure
;
import
com.umeng.socialize.PlatformConfig
;
import
com.umeng.socialize.UMShareAPI
;
import
com.ydl.audioim.YDLavManager
;
import
com.ydl.component.BuildConfig
;
import
com.ydl.component.MainActivity
;
import
com.ydl.media.audio.PlayService
;
...
...
@@ -61,6 +61,8 @@ public class DemoAppLifecycles implements IAppLifecycles {
Intent
intent
=
new
Intent
(
application
,
PlayService
.
class
);
application
.
startService
(
intent
);
application
.
registerActivityLifecycleCallbacks
(
new
CoursePlayLifecycle
());
Stetho
.
initializeWithDefaults
(
application
);
}
}
...
...
config.gradle
View file @
ca3a5007
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
fals
e
dev_mode
=
tru
e
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
applicationId:
"com.cxzapp.yidianling"
,
versionName
:
"4.0.
0
0"
,
versionName
:
"4.0.
2
0"
,
versionCode
:
4000
,
]
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/model/TrendsDetailInfoBean.java
View file @
ca3a5007
...
...
@@ -72,8 +72,7 @@ public class TrendsDetailInfoBean {
public
ArrayList
<
IMage
>
bigAttach
;
//大图
public
int
topicId
;
//话题id
public
String
topicTitle
;
//话题标题
@SerializedName
(
value
=
"isFocused"
,
alternate
=
"is_focused"
)
public
int
is_focused
;
//1已关注,2未关注
public
int
isFocused
;
//1已关注,2未关注
public
String
uid
;
public
String
multitextType
;
//动态类型
public
ExtAd
ext
;
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/trendsDetail/TrendsDetailActivity.java
View file @
ca3a5007
...
...
@@ -300,7 +300,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@NotNull
@Override
public
StatusBarOptions
getStatusViewOptions
()
{
return
new
StatusBarOptions
(
true
,
true
);
return
new
StatusBarOptions
(
true
,
true
);
}
public
static
Intent
newIntent
(
Activity
activity
,
int
trendId
,
boolean
isScrollToZan
)
{
...
...
@@ -407,8 +407,8 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
/**
* 获取路由传递的参数
*/
private
void
getParam
(){
if
(
null
==
getIntent
()
||
!
getIntent
().
hasExtra
(
ROUTER_PARAMS
)){
private
void
getParam
()
{
if
(
null
==
getIntent
()
||
!
getIntent
().
hasExtra
(
ROUTER_PARAMS
))
{
return
;
}
//路由传递的入参
...
...
@@ -421,6 +421,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
e
.
printStackTrace
();
}
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
...
...
@@ -432,7 +433,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
dismissProgressDialog
();
if
(
isFirstLoad
)
{
vLoading
.
setViewType
(
LogoLoadingView
.
TYPE_LOADING
,
null
);
}
else
{
}
else
{
showProgressDialog
(
message
);
}
}
...
...
@@ -492,7 +493,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
.
setLeftOnclick
(
TrendsDetailActivity
.
this
.
getString
(
R
.
string
.
dynamic_details
),
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
String
realUrl
=
TextUtils
.
isEmpty
(
url
)
?
DynamicConstants
.
HELP_URL
:
url
;
String
realUrl
=
TextUtils
.
isEmpty
(
url
)
?
DynamicConstants
.
HELP_URL
:
url
;
H5Params
params
=
new
H5Params
(
realUrl
,
""
);
NewH5Activity
.
start
(
TrendsDetailActivity
.
this
,
params
);
}
...
...
@@ -875,7 +876,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
comments
=
new
ArrayList
<>();
Bundle
bundle
=
getIntent
().
getBundleExtra
(
YDLConstants
.
BUNDLE
);
if
(
null
!=
bundle
){
if
(
null
!=
bundle
)
{
lastId
=
bundle
.
getInt
(
KEY_LAST_ID
,
0
);
isFromSplash
=
bundle
.
getBoolean
(
KEY_IS_SPLASH
,
false
);
trendId
=
bundle
.
getInt
(
KEY_TREND_ID
,
0
);
...
...
@@ -1179,7 +1180,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
.
setRightClick
(
"果断绑定"
,
v
->
{
startActivity
(
DynamicIn
.
INSTANCE
.
inputPhoneIntent
(
this
,
DynamicConstants
.
BIND_PHONE_ACTION
));
})
.
setMessage
(
"\n"
+
DynamicConstants
.
Companion
.
getBIND_PHONE
()+
"\n"
)
.
setMessage
(
"\n"
+
DynamicConstants
.
Companion
.
getBIND_PHONE
()
+
"\n"
)
.
show
();
return
;
}
...
...
@@ -1388,7 +1389,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
linContent
.
setVisibility
(
View
.
VISIBLE
);
relNotExist
.
setVisibility
(
View
.
GONE
);
linNullTip
.
setVisibility
(
mTrendBody
.
replyCounter
>
0
?
GONE
:
VISIBLE
);
tvGuanzhu
.
setVisibility
(
mTrendBody
.
is
_f
ocused
==
1
||
mTrendBody
.
uid
.
equals
(
"0"
)
||
TextUtils
.
equals
(
mTrendBody
.
uid
,
DynamicIn
.
INSTANCE
.
getUserInfo
().
getUid
())
?
View
.
GONE
:
View
.
VISIBLE
);
tvGuanzhu
.
setVisibility
(
mTrendBody
.
is
F
ocused
==
1
||
mTrendBody
.
uid
.
equals
(
"0"
)
||
TextUtils
.
equals
(
mTrendBody
.
uid
,
DynamicIn
.
INSTANCE
.
getUserInfo
().
getUid
())
?
View
.
GONE
:
View
.
VISIBLE
);
ivLike
.
setImageResource
(
mTrendBody
.
isZan
==
1
?
R
.
drawable
.
dynamic_newsfeed_like_sel
:
R
.
drawable
.
dynamic_newsfeed_like
);
if
(!
TextUtils
.
isEmpty
(
mTrendBody
.
content
))
{
MoonUtil
.
identifyFaceExpression
(
this
,
tvContent
,
mTrendBody
.
content
,
ImageSpan
.
ALIGN_BOTTOM
);
...
...
@@ -1614,7 +1615,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
// //删除
// deleteDialog(2, mTrendBody.id, 0);//
// }));
YDLShareDialog
dialog
=
YDLShareDialog
.
Companion
.
style2
(
this
,
mTrendBody
.
title
,
DynamicConstants
.
Companion
.
getTRENF_INFO_SHARE_H5
()+
trendId
,
mTrendBody
.
content
,
"http://static.ydlcdn.com/v1/images/logo320.png"
);
YDLShareDialog
dialog
=
YDLShareDialog
.
Companion
.
style2
(
this
,
mTrendBody
.
title
,
DynamicConstants
.
Companion
.
getTRENF_INFO_SHARE_H5
()
+
trendId
,
mTrendBody
.
content
,
"http://static.ydlcdn.com/v1/images/logo320.png"
);
dialog
.
setCallBack
(
type
->
{
if
(
2
==
type
)
{
//删除
...
...
@@ -1626,7 +1627,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
dialog
.
show
(
getFragmentManager
(),
"lose"
);
}
else
{
//别人帖子
YDLShareDialog
dialog
=
YDLShareDialog
.
Companion
.
style3
(
this
,
mTrendBody
.
title
,
DynamicConstants
.
Companion
.
getTRENF_INFO_SHARE_H5
()+
trendId
,
mTrendBody
.
content
,
"http://static.ydlcdn.com/v1/images/logo320.png"
);
YDLShareDialog
dialog
=
YDLShareDialog
.
Companion
.
style3
(
this
,
mTrendBody
.
title
,
DynamicConstants
.
Companion
.
getTRENF_INFO_SHARE_H5
()
+
trendId
,
mTrendBody
.
content
,
"http://static.ydlcdn.com/v1/images/logo320.png"
);
dialog
.
setCallBack
(
type
->
{
if
(
3
==
type
)
{
if
(!
DynamicIn
.
INSTANCE
.
isLogin
())
{
...
...
@@ -1672,7 +1673,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
}
private
void
backHome
()
{
DynamicIn
.
INSTANCE
.
mainIntent
(
this
,
0
);
DynamicIn
.
INSTANCE
.
mainIntent
(
this
,
0
);
}
/**
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/trendsHome/TrendsHomeFragment.java
View file @
ca3a5007
...
...
@@ -253,7 +253,6 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
.
burryPoint
(
"topTabClick"
);
if
(!
DynamicIn
.
INSTANCE
.
isLogin
())
{
startActivity
(
DynamicIn
.
INSTANCE
.
loginWayIntent
(
getActivity
()));
// startActivity(new Intent(getActivity(), ChooseLoginWayActivity.class));
return
;
}
BuryPointUtils
.
getInstance
().
trackViewScreen
(
getActivity
(),
"动态-关注"
,
"com.cxzapp.yidianling.trends.trendList.TrendsListFragment"
);
...
...
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
ca3a5007
...
...
@@ -20,7 +20,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Action
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
import
java.util.concurrent.TimeUnit
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...
...
m-im/src/main/java/com/yidianling/im/bean/UserTypeBean.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.im.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/10
*/
class
UserTypeBean
(
var
userType
:
String
,
//用户类型 1 用户 2 专家 3 助理
var
chatEvent
:
Boolean
,
//私聊常用语弹窗
var
collectEvent
:
Boolean
)//
收集信息
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/event/MsgPushEvent.java
0 → 100644
View file @
ca3a5007
package
com
.
yidianling
.
im
.
event
;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/13
*/
public
class
MsgPushEvent
{
public
String
toUid
;
public
String
headUrl
;
public
String
content
;
public
String
name
;
@Override
public
String
toString
()
{
return
"MsgPushEvent{"
+
"toUid='"
+
toUid
+
'\''
+
", headUrl='"
+
headUrl
+
'\''
+
", content='"
+
content
+
'\''
+
", name='"
+
name
+
'\''
+
'}'
;
}
}
m-im/src/main/java/com/yidianling/im/helper/IMUtil.java
View file @
ca3a5007
package
com
.
yidianling
.
im
.
helper
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.support.v7.app.AppCompatActivity
;
import
android.text.TextUtils
;
...
...
@@ -17,6 +18,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.api.bean.IMExpertBuild
;
import
com.yidianling.im.bean.DoctorAssistantRespDtoBean
;
import
com.yidianling.im.bean.GetExpert
;
import
com.yidianling.im.bridge.P2PCustomActionHandlerImpl
;
...
...
@@ -24,7 +26,7 @@ import com.yidianling.im.config.constants.ImConstants;
import
com.yidianling.im.http.ImRetrofitApi
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.im.session.SessionHelper
;
import
com.yidianling.
im.api.bean.IMExpertBuild
;
import
com.yidianling.
uikit.business.session.helper.ChatStatusCacheHelper
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
...
...
@@ -64,9 +66,10 @@ public class IMUtil {
* @param flag
* @param canTalk
* @param listener
* @param isFromQingShu 用于判断是否从倾诉流程跳转私聊:1:是 其他:不是 从倾述流程跳转私聊,需要发送自定义消息
* @param isFromQingShu
用于判断是否从倾诉流程跳转私聊:1:是 其他:不是 从倾述流程跳转私聊,需要发送自定义消息
* @param isFromMessageList 用于判断是否来自于聊天列表点击进入 true 是 false,不是
*/
@SuppressLint
(
"CheckResult"
)
public
static
void
startChat
(
AppCompatActivity
context
,
String
toUid
,
int
flag
,
int
canTalk
,
ExpertDataFetchListener
listener
,
int
isFromQingShu
,
boolean
isFromMessageList
)
{
if
(!
ImIn
.
INSTANCE
.
isLogin
(
context
,
true
))
{
return
;
...
...
@@ -77,63 +80,171 @@ public class IMUtil {
LogUtil
.
d
(
"isSaveUserInfo: "
+
isSaveUserInfo
+
" isUseUm: "
+
isUseUm
);
LoadingDialogFragment
dialog
=
LoadingDialogFragment
.
Companion
.
newInstance
(
null
);
if
(
context
.
getSupportFragmentManager
()
!=
null
&&
!
context
.
isDestroyed
())
{
if
(
context
.
getSupportFragmentManager
()
!=
null
&&
!
context
.
isDestroyed
())
{
dialog
.
show
(
context
.
getSupportFragmentManager
(),
null
);
}
GetExpert
cmd
=
new
GetExpert
(
Integer
.
parseInt
(
toUid
),
canTalk
);
if
(
isFromMessageList
)
{
//先根据uid判断用户类型:专家调一个接口,非专家调另外的接口
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getUserType
(
toUid
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
res
->
{
if
(
res
.
code
==
200
&&
res
.
data
!=
null
)
{
if
(
res
.
data
.
getChatEvent
())
{
//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
.
getChatEvent
());
}
if
(
res
.
data
.
getCollectEvent
())
{
//和助理私聊需要打开信息采集弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"collectEvent"
,
res
.
data
.
getCollectEvent
());
}
//先根据uid判断用户类型:专家调一个接口,非专家调另外的接口
Disposable
disposable
=
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getUserType
(
toUid
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
res
->
{
if
(
res
.
code
==
200
)
{
if
(
TextUtils
.
equals
(
res
.
data
,
"2"
))
{
//专家 java 接口
//如果是从消息列表点击进来的,那么专家还是专家,助理还是助理,不走其他所有逻辑(比如销售代运营)
if
(
isFromMessageList
)
{
startExpertChat
(
context
,
toUid
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
return
;
if
(
TextUtils
.
equals
(
res
.
data
.
getUserType
(),
"2"
))
{
//专家 java 接口
//如果是从消息列表点击进来的,那么专家还是专家,助理还是助理,不走其他所有逻辑(比如销售代运营)
if
(
isFromMessageList
)
{
startExpertChat
(
context
,
toUid
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
return
;
}
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getChatUid
((
toUid
))
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
resp
->
{
DoctorAssistantRespDtoBean
bean
=
resp
.
data
;
if
(
bean
.
getRole
()
==
1
)
{
//接口返回值是专家,java接口
startExpertChat
(
context
,
bean
.
getChatUid
(),
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
else
{
GetExpert
cmd1
=
new
GetExpert
(
Integer
.
parseInt
(
bean
.
getChatUid
()),
canTalk
);
//接口返回值是助理,php接口
startAssistantChat
(
context
,
bean
.
getChatUid
(),
cmd1
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
},
t
->
{
HttpErrorUtils
.
Companion
.
handleError
(
context
,
t
);
});
}
else
{
//非专家 php接口
startAssistantChat
(
context
,
toUid
,
cmd
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
}
else
{
if
(
dialog
.
isVisible
())
{
dialog
.
dismissAllowingStateLoss
();
}
ToastUtil
.
toastShort
(
res
.
msg
);
}
},
throwable
->
{
if
(
dialog
.
isVisible
())
{
dialog
.
dismissAllowingStateLoss
();
}
HttpErrorUtils
.
Companion
.
handleError
(
context
,
throwable
);
});
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
Disposable
disposa
=
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getChatUid
((
toUid
)
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
r
esp
->
{
}
else
{
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getChatUid
(
toUid
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
getChatUidR
esp
->
{
DoctorAssistantRespDtoBean
bean
=
resp
.
data
;
if
(
bean
.
getRole
()
==
1
)
{
DoctorAssistantRespDtoBean
bean
=
getChatUidResp
.
data
;
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getUserType
(
bean
.
chatUid
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
userTypeResp
->
{
if
(
userTypeResp
.
code
==
200
&&
userTypeResp
.
data
!=
null
)
{
if
(
userTypeResp
.
data
.
getChatEvent
())
{
//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
userTypeResp
.
data
.
getChatEvent
());
}
if
(
userTypeResp
.
data
.
getCollectEvent
())
{
//和助理私聊需要打开信息采集弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"collectEvent"
,
userTypeResp
.
data
.
getCollectEvent
());
}
if
(
TextUtils
.
equals
(
userTypeResp
.
data
.
getUserType
(),
"2"
))
{
//专家 java 接口
//接口返回值是专家,java接口
startExpertChat
(
context
,
bean
.
getChatUid
(),
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
else
{
startExpertChat
(
context
,
bean
.
chatUid
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
else
{
//非专家 php接口
GetExpert
cmd1
=
new
GetExpert
(
Integer
.
parseInt
(
bean
.
getChatUid
()),
canTalk
);
//接口返回值是助理,php接口
startAssistantChat
(
context
,
bean
.
getChatUid
(),
cmd1
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
GetExpert
cmd1
=
new
GetExpert
(
Integer
.
parseInt
(
bean
.
chatUid
),
canTalk
);
startAssistantChat
(
context
,
bean
.
chatUid
,
cmd1
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
},
t
->{
HttpErrorUtils
.
Companion
.
handleError
(
context
,
t
);
});
}
else
{
//非专家 php接口
startAssistantChat
(
context
,
toUid
,
cmd
,
dialog
,
listener
,
isUseUm
,
isSaveUserInfo
,
isFromQingShu
);
}
}
else
{
}
else
{
if
(
dialog
.
isVisible
())
{
dialog
.
dismissAllowingStateLoss
();
}
ToastUtil
.
toastShort
(
userTypeResp
.
msg
);
}
},
throwable
->
{
if
(
dialog
.
isVisible
())
{
dialog
.
dismissAllowingStateLoss
();
}
HttpErrorUtils
.
Companion
.
handleError
(
context
,
throwable
);
});
},
t
->
{
if
(
dialog
.
isVisible
())
{
dialog
.
dismissAllowingStateLoss
();
}
ToastUtil
.
toastShort
(
res
.
msg
);
}
},
throwable
->
{
if
(
dialog
.
isVisible
())
{
dialog
.
dismissAllowingStateLoss
();
}
HttpErrorUtils
.
Companion
.
handleError
(
context
,
throwable
);
});
HttpErrorUtils
.
Companion
.
handleError
(
context
,
t
);
});
}
// //先根据uid判断用户类型:专家调一个接口,非专家调另外的接口
// Disposable disposable = ImRetrofitApi.Companion.getImJavaApi().getUserType(toUid)
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(res -> {
// if (res.code == 200) {
// if (TextUtils.equals(res.data, "2")) {//专家 java 接口
//
// //如果是从消息列表点击进来的,那么专家还是专家,助理还是助理,不走其他所有逻辑(比如销售代运营)
// if (isFromMessageList) {
// startExpertChat(context, toUid, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// return ;
// }
//
// //在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
// Disposable disposa = ImRetrofitApi.Companion.getImJavaApi().getChatUid((toUid))
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(resp -> {
//
// DoctorAssistantRespDtoBean bean = resp.data;
// if (bean.getRole() == 1) {
// //接口返回值是专家,java接口
// startExpertChat(context, bean.getChatUid(), dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// }else {
//
// GetExpert cmd1 = new GetExpert(Integer.parseInt(bean.getChatUid()), canTalk);
// //接口返回值是助理,php接口
// startAssistantChat(context, bean.getChatUid(), cmd1, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// }
//
// },t->{
// HttpErrorUtils.Companion.handleError(context, t);
// });
// } else {//非专家 php接口
// startAssistantChat(context, toUid, cmd, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// }
// } else {
// if (dialog.isVisible()) {
// dialog.dismissAllowingStateLoss();
// }
// ToastUtil.toastShort(res.msg);
// }
// }, throwable -> {
// if (dialog.isVisible()) {
// dialog.dismissAllowingStateLoss();
// }
// HttpErrorUtils.Companion.handleError(context, throwable);
// });
}
/**
...
...
m-im/src/main/java/com/yidianling/im/helper/ImObserversHelper.kt
View file @
ca3a5007
...
...
@@ -17,6 +17,7 @@ import com.netease.nimlib.sdk.msg.model.RevokeMsgNotification
import
com.netease.nimlib.sdk.team.TeamServiceObserver
import
com.netease.nimlib.sdk.team.model.Team
import
com.yidianling.im.api.event.AccountChangeEvent
import
com.yidianling.im.event.MsgPushEvent
import
com.yidianling.im.event.TeamRemoveEvent
import
com.yidianling.im.preference.IMCache
import
com.yidianling.im.preference.ImTempData
...
...
@@ -30,6 +31,7 @@ import com.yidianling.uikit.api.wrapper.NimMessageRevokeObserver
import
com.yidianling.uikit.business.session.helper.MessageListPanelHelper
import
com.yidianling.uikit.business.team.helper.TeamMemberAitHelper
import
de.greenrobot.event.EventBus
import
java.util.concurrent.Executors
/**
* Created by haorui on 2019/5/17.
...
...
@@ -49,16 +51,20 @@ class ImObserversHelper {
fun
registerObserver
(
register
:
Boolean
)
{
//注册`在线状态变化`观察者
NIMClient
.
getService
(
AuthServiceObserver
::
class
.
java
).
observeOnlineStatus
(
userStatusObserver
,
register
)
NIMClient
.
getService
(
AuthServiceObserver
::
class
.
java
)
.
observeOnlineStatus
(
userStatusObserver
,
register
)
//注册`消息撤回`观察者
NIMClient
.
getService
(
MsgServiceObserve
::
class
.
java
).
observeRevokeMessage
(
messageRevokeObserver
,
register
)
NIMClient
.
getService
(
MsgServiceObserve
::
class
.
java
)
.
observeRevokeMessage
(
messageRevokeObserver
,
register
)
//注册`消息接收`观察者
NIMClient
.
getService
(
MsgServiceObserve
::
class
.
java
).
observeReceiveMessage
(
incomingMessageObserver
,
register
)
NIMClient
.
getService
(
MsgServiceObserve
::
class
.
java
)
.
observeReceiveMessage
(
incomingMessageObserver
,
register
)
//注册`移出群`观察者通知
NIMClient
.
getService
(
TeamServiceObserver
::
class
.
java
).
observeTeamRemove
(
teamObserver
,
register
)
NIMClient
.
getService
(
TeamServiceObserver
::
class
.
java
)
.
observeTeamRemove
(
teamObserver
,
register
)
//注册`未读消息改变数量`观察者
registerMsgUnreadInfoObserver
(
register
)
if
(
register
){
if
(
register
)
{
//注册`消息转发`过滤器
NimUIKit
.
setMsgForwardFilter
(
msgForwardFilter
)
//注册`消息撤回`过滤器
...
...
@@ -70,13 +76,15 @@ class ImObserversHelper {
if
(
register
)
{
ReminderManager
.
getInstance
().
registerUnreadNumChangedCallback
(
unreadNumChangedCallback
)
}
else
{
ReminderManager
.
getInstance
().
unregisterUnreadNumChangedCallback
(
unreadNumChangedCallback
)
ReminderManager
.
getInstance
()
.
unregisterUnreadNumChangedCallback
(
unreadNumChangedCallback
)
}
}
private
var
unreadNumChangedCallback
:
ReminderManager
.
UnreadNumChangedCallback
=
ReminderManager
.
UnreadNumChangedCallback
()
{
MsgReceiveHelper
.
onMessageReceived
()
}
private
var
unreadNumChangedCallback
:
ReminderManager
.
UnreadNumChangedCallback
=
ReminderManager
.
UnreadNumChangedCallback
()
{
MsgReceiveHelper
.
onMessageReceived
()
}
private
var
userStatusObserver
:
Observer
<
StatusCode
>
=
Observer
{
code
->
if
(
code
.
wontAutoLoginForever
())
{
...
...
@@ -86,9 +94,11 @@ class ImObserversHelper {
private
var
messageRevokeObserver
:
Observer
<
RevokeMsgNotification
>
=
NimMessageRevokeObserver
()
private
var
teamObserver
:
Observer
<
Team
>
=
Observer
<
Team
>
{
t
->
EventBus
.
getDefault
().
post
(
TeamRemoveEvent
(
1
,
t
.
id
)
)
}
private
var
teamObserver
:
Observer
<
Team
>
=
Observer
<
Team
>
{
t
->
EventBus
.
getDefault
().
post
(
TeamRemoveEvent
(
1
,
t
.
id
)
)
}
private
var
incomingMessageObserver
=
Observer
<
List
<
IMMessage
>>
{
messages
->
// 处理新收到的消息,为了上传处理方便,SDK 保证参数 messages 全部来自同一个聊天对象。
...
...
@@ -96,9 +106,9 @@ class ImObserversHelper {
if
(
messages
==
null
||
messages
.
isEmpty
())
{
return
@Observer
}
if
(
messages
.
size
>
1
){
if
(
messages
.
size
>
1
)
{
//漫游消息 nothing
}
else
{
}
else
{
//单/群聊消息
for
(
m
in
messages
)
{
//监听在线消息中是否有@我
...
...
@@ -112,12 +122,44 @@ class ImObserversHelper {
flushReceivedMoney
(
m
)
}
else
{
MsgReceiveHelper
.
onMessageReceived
()
if
(
System
.
currentTimeMillis
()
-
m
.
time
<=
5000
)
{
Executors
.
newSingleThreadExecutor
().
execute
{
val
userInfo
=
NimUIKit
.
getUserInfoProvider
().
getUserInfo
(
m
.
fromAccount
)
val
event
=
MsgPushEvent
()
event
.
toUid
=
m
.
fromAccount
when
(
m
.
msgType
)
{
MsgTypeEnum
.
text
->
{
event
.
content
=
m
.
content
}
MsgTypeEnum
.
image
->
{
event
.
content
=
"[图片]"
}
MsgTypeEnum
.
audio
->
{
event
.
content
=
"[语音]"
}
MsgTypeEnum
.
video
->
{
event
.
content
=
"[视频]"
}
else
->
{
event
.
content
=
"[链接]"
}
}
if
(
userInfo
!=
null
)
{
event
.
name
=
userInfo
.
name
event
.
headUrl
=
userInfo
.
avatar
}
// LogUtil.e("发送事件:$event")
EventBus
.
getDefault
().
post
(
event
)
}
}
}
}
}
}
private
var
msgForwardFilter
=
MsgForwardFilter
{
message
->
private
var
msgForwardFilter
=
MsgForwardFilter
{
message
->
if
(
message
.
direct
==
MsgDirectionEnum
.
In
&&
(
message
.
attachStatus
==
AttachStatusEnum
.
transferring
||
message
.
attachStatus
==
AttachStatusEnum
.
fail
))
{
// 接收到的消息,附件没有下载成功,不允许转发
return
@MsgForwardFilter
true
...
...
@@ -131,8 +173,9 @@ class ImObserversHelper {
private
var
msgRevokeFilter
=
MsgRevokeFilter
{
message
->
if
(
message
.
attachment
!=
null
&&
message
.
attachment
is
AVChatAttachment
&&
message
.
attachment
is
CustomAttachRedPacket
)
{
&&
message
.
attachment
is
AVChatAttachment
&&
message
.
attachment
is
CustomAttachRedPacket
)
{
// 视频通话消息和白板消息 不允许撤回
return
@MsgRevokeFilter
true
}
else
if
(
IMCache
.
getAccount
()
!=
null
&&
IMCache
.
getAccount
()
==
message
.
sessionId
)
{
...
...
@@ -145,36 +188,39 @@ class ImObserversHelper {
//如果是收款提醒消息 则更新历史收款消息的状态
fun
flushReceivedMoney
(
m
:
IMMessage
)
{
//跟新收款消息
NIMClient
.
getService
(
MsgService
::
class
.
java
).
queryMessageListByType
(
MsgTypeEnum
.
custom
,
m
,
100
).
setCallback
(
object
:
RequestCallback
<
List
<
IMMessage
>>
{
override
fun
onSuccess
(
imMessages
:
List
<
IMMessage
>)
{
for
(
im
in
imMessages
)
{
if
(
im
.
attachment
is
CustomAttachReceivedMoney
)
{
val
money
=
im
.
attachment
as
CustomAttachReceivedMoney
if
(
money
.
orPay
==
1
)
return
val
status
=
m
.
attachment
as
CustomAttachmentReceivedSuccess
if
(
money
.
orderId
==
null
||
status
.
orderid
==
null
)
return
if
(
money
.
orderId
==
status
.
orderid
)
{
money
.
orPay
=
1
//设置为已支付
im
.
attachment
=
money
//更新此消息到sdk
NIMClient
.
getService
(
MsgService
::
class
.
java
).
updateIMMessageStatus
(
im
)
//更新私聊界面聊天信息
MessageListPanelHelper
.
getInstance
().
notifyModifyMessage
(
im
)
return
NIMClient
.
getService
(
MsgService
::
class
.
java
)
.
queryMessageListByType
(
MsgTypeEnum
.
custom
,
m
,
100
)
.
setCallback
(
object
:
RequestCallback
<
List
<
IMMessage
>>
{
override
fun
onSuccess
(
imMessages
:
List
<
IMMessage
>)
{
for
(
im
in
imMessages
)
{
if
(
im
.
attachment
is
CustomAttachReceivedMoney
)
{
val
money
=
im
.
attachment
as
CustomAttachReceivedMoney
if
(
money
.
orPay
==
1
)
return
val
status
=
m
.
attachment
as
CustomAttachmentReceivedSuccess
if
(
money
.
orderId
==
null
||
status
.
orderid
==
null
)
return
if
(
money
.
orderId
==
status
.
orderid
)
{
money
.
orPay
=
1
//设置为已支付
im
.
attachment
=
money
//更新此消息到sdk
NIMClient
.
getService
(
MsgService
::
class
.
java
)
.
updateIMMessageStatus
(
im
)
//更新私聊界面聊天信息
MessageListPanelHelper
.
getInstance
().
notifyModifyMessage
(
im
)
return
}
}
}
}
}
override
fun
onFailed
(
i
:
Int
)
{
// Log.e("hzs","跟新收款消息失败");
}
override
fun
onFailed
(
i
:
Int
)
{
// Log.e("hzs","跟新收款消息失败");
}
override
fun
onException
(
throwable
:
Throwable
)
{
// Log.e("hzs","跟新收款消息异常:"+throwable);
}
})
override
fun
onException
(
throwable
:
Throwable
)
{
// Log.e("hzs","跟新收款消息异常:"+throwable);
}
})
}
}
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
View file @
ca3a5007
...
...
@@ -5,11 +5,8 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.im.bean.CourseStatusBean
import
com.yidianling.im.bean.DoctorAssistantRespDtoBean
import
com.yidianling.im.bean.PushConfideStatusBean
import
com.yidianling.im.bean.RedPacketDetailBean
import
com.yidianling.im.api.bean.IMExpertBuild
import
com.yidianling.im.bean.*
import
io.reactivex.Observable
import
retrofit2.http.*
...
...
@@ -43,7 +40,7 @@ interface ImRetrofitApi {
//获取用户的状态(用户、专家、助理)
@GET
(
"user/userType"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getUserType
(
@Query
(
"targetUid"
)
uid
:
String
):
Observable
<
BaseResponse
<
String
>>
fun
getUserType
(
@Query
(
"targetUid"
)
uid
:
String
):
Observable
<
BaseResponse
<
UserTypeBean
>>
//根据专家uid获取私聊的目标uid(有可能是专家uid,有可能是助理uid)
@GET
(
"doctor/chat-user"
)
...
...
m-im/src/main/java/com/yidianling/im/session/action/OrderAction.java
View file @
ca3a5007
...
...
@@ -47,7 +47,7 @@ public class OrderAction extends BaseAction {
.
subscribe
(
res
->
{
if
(
res
.
code
==
200
)
{
Observable
<
BaseResponse
<
IMExpertBuild
>>
observable
;
if
(
TextUtils
.
equals
(
res
.
data
,
"2"
))
{
//专家
if
(
TextUtils
.
equals
(
res
.
data
.
getUserType
()
,
"2"
))
{
//专家
observable
=
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getPersonalChat
(
getAccount
());
}
else
{
observable
=
ImHttpImpl
.
Companion
.
getInstance
().
getExpert
(
new
ExpertParam
(
Integer
.
valueOf
(
getAccount
()),
0
));
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
ca3a5007
...
...
@@ -21,6 +21,7 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.Observer
;
import
com.netease.nimlib.sdk.RequestCallback
;
...
...
@@ -42,6 +43,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.nimbase.api.UIKitOptions
;
import
com.yidianling.nimbase.api.model.main.CustomPushContentProvider
;
import
com.yidianling.nimbase.api.model.session.ModuleProxy
;
...
...
@@ -54,22 +56,34 @@ import com.yidianling.nimbase.common.fragment.TFragment;
import
com.yidianling.nimbase.impl.cache.NimUserInfoCache
;
import
com.yidianling.uikit.api.NimUIKitImpl
;
import
com.yidianling.uikit.business.ait.AitManager
;
import
com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper
;
import
com.yidianling.uikit.business.session.module.input.InputPanel
;
import
com.yidianling.uikit.business.session.module.list.MessageListPanelEx
;
import
com.yidianling.uikit.business.session.view.ChatPrivateTips
;
import
com.yidianling.uikit.business.session.view.CollectInfoPopupWindow
;
import
com.yidianling.uikit.business.session.view.CommonQuestionView
;
import
com.yidianling.uikit.custom.bridge.ActionHandlerStorage
;
import
com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler
;
import
com.yidianling.uikit.custom.http.ServiceImpl
;
import
com.yidianling.uikit.custom.http.response.CommonQuestionBean
;
import
com.yidianling.uikit.custom.http.response.SubmitUserInfoBean
;
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
;
import
com.yidianling.uikit.custom.widget.ConfideOrderInfoView
;
import
com.yidianling.uikit.custom.widget.HalfCircleDrawable
;
import
com.yidianling.user.api.service.IUserService
;
import
org.jetbrains.annotations.NotNull
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
/**
* 聊天界面基类
...
...
@@ -114,6 +128,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
int
timeCount
=
0
;
protected
AitManager
aitManager
;
private
CollectInfoPopupWindow
collectInfoPopupWindow
;
private
CircleImageView
small_head_img
;
//小头像
private
TextView
help_num_tv
;
//帮助人数
...
...
@@ -126,6 +141,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
ImageView
qingshuImg
;
//预约咨询
private
ConstraintLayout
top_expert_info_cl
;
private
RelativeLayout
rl_common_question_enter
;
private
FrameLayout
fl_question_content
;
private
List
<
CommonQuestionBean
>
commonQuestionBeanList
;
@SuppressLint
(
"HandlerLeak"
)
private
Handler
mHandler
=
new
Handler
()
{
...
...
@@ -157,6 +175,51 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
qingshu
=
rootView
.
findViewById
(
R
.
id
.
action_qingshu
);
qingshuImg
=
rootView
.
findViewById
(
R
.
id
.
action_qingshu_img
);
//和助理私聊时的常用语逻辑
rl_common_question_enter
=
rootView
.
findViewById
(
R
.
id
.
rl_common_question
);
fl_question_content
=
rootView
.
findViewById
(
R
.
id
.
fl_question_content
);
rl_common_question_enter
.
setVisibility
(
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
3
?
View
.
VISIBLE
:
View
.
GONE
);
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
3
)
{
rl_common_question_enter
.
setOnClickListener
(
v
->
{
if
(
commonQuestionBeanList
!=
null
&&
commonQuestionBeanList
.
size
()
>
0
)
{
openOrCloseCommonQuestionLayout
(
true
);
}
else
{
getCommonQuestionListData
();
}
});
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"chatEvent"
))
{
if
(
commonQuestionBeanList
!=
null
&&
commonQuestionBeanList
.
size
()
>
0
)
{
rl_common_question_enter
.
postDelayed
(()
->
openOrCloseCommonQuestionLayout
(
true
),
300
);
}
else
{
getCommonQuestionListData
();
}
ChatStatusCacheHelper
.
clearDataByKey
(
"chatEvent"
);
}
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"collectEvent"
))
{
String
time
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
+
"-"
+
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
Calendar
.
getInstance
().
get
(
Calendar
.
DAY_OF_MONTH
);
// if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + YdlCommonRouterManager.INSTANCE.getYdlCommonRoute().getUid()))) {
if
(!
TextUtils
.
equals
(
time
,
SharedPreferencesEditor
.
getString
(
"skip_time_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
())))
{
collectInfoPopupWindow
=
new
CollectInfoPopupWindow
(
getActivity
(),
(
content
,
result
)
->
{
if
(
TextUtils
.
isEmpty
(
content
))
{
//点击跳过后当天不再显示此弹窗
SharedPreferencesEditor
.
putString
(
"skip_time_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
()
,
time
);
}
else
{
IMMessage
textMessage
=
MessageBuilder
.
createTextMessage
(
sessionId
,
sessionType
,
content
);
if
(
sendMessage
(
textMessage
))
{
openOrCloseCommonQuestionLayout
(
false
);
}
submitUserCollect
(
result
);
}
});
getUserInfoCollect
();
collectInfoPopupWindow
.
show
(
top_expert_info_cl
);
}
ChatStatusCacheHelper
.
clearDataByKey
(
"collectEvent"
);
}
}
// 初始化顶部专家信息栏
if
(
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
2
)
{
top_expert_info_cl
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -214,32 +277,30 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
* 初始化顶部专家信息栏
*/
private
void
initTopCustomBar
()
{
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
{
// 头像
String
headUrl
=
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoSmallImage
;
if
(!
TextUtils
.
isEmpty
(
headUrl
))
{
GlideApp
.
with
(
getActivity
()).
load
(
headUrl
).
into
(
small_head_img
);
}
// 帮助人数
String
help_num
=
String
.
valueOf
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoOrderNum
);
if
(
TextUtils
.
isEmpty
(
help_num
))
help_num
=
"0"
;
help_num_tv
.
setText
(
help_num
);
// 服务时长
String
server_num
=
String
.
valueOf
((
int
)
Math
.
ceil
((
double
)
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoHelpLong
/
60.0
));
if
(
TextUtils
.
isEmpty
(
server_num
))
server_num
=
"0"
;
server_num_tv
.
setText
(
server_num
);
// 好评率
String
good_num
=
String
.
format
(
"%.2f"
,
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoFeedbackRate
*
20
);
if
(
TextUtils
.
isEmpty
(
good_num
))
good_num
=
"0.00"
;
good_num_tv
.
setText
(
good_num
+
"%"
);
if
(!
TextUtils
.
isEmpty
(
headUrl
))
{
IP2PCustomActionHandler
.
DocInfo
info
=
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
();
if
(
null
!=
info
)
{
NimUserInfo
user
=
NimUserInfoCache
.
getInstance
().
getUserInfo
(
info
.
toUid
);
if
(
null
!=
user
&&
null
!=
user
.
getAvatar
()
&&
headUrl
.
equals
(
user
.
getAvatar
()))
{
NimUserInfoCache
.
getInstance
().
getUserInfoFromRemote
(
info
.
toUid
,
null
);
}
// 头像
String
headUrl
=
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoSmallImage
;
if
(!
TextUtils
.
isEmpty
(
headUrl
))
{
GlideApp
.
with
(
getActivity
()).
load
(
headUrl
).
into
(
small_head_img
);
}
// 帮助人数
String
help_num
=
String
.
valueOf
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoOrderNum
);
if
(
TextUtils
.
isEmpty
(
help_num
))
help_num
=
"0"
;
help_num_tv
.
setText
(
help_num
);
// 服务时长
String
server_num
=
String
.
valueOf
((
int
)
Math
.
ceil
((
double
)
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoHelpLong
/
60.0
));
if
(
TextUtils
.
isEmpty
(
server_num
))
server_num
=
"0"
;
server_num_tv
.
setText
(
server_num
);
// 好评率
String
good_num
=
String
.
format
(
"%.2f"
,
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorBriefInfoFeedbackRate
*
20
);
if
(
TextUtils
.
isEmpty
(
good_num
))
good_num
=
"0.00"
;
good_num_tv
.
setText
(
good_num
+
"%"
);
if
(!
TextUtils
.
isEmpty
(
headUrl
))
{
IP2PCustomActionHandler
.
DocInfo
info
=
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
();
if
(
null
!=
info
)
{
NimUserInfo
user
=
NimUserInfoCache
.
getInstance
().
getUserInfo
(
info
.
toUid
);
if
(
null
!=
user
&&
null
!=
user
.
getAvatar
()
&&
headUrl
.
equals
(
user
.
getAvatar
()))
{
NimUserInfoCache
.
getInstance
().
getUserInfoFromRemote
(
info
.
toUid
,
null
);
}
}
}
...
...
@@ -349,7 +410,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override
public
void
onClick
(
View
v
)
{
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
"聊天界面点击常见问题"
);
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
{
if
(
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)
)
{
ActionHandlerStorage
.
getL
(
sessionId
).
startHelp
(
getActivity
());
}
}
...
...
@@ -358,7 +419,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override
public
void
onClick
(
View
v
)
{
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
"聊天界面点击投诉与反馈"
);
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
{
if
(
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)
)
{
ActionHandlerStorage
.
getL
(
sessionId
).
startFeedback
(
getActivity
());
}
}
...
...
@@ -368,7 +429,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override
public
void
onClick
(
View
v
)
{
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
"聊天界面点击免费热线"
);
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
{
if
(
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)
)
{
ActionHandlerStorage
.
getL
(
sessionId
).
popCallDialog
(
getActivity
());
}
}
...
...
@@ -402,6 +463,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
NIMClient
.
getService
(
MsgService
.
class
).
setChattingAccount
(
sessionId
,
sessionType
);
getActivity
().
setVolumeControlStream
(
AudioManager
.
STREAM_VOICE_CALL
);
// 默认使用听筒播放
messageListPanel
.
scrollToBottom
();
}
@Override
...
...
@@ -418,7 +482,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
public
boolean
onBackPressed
()
{
return
inputPanel
.
collapse
(
true
)
||
messageListPanel
.
onBackPressed
();
return
inputPanel
.
collapse
(
true
)
||
messageListPanel
.
onBackPressed
()
||
openOrCloseCommonQuestionLayout
(
false
)
;
}
//刷新消息列表
...
...
@@ -640,11 +704,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override
public
void
onInputPanelExpand
()
{
messageListPanel
.
scrollToBottom
();
openOrCloseCommonQuestionLayout
(
false
);
}
@Override
public
void
shouldCollapseInputPanel
()
{
inputPanel
.
collapse
(
false
);
openOrCloseCommonQuestionLayout
(
false
);
}
@Override
...
...
@@ -677,4 +745,108 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
return
actions
;
}
}
private
boolean
openOrCloseCommonQuestionLayout
(
boolean
open
)
{
boolean
result
=
false
;
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
3
)
{
if
(
open
)
{
inputPanel
.
collapse
(
true
);
messageListPanel
.
scrollToBottom
();
}
if
(
rl_common_question_enter
!=
null
)
{
rl_common_question_enter
.
setVisibility
(
open
?
View
.
GONE
:
View
.
VISIBLE
);
}
if
(
fl_question_content
!=
null
)
{
if
(
fl_question_content
.
getVisibility
()
==
View
.
VISIBLE
)
{
result
=
true
;
}
fl_question_content
.
setVisibility
(
open
?
View
.
VISIBLE
:
View
.
GONE
);
}
}
return
result
;
}
@SuppressLint
(
"CheckResult"
)
private
void
getCommonQuestionListData
()
{
ServiceImpl
.
Companion
.
getInstance
().
getCommonQuestionList
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
res
->
{
if
(
res
.
data
!=
null
&&
res
.
data
.
size
()
>
0
)
{
if
(
commonQuestionBeanList
==
null
)
{
commonQuestionBeanList
=
new
ArrayList
<>();
}
else
{
commonQuestionBeanList
.
clear
();
}
commonQuestionBeanList
.
addAll
(
res
.
data
);
initCommonQuestionLayout
();
}
},
throwable
->
{
ToastUtil
.
toastShort
(
throwable
.
toString
());
});
}
private
void
initCommonQuestionLayout
()
{
CommonQuestionView
commonQuestionView
=
new
CommonQuestionView
(
getActivity
());
commonQuestionView
.
setData
(
commonQuestionBeanList
);
commonQuestionView
.
setListener
(
new
CommonQuestionView
.
OnSelectItemListener
()
{
@Override
public
void
close
()
{
openOrCloseCommonQuestionLayout
(
false
);
}
@Override
public
void
onSelect
(
@NotNull
String
title
,
String
id
)
{
IMMessage
textMessage
=
MessageBuilder
.
createTextMessage
(
sessionId
,
sessionType
,
title
);
if
(
sendMessage
(
textMessage
))
{
openOrCloseCommonQuestionLayout
(
false
);
}
commonQuestionClickCount
(
id
);
}
});
fl_question_content
.
addView
(
commonQuestionView
);
openOrCloseCommonQuestionLayout
(
true
);
}
@SuppressLint
(
"CheckResult"
)
private
void
commonQuestionClickCount
(
String
id
)
{
ServiceImpl
.
Companion
.
getInstance
().
sendCommonQuestionCount
(
id
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
objectBaseAPIResponse
->
{
},
throwable
->
{
});
}
@SuppressLint
(
"CheckResult"
)
private
void
getUserInfoCollect
()
{
ServiceImpl
.
Companion
.
getInstance
().
userCollectList
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
resp
->
{
if
(
resp
.
data
!=
null
&&
resp
.
data
.
size
()
>
0
)
{
collectInfoPopupWindow
.
setData
(
resp
.
data
);
}
else
{
collectInfoPopupWindow
.
dismiss
();
}
},
throwable
->
{
collectInfoPopupWindow
.
dismiss
();
});
}
@SuppressLint
(
"CheckResult"
)
private
void
submitUserCollect
(
List
<
UserQuestInfoBean
>
result
)
{
SubmitUserInfoBean
submitUserInfoBean
=
new
SubmitUserInfoBean
();
submitUserInfoBean
.
userInfoList
=
result
;
ServiceImpl
.
Companion
.
getInstance
().
submitUserCollect
(
JSON
.
toJSONString
(
submitUserInfoBean
))
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
resp
->
{
},
throwable
->
{
});
}}
m-im/src/main/java/com/yidianling/uikit/business/session/helper/ChatStatusCacheHelper.java
0 → 100644
View file @
ca3a5007
package
com
.
yidianling
.
uikit
.
business
.
session
.
helper
;
import
java.util.HashMap
;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/11
*/
public
class
ChatStatusCacheHelper
{
private
static
final
HashMap
<
String
,
Boolean
>
statusCache
=
new
HashMap
<>();
public
static
void
setStatusCache
(
String
key
,
boolean
value
)
{
statusCache
.
put
(
key
,
value
);
}
public
static
boolean
getStatusCache
(
String
key
)
{
if
(
statusCache
.
containsKey
(
key
))
{
return
statusCache
.
get
(
key
);
}
return
false
;
}
public
static
void
clearDataByKey
(
String
key
)
{
if
(
statusCache
.
containsKey
(
key
))
{
statusCache
.
remove
(
key
);
}
}
}
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
View file @
ca3a5007
...
...
@@ -213,7 +213,7 @@ public class MessageListPanelEx {
private
OnItemClickListener
listener
=
new
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
IRecyclerView
adapter
,
View
view
,
int
position
)
{
container
.
proxy
.
shouldCollapseInputPanel
();
}
@Override
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectInfoPopupWindow.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.business.session.view
import
android.content.Context
import
android.graphics.drawable.BitmapDrawable
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.View
import
android.view.ViewGroup
import
android.widget.PopupWindow
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/10
*/
class
CollectInfoPopupWindow
(
var
mContext
:
Context
,
var
listener
:
OnSendMsgListener
)
:
PopupWindow
(
mContext
)
{
private
var
collectUserInformationView
:
CollectUserInformationView
private
var
isFromBack
=
true
init
{
height
=
ViewGroup
.
LayoutParams
.
MATCH_PARENT
width
=
ViewGroup
.
LayoutParams
.
MATCH_PARENT
setBackgroundDrawable
(
BitmapDrawable
())
collectUserInformationView
=
CollectUserInformationView
(
mContext
,
{
listener
.
sendMsg
(
""
,
ArrayList
())
isFromBack
=
false
dismiss
()
},
{
_content
,
_list
->
listener
.
sendMsg
(
_content
,
_list
)
isFromBack
=
false
dismiss
()
})
collectUserInformationView
.
isFocusableInTouchMode
=
true
collectUserInformationView
.
setOnKeyListener
{
v
,
keyCode
,
event
->
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
showSkipDialog
()
true
}
false
}
contentView
=
collectUserInformationView
isFocusable
=
true
isTouchable
=
true
isOutsideTouchable
=
false
}
fun
setData
(
list
:
List
<
UserQuestInfoBean
>)
{
if
(
list
.
isEmpty
())
{
ToastUtil
.
toastShort
(
"数据异常,请稍后重试"
)
return
}
collectUserInformationView
.
setData
(
list
)
}
override
fun
dismiss
()
{
if
(
isFromBack
)
{
showSkipDialog
()
isFromBack
=
false
}
else
{
super
.
dismiss
()
}
}
private
fun
showSkipDialog
()
{
collectUserInformationView
.
showSkipDialog
()
}
fun
show
(
v
:
View
)
{
v
.
post
{
showAtLocation
(
v
,
Gravity
.
BOTTOM
,
0
,
0
)
}
}
interface
OnSendMsgListener
{
fun
sendMsg
(
content
:
String
,
result
:
List
<
UserQuestInfoBean
>)
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectInfoStyleAdapter.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.business.session.view
import
android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.TextView
import
com.yidianling.im.R
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/11
*/
class
CollectInfoStyleAdapter
(
var
list
:
List
<
String
>,
var
event
:
(
title
:
String
)
->
Unit
)
:
RecyclerView
.
Adapter
<
CollectInfoStyleAdapter
.
InfoStyleHolder
>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
?,
viewType
:
Int
):
InfoStyleHolder
{
return
InfoStyleHolder
(
LayoutInflater
.
from
(
parent
!!
.
context
).
inflate
(
R
.
layout
.
im_item_collect_info_question_style
,
parent
,
false
))
}
override
fun
getItemCount
():
Int
{
return
if
(
list
.
size
>
9
)
9
else
list
.
size
}
override
fun
onBindViewHolder
(
holder
:
InfoStyleHolder
?,
position
:
Int
)
{
holder
!!
.
bindData
(
list
[
position
])
holder
.
itemView
.
setOnClickListener
{
event
(
list
[
position
])
}
}
inner
class
InfoStyleHolder
(
var
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
private
var
textView
:
TextView
=
view
.
findViewById
(
R
.
id
.
tv_title
)
fun
bindData
(
title
:
String
)
{
textView
!!
.
text
=
title
}
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectUserInformationView.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.business.session.view
import
android.annotation.SuppressLint
import
android.content.Context
import
android.graphics.Color
import
android.support.v7.widget.GridLayoutManager
import
android.text.Spannable
import
android.text.SpannableString
import
android.text.TextUtils
import
android.text.style.AbsoluteSizeSpan
import
android.text.style.ForegroundColorSpan
import
android.util.TypedValue
import
android.view.Gravity
import
android.view.View
import
android.view.ViewGroup
import
android.view.inputmethod.InputMethodManager
import
android.widget.EditText
import
android.widget.LinearLayout
import
android.widget.ScrollView
import
android.widget.TextView
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.R
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import
kotlinx.android.synthetic.main.im_view_collect_user_infomation.view.*
import
java.util.*
import
kotlin.collections.ArrayList
/**
* @author jiucheng
* @描述:用户信息采集view
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/10
*/
@SuppressLint
(
"ViewConstructor"
)
class
CollectUserInformationView
(
var
mContext
:
Context
,
var
skipEvent
:
()
->
Unit
,
var
sendMsgEvent
:
(
content
:
String
,
list
:
List
<
UserQuestInfoBean
>)
->
Unit
)
:
LinearLayout
(
mContext
)
{
private
var
resultInfoList
=
ArrayList
<
UserQuestInfoBean
>()
private
var
currentIndex
=
0
private
var
year
=
1994
//todo CommonDialog的样式要改
private
var
dialog
:
CommonDialog
?
=
null
private
var
ageStr
=
""
private
var
genderStr
=
""
private
var
questionStr
=
""
private
var
questionStyleStr
=
""
init
{
val
params
=
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
)
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
im_view_collect_user_infomation
,
this
)
orientation
=
VERTICAL
tv_skip
.
setOnClickListener
{
showSkipDialog
()
}
}
fun
setData
(
list
:
List
<
UserQuestInfoBean
>)
{
resultInfoList
.
clear
()
resultInfoList
.
addAll
(
list
)
addContentView
(
resultInfoList
[
0
].
question
!!
,
true
)
proceedNext
(
list
)
}
private
fun
proceedNext
(
list
:
List
<
UserQuestInfoBean
>)
{
tv_start
.
setOnClickListener
{
addContentView
(
resultInfoList
[
1
].
question
!!
,
true
)
tv_start
.
visibility
=
View
.
GONE
ll_gender
.
visibility
=
View
.
VISIBLE
}
tv_gender_male
.
setOnClickListener
{
addContentView
(
tv_gender_male
.
text
.
toString
(),
false
)
tv_gender_male
.
postDelayed
({
genderStr
=
"性别:男"
addContentView
(
resultInfoList
[
currentIndex
].
question
!!
,
true
)
ll_gender
.
visibility
=
View
.
GONE
rl_age
.
visibility
=
View
.
VISIBLE
},
300
)
}
tv_gender_fomale
.
setOnClickListener
{
addContentView
(
tv_gender_fomale
.
text
.
toString
(),
false
)
tv_gender_fomale
.
postDelayed
({
genderStr
=
"性别:女"
addContentView
(
resultInfoList
[
currentIndex
].
question
!!
,
true
)
ll_gender
.
visibility
=
View
.
GONE
rl_age
.
visibility
=
View
.
VISIBLE
},
300
)
}
((
date_pick
.
getChildAt
(
0
)
as
ViewGroup
).
getChildAt
(
0
)
as
ViewGroup
).
getChildAt
(
2
).
visibility
=
View
.
GONE
((
date_pick
.
getChildAt
(
0
)
as
ViewGroup
).
getChildAt
(
0
)
as
ViewGroup
).
getChildAt
(
1
).
visibility
=
View
.
GONE
date_pick
.
init
(
year
,
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
),
Calendar
.
getInstance
().
get
(
Calendar
.
DAY_OF_MONTH
)
)
{
_
,
year
,
_
,
_
->
this
.
year
=
year
}
date_pick
.
maxDate
=
Calendar
.
getInstance
().
timeInMillis
tv_age_ensure
.
setOnClickListener
{
ageStr
=
"年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
addContentView
(
"${year}年"
,
false
)
tv_age_ensure
.
postDelayed
({
addContentView
(
resultInfoList
[
currentIndex
].
question
!!
,
true
)
rl_age
.
visibility
=
View
.
GONE
rl_question_style
.
visibility
=
View
.
VISIBLE
},
300
)
}
val
adapter
=
CollectInfoStyleAdapter
(
list
[
3
].
answerList
!!
)
{
addContentView
(
it
,
false
)
rl_question_style
.
postDelayed
({
questionStyleStr
=
"咨询类型:${it}"
addContentView
(
resultInfoList
[
currentIndex
].
question
!!
,
true
,
resultInfoList
[
currentIndex
].
answerList
!!
[
0
])
rl_question_style
.
visibility
=
View
.
GONE
ll_input
.
visibility
=
View
.
VISIBLE
rl_question_style
.
postDelayed
({
showInputMethod
(
et_input
)
},
100
)
scrollView
.
postDelayed
({
scrollView
.
fullScroll
(
ScrollView
.
FOCUS_DOWN
)
},
300
)
},
300
)
}
val
layoutManager
=
GridLayoutManager
(
mContext
,
3
)
rl_question_style
.
layoutManager
=
layoutManager
rl_question_style
.
adapter
=
adapter
tv_send
.
setOnClickListener
{
val
content
=
et_input
.
text
.
trim
().
toString
()
if
(
TextUtils
.
isEmpty
(
content
))
{
ToastUtil
.
toastShort
(
"请输入内容"
)
}
else
{
questionStr
=
"问题描述:${content}"
addContentView
(
content
,
false
)
tv_send
.
postDelayed
({
addContentView
(
resultInfoList
[
currentIndex
].
question
!!
,
true
)
ll_input
.
visibility
=
View
.
GONE
tv_finish
.
visibility
=
View
.
VISIBLE
hideInputMethod
(
et_input
)
},
300
)
}
}
tv_finish
.
setOnClickListener
{
val
resultContent
=
ageStr
+
"\n"
+
genderStr
+
"\n"
+
questionStyleStr
+
"\n"
+
questionStr
val
genderBean
=
UserQuestInfoBean
(
list
[
1
].
userInfoType
,
""
,
ArrayList
(),
genderStr
.
split
(
":"
)[
1
])
val
ageBean
=
UserQuestInfoBean
(
list
[
2
].
userInfoType
,
""
,
ArrayList
(),
"${year}"
)
val
questionStyleBean
=
UserQuestInfoBean
(
list
[
3
].
userInfoType
,
""
,
ArrayList
(),
questionStyleStr
.
split
(
":"
)[
1
])
val
questionBean
=
UserQuestInfoBean
(
list
[
4
].
userInfoType
,
""
,
ArrayList
(),
questionStr
.
split
(
":"
)[
1
])
val
resultList
=
ArrayList
<
UserQuestInfoBean
>()
resultList
.
add
(
genderBean
)
resultList
.
add
(
ageBean
)
resultList
.
add
(
questionStyleBean
)
resultList
.
add
(
questionBean
)
sendMsgEvent
(
resultContent
,
resultList
)
}
}
@SuppressLint
(
"RtlHardcoded"
)
private
fun
addContentView
(
title
:
String
,
send
:
Boolean
,
subtitle
:
String
=
""
)
{
val
textView
=
TextView
(
mContext
)
val
params
=
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
params
.
topMargin
=
RxImageTool
.
dp2px
(
18f
)
textView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
17f
)
textView
.
setTextColor
(
Color
.
parseColor
(
"#242424"
))
textView
.
setPadding
(
RxImageTool
.
dp2px
(
13f
),
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
13f
),
RxImageTool
.
dp2px
(
9f
))
if
(
send
)
{
textView
.
setBackgroundResource
(
R
.
drawable
.
im_background_collect_info_left
)
params
.
gravity
=
Gravity
.
LEFT
}
else
{
textView
.
setBackgroundResource
(
R
.
drawable
.
im_background_collect_info_right
)
params
.
gravity
=
Gravity
.
RIGHT
}
if
(!
TextUtils
.
isEmpty
(
subtitle
))
{
val
resultText
=
"$title\n参考:\n$subtitle"
val
sbString
=
SpannableString
(
resultText
)
sbString
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#999999"
)),
title
.
length
+
3
,
resultText
.
length
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
sbString
.
setSpan
(
AbsoluteSizeSpan
(
12
,
true
),
title
.
length
,
resultText
.
length
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
textView
.
text
=
sbString
textView
.
setLineSpacing
(
4f
,
1f
)
}
else
{
textView
.
text
=
title
}
textView
.
maxWidth
=
RxImageTool
.
dp2px
(
255f
)
textView
.
layoutParams
=
params
ll_content
.
addView
(
textView
)
if
(
send
)
{
currentIndex
++
}
}
// 隐藏键盘布局
private
fun
hideInputMethod
(
et
:
EditText
)
{
val
imm
=
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
hideSoftInputFromWindow
(
et
.
windowToken
,
0
)
et
.
clearFocus
()
}
// 显示键盘布局
private
fun
showInputMethod
(
editTextMessage
:
EditText
)
{
editTextMessage
.
requestFocus
()
val
imm
=
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
showSoftInput
(
editTextMessage
,
0
)
}
fun
showSkipDialog
()
{
if
(
dialog
==
null
)
{
dialog
=
CommonDialog
.
create
(
mContext
)
.
setLeftOnclick
(
"下次吧"
)
{
skipEvent
()
}
.
setRightClick
(
"继续填写"
)
{
dialog
!!
.
dismiss
()
}
.
setMessage
(
"这个过程可以帮助您更快地改变当前的现状,确定要跳过吗?"
)
.
setTitle_color
(
R
.
color
.
im_color_242424
)
.
setCancelAble
(
true
)
}
if
(!
dialog
!!
.
isShowing
)
{
dialog
!!
.
show
()
}
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/business/session/view/CommonQuestionAdapter.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.business.session.view
import
android.content.Context
import
android.support.v7.widget.RecyclerView
import
android.view.ViewGroup
import
com.yidianling.uikit.custom.http.response.CommonQuestionBean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class
CommonQuestionAdapter
(
var
mContext
:
Context
,
var
list
:
List
<
CommonQuestionBean
>,
var
event
:
(
title
:
String
,
id
:
String
)
->
Unit
)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
?,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
return
CommonQuestionViewHolder
(
CommonQuestionItemView
(
mContext
))
}
override
fun
getItemCount
():
Int
{
return
list
.
size
}
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
?,
position
:
Int
)
{
((
holder
as
CommonQuestionViewHolder
).
itemView
as
CommonQuestionItemView
).
setData
(
list
[
position
].
title
,
list
[
position
].
keyword
,
position
==
list
.
size
-
1
)
holder
.
itemView
.
setOnClickListener
{
event
(
list
[
position
].
title
,
list
[
position
].
id
)
}
}
inner
class
CommonQuestionViewHolder
(
view
:
CommonQuestionItemView
)
:
RecyclerView
.
ViewHolder
(
view
)
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/business/session/view/CommonQuestionItemView.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.business.session.view
import
android.content.Context
import
android.graphics.Color
import
android.text.Spannable
import
android.text.SpannableString
import
android.text.TextUtils
import
android.text.style.ForegroundColorSpan
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
com.yidianling.im.R
import
kotlinx.android.synthetic.main.im_item_view_common_question.view.*
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class
CommonQuestionItemView
(
var
mContext
:
Context
)
:
LinearLayout
(
mContext
)
{
init
{
var
parmas
=
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
parmas
View
.
inflate
(
mContext
,
R
.
layout
.
im_item_view_common_question
,
this
)
orientation
=
VERTICAL
}
fun
setData
(
title
:
String
,
keyWords
:
String
?,
isLast
:
Boolean
)
{
if
(
TextUtils
.
isEmpty
(
keyWords
))
{
tv_title
.
text
=
title
}
else
{
if
(
title
.
contains
(
keyWords
!!
))
{
val
temp
=
title
.
split
(
keyWords
)
val
spanString
=
SpannableString
(
temp
[
0
]
+
keyWords
+
temp
[
1
])
spanString
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#1da1f2"
)),
temp
[
0
].
length
,
(
temp
[
0
]
+
keyWords
).
length
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
tv_title
.
text
=
spanString
}
else
{
tv_title
.
text
=
title
}
}
if
(
isLast
)
{
view_line
.
visibility
=
View
.
GONE
}
else
{
view_line
.
visibility
=
View
.
VISIBLE
}
}
}
m-im/src/main/java/com/yidianling/uikit/business/session/view/CommonQuestionView.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.business.session.view
import
android.content.Context
import
android.support.v7.widget.RecyclerView
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.im.R
import
com.yidianling.uikit.custom.http.response.CommonQuestionBean
import
kotlinx.android.synthetic.main.im_view_common_question.view.*
/**
* @author jiucheng
* @描述:私聊常见问题view
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class
CommonQuestionView
(
var
mContext
:
Context
)
:
LinearLayout
(
mContext
)
{
var
listener
:
OnSelectItemListener
?
=
null
init
{
var
parmas
=
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
parmas
View
.
inflate
(
mContext
,
R
.
layout
.
im_view_common_question
,
this
)
orientation
=
VERTICAL
}
fun
setData
(
list
:
List
<
CommonQuestionBean
>)
{
if
(
list
.
isEmpty
())
{
visibility
=
View
.
GONE
return
}
if
(
list
.
size
>
4
)
{
var
parmas
=
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
RxImageTool
.
dp2px
(
214f
))
content_view
.
layoutParams
=
parmas
}
val
adapter
=
CommonQuestionAdapter
(
mContext
,
list
)
{
title
,
id
->
listener
!!
.
onSelect
(
title
,
id
)
listener
!!
.
close
()
}
var
layoutManager
=
WrapContentLinearLayoutManager
(
mContext
)
content_view
.
layoutManager
=
layoutManager
as
RecyclerView
.
LayoutManager
?
content_view
.
adapter
=
adapter
rl_close
.
setOnClickListener
{
listener
!!
.
close
()
}
}
fun
show
()
{
visibility
=
View
.
VISIBLE
}
fun
hide
()
{
visibility
=
View
.
GONE
}
interface
OnSelectItemListener
{
fun
onSelect
(
title
:
String
,
id
:
String
)
fun
close
()
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
View file @
ca3a5007
...
...
@@ -4,11 +4,12 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.uikit.custom.http.response.ChatStatusBean
import
com.yidianling.uikit.custom.http.response.CommonQuestionBean
import
com.yidianling.uikit.custom.http.response.RecommendExpertBean
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import
io.reactivex.Observable
import
retrofit2.http.GET
import
retrofit2.http.Headers
import
retrofit2.http.Query
import
okhttp3.RequestBody
import
retrofit2.http.*
/**
* Created by xj on 2019/6/26.
...
...
@@ -29,4 +30,25 @@ interface ServiceApi{
@GET
(
"doctor/recommendSimilarListeners"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getRecommendExpertList
(
@Query
(
"doctorUid"
)
doctorUid
:
Long
,
@Query
(
"catName"
)
catName
:
String
,
@Query
(
"limit"
)
limit
:
Int
):
Observable
<
BaseAPIResponse
<
ArrayList
<
RecommendExpertBean
>>>
//获取常用语
@POST
(
"phrase/list"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getCommonQuestionList
():
Observable
<
BaseAPIResponse
<
List
<
CommonQuestionBean
>>>
//常用语的点击
@GET
(
"phrase/count"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
sendCommonQuestionCount
(
@Query
(
"id"
)
id
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
//信息采集的问题
@GET
(
"user/collect/list"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
userCollectList
():
Observable
<
BaseAPIResponse
<
List
<
UserQuestInfoBean
>>>
//信息采集的问题
@POST
(
"user/collect/submit"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
submitUserCollect
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
View file @
ca3a5007
...
...
@@ -3,8 +3,12 @@ package com.yidianling.uikit.custom.http
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.uikit.custom.http.response.ChatStatusBean
import
com.yidianling.uikit.custom.http.response.CommonQuestionBean
import
com.yidianling.uikit.custom.http.response.RecommendExpertBean
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import
io.reactivex.Observable
import
okhttp3.MediaType
import
okhttp3.RequestBody
/**
* Created by xj on 2019/6/26.
...
...
@@ -35,4 +39,33 @@ class ServiceImpl private constructor(){
fun
getRecommendExpertList
(
doctorUid
:
Long
,
catName
:
String
,
limit
:
Int
):
Observable
<
BaseAPIResponse
<
ArrayList
<
RecommendExpertBean
>>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getRecommendExpertList
(
doctorUid
,
catName
,
limit
)
}
/**
* 获取常用语
*/
fun
getCommonQuestionList
():
Observable
<
BaseAPIResponse
<
List
<
CommonQuestionBean
>>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getCommonQuestionList
()
}
/**
* 常用语的点击
*/
fun
sendCommonQuestionCount
(
id
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
sendCommonQuestionCount
(
id
)
}
/**
* 信息采集的问题
*/
fun
userCollectList
():
Observable
<
BaseAPIResponse
<
List
<
UserQuestInfoBean
>>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
userCollectList
()
}
/**
* 上传采集的问题
*/
fun
submitUserCollect
(
params
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
{
val
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
params
)
as
RequestBody
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
submitUserCollect
(
body
)
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/response/CommonQuestionBean.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.custom.http.response
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class
CommonQuestionBean
(
var
title
:
String
,
var
id
:
String
,
var
keyword
:
String
)
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/response/SubmitUserInfoBean.java
0 → 100644
View file @
ca3a5007
package
com
.
yidianling
.
uikit
.
custom
.
http
.
response
;
import
java.util.List
;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/13
*/
public
class
SubmitUserInfoBean
{
public
List
<
UserQuestInfoBean
>
userInfoList
;
}
m-im/src/main/java/com/yidianling/uikit/custom/http/response/UserQuestInfoBean.kt
0 → 100644
View file @
ca3a5007
package
com.yidianling.uikit.custom.http.response
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/12
*/
class
UserQuestInfoBean
(
var
userInfoType
:
String
,
var
question
:
String
?,
var
answerList
:
List
<
String
>?,
var
content
:
String
?)
\ No newline at end of file
m-im/src/main/res_uikit/drawable-xhdpi/im_ico_default_avatar.png
0 → 100644
View file @
ca3a5007
10.4 KB
m-im/src/main/res_uikit/drawable/im_background_chat_collect_info_question_style.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:radius=
"17dp"
/>
<solid
android:color=
"#1A1DA1F2"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/drawable/im_background_chat_collect_info_send.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:radius=
"6dp"
/>
<solid
android:color=
"@color/platform_color_1DA1F2"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/drawable/im_background_chat_common_question.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:topRightRadius=
"6dp"
/>
<solid
android:color=
"#EBffffff"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/drawable/im_background_collect_info_bottom_gender.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:radius=
"20dp"
/>
<solid
android:color=
"#1F1DA1F2"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/drawable/im_background_collect_info_bottom_start.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:radius=
"20dp"
/>
<gradient
android:endColor=
"@color/platform_color_1DA1F2"
android:startColor=
"#23B2FA"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/drawable/im_background_collect_info_left.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:bottomLeftRadius=
"6dp"
android:bottomRightRadius=
"6dp"
android:topRightRadius=
"6dp"
/>
<solid
android:color=
"#ffffff"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/drawable/im_background_collect_info_right.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:bottomLeftRadius=
"6dp"
android:bottomRightRadius=
"6dp"
android:topLeftRadius=
"6dp"
/>
<solid
android:color=
"#CCEBFF"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/layout/im_item_collect_info_question_style.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/tv_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"15dp"
android:background=
"@drawable/im_background_chat_collect_info_question_style"
android:gravity=
"center"
android:paddingTop=
"7dp"
android:layout_marginTop=
"14dp"
android:paddingBottom=
"7dp"
android:textColor=
"@color/platform_color_1DA1F2"
android:textSize=
"15sp"
tools:text=
"恋爱情感"
/>
m-im/src/main/res_uikit/layout/im_item_view_common_question.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
tools:parentTag=
"android.widget.LinearLayout"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"11dp"
android:layout_marginEnd=
"17dp"
android:ellipsize=
"end"
android:gravity=
"center_vertical"
android:maxLines=
"2"
android:minHeight=
"44dp"
android:paddingTop=
"11dp"
android:paddingBottom=
"11dp"
android:textColor=
"#242424"
android:textSize=
"16sp"
tools:text=
"咨询顾问的服咨询顾问的服咨询顾问的服务收费吗务收费吗咨询顾问的服务收费吗务收费吗?"
/>
<View
android:id=
"@+id/view_line"
android:layout_width=
"match_parent"
android:layout_height=
"1px"
android:layout_marginStart=
"11dp"
android:layout_marginEnd=
"17dp"
android:background=
"#EBEBEB"
/>
</merge>
\ No newline at end of file
m-im/src/main/res_uikit/layout/im_view_collect_user_infomation.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:parentTag=
"android.widget.LinearLayout"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
android:background=
"@color/white"
>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"26dp"
android:layout_height=
"30dp"
android:layout_marginRight=
"6dp"
android:layout_centerVertical=
"true"
android:layout_toLeftOf=
"@+id/tv_title"
android:src=
"@drawable/im_ico_default_avatar"
/>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_centerHorizontal=
"true"
android:gravity=
"center_vertical"
android:text=
"咨询前评估"
android:textColor=
"@color/im_color_242424"
android:textSize=
"17sp"
/>
<TextView
android:id=
"@+id/tv_skip"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentRight=
"true"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:paddingRight=
"15dp"
android:text=
"跳过"
android:textColor=
"@color/im_color_grey_999999"
android:textSize=
"14sp"
/>
</RelativeLayout>
<ScrollView
android:id=
"@+id/scrollView"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:background=
"@color/platform_color_F0F0F0"
>
<LinearLayout
android:id=
"@+id/ll_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:paddingLeft=
"18dp"
android:paddingRight=
"18dp"
android:paddingBottom=
"28dp"
>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id=
"@+id/rl_choose_item"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:minHeight=
"56dp"
>
<!-- 开始-->
<TextView
android:id=
"@+id/tv_start"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginLeft=
"30dp"
android:layout_marginTop=
"14dp"
android:layout_marginRight=
"30dp"
android:layout_marginBottom=
"14dp"
android:background=
"@drawable/im_background_collect_info_bottom_start"
android:gravity=
"center"
android:text=
"好的"
android:textColor=
"@color/white"
android:textSize=
"16sp"
android:visibility=
"visible"
tools:visibility=
"gone"
/>
<!-- 性别-->
<LinearLayout
android:id=
"@+id/ll_gender"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"30dp"
android:layout_marginTop=
"14dp"
android:layout_marginRight=
"30dp"
android:layout_marginBottom=
"14dp"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_gender_male"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_background_collect_info_bottom_gender"
android:gravity=
"center"
android:text=
"男"
android:textColor=
"@color/platform_color_1DA1F2"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_gender_fomale"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginLeft=
"15dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_background_collect_info_bottom_gender"
android:gravity=
"center"
android:text=
"女"
android:textColor=
"@color/platform_color_1DA1F2"
android:textSize=
"16sp"
/>
</LinearLayout>
<!-- 年龄-->
<RelativeLayout
android:id=
"@+id/rl_age"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"44dp"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:text=
"请选择出生年份"
android:textColor=
"@color/im_color_242424"
android:textSize=
"17sp"
/>
<TextView
android:id=
"@+id/tv_age_ensure"
android:layout_width=
"wrap_content"
android:layout_height=
"44dp"
android:layout_alignParentRight=
"true"
android:gravity=
"center"
android:paddingRight=
"20dp"
android:text=
"确定"
android:textColor=
"@color/platform_color_1DA1F2"
android:textSize=
"17sp"
/>
<DatePicker
android:id=
"@+id/date_pick"
android:layout_width=
"match_parent"
android:layout_height=
"205dp"
android:layout_below=
"@+id/title"
android:calendarViewShown=
"false"
android:datePickerMode=
"spinner"
/>
</RelativeLayout>
<!-- 问题类型?-->
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rl_question_style"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingLeft=
"5dp"
android:paddingTop=
"6dp"
android:paddingRight=
"20dp"
android:paddingBottom=
"20dp"
android:visibility=
"gone"
tools:layout_height=
"160dp"
/>
<!-- 问题输入-->
<LinearLayout
android:id=
"@+id/ll_input"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/platform_color_F7F7F7"
android:orientation=
"horizontal"
android:paddingRight=
"20dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<EditText
android:id=
"@+id/et_input"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_nim_chat_input_edit_background"
android:hint=
"放心咨询,信息保密"
android:minHeight=
"37dp"
android:paddingStart=
"10dp"
android:paddingTop=
"5dp"
android:paddingRight=
"10dp"
android:paddingBottom=
"5dp"
android:textColor=
"@color/im_color_242424"
android:textColorHint=
"@color/platform_color_BFBFBF"
android:textSize=
"14sp"
tools:text=
"放心咨询,信放心咨询,信息保密放心咨询,信息保密放心咨询,信息保密放心咨询,信息保密放心咨询,信息保密息保密"
/>
<TextView
android:id=
"@+id/tv_send"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"12dp"
android:background=
"@drawable/im_background_chat_collect_info_send"
android:gravity=
"center"
android:padding=
"5dp"
android:text=
"@string/send"
android:textColor=
"@color/white"
android:textSize=
"14sp"
/>
</LinearLayout>
<!-- 开始-->
<TextView
android:id=
"@+id/tv_finish"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginLeft=
"30dp"
android:layout_marginTop=
"14dp"
android:layout_marginRight=
"30dp"
android:layout_marginBottom=
"14dp"
android:background=
"@drawable/im_background_collect_info_bottom_start"
android:gravity=
"center"
android:text=
"去沟通"
android:textColor=
"@color/white"
android:textSize=
"16sp"
android:visibility=
"gone"
/>
</RelativeLayout>
</merge>
\ No newline at end of file
m-im/src/main/res_uikit/layout/im_view_common_question.xml
0 → 100644
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
tools:parentTag=
"android.widget.LinearLayout"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/content_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:layout_height=
"200dp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1px"
android:background=
"#EBEBEB"
/>
<RelativeLayout
android:id=
"@+id/rl_close"
android:layout_width=
"match_parent"
android:layout_height=
"42dp"
>
<TextView
android:id=
"@+id/tv_common"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginStart=
"11dp"
android:layout_marginRight=
"13dp"
android:gravity=
"center_vertical"
android:text=
"常见问题"
android:textColor=
"#242424"
android:textStyle=
"bold"
/>
</RelativeLayout>
</merge>
\ No newline at end of file
m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
View file @
ca3a5007
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@color/platform_color_F0F0F0"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/message_activity_list_view_container"
android:layout_width=
"match_parent"
android:layout_height=
"0dip"
android:layout_weight=
"1"
>
<com.yidianling.uikit.business.session.helper.MsgBkImageView
android:id=
"@+id/message_activity_background"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<android.support.design.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.design.widget.AppBarLayout
android:id=
"@+id/appbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:elevation=
"0dp"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_scrollFlags=
"scroll|enterAlways"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/line"
android:background=
"#ffffff"
android:visibility=
"gone"
>
<com.yidianling.nimbase.common.ui.imageview.CircleImageView
android:id=
"@+id/info_head"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_margin=
"10dp"
/>
<TextView
android:id=
"@+id/info_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:layout_toRightOf=
"@+id/info_head"
android:text=
"预约咨询"
/>
<TextView
android:id=
"@+id/info_money"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/info_name"
android:layout_toRightOf=
"@+id/info_head"
android:text=
"200"
android:textColor=
"#ff8800"
android:textSize=
"16sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/info_name"
android:layout_alignBaseline=
"@+id/info_money"
android:layout_toRightOf=
"@+id/info_money"
android:text=
"元/次"
android:textSize=
"12sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10dp"
android:background=
"@drawable/im_shape_green_bg"
android:padding=
"5dp"
android:text=
"立即预约"
android:textColor=
"#3fca69"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_below=
"@+id/info_head"
android:background=
"#EDEDED"
/>
</RelativeLayout>
<LinearLayout
android:id=
"@+id/top_expert_info_ll"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<android.support.constraint.ConstraintLayout
android:id=
"@+id/top_expert_info_cl"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_10"
android:paddingLeft=
"@dimen/platform_dp_10"
android:background=
"@color/im_white"
android:visibility=
"gone"
>
<com.ydl.ydlcommon.view.CircleImageView
android:id=
"@+id/small_head_img"
android:layout_width=
"@dimen/platform_dp_36"
android:layout_height=
"@dimen/platform_dp_36"
android:background=
"@drawable/platform_head_place_hold_pic"
>
</com.ydl.ydlcommon.view.CircleImageView>
<RelativeLayout
android:id=
"@+id/rl_help"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintLeft_toRightOf=
"@+id/small_head_img"
android:layout_marginLeft=
"30dp"
>
<TextView
android:id=
"@+id/help_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"2648"
android:fontFamily=
"@font/platform_dincond_bold"
android:textColor=
"@color/im_color_242424"
android:layout_centerHorizontal=
"true"
android:textSize=
"@dimen/platform_dp_20"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"帮助人数"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_10"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_good"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintRight_toRightOf=
"parent"
android:layout_marginRight=
"30dp"
>
<TextView
android:id=
"@+id/good_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"99.9%"
android:fontFamily=
"@font/platform_dincond_bold"
android:textColor=
"@color/im_color_242424"
android:layout_centerHorizontal=
"true"
android:textSize=
"@dimen/platform_dp_20"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"好评率"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_10"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_server"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintLeft_toRightOf=
"@+id/rl_help"
app:layout_constraintRight_toLeftOf=
"@+id/rl_good"
>
<TextView
android:id=
"@+id/server_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"1634"
android:fontFamily=
"@font/platform_dincond_bold"
android:textColor=
"@color/im_color_242424"
android:layout_centerHorizontal=
"true"
android:textSize=
"@dimen/platform_dp_20"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"服务时长 (小时)"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_10"
/>
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
>
<!--快捷按钮-->
<FrameLayout
android:id=
"@+id/quick_fl"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingLeft=
"8dp"
android:paddingTop=
"10dp"
android:paddingRight=
"10dp"
>
<LinearLayout
android:id=
"@+id/ll_actions_yi"
android:layout_width=
"match_parent"
android:layout_height=
"53dp"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<LinearLayout
android:id=
"@+id/action_help"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:background=
"@drawable/im_bg_im_confide_action"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"17dp"
android:layout_height=
"17dp"
android:src=
"@drawable/im_chat_ico_help"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"3dp"
android:gravity=
"center"
android:text=
"常见问题"
android:textColor=
"@color/im_color_242424"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/action_feedback"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"8dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_bg_im_confide_action"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"17dp"
android:layout_height=
"17dp"
android:src=
"@drawable/im_chat_ico_feedback"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"3dp"
android:gravity=
"center"
android:text=
"投诉反馈"
android:textColor=
"@color/im_color_242424"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/action_call"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"8dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_bg_im_confide_action"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"17dp"
android:layout_height=
"17dp"
android:src=
"@drawable/im_chat_free_call"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"3dp"
android:gravity=
"center"
android:text=
"免费热线"
android:textColor=
"@color/im_color_242424"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
<RelativeLayout
android:id=
"@+id/rl_contain"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:layout_height=
"50dp"
android:layout_below=
"@+id/quick_fl"
>
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/messageListView"
style=
"@style/list_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:cacheColorHint=
"@android:color/transparent"
android:divider=
"@null"
android:fadingEdge=
"none"
android:focusable=
"false"
android:layout_below=
"@+id/rl_contain"
android:listSelector=
"@android:color/transparent"
android:scrollbars=
"vertical"
/>
<RelativeLayout
android:id=
"@+id/lin_actions"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_alignParentRight=
"true"
android:layout_alignTop=
"@+id/messageListView"
android:layout_marginRight=
"@dimen/platform_dp_10"
android:layout_marginTop=
"10dp"
android:visibility=
"visible"
>
<RelativeLayout
android:id=
"@+id/rela_qingsu"
android:layout_width=
"wrap_content"
android:layout_height=
"36dp"
android:paddingLeft=
"14dp"
android:paddingRight=
"17dp"
android:gravity=
"center"
android:background=
"@drawable/im_bg_im_confide_action"
>
<ImageView
android:id=
"@+id/action_qingshu_img"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/im_chat_ico_call"
/>
<TextView
android:id=
"@+id/action_qingshu"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"即时倾诉"
android:paddingLeft=
"5dp"
android:layout_toRightOf=
"@+id/action_qingshu_img"
android:textColor=
"@color/platform_google_blue"
android:textSize=
"12dp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rela_zixun"
android:layout_width=
"wrap_content"
android:layout_height=
"36dp"
android:paddingLeft=
"17dp"
android:paddingRight=
"14dp"
android:layout_toRightOf=
"@+id/rela_qingsu"
android:layout_marginLeft=
"-4dp"
android:gravity=
"center"
android:background=
"@drawable/im_bg_im_confide_action"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/im_bg_im_confide_top_tips"
android:paddingLeft=
"5dp"
android:paddingTop=
"1dp"
android:paddingRight=
"5dp"
android:paddingBottom=
"1dp"
android:text=
"立减20元"
android:textColor=
"@color/im_white"
android:textSize=
"9sp"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/img_zixun"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/im_chat_pre_zixun"
/>
<TextView
android:id=
"@+id/action_yuyue"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"预约咨询"
android:paddingLeft=
"5dp"
android:layout_toRightOf=
"@+id/img_zixun"
android:textColor=
"@color/platform_google_green"
android:textSize=
"12dp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
<FrameLayout
android:id=
"@+id/layoutPlayAudio"
android:layout_width=
"128dp"
android:layout_height=
"128dp"
android:layout_gravity=
"center"
android:background=
"@drawable/im_nim_audio_record_toast_bg"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ImageView
android:id=
"@+id/img_antation"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"25dp"
android:src=
"@mipmap/im_voice_search_feedback001"
/>
<ImageView
android:id=
"@+id/img_cancel"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"25dp"
android:src=
"@mipmap/im_icon_audio_cancel"
android:visibility=
"gone"
/>
<Chronometer
android:id=
"@+id/timer"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"@string/im_timer_default"
android:textColor=
"@color/im_white"
android:textSize=
"45sp"
android:visibility=
"gone"
/>
<LinearLayout
android:id=
"@+id/timer_tip_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_margin=
"6dp"
android:gravity=
"center"
>
<TextView
android:id=
"@+id/timer_tip"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:text=
"@string/im_recording_cancel"
android:textColor=
"@color/im_white"
android:textSize=
"12sp"
/>
</LinearLayout>
</FrameLayout>
<com.yidianling.uikit.business.session.view.ChatPrivateTips
android:id=
"@+id/v_chattips"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"58dp"
android:visibility=
"gone"
/>
</FrameLayout>
<include
layout=
"@layout/im_nim_message_activity_bottom_layout"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@color/platform_color_F0F0F0"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/message_activity_list_view_container"
android:layout_width=
"match_parent"
android:layout_height=
"0dip"
android:layout_weight=
"1"
>
<com.yidianling.uikit.business.session.helper.MsgBkImageView
android:id=
"@+id/message_activity_background"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<android.support.design.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.design.widget.AppBarLayout
android:id=
"@+id/appbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:elevation=
"0dp"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_scrollFlags=
"scroll|enterAlways"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/line"
android:background=
"#ffffff"
android:visibility=
"gone"
>
<com.yidianling.nimbase.common.ui.imageview.CircleImageView
android:id=
"@+id/info_head"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_margin=
"10dp"
/>
<TextView
android:id=
"@+id/info_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:layout_toRightOf=
"@+id/info_head"
android:text=
"预约咨询"
/>
<TextView
android:id=
"@+id/info_money"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/info_name"
android:layout_toRightOf=
"@+id/info_head"
android:text=
"200"
android:textColor=
"#ff8800"
android:textSize=
"16sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/info_name"
android:layout_alignBaseline=
"@+id/info_money"
android:layout_toRightOf=
"@+id/info_money"
android:text=
"元/次"
android:textSize=
"12sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10dp"
android:background=
"@drawable/im_shape_green_bg"
android:padding=
"5dp"
android:text=
"立即预约"
android:textColor=
"#3fca69"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_below=
"@+id/info_head"
android:background=
"#EDEDED"
/>
</RelativeLayout>
<LinearLayout
android:id=
"@+id/top_expert_info_ll"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<android.support.constraint.ConstraintLayout
android:id=
"@+id/top_expert_info_cl"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_10"
android:paddingLeft=
"@dimen/platform_dp_10"
android:background=
"@color/im_white"
android:visibility=
"gone"
>
<com.ydl.ydlcommon.view.CircleImageView
android:id=
"@+id/small_head_img"
android:layout_width=
"@dimen/platform_dp_36"
android:layout_height=
"@dimen/platform_dp_36"
android:background=
"@drawable/platform_head_place_hold_pic"
>
</com.ydl.ydlcommon.view.CircleImageView>
<RelativeLayout
android:id=
"@+id/rl_help"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintLeft_toRightOf=
"@+id/small_head_img"
android:layout_marginLeft=
"30dp"
>
<TextView
android:id=
"@+id/help_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"2648"
android:fontFamily=
"@font/platform_dincond_bold"
android:textColor=
"@color/im_color_242424"
android:layout_centerHorizontal=
"true"
android:textSize=
"@dimen/platform_dp_20"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"帮助人数"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_10"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_good"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintRight_toRightOf=
"parent"
android:layout_marginRight=
"30dp"
>
<TextView
android:id=
"@+id/good_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"99.9%"
android:fontFamily=
"@font/platform_dincond_bold"
android:textColor=
"@color/im_color_242424"
android:layout_centerHorizontal=
"true"
android:textSize=
"@dimen/platform_dp_20"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"好评率"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_10"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_server"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintLeft_toRightOf=
"@+id/rl_help"
app:layout_constraintRight_toLeftOf=
"@+id/rl_good"
>
<TextView
android:id=
"@+id/server_num_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"1634"
android:fontFamily=
"@font/platform_dincond_bold"
android:textColor=
"@color/im_color_242424"
android:layout_centerHorizontal=
"true"
android:textSize=
"@dimen/platform_dp_20"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"服务时长 (小时)"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"@dimen/platform_dp_10"
/>
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
>
<!--快捷按钮-->
<FrameLayout
android:id=
"@+id/quick_fl"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingLeft=
"8dp"
android:paddingTop=
"10dp"
android:paddingRight=
"10dp"
>
<LinearLayout
android:id=
"@+id/ll_actions_yi"
android:layout_width=
"match_parent"
android:layout_height=
"53dp"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<LinearLayout
android:id=
"@+id/action_help"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:background=
"@drawable/im_bg_im_confide_action"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"17dp"
android:layout_height=
"17dp"
android:src=
"@drawable/im_chat_ico_help"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"3dp"
android:gravity=
"center"
android:text=
"常见问题"
android:textColor=
"@color/im_color_242424"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/action_feedback"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"8dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_bg_im_confide_action"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"17dp"
android:layout_height=
"17dp"
android:src=
"@drawable/im_chat_ico_feedback"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"3dp"
android:gravity=
"center"
android:text=
"投诉反馈"
android:textColor=
"@color/im_color_242424"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/action_call"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"8dp"
android:layout_weight=
"1"
android:background=
"@drawable/im_bg_im_confide_action"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"17dp"
android:layout_height=
"17dp"
android:src=
"@drawable/im_chat_free_call"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"3dp"
android:gravity=
"center"
android:text=
"免费热线"
android:textColor=
"@color/im_color_242424"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
<RelativeLayout
android:id=
"@+id/rl_contain"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:layout_height=
"50dp"
android:layout_below=
"@+id/quick_fl"
>
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/messageListView"
style=
"@style/list_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:cacheColorHint=
"@android:color/transparent"
android:divider=
"@null"
android:fadingEdge=
"none"
android:focusable=
"false"
android:layout_below=
"@+id/rl_contain"
android:listSelector=
"@android:color/transparent"
android:scrollbars=
"vertical"
/>
<RelativeLayout
android:id=
"@+id/lin_actions"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_alignParentRight=
"true"
android:layout_alignTop=
"@+id/messageListView"
android:layout_marginRight=
"@dimen/platform_dp_10"
android:layout_marginTop=
"10dp"
android:visibility=
"visible"
>
<RelativeLayout
android:id=
"@+id/rela_qingsu"
android:layout_width=
"wrap_content"
android:layout_height=
"36dp"
android:paddingLeft=
"14dp"
android:paddingRight=
"17dp"
android:gravity=
"center"
android:background=
"@drawable/im_bg_im_confide_action"
>
<ImageView
android:id=
"@+id/action_qingshu_img"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/im_chat_ico_call"
/>
<TextView
android:id=
"@+id/action_qingshu"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"即时倾诉"
android:paddingLeft=
"5dp"
android:layout_toRightOf=
"@+id/action_qingshu_img"
android:textColor=
"@color/platform_google_blue"
android:textSize=
"12dp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rela_zixun"
android:layout_width=
"wrap_content"
android:layout_height=
"36dp"
android:paddingLeft=
"17dp"
android:paddingRight=
"14dp"
android:layout_toRightOf=
"@+id/rela_qingsu"
android:layout_marginLeft=
"-4dp"
android:gravity=
"center"
android:background=
"@drawable/im_bg_im_confide_action"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/im_bg_im_confide_top_tips"
android:paddingLeft=
"5dp"
android:paddingTop=
"1dp"
android:paddingRight=
"5dp"
android:paddingBottom=
"1dp"
android:text=
"立减20元"
android:textColor=
"@color/im_white"
android:textSize=
"9sp"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/img_zixun"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/im_chat_pre_zixun"
/>
<TextView
android:id=
"@+id/action_yuyue"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:text=
"预约咨询"
android:paddingLeft=
"5dp"
android:layout_toRightOf=
"@+id/img_zixun"
android:textColor=
"@color/platform_google_green"
android:textSize=
"12dp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
<FrameLayout
android:id=
"@+id/layoutPlayAudio"
android:layout_width=
"128dp"
android:layout_height=
"128dp"
android:layout_gravity=
"center"
android:background=
"@drawable/im_nim_audio_record_toast_bg"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ImageView
android:id=
"@+id/img_antation"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"25dp"
android:src=
"@mipmap/im_voice_search_feedback001"
/>
<ImageView
android:id=
"@+id/img_cancel"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"25dp"
android:src=
"@mipmap/im_icon_audio_cancel"
android:visibility=
"gone"
/>
<Chronometer
android:id=
"@+id/timer"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"@string/im_timer_default"
android:textColor=
"@color/im_white"
android:textSize=
"45sp"
android:visibility=
"gone"
/>
<LinearLayout
android:id=
"@+id/timer_tip_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_margin=
"6dp"
android:gravity=
"center"
>
<TextView
android:id=
"@+id/timer_tip"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:text=
"@string/im_recording_cancel"
android:textColor=
"@color/im_white"
android:textSize=
"12sp"
/>
</LinearLayout>
</FrameLayout>
<com.yidianling.uikit.business.session.view.ChatPrivateTips
android:id=
"@+id/v_chattips"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"58dp"
android:visibility=
"gone"
/>
<!-- 快捷回复-->
<RelativeLayout
android:id=
"@+id/rl_common_question"
android:layout_width=
"wrap_content"
android:layout_height=
"42dp"
android:paddingRight=
"13dp"
android:layout_gravity=
"bottom"
android:background=
"@drawable/im_background_chat_common_question"
>
<TextView
android:id=
"@+id/tv_open_common_question"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginStart=
"11dp"
android:gravity=
"center_vertical"
android:text=
"常见问题"
android:textColor=
"@color/platform_color_1DA1F2"
android:textStyle=
"bold"
/>
</RelativeLayout>
</FrameLayout>
<FrameLayout
android:id=
"@+id/fl_question_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:visibility=
"gone"
/>
<include
layout=
"@layout/im_nim_message_activity_bottom_layout"
/>
</LinearLayout>
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/BaseCommand.kt
View file @
ca3a5007
...
...
@@ -10,21 +10,22 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
* Created by Dog on 2015/5/8.
*/
open
class
BaseCommand
{
@JvmField
var
uid
=
"0"
@JvmField
var
accessToken
=
""
@JvmField
var
ts
:
String
@JvmField
var
version
:
String
@JvmField
var
osBuild
=
RxDeviceTool
.
getBuildMANUFACTURER
()
+
","
+
RxDeviceTool
.
getBuildBrandModel
()
+
","
+
RxDeviceTool
.
getOsBuileVersion
()
+
","
+
RxDeviceTool
.
getAppVersionName
(
BaseApp
.
getApp
()
)
@JvmField
var
isFromApp
=
"1"
//2表示专家版1表示用户版
@JvmField
var
ffrom
=
PlatformDataManager
.
getRam
().
getChannelName
()
//渠Y道来源
init
{
...
...
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