Commit 856dea64 by 刘鹏

Merge branch 'd/v4.0.57_xlzx' into 'release'

D/v4.0.57

See merge request app_android_lib/YDL-Component!364
parents 08dfa5d3 d17f193b
......@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2'
componentVersion = "0.3.0.48"
componentVersion = "0.3.0.49.3-SNAPSHOT"
}
repositories {
mavenCentral()
......
......@@ -164,7 +164,7 @@ ext {
"blankUtil" : "com.blankj:utilcode:1.25.9",
"ydl-hnet" : "com.ydl:h-net:0.0.8",
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
"ydl-device" : "com.ydl:device-id:0.0.35",
"ydl-device" : "com.ydl:device-id:0.0.36",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.57@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
......
......@@ -65,7 +65,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api "com.ydl:ydl-av:1.4.8"
api "com.ydl:ydl-av:1.4.9"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
api project(':ydl-platform')
......
......@@ -341,7 +341,7 @@ class AudioHomeActivity :
}
Apm.reportEvent("agora_android", "occur_error", "$err")
AudioApiRequestUtil.reportCallEvent(channelId, RtcEvent(RtcEvent.Event.errorOccurred), errorCode = err)
channelId?.let { YDLavManager.instances.callEndStatusUpdate(it, 60, "频道错误回调$err") }
// channelId?.let { YDLavManager.instances.callEndStatusUpdate(it, 60, "频道错误回调$err") }
}
override fun onApiCallExecuted(error: Int, api: String?, result: String?) {
......
......@@ -2,18 +2,14 @@ package com.ydl.audioim
import android.app.Activity
import android.content.Context
import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.tencent.mmkv.MMKV
import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.audioim.http.RtcEvent
import com.ydl.consultantim.ConsultantAudioHomeActivity
import com.ydl.ydl_av.voice.listener.RtcNetInterface
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydlcommon.utils.log.XLog
import io.agora.rtc.Constants
import io.reactivex.Single
import io.reactivex.schedulers.Schedulers
import java.io.File
......@@ -94,13 +90,13 @@ class NetQuality(
override fun onRemoteAudioStateChanged(uid: Int, state: Int, reason: Int, elapsed: Int) {
XLog.i("NetQuality", "uid:$uid,state:$state,reason:$reason,elapsed:$elapsed")
if (reason == Constants.REMOTE_AUDIO_REASON_NETWORK_CONGESTION && state == Constants.REMOTE_AUDIO_STATE_FROZEN) {
/*if (reason == Constants.REMOTE_AUDIO_REASON_NETWORK_CONGESTION && state == Constants.REMOTE_AUDIO_STATE_FROZEN) {
val qualityValue = MMKV.defaultMMKV().getString("network_quality_config", "0")
if (TextUtils.equals(qualityValue, "1")) {
if (System.currentTimeMillis() - lastOnRemoteNetworkCongestion > 30 * 1000) {
if (System.currentTimeMillis() - lastOnRemoteNetworkCongestion > 2 * 60 * 1000) {
lastOnRemoteNetworkCongestion = System.currentTimeMillis()
voiceManage?.getVoiceApi()
?.playEffect(3001, getNetLowEffect(activity))
?.playEffect(3001, getNetLowEffect(activity), 50.0)
}
if (activity is AudioHomeActivity) {
activity.showNetStatus("对方的网络状况不佳", 0)
......@@ -108,7 +104,7 @@ class NetQuality(
activity.showNetStatus("对方的网络状况不佳", 0)
}
}
}
}*/
}
override fun onRemoteAudioStats(quality: Int, delay: Int, bitrate: Int, audioLossRate: Int) {
......
......@@ -184,20 +184,6 @@ class YDLavManager {
)
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
//专家离线或者30 秒后仍未收到专家响应,重新再邀请一次
when (errorCode) {
//被叫不在线 呼叫邀请发出 30 秒后被叫仍未 ACK 响应呼叫邀请
RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_PEER_OFFLINE, RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_PEER_NO_RESPONSE -> {
if (act is AudioHomeActivity) {
act.runOnUiThread {
act.rtcCall()
}
}
}
RtmStatusCode.LocalInvitationError.LOCAL_INVITATION_ERR_INVITATION_EXPIRE -> {
//呼叫邀请过期。被叫 ACK 响应呼叫邀请后 60 秒呼叫邀请未被取消、接受、拒绝,则呼叫邀请过期。
}
}
//呼叫失败日志输出
if (act is AudioHomeActivity) {
act.runOnUiThread {
......
......@@ -395,9 +395,11 @@ class ConsultantAudioHomeActivity :
//110:生成的 Token 无效
//123:此用户被服务器禁止
runOnUiThread {
var report = false
when (err) {
3, 7, 109, 110 -> {
showToast("请退出应用,重新打开")
report = true
close(RESULT_NOT_ANSWERED_CODE, "咨询师已挂断")
callEventSave(
"80",
......@@ -408,17 +410,20 @@ class ConsultantAudioHomeActivity :
10 -> {
callEventSave("80", "err:${err} 专家网络较差")
showToast("当前网络较差,请更换网络")
report = true
close(RESULT_NOT_ANSWERED_CODE, "专家网络较差")
}
101 -> {
callEventSave("80", "err:${err} 不是有效的 APP ID")
showToast("安装包有问题,请联系技术")
report = true
close(RESULT_NOT_ANSWERED_CODE, "安装包有问题,请联系技术")
}
102 -> {
callEventSave("80", "err:${err} 不是有效的 频道名")
showToast("频道错误,请联系技术")
report = true
close(RESULT_NOT_ANSWERED_CODE, "频道错误,请联系技术")
}
123 -> {
......@@ -433,11 +438,13 @@ class ConsultantAudioHomeActivity :
if (err == 0 || err == 18) {
return@runOnUiThread
}
YDLavManager.instances.callEndStatusUpdate(
mAudioMessageBean?.channelId!!,
60,
"频道错误回调${err} "
)
if (report) {
YDLavManager.instances.callEndStatusUpdate(
mAudioMessageBean?.channelId!!,
60,
"频道错误回调${err} "
)
}
}
}
......
......@@ -9,7 +9,6 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Typeface
import android.os.Bundle
import android.os.Handler
import android.text.TextUtils
import android.view.View
......@@ -1800,7 +1799,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
R.drawable.consult_ic_arrow_drwn_gray,
0
)
}
......@@ -1810,7 +1809,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
R.drawable.consult_ic_arrow_drwn_en,
0
)
}
......@@ -1820,7 +1819,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
R.drawable.consult_ic_arrow_drwn_en,
0
)
}
......@@ -1836,7 +1835,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.filter_up_grey,
R.drawable.filter_up_gray,
0
)
}
......
......@@ -6,9 +6,7 @@ import android.animation.ObjectAnimator
import android.animation.PropertyValuesHolder
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.graphics.Typeface
import android.net.Uri
import android.os.Handler
import android.text.TextUtils
import android.view.View
......@@ -31,9 +29,7 @@ import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.BuryPointUtils
......@@ -54,12 +50,8 @@ import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.PRICE_TYPE_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultantLocationAuth.Companion.REFUSE_ALREADY
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultantLocationAuth.Companion.WHETHER_LOCATION_AUTH
import com.yidianling.consultant.listener.*
import com.yidianling.consultant.dialog.ConsultSubPayDialog
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.listener.OnExpertClickListener
import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.listener.OnSortItemSelectedListener
import com.yidianling.consultant.listener.*
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.*
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
......@@ -501,20 +493,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
textView.setOnClickListener {
if (textView.isSelected) {
dealHotSelect(hot, false)
textView!!.isSelected = false
textView.paint.isFakeBoldText = false
textView.isSelected = false
} else {
dealHotSelect(hot, true)
textView.isSelected = true
textView.paint.isFakeBoldText = true
// 埋点
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,
ConsultBIConstants.ConsultEvent.POSITION_CHOICE_FILTER_CLICK,
hot.value!!,
"app",
""
)
hot.value?.let { it1 ->
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,
ConsultBIConstants.ConsultEvent.POSITION_CHOICE_FILTER_CLICK,
it1,
"app",
""
)
}
}
filterLabelSet()
//开始筛选数据
......@@ -1611,12 +1603,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private fun updateFilterTextViewStatus(tv: TextView, status: Int) {
when (status) {
FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_color_242424))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
R.drawable.consult_ic_arrow_drwn_gray,
0
)
}
......@@ -1626,7 +1618,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
R.drawable.consult_ic_arrow_drwn_en,
0
)
}
......@@ -1636,7 +1628,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
R.drawable.consult_ic_arrow_drwn_en,
0
)
}
......@@ -1647,12 +1639,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private fun updateFilterRightTextViewStatus(tv: TextView, status: Int) {
when (status) {
FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_color_242424))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.filter_up_grey,
R.drawable.filter_up_gray,
0
)
}
......
......@@ -8,7 +8,6 @@ import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.AnimUtils
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.RxAppTool
......@@ -266,15 +265,28 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
fieldsMap["is_free_today"] = true
fieldsMap["display_region"] = true
fieldsMap["has_servicefree_experience"] = true
//专家头像下方文案:如 忙碌;现在有空;今日可约;最近可约;已约满;休息中
fieldsMap["consult_display_status_str"] = true
//咨询显示状态:1.忙碌;2.现在有空;3.今日可约;4.最近可约;5.已约满;6.休息中
fieldsMap["consult_display_status"] = true
//私聊下方时间描述:如 最快可约今天19:00
fieldsMap["today_time_des"] = true
//服务方式:如 当面/视频
fieldsMap["attr_combine"] = true
//是否开启代聊:1开启,2关闭
fieldsMap["open_chat_agency"] = true
//年审
fieldsMap["audit_tag"] = true
map["fields"] = fieldsMap
val optionsMap = HashMap<String, Any?>()
optionsMap["search_scene_id"] = "doctor_main_search"
optionsMap["uid"] = ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
optionsMap["uid"] =
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
optionsMap["ffrom"] = PlatformDataManager.getRam().getChannelName()
optionsMap["version"]= RxAppTool.getAppVersionName(BaseApp.getApp())
optionsMap["os_type"]= 2
if (extras!=null){
optionsMap["version"] = RxAppTool.getAppVersionName(BaseApp.getApp())
optionsMap["os_type"] = 2
if (extras != null) {
optionsMap["extras"] = extras
}
map["options"] = optionsMap
......
......@@ -11,14 +11,12 @@ import android.text.style.StyleSpan
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.URLUtils
......@@ -33,10 +31,8 @@ import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_header_view.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_products_item.view.*
import kotlinx.android.synthetic.main.consultant_item_empty.view.*
import kotlinx.android.synthetic.main.consultant_item_footer.view.*
import kotlinx.android.synthetic.main.consultant_item_tag.view.*
......@@ -60,7 +56,7 @@ class ExpertSearchAdapter(
}
interface OnClickLister {
fun onClick(searchWords:String)
fun onClick(searchWords: String)
}
private lateinit var mOnClickLister: OnClickLister
......@@ -75,7 +71,7 @@ class ExpertSearchAdapter(
var hasMore = true
var pageIndex: Int = 0
var clickCount=0 // 搜索结果提示标签点击次数
var clickCount = 0 // 搜索结果提示标签点击次数
var mIsRecommendWords = false // 是否是推荐词
......@@ -83,340 +79,294 @@ class ExpertSearchAdapter(
this.pageIndex = pageIndex
}
fun setIsRecommendWords(isRecommend:Boolean){
fun setIsRecommendWords(isRecommend: Boolean) {
mIsRecommendWords = isRecommend
}
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is HeaderViewHolder) { // 搜索结果提示头部
if (listData.size>0){
if (listData[0].is_head_view){
if (clickCount==0){
holder.clSearchWords.visibility = View.VISIBLE
var text = "根据匹配,为您推荐“${listData[0].related_word}”的搜索结果"
holder.tvSearchRelatedWord.text = setTextBold(text,listData[0].related_word)
holder.tvSearchWord.text = listData[0].search_content
// 埋点
if (mIsRecommendWords){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_map_word_visit",listData[0].search_content,listData[0].related_word,"app")
}else{
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_correction_word_visit",listData[0].search_content,listData[0].related_word,"app")
}
holder.tvSearchWord.setOnClickListener {
mOnClickLister.onClick(holder.tvSearchWord.text.toString())
++clickCount
if (clickCount==1){
text = "以下是“${listData[0].search_content}”的搜索结果"
holder.tvSearchRelatedWord.text = setTextBold(text,listData[0].search_content)
holder.tvSearchTips.text = "你要找的是不是"
holder.tvSearchWord.text = listData[0].related_word
// 埋点
if (mIsRecommendWords){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_map_inputword_click",listData[0].related_word,listData[0].search_content,"app")
}else{
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_correction_inputword_click",listData[0].related_word,listData[0].search_content,"app")
}
}else if (clickCount==2){ // 第二次点击搜索标签隐藏搜索匹配结果提示
// 埋点
if (mIsRecommendWords){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_map_recommendword_click",listData[0].search_content,listData[0].related_word,"app")
}else{
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_correction_recommendword_click",listData[0].search_content,listData[0].related_word,"app")
}
listData.removeAt(0)
clickCount = 0 // 点击两次后重置为0
}
}
}
}
}
if (holder is HeaderViewHolder) {
// 搜索结果提示头部
bindHeaderView(holder)
} else if (holder is NormalViewHolder) {
val itemBean = listData[position]
//头像
val headConfig = SimpleImageOpConfiger()
headConfig.loadingPic = R.drawable.consultant_avatar_def_circle
headConfig.errorPic = R.drawable.consultant_avatar_def_circle
expertSearchView.showImage(
itemBean.head,
holder.imgHead,
holder.imgHead.width,
holder.imgHead.height,
headConfig
)
//姓名
holder.tvName.text = itemBean.doctor_name
//服务中
if (itemBean.open_chat_agency == 2 && itemBean.service_status == 2) {
holder.imgHead_online_server.visibility = View.VISIBLE
holder.chat_people_in_question.visibility = View.GONE
holder.imgHead_online.visibility = View.GONE
} else {
//不是服务中且问询人数大于0
when {
itemBean.chat_num > 5 -> {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "多人在问询"
}
itemBean.chat_num > 0 -> {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "${itemBean.chat_num}人在问询"
}
else -> {
holder.chat_people_in_question.visibility = View.GONE
}
}
//可预约
holder.imgHead_online_server.visibility = View.GONE
if (itemBean.is_free_today== 1) {
holder.imgHead_online.visibility = View.VISIBLE
} else {
holder.imgHead_online.visibility = View.GONE
}
}
bindNormalView(position, holder)
//省市
if (!TextUtils.isEmpty(itemBean.display_region)) {
holder.tvCity.text = itemBean.display_region
} else {
holder.tvCity.text = ""
}
//公益图标,不与其他图标冲突
if (1 == itemBean.has_servicefree_experience) {
if (null != itemBean.icons && !TextUtils.isEmpty(itemBean.icons.service_free_icon)) {
expertSearchView.showImage(
itemBean.icons.service_free_icon,
holder.imgServiceFree
)
} else {
val sp = SimpleImageOpConfiger()
sp.loadingPic = R.drawable.consultant_service_free
sp.errorPic = R.drawable.consultant_service_free
expertSearchView.showImage("", holder.imgServiceFree, sp)
}
holder.imgServiceFree.visibility = View.VISIBLE
} else {
holder.imgServiceFree.visibility = View.GONE
}
// 展示了抗疫,就不展示其他标签
if (itemBean.fightEpidemicIconShow) {
itemBean.icons?.fight_epidemic_icon?.let {
GlideApp.with(context).load(itemBean.icons?.fight_epidemic_icon)
.into(holder.imgFightEpidemicIcon)
holder.imgFightEpidemicIcon.visibility = View.VISIBLE
}
} else if (holder is FooterViewHolder) {
bindFooterView(holder)
}
}
if (itemBean.joinActivity == true) {
//活动图标
if (!TextUtils.isEmpty(itemBean.activityImg)) {
holder.imgActivity.visibility = View.VISIBLE
GlideApp.with(context).load(itemBean.activityImg).into(holder.imgActivity)
} else {
holder.imgActivity.visibility = View.GONE
}
} else {
holder.imgActivity.visibility = View.GONE
}
/**底部布局*/
private fun bindFooterView(holder: FooterViewHolder) {
if (hasMore) {
holder.itemView.visibility = View.VISIBLE
holder.pbLoading.visibility = View.VISIBLE
holder.tvHint.text = context.getString(R.string.consultant_loading)
} else {
holder.pbLoading.visibility = View.GONE
holder.tvHint.text = context.getString(R.string.platform_no_more)
}
}
//影藏其余所有标签(除公益)
holder.imgAbilityLevel.visibility = View.GONE
holder.imgNewEnter.visibility = View.GONE
} else {
holder.imgFightEpidemicIcon.visibility = View.GONE
//能力等级标签
when (itemBean.abilityLevel) {
1 -> {
//实习
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_shixi)
holder.imgAbilityLevel.visibility = View.VISIBLE
}
2 -> {
//新手
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou)
holder.imgAbilityLevel.visibility = View.VISIBLE
}
else -> {
holder.imgAbilityLevel.visibility = View.GONE
}
}
//活动图标
if (!TextUtils.isEmpty(itemBean.activityImg)) {
holder.imgActivity.visibility = View.VISIBLE
GlideApp.with(context).load(itemBean.activityImg).into(holder.imgActivity)
} else {
holder.imgActivity.visibility = View.GONE
}
//新驻图标
if (itemBean.is_new_enter != null && itemBean.is_new_enter!!) {
if (null != itemBean.icons && !TextUtils.isEmpty(itemBean.icons.new_enter_icon)) {
expertSearchView.showImage(
itemBean.icons.new_enter_icon,
holder.imgNewEnter
)
} else {
val sp = SimpleImageOpConfiger()
sp.loadingPic = R.drawable.consultant_new_enter
sp.errorPic = R.drawable.consultant_new_enter
expertSearchView.showImage("", holder.imgNewEnter, sp)
}
holder.imgNewEnter.visibility = View.VISIBLE
} else {
holder.imgNewEnter.visibility = View.GONE
}
}
holder.ll_feedbackRate.removeAllViews()
for (num in 1..5) {
val view = LayoutInflater.from(context).inflate(
R.layout.consultant_expert_search_feedbackrate,
holder.ll_feedbackRate,
false
)
if (itemBean.evaluation_average_score >= num) {
(view.imgRate as ImageView).background =
context.resources.getDrawable(R.drawable.consultant_expert_search_full_star)
} else if (itemBean.evaluation_average_score < num && itemBean.evaluation_average_score > num - 1) {
(view.imgRate as ImageView).background =
context.resources.getDrawable(R.drawable.consultant_expert_search_half_star)
} else {
(view.imgRate as ImageView).background =
context.resources.getDrawable(R.drawable.consultant_expert_search_nothing_star)
}
holder.ll_feedbackRate.addView(view)
}
//XXX人点评
val numSb = StringBuffer()
holder.tv_zixunOrderNum.text =
numSb.append(itemBean.evaluate_num).append("").toString()
//咨询师简介
holder.tvTeamCertifications.text = itemBean.title
//咨询师标签
holder.ll_tags.removeAllViews()
itemBean.feature_tags?.let {
if (it.isNotEmpty()) {
for (tag in itemBean.feature_tags) {
val view = LayoutInflater.from(context)
.inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
tag.tag_name.let { name ->
if (name.length > 4) {
view.tvTag.text = "${name.substring(0, 4)}…"
} else {
view.tvTag.text = name
}
}
if (tag.is_highlight) {
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_eb892c)
view.tvTag.setTextColor(
ContextCompat.getColor(
context,
R.color.color_EB892C
)
)
} else {
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_gray_1)
view.tvTag.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
)
)
}
holder.ll_tags.addView(view)
}
}
}
//帮助人数
val orderUser = StringBuffer()
holder.tvOrderNum.text = orderUser.append(itemBean.help_num).append("").toString()
//私聊文案
if (TextUtils.isEmpty(itemBean.chat_btn_text)) {
holder.tvChat.text = "私聊"
holder.tvChat.setTextColor(
/**item布局*/
private fun bindNormalView(position: Int, holder: NormalViewHolder) {
val itemBean = listData[position]
//头像
val headConfig = SimpleImageOpConfiger()
headConfig.loadingPic = R.drawable.consultant_avatar_def_circle
headConfig.errorPic = R.drawable.consultant_avatar_def_circle
expertSearchView.showImage(
itemBean.head,
holder.imgHead,
holder.imgHead.width,
holder.imgHead.height,
headConfig
)
//咨询显示状态:1.忙碌;2.现在有空;3.今日可约;4.最近可约;5.已约满;6.休息中
when (itemBean.consult_display_status) {
6 -> {
holder.consult_display_status_str.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.platform_but_text_color
R.color.color_b6bece_90
)
)
holder.tvChat.setTextColor(
}
5, 1 -> {
holder.consult_display_status_str.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.platform_but_text_color
R.color.color_f5a082_90
)
)
holder.tvChat.background =
ContextCompat.getDrawable(context, R.drawable.consultant_expert_search_chat)
} else {
holder.tvChat.text = itemBean.chat_btn_text
holder.tvChat.setTextColor(
}
else -> {
holder.consult_display_status_str.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.platform_color_999999
R.color.color_6ec8f9_90
)
)
holder.tvChat.background = ContextCompat.getDrawable(
}
}
//专家头像下方文案:如 忙碌;现在有空;今日可约;最近可约;已约满;休息中
holder.consult_display_status_str.text = itemBean.consult_display_status_str
//姓名
holder.tvName.text = itemBean.doctor_name
//年审
if (!TextUtils.isEmpty(itemBean.audit_tag)) {
holder.audit_tag.visibility = View.VISIBLE
holder.audit_tag.text = itemBean.audit_tag
} else {
holder.audit_tag.visibility = View.GONE
}
//省市
if (!TextUtils.isEmpty(itemBean.display_region)) {
holder.tvCity.text = itemBean.display_region
holder.tvCity.visibility = View.VISIBLE
} else {
holder.tvCity.visibility = View.GONE
}
//咨询师tag
holder.tvTeamCertifications.text = itemBean.title
//服务时长 经验
val durationStringBuffer = StringBuffer()
holder.tvSaleDurationForMonth.text =
durationStringBuffer.append(itemBean.sum_service_time.toInt()).append("小时").toString()
//口碑
val numSb = StringBuffer()
holder.tv_zixunOrderNum.text =
numSb.append(itemBean.evaluate_num).append("条").toString()
//咨询师标签
holder.ll_tags.removeAllViews()
if (itemBean.feature_tags?.isNotEmpty() == true) {
holder.ll_tags.visibility = View.VISIBLE
for (tag in itemBean.feature_tags) {
val view = LayoutInflater.from(context)
.inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
tag.tag_name.let { name ->
view.tvTag.text = name
}
if (tag.is_highlight) {
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_eb892c)
view.tvTag.setTextColor(
ContextCompat.getColor(
context,
R.color.color_EB892C
)
)
} else {
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_gray_1)
view.tvTag.setTextColor(
ContextCompat.getColor(
context,
R.color.color_1c1f28_50
)
)
}
holder.ll_tags.addView(view)
}
} else {
holder.ll_tags.visibility = View.GONE
}
//价格
val price = BigDecimal(itemBean.min_price)
// 去掉末尾无用的.00
val priceStr = "¥" + price.stripTrailingZeros().toPlainString()
holder.tvPrice.text = priceStr
//服务方式
holder.attr_combine.text = itemBean.attr_combine
if (1 == itemBean.open_chat_agency) {
//联系顾问
holder.tvChat.text = "联系顾问"
holder.card_chat.setCardBackgroundColor(
ContextCompat.getColor(
context,
R.drawable.consultant_expert_search_chat_rest
R.color.color_6ec8f9
)
}
//服务时长
val durationStringBuffer = StringBuffer()
holder.tvSaleDurationForMonth.text =
durationStringBuffer.append(itemBean.sum_service_time.toInt()).append("").toString()
//价格
val price = BigDecimal(itemBean.min_price)
// 去掉末尾无用的.00
holder.tvPrice.text = price.stripTrailingZeros().toPlainString()
//套餐
holder.ll_products.removeAllViews()
if (null != itemBean.doctor_products && itemBean.doctor_products.isNotEmpty()) {
for (item in itemBean.doctor_products) {
val view = LayoutInflater.from(context).inflate(
R.layout.consultant_expert_search_products_item,
holder.ll_tags,
false
)
} else {
//私聊状态:1.上线;2.离线;3.忙碌中
when (itemBean.chat_status) {
2, 3 -> {
holder.tvChat.text = "留 言"
holder.card_chat.setCardBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_b6bece
)
)
when (item.product_type) {
"1" -> {
view.tvTitle.text = "单次"
view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_single)
view.tvContent.text = item.product_name
holder.ll_products.addView(view)
}
"2" -> {
view.tvTitle.text = "套餐"
view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_menu)
view.tvContent.text = item.product_name
holder.ll_products.addView(view)
}
else -> {
}
else -> {
holder.tvChat.text = "私 聊"
holder.card_chat.setCardBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_6ec8f9
)
)
}
}
}
//问询 可约
var bottomDec = if (itemBean.chat_num > 0) {
if (!TextUtils.isEmpty(itemBean.today_time_des)) {
"${itemBean.chat_num}人在问询·${itemBean.today_time_des}"
} else {
"${itemBean.chat_num}人在问询"
}
} else {
if (!TextUtils.isEmpty(itemBean.today_time_des)) {
itemBean.today_time_des
} else {
""
}
}
if (TextUtils.isEmpty(bottomDec)) {
holder.chat_people_in_question.visibility = View.GONE
} else {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = bottomDec
}
}
/**顶部根据匹配,为您推荐布局*/
private fun bindHeaderView(holder: HeaderViewHolder) {
if (listData.size > 0) {
if (listData[0].is_head_view) {
if (clickCount == 0) {
holder.clSearchWords.visibility = View.VISIBLE
var text = "根据匹配,为您推荐“${listData[0].related_word}”的搜索结果"
holder.tvSearchRelatedWord.text = setTextBold(text, listData[0].related_word)
holder.tvSearchWord.text = listData[0].search_content
// 埋点
if (mIsRecommendWords) {
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
"ydl_user_map_word_visit",
listData[0].search_content,
listData[0].related_word,
"app"
)
} else {
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
"ydl_user_correction_word_visit",
listData[0].search_content,
listData[0].related_word,
"app"
)
}
holder.tvSearchWord.setOnClickListener {
mOnClickLister.onClick(holder.tvSearchWord.text.toString())
++clickCount
if (clickCount == 1) {
text = "以下是“${listData[0].search_content}”的搜索结果"
holder.tvSearchRelatedWord.text =
setTextBold(text, listData[0].search_content)
holder.tvSearchTips.text = "你要找的是不是"
holder.tvSearchWord.text = listData[0].related_word
// 埋点
if (mIsRecommendWords) {
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
"ydl_user_map_inputword_click",
listData[0].related_word,
listData[0].search_content,
"app"
)
} else {
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
"ydl_user_correction_inputword_click",
listData[0].related_word,
listData[0].search_content,
"app"
)
}
} else if (clickCount == 2) { // 第二次点击搜索标签隐藏搜索匹配结果提示
// 埋点
if (mIsRecommendWords) {
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
"ydl_user_map_recommendword_click",
listData[0].search_content,
listData[0].related_word,
"app"
)
} else {
ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
"ydl_user_correction_recommendword_click",
listData[0].search_content,
listData[0].related_word,
"app"
)
}
listData.removeAt(0)
clickCount = 0 // 点击两次后重置为0
}
}
}
}
} else if (holder is FooterViewHolder) {
if (hasMore) {
holder.itemView.visibility = View.VISIBLE
holder.pbLoading.visibility = View.VISIBLE
holder.tvHint.text = context.getString(R.string.consultant_loading)
} else {
holder.pbLoading.visibility = View.GONE
holder.tvHint.text = context.getString(R.string.platform_no_more)
}
}
}
override fun getItemCount(): Int =
// if (listData.size < ExpertSearchActivity.PAGE_SIZE && hasMore) {
if (listData.size==1) {
if (listData.size == 1) {
listData.size
} else {
listData.size + 1
......@@ -425,7 +375,8 @@ class ExpertSearchAdapter(
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder =
when (viewType) {
HEADER_VIEW -> {
val view = LayoutInflater.from(context).inflate(R.layout.consultant_expert_search_header_view, parent, false)
val view = LayoutInflater.from(context)
.inflate(R.layout.consultant_expert_search_header_view, parent, false)
HeaderViewHolder(view)
}
NORMAL_VIEW -> {
......@@ -447,7 +398,7 @@ class ExpertSearchAdapter(
override fun getItemViewType(position: Int): Int =
when {
position==0&&listData.size>0&&listData[0].is_head_view ->{
position == 0 && listData.size > 0 && listData[0].is_head_view -> {
HEADER_VIEW
}
position < listData.size -> {
......@@ -462,28 +413,18 @@ class ExpertSearchAdapter(
inner class NormalViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
//头像
val imgHead = itemView.imgHead!!
val cv_head_view = itemView.cv_head_view!!
//专家姓名
val tvName = itemView.tvName!!
//活动图标
val imgActivity = itemView.img_activity!!
//优质图标
val imgAbilityLevel = itemView.imgAbilityLevel!!
//公益图标
val imgServiceFree = itemView.imgServiceFree!!
//年审
val audit_tag = itemView.audit_tag!!
//新驻图标
val imgNewEnter = itemView.imgNewEnter!!
//头像下方文案
val consult_display_status_str = itemView.consult_display_status_str!!
//荣誉标签
val ll_honor_layout = itemView.ll_honor_layout!!
//好评率
val ll_feedbackRate = itemView.ll_feedbackRate!!
//服务方式
val attr_combine = itemView.attr_combine
//xxx人点评
val tv_zixunOrderNum = itemView.tv_zixunOrderNum!!
......@@ -494,49 +435,24 @@ class ExpertSearchAdapter(
//咨询师标签
val ll_tags = itemView.ll_tags!!
//帮助人数
val tvOrderNum = itemView.tvOrderNum!!
//帮助人数文案
val tvOrderNumContent = itemView.tvOrderNumContent
//服务时长
val tvSaleDurationForMonth = itemView.tvSaleDurationForMonth!!
//月售时长文案
val tvSaleDurationForMonthContent = itemView.tvSaleDurationForMonthContent
//价格
val tvPrice = itemView.tvPrice!!
val tvPriceContent = itemView.tvPriceContent!!
val tv_money_symbol = itemView.tv_money_symbol!!
//服务套餐
val ll_products = itemView.ll_products!!
//私聊按钮
val tvChat = itemView.tvChat!!
//个人铭言整个布局
val group_desc = itemView.group_desc!!
//个人铭言
val tvDesc = itemView.tvDesc!!
//私聊背景
val card_chat = itemView.card_chat!!
//省市
val tvCity = itemView.tvCity!!
//今日是否可约
val imgHead_online = itemView.imgHead_online!!
//服务中(咨询中或者聆听中)
val imgHead_online_server = itemView.imgHead_online_server!!
//多少人在问询
val chat_people_in_question = itemView.people_in_question!!
// 抗疫先锋图标
val imgFightEpidemicIcon = itemView.img_fightEpidemicIcon
init {
itemView.setOnClickListener {
......@@ -562,7 +478,7 @@ class ExpertSearchAdapter(
}
}
itemView.tvChat.setOnClickListener {
itemView.card_chat.setOnClickListener {
if (adapterPosition != RecyclerView.NO_POSITION) {
val doctor = listData[adapterPosition]
if (pageIndex == 0) {
......
package com.yidianling.consultant.model.bean
import com.yidianling.consultant.bean.ExpertSearchProductsBean
import com.yidianling.consultant.bean.ExpertSearchTagsIconBean
/**
* @author yuanWai
* @描述:
......@@ -23,153 +20,97 @@ data class ExpertServiceItem(
* 专家名称
*/
val doctor_name: String?,
/**
* 跳转路由地址(正常为专家主页地址)
*/
/*** 跳转路由地址(正常为专家主页地址)*/
val link_url: String?,
/**
* 专家头像地址
*/
/*** 专家头像地址*/
val head: String?,
/**
* 专家是否在线 1.在线
*/
/*** 私聊状态:1.上线;2.离线;3.忙碌中*/
val chat_status: Int?,
/**
* 能力等级 1.实习 2.新手 3.精英
*/
val abilityLevel: Int?,
/**
* 有免费咨询:1.有,2.无
*/
val has_servicefree_consult: Int?,
/**
* 活动图标
*/
val activityImg: String?,
/**
* 是否参加活动
*/
val joinActivity: Boolean?,
/**
* 是否新入驻:true:是,false:否
*/
var is_new_enter: Boolean?,
/**
* 好评率(倾诉+咨询)
*/
var evaluation_average_score: Float = 0f,
/**
* 是否抗疫先锋图标
*/
var fightEpidemicIconShow: Boolean = false,
/**
* 评价数(咨询订单数)
*/
/*** 评价数(咨询订单数)*/
var evaluate_num: Int = 0,
/**
* 咨询最低价
*/
/*** 咨询最低价*/
val min_price: String?,
/**
* 资质材料
*/
/*** 资质材料*/
val title: String?,
/**
* 已帮助人数(咨询人数)
*/
val help_num: String?,
/**
* 月售时长
*/
var p30d_sold_hour: Float = 0f,
/**
* 服务时长
*/
/*** 服务时长*/
var sum_service_time: Float = 0f,
/**
* 服务
*/
val doctor_products: MutableList<ExpertSearchProductsBean>?,
/**
* 标签图片
*/
val icons: ExpertSearchTagsIconBean?,
// /**
// * 今日是否可约
// */
// val booking_status: Int,
// /**
// * 咨询状态 1-待服务 2-服务中
// */
// var consult_status: Int,
// /**
// * 倾诉状态 1-待服务 2-服务中
// */
// var listen_status: Int,
var open_chat_agency: Int,
/***服务状态:1.空闲,2.忙碌*/
var service_status: Int,
var is_free_today: Int,
/**
* 私聊人数
*/
/*** 私聊人数*/
var chat_num: Int = 0,
/**
* 个人铭言
*/
val famous_remark: String?,
/**
* 省
*/
val province: String?,
/**
* 市
*/
val city: String?,
/**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/
/*** 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)*/
val chat_btn_text: String?,
/**
* 新标签分类
*/
/*** 新标签分类*/
val feature_tags: ArrayList<FeatureTag>?,
/**
* 是否是头部headView
*/
/*** 是否是头部headView*/
val is_head_view: Boolean = false,
/**
* 搜索词
*/
/*** 搜索词*/
val search_content: String,
/**
* 联想词
*/
/*** 联想词*/
val related_word: String,
/**
* 地区
*/
/*** 地区*/
val display_region: String,
/**
* 是否展示公益图标
*/
val has_servicefree_experience: Int?
/***咨询显示状态:1.忙碌;2.现在有空;3.今日可约;4.最近可约;5.已约满;6.休息中*/
val consult_display_status: Int,
/***专家头像下方文案:如 忙碌;现在有空;今日可约;最近可约;已约满;休息中*/
val consult_display_status_str: String,
/***私聊下方时间描述:如 最快可约今天19:00*/
val today_time_des: String,
/***服务方式:如 当面/视频*/
val attr_combine: String = "",
/***0:关闭代聊,1:开启代聊*/
val open_chat_agency: Int,
/***年审*/
val audit_tag: String,
) {
) {
constructor(is_head_view: Boolean, search_content: String, related_word: String) : this(
"", "", "", "", "",
1, 1, 1, "", false, true,
1f, false, 0, "", "", "", 1f, 1f,
null, null, 1, 1, 1, 1,
"", "", "", "", null, is_head_view, search_content, related_word, "", 1
id = "",
uid = "",
doctor_name = "",
link_url = "",
head = "",
chat_status = 1,
evaluate_num = 0,
min_price = "",
title = "",
sum_service_time = 0f,
service_status = 1,
chat_num = 0,
chat_btn_text = null,
feature_tags = null,
is_head_view = is_head_view,
search_content = search_content,
related_word = related_word,
display_region = "",
consult_display_status = 2,
consult_display_status_str = "",
today_time_des = "",
attr_combine = "",
open_chat_agency = 0,
audit_tag = ""
)
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"/>
<corners android:radius="4dp" />
<solid android:color="@color/color_1AEB892C" />
<stroke android:width="0.5dp" android:color="@color/color_EB892C"/>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"/>
<corners android:radius="4dp" />
<solid android:color="@color/platform_white" />
<stroke android:width="0.5dp" android:color="@color/platform_color_E0E0E0"/>
<stroke
android:width="0.5dp"
android:color="@color/color_1c1f28_10" />
</shape>
\ No newline at end of file
......@@ -4,9 +4,9 @@
<shape android:shape="rectangle">
<solid android:color="@color/platform_main_theme_bright" />
<corners android:radius="11dp"/>
<stroke
<!--<stroke
android:width="0.5dp"
android:color="@color/platform_main_theme"/>
android:color="@color/platform_main_theme"/>-->
</shape>
</item>
<item android:state_enabled="true">
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_f6f6f7" />
<corners android:radius="2dp" />
<padding
android:bottom="2dp"
android:left="4dp"
android:right="4dp"
android:top="1.5dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/platform_dp_13"
android:paddingRight="@dimen/platform_dp_15"
android:paddingBottom="@dimen/platform_dp_8">
<!--头像-->
<LinearLayout
android:id="@+id/cvHead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_15"
android:background="@drawable/consultant_bg_radius_line_gray_05"
android:orientation="vertical">
android:paddingLeft="@dimen/platform_dp_16"
android:paddingTop="@dimen/platform_dp_19"
android:paddingRight="@dimen/platform_dp_16">
<androidx.cardview.widget.CardView
android:id="@+id/cv_head_view"
android:layout_width="92dp"
android:layout_height="114dp"
app:cardCornerRadius="4dp"
app:cardElevation="0px">
<androidx.cardview.widget.CardView
android:id="@+id/cv_head_view"
android:layout_width="64dp"
android:layout_height="80dp"
android:layout_marginTop="3dp"
app:cardCornerRadius="8dp"
app:cardElevation="0px"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imgHead"
......@@ -29,32 +30,22 @@
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/consultant_avatar_def_circle" />
</androidx.cardview.widget.CardView>
</LinearLayout>
<ImageView
android:id="@+id/imgHead_online"
android:layout_width="62dp"
android:layout_height="14dp"
android:layout_alignBottom="@+id/cvHead"
android:layout_gravity="bottom"
android:scaleType="centerCrop"
android:visibility="gone"
app:srcCompat="@drawable/consultant_online_yue"
tools:visibility="visible" />
<TextView
android:id="@+id/consult_display_status_str"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#6EC8F9"
android:gravity="center"
android:paddingTop="1dp"
android:paddingBottom="2dp"
android:textColor="@color/white"
android:textSize="9dp"
tools:text="现在有空" />
</RelativeLayout>
<ImageView
android:id="@+id/imgHead_online_server"
android:layout_width="41dp"
android:layout_height="14dp"
android:layout_alignBottom="@+id/cvHead"
android:layout_gravity="bottom"
android:scaleType="centerCrop"
android:visibility="gone"
app:srcCompat="@drawable/consultant_online_server"
tools:visibility="visible" />
</androidx.cardview.widget.CardView>
<!--咨询师姓名-->
<TextView
......@@ -62,347 +53,209 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_toEndOf="@+id/cvHead"
android:layout_toRightOf="@+id/cvHead"
android:gravity="center_vertical"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_18"
android:textColor="@color/color_1C1F28"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
app:layout_constraintLeft_toRightOf="@id/cv_head_view"
app:layout_constraintTop_toTopOf="parent"
tools:text="罗静" />
<LinearLayout
android:id="@+id/ll_honor_layout"
android:layout_width="match_parent"
<TextView
android:id="@+id/audit_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvName"
android:layout_alignBottom="@+id/tvName"
android:layout_marginStart="@dimen/platform_dp_2"
android:layout_toEndOf="@+id/tvName"
android:layout_toRightOf="@+id/tvName"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="8dp">
<ImageView
android:id="@+id/img_fightEpidemicIcon"
android:layout_width="53dp"
android:layout_height="@dimen/platform_dp_17"
android:layout_marginRight="4dp"
android:scaleType="centerCrop"
android:visibility="gone" />
<!--活动图标-->
<ImageView
android:id="@+id/img_activity"
android:layout_width="42dp"
android:layout_height="12dp"
android:layout_marginRight="4dp"
android:visibility="gone" />
<!--公益图标-->
<ImageView
android:id="@+id/imgServiceFree"
android:layout_width="26dp"
android:layout_height="@dimen/platform_dp_12"
android:layout_marginRight="4dp"
android:scaleType="centerCrop"
tools:background="@drawable/consultant_service_free" />
<!--新驻图标-->
<ImageView
android:id="@+id/imgNewEnter"
android:layout_width="26dp"
android:layout_height="@dimen/platform_dp_12"
android:layout_marginRight="4dp"
android:scaleType="fitCenter"
tools:background="@drawable/consultant_new_enter" />
<!--优质图标-->
<ImageView
android:id="@+id/imgAbilityLevel"
android:layout_width="26dp"
android:layout_height="@dimen/platform_dp_12"
android:layout_marginRight="4dp"
android:scaleType="fitCenter"
android:visibility="gone"
tools:background="@drawable/consultant_expert_search_shixi" />
</LinearLayout>
android:layout_marginStart="4dp"
android:background="@drawable/consultant_ns_bg"
android:textColor="@color/color_62636F"
android:textSize="10dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tvName"
app:layout_constraintLeft_toRightOf="@id/tvName"
app:layout_constraintTop_toTopOf="@id/tvName"
tools:text="2022年审"
tools:visibility="visible" />
<TextView
android:id="@+id/tvCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/consult_location_icon"
android:drawablePadding="2dp"
android:gravity="right"
android:textColor="@color/color_1c1f28_40"
android:textSize="@dimen/platform_dp_11"
app:layout_constraintBottom_toBottomOf="@id/tvName"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tvName"
tools:text="浙江.杭州" />
<!--咨询师简介-->
<TextView
android:id="@+id/tvTeamCertifications"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@+id/tvName"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_4"
android:layout_toEndOf="@+id/cvHead"
android:layout_toRightOf="@+id/cvHead"
android:ellipsize="end"
android:layout_toStartOf="@+id/tvCity"
android:lines="1"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
tools:text="一级婚姻家庭咨询师,二级心理咨询师二级心理咨询师二级心理咨询师" />
<!--咨询师标签-->
<LinearLayout
android:id="@+id/ll_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvName"
android:layout_alignTop="@+id/tvChat"
android:layout_alignBottom="@+id/tvChat"
android:layout_toLeftOf="@+id/tvChat"
android:gravity="center_vertical"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout
android:id="@+id/ll_zixunOrderNum"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_16"
android:layout_below="@+id/tvTeamCertifications"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_toEndOf="@+id/cvHead"
android:layout_toRightOf="@+id/cvHead"
android:orientation="horizontal">
<!--好评率-->
<LinearLayout
android:id="@+id/ll_feedbackRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal" />
<!--61234人点评-->
<TextView
android:id="@+id/tv_zixunOrderNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="61234" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="条评价"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12" />
android:textColor="@color/color_1c1f28_60"
android:textSize="@dimen/platform_dp_13"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="@id/tvName"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvName"
tools:text="一级婚姻家庭咨询师 | 二级心理咨询师二级心理咨询师二级心理咨询师" />
</LinearLayout>
<!--帮助人数-->
<TextView
android:id="@+id/tvOrderNumContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_zixunOrderNum"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/cvHead"
android:text="帮助"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
tools:ignore="SpUsage" />
<!--服务时长-->
<TextView
android:id="@+id/tvOrderNum"
android:id="@+id/tvSaleDurationForMonth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_marginLeft="1dp"
android:layout_marginTop="4dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@+id/tvOrderNumContent"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="2648" />
android:gravity="center"
android:textColor="@color/color_1C1F28"
android:textSize="@dimen/platform_dp_13"
app:layout_constraintLeft_toLeftOf="@id/tvName"
app:layout_constraintTop_toBottomOf="@id/tvTeamCertifications"
tools:text="134小时" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_toRightOf="@+id/tvOrderNum"
android:text="人"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
tools:ignore="SpUsage" />
<!--服务时长-->
<TextView
android:id="@+id/tvSaleDurationForMonthContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_marginLeft="@dimen/platform_dp_20"
android:layout_toRightOf="@+id/tvOrderNum"
android:text="服务"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
tools:ignore="SpUsage" />
android:text="经验"
android:textColor="@color/color_1c1f28_60"
android:textSize="@dimen/platform_dp_13"
app:layout_constraintBaseline_toBaselineOf="@id/tvSaleDurationForMonth"
app:layout_constraintLeft_toRightOf="@id/tvSaleDurationForMonth" />
<TextView
android:id="@+id/tvSaleDurationForMonth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@+id/tvSaleDurationForMonthContent"
android:gravity="center"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="134" />
<TextView
android:id="@+id/tv_zixunOrderNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_toRightOf="@+id/tvSaleDurationForMonth"
android:text="小时"
android:textColor="@color/platform_color_999999"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/platform_dp_13"
android:textColor="@color/color_1C1F28"
android:textSize="@dimen/platform_dp_12"
tools:ignore="SpUsage" />
app:layout_constraintBaseline_toBaselineOf="@id/tvSaleDurationForMonth"
app:layout_constraintLeft_toRightOf="@id/tvSaleDurationForMonthContent"
tools:text="61234条" />
<TextView
android:id="@+id/people_in_question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_alignParentRight="true"
android:textColor="@color/platform_color_FF5040"
android:textSize="@dimen/platform_dp_12"
android:visibility="gone"
tools:ignore="SpUsage"
tools:text="多人在问询"
tools:visibility="visible" />
android:layout_gravity="center_vertical"
android:text="口碑"
android:textColor="@color/color_1c1f28_60"
android:textSize="@dimen/platform_dp_13"
app:layout_constraintBaseline_toBaselineOf="@id/tv_zixunOrderNum"
app:layout_constraintLeft_toRightOf="@id/tv_zixunOrderNum" />
<TextView
android:id="@+id/tv_money_symbol"
<!--咨询师标签-->
<LinearLayout
android:id="@+id/ll_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvPrice"
android:layout_marginTop="3dp"
android:layout_marginRight="1dp"
android:layout_toLeftOf="@+id/tvPrice"
android:text="¥"
android:textColor="#FF5040"
android:textSize="@dimen/platform_dp_11"
android:textStyle="bold"
tools:ignore="SpUsage" />
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="@id/tvName"
app:layout_constraintTop_toBottomOf="@id/tvSaleDurationForMonth"
tools:visibility="gone" />
<TextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvName"
android:layout_toLeftOf="@+id/tvPriceContent"
android:fontFamily="@font/platform_din_bold"
android:textColor="#FF5040"
android:textSize="@dimen/platform_dp_20"
tools:text="250" />
android:layout_marginTop="8dp"
android:textColor="@color/color_ef8a4a"
android:textSize="@dimen/platform_dp_14"
app:layout_constraintLeft_toLeftOf="@id/tvName"
app:layout_constraintTop_toBottomOf="@id/ll_tags"
app:layout_goneMarginTop="10dp"
tools:text="¥250" />
<TextView
android:id="@+id/tvPriceContent"
android:id="@+id/tvPrice_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvPrice"
android:layout_alignParentRight="true"
android:layout_marginLeft="1dp"
android:layout_marginBottom="2.5dp"
android:layout_alignTop="@+id/tvName"
android:text="起"
android:textColor="#FF5040"
android:textSize="@dimen/platform_dp_11" />
android:textColor="@color/color_ef8a4a"
android:textSize="@dimen/platform_dp_12"
app:layout_constraintTop_toTopOf="@id/tvPrice"
app:layout_constraintBottom_toBottomOf="@id/tvPrice"
app:layout_constraintLeft_toRightOf="@id/tvPrice" />
<TextView
android:id="@+id/tvCity"
android:id="@+id/attr_combine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvName"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/platform_dp_4"
android:gravity="right"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
tools:text="浙江.杭州" />
<!--<View-->
<!--android:id="@+id/vLine"-->
<!--android:layout_below="@+id/tvPrice"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="2dp"-->
<!--android:layout_marginLeft="104dp"-->
<!--android:layout_marginStart="104dp"-->
<!--android:layout_marginTop="7dp"-->
<!--android:layerType="software"-->
<!--android:background="@drawable/expert_search_dash_line" />-->
<!--服务套餐-->
<LinearLayout
android:id="@+id/ll_products"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="104dp"
android:layout_marginLeft="104dp"
android:layout_marginTop="@dimen/platform_dp_5"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
android:layout_marginStart="12dp"
android:textColor="@color/color_1c1f28_40"
android:textSize="12dp"
app:layout_constraintBaseline_toBaselineOf="@id/tvPrice"
app:layout_constraintLeft_toRightOf="@id/tvPrice_unit"
tools:text="面/视咨询" />
<!--私聊-->
<TextView
android:id="@+id/tvChat"
<androidx.cardview.widget.CardView
android:id="@+id/card_chat"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_24"
android:layout_alignBottom="@+id/cvHead"
android:layout_alignParentRight="true"
android:gravity="center"
android:textSize="@dimen/platform_dp_13"
android:textStyle="bold"
android:background="@drawable/consultant_expert_search_chat"
android:textColor="@color/platform_but_text_color"
android:text="私聊"/>
<!--描述-->
<RelativeLayout
android:id="@+id/group_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvChat"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_10"
android:layout_toRightOf="@+id/cvHead"
android:background="@drawable/consultant_bg_radius_gray_2"
android:visibility="gone">
<ImageView
android:layout_width="12dp"
android:layout_height="11dp"
android:layout_marginLeft="@dimen/platform_dp_8"
android:layout_marginTop="@dimen/platform_dp_6"
android:src="@drawable/consultant_bg_item_desc" />
android:layout_height="24dp"
android:elevation="0dp"
android:minWidth="60dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
app:cardBackgroundColor="@color/color_6ec8f9"
app:cardCornerRadius="12dp"
app:cardElevation="0dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tvPrice">
<TextView
android:id="@+id/tvDesc"
android:layout_width="match_parent"
android:id="@+id/tvChat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="8dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/platform_color_999999"
android:layout_gravity="center"
android:gravity="center"
android:text="私 聊"
android:textColor="@color/white"
android:textSize="@dimen/platform_dp_11"
tools:text="的客人能够黄偶尔烦人呢日工俄日给你额鞥你让个汇入你哦个人会儿个黄胡蓉呢你个人给哦 而归黑人更换二给" />
</RelativeLayout>
app:layout_constraintBaseline_toBaselineOf="@id/tvPrice"
app:layout_constraintRight_toRightOf="parent" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/people_in_question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="@color/color_1c1f28_40"
android:textSize="@dimen/platform_dp_10"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/card_chat"
tools:text="多人在问询"
tools:visibility="visible" />
<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginTop="20dp"
android:background="@color/color_EFEFF1"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="@id/cv_head_view"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/people_in_question" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -4,10 +4,13 @@
android:id="@+id/tvTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="@drawable/consultant_bg_radius_line_gray_1"
android:gravity="center"
android:layout_marginEnd="6dp"
android:padding="3dp"
android:textColor="@color/platform_color_666666"
android:textSize="10sp"
android:paddingLeft="4dp"
android:paddingTop="2dp"
android:paddingRight="4dp"
android:paddingBottom="3dp"
android:textColor="@color/color_1c1f28_50"
android:textSize="11dp"
tools:text="恋爱情感" />
......@@ -3,7 +3,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/platform_white"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
......@@ -29,12 +28,14 @@
android:id="@+id/tvSubject"
style="@style/consultant_FilterTextViewStyle"
android:layout_width="0dp"
android:drawablePadding="4dp"
android:layout_weight="1"
android:width="0dp"
android:ellipsize="end"
android:textStyle="bold"
android:singleLine="true"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableEnd="@drawable/consult_ic_arrow_drwn_gray"
android:drawableRight="@drawable/consult_ic_arrow_drwn_gray"
android:text="困扰"
android:textColor="@color/platform_color_242424" />
......@@ -44,8 +45,10 @@
android:layout_width="0dp"
android:layout_weight="1"
android:width="0dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:textStyle="bold"
android:drawablePadding="4dp"
android:drawableEnd="@drawable/consult_ic_arrow_drwn_gray"
android:drawableRight="@drawable/consult_ic_arrow_drwn_gray"
android:text="城市"
android:textColor="@color/platform_color_242424" />
......@@ -55,8 +58,10 @@
android:layout_width="0dp"
android:layout_weight="1"
android:width="0dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:textStyle="bold"
android:drawablePadding="4dp"
android:drawableEnd="@drawable/consult_ic_arrow_drwn_gray"
android:drawableRight="@drawable/consult_ic_arrow_drwn_gray"
android:text="价格"
android:textColor="@color/platform_color_242424" />
......@@ -66,8 +71,10 @@
android:layout_width="0dp"
android:layout_weight="1"
android:width="0dp"
android:drawableEnd="@drawable/filter_up_grey"
android:drawableRight="@drawable/filter_up_grey"
android:textStyle="bold"
android:drawablePadding="4dp"
android:drawableEnd="@drawable/filter_up_gray"
android:drawableRight="@drawable/filter_up_gray"
android:text="@string/platform_filter"
android:textColor="@color/platform_color_242424" />
</LinearLayout>
......
......@@ -26,5 +26,18 @@
<color name="consultant_colorBg">#f5f5f5</color>
<color name="color_EB892C">#EB892C</color>
<color name="color_1AEB892C">#1AEB892C</color>
<color name="color_1c1f28_60">#a61c1f28</color>
<color name="color_1c1f28_50">#801c1f28</color>
<color name="color_1c1f28_40">#661c1f28</color>
<color name="color_1c1f28_20">#331c1f28</color>
<color name="color_1c1f28_10">#1a1c1f28</color>
<color name="color_ef8a4a">#EF8A4A</color>
<color name="color_f6f6f7">#f6f6f7</color>
<color name="color_6ec8f9">#6ec8f9</color>
<color name="color_6ec8f9_90">#E66ec8f9</color>
<color name="color_b6bece">#B6BECE</color>
<color name="color_b6bece_90">#E6B6BECE</color>
<color name="color_f5a082">#F5A082</color>
<color name="color_f5a082_90">#E6F5A082</color>
<color name="color_f28e6b">#F28E6B</color>
</resources>
......@@ -27,7 +27,6 @@ android {
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
}
......@@ -49,7 +48,9 @@ android {
ydl {}
xlzx {}
}
dataBinding {
enabled true
}
sourceSets {
main {
res.srcDirs = ['src/main/res']
......
package com.yidianling.home.model.bean
import com.google.gson.annotations.SerializedName
import com.yidianling.consultant.bean.Keyworks
import java.io.Serializable
......@@ -18,14 +17,8 @@ class HomeHeaderBean : HomeItemBaseBean {
var activityResponse: ActivityResponse? = null
/**
* 分类数据
*/
var askCategoryData: MutableList<AskCategoryDataBean>? = null
/**
* 新版分类数据
*/
var goldList: MutableList<CategoryGoldListDataBean>? = null
/**
......@@ -73,28 +66,6 @@ class HomeHeaderBean : HomeItemBaseBean {
var goCriteriaMap: HashMap<String, Any>? = null
) : Serializable
class AskCategoryDataBean {
/**
* id
*/
var cateId: Int = 0
/**
* 名称
*/
var cateTitle: String? = null //
/**
* 跳转url
*/
var url: String? = null
/**
* 图片icon
*/
var coverUrl: String? = null
}
class FocusListBean {
/**
* 标题
......
package com.yidianling.home.ui.transform;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
import jp.wasabeef.glide.transformations.BitmapTransformation;
public class CircleCropTransform extends BitmapTransformation {
private final Paint mBorderPaint;
private final float mBorderSize;
public CircleCropTransform() {
this(0, Color.TRANSPARENT);
}
@Override
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
return circleCrop(pool, toTransform);
}
/**
* @param borderSize 边框宽度(px)
* @param borderColor 边框颜色
*/
public CircleCropTransform(float borderSize, int borderColor) {
this(TypedValue.COMPLEX_UNIT_PX, borderSize, borderColor);
}
/**
* @param unit borderSize 单位
* @param borderSize 边框宽度(px)
* @param borderColor 边框颜色
*/
public CircleCropTransform(int unit, float borderSize, int borderColor) {
DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics();
mBorderSize = TypedValue.applyDimension(unit, borderSize, displayMetrics);
mBorderPaint = new Paint();
mBorderPaint.setDither(true);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(borderColor);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setStrokeWidth(mBorderSize);
}
private Bitmap circleCrop(BitmapPool pool, Bitmap source) {
if (source == null) return null;
int size = (int) (Math.min(source.getWidth(), source.getHeight()) - (mBorderSize / 2));
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap squared = Bitmap.createBitmap(source, x, y, size, size);
Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
paint.setAntiAlias(true);
float r = size / 2f;
canvas.drawCircle(r, r, r, paint);
if (mBorderPaint != null) {
float borderRadius = r - mBorderSize / 2;
canvas.drawCircle(r, r, borderRadius, mBorderPaint);
}
return result;
}
@Override
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
}
@Override
public boolean equals(Object o) {
return false;
}
@Override
public int hashCode() {
return 0;
}
}
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.yidianling.home.R
import com.yidianling.home.databinding.HomeButtonBannerViewBinding
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import kotlinx.android.synthetic.xlzx.home_button_banner_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
......@@ -21,6 +20,7 @@ import kotlinx.android.synthetic.xlzx.home_button_banner_view.view.*
*/
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) :
LinearLayout(mContext) {
private var dataBinding: HomeButtonBannerViewBinding? = null
init {
initView()
......@@ -32,33 +32,37 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
ViewGroup.LayoutParams.WRAP_CONTENT
)
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
dataBinding = DataBindingUtil.inflate(
LayoutInflater.from(mContext),
R.layout.home_button_banner_view,
this,
true
)
Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(qingsuGif)
homeModuleButtonBannerFirst.setOnClickListener {
dataBinding?.homeModuleButtonBannerFirst?.setOnClickListener {
homeEvent?.reservationExpertsClick()
}
homeModuleButtonBannerSecond.setOnClickListener {
homeEvent?.askMoreClick()
}
homeModuleButtonBannerThird.setOnClickListener {
dataBinding?.homeModuleButtonBannerSecond?.setOnClickListener {
homeEvent?.nowConfideClick(false)
}
homeModuleButtonBannerFourth.setOnClickListener {
dataBinding?.homeModuleButtonBannerThird?.setOnClickListener {
homeEvent?.psychologyClassClick()
}
dataBinding?.homeModuleButtonBannerFourth?.setOnClickListener {
homeEvent?.psychologyTestClick()
}
dataBinding?.loopAvatar?.stopLoop()
dataBinding?.loopAvatar?.startLoop()
}
fun initData(
homeCategory: List<HomeHeaderBean.CategoryGoldListDataBean>?
) {
homeEvent?.let { home_category_view.setEvent(it) }
home_category_view.initData(homeCategory)
homeEvent?.let { dataBinding?.homeCategoryView?.setEvent(it) }
dataBinding?.homeCategoryView?.initData(homeCategory)
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.os.Handler
import android.os.Message
import android.util.AttributeSet
import android.util.Log
import android.widget.ImageView
import android.widget.RelativeLayout
import com.blankj.utilcode.util.SizeUtils
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.home.R
import com.yidianling.home.ui.transform.CircleCropTransform
import java.lang.ref.WeakReference
const val START_AVATAR_LOOP = 111
class LoopScrollAvatar @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : RelativeLayout(context, attrs, defStyleAttr) {
//动画播放时长
private val animDuration = 500L
//动画间隔播放时间
private val animIntervalTime = 1500L
//两边头像的缩放程度
private val scaleFrom = 0.7F
//头像大小
private val avatarSize = SizeUtils.dp2px(18F)
//从当前位置滚动到下一位置需要移动的距离
private var scrollLength = 0F
//下次要显示的图片角标
private var index = 0
private val res =
arrayOf(
R.mipmap.home_banner_header1,
R.mipmap.home_banner_header2,
R.mipmap.home_banner_header3,
R.mipmap.home_banner_header4,
R.mipmap.home_banner_header5
)
//缓存复用ImageView
private val ivCache = mutableListOf(
createImageView(),
createImageView(),
createImageView(),
createImageView()
)
private val handler by lazy {
LoopHandler(this)
}
init {
//前三位的头像先addView显示出来
//放左边
addImageView(ALIGN_PARENT_LEFT)
//放中间
addImageView(CENTER_HORIZONTAL)
//默认放右边
addImageView()
}
class LoopHandler() : Handler() {
private var lWeak: WeakReference<LoopScrollAvatar>? = null
constructor(loopScrollAvatar: LoopScrollAvatar) : this() {
lWeak = WeakReference(loopScrollAvatar)
}
override fun handleMessage(msg: Message) {
super.handleMessage(msg)
lWeak?.get()?.apply {
if ((context as? Activity)?.isDestroyed == false) {
startAnimMove()
sendLoopMsg()
}
}
}
}
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
scrollLength = (width - avatarSize) / 2F
}
/**
* 创建圆形头像ImageView
*/
private fun createImageView(): ImageView {
return ImageView(context)
}
/**
* 摆放头像ImageView
*/
private fun addImageView(rule: Int = ALIGN_PARENT_RIGHT) {
//复用缓存
val iv = if (ivCache.size > 0) {
ivCache[0]
} else {
createImageView()
}
//当前已在屏幕显示的控件不要复用,防止params混乱
ivCache.remove(iv)
//图片资源全部播放完之后要从头重播
index = (index + 1) % res.size
//设置在RelativeLayout中的显示位置
val lp = LayoutParams(avatarSize, avatarSize)
lp.addRule(rule)
iv.layoutParams = lp
addView(iv)
//圆角带描边
GlideApp.with(this).load(res[index]).transform(CircleCropTransform(1f, Color.WHITE))
.into(iv)
}
/**
* 轮播滚动动效
*/
private fun startAnimMove() {
//添加一个即将从右边移进屏幕的ImageView
addImageView()
//上行代码刚添加进来的最右边头像(此时RelativeLayout的mChildrenCount=4)
getChildAt(3)?.apply {
//设置起始的低透明度 和 小size
alpha = 0.6F
scaleX = scaleFrom
scaleY = scaleFrom
//先设置左边部分向左移出控件,即挡住左边不显示(然后才能translationXBy移进屏幕)
translationX = scrollLength
//translationXBy指的是从当前位置开始移动多少距离(区别于translationX)
//alpha是从当前透明度(即0.6F)变为设置的透明度(即1F)
//scaleX是从当前宽度比例(即scaleFrom)变为设置的宽度比例(即1F)
animate().translationXBy(-scrollLength).alpha(1F).scaleX(1F).scaleY(1F)
.setDuration(animDuration).start()
}
//中间俩头像只需设置平移的距离即可
getChildAt(1)?.apply {
animate().translationXBy(-scrollLength).setDuration(animDuration).start()
}
//设置平移的距离
getChildAt(2)?.apply {
animate().translationXBy(-scrollLength).setDuration(animDuration).start()
}
//最左边的头像(从完整显示 到 透明度和大小都变小,并且左移出屏幕)(因为是最先add进来的View,所以index=0)
getChildAt(0)?.let { iv ->
iv.animate().translationXBy(0f).alpha(0F).scaleX(scaleFrom).scaleY(scaleFrom)
.setDuration(animDuration)
.setListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
super.onAnimationEnd(animation)
//清除ImageView已有属性,并添加进ivCache缓存
iv.animate().setListener(null)
iv.clearAnimation()
iv.translationX = 0F
iv.scaleX = 1.0F
iv.scaleY = 1.0F
iv.alpha = 1F
//从RelativeLayout移出
removeView(iv)
ivCache.add(0, iv as ImageView)
try {
if ((context as Activity).isFinishing) {
stopLoop()
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}).start()
}
}
private fun sendLoopMsg() {
handler.sendEmptyMessageDelayed(START_AVATAR_LOOP, animIntervalTime + animDuration)
}
private var looping = false
/**
* 开始轮播
*/
fun startLoop() {
if (looping) {
Log.e("startLoop", "startLoop cannot be called twice")
}
looping = true
sendLoopMsg()
}
/**
* 停止轮播
*/
fun stopLoop() {
looping = false
handler.removeCallbacksAndMessages(null)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_home_module_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
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" />
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:id="@+id/ll_home_module_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginTop="15dp"
android:layout_marginRight="4dp"
android:gravity="center_horizontal|bottom"
android:orientation="horizontal"
android:paddingBottom="12dp">
android:layout_marginTop="17dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_first_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="心理咨询"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"
android:textStyle="bold" />
</LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="54dp"
android:layout_height="52dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_fourth_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="心理测试"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"
android:textStyle="bold" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/third_icon"
android:layout_width="71dp"
android:layout_height="64dp"
android:paddingLeft="7dp"
android:paddingTop="12dp"
android:paddingRight="12dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_third_icon"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/qingsuGif"
android:layout_width="45dp"
android:layout_height="24dp"
app:layout_constraintRight_toRightOf="@id/third_icon"
app:layout_constraintTop_toTopOf="@id/third_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/third_icon"
android:layout_marginTop="6dp"
android:text="倾诉热线"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="@id/third_icon"
app:layout_constraintRight_toRightOf="@id/third_icon"
app:layout_constraintTop_toBottomOf="@id/third_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_marginLeft="16dp"
android:layout_marginTop="15dp"
android:layout_marginRight="16dp"
android:gravity="center_horizontal|bottom"
android:orientation="horizontal"
android:paddingBottom="12dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="84dp"
android:layout_weight="1"
android:background="@mipmap/home_banner_first_bg">
<TextView
android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="心理咨询"
android:textColor="@color/white"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/homeModuleFirstDec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3W+师资"
android:layout_marginTop="2dp"
android:textColor="@color/white"
android:textSize="11dp"
app:layout_constraintLeft_toLeftOf="@id/homeModuleButtonBannerFirstTitle"
app:layout_constraintTop_toBottomOf="@id/homeModuleButtonBannerFirstTitle" />
<com.yidianling.home.ui.view.LoopScrollAvatar
android:id="@+id/loop_avatar"
android:layout_marginTop="8dp"
android:visibility="visible"
android:src="@mipmap/home_banner_header1"
app:layout_constraintTop_toBottomOf="@id/homeModuleFirstDec"
app:layout_constraintLeft_toLeftOf="@id/homeModuleButtonBannerFirstTitle"
android:layout_width="45dp"
app:layout_constraintHorizontal_weight="1"
android:layout_height="20dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="84dp"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@mipmap/home_banner_test_bg">
<TextView
android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="心理测试"
android:textColor="@color/white"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/homeModuleTestDec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="抑郁测量"
android:textColor="@color/white"
android:layout_marginTop="2dp"
android:textSize="11dp"
app:layout_constraintLeft_toLeftOf="@id/homeModuleButtonBannerFourthTitle"
app:layout_constraintTop_toBottomOf="@id/homeModuleButtonBannerFourthTitle" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="84dp"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@mipmap/home_banner_third_bg"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="心理课堂"
android:textColor="@color/white"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/homeModuleThirdDec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="学习与成长"
android:textColor="@color/white"
android:textSize="11dp"
app:layout_constraintLeft_toLeftOf="@id/homeModuleButtonBannerThirdTitle"
app:layout_constraintTop_toBottomOf="@id/homeModuleButtonBannerThirdTitle" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="84dp"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:background="@mipmap/home_banner_second_bg"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="倾诉热线"
android:textColor="@color/white"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/homeModuleSecondDec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="24小时在线"
android:textColor="@color/white"
android:textSize="11dp"
app:layout_constraintLeft_toLeftOf="@id/homeModuleButtonBannerSecondTitle"
app:layout_constraintTop_toBottomOf="@id/homeModuleButtonBannerSecondTitle" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="fitXY"
android:src="@drawable/home_banner_second_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="心理问答"
android:textColor="@color/platform_color_242424"
android:textSize="13dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>
......@@ -23,9 +23,6 @@ class HomeCategoryAdapter : PagerAdapter {
private var mContext : Context? = null
private var mHomeEvent : IHomeBaseEvent? = null
//源数据
private var mOriginList: MutableList<HomeHeaderBean.AskCategoryDataBean>? = null
//数据
private var list: MutableList<MutableList<HomeHeaderBean.CategoryGoldListDataBean>>? = null
......
......@@ -550,49 +550,53 @@ object IMChatUtil {
val status = chatStatusBean.data.status
actionHandler.setDoctorStatus(status)
actionHandler.setDoctorBusyNum(chatStatusBean.data.busyTotal)
//1.在线,2.离线,3.忙碌 4咨询中, 5倾述中 6咨询前准备
if (status == 2) { //离线
tb.setMinTitleText("离线")
tb.setMinTitleColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
//1.在线,2.离线,3.服务中 4咨询中, 5倾述中 6咨询前准备
when (status) {
3 -> { //服务中
tb.setMinTitleText("服务中")
tb.setMinTitleColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
)
)
)
tb.setMinTitleDrawable(
ContextCompat.getDrawable(
context,
R.drawable.im_background_chat_top_status_off_line
tb.setMinTitleDrawable(
ContextCompat.getDrawable(
context,
R.drawable.im_background_chat_top_status_online_server
)
)
)
} else if (status == 4 || status == 5) { //服务中
tb.setMinTitleText("服务中")
tb.setMinTitleColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
}
2 -> { //离线
tb.setMinTitleText("离线")
tb.setMinTitleColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
)
)
)
tb.setMinTitleDrawable(
ContextCompat.getDrawable(
context,
R.drawable.im_background_chat_top_status_online_server
tb.setMinTitleDrawable(
ContextCompat.getDrawable(
context,
R.drawable.im_background_chat_top_status_off_line
)
)
)
} else { //在线 1,3,6..
tb.setMinTitleText("在线")
tb.setMinTitleColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
}
else -> { //在线 1
tb.setMinTitleText("在线")
tb.setMinTitleColor(
ContextCompat.getColor(
context,
R.color.platform_color_666666
)
)
)
tb.setMinTitleDrawable(
ContextCompat.getDrawable(
context,
R.drawable.im_background_chat_top_status_online
tb.setMinTitleDrawable(
ContextCompat.getDrawable(
context,
R.drawable.im_background_chat_top_status_online
)
)
)
}
}
initSystemMessage(
chatStatusBean.data.promptRule,
......
......@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.Build
import android.text.TextUtils
import android.util.Log
import com.google.gson.Gson
import com.ydl.devicesidlib.DeviceIDHelper
import com.ydl.devicesidlib.Utils
......@@ -259,14 +260,32 @@ class HttpConfig {
}
val message = originalResponse.message()
val api = request.url().encodedPath()
ActionCountUtils.baiDuCount("ydl_user_error_business","error_log",api,params,message)
ActionCountUtils.baiDuCount(
"ydl_user_error_business",
"error_log",
api,
params,
message
)
//阿里云忽略埋点接口
if (!api.contains("maidian/writeMaiDianData")){
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.API, "error_log---api:$api---params:$params ---- message:$message")
}else{
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.API, "writeMaiDianDataError:$api---params:$params ---- message:$message")
if (!api.contains("maidian/writeMaiDianData")) {
AliYunRichLogsHelper.getInstance().sendRichLog(
AliYunLogConfig.API,
"error_log---api:$api---params:$params ---- message:$message"
)
} else {
AliYunRichLogsHelper.getInstance().sendRichLog(
AliYunLogConfig.API,
"writeMaiDianDataError:$api---params:$params ---- message:$message"
)
}
}
} else {
Log.e(
"YDL",
"\n---------------------------------------------------------------------------\n" +
"| 请求地址:" + request.url() + " |\n--------------------------------------------------------------------------\n"
)
}
originalResponse
}
......
......@@ -13,9 +13,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ll_share"
android:layout_marginStart="68dp"
android:layout_marginEnd="68dp"
android:layout_marginBottom="-25dp"
android:layout_marginStart="42dp"
android:layout_marginEnd="42dp"
android:clickable="true"
android:visibility="gone"
app:cardCornerRadius="10dp"
......@@ -31,7 +30,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scaleType="fitXY"
android:scaleType="fitCenter"
tools:layout_height="100dp" />
<TextView
......
......@@ -204,7 +204,7 @@ class ShareMeditationDialog : DialogFragment() {
fun newInstance(
isDarkMode: Boolean, shareUrl: String, shareTitle: String,
shareContent: String, shareCover: String, miniId: String, miniPath: String
shareContent: String, shareCover: String, miniId: String?, miniPath: String?
): ShareMeditationDialog {
val args = Bundle()
args.putBoolean(KEY_SHARE_DARK_MODE, isDarkMode)
......
......@@ -26,6 +26,8 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import androidx.core.content.ContextCompat;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.tencent.smtt.export.external.interfaces.JsResult;
......@@ -50,7 +52,7 @@ import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.bean.ShareData;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.event.MeditationEvent;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.ydl.ydlcommon.ui.LogoLoadingView;
import com.ydl.ydlcommon.utils.ActivityManager;
import com.ydl.ydlcommon.utils.BuryPointUtils;
......@@ -100,13 +102,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
/*** 路由传递过来的参数*/
public static final String ROUTER_PARAMS = "routerParam";
/***下单选择时间请求吗*/
public static final int ORDER_TIME_REQUEST_CODE = 110;
/***启动类型 0正常模式 1从下至上打开页面*/
private int startType = 0;
/***右侧按钮文字*/
private String rightText = "";
protected TitleBar tb_title;
protected View tb_title_cover_v;
......@@ -122,14 +119,10 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
protected String shareTitle;
protected String shareDesc;
private String cover;
private String miniId;
private String miniPath;
// 评价2.0新增字段 区分评价列表
// 评价2.0新增字段 区分评价列表
private H5JsBean.H5JsCmd.Params paramsForCommentList;
private boolean isShareCommentList;
private boolean isDarkMode = false;
private ShareMeditationDialog shareMeditationDialog;
private ArticleDialogFragment commentArticleDialog;
......@@ -154,7 +147,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private long initDuration = 0;
/***加载url耗时*/
private long loadDuration = 0;
private NetWorkSpeedUtils workSpeedUtils;
/***部分机型中webview加载完成回调方法会调用多次,增加本地标识符*/
private boolean hasLoad = false;
/***是否跳转到动态*/
......@@ -162,24 +154,22 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private LogoLoadingView v_loading;
/***是否超时*/
private boolean isTimeOut = false;
/***超时处理handler*/
private Handler mTimeOutHandler = null;
/***超时限定时间*/
private int timeOutLong = 15000;
private final int TIME_OUT_LONG = 15000;
/***超时消息*/
private int TIME_OUT_TYPE = 0x1000;
private final int TIME_OUT_TYPE = 0x1000;
/**
* 设置微信 H5 支付调用 loadDataWithBaseURL 的标记位,避免循环调用,
* 再次进入微信 H5 支付流程时记得重置此标记位状态
*/
boolean firstVisitWXH5PayUrl = true;
private String WX_H5_PAY_HOST = "http://testnewm.ydl.com";
/*** 当前页面类型*/
private int selfPageType = -1;
/***测评题页面*/
private int TEST_QUESTIONS_PAGE_TYPE = 1000001;
private final int TEST_QUESTIONS_PAGE_TYPE = 1000001;
private YDLCommonDialog testQuestionsPageReturnDialog = null;
/*** 标题栏是否被覆盖隐藏*/
......@@ -189,7 +179,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
/**
* 设置当前h5页面类型
*
* @param pageType
* @param pageType h5页面类型
*/
public void setSelfPageType(int pageType) {
selfPageType = pageType;
......@@ -304,7 +294,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initTimeOutHandler() {
mTimeOutHandler = new Handler(msg -> {
if (wv_content.getProgress() < 100) {
isTimeOut = true;
llWebView.setVisibility(View.GONE);
v_loading.setVisibility(View.VISIBLE);
......@@ -320,7 +309,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
*/
private void sendNetLossMessage() {
if (null != mTimeOutHandler) {
mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, timeOutLong);
mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, TIME_OUT_LONG);
}
}
......@@ -341,7 +330,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@Override
public void onDataResetClick() {
sendNetLossMessage();
isTimeOut = false;
llWebView.setVisibility(View.VISIBLE);
v_loading.setVisibility(View.VISIBLE);
v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null);
......@@ -388,12 +376,13 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tellData = new TellData();
}
initView();
if (!BaseApp.instance.getGlobalConfig().getAppDebug()&& ProxyCheckUtils.INSTANCE.isWifiProxy(this)){
if (!BaseApp.instance.getGlobalConfig().getAppDebug() && ProxyCheckUtils.INSTANCE.isWifiProxy(this)) {
ToastUtil.toastShort("网络设置错误");
return;
}
startType = getIntent().getIntExtra("startType", 0);
rightText = getIntent().getStringExtra("rightText");
//右侧按钮文字
String rightText = getIntent().getStringExtra("rightText");
if (h5Params == null) {
ToastUtil.toastShort("参数错误");
AliYunRichLogsHelper.Companion.getInstance().sendRichLog(AliYunLogConfig.WEB, "参数错误 Params == null");
......@@ -410,14 +399,10 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setImageVis(0);
tb_title.setLeftTextVisible(View.GONE);
tb_title.setmRightText(rightText);
tb_title.setOnRightTextClick((view, isActive) -> {
finish();
});
tb_title.setOnRightTextClick((view, isActive) -> finish());
} else if (!TextUtils.isEmpty(rightText) && webRightClickListener != null) {
tb_title.setmRightText(rightText);
tb_title.setOnRightTextClick((view, isActive) -> {
webRightClickListener.onCLick(view);
});
tb_title.setOnRightTextClick((view, isActive) -> webRightClickListener.onCLick(view));
}
llWebView = findViewById(R.id.ll_web_view);
initLoadingView();
......@@ -436,7 +421,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//再次替换 方哥那边解决不了域名的问题 app中强行匹配修改
if (url.contains("fe-app-yidianling")) {
int index = url.indexOf("course/Detail");
String newUrl = url.substring(index, url.length());
String newUrl = url.substring(index);
if (url.contains("test")) {
newUrl = "https://testnewm.ydl.com/" + newUrl;
} else {
......@@ -453,8 +438,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
/**
* 专家详情页改版 需要url后面拼接状态栏高度 并且隐藏导航栏
*
* @param url
* @return
* @param url 页面地址
* @return 拼接状态栏高度的url
*/
private String setUrlHeightParams(String url) {
String resultUrl = url;
......@@ -480,12 +465,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
showTitleBar();
return jumpUrl;
}
String useUrl = new StringBuffer().append(jumpUrl).toString();
StringBuilder useUrl = new StringBuilder(jumpUrl);
Resources res = getResources();
String[] doctorUrlArray = res.getStringArray(R.array.platform_doctorUrls);
for (String url : doctorUrlArray) {
if (useUrl.contains(url)) {
String lastUrl = useUrl.replaceAll(url, "");
if (useUrl.toString().contains(url)) {
String lastUrl = useUrl.toString().replaceAll(url, "");
if (lastUrl.contains("?")) {
lastUrl = lastUrl.substring(0, lastUrl.indexOf("?"));
}
......@@ -493,14 +478,14 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//不报错就说明可以转成long,就说明是专家详情页地址
Long.parseLong(lastUrl);
if (!lastUrl.contains("/")) {
if (useUrl.endsWith("?")) {
useUrl = useUrl.substring(0, useUrl.indexOf("?"));
if (useUrl.toString().endsWith("?")) {
useUrl = new StringBuilder(useUrl.substring(0, useUrl.indexOf("?")));
}
if (!useUrl.contains("barHeight")) {
String paramsStr = useUrl.contains("?")
? "&barHeight=" + String.valueOf(StatusBarUtils.Companion.getStatusBarHeight(NewH5Activity.this))
: "?barHeight=" + String.valueOf(StatusBarUtils.Companion.getStatusBarHeight(NewH5Activity.this));
useUrl = new StringBuffer().append(useUrl).append(paramsStr).toString();
if (!useUrl.toString().contains("barHeight")) {
String paramsStr = useUrl.toString().contains("?")
? "&barHeight=" + StatusBarUtils.Companion.getStatusBarHeight(NewH5Activity.this)
: "?barHeight=" + StatusBarUtils.Companion.getStatusBarHeight(NewH5Activity.this);
useUrl.append(paramsStr);
}
hideJavaTitleBar();
}
......@@ -509,7 +494,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
}
}
return useUrl;
return useUrl.toString();
}
public void hasShowDownRefresh(boolean isVisible) {
......@@ -531,7 +516,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
cover = params.getShare().getCover();
paramsForCommentList = params;
LogUtil.d("title: " + shareTitle + " url: " + shareUrl + " desc: " + shareDesc + " cover: " + cover);
new Handler(getMainLooper()).post(() -> initShareMenu());
new Handler(getMainLooper()).post(this::initShareMenu);
}
}
......@@ -546,22 +531,22 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
public void openShareMenu(H5JsBean.H5JsCmd.Params params) {
if (params.getShare() != null) {
if ("Meditation".equals(params.getShare().getType())){
if ("Meditation".equals(params.getShare().getType())) {
shareUrl = params.getShare().getShare_url();
shareTitle = params.getShare().getTitle();
shareDesc = params.getShare().getDesc();
cover = params.getShare().getCover();
miniId = params.getShare().getMinProgramId();
miniPath = params.getShare().getMinProgramPath();
isDarkMode = params.getShare().isDarkMode();
String miniId = params.getShare().getMinProgramId();
String miniPath = params.getShare().getMinProgramPath();
boolean isDarkMode = params.getShare().isDarkMode();
if (shareMeditationDialog == null) {
shareMeditationDialog = ShareMeditationDialog.Companion.newInstance(isDarkMode,
shareUrl, shareTitle, shareDesc, cover, miniId, miniPath);
}
if (shareMeditationDialog != null && !shareMeditationDialog.isAdded()) {
if (!shareMeditationDialog.isAdded()) {
shareMeditationDialog.show(getSupportFragmentManager(), "share_meditation");
}
}else {
} else {
purl = params.getShare().getUrl();
shareUrl = params.getShare().getShare_url();
shareTitle = params.getShare().getTitle();
......@@ -576,13 +561,13 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initView() {
tb_title = (TitleBar) findViewById(R.id.tb_title);
tb_title_cover_v = (View) findViewById(R.id.tb_title_cover_v);
tb_title = findViewById(R.id.tb_title);
tb_title_cover_v = findViewById(R.id.tb_title_cover_v);
tb_title.setPaddingLeft(10);
wv_content = (ProgressWebView) findViewById(R.id.wv_content);
wv_content = findViewById(R.id.wv_content);
backgroundView = findViewById(R.id.iv_background);
store_house_ptr_frame = (PtrFrameLayout) findViewById(R.id.store_house_ptr_frame);
safeTipView = (SafeTipView) findViewById(R.id.safe_tip_view);
store_house_ptr_frame = findViewById(R.id.store_house_ptr_frame);
safeTipView = findViewById(R.id.safe_tip_view);
if (h5Params != null && h5Params.isControlBack()) {
store_house_ptr_frame.setEnabled(false);
......@@ -596,9 +581,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
runOnUiThread(() -> {
tb_title.setVisibility(View.GONE);
if (null != getStatusView()) {
if (selfPageType == TEST_QUESTIONS_PAGE_TYPE) {
//测评题隐藏标题的时候,不隐藏状态栏
} else {
//测评题隐藏标题的时候,不隐藏状态栏
if (selfPageType != TEST_QUESTIONS_PAGE_TYPE) {
getStatusView().setVisibility(View.GONE);
}
}
......@@ -606,9 +590,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
public void setBottomViewColor(String color) {
runOnUiThread(() -> {
setBottomColor(color);
});
runOnUiThread(() -> setBottomColor(color));
}
public void showTitleBar() {
......@@ -623,16 +605,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//js修改UI的操作需要放在UI线程中更新,覆盖标题
public void coverJavaTitleBar() {
isTitleBarCover = true;
runOnUiThread(() -> {
tb_title_cover_v.setVisibility(VISIBLE);
});
runOnUiThread(() -> tb_title_cover_v.setVisibility(VISIBLE));
}
public void notCoverTitleBar() {
isTitleBarCover = false;
runOnUiThread(() -> {
tb_title_cover_v.setVisibility(GONE);
});
runOnUiThread(() -> tb_title_cover_v.setVisibility(GONE));
}
public void closeWebKit() {
......@@ -660,7 +638,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (!TextUtils.isEmpty(h5Params.getTitle()) && !h5Params.getShowUrlTitle()) {
tb_title.setTitle(h5Params.getTitle());
}
tb_title.setImage(getResources().getDrawable(R.drawable.web_common_back));
tb_title.setImage(ContextCompat.getDrawable(NewH5Activity.this, R.drawable.web_common_back));
WebSettings setting = wv_content.getSettings();
//支持js
......@@ -687,14 +665,13 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setImageListener(v -> {
if (h5Params.isSplash()) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish();
} else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish();
}
finish();
});
if (startType != 1) {
tb_title.setImageVis(1);
......@@ -724,7 +701,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
if (TextUtils.isEmpty(h5Params.getTitle())){
if (TextUtils.isEmpty(h5Params.getTitle())) {
tb_title.setTitle(title);
}
wv_content.setTitle(title);
......@@ -739,26 +716,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
}
// For Android < 3.0
public void openFileChooser(ValueCallback<Uri> valueCallback) {
uploadMessage = valueCallback;
openImageChooserActivity();
}
// For Android >= 3.0
public void openFileChooser(ValueCallback valueCallback, String acceptType) {
uploadMessage = valueCallback;
openImageChooserActivity();
}
//For Android >= 4.1
@Override
public void openFileChooser(ValueCallback<Uri> valueCallback, String acceptType, String capture) {
uploadMessage = valueCallback;
openImageChooserActivity();
}
// For Android >= 5.0
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
uploadMessageAboveL = filePathCallback;
......@@ -781,7 +738,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (!TextUtils.isEmpty(url) && url.endsWith(".apk")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
} else if (url.startsWith("tel://")){
} else if (url.startsWith("tel://")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
} else if (!TextUtils.isEmpty(url) && url.startsWith("http")) {
......@@ -806,7 +763,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
hasLoad = true;
loadDuration = System.currentTimeMillis() - loadStartTime;
LogUtil.e("initDuration:" + initDuration + ",loadDuration:" + loadDuration);
// UploadWebViewTimeUtils.Companion.uploadWebViewTime(h5Params.getUrl(), initDuration + "", loadDuration + "", workSpeedUtils.getNetSpeed());
}
if (shouldClearHistory) {
......@@ -867,11 +823,10 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (!TextUtils.isEmpty(url) && url.endsWith(".apk")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
}else if (url.startsWith("tel://")){
} else if (url.startsWith("tel://")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
}
else if (!TextUtils.isEmpty(url) && url.startsWith("http")) {
} else if (!TextUtils.isEmpty(url) && url.startsWith("http")) {
loadUrl(setUrlHeightParams(url));
} else {
if (!YDLRouterManager.Companion.router(url)) {
......@@ -892,7 +847,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
hasLoad = true;
loadDuration = System.currentTimeMillis() - loadStartTime;
LogUtil.e("initDuration:" + initDuration + ",loadDuration:" + loadDuration);
//UploadWebViewTimeUtils.Companion.uploadWebViewTime(h5Params.getUrl(), initDuration + "", loadDuration + "", workSpeedUtils.getNetSpeed());
}
if (shouldClearHistory) {
......@@ -909,26 +863,22 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
finish();
}
});
if (startType != 1) {
tb_title.setImageVis(1);
}
} else {
tb_title.setImage(getResources().getDrawable(R.drawable.web_common_back));
tb_title.setImage(ContextCompat.getDrawable(NewH5Activity.this, R.drawable.web_common_back));
tb_title.setmLeftText("");
tb_title.setImageListener(v -> {
if (h5Params.getShowUrlTitle()) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
finish();
} else {
if (ActivityManager.Companion.getInstance().getActivitys().size() == 1) {
WebModularServiceUtils.Companion.startMain(NewH5Activity.this);
}
finish();
}
finish();
});
if (startType != 1) {
tb_title.setImageVis(1);
}
}
if (startType != 1) {
tb_title.setImageVis(1);
}
if (!loadFailed) {
......@@ -975,7 +925,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
});
initDuration = System.currentTimeMillis() - initStartTime;
workSpeedUtils = new NetWorkSpeedUtils(this);
NetWorkSpeedUtils workSpeedUtils = new NetWorkSpeedUtils(this);
workSpeedUtils.startNetSpeed();
loadStartTime = System.currentTimeMillis();
loadUrl(h5Params.getUrl());
......@@ -1005,11 +955,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
}
// 处理普通 http 请求跳转
// if (!(url.startsWith("http") || url.startsWith("https"))) {
// return true;
// }
// 处理微信 H5 支付跳转时验证请求头 referer 失效
// 验证不通过会出现“商家参数格式有误,请联系商家解决”
if (url.contains("wx.tenpay.com")) {
......@@ -1059,7 +1004,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
private void initShareMenu() {
tb_title.setRightIcon(getResources().getDrawable(R.drawable.web_common_share));
tb_title.setRightIcon(ContextCompat.getDrawable(NewH5Activity.this, R.drawable.web_common_share));
tb_title.setOnRightTextClick((view, isActive) -> {
ShareData shareData = paramsForCommentList.getShare();
if (shareData != null && "commentList".equals(shareData.getType())) {
......@@ -1161,7 +1106,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initHead() {
// header
final MaterialHeader header = new MaterialHeader(this);
int[] colors = new int[]{getResources().getColor(R.color.platform_main_theme)};
int[] colors = new int[]{ContextCompat.getColor(NewH5Activity.this, R.color.platform_main_theme)};
header.setColorSchemeColors(colors);
header.setLayoutParams(new PtrFrameLayout.LayoutParams(-1, -2));
int padding = (int) getResources().getDimension(R.dimen.platform_default_dis_size);
......@@ -1207,11 +1152,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
} else {
wv_content.goBack();
}
if (startType != 1) {
tb_title.setImageVis(1);
}
} else {
tb_title.setImage(getResources().getDrawable(R.drawable.web_common_back));
tb_title.setImage(ContextCompat.getDrawable(NewH5Activity.this, R.drawable.web_common_back));
tb_title.setmLeftText("");
if ("top".equals(type)) {
setTitle(wv_content.getTitle());
......@@ -1227,7 +1169,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
});
} else {
if (h5Params.getUrl()!=null && h5Params.getUrl().contains("user/payment/detail")){
if (h5Params.getUrl() != null && h5Params.getUrl().contains("user/payment/detail")) {
//付款详情页 付款详情页_返回点击
ActionCountUtils.Companion.count("consult_order_pay_details_page|return_click");
}
......@@ -1241,9 +1183,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
finish();
}
}
if (startType != 1) {
tb_title.setImageVis(1);
}
}
if (startType != 1) {
tb_title.setImageVis(1);
}
}
......@@ -1365,7 +1307,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 新用户侧滑按钮限制
*/
if (h5Params.getBackLimit() != null && h5Params.getBackLimit() == H5Params.BackLimit.NEW_USER_PAGE) {
ModularServiceManager.INSTANCE.provide(IAppService.class).mainIntent(this);
ModularServiceManagerKt.findRouteService(IAppService.class).mainIntent(this);
return true;
}
......@@ -1426,9 +1368,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
if (h5Params.isShowMenu()) {
try {
if (WebModularServiceUtils.Companion.getImService().isHasUnread()) {
tb_title.setImage_right(getResources().getDrawable(R.drawable.web_common_notice_more_en));
tb_title.setImage_right(ContextCompat.getDrawable(NewH5Activity.this, R.drawable.web_common_notice_more_en));
} else {
tb_title.setImage_right(getResources().getDrawable(R.drawable.web_common_notice_more_un));
tb_title.setImage_right(ContextCompat.getDrawable(NewH5Activity.this, R.drawable.web_common_notice_more_un));
}
} catch (Exception e) {
e.printStackTrace();
......@@ -1465,9 +1407,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//如果未引入动态模块的话,隐藏分享至动态按钮
dialog = YDLShareDialog.Companion.style4(this, shareTitle, shareUrl, shareDesc, cover);
} else {
if (isShareCommentList){
if (isShareCommentList) {
dialog = YDLShareDialog.Companion.style7(this, shareTitle, shareUrl, shareDesc, cover, minPath, minId);
}else {
} else {
dialog = YDLShareDialog.Companion.style1(this, shareTitle, shareUrl, shareDesc, cover, minPath, minId);
}
}
......@@ -1530,39 +1472,36 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
public void switchSound(int mediaId, long meditationId, int meditationType, int businessType,
String buried, String mediaUrl, String mediaCoverUrl,
String title, String desc, int status){
String buried, String mediaUrl, String mediaCoverUrl,
String title, String desc, int status) {
MeditationEvent event = new MeditationEvent(
mediaId,meditationId,meditationType,businessType,
status,buried,mediaUrl,mediaCoverUrl,title,desc);
mediaId, meditationId, meditationType, businessType,
status, buried, mediaUrl, mediaCoverUrl, title, desc);
EventBus.getDefault().post(event);
}
public void setBG(String color,String alpha){
public void setBG(String color, String alpha) {
try {
store_house_ptr_frame.setBackgroundColor(Color.parseColor(color));
int a = Integer.valueOf(alpha);
store_house_ptr_frame.getBackground().setAlpha(a);
}catch (Exception ex){
} catch (Exception ex) {
}
}
public void showCommentArticleDialog(String title){
public void showCommentArticleDialog(String title) {
if (commentArticleDialog == null) {
String titleStr = title==null?wv_content.getTitle():title;
String titleStr = title == null ? wv_content.getTitle() : title;
commentArticleDialog = ArticleDialogFragment.newInstance(titleStr);
commentArticleDialog.setOnPublishListener(comment -> {
callJSFunc("sendComment('"+comment+"')");
callJSFunc("sendComment('" + comment + "')");
});
}
if (commentArticleDialog != null && !commentArticleDialog.isAdded()) {
commentArticleDialog.show(getSupportFragmentManager(), "article_comment");
}
}
}
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