Commit 29693366 by 刘鹏

Merge branch 'd/v_confide_2.0' into feat/lp/lp_confide_2.0

# Conflicts:
#	app/build.gradle
#	config.gradle
#	ydl-platform/src/main/java/com/ydl/ydlcommon/view/dialog/YDLShareDialog.kt
parents 5ab37efb b3e227f2
......@@ -170,6 +170,9 @@ android {
packagingOptions {
exclude 'META-INF/proguard/coroutines.pro'
}
dataBinding {
enabled true
}
}
......@@ -248,5 +251,6 @@ dependencies {
implementation rootProject.ext.dependencies["retrofit-url-manager"]
kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'androidx.fragment:fragment:1.2.4@aar'
implementation "androidx.fragment:fragment:1.2.4"
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
}
/*___Generated_by_IDEA___*/
package com.ydl.component;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.ydl.component;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.ydl.component;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
\ No newline at end of file
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -5,6 +5,7 @@ import android.app.Activity;
import com.alibaba.android.arouter.launcher.ARouter;
import com.ydl.confide.api.IConfideService;
import com.ydl.confide.home.event.ChangeAnotherExpertEvent;
import com.ydl.webview.H5JsBean;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
......@@ -12,6 +13,8 @@ import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.im.api.service.IImService;
import de.greenrobot.event.EventBus;
/**
* webview 点击事件监听 抽象类
* Created by harvie on 2017/7/4 0004.
......@@ -446,5 +449,10 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
}
}
@Override
public void getNextExpertStatus(String doctorID, String title,String uid) {
EventBus.getDefault().post(new ChangeAnotherExpertEvent(doctorID,title,uid));
}
}
......@@ -381,6 +381,10 @@ class WebJavascriptHandler : IJavascriptHandler{
wvEnventPro?.setSelfPageType(it.selfPageType)
}
}
//再换一位
"get_next_doctor"->{
wvEnventPro?.getNextExpertStatus(jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.title,jsData.cmd?.params?.uid.toString())
}
}
}
}
......@@ -181,5 +181,5 @@ public interface WebViewClientClickListener {
//设置当前页面类型
void setSelfPageType(int selfType);
void getNextExpertStatus(String doctorID,String title,String uid);
}
......@@ -31,8 +31,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//bugly 符号表
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
classpath 'com.ydl.plugins:restools:1.0.1'
......
......@@ -5,12 +5,12 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.74",
"m-confide" : "0.0.49.78",
"m-consultant" : "0.0.60.25",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.11",
"m-home" : "0.0.23.48",
"m-im" : "0.0.21.44",
"m-im" : "0.0.21.45",
"m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.10",
......@@ -20,7 +20,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.11",
"m-confide-api" : "0.0.2.12",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......@@ -35,19 +35,19 @@ ext {
//mdt 组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.08",
"ydl-platform" : "0.0.41.11",
//第二步 若干
"ydl-webview" : "0.0.38.62",
"ydl-media" : "0.0.21.44",
"ydl-media" : "0.0.21.45",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.90",
"m-audioim" : "0.0.49.29.92",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.93",
"ydl-utils" : "0.0.3.3",
"ydl-utils" : "0.0.3.6",
]
ydl_app = [
appName : "壹点灵心理咨询",
......@@ -90,12 +90,12 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.74",
"m-confide" : "0.0.49.78",
"m-consultant" : "0.0.60.25",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.11",
"m-home" : "0.0.23.48",
"m-im" : "0.0.21.44",
"m-im" : "0.0.21.45",
"m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.8",
......@@ -104,7 +104,7 @@ ext {
"m-course" : "0.0.43.37",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.11",
"m-confide-api" : "0.0.2.12",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......@@ -118,19 +118,19 @@ ext {
//mdt组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.08",
"ydl-platform" : "0.0.41.11",
//第二步 若干
"ydl-webview" : "0.0.38.62",
"ydl-media" : "0.0.21.44",
"ydl-media" : "0.0.21.45",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.90",
"m-audioim" : "0.0.49.29.92",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.93",
"ydl-utils" : "0.0.3.3",
"ydl-utils" : "0.0.3.6",
]
dependencies = [
......
......@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx4096m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
......
......@@ -21,6 +21,7 @@ import android.view.View
import android.view.animation.AccelerateInterpolator
import androidx.core.content.ContextCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson
import com.hjq.permissions.OnPermissionCallback
import com.hjq.permissions.XXPermissions
......@@ -41,6 +42,7 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.webview.RefreshWebEvent
import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydl_av.voice.impl.YDLVoiceApiImpl
import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger
......@@ -56,6 +58,7 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import io.agora.rtc.Constants
......@@ -546,7 +549,7 @@ class AudioHomeActivity :
writeAgoraLog("用户拨打电话界面开启")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "用户拨打电话界面开启")
tv_change_route.isEnabled = false
ll_changeRoute.isEnabled = false
//水波纹view初始化
wave_view.setDuration(6000)
wave_view.setStyle(Paint.Style.STROKE)
......@@ -573,14 +576,33 @@ class AudioHomeActivity :
}
if (!isShowAXB) {
tv_change_route.visibility = View.GONE
ll_changeRoute.visibility = View.GONE
tv_change_time_counter.visibility = View.GONE
}
}
private fun setClickEvent() {
//跳转客服小壹
jump_kefu.setOnClickListener {
val imService = ARouter.getInstance().navigation(IImService::class.java)
imService?.startKefuChat(this, "", 0, 0)
}
//静音开启
rl_mute_on_off.setOnClickListener {
if (iv_mute_on_off.isSelected) {
iv_mute_on_off.isSelected = false
iv_mute_on_off.setImageResource(R.drawable.audiohome_muteoff)
audio_mute_text.text="麦克风已关"
voiceManage?.getVoiceApi()?.enableLocalAudio(false)
} else {
iv_mute_on_off.isSelected = true
iv_mute_on_off.setImageResource(R.drawable.audiohome_muteon)
audio_mute_text.text="麦克风已开"
voiceManage?.getVoiceApi()?.enableLocalAudio(true)
}
}
//切换线路
tv_change_route.setOnClickListener {
ll_changeRoute.setOnClickListener {
showChooseDialog(1)
}
//挂断
......@@ -597,10 +619,10 @@ class AudioHomeActivity :
leaveChannel()
uploadLog()
YDLavManager.instances.callEndStatusUpdate(channelId!!, 3, "主叫主动挂断")
callEventSave("51", "已接通:主叫主动挂断")
} else {
userCloseCalling()
}
callEventSave("51", "已接通:主叫主动挂断")
ActionCountUtils.count(
"shengwang_popup_layer_page|shengwang_popup_layer_refuse_click",
......@@ -762,7 +784,7 @@ class AudioHomeActivity :
if (!isConnectSuccess) {
//关闭音乐
stopPlaying()
callEventSave("80", "未接通挂断:50s等待倒计时结束挂断")
callEventSave("34", "未接通挂断:50s等待倒计时结束挂断")
writeAgoraLog("未接通挂断:50s等待倒计时结束挂断")
AliYunRichLogsHelper.getInstance()
......@@ -836,7 +858,7 @@ class AudioHomeActivity :
*
*/
private fun userCloseCalling() {
callEventSave("51", "未接听时:主叫(用户)主动挂断,取消呼叫")
callEventSave("32", "未接听时:主叫(用户)主动挂断,取消呼叫")
writeAgoraLog("未接听时:主叫(用户)主动挂断,取消呼叫")
AliYunRichLogsHelper.getInstance()
......@@ -997,13 +1019,10 @@ class AudioHomeActivity :
// tv_change_doctor.visibility = View.VISIBLE
// }
if (!isShowAXB) {
tv_change_route.visibility = View.GONE
ll_changeRoute.visibility = View.GONE
} else {
//切换线路按钮可见
tv_change_route.isEnabled = true
tv_change_route.text = "切换至传统电话"
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.platform_white))
ll_changeRoute.isEnabled = true
}
}
......@@ -1102,23 +1121,8 @@ class AudioHomeActivity :
playNoticeMusic(1)
}
if (localRemainTime!! <= 60) {
if (tv_change_route.isEnabled) {
tv_change_route.isEnabled = false
tv_change_route.setTextColor(
ContextCompat.getColor(
this,
R.color.audioim_color_50ffffff
)
)
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(
this,
R.drawable.audioim_img_choose_arrow_unuse
),
null
)
if (ll_changeRoute.isEnabled) {
ll_changeRoute.isEnabled = false
}
}
tv_remain_time.text = DateUtils.formatTime(localRemainTime.toString())
......@@ -1406,7 +1410,7 @@ class AudioHomeActivity :
* @param res 上报的详细
* @param line 载体:1.网易 2.中国移动(双呼)3.联通 4.华为 5.糖猫-联通 7:声网 8:微信 10:新移动
* */
private fun callEventSave(
fun callEventSave(
status: String,
res: String,
session: String? = channelId,
......
......@@ -142,6 +142,7 @@ class YDLavManager {
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
act.callEventSave("33", "被叫拒绝,被叫点击了拒绝按钮")
callEndStatusUpdate(response?.ChannelId!!, 2, "被叫拒绝")
ToastUtil.toastShort("对方已挂断")
act.writeAgoraLog("被叫(专家)拒绝了通话邀请")
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/platform_dp_14" />
<solid android:color="@color/transparent" />
<stroke
android:color="#ffffff"
android:width="0.5dp"
>
</stroke>
</shape>
\ No newline at end of file
......@@ -50,6 +50,9 @@ android {
buildConfigField "String", "AGORA_APPID", '"3387e9b251f3491e9221a9877e8f7830"'
}
}
dataBinding {
enabled true
}
publishNonDefault true
productFlavors {
......@@ -75,9 +78,11 @@ dependencies {
implementation 'com.daimajia.androidanimations:library:2.3@aar'
api 'fr.tvbarthel.blurdialogfragment:lib:2.1.5'
api "com.alibaba:arouter-api:$arouter_api"
api 'com.tencent.tbs.tbssdk:sdk:43903'
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation 'com.alibaba:fastjson:1.2.38'
implementation "com.ydl:jjdxm-ijkplayer:0.0.33"
api rootProject.ext.dependencies["ydl-user-router"]
implementation modularPublication('com.ydl:m-consultant-api')
......@@ -88,6 +93,7 @@ dependencies {
api project(':m-audioim')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-utils')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-confide-api')
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.confide" >
package="com.ydl.confide">
<application>
<activity android:name=".home.ConfideHomeActivity"
<activity
android:name=".home.ConfideHomeActivity"
android:screenOrientation="portrait"
android:theme="@style/confide_NoTitleTheme"
>
</activity>
android:theme="@style/confide_NoTitleTheme"/>
<activity
android:name=".intro.ExpertIntroActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
......@@ -4,12 +4,14 @@ import android.content.Context
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.widget.*
import com.ydl.ydlcommon.utils.DisplayUtils
/**
* @author yuanwai
......@@ -73,17 +75,26 @@ class ConfideHomeAdapter(private val mContext: Context,
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
when (viewType) {
//banner
IConfideHomeConfig.TYPE_BANNER -> {
return BannerViewHolder(ConfideHomeBannerView(parent.context, confideHomeEvent))
}
// IConfideHomeConfig.TYPE_BANNER -> {
// return BannerViewHolder(ConfideHomeBannerView(parent.context, confideHomeEvent))
// }
//最近倾诉
IConfideHomeConfig.TYPE_RECENTLY_CONFIDED -> {
return ConsultViewHolder(ConfideHomeRecentView(parent.context, confideHomeEvent))
// return ConsultViewHolder(ConfideHomeRecentView(parent.context, confideHomeEvent))
val recyclerView = RecyclerView(parent.context)
recyclerView.layoutParams = ViewGroup.MarginLayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
).apply {
leftMargin = DisplayUtils.dip2px(parent.context, 4F)
rightMargin = DisplayUtils.dip2px(parent.context, 4F)
}
return RecentConfideHolder(recyclerView)
}
//分类
IConfideHomeConfig.TYPE_CATEGORY -> {
return CategoryViewHolder(ConfideHomeCategoryView(parent.context, confideHomeEvent, confideHomeView))
}
// IConfideHomeConfig.TYPE_CATEGORY -> {
// return CategoryViewHolder(ConfideHomeCategoryView(parent.context, confideHomeEvent, confideHomeView))
// }
//筛选模块
IConfideHomeConfig.TYPE_RECOMMEND_FILTER -> {
return FilterViewHolder(ConfideHomeFilterView(parent.context, confideHomeView))
......@@ -92,6 +103,17 @@ class ConfideHomeAdapter(private val mContext: Context,
IConfideHomeConfig.TYPE_RECOMMEND -> {
return RecommendViewHolder(ConfideHomeRecommendView(confideHomeView, parent.context, confideHomeEvent))
}
IConfideHomeConfig.TYPE_VIDEO_SHOW -> {
val recyclerView = RecyclerView(parent.context)
recyclerView.layoutParams = ViewGroup.MarginLayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
).apply {
leftMargin = DisplayUtils.dip2px(parent.context, 6F)
rightMargin = DisplayUtils.dip2px(parent.context, 6F)
}
return VideoShowHolder(recyclerView)
}
// //听声寻人
// IConfideHomeConfig.TYPE_SOUND -> {
//// return ConfideHomeListenAndFoundViewHolder(ConfideHomeListenAndFoundView(parent.context, confideHomeEvent))
......@@ -103,25 +125,35 @@ class ConfideHomeAdapter(private val mContext: Context,
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) =
if (holder is BannerViewHolder && null != holder.bannerView) {
/*if (holder is BannerViewHolder && null != holder.bannerView) {
//banner
holder.bannerView!!.initData(mListData!![position])
} else if (holder is CategoryViewHolder && null != holder.categoryView) {
//分类
holder.categoryView!!.initData(mListData!![position])
} else if (holder is FilterViewHolder && null != holder.filterView) {
} else */if (holder is FilterViewHolder && null != holder.filterView) {
mFilterViewHolder = holder
//筛选模块
holder.filterView.initData(mListData!![position])
} else if (holder is ConfideHomeListenAndFoundViewHolder) {
//听声寻人
// holder.confideHomeListenAndFoundView!!.initData(mListData!![position])
} else if (holder is ConsultViewHolder && null != holder.consultView) {
//最近倾诉
holder.consultView!!.initData(mListData!![position])
} else if (holder is RecentConfideHolder) {
//最近倾诉
holder.rv.layoutManager =
LinearLayoutManager(holder.itemView.context, RecyclerView.HORIZONTAL, false)
val recentBody = mListData!![position].body
val data = recentBody?.map { ItemVideoShowViewModel().mapOf(it) } ?: emptyList()
holder.rv.adapter = RecentConfideAdapter(data, confideHomeEvent)
// holder.consultView!!.initData(mListData!![position])
} else if (holder is RecommendViewHolder && null != mListData!![position] && null != mListData!![position].body && !mListData!![position].body!!.isEmpty()) {
//为你推荐
holder.confideHomeRecommendView.initData(mListData!![position].body!![0], position, mListData!![position].recommendId)
} else if (holder is VideoShowHolder) {
holder.rv.layoutManager =
LinearLayoutManager(holder.itemView.context, RecyclerView.HORIZONTAL, false)
val recentBody = mListData!![position].body
holder.rv.adapter = VideoShowAdapter(recentBody, confideHomeEvent)
} else if (holder is EmptyViewHolder) {
} else {
......@@ -184,4 +216,6 @@ class ConfideHomeAdapter(private val mContext: Context,
view = itemView
}
}
class VideoShowHolder(val rv: RecyclerView) : RecyclerView.ViewHolder(rv)
class RecentConfideHolder(val rv: RecyclerView) : RecyclerView.ViewHolder(rv)
}
\ No newline at end of file
package com.ydl.confide.home.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ObservableField
import androidx.databinding.ObservableInt
import androidx.recyclerview.widget.RecyclerView
import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemConfideHomeRecentBinding
import com.ydl.confide.databinding.ItemVideoShowBinding
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.intro.BindingViewHolder
import com.ydl.ydlcommon.base.config.HttpConfig
class VideoShowAdapter(private val data: List<ConfideHomeBodyBean>?, private val event: IConfideHomeEvent) :
RecyclerView.Adapter<BindingViewHolder<ItemVideoShowBinding>>() {
private val dataList: List<ItemVideoShowViewModel> = data?.map { ItemVideoShowViewModel().mapOf(it) } ?: emptyList()
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): BindingViewHolder<ItemVideoShowBinding> {
val layoutInflater = LayoutInflater.from(parent.context)
val binding =
DataBindingUtil.inflate<ItemVideoShowBinding>(layoutInflater, R.layout.item_video_show, parent, false)
return BindingViewHolder(binding)
}
override fun onBindViewHolder(holder: BindingViewHolder<ItemVideoShowBinding>, position: Int) {
val itemVideoShowViewModel = dataList[position]
holder.binding.item = itemVideoShowViewModel
holder.itemView.setOnClickListener { event.videoShowClick(position, data) }
}
override fun getItemCount() = dataList.size
}
class RecentConfideAdapter(val data: List<ItemVideoShowViewModel>, private val event: IConfideHomeEvent) :
RecyclerView.Adapter<BindingViewHolder<ItemConfideHomeRecentBinding>>() {
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): BindingViewHolder<ItemConfideHomeRecentBinding> {
val layoutInflater = LayoutInflater.from(parent.context)
val binding =
DataBindingUtil.inflate<ItemConfideHomeRecentBinding>(
layoutInflater,
R.layout.item_confide_home_recent,
parent,
false
)
return BindingViewHolder(binding)
}
override fun onBindViewHolder(holder: BindingViewHolder<ItemConfideHomeRecentBinding>, position: Int) {
val itemVideoShowViewModel = data[position]
holder.binding.item = itemVideoShowViewModel
holder.itemView.setOnClickListener { event.consultantClick(itemVideoShowViewModel.linkUrl,itemVideoShowViewModel.doctorId) }
}
override fun getItemCount() = data.size
}
class ItemVideoShowViewModel {
var linkUrl: String? = null
val name = ObservableField<String>("")
val coverUrl = ObservableField<String>("")
val videoCoverUrl = ObservableField<String>("")
val state = ObservableInt()
var doctorId: String? = null
}
internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoShowViewModel {
name.set(bean.confidedName)
coverUrl.set(bean.confidedIcon)
videoCoverUrl.set(bean.coverVideoPicture)
state.set(bean.confideLine ?: 0)
doctorId = bean.doctorId
doctorId?.let {
linkUrl = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)
}
return this
}
......@@ -39,7 +39,8 @@ data class ConfideHomeBodyBean(
//副标题(底部更多文案)
val subTitle : String?,
//咨询师标题
val confidedTitle:String?,
val confidedTitle: String?,
val title: String?,
//副标题点击事件
val subLinkUrl : String?,
//咨询师背景图片
......@@ -50,6 +51,9 @@ data class ConfideHomeBodyBean(
val couponMoney : String?,
//新用户优惠文案
val couponText : String?,
val videoUrl: String?,
val coverVideoPicture: String?,
val coverPicture: String?,
/**
* banner数据
*/
......@@ -115,5 +119,7 @@ data class ConfideHomeBodyBean(
//接通率
val confideConnection : String?,
//
var bodyData : List<ConfideHomeBodyBean>?
var bodyData : List<ConfideHomeBodyBean>?,
var confidePraiseScore:String?,//新增评分字段
var listenFree:Boolean?//新增倾诉免费标识字段
)
\ No newline at end of file
......@@ -30,8 +30,4 @@ data class ConfideHomeDataBean(
/**
* 为你推荐Id 本地使用 用于区分音频播放区域
*/
var recommendId : Int,
/**
* 是否显示分割线 0.不显示 1.显示
*/
val diviLine : Int?)
\ No newline at end of file
var recommendId : Int)
\ No newline at end of file
package com.ydl.confide.home.bean
class DialStatus {
var confideLine: Int? = null
var remainingTime: RemainingTime? = null
}
class RemainingTime {
var remainingTime: Long? = null//秒
var listenerUid: String? = null
var listenOrderId: String? = null
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ interface IConfideHomeConfig{
const val TYPE_RECOMMEND_FILTER = 4
const val TYPE_RECOMMEND = 5
const val TYPE_SOUND = 6
const val TYPE_CONSULTANT = 7
const val TYPE_VIDEO_SHOW = 7
const val TYPE_FOOTER = 999
/**
* section id. 与上面相对应
......
......@@ -87,10 +87,6 @@ interface IConfideHomeContract{
interface Presenter : IPresenter<View> {
/**
* 加载本地缓存
*/
fun loadLocalData(context: Context)
/**
* 倾诉首页数据请求
*/
fun confideHomeRequest(isRefresh:Boolean = true)
......
package com.ydl.confide.home.event
data class ChangeAnotherExpertEvent(
var doctorID:String,
var title:String,
var uid:String
)
\ No newline at end of file
......@@ -4,9 +4,13 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.appcompat.app.AppCompatActivity
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import com.alibaba.fastjson.JSON
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
......@@ -27,11 +31,14 @@ import com.ydl.media.view.PlayerFloatView
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.route
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMRequestCallback
/**
* @author yuanwai
* @描述:倾诉首页事件处理类
......@@ -125,8 +132,16 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址
*/
override fun consultantClick(linkUrl: String?) {
link(linkUrl)
override fun consultantClick(linkUrl: String?, doctorId: String?) {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(mContext as FragmentActivity, HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(doctorId.toString()), doctorId!!)
}
override fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?) {
val dataJson = if (data != null) JSON.toJSONString(data) else null
pauseVoice()
route(mContext, ConfideRoute.R_VIDEO_SHOW, "initPos" to index, "initData" to dataJson)
}
/**
......@@ -154,10 +169,11 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
initConfidePlayerListener()
}
override fun playVoice(type: Int?, index: Int?, recommendId: Int, playUrl: String?, name: String?) {
override fun playVoice(type: Int?, index: Int?, recommendId: Int, playUrl: String?, name: String?,confideIcon:String?) {
val mu = Music()
mu.title = name
mu.path = playUrl
mu.coverPath=confideIcon
AudioPlayer.get().singlePlay(mu)
if (PlayerFloatHelper.isShow(mContext!!)) {
if (AudioPlayer.get().playMode.value() == 1) {
......@@ -215,9 +231,6 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
//听声寻人
IConfideHomeConfig.TYPE_SOUND -> {
}
//咨询师推荐
IConfideHomeConfig.TYPE_CONSULTANT -> {
}
}
}
......
......@@ -73,7 +73,9 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址
*/
fun consultantClick(linkUrl: String?)
fun consultantClick(linkUrl: String?,doctorId: String?)
fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?)
/**
* 咨询师推荐--更多情感恋爱专家
......@@ -97,7 +99,7 @@ interface IConfideHomeEvent {
* @param playUrl 播放地址
* @param name 咨询师姓名
*/
fun playVoice(type: Int?, index: Int?, recommendId: Int, playUrl: String?, name: String?)
fun playVoice(type: Int?, index: Int?, recommendId: Int, playUrl: String?, name: String?,confideIcon:String?)
/**
* 重播
......
......@@ -2,6 +2,7 @@ package com.ydl.confide.home.http
import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.bean.DialStatus
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
......@@ -33,4 +34,16 @@ interface ConfideHomeApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("auth/listen/dial")
fun connectJava(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<ConfideConnectResponse>>
// 1=在线 3-通话中 2-离线
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("auth/listen/dialchangestatus")
fun getDialStatus(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<DialStatus>>
@GET
fun recommendDoctor(
@Url url: String,
@Query("page") page: Int,
@Query("businessSource") source: Int
): Observable<BaseAPIResponse<ConfideHomeDataBean>>
}
\ No newline at end of file
......@@ -35,7 +35,7 @@ class ConfideHomeHttpImpl private constructor() : IConfideHomeHttp {
override fun confideHomeRequest(): Observable<BaseAPIResponse<MutableList<ConfideHomeDataBean>>> {
return RxUtils.mapObservable(ConfideHomeParam(0))
.flatMap {
confideHomeApi.confideHome(HttpConfig.JAVA_BASE_URL + "auth/listen/home", 2)
confideHomeApi.confideHome(HttpConfig.JAVA_BASE_URL + "auth/listen/nhome?listenVersion=2.0", 2)
}
}
......
......@@ -2,6 +2,7 @@ package com.ydl.confide.home.listener
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ydl.confide.home.widget.ConfideHomeFilterView
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
......@@ -51,7 +52,9 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
fun moveToPosition(mRecyclerView: RecyclerView){
mRecyclerView.scrollBy(0, 1)
var top = mRecyclerView.getChildAt(mIndex).top
val childAt = mRecyclerView.getChildAt(mIndex)
if (childAt !is ConfideHomeFilterView) return
val top = childAt.top
if(top==0 || top==1){
//已滚动到顶部
......
......@@ -5,20 +5,20 @@ import android.app.Application
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.fragment.app.DialogFragment
import android.text.TextUtils
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.RxSPTool
import com.yidianling.common.tools.ToastUtil
/**
* Created by haorui on 2019-12-11 .
......@@ -116,5 +116,8 @@ class ConfdieServiceImpl : IConfideService {
}
override fun showExpertDetailDialog(activity: FragmentActivity, jumpUrl: String, doctorId: String) {
ConfideBottomSheetDialogFragment().showBottomSheetDialog(activity, jumpUrl, doctorId, false)
}
}
\ No newline at end of file
package com.ydl.confide.home.util
import android.content.Context
import androidx.core.content.ContextCompat
import androidx.appcompat.widget.AppCompatTextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import android.view.animation.AnimationUtils
import android.view.animation.LinearInterpolator
import android.widget.ImageView
import androidx.appcompat.widget.AppCompatTextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
......@@ -84,32 +84,12 @@ class ConfideHomeUtils {
* 数据重组
*/
fun resetData(list: MutableList<ConfideHomeDataBean>, filterView: ConfideHomeFilterView, listScrollListener: ConfideHomeRecycleViewListener) {
val recommendList: MutableList<ConfideHomeDataBean> = ArrayList()
var soundDataBean: ConfideHomeDataBean? = null
for ((index, dataBean) in list.withIndex().reversed()) {
for ((index, dataBean) in list.withIndex()) {
//给隐藏的为你推荐筛选view赋值
if (dataBean.type == IConfideHomeConfig.TYPE_RECOMMEND_FILTER) {
listScrollListener.setFilterIndex(index)
filterView.initData(dataBean)
}
//拆分为你推荐数据
if (dataBean.type == IConfideHomeConfig.TYPE_RECOMMEND) {
//如果是为你推荐数据 则进行筛分
recommendList.addAll(getRecommendList(dataBean))
//移除当前 为你推荐数据
list.removeAt(index)
}
//移除听声寻人数据 放在最后
if (dataBean.type == IConfideHomeConfig.TYPE_SOUND) {
soundDataBean = ConfideHomeDataBean(dataBean.type, dataBean.body, dataBean.head, dataBean.footer, dataBean.recommendId, dataBean.diviLine)
list.removeAt(index)
}
}
//添加 拆分后的 为你推荐数据
list.addAll(recommendList)
//添加 听声寻人 数据
if (null != soundDataBean) {
list.add(soundDataBean)
}
}
......@@ -124,7 +104,7 @@ class ConfideHomeUtils {
for (bodyBean in dataBean.body) {
val bodyList: MutableList<ConfideHomeBodyBean> = ArrayList()
bodyList.add(bodyBean)
val recommendDataBean = ConfideHomeDataBean(dataBean.type, bodyList, dataBean.head, dataBean.footer, dataBean.recommendId, dataBean.diviLine)
val recommendDataBean = ConfideHomeDataBean(dataBean.type, bodyList, dataBean.head, dataBean.footer, dataBean.recommendId)
list.add(recommendDataBean)
}
return list
......@@ -174,12 +154,6 @@ class ConfideHomeUtils {
section.setData(resultBean)
mConfideAdapter?.addSection(section)
}
//最佳倾诉榜单 todo 产品说先隐藏掉
IConfideHomeConfig.TYPE_CONSULTANT -> {
// var section = ConfideHomeRecommendExpertSection(context,mConfideEvent)
// section.setData(resultBean)
// mConfideAdapter?.addSection(section)
}
//为你推荐筛选模块
IConfideHomeConfig.TYPE_RECOMMEND_FILTER -> {
var section = ConfideHomeFilterSection(context, view)
......@@ -254,10 +228,6 @@ class ConfideHomeUtils {
IConfideHomeConfig.TYPE_SOUND -> {
listenAndFoundData = resultBean
}
//最佳倾听榜单
IConfideHomeConfig.TYPE_CONSULTANT -> {
recommendExpertData = resultBean
}
}
}
......
package com.ydl.confide.home.util
import android.widget.TextView
import androidx.databinding.BindingAdapter
import com.ydl.confide.R
@BindingAdapter("confideLineText")
fun TextView.confideLineText(line: Int) {
when (line) {
1 -> {
text = "立即拨打"
}
2 -> {
text = "已离线"
}
3 -> {
text = "通话中"
}
4->{
text = "继续倾诉"
}
}
}
@BindingAdapter("confideLineRecentText")
fun TextView.confideLineRecentText(line: Int) {
when (line) {
1 -> {
text = "空闲"
setBackgroundResource(R.drawable.confide_bg_main_color)
}
2 -> {
text = "离线"
setBackgroundResource(R.drawable.confide_bg_color_666666)
}
3 -> {
text = "通话中"
setBackgroundResource(R.drawable.confide_bg_color_ff8f38)
}
else ->{
text = ""
background = null
}
}
}
\ No newline at end of file
......@@ -153,7 +153,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
if (confideIsPlay) {
confideHomeEvent.pauseVoice()
} else {
confideHomeEvent.playVoice(IConfideHomeConfig.TYPE_CONSULTANT, position, bodyBean.confideVoice)
confideHomeEvent.playVoice(IConfideHomeConfig.TYPE_VIDEO_SHOW, position, bodyBean.confideVoice)
}
}
}
......@@ -243,7 +243,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
private fun click(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 3, 4 -> {
confideHomeEvent.consultantClick(bodyBean.linkUrl)
confideHomeEvent.consultantClick(bodyBean.linkUrl,bodyBean.doctorId)
}
2 -> {
//跳转私聊 并发送自定义消息
......
......@@ -2,7 +2,6 @@ package com.ydl.confide.home.widget
import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.text.TextUtils
import android.util.TypedValue
import android.view.Gravity
......@@ -11,14 +10,17 @@ import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.TextView
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.blankj.utilcode.util.SpanUtils
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.ydl.confide.R
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import kotlinx.android.synthetic.main.confide_recommend_view.view.*
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_recommend_view_new.view.*
/**
* @author yuanwai
......@@ -41,7 +43,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.confide_recommend_view, this)
View.inflate(context, R.layout.confide_recommend_view_new, this)
dp96 = RxImageTool.dip2px(96f)
dp16 = RxImageTool.dip2px(16f)
dp4 = RxImageTool.dip2px(4f)
......@@ -63,25 +65,47 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
//设置名称
tv_name.text = bodyBean.confidedName
//设置性别
setSex(bodyBean)
// setSex(bodyBean)
//设置向TA倾诉文案
setConfideNum(bodyBean)
//设置接通率文案
setConnection(bodyBean)
//设置价格
setPrice(bodyBean)
// setPrice(bodyBean)
//设置红包、原价
setCoupon(bodyBean)
// setCoupon(bodyBean)
//设置标签
setConfideTag(bodyBean)
//设置咨询师简介
tv_content.text = bodyBean.confideContent
//设置向TA倾诉按钮状态
setConfideButton(bodyBean)
setListenAndScore(bodyBean)
//设置页面点击事件
this.setOnClickListener {
confideHomeEvent.consultantClick(bodyBean.linkUrl)
confideHomeEvent.consultantClick(bodyBean.linkUrl,bodyBean.doctorId)
}
}
private fun setListenAndScore(bodyBean: ConfideHomeBodyBean) {
SpanUtils.with(price_content).append(bodyBean.confideFee.toString())
.setForegroundColor(resources.getColor(R.color.confide_fe6040)).setFontSize(18, true)
.append("元").setForegroundColor(resources.getColor(R.color.confide_fe6040))
.setFontSize(11, true)
.append("/25分钟").setForegroundColor(resources.getColor(R.color.confide_aaaeba))
.setFontSize(11, true)
.create()
tv_score.text = bodyBean.confidePraiseScore
if (bodyBean.listenFree == true) {
confide_free_logo.visibility = VISIBLE
Glide.with(context)
.load(R.drawable.confide__free)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(confide_free_logo)
} else {
confide_free_logo.visibility = GONE
}
}
......@@ -141,7 +165,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if (bodyBean.confideIsPlay!!) {
confideHomeEvent.pauseVoice()
} else {
confideHomeEvent.playVoice(IConfideHomeConfig.TYPE_RECOMMEND, position, recommendId, bodyBean.confideVoice, bodyBean.confidedName)
confideHomeEvent.playVoice(IConfideHomeConfig.TYPE_RECOMMEND, position, recommendId, bodyBean.confideVoice, bodyBean.confidedName,bodyBean.confidedIcon)
}
}
}
......@@ -149,13 +173,13 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
* 设置性别
*/
private fun setSex(bodyBean: ConfideHomeBodyBean) {
/*private fun setSex(bodyBean: ConfideHomeBodyBean) {
if (bodyBean.confideSex == 1) {
img_sex.setImageResource(R.drawable.confide_new_male)
} else {
img_sex.setImageResource(R.drawable.confide_new_female)
}
}
}*/
/**
* 设置向TA倾诉文案
......@@ -188,15 +212,15 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
* 设置价格
*/
private fun setPrice(bodyBean: ConfideHomeBodyBean) {
val sb = StringBuffer()
if (TextUtils.isEmpty(bodyBean.confideFee)) {
sb.append("0")
} else {
sb.append(bodyBean.confideFee)
}
tv_price.text = sb.toString()
}
// private fun setPrice(bodyBean: ConfideHomeBodyBean) {
// val sb = StringBuffer()
// if (TextUtils.isEmpty(bodyBean.confideFee)) {
// sb.append("0")
// } else {
// sb.append(bodyBean.confideFee)
// }
// tv_price.text = sb.toString()
// }
/**
* 设置标签 todo 待优化
......@@ -255,7 +279,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
/**
* 设置红包、原价
*/
private fun setCoupon(bodyBean: ConfideHomeBodyBean) {
/*private fun setCoupon(bodyBean: ConfideHomeBodyBean) {
if (!TextUtils.isEmpty(bodyBean.couponText)) {
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
......@@ -286,7 +310,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
}
}
}
}*/
/**
* 点击事件
......@@ -299,7 +323,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if (bodyBean.confideLine == 3) {
}
confideHomeEvent.consultantClick(bodyBean.linkUrl)
confideHomeEvent.consultantClick(bodyBean.linkUrl,bodyBean.doctorId)
}
2 -> {
//跳转私聊 并发送自定义消息
......
package com.ydl.confide.home.widget
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView
class FilterItemDecoration : RecyclerView.ItemDecoration() {
private val bounds = Rect()
private val paint = Paint().apply {
color = Color.parseColor("#EFEFF1")
strokeWidth = 1F
}
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
if (view is ConfideHomeFilterView) {
outRect.set(0, 0, 0, 1)
}
}
override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
val count = parent.childCount
for (i in 0 until count) {
val child = parent.getChildAt(i)
if (child is ConfideHomeFilterView) {
parent.getDecoratedBoundsWithMargins(child, bounds)
c.drawLine(
bounds.left.toFloat(),
bounds.top.toFloat(),
bounds.right.toFloat(),
bounds.top.toFloat(),
paint
)
c.drawLine(
bounds.left.toFloat(),
bounds.bottom.toFloat(),
bounds.right.toFloat(),
bounds.bottom.toFloat(),
paint
)
}
}
}
}
\ No newline at end of file
package com.ydl.confide.intro
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.viewpager2.widget.ViewPager2
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.alibaba.fastjson.JSON
import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ActivityExpertIntroBinding
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.base.config.HttpConfig.Companion.YDL_H5
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.api.service.IUserService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
@Route(path = ConfideRoute.R_VIDEO_SHOW)
class ExpertIntroActivity : AppCompatActivity() {
companion object {
private const val SOURCE_VIDEO = 10
}
private val tag = javaClass.simpleName
@Autowired
@JvmField
var initPos: Int = 0
@Autowired
@JvmField
var initData: String? = null
private var lastSelectPos = 0
private lateinit var binding: ActivityExpertIntroBinding
private lateinit var adapter: IntroAdapter
private var page = 1
private var disposable: Disposable? = null
private val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
private val data = mutableListOf<VideoViewModel>()
private var noMoreData = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ARouter.getInstance().inject(this)
binding = DataBindingUtil.setContentView(this, R.layout.activity_expert_intro)
if (Build.VERSION.SDK_INT >= 21) {
val decorView = window.decorView
val option = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
decorView.systemUiVisibility = option
window.statusBarColor = Color.TRANSPARENT
}
if (initData != null) {
val beans = JSON.parseArray(initData, ConfideHomeBodyBean::class.java)
val isLogin = findRouteService(IUserService::class.java)?.isLogin() ?: false
val vms = beans.map {
VideoViewModel().mapOf(it).apply { showFreeTag.set(!isLogin) }
}
data.addAll(vms)
}
binding.ivBack.setOnClickListener { onBackPressed() }
binding.tvConfideRecord.setOnClickListener {
if (!PhoneCallIn.loginByOneKeyLogin(this, true)) {
return@setOnClickListener
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "倾诉记录")
.burryPoint("mine")
val h5Paramsqing = H5Params(YDL_H5 + "confideOrderList", null)
NewH5Activity.start(this, h5Paramsqing)
}
binding.viewPager.orientation = ViewPager2.ORIENTATION_VERTICAL
binding.viewPager.offscreenPageLimit = 1
adapter = IntroAdapter(this, data, this)
binding.viewPager.adapter = adapter
binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
adapter.onSelect(position)
if (position == data.size - 1 && lastSelectPos < position) {
loadMore()
}
lastSelectPos = position
}
})
adapter.checkNetwork()
binding.viewPager.currentItem = initPos
}
private fun loadMore() {
if (disposable != null && !disposable!!.isDisposed) {
return
}
if (noMoreData) return
disposable = confideApi.recommendDoctor(HttpConfig.JAVA_BASE_URL + "auth/listen/nsearch?", page, SOURCE_VIDEO)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
if (resp.code == "200") {
page++
val body = resp.data.body
val isLogin = findRouteService(IUserService::class.java)?.isLogin() ?: false
val map = body?.map { VideoViewModel().mapOf(it).apply { showFreeTag.set(!isLogin) } }
map?.let {
data.addAll(it)
adapter.notifyItemRangeInserted(data.size - it.size, it.size)
}
if (body == null || body.size == 0) {
noMoreData = true
}
} else {
ToastUtil.toastShort(resp.msg)
}
}, { throwable ->
LogUtil.e(tag, throwable.message)
})
}
override fun onDestroy() {
super.onDestroy()
disposable?.dispose()
}
}
\ No newline at end of file
package com.ydl.confide.intro
import android.app.Activity
import android.content.Context
import android.net.Uri
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.OnLifecycleEvent
import androidx.recyclerview.widget.RecyclerView
import com.dou361.ijkplayer.widget.IjkVideoView
import com.ydl.confide.R
import com.ydl.confide.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.home.util.ConfideNetworkUtil
import com.ydl.ydlcommon.utils.TimeUtil
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.ToastUtil
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
internal class IntroAdapter(
private val context: Context,
private val data: List<VideoViewModel>,
private val lifecycleOwner: LifecycleOwner
) : RecyclerView.Adapter<ItemIntroHolder>(), LifecycleObserver {
private val videoViews = hashMapOf<Int, IjkVideoView>()
private var hasAgreePlayWithoutWiFi = false
private var curPos = 0
private var dispose: Disposable? = null
init {
lifecycleOwner.lifecycle.addObserver(this)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemIntroHolder {
val binding = DataBindingUtil.inflate<ItemExpertIntroBinding>(
LayoutInflater.from(parent.context),
R.layout.item_expert_intro,
parent,
false
)
return ItemIntroHolder(binding)
}
override fun onBindViewHolder(holder: ItemIntroHolder, position: Int) {
val item = data[position]
holder.onBind(item)
holder.binding.item = item
}
override fun onViewAttachedToWindow(holder: ItemIntroHolder) {
val adapterPosition = holder.adapterPosition
val videoView = IjkVideoView(context)
val playUrl = data[adapterPosition].playUrl
if (!playUrl.isNullOrBlank()) {
if (hasAgreePlayWithoutWiFi || ConfideNetworkUtil.isWifi(context)) {
videoView.setVideoURI(Uri.parse(playUrl))
if (curPos == adapterPosition) {
videoView.start()
}
} else {
videoView.tag = playUrl
}
}
videoViews.put(adapterPosition, videoView)
holder.onAttach(videoView)
}
internal fun checkNetwork() {
if (!ConfideNetworkUtil.isWifi(context)) {
val dialog = CommonDialog.create(context)
.setTitle(context.getString(R.string.confide_tip))
.setMessage(context.getString(R.string.confide_video_wifi_tip))
.setLeftOnclick("继续播放") {
hasAgreePlayWithoutWiFi = true
for (entry in videoViews.entries) {
val value = entry.value
val playUrl = value.tag as? String
if (!playUrl.isNullOrBlank()) {
value.setVideoURI(Uri.parse(playUrl))
if (curPos == entry.key) {
value.start()
}
}
}
}
.setLeftButton_color(R.color.platform_but_text_color_selected)
.setRightButton_color(R.color.platform_text_bright_color)
.setRightClick("取消") {
if (context is Activity) {
context.onBackPressed()
}
}
.setCancelAble(true)
dialog.setOnCancelListener {
if (context is Activity) {
context.onBackPressed()
}
}
dialog.show()
}
}
override fun onViewDetachedFromWindow(holder: ItemIntroHolder) {
super.onViewDetachedFromWindow(holder)
val adapterPosition = holder.adapterPosition
val video = videoViews.get(adapterPosition)
video?.release(true)
videoViews.remove(adapterPosition)
holder.onDetach()
}
override fun getItemCount(): Int {
return data.size
}
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
private fun onDestroy() {
for (entry in videoViews.entries) {
entry.value.release(true)
}
}
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
private fun onResume() {
val ijkVideoView = videoViews[curPos]
ijkVideoView?.start()
}
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
private fun onPause() {
val ijkVideoView = videoViews[curPos]
ijkVideoView?.pause()
}
fun onSelect(position: Int) {
curPos = position
onLoadDialStatus(position)
if (!ConfideNetworkUtil.isWifi(context) && !hasAgreePlayWithoutWiFi) {
return
}
for (entry in videoViews.entries) {
if (entry.key == position) {
// entry.value.seekTo(0)
entry.value.start()
} else {
entry.value.seekTo(0)
entry.value.pause()
}
}
}
private fun onLoadDialStatus(position: Int) {
val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
val curUid = data[position].uid
if (curUid != null) {
dispose?.dispose()
dispose = confideApi.getDialStatus(curUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
if (resp.code == "200") {
val lineStatus = resp.data?.confideLine ?: 2
if (lineStatus == 4) {//继续倾诉
val t = resp?.data?.remainingTime?.remainingTime
if (t != null) {
val remain = TimeUtil.getElapseTimeForShow(t * 1000)
data[position].remainingTime.set(
context.getString(
R.string.confide_tip_remain_time,
remain
)
)
}
}
data[position].lineStatus.set(lineStatus)
} else {
if (!resp.msg.isNullOrEmpty()) {
ToastUtil.toastShort(resp.msg)
}
}
}, { throwable -> throwable.printStackTrace() })
}
}
}
\ No newline at end of file
package com.ydl.confide.intro
import android.app.Activity
import android.util.Log
import android.view.View
import android.widget.SeekBar
import androidx.databinding.ObservableBoolean
import androidx.databinding.ObservableField
import androidx.databinding.ObservableInt
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.dou361.ijkplayer.widget.IjkVideoView
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.view.dialog.YDLShareDialog
import com.yidianling.im.api.service.IImService
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.net.URLEncoder
import java.util.concurrent.TimeUnit
internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
BindingViewHolder<ItemExpertIntroBinding>(binding) {
companion object {
private const val TAG = "ItemIntroHolder"
}
private var disposable: Disposable? = null
private var video: IjkVideoView? = null
private var vm: VideoViewModel? = null
@Volatile
private var isTouch = false
fun onDetach() {
stopTiming()
video?.release(true)
}
fun onBind(item: VideoViewModel) {
vm = item
binding.layoutCall.setOnClickListener {
showDoctorDetail(item)
}
binding.btnChat.setOnClickListener {
val aty = it.context as? Activity
if (aty != null && !item.uid.isNullOrEmpty()) {
findRouteService(IImService::class.java)?.startChat(aty, item.uid!!, 0, 0)
}
}
binding.btnEvaluate.setOnClickListener {
item.doctorId?.let {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
itemView.context as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ExpertEval(it),
it
)
}
}
binding.tvName.setOnClickListener {
showDoctorDetail(item)
}
binding.ivAvatar.setOnClickListener {
showDoctorDetail(item)
}
binding.vDisableClick.setOnClickListener { }
binding.btnShare.setOnClickListener {
val aty = it.context as? Activity
if (aty != null) {
var shareUrl = "${HttpConfig.MH5_URL}experts/${item.doctorId}"
if (!item.confideId.isNullOrBlank()) {
shareUrl += "?id=${item.confideId}"
}
val dialog = YDLShareDialog.style8(
aty, "${item.name.get()}_${item.title.get()}", shareUrl, "壹点灵心理服务平台让天下人更快乐", item.avatar.get(),
genMinProgramPath(shareUrl), "gh_25b90294ddcc"
)
dialog.show(aty.fragmentManager, "share")
}
}
binding.videoView.setOnClickListener {
if (video?.canPause() == true) {
video?.pause()
if (item.isVideo) {
binding.ivPlay.visibility = View.VISIBLE
} else {
binding.voicePlay.stop()
}
}
}
binding.ivPlay.setOnClickListener {
video?.start()
if (item.isVideo) {
binding.ivPlay.visibility = View.GONE
} else {
binding.voicePlay.start()
}
}
binding.voicePlay.setOnClickListener {
if (video?.isPlaying == true) {
video?.pause()
binding.voicePlay.stop()
} else if (video?.isPlaying == false) {
video?.start()
binding.voicePlay.start()
}
}
binding.seekbar.progress = 0
binding.seekbar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
isTouch = true
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
isTouch = false
if (seekBar != null) {
video?.seekTo(seekBar.progress)
video?.start()
binding.ivPlay.visibility = View.GONE
}
}
})
binding.voicePlay.visibility =
if (item.isVideo) View.GONE else if (item.playUrl.isNullOrBlank()) View.GONE else View.VISIBLE
}
fun onAttach(videoView: IjkVideoView) {
this.video = videoView
binding.videoView.addView(videoView)
video?.setOnPreparedListener { player ->
Log.d(TAG, "${player.videoHeight},${player.videoWidth},${player.duration}")
val duration = player.duration.toInt()
if (duration > 0) {
binding.seekbar.max = duration
} else {
binding.seekbar.visibility = View.GONE
}
}
video?.setOnInfoListener { mp, what, extra ->
Log.d(TAG, "OnInfo:${what},${extra}")
return@setOnInfoListener true
}
video?.setOnCompletionListener {
video?.seekTo(0)
video?.start()
}
video?.setOnErrorListener { player, what, extra ->
LogUtil.e(TAG, "onError:$what,$extra")
return@setOnErrorListener true
}
startTiming()
if (vm?.isVideo == false && !vm?.playUrl.isNullOrBlank()) {
binding.voicePlay.start()
}
}
private fun startTiming() {
disposable = Observable.interval(3, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.computation())
.subscribe {
val pos = (video?.mMediaPlayer as IjkMediaPlayer?)?.currentPosition ?: 0
if (pos > 0) {
if (vm?.isVideo == true) {
binding.ivCover.visibility = View.GONE
}
if (!isTouch) {
binding.seekbar.progress = pos.toInt()// video.bufferPercentage
}
if (video?.isPlaying == true) {
when (vm?.isVideo) {
true -> {
binding.ivPlay.visibility = View.GONE
}
false -> {
binding.voicePlay.start()
}
}
}
}
}
}
private fun stopTiming() {
disposable?.dispose()
}
private fun showDoctorDetail(item: VideoViewModel) {
if (!item.linkUrl.isNullOrBlank()) {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(itemView.context as FragmentActivity, item.linkUrl!!, item.doctorId!!)
}
}
}
class VideoViewModel {
val name = ObservableField<String>("")
val title = ObservableField<String>("")
val avatar = ObservableField<String>("")
val count = ObservableField<String>("")
val lineStatus = ObservableInt()
var remainingTime = ObservableField<String>("")
val intro = ObservableField<String>("")
val tag = ObservableField<String>("")
var playUrl: String? = null
val coverUrl = ObservableField<String>("")
val showFreeTag = ObservableBoolean(false)
var isVideo = false
var uid: String? = null
var doctorId: String? = null
var confideId: String? = null
var linkUrl: String? = null
}
private fun genMinProgramPath(url: String): String {
val pathPrefix = "/pages/web/web?load_url="
val encode = URLEncoder.encode(url, "UTF-8")
return pathPrefix + encode
}
internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
name.set(bean.confidedName)
avatar.set(bean.confidedIcon)
count.set("倾听人次 " + bean.confideNum)
intro.set(bean.confideContent)
title.set(bean.title)
val sb = StringBuilder()
bean.confidedTag?.forEach { sb.append(it).append(" | ") }
if (sb.isNotEmpty()) {
sb.setLength(sb.length - 3)
}
tag.set(sb.toString())
if (!bean.videoUrl.isNullOrEmpty()) {
playUrl = bean.videoUrl
isVideo = true
coverUrl.set(bean.coverVideoPicture)
} else {
playUrl = bean.confideVoice
isVideo = false
coverUrl.set(bean.coverPicture)
}
uid = bean.uid?.toString()
doctorId = bean.doctorId
confideId = bean.confidedId
doctorId?.let {
linkUrl = HttpConfig.MH5_URL + ConfideRoute.h5ExpertEval(it)
}
return this
}
open class BindingViewHolder<T : ViewDataBinding>(val binding: T) :
RecyclerView.ViewHolder(binding.root)
\ No newline at end of file
......@@ -5,6 +5,7 @@ import android.app.Application
import android.content.Context
import android.content.Intent
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.template.IProvider
interface IConfideService : IProvider {
......@@ -26,4 +27,10 @@ interface IConfideService : IProvider {
fun initYdlavManager(app: Application)
fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?)
fun showExpertDetailDialog(
activity: FragmentActivity,
jumpUrl: String,
doctorId: String
)
}
\ No newline at end of file
package com.ydl.confide.api
object ConfideRoute {
const val R_VIDEO_SHOW = "confide/expert_video"
fun h5ConfideIntro(id: String) = "jy/listenMask?listenerId=${id}"
fun h5ExpertEval(id: String) = "comment/evaList/${id}?listenerId=${id}"
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
<solid android:color="#FF4A4A" />
<stroke
android:width="1dp"
android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#90666666" />
<solid android:color="#BBC1CD" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#90FF8F38"/>
<solid android:color="#FF994B"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#901da1f2" />
<solid android:color="#701da1f2" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="@dimen/confide_dp_4"
/>
<solid android:color="#d1d1d1"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
<corners android:topLeftRadius="15dp" android:topRightRadius="15dp" />
</shape>
</item>
</selector>
\ No newline at end of file
......@@ -3,7 +3,7 @@
android:shape="rectangle">
<corners
android:radius="4dp"/>
android:radius="8dp"/>
<solid android:color="#eaffffff"/>
......
......@@ -3,9 +3,9 @@
android:shape="rectangle">
<gradient
android:startColor="@color/platform_main_gradient_end_color"
android:endColor="@color/platform_main_gradient_start_color"/>
android:startColor="@color/confide_61CEAC"
android:endColor="@color/confide_48CC95"/>
<corners android:radius="15dp" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="26dp" />
<gradient
android:endColor="#48CC95"
android:startColor="#61CEAC" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="26dp" />
<gradient
android:endColor="#BBC1CD"
android:startColor="#D5D6D7" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="26dp" />
<gradient
android:endColor="#FF994B"
android:startColor="#F6B37F" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="26dp" />
<gradient
android:endColor="#4BAFEC"
android:startColor="#65C4FF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%" android:pivotY="50%"
android:fromDegrees="0"
android:toDegrees="360">
<shape
android:shape="ring"
android:innerRadiusRatio="3"
android:thicknessRatio="8"
android:useLevel="false">
<gradient
android:type="sweep"
android:useLevel="false"
android:startColor="#ffffff"
android:centerColor="#ffffff"
android:centerY="0.50"
android:endColor="@color/transparent" />
</shape>
</animated-rotate>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="3dp"/>
<solid android:color="@color/platform_main_theme" />
<solid android:color="#701da1f2" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<selector>
<item android:state_pressed="true">
<shape>
<corners android:radius="4dp" />
<solid android:color="#59FFFFFF" />
<stroke android:width="1dp" android:color="@color/transparent"/>
</shape>
</item>
<item>
<shape>
<corners android:radius="4dp" />
<solid android:color="#59FFFFFF" />
<stroke android:width="3dp" android:color="@color/transparent"/>
</shape>
</item>
</selector>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<corners android:radius="4dp" />
<solid android:color="@color/white" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<selector>
<item android:state_pressed="true">
<clip>
<shape>
<corners android:radius="4dp" />
<solid android:color="@color/white" />
<stroke android:width="1dp" android:color="@color/transparent"/>
</shape>
</clip>
</item>
<item>
<clip>
<shape>
<corners android:radius="4dp" />
<solid android:color="@color/white" />
<stroke android:width="3dp" android:color="@color/transparent"/>
</shape>
</clip>
</item>
</selector>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<size android:width="6dp" android:height="8dp" />
<corners android:radius="2dp" />
</shape>
</item>
<item android:state_pressed="false">
<shape android:shape="oval">
<solid android:color="@color/white" />
<size android:width="8dp" android:height="8dp" />
<stroke android:width="2dp" android:color="@color/transparent" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivBack"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="24dp"
android:padding="12dp"
android:src="@drawable/confide_back"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shape="@{1}"
app:shapeBg="@{0x33000000}"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tvConfideRecord"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:drawableLeft="@drawable/ic_confide_record"
android:drawablePadding="4dp"
android:gravity="center"
android:padding="8dp"
android:paddingHorizontal="8dp"
android:paddingVertical="5dp"
android:text="倾诉记录"
android:textColor="@color/white"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@+id/ivBack"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/ivBack"
app:shapeBg="@{0x26000000}"
app:shapeRadius="@{15}"
app:shapeStrokeWidth="@{1}"
app:shapeStrokeColor="@{0xFFFFFFFF}" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:layout_marginStart="@dimen/platform_dp_15"
android:layout_marginEnd="@dimen/platform_dp_15"
android:background="@color/transparent"
android:gravity="center_horizontal"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layoutCall"
android:layout_width="150dp"
android:layout_height="42dp"
android:layout_marginBottom="32dp"
android:background="@drawable/confide_line_bg_1"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/layoutChange"
>
<ImageView
android:id="@+id/ivCall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="4dp"
android:src="@drawable/ic_confide_call"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/tvCall"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvCall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="继续倾诉"
android:textColor="@color/white"
android:textSize="17sp"
app:layout_constraintBottom_toTopOf="@+id/tvTime"
app:layout_constraintLeft_toRightOf="@+id/ivCall"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/white"
android:textSize="10sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/tvCall"
app:layout_constraintRight_toRightOf="@+id/tvCall"
app:layout_constraintTop_toBottomOf="@+id/tvCall"
tools:text="剩余1分40秒" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_confide_free"
android:paddingLeft="5dp"
android:paddingTop="2dp"
android:paddingRight="5dp"
android:paddingBottom="2dp"
android:text="首单免费"
android:textColor="@color/white"
android:textSize="11sp"
android:id="@+id/first_order"
android:visibility="gone"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp" />
<LinearLayout
android:id="@+id/layoutChange"
android:layout_width="150dp"
android:layout_height="42dp"
android:layout_marginStart="@dimen/platform_dp_23"
android:layout_marginBottom="32dp"
android:visibility="gone"
tools:visibility="visible"
android:background="@drawable/confide_line_bg_change"
app:layout_constraintTop_toTopOf="@id/layoutCall"
app:layout_constraintLeft_toRightOf="@id/layoutCall"
app:layout_constraintRight_toRightOf="parent"
android:gravity="center"
android:paddingLeft="28dp"
android:paddingRight="28dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="再换一位"
android:id="@+id/layout_change_text"
android:textColor="@color/white"
android:textSize="17sp"
/>
<ProgressBar
android:layout_width="@dimen/platform_dp_20"
android:layout_height="@dimen/platform_dp_20"
android:id="@+id/confide_progress"
android:visibility="gone"
android:indeterminateDrawable="@drawable/confide_progress"
>
</ProgressBar>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/confide_title_bar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<LinearLayout
android:id="@+id/quick_consult_card"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="30dp"
android:background="@drawable/confide_card_consult_bg"
android:orientation="horizontal"
android:paddingLeft="@dimen/confide_dp_25"
android:paddingRight="@dimen/confide_dp_25"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="不知道选择哪位咨询师?试试"
android:textColor="@color/platform_color_242424"
android:textSize="14dp" />
<TextView
android:id="@+id/quick_consult_btn"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:background="@drawable/confide_consult_btn_bg"
android:gravity="center"
android:paddingLeft="@dimen/confide_dp_20"
android:paddingRight="@dimen/confide_dp_20"
android:text="一键倾诉"
android:textColor="@color/platform_but_text_color"
android:textSize="14dp"
android:textStyle="bold" />
</LinearLayout>
<View
android:id="@+id/v_zhezhao"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="48dp"
android:background="#80000000"
android:visibility="gone"
/>
<com.ydl.confide.home.widget.ConfideHomeFilterView
android:id="@+id/v_filterView"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white"
android:visibility="gone"
/>
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView
android:visibility="gone"
android:id="@+id/lce_state_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/rv_list"
android:layout_alignTop="@+id/rv_list"
android:layout_alignRight="@+id/rv_list"
android:layout_alignBottom="@+id/rv_list" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/quick_consult_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="30dp"
android:background="@drawable/confide_card_consult_bg"
android:orientation="horizontal"
android:paddingLeft="@dimen/platform_dp_8"
android:paddingRight="@dimen/platform_dp_8"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/confide_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/confide_call_logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginBottom="@dimen/platform_dp_12"
>
</ImageView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="智能推荐,一键倾诉"
android:textColor="@color/platform_color_333333"
android:textSize="14dp"
android:layout_marginStart="@dimen/platform_dp_8"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/confide_logo"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/platform_dp_12"
app:layout_constraintTop_toTopOf="@id/confide_logo"
app:layout_constraintBottom_toBottomOf="@id/confide_logo"
>
<TextView
android:id="@+id/quick_consult_btn"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:background="@drawable/confide_consult_btn_bg"
android:gravity="center"
android:paddingTop="@dimen/platform_dp_5"
android:paddingBottom="@dimen/platform_dp_5"
android:paddingLeft="@dimen/platform_dp_7"
android:paddingRight="@dimen/platform_dp_7"
android:text="我要倾诉"
android:layout_marginTop="@dimen/platform_dp_15"
android:textColor="@color/white"
android:textSize="13sp"
android:drawableRight="@drawable/confide_right_arrow"
/>
<ImageView
android:layout_width="@dimen/platform_dp_40"
android:layout_height="@dimen/confide_dp_25"
android:src="@drawable/confide__free"
android:layout_marginStart="@dimen/platform_dp_40"
android:id="@+id/confide_Free"
>
</ImageView>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/v_zhezhao"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="48dp"
android:background="#80000000"
android:visibility="gone" />
<com.ydl.confide.home.widget.ConfideHomeFilterView
android:id="@+id/v_filterView"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white"
android:visibility="gone" />
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView
android:id="@+id/lce_state_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/rv_list"
android:layout_alignTop="@+id/rv_list"
android:layout_alignRight="@+id/rv_list"
android:layout_alignBottom="@+id/rv_list"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/white"
>
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginStart="@dimen/platform_dp_15"
android:id="@+id/img_bg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<FrameLayout
android:layout_width="96dp"
android:layout_height="96dp">
<ImageView
android:id="@+id/img_head"
android:layout_width="96dp"
android:layout_height="96dp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/tv_isLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="9dp"
android:paddingRight="9dp"
android:paddingTop="1dp"
android:paddingBottom="1dp"
android:textSize="@dimen/confide_dp_10"
android:textColor="@color/white"
android:background="@drawable/confide_recommend_expert_line_bg"
tools:text="在线"/>
<ImageView
android:id="@+id/iv_play"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
tools:background="@drawable/confide_paused"/>
</FrameLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_name"
app:layout_constraintStart_toEndOf="@id/img_bg"
app:layout_constraintTop_toTopOf="@id/img_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:textSize="@dimen/platform_sp_16"
android:textColor="@color/platform_color_333333"
tools:text="姚雨晴"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_confide_data"
app:layout_constraintTop_toBottomOf="@id/tv_name"
app:layout_constraintStart_toEndOf="@id/img_bg"
android:layout_marginStart="14dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
>
<TextView
android:id="@+id/tv_Connection"
android:layout_marginTop="@dimen/confide_dp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#ACADB1"
android:textStyle="bold"
tools:text="83%"
/>
<TextView
android:id="@+id/tv_ConnectionContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#BCBCBC"
android:text="接通率" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginStart="@dimen/confide_dp_25"
>
<TextView
android:id="@+id/tv_confideNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#ACADB1"
android:textStyle="bold"
android:layout_marginTop="12dp"
tools:text="8000人"
/>
<TextView
android:id="@+id/tv_tv_confideNumContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#BCBCBC"
android:text="向TA倾诉"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginStart="@dimen/confide_dp_25"
>
<TextView
android:id="@+id/tv_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#ACADB1"
android:textStyle="bold"
android:layout_marginTop="12dp"
tools:text="4.9"
/>
<TextView
android:id="@+id/tv_tv_ScoreContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#BCBCBC"
android:text="评分"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/flowlayout_tag"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="16dp"
app:layout_constraintStart_toEndOf="@id/img_bg"
android:layout_marginStart="14dp"
app:layout_constraintBottom_toBottomOf="@id/img_bg"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50元/25分钟"
android:id="@+id/price_content"
android:textSize="@dimen/platform_sp_12"
app:layout_constraintStart_toEndOf="@id/flowlayout_tag"
app:layout_constraintBottom_toBottomOf="@id/flowlayout_tag"
>
</TextView>
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="#919190"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintTop_toBottomOf="@id/img_bg"
app:layout_constraintStart_toStartOf="@id/img_bg"
android:layout_marginTop="@dimen/platform_dp_15"
tools:text="没有人一出生就是完美的,只有不断的相信自...己…才能成就自己的梦想。"
/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<TextView
android:id="@+id/tv_confide"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginEnd="@dimen/platform_dp_15"
android:gravity="center"
tools:background="@drawable/confide_line_1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/confide_free_logo"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_marginStart="@dimen/platform_dp_8"
>
</ImageView>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
app:layout_constraintTop_toBottomOf="@id/tv_content"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/confide_dp_15"
android:background="@color/confide_line"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:orientation="horizontal"
android:id="@+id/rl_confide_title_layout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/confide_common_bg"
android:id="@+id/rl_confide_title_layout"
>
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_bar_root"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="48dp">
android:layout_height="48dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="40dp"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/confide_back"/>
android:scaleType="center"
android:src="@drawable/platform_common_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/confide_title"
android:textColor="@color/black"
android:textSize="17dp"
android:textColor="#FFFFFF"
android:text="@string/confide_title"/>
<ImageView
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/img_mine"
android:layout_width="wrap_content"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/confide_mine"/>
</LinearLayout>
android:drawableTop="@drawable/ic_action_confide_order"
android:drawablePadding="4dp"
android:gravity="center"
android:text="订单"
android:textColor="@color/_9"
android:textSize="7sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/img_customer"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/img_customer"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:drawableTop="@drawable/ic_action_confide_customer"
android:drawablePadding="4dp"
android:gravity="center"
android:text="客服"
android:textColor="@color/_9"
android:textSize="7sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@+id/img_help"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/img_help"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:drawableTop="@drawable/ic_action_confide_help"
android:drawablePadding="4dp"
android:gravity="center"
android:text="帮助"
android:textColor="@color/_9"
android:textSize="7sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/rl_title"
android:layout_marginLeft="@dimen/platform_dp_20"
android:layout_marginRight="@dimen/platform_dp_20"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/confide_close_icon"
android:id="@+id/close_webview_Icon"
android:visibility="gone"
android:layout_marginTop="@dimen/platform_dp_28"
android:layout_centerVertical="true"
>
</ImageView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_centerInParent="true"
android:id="@+id/text_title"
android:visibility="gone"
>
</TextView>
<View
android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_6"
android:background="@drawable/confide_bottom_line"
android:id="@+id/line"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_centerInParent="true"
>
</View>
</RelativeLayout>
<com.ydl.webview.ProgressWebView
android:id="@+id/wv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/rl_title"
/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="item"
type="com.ydl.confide.home.adapter.ItemVideoShowViewModel" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="10dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="6dp"
app:cardElevation="0dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:imageUrl="@{item.coverUrl}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginBottom="2dp"
android:maxLines="1"
android:text="@{item.name}"
android:textColor="@color/white"
android:textSize="10sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_marginBottom="2dp"
android:maxLines="1"
android:paddingLeft="4dp"
android:paddingTop="2dp"
android:paddingRight="4dp"
android:paddingBottom="2dp"
android:textColor="@color/white"
android:textSize="7sp"
app:confideLineRecentText="@{item.state}" />
</androidx.cardview.widget.CardView>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="item"
type="com.ydl.confide.home.adapter.ItemVideoShowViewModel" />
</data>
<androidx.cardview.widget.CardView
android:layout_width="180dp"
android:layout_height="140dp"
android:layout_marginLeft="6dp"
android:layout_marginTop="20dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:imageUrl="@{item.videoCoverUrl}" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:text="@{item.name}"
android:textColor="@color/white"
android:textSize="15sp" />
<ImageView
android:layout_width="33dp"
android:layout_height="33dp"
android:layout_gravity="center"
android:src="@drawable/ic_video_play" />
</androidx.cardview.widget.CardView>
</layout>
......@@ -4,4 +4,8 @@
<color name="confide_line">#F0F0F0</color>
<color name="confide_filters_line">#E0E0E0</color>
<color name="confide_category_bg">#FAFAFA</color>
<color name="confide_61CEAC">#61CEAC</color>
<color name="confide_48CC95">#48CC95</color>
<color name="confide_fe6040">#fe6040</color>
<color name="confide_aaaeba">#aaaeba</color>
</resources>
<resources>
<string name="confide_title">即时倾诉</string>
<string name="confide_video_wifi_tip">当前处于非wifi环境下,播放会消耗流量,确定继续播放?</string>
<string name="confide_tip">提示</string>
<string name="confide_tip_remain_time">(剩余%s)</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="confide_NoTitleTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:windowActionBar">false</item>
......@@ -9,5 +10,22 @@
<item name="colorPrimaryDark">@color/platform_main_theme</item>
<item name="colorAccent">@color/platform_main_theme</item>
</style>
<style name="confide_dialog" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<!-- Customize your theme here. -->
</style>
<style name="CustomShapeAppearanceBottomSheetDialog" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopRight">16dp</item>
<item name="cornerSizeTopLeft">16dp</item>
<item name="cornerSizeBottomRight">0dp</item>
<item name="cornerSizeBottomLeft">0dp</item>
<item name="background">@color/transparent</item>
</style>
<style name="AppBottomSheet" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppBottomSheetStyle</item>
</style>
<style name="AppBottomSheetStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/confide_bottom_webview</item>
</style>
</resources>
\ No newline at end of file
......@@ -68,14 +68,9 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
api "com.airbnb.android:lottie:3.4.0"
implementation "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation rootProject.ext.dependencies["ydl-user-router"]
......@@ -87,6 +82,7 @@ dependencies {
implementation modularPublication('com.ydl:m-tests-api')
implementation modularPublication('com.ydl:m-home-api')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-confide-api')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
......@@ -98,6 +94,7 @@ dependencies {
compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies['ydl-m-tests-api']
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
......@@ -7,8 +7,11 @@ import android.os.Bundle
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.api.IConfideService
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayTypeEnum
......@@ -23,7 +26,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
......@@ -357,14 +360,12 @@ open class HomeBaseImpl : IHomeBaseEvent {
doctorId.toString()
)
if (linkUrl.startsWith("http")) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), ""
findRouteService(IConfideService::class.java)
?.showExpertDetailDialog(
mContext as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(doctorId.toString()),
doctorId.toString()
)
} else {
YDLRouterManager.router(linkUrl)
}
}
/**
......
......@@ -467,7 +467,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachPleaseSubscribeConsultDate.class, MsgViewHolderPleaseSubscribeConsultDate.class);//请预约咨询时间
NimUIKit.registerMsgItemViewHolder(CustomCustomerServiceCardAttachment.class, MsgViewHolderCustomerServiceCard.class);//客服小壹名片
NimUIKit.registerMsgItemViewHolder(CustomAttachmentShareMsg.class, MsgViewHolderShareMsg.class);//分享推送
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultCallStatus.class, MsgViewHolderConsultCallStatus.class);//咨询声网的拨打状态
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultCallStatus.class, MsgViewHolderConsultCallStatus.class);//咨询声网的拨打状态 32
NimUIKit.registerMsgItemViewHolder(CustomAttachAssistantReceivedMoney.class, MsgViewHolderAssistantReceivedMoney.class);
NimUIKit.registerMsgItemViewHolder(CustomAttachmentBusinessCard.class, MsgViewHolderBusinessCard.class);//专家自定义名片 ,TYPE=34
NimUIKit.registerMsgItemViewHolder(CustomAttachmentJumpToDaoYi.class, MsgViewHolderJumpToDaoYi.class);//跳转导医聊天窗口触发导医分配逻辑,TYPE=35
......
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