Commit d2e3abca by ydl

merge

parents 249f2afc 2beef95f
...@@ -42,12 +42,12 @@ ext { ...@@ -42,12 +42,12 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.11", "m-confide" : "0.0.48.12",
"m-consultant" : "0.0.58.6", "m-consultant" : "0.0.59.0",
"m-fm" : "0.0.29.3", "m-fm" : "0.0.29.3",
"m-user" : "0.0.60.4", "m-user" : "0.0.60.4",
"m-home" : "0.0.19.1", "m-home" : "0.0.21.4",
"m-im" : "0.0.17.9", "m-im" : "0.0.18.0",
"m-dynamic" : "0.0.7.5", "m-dynamic" : "0.0.7.5",
"m-muse" : "0.0.28.9", "m-muse" : "0.0.28.9",
...@@ -69,14 +69,14 @@ ext { ...@@ -69,14 +69,14 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.39.22", "ydl-platform" : "0.0.39.24",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.24", "ydl-webview" : "0.0.38.29",
"ydl-media" : "0.0.20", "ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17", "ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.3.14", "m-audioim" : "0.0.48.3.16",
"ydl-flutter-base": "0.0.10.9", "ydl-flutter-base": "0.0.14.12",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
...@@ -115,13 +115,13 @@ ext { ...@@ -115,13 +115,13 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.39.21", "ydl-platform" : "0.0.39.24",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.24", "ydl-webview" : "0.0.38.29",
"ydl-media" : "0.0.20", "ydl-media" : "0.0.20",
"ydl-pay" : "0.0.17", "ydl-pay" : "0.0.17",
"m-audioim" : "0.0.48.3.14", "m-audioim" : "0.0.48.3.16",
"ydl-flutter-base": "0.0.10.9", "ydl-flutter-base": "0.0.10.9",
//以下 几乎不会动 //以下 几乎不会动
...@@ -270,7 +270,7 @@ ext { ...@@ -270,7 +270,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块 //flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块 "ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.18.0@aar", //flutter aar "ydl-flutter" : "com.ydl:ydl-flutter:0.0.18.9@aar", //flutter aar
"ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号 //基础组件 <<--- 先发这个,发完改这里的版本号
......
...@@ -2,11 +2,13 @@ package com.ydl.audioim ...@@ -2,11 +2,13 @@ package com.ydl.audioim
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.http.AudioApiRequestUtil import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.audioim.http.command.ConnectExceptionCommand import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.consultantim.ConsultantAudioHomeActivity import com.ydl.consultantim.ConsultantAudioHomeActivity
import com.ydl.ydl_av.chat.bean.AudioMessageBean import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydl_av.messge_service.YDLRTMClient import com.ydl.ydl_av.messge_service.YDLRTMClient
...@@ -38,6 +40,10 @@ class YDLavManager { ...@@ -38,6 +40,10 @@ class YDLavManager {
companion object { companion object {
val FILE_NAME="consult"
//当前sdk的登录状态
var sdkStatus = -1
val instances: YDLavManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { val instances: YDLavManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
YDLavManager() YDLavManager()
} }
...@@ -49,6 +55,14 @@ class YDLavManager { ...@@ -49,6 +55,14 @@ class YDLavManager {
YDLRTMClient.instances.init(context, appId, listener) YDLRTMClient.instances.init(context, appId, listener)
//设置回调 //设置回调
setCallback() setCallback()
val uid= ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
if (!TextUtils.isEmpty(uid) && !TextUtils.equals("0", uid)) {
//不延时,可能会导致请求api报 network not unablibale
Handler().postDelayed({
login(uid)
}, 300)
}
} }
...@@ -88,6 +102,7 @@ class YDLavManager { ...@@ -88,6 +102,7 @@ class YDLavManager {
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
ToastUtil.toastShort("对方已挂断") ToastUtil.toastShort("对方已挂断")
act. writeAgoraLog("被叫拒绝了通话邀请")
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
act.uploadLog() act.uploadLog()
act.leaveChannel() act.leaveChannel()
...@@ -100,17 +115,23 @@ class YDLavManager { ...@@ -100,17 +115,23 @@ class YDLavManager {
override fun onCallCanceled(response: CallLocalResponse?) { override fun onCallCanceled(response: CallLocalResponse?) {
//返回给主叫 //返回给主叫
LogUtil.e("[agora]主叫已取消呼叫邀请") LogUtil.e("[agora]主叫已取消呼叫邀请")
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
act.writeAgoraLog("主叫呼叫取消:超时或主动取消")
}
}
} }
override fun onCallFailure(response: CallLocalResponse?, errorCode: Int) { override fun onCallFailure(response: CallLocalResponse?, errorCode: Int) {
//返回给主叫 //返回给主叫
LogUtil.e("[agora]呼叫${response?.calleeId}用户失败:${response?.response}") LogUtil.e("[agora]呼叫${response?.calleeId}用户失败:${response?.response}")
val act = ActivityManager.getInstance().getTopTaskActivity()
//专家离线或者30 秒后仍未收到专家响应,重新再邀请一次 //专家离线或者30 秒后仍未收到专家响应,重新再邀请一次
when (errorCode) { when (errorCode) {
//被叫不在线 呼叫邀请发出 30 秒后被叫仍未 ACK 响应呼叫邀请 //被叫不在线 呼叫邀请发出 30 秒后被叫仍未 ACK 响应呼叫邀请
RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_PEER_OFFLINE, RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_PEER_OFFLINE,
RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_PEER_NO_RESPONSE -> { RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_PEER_NO_RESPONSE -> {
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
act.rtcCall() act.rtcCall()
...@@ -118,7 +139,14 @@ class YDLavManager { ...@@ -118,7 +139,14 @@ class YDLavManager {
} }
} }
RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_INVITATION_EXPIRE -> {//呼叫邀请过期。被叫 ACK 响应呼叫邀请后 60 秒呼叫邀请未被取消、接受、拒绝,则呼叫邀请过期。 RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_INVITATION_EXPIRE -> {//呼叫邀请过期。被叫 ACK 响应呼叫邀请后 60 秒呼叫邀请未被取消、接受、拒绝,则呼叫邀请过期。
if (act is AudioHomeActivity) {
act.runOnUiThread {
act. writeAgoraLog("呼叫失败:${errorCode}")
//通话结束或挂断时,上传日志文件
act.uploadLog()
act.leaveChannel()
}
}
} }
} }
} }
...@@ -126,7 +154,7 @@ class YDLavManager { ...@@ -126,7 +154,7 @@ class YDLavManager {
override fun onRemoteInvitationReceived(response: CallRemoteResponse?) { override fun onRemoteInvitationReceived(response: CallRemoteResponse?) {
//返回给被叫 //返回给被叫
LogUtil.e("[agora]收到来自${response?.callerId}的呼叫邀请") LogUtil.e("[agora]收到来自${response?.callerId}的呼叫邀请")
receivedCall(response?.content) receivedCall(response?.content, "来自RTM")
} }
override fun onRemoteInvitationAccepted(response: CallRemoteResponse?) { override fun onRemoteInvitationAccepted(response: CallRemoteResponse?) {
...@@ -142,12 +170,18 @@ class YDLavManager { ...@@ -142,12 +170,18 @@ class YDLavManager {
override fun onRemoteInvitationCanceled(response: CallRemoteResponse?) { override fun onRemoteInvitationCanceled(response: CallRemoteResponse?) {
//返回给被叫 //返回给被叫
LogUtil.e("[agora]主叫${response?.callerId}已取消呼叫邀请") LogUtil.e("[agora]主叫${response?.callerId}已取消呼叫邀请")
AudioLogUtils.writeAgoraLog("呼叫邀请被取消:主叫主动取消",FILE_NAME)
closePage() closePage()
} }
override fun onRemoteInvitationFailure(response: CallRemoteResponse?, errorCode: Int) { override fun onRemoteInvitationFailure(response: CallRemoteResponse?, errorCode: Int) {
//返回给被叫 //返回给被叫
LogUtil.e("[agora]来自主叫${response?.callerId}的呼叫邀请进程失败:${response?.response}") LogUtil.e("[agora]来自主叫${response?.callerId}的呼叫邀请进程失败:${response?.response}")
if (errorCode == RtmStatusCode.RemoteInvitationError.REMOTE_INVITATION_ERR_INVITATION_EXPIRE) {//呼叫邀请过期
AudioLogUtils.writeAgoraLog("呼叫邀请被取消:呼叫邀请过期",FILE_NAME)
} else {
AudioLogUtils.writeAgoraLog("呼叫邀请被取消:错误原因(${errorCode})",FILE_NAME)
}
//关闭页面 //关闭页面
closePage() closePage()
} }
...@@ -158,8 +192,16 @@ class YDLavManager { ...@@ -158,8 +192,16 @@ class YDLavManager {
}) })
} }
@SuppressLint("CheckResult")
fun login(userId: String?) { fun login(userId: String?) {
login(userId) { _, _ ->
}
}
@SuppressLint("CheckResult")
fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") { if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") {
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录 //如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId") LogUtil.e("[agora]login-uid:$userId")
...@@ -177,10 +219,12 @@ class YDLavManager { ...@@ -177,10 +219,12 @@ class YDLavManager {
override fun onSuccess() { override fun onSuccess() {
//登陆成功,发起呼叫 //登陆成功,发起呼叫
LogUtil.e("[agora]实时消息登录成功") LogUtil.e("[agora]实时消息登录成功")
event(true, "")
} }
override fun onFailure(msg: String?) { override fun onFailure(msg: String?) {
LogUtil.e("[agora]实时消息登录失败:$msg") LogUtil.e("[agora]实时消息登录失败:$msg")
event(false, msg)
} }
}) })
...@@ -199,7 +243,7 @@ class YDLavManager { ...@@ -199,7 +243,7 @@ class YDLavManager {
* 收到邀请 * 收到邀请
*/ */
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun receivedCall(content: String?) { fun receivedCall(content: String?, from: String = "") {
if (!TextUtils.isEmpty(content)) { if (!TextUtils.isEmpty(content)) {
//如果已经接听了用户电话 再有电话进来 是不能接听的 //如果已经接听了用户电话 再有电话进来 是不能接听的
if (!activityIsExists(ConsultantAudioHomeActivity::class.java) && !activityIsExists( if (!activityIsExists(ConsultantAudioHomeActivity::class.java) && !activityIsExists(
...@@ -215,14 +259,10 @@ class YDLavManager { ...@@ -215,14 +259,10 @@ class YDLavManager {
ARouter.getInstance().build("/av/ConsultantAudioHomeActivity") ARouter.getInstance().build("/av/ConsultantAudioHomeActivity")
.withString("param", content) .withString("param", content)
.navigation() .navigation()
AudioLogUtils.writeAgoraLog("收到主叫方通话邀请($from)", FILE_NAME, false)
} }
} else { } else {
try {
val mAudioMessageBean = Gson().fromJson(content, AudioMessageBean::class.java)
YDLRTMClient.instances.refuseCall(mAudioMessageBean.channelId)
} catch (e: Exception) {
}
LogUtil.d("[agora]收到声网邀请,但界面实例已存在") LogUtil.d("[agora]收到声网邀请,但界面实例已存在")
} }
} else { } else {
...@@ -303,6 +343,7 @@ class YDLavManager { ...@@ -303,6 +343,7 @@ class YDLavManager {
} }
override fun onConnectionStateChanged(state: Int, reason: Int) { override fun onConnectionStateChanged(state: Int, reason: Int) {
sdkStatus = state
LogUtil.i("[agora]onConnectionStateChanged:state:${state} -->reason:$reason") LogUtil.i("[agora]onConnectionStateChanged:state:${state} -->reason:$reason")
} }
......
...@@ -29,10 +29,10 @@ class AudioLogUtils { ...@@ -29,10 +29,10 @@ class AudioLogUtils {
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
fun writeAgoraLog(content: String, fileName: String) { fun writeAgoraLog(content: String, fileName: String, isAppend: Boolean = true) {
Observable.create<Any> { Observable.create<Any> {
try { try {
writeLog(content, fileName) writeLog(content, fileName, isAppend)
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
LogUtil.d("writeLog_complete") LogUtil.d("writeLog_complete")
} }
...@@ -42,7 +42,7 @@ class AudioLogUtils { ...@@ -42,7 +42,7 @@ class AudioLogUtils {
.subscribe() .subscribe()
} }
private fun writeLog(content: String, fileName: String) { private fun writeLog(content: String, fileName: String, isAppend: Boolean) {
try { try {
val folder = getLogFolder() val folder = getLogFolder()
val file = File(folder, fileName) val file = File(folder, fileName)
...@@ -51,19 +51,21 @@ class AudioLogUtils { ...@@ -51,19 +51,21 @@ class AudioLogUtils {
} }
val fileWriter = FileWriter(file, true) val fileWriter = FileWriter(file, true)
val writer = BufferedWriter(fileWriter) val writer = BufferedWriter(fileWriter)
writer.write("""Time:${format.format(Calendar.getInstance().time)}""") if (!isAppend) {
writer.newLine() writer.write("----------------")
writer.write("UserUid = ${ModularServiceManager.getPlatformUserService()?.getUser()?.userId}") writer.newLine()
writer.newLine() writer.write("""Time:${format.format(Calendar.getInstance().time)}""")
writer.write("""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}""") writer.newLine()
writer.newLine() writer.write("ExpertUid = ${ModularServiceManager.getPlatformUserService()?.getUser()?.userId}")
writer.write("""DevicesInfo:${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()}""") writer.newLine()
writer.newLine() writer.write("""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}""")
writer.write("""VersionInfo:${RxAppTool.getAppVersionName(BaseApp.getApp())}""") writer.newLine()
writer.newLine() writer.write("""DevicesInfo:${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()}""")
writer.write("AgoraLog:$content") writer.newLine()
writer.newLine() writer.write("""VersionInfo:${RxAppTool.getAppVersionName(BaseApp.getApp())}""")
writer.write("--------") writer.newLine()
}
writer.write(content)
writer.newLine() writer.newLine()
writer.flush() writer.flush()
writer.close() writer.close()
......
...@@ -86,9 +86,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -86,9 +86,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
initViews() initViews()
initData(intent) initData(intent)
ActionCountUtils.count("main_page|app_consult_list_page_visit|app_consult_list_page_visit")
} }
override fun getStatusViewOptions(): StatusBarOptions { override fun getStatusViewOptions(): StatusBarOptions {
...@@ -174,8 +171,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -174,8 +171,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private var headData: HeadData? = null //筛选数据 private var headData: HeadData? = null //筛选数据
private var isFromSplash = false private var isFromSplash = false
private val props1 = JSONObject() //筛选标题埋点参数 private val props1 = JSONObject() //筛选标题埋点参数
private var fromPageType: Int = 0 //从哪个页面跳转过来的 private var fromPageType: Int = 1 //从哪个页面跳转过来的
private val fromPages = arrayOf("首页搜索", "找专家", "在线专家") private val fromPages = arrayOf("首页", "搜索页面", "在线专家")
private var isRecommend = false //埋点数据 private var isRecommend = false //埋点数据
private var keyWord: String? = null //埋点数据 private var keyWord: String? = null //埋点数据
private var isDoSearch: Boolean = false //埋点判断是否通过搜索进入埋点的 private var isDoSearch: Boolean = false //埋点判断是否通过搜索进入埋点的
...@@ -382,7 +379,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -382,7 +379,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null) v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null)
if (fromPageType != -1) { if (fromPageType != -1) {
doctorAdapter.setEntrance(fromPages[fromPageType]) doctorAdapter.setEntrance(fromPages[fromPageType],1)
} }
} }
...@@ -1456,7 +1453,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1456,7 +1453,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT) ActionCountUtils.count(ConsultBIConstants.ConsultSearchListEvent.APP_CONSULT_SEARCH_LIST_PAGE_VISIT)
} }
......
...@@ -32,6 +32,19 @@ class ConsultBIConstants { ...@@ -32,6 +32,19 @@ class ConsultBIConstants {
const val APP_CONSULT_LIST_CHAT_CLICK: String = APP_CONSULT_LIST_PAGE + "app_consult_list_chat_click"//每个咨询师私聊 const val APP_CONSULT_LIST_CHAT_CLICK: String = APP_CONSULT_LIST_PAGE + "app_consult_list_chat_click"//每个咨询师私聊
} }
} }
class ConsultSearchListEvent {
companion object {
private const val CONSULT_SEARCH_LIST_PAGE: String = "consul_search_list_page|"//APP咨询搜索列表页 partId
const val APP_CONSULT_SEARCH_LIST_PAGE_VISIT: String = CONSULT_SEARCH_LIST_PAGE + "consul_search_list_page_visit"//列表页浏览事件
const val APP_CONSULT_SEARCH_LIST_CONSULT_ITEM_CLICK: String = CONSULT_SEARCH_LIST_PAGE + "consult_search_list_doctor_click "//每个咨询师页面点击
const val APP_CONSULT_SEARCH_LIST_CHAT_CLICK: String = CONSULT_SEARCH_LIST_PAGE + "consult__search_list_chat_click"//每个咨询师私聊
}
}
class UserMainEvent { class UserMainEvent {
companion object { companion object {
......
...@@ -11,57 +11,67 @@ ...@@ -11,57 +11,67 @@
layout="@layout/consultant_layout_search_toolbar" layout="@layout/consultant_layout_search_toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" /> android:layout_height="48dp" />
<com.yidianling.consultant.ui.view.ExpertSearchSwipeRefreshLayout <com.yidianling.consultant.ui.view.ExpertSearchSwipeRefreshLayout
android:id="@+id/srlContainer" android:id="@+id/srlContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout <android.support.design.widget.CoordinatorLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/consultant_colorBg"
tools:ignore="InefficientWeight">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@color/consultant_colorBg" android:background="@color/consultant_colorBg"
android:clipChildren="false" tools:ignore="InefficientWeight">
android:clipToPadding="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout <android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:background="@color/consultant_colorBg"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed"> android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<com.yidianling.consultant.ui.view.topView.RecommendListView <android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/recommendListView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="match_parent"
</com.yidianling.consultant.ui.view.topView.RecommendListView> android:clipChildren="false"
android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/consultant_layout_search_content" /> <!-- 心理咨询app华为渠道紧急处理,咨询师列表页先简单粗暴的隐藏顶部推荐模块-->
<RelativeLayout
android:id="@+id/rl_hot_fix_for_huawei"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<!--<include layout="@layout/layout_search_head_input"/>--> <com.yidianling.consultant.ui.view.topView.RecommendListView
android:id="@+id/recommendListView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<!--筛选弹窗半透明背景-->
<View
android:id="@+id/viewDim_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#40000000"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/consultant_layout_search_content" />
<!--<include layout="@layout/layout_search_head_input"/>-->
<!--筛选弹窗半透明背景-->
<View
android:id="@+id/viewDim_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#40000000"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout>
</com.yidianling.consultant.ui.view.ExpertSearchSwipeRefreshLayout> </com.yidianling.consultant.ui.view.ExpertSearchSwipeRefreshLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="8dp"
android:bottomLeftRadius="8dp"/>
<gradient
android:angle="0"
android:startColor="#CC1DA1F2"
android:endColor="#CC1DA1F2"/>
</shape>
\ No newline at end of file
...@@ -2,13 +2,14 @@ package com.yidianling.home.adapter ...@@ -2,13 +2,14 @@ package com.yidianling.home.adapter
import android.content.Context import android.content.Context
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.ydl.ydlcommon.data.PlatformDataManager.getRam
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeAskBean import com.yidianling.home.model.bean.HomeAskBean
import com.yidianling.home.model.bean.HomeConfideBean import com.yidianling.home.model.bean.HomeConfideBean
import com.yidianling.home.model.bean.HomeConsultBean import com.yidianling.home.model.bean.HomeConsultBean
...@@ -22,9 +23,11 @@ import com.yidianling.home.ui.view.* ...@@ -22,9 +23,11 @@ import com.yidianling.home.ui.view.*
* @Company 壹点灵 * @Company 壹点灵
* @date 2019/02/13 * @date 2019/02/13
*/ */
class YdlHomeAdapter(private val mContext: Context, class YdlHomeAdapter(
private var homeEvent: HomeImpl, private val mContext: Context,
private var list: ArrayList<HomePagerDataBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { private var homeEvent: HomeImpl,
private var list: ArrayList<HomePagerDataBean>
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val mInflater: LayoutInflater = LayoutInflater.from(mContext) private val mInflater: LayoutInflater = LayoutInflater.from(mContext)
/** /**
...@@ -141,11 +144,17 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -141,11 +144,17 @@ class YdlHomeAdapter(private val mContext: Context,
when (holder) { when (holder) {
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块 //顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> { is HomeButtonBannerViewHolder -> {
holder.buttonBannerView.initData(list[position].headerBean?.homeSaleData,list[position].headerBean?.askCategoryData) holder.buttonBannerView.initData(
list[position].headerBean?.homeSaleData,
list[position].headerBean?.askCategoryData
)
} }
//倾诉*排解模块 //倾诉*排解模块
is HomeConfideViewHolder -> { is HomeConfideViewHolder -> {
holder.confideViewView.setTitle(list[position].headerBean?.listenCategoryDate, confideSelectPosition) holder.confideViewView.setTitle(
list[position].headerBean?.listenCategoryDate,
confideSelectPosition
)
holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body) holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
confidePosition = position confidePosition = position
} }
...@@ -155,7 +164,15 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -155,7 +164,15 @@ class YdlHomeAdapter(private val mContext: Context,
} }
//解忧*问答模块 //解忧*问答模块
is HomeAssuageGriefViewHolder -> { is HomeAssuageGriefViewHolder -> {
holder.assuageGriefViewView.initData(position, list[position].askBean?.data) val ffrom =
getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
val parm = holder.itemView.layoutParams
parm.height = 0
holder.itemView.layoutParams = parm
} else {
holder.assuageGriefViewView.initData(position, list[position].askBean?.data)
}
} }
//文章*阅读模块 //文章*阅读模块
is HomeArticleViewHolder -> { is HomeArticleViewHolder -> {
...@@ -163,8 +180,14 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -163,8 +180,14 @@ class YdlHomeAdapter(private val mContext: Context,
} }
//咨询模块 //咨询模块
is HomeConsultViewHolder -> { is HomeConsultViewHolder -> {
holder.consultView.setTitle(list[position].headerBean?.consultCategoryData, consultSelectPosition) holder.consultView.setTitle(
holder.consultView.setConsultInfoView(list[position].consultBean?.list,list[position].headerBean?.consultCategoryData?.get(consultSelectPosition)) list[position].headerBean?.consultCategoryData,
consultSelectPosition
)
holder.consultView.setConsultInfoView(
list[position].consultBean?.list,
list[position].headerBean?.consultCategoryData?.get(consultSelectPosition)
)
consultPosition = position consultPosition = position
} }
//测试模块 //测试模块
...@@ -177,25 +200,30 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -177,25 +200,30 @@ class YdlHomeAdapter(private val mContext: Context,
override fun getItemCount(): Int { override fun getItemCount(): Int {
return list.size return list.size
} }
/** /**
* 顶部预约专家,即时倾诉,心理测试按钮模块 ViewHolder * 顶部预约专家,即时倾诉,心理测试按钮模块 ViewHolder
*/ */
inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) : RecyclerView.ViewHolder(buttonBannerView) inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) :
RecyclerView.ViewHolder(buttonBannerView)
/** /**
* 咨询模块 ViewHolder * 咨询模块 ViewHolder
*/ */
inner class HomeConsultViewHolder(val consultView: HomeConsultView) : RecyclerView.ViewHolder(consultView) inner class HomeConsultViewHolder(val consultView: HomeConsultView) :
RecyclerView.ViewHolder(consultView)
/** /**
* 倾诉*排解模块 ViewHolder * 倾诉*排解模块 ViewHolder
*/ */
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) : RecyclerView.ViewHolder(confideViewView) inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) :
RecyclerView.ViewHolder(confideViewView)
/** /**
* 课程*成长模块 ViewHolder * 课程*成长模块 ViewHolder
*/ */
inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) : RecyclerView.ViewHolder(courseViewView) inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) :
RecyclerView.ViewHolder(courseViewView)
/** /**
* 测试模块 ViewHolder * 测试模块 ViewHolder
...@@ -205,11 +233,14 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -205,11 +233,14 @@ class YdlHomeAdapter(private val mContext: Context,
/** /**
* 解忧*问答模块 ViewHolder * 解忧*问答模块 ViewHolder
*/ */
inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) : RecyclerView.ViewHolder(assuageGriefViewView) inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) :
RecyclerView.ViewHolder(assuageGriefViewView)
/** /**
* 文章*阅读模块 ViewHolder * 文章*阅读模块 ViewHolder
*/ */
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) : RecyclerView.ViewHolder(articleViewView) inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) :
RecyclerView.ViewHolder(articleViewView)
/** /**
* 底部提示语模块 ViewHolder * 底部提示语模块 ViewHolder
......
package com.yidianling.home.ui.view package com.yidianling.home.ui.view
import android.content.Context import android.content.Context
import android.graphics.Color
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
...@@ -33,6 +34,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent: ...@@ -33,6 +34,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
) )
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_assuage_grief_view, this) View.inflate(mContext, R.layout.home_assuage_grief_view, this)
setBackgroundColor(Color.GREEN)
homeModuleAssuageGriefViewHomeCommonTitleView.setTitle("解忧·问答") homeModuleAssuageGriefViewHomeCommonTitleView.setTitle("解忧·问答")
homeModuleAssuageGriefViewHomeCommonTitleView.setOnClickListener { homeModuleAssuageGriefViewHomeCommonTitleView.setOnClickListener {
homeEvent?.askMoreClick() homeEvent?.askMoreClick()
...@@ -42,6 +44,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent: ...@@ -42,6 +44,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
fun initData(position: Int, list: List<HomeAskBean.DataBean>?) { fun initData(position: Int, list: List<HomeAskBean.DataBean>?) {
//添加View //添加View
if (list == null) { if (list == null) {
visibility = View.GONE
return return
} }
if (cacheList.size != list?.size) { if (cacheList.size != list?.size) {
......
package com.yidianling.home.ui.view package com.yidianling.home.ui.view
import android.content.Context import android.content.Context
import android.graphics.Color
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent import com.yidianling.home.event.IHomeBaseEvent
...@@ -56,6 +59,28 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -56,6 +59,28 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
// initButtonView() // initButtonView()
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
homeModuleButtonBannerFirst.background =
resources.getDrawable(R.drawable.home_dcotor_bt_bg_huawei)
homeModuleButtonBannerSecond.background =
resources.getDrawable(R.drawable.home_test_bt_bg_hauwei)
homeModuleButtonBannerThird.background =
resources.getDrawable(R.drawable.home_course_bt_bg_huawei)
homeModuleButtonBannerFourth.background =
resources.getDrawable(R.drawable.home_listen_bt_bg_huawei)
homeModuleButtonBannerFirstTitle.setTextColor(Color.WHITE)
tv_first_text.setTextColor(Color.WHITE)
homeModuleButtonBannerFourthTitle.setTextColor(Color.WHITE)
tv_second_text.setTextColor(Color.WHITE)
homeModuleButtonBannerThirdTitle.setTextColor(Color.WHITE)
tv_third_text.setTextColor(Color.WHITE)
homeModuleButtonBannerSecondTitle.setTextColor(Color.WHITE)
tv_fourth_text.setTextColor(Color.WHITE)
}
homeModuleButtonBannerFirst.setOnClickListener { homeModuleButtonBannerFirst.setOnClickListener {
homeEvent?.reservationExpertsClick() homeEvent?.reservationExpertsClick()
} }
......
...@@ -5,11 +5,6 @@ ...@@ -5,11 +5,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -17,8 +12,8 @@ ...@@ -17,8 +12,8 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="horizontal" android:paddingBottom="12dp"
android:paddingBottom="20dp"> android:orientation="horizontal">
<RelativeLayout <RelativeLayout
...@@ -29,22 +24,23 @@ ...@@ -29,22 +24,23 @@
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/home_dcotor_bt_bg" android:background="@drawable/home_dcotor_bt_bg"
android:gravity="center"> android:gravity="center_horizontal">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerFirstTitle" android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="预约咨询" android:text="预约咨询"
android:textColor="@color/platform_black" android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tv_first_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFirstTitle" android:layout_below="@+id/homeModuleButtonBannerFirstTitle"
android:layout_marginTop="2dp"
android:text="1W+师资" android:text="1W+师资"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" /> android:textSize="@dimen/platform_dp_11" />
...@@ -58,22 +54,23 @@ ...@@ -58,22 +54,23 @@
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/home_listen_bt_bg" android:background="@drawable/home_listen_bt_bg"
android:gravity="center"> android:gravity="center_horizontal">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerFourthTitle" android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理测试" android:text="心理测试"
android:textColor="@color/platform_black" android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tv_second_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFourthTitle" android:layout_below="@+id/homeModuleButtonBannerFourthTitle"
android:layout_marginTop="2dp"
android:text="专业权威" android:text="专业权威"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" /> android:textSize="@dimen/platform_dp_11" />
...@@ -87,23 +84,24 @@ ...@@ -87,23 +84,24 @@
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/home_course_bt_bg" android:background="@drawable/home_course_bt_bg"
android:gravity="center" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerThirdTitle" android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理课堂" android:text="心理课堂"
android:textColor="@color/platform_black" android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tv_third_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerThirdTitle" android:layout_below="@+id/homeModuleButtonBannerThirdTitle"
android:layout_marginTop="2dp"
android:text="学习与成长" android:text="学习与成长"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" /> android:textSize="@dimen/platform_dp_11" />
...@@ -114,59 +112,38 @@ ...@@ -114,59 +112,38 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="78dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/home_test_bt_bg"> android:background="@drawable/home_test_bt_bg"
android:gravity="center_horizontal">
<RelativeLayout <TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_gravity="center"
android:background="@drawable/home_button_first_free_bg" android:layout_marginTop="7dp"
android:paddingLeft="5dp" android:text="即时倾诉"
android:paddingTop="1dp" android:textColor="@color/platform_black"
android:paddingRight="5dp" android:textSize="@dimen/platform_dp_16"
android:paddingBottom="1dp" android:textStyle="bold" />
android:visibility="gone" />
<TextView
<LinearLayout android:id="@+id/tv_fourth_text"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_gravity="center_horizontal" android:text="专业解忧"
android:gravity="center_vertical" android:textColor="@color/platform_color_444444"
android:orientation="vertical"> android:textSize="@dimen/platform_dp_11" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="即时倾诉"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_centerVertical="true"
android:layout_marginTop="2dp"
android:text="专业解忧"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</LinearLayout>
</LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
...@@ -36,7 +36,6 @@ public class ConfideOrderInfoView extends RelativeLayout { ...@@ -36,7 +36,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
private String mSessionId; private String mSessionId;
private IP2PCustomActionHandler.DocInfo info = null; private IP2PCustomActionHandler.DocInfo info = null;
private TextView tv_status = null; private TextView tv_status = null;
private TextView tv_tips = null;
private TextView tv_action = null; private TextView tv_action = null;
private TextView tv_order_info = null; private TextView tv_order_info = null;
private ImageView iv_call = null; private ImageView iv_call = null;
...@@ -61,7 +60,6 @@ public class ConfideOrderInfoView extends RelativeLayout { ...@@ -61,7 +60,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
View.inflate(mContext, R.layout.im_nim_chat_confide_order_info_view, this); View.inflate(mContext, R.layout.im_nim_chat_confide_order_info_view, this);
setBackground(getResources().getDrawable(R.drawable.im_bg_im_confide_action)); setBackground(getResources().getDrawable(R.drawable.im_bg_im_confide_action));
tv_status = findViewById(R.id.tv_status); tv_status = findViewById(R.id.tv_status);
tv_tips = findViewById(R.id.tv_tips);
tv_action = findViewById(R.id.tv_action); tv_action = findViewById(R.id.tv_action);
iv_call = findViewById(R.id.iv_call); iv_call = findViewById(R.id.iv_call);
tv_order_info = findViewById(R.id.tv_order_info); tv_order_info = findViewById(R.id.tv_order_info);
...@@ -78,7 +76,6 @@ public class ConfideOrderInfoView extends RelativeLayout { ...@@ -78,7 +76,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
//有未完成订单 //有未完成订单
if (info.hasAvailableListenOrder == 2) { if (info.hasAvailableListenOrder == 2) {
tv_status.setText("剩余时间:" + coverTime(Integer.valueOf(info.listenOrderRemainTime))); tv_status.setText("剩余时间:" + coverTime(Integer.valueOf(info.listenOrderRemainTime)));
tv_tips.setVisibility(View.GONE);
if (info.is_online == 3) { //通话中 if (info.is_online == 3) { //通话中
...@@ -98,7 +95,6 @@ public class ConfideOrderInfoView extends RelativeLayout { ...@@ -98,7 +95,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
tv_action.setBackground(getResources().getDrawable(R.drawable.im_background_chat_confide_order_action)); tv_action.setBackground(getResources().getDrawable(R.drawable.im_background_chat_confide_order_action));
tv_action.setTextColor(getResources().getColor(R.color.im_white)); tv_action.setTextColor(getResources().getColor(R.color.im_white));
tv_action.setText("去评价"); tv_action.setText("去评价");
tv_tips.setVisibility(View.VISIBLE);
} }
tv_order_info.setText(info.listenOrderDesc); tv_order_info.setText(info.listenOrderDesc);
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" <merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:parentTag="android.widget.RelativeLayout"> tools:parentTag="android.widget.RelativeLayout">
<TextView <TextView
android:id="@+id/tv_order_style" android:id="@+id/tv_order_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="18dp" android:layout_marginTop="18dp"
android:background="@drawable/im_background_chat_confide_order_stytle" android:background="@drawable/im_background_chat_confide_order_stytle"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="倾诉" android:text="倾诉"
android:textColor="@color/platform_color_1DA1F2" android:textColor="@color/platform_color_1DA1F2"
android:textSize="11sp" /> android:textSize="11sp" />
<TextView <TextView
android:id="@+id/tv_status" android:id="@+id/tv_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_toRightOf="@+id/tv_order_style" android:layout_toRightOf="@+id/tv_order_style"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="已结束" /> tools:text="已结束" />
<TextView <TextView
android:id="@+id/tv_order_info" android:id="@+id/tv_order_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_order_style" android:layout_below="@+id/tv_order_style"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="7dp" android:layout_marginTop="7dp"
android:layout_marginBottom="13dp" android:layout_marginBottom="13dp"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="11sp" android:textSize="11sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="电话倾诉 倾诉时长:25分钟 2018.11.24 " /> tools:text="电话倾诉 倾诉时长:25分钟 2018.11.24 " />
<ImageView <ImageView
android:id="@+id/iv_call" android:id="@+id/iv_call"
android:layout_width="36dp" android:layout_width="36dp"
android:layout_height="36dp" android:layout_height="36dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:src="@drawable/im_icon_qingsu_call" android:src="@drawable/im_icon_qingsu_call"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView
android:id="@+id/tv_action" android:id="@+id/tv_action"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:paddingLeft="14dp" android:paddingLeft="14dp"
android:paddingTop="4dp" android:paddingTop="4dp"
android:paddingRight="14dp" android:paddingRight="14dp"
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:textColor="@color/im_white" android:textColor="@color/im_white"
tools:background="@drawable/im_background_chat_confide_order_action" tools:background="@drawable/im_background_chat_confide_order_action"
tools:text="去评价" /> tools:text="去评价" />
</merge>
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/im_background_chat_confide_order_tpis"
android:paddingLeft="5dp"
android:paddingTop="1dp"
android:paddingRight="5dp"
android:paddingBottom="1dp"
android:text="最高返30元红包"
android:textColor="@color/im_white"
android:textSize="9sp"
android:visibility="gone" />
</merge>
...@@ -191,7 +191,8 @@ interface UserApi { ...@@ -191,7 +191,8 @@ interface UserApi {
fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>> fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
//获取新用户引导页面url //获取新用户引导页面url
@FormUrlEncoded
@POST("user/getNewUserJumpUrl") @POST("user/getNewUserJumpUrl")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> fun getNewUserJumpUrl(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<String>>
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.google.gson.internal.LinkedTreeMap ...@@ -6,6 +6,7 @@ import com.google.gson.internal.LinkedTreeMap
import com.umeng.socialize.bean.SHARE_MEDIA import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseCommand
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
...@@ -204,7 +205,8 @@ class UserHttpImpl private constructor() : UserHttp { ...@@ -204,7 +205,8 @@ class UserHttpImpl private constructor() : UserHttp {
} }
override fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> { override fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> {
return getUserApi().getNewUserJumpUrl() return RxUtils.mapObservable(BaseCommand())
.flatMap { getUserApi().getNewUserJumpUrl(it) }
} }
private object Holder { private object Holder {
......
...@@ -9,6 +9,7 @@ import com.ydl.ydlcommon.base.BaseApp ...@@ -9,6 +9,7 @@ import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.data.PlatformDataManager import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil import com.ydl.ydlcommon.utils.YdlBuryPointUtil
...@@ -40,6 +41,7 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler { ...@@ -40,6 +41,7 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
companion object { companion object {
const val CHANNEL: String = "lib/common/channel" const val CHANNEL: String = "lib/common/channel"
const val GETPUBLICPARAMAS: String = "getPublicParamas" const val GETPUBLICPARAMAS: String = "getPublicParamas"
const val GET_PACKAGE_AND_FFROM: String = "get_package_and_ffrom" // 获取包名和渠道名,中间用,分割
const val ACTION_PUSH_EVENT_TRACKING_TAP: String = "action_push_event_tracking_tap"// 点击事件埋点 const val ACTION_PUSH_EVENT_TRACKING_TAP: String = "action_push_event_tracking_tap"// 点击事件埋点
const val ACTION_PUSH_EVENT_TRACKING_PV: String = "action_push_event_tracking_pv"//pv埋点 const val ACTION_PUSH_EVENT_TRACKING_PV: String = "action_push_event_tracking_pv"//pv埋点
...@@ -127,6 +129,11 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler { ...@@ -127,6 +129,11 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
YdlBuryPointUtil.sendPv(pvPath) YdlBuryPointUtil.sendPv(pvPath)
} }
} }
GET_PACKAGE_AND_FFROM -> {
val packageName = YdlCommonOut.getApp().packageName
val ffrom = PlatformDataManager.getRam().getChannelName()
result.success("$packageName,$ffrom")
}
} }
} }
} }
\ No newline at end of file
...@@ -102,6 +102,32 @@ abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable { ...@@ -102,6 +102,32 @@ abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable {
} }
} }
/**
* 设置底部抬高的布局的颜色
*/
open fun setBottomColor(color: String) {
try {
if (getStatusViewOptions()?.isAddStatusView) {
if (StatusBarUtils.hasBottomNavigatorLine(this)) {
findViewById<View>(R.id.ll_bottom_v).setBackgroundColor(
Color.parseColor(
color
)
)
}
} else {
if (StatusBarUtils.hasBottomNavigatorLine(this)) {
findViewById<View>(R.id.ll_bottom_fit_v).setBackgroundColor(
Color.parseColor(
color
)
)
}
}
} catch (e: Exception) {
}
}
open fun getDefaultBottomColor(): Int { open fun getDefaultBottomColor(): Int {
return Color.parseColor("#00000000") return Color.parseColor("#00000000")
} }
......
...@@ -154,6 +154,8 @@ class LogHelper private constructor() { ...@@ -154,6 +154,8 @@ class LogHelper private constructor() {
val yunxinLog = getYunXinLog(BaseApp.getApp()) val yunxinLog = getYunXinLog(BaseApp.getApp())
//声网日志 //声网日志
val agoraLog = getAgoraLog(BaseApp.getApp()) val agoraLog = getAgoraLog(BaseApp.getApp())
val agoraRtmLog = getAgoraRTMLog(BaseApp.getApp())
val agoraRtmBackLog = getAgoraRtmBackLog(BaseApp.getApp())
if (zipFile.exists()) zipFile.delete() if (zipFile.exists()) zipFile.delete()
zipFile.createNewFile() zipFile.createNewFile()
...@@ -167,6 +169,12 @@ class LogHelper private constructor() { ...@@ -167,6 +169,12 @@ class LogHelper private constructor() {
if (agoraLog.exists()) { if (agoraLog.exists()) {
files.add(agoraLog) files.add(agoraLog)
} }
if (agoraRtmLog.exists()) {
files.add(agoraRtmLog)
}
if (agoraRtmBackLog.exists()) {
files.add(agoraRtmBackLog)
}
// ZipUtils.toZip(getLogFolder().absolutePath, FileOutputStream(zipFile), true) // ZipUtils.toZip(getLogFolder().absolutePath, FileOutputStream(zipFile), true)
ZipUtils.toZip(files, FileOutputStream(zipFile)) ZipUtils.toZip(files, FileOutputStream(zipFile))
...@@ -233,6 +241,20 @@ class LogHelper private constructor() { ...@@ -233,6 +241,20 @@ class LogHelper private constructor() {
return File(filePath) return File(filePath)
} }
//获取RTM日志
private fun getAgoraRTMLog(context: Context): File {
val agoraRTMLog = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorartm.log"
return File(agoraRTMLog)
}
//获取RTM备份日志
private fun getAgoraRtmBackLog(context: Context): File {
val agoraRTMLog = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorartm_1.log"
return File(agoraRTMLog)
}
private object Holder { private object Holder {
val INSTANCE = LogHelper() val INSTANCE = LogHelper()
} }
......
...@@ -44,6 +44,8 @@ class H5JsBean { ...@@ -44,6 +44,8 @@ class H5JsBean {
var orderStatus: Int = 0 var orderStatus: Int = 0
var orderStatusDesc: String? = null var orderStatusDesc: String? = null
var bottomfitViewColor: String? = null //底部适配布局的颜色
var orderContent: String? = null//默认发送的第一天聊天 var orderContent: String? = null//默认发送的第一天聊天
var action_name: String? = null var action_name: String? = null
......
...@@ -17,7 +17,6 @@ import android.text.TextUtils; ...@@ -17,7 +17,6 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.webkit.ValueCallback;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.PopupWindow; import android.widget.PopupWindow;
...@@ -28,6 +27,7 @@ import com.tencent.smtt.export.external.interfaces.JsResult; ...@@ -28,6 +27,7 @@ import com.tencent.smtt.export.external.interfaces.JsResult;
import com.tencent.smtt.export.external.interfaces.SslError; import com.tencent.smtt.export.external.interfaces.SslError;
import com.tencent.smtt.export.external.interfaces.SslErrorHandler; import com.tencent.smtt.export.external.interfaces.SslErrorHandler;
import com.tencent.smtt.sdk.CookieSyncManager; import com.tencent.smtt.sdk.CookieSyncManager;
import com.tencent.smtt.sdk.ValueCallback;
import com.tencent.smtt.sdk.WebChromeClient; import com.tencent.smtt.sdk.WebChromeClient;
import com.tencent.smtt.sdk.WebSettings; import com.tencent.smtt.sdk.WebSettings;
import com.tencent.smtt.sdk.WebView; import com.tencent.smtt.sdk.WebView;
...@@ -544,6 +544,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -544,6 +544,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}); });
} }
public void setBottomViewColor(String color) {
runOnUiThread(() -> {
setBottomColor(color);
});
}
public void showTitleBar() { public void showTitleBar() {
runOnUiThread(() -> { runOnUiThread(() -> {
tb_title.setVisibility(VISIBLE); tb_title.setVisibility(VISIBLE);
...@@ -1267,6 +1273,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1267,6 +1273,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 新用户侧滑按钮限制 * 新用户侧滑按钮限制
*/ */
if (h5Params.getBackLimit() != null && h5Params.getBackLimit() == H5Params.BackLimit.NEW_USER_PAGE) { if (h5Params.getBackLimit() != null && h5Params.getBackLimit() == H5Params.BackLimit.NEW_USER_PAGE) {
ModularServiceManager.INSTANCE.provide(IAppService.class).mainIntent(this);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment