Commit 7bcf494e by 冯全

Merge branch 'd/v4.4.01' into 'feat/hot_fix'

# Conflicts:
#   config.gradle
parents ef97e81e cea87958
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.3'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.ydl.confide.api">
</manifest>
\ No newline at end of file
......@@ -34,4 +34,6 @@ interface IConfideService : IProvider {
doctorId: String,
uid: String
)
fun isOnlineRtm():Boolean
}
\ No newline at end of file
......@@ -195,7 +195,7 @@ dependencies {
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation project(':m-confide')
implementation modularPublication('com.ydl:m-confide-api')
implementation project(':api:confide')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-tests')
......
......@@ -53,9 +53,6 @@
<meta-data
android:name="com.ydl.component.base.DemoGlobalConfig"
android:value="ModuleConfig" />
<meta-data
android:name="com.openinstall.APP_KEY"
android:value="jz0d0s"/>
<activity
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
......
......@@ -9,13 +9,17 @@ import android.content.ServiceConnection
import android.net.Uri
import android.os.IBinder
import android.provider.Settings
import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.fm.openinstall.OpenInstall
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper
import com.tbruyelle.rxpermissions2.RxPermissions
import com.tencent.qcloud.tuicore.calling.trtccalling.model.TRTCCalling
import com.tencent.qcloud.tuicore.calling.videocall.Constant
import com.tencent.qcloud.tuicore.calling.videocall.YDLInvitionActivity
import com.umeng.analytics.MobclickAgent
import com.ydl.audioim.YDLavManager
import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
......@@ -34,7 +38,7 @@ import com.yidianling.muse.event.MeditationFloatEvent
import com.yidianling.muse.helper.MediaPlayerManager
import com.yidianling.muse.service.MeditationWindowService
import com.yidianling.tests.home.NewTestHomeActivity
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.service.IUserService
import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import com.yidianling.user.ui.login.OneKeyLoginHelp
import com.yidianling.user.widget.SecretDescriptionDialog
......@@ -51,15 +55,15 @@ import kotlinx.android.synthetic.main.activity_main.*
@Route(path = "/main/main")
class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(),
DemoContract.View {
private var secretDescriptionDialog: SecretDescriptionDialog? = null
// private var secretDescriptionDialog: SecretDescriptionDialog? = null
private var serviceConnection: ServiceConnection? = null
private var meditationServiceConnection:ServiceConnection? = null
private var meditationServiceConnection: ServiceConnection? = null
private var secretDialog: SecretDialog? = null
protected var playService: PlayService? = null
protected var meditationService:MeditationWindowService?=null
protected var meditationService: MeditationWindowService? = null
override fun getContentViewId(): Int {
return R.id.lce_content_view
......@@ -84,16 +88,21 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun initDataAndEvent() {
EventBus.getDefault().register(this)
//线上
// YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
//测试
YDLavManager.instances.init(this, "13b1536698f64905a1e7e5bb978ba821")
YdlCommonRouterManager.initYdlCommonRoute(PlatformTempCommonRouteImpl())
OpenInstall.init(this);// TODO: 1/29/21 统计渠道测试
StatusUtils.isUseOpenInstall = true
// 初始化一键登录sdk
OneKeyLoginHelp.sdkInit(this, OneKeyLoginHelp.YDL_USER_APP, PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN)
OneKeyLoginHelp.sdkInit(
this,
OneKeyLoginHelp.YDL_USER_APP,
PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN
)
bindService()
bindMeditationService()
reLoadData()
requestPermission()
bt_mdt.setOnClickListener {
......@@ -114,7 +123,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// .withBoolean("bind_phone", false)
// .withBoolean("isFromGuide", true)
// .navigation()
OneKeyLoginHelp.startLogin(this,false)
OneKeyLoginHelp.startLogin(this, false)
}
bt_to_consultant.setOnClickListener {
// ARouter.getInstance()
......@@ -159,7 +168,9 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
startActivity(Intent(this, CollectSexAndBirthActivity::class.java))
}
bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016")
YDLavManager.instances.login(
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
)
startActivity(Intent(this, ConfideHomeActivity::class.java))
}
......@@ -225,7 +236,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_privacy.setOnClickListener {
startActivity(Intent(this@MainActivity, TestAppActivity::class.java))
}
}
......@@ -239,20 +249,24 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
val rxPermissions = RxPermissions(this)
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe { permission ->
if (permission.granted) {
ToastUtil.toastShort("Permission Success")
} else if (permission.shouldShowRequestPermissionRationale) {
requestPermission()
} else {
ToastUtil.toastLong(
this,
getString(R.string.platform_need_storage_permission_hint)
)
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null)
intent.data = uri
startActivity(intent)
finish()
when {
permission.granted -> {
ToastUtil.toastShort("Permission Success")
}
permission.shouldShowRequestPermissionRationale -> {
requestPermission()
}
else -> {
ToastUtil.toastLong(
this,
getString(R.string.platform_need_storage_permission_hint)
)
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null)
intent.data = uri
startActivity(intent)
finish()
}
}
}
......@@ -265,11 +279,11 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE)
}
private fun bindMeditationService(){
private fun bindMeditationService() {
val intent = Intent()
intent.setClass(this,MeditationWindowService::class.java)
intent.setClass(this, MeditationWindowService::class.java)
meditationServiceConnection = MeditationServiceConnection()
bindService(intent,meditationServiceConnection,Context.BIND_AUTO_CREATE)
bindService(intent, meditationServiceConnection, Context.BIND_AUTO_CREATE)
}
override fun onResume() {
......@@ -279,6 +293,16 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// ModularServiceManager.provide(IConsultantService::class.java)
// .
// (this)
val trtcCalling = TRTCCalling.sharedInstance(this)
if (!TextUtils.isEmpty(trtcCalling.mRoomId) && !TextUtils.isEmpty(trtcCalling.mUserId)) {
val intent = Intent(mContext, YDLInvitionActivity::class.java)
intent.putExtra(Constant.ROOM_ID, trtcCalling.mRoomId)
intent.putExtra(Constant.USER_ID, trtcCalling.mUserId)
intent.putExtra(Constant.INVITE_ID, trtcCalling.mInviteId)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
mContext.startActivity(intent)
}
}
override fun onPause() {
......@@ -287,8 +311,8 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
fun onEvent(event:MeditationFloatEvent){
fun onEvent(event: MeditationFloatEvent) {
}
@SuppressLint("MissingSuperCall")
......@@ -296,12 +320,12 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
if (serviceConnection != null) {
unbindService(serviceConnection)
}
if(meditationServiceConnection!=null){
if (meditationServiceConnection != null) {
EventBus.getDefault().post(MeditationFloatEvent(false))
MediaPlayerManager.getInstance(this)?.stop()
unbindService(meditationServiceConnection)
}
if(EventBus.getDefault().isRegistered(this)){
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
super.onDestroy()
......@@ -317,7 +341,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
}
private inner class MeditationServiceConnection:ServiceConnection {
private inner class MeditationServiceConnection : ServiceConnection {
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
meditationService = (service as MeditationWindowService.MeditationBinder).service
}
......
......@@ -20,10 +20,10 @@ 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_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -36,12 +36,12 @@ class JsMethod {
return true
}
"show_loading" -> {
val topActivity = BaseActivityMgr.INST.getTopActivity()
Loading.show(topActivity)
// val topActivity = BaseActivityMgr.INST.getTopActivity()
// Loading.show(topActivity)
return true
}
"close_loading" -> {
Loading.close()
// Loading.close()
return true
}
"open_app_eval_list"->{
......
......@@ -481,8 +481,17 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
}
@Override
public void getNextExpertStatus(String doctorID, String title, String uid) {
EventBus.getDefault().post(new ChangeAnotherExpertEvent(doctorID,title,uid));
public void getNextExpertStatus(String doctorID, String title, String uid, String linkUrl) {
EventBus.getDefault().post(new ChangeAnotherExpertEvent(doctorID, title, uid, linkUrl));
}
@Override
public void switchPushStatus(H5JsBean.H5JsCmd.Params params) {
if (params.getSwitchStatus() == 1) {
// MsgPushLifecycle.Companion.setH5Open(true);
} else {
// MsgPushLifecycle.Companion.setH5Open(false);
}
}
@Override
......
......@@ -50,6 +50,7 @@ class WebJavascriptHandler : IJavascriptHandler{
if (YDLRouterManager.router(params)) {
return
}
if (js.handle(params)) return
val jsData = Gson().fromJson(params, H5JsBean::class.java)
//是否登录
......@@ -447,7 +448,7 @@ class WebJavascriptHandler : IJavascriptHandler{
//再换一位
"get_next_doctor"->{
wvEnventPro?.getNextExpertStatus(jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.title,jsData.cmd?.params?.uid.toString())
wvEnventPro?.getNextExpertStatus(jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.title,jsData.cmd?.params?.uid.toString(),jsData.cmd?.params?.linkUrl)
}
"show_popup_window" -> {
val doctorId = jsData.cmd?.params?.doctorId?.toString()
......@@ -459,6 +460,9 @@ class WebJavascriptHandler : IJavascriptHandler{
findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId, uid ?: "")
}
}
"switch_push_status" -> {
wvEnventPro?.switchPushStatus(jsData.cmd?.params)
}
}
}
......
......@@ -199,6 +199,8 @@ public interface WebViewClientClickListener {
default void setWebViewBG(String rgb,String alpha){}
void getNextExpertStatus(String doctorID,String title,String uid);
void getNextExpertStatus(String doctorID, String title, String uid, String linkUrl);
//h5页面是否需要打开推送
void switchPushStatus(H5JsBean.H5JsCmd.Params params);
}
......@@ -137,7 +137,6 @@
android:id="@+id/bt_to_tests"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="测评" />
......
ext {
kotlin_version = "1.3.21"
dev_mode = false
dev_mode = false //组件发布的时候需要设置为false
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.24",
"m-consultant" : "0.0.60.64",
"m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.74",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.48",
"m-home" : "0.0.23.92",
"m-im" : "0.0.21.57",
"m-dynamic" : "0.0.7.74",
"m-user" : "0.0.62.72",
"m-home" : "0.0.24.00",
"m-im" : "0.0.21.67",
"m-dynamic" : "0.0.7.80",
"m-article" : "0.0.0.10",
"m-muse" : "0.0.28.87",
"m-tests" : "0.0.24.24",
"m-course" : "0.0.43.39",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.25",
//第一步
"ydl-platform" : "0.0.41.51",
//第二步 若干
"ydl-webview" : "0.0.39.03",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.21",
"m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.44",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.12",
"m-muse" : "0.0.28.78",
"m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......@@ -32,29 +47,6 @@ ext {
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.37",
//第二步 若干
"ydl-webview" : "0.0.38.92",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.18",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8",
]
ydl_app = [
appName : "壹点灵心理咨询",
......@@ -96,24 +88,40 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.24",
"m-consultant" : "0.0.60.64",
"m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.74",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.48",
"m-home" : "0.0.23.92",
"m-im" : "0.0.21.57",
"m-dynamic" : "0.0.7.74",
"m-user" : "0.0.62.72",
"m-home" : "0.0.24.00",
"m-im" : "0.0.21.67",
"m-dynamic" : "0.0.7.80",
"m-article" : "0.0.0.10",
"m-muse" : "0.0.28.87",
"m-tests" : "0.0.24.24",
"m-course" : "0.0.43.39",
//-------------- 功能组件 --------------
"m-muse" : "0.0.28.78",
//mdt 组件
"ydl-tuicore" : "0.0.25",
//第一步
"ydl-platform" : "0.0.41.51",
"m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39",
//第二步 若干
"ydl-webview" : "0.0.39.03",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.21",
"m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.44",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.12",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-confide-api" : "1.0.3",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......@@ -123,24 +131,6 @@ ext {
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.37",
//第二步 若干
"ydl-webview" : "0.0.38.92",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.18",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8",
]
dependencies = [
......@@ -268,7 +258,7 @@ ext {
"ydl-pushagent" : "com.ydl:pushagent:0.1.1",
"ydl-notracepoint" : "com.ydl:notracepoint-lib:0.2.3.3@aar",
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.1-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.4",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
"mmkv" : "com.tencent:mmkv-static:1.2.6",
"arouter-api" : "com.alibaba:arouter-api:1.4.1",
......@@ -287,7 +277,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.44@aar", //flutter aar
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.51@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
......
......@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
implementation "com.ydl:ydl-av:1.4.4"
api "com.ydl:ydl-av:1.4.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
......
......@@ -4,9 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.bytedance.apm.insight.ApmInsightAgent
import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.http.AudioApiRequestUtil
......@@ -25,6 +23,7 @@ import com.ydl.ydl_av.messge_service.callback.LoginCallback
import com.ydl.ydl_av.messge_service.request.LoginParam
import com.ydl.ydl_av.messge_service.response.CallLocalResponse
import com.ydl.ydl_av.messge_service.response.CallRemoteResponse
import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
......@@ -43,7 +42,6 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.json.JSONObject
import java.util.*
import java.util.concurrent.TimeUnit
......@@ -326,53 +324,6 @@ class YDLavManager {
toUid: String,
content: String
) {
// LogUtil.e("[agora]收到云信的通知消息:$content")
// val agoraInvitationBean = Gson().fromJson(content, AgoraInvitationBean::class.java)
//1发起呼叫 2接受呼叫 3取消呼叫 4拒绝呼叫邀请 5呼叫超时
// when (agoraInvitationBean.callType) {
// "1" -> {
// writeAgoraLog("1收到云信消息通知电话-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// receivedCall(agoraInvitationBean.data, "来自云信")
// }
// "2" -> {
// writeAgoraLog("对方接受了通话邀请,主叫开始加入频道:callType${agoraInvitationBean.callType}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}",
// FILE_NAME
// )
// val act = ActivityManager.getInstance().getTopTaskActivity()
// if (act is AudioHomeActivity) {
// act.runOnUiThread {
// act.joinChannel()
// }
// }
// }
// "3" -> {
// writeAgoraLog("呼叫邀请被取消:主叫主动取消-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// closePage()
// }
// "4" -> {
// writeAgoraLog("被叫拒绝了通话邀请-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// val act = ActivityManager.getInstance().getTopTaskActivity()
// if (act is AudioHomeActivity) {
// act.runOnUiThread {
// ToastUtil.toastShort("对方已挂断")
// //通话结束或挂断时,上传日志文件
// act.uploadLog()
// act.leaveChannel()
// }
// }
// }
// "5" -> {
// writeAgoraLog("呼叫邀请被取消:呼叫邀请过期-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// //关闭页面
// closePage()
// }
// else -> {
// writeAgoraLog("其它AgoraInvitationBean,${agoraInvitationBean.callType}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// }
// }
}
})
}
......@@ -498,6 +449,7 @@ class YDLavManager {
}
override fun onFailure(msg: String?) {
Apm.reportCustom("agora_login_error", msg ?: "", Exception(msg))
LogUtil.e("[agora]实时消息登录失败:$msg")
writeAgoraLog(
"声网rtm登录失败:$msg-------Time:${
......@@ -714,6 +666,8 @@ class YDLavManager {
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */
override fun onConnectionStateChanged(state: Int, reason: Int) {
val msg = "state:${state},reason:${reason}"
Apm.reportCustom("agora_connectionstate_error", msg, Exception(msg))
sdkStatus = state
writeAgoraLog(
"声网rtm登录状态:${state}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}",
......@@ -754,9 +708,13 @@ class YDLavManager {
session: String?,
line: String
) {
AudioApiRequestUtil.callEventSave(session, line, status, "用户端:${res}")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe()
//保证session有值
session?.let { sessionLet ->
AudioApiRequestUtil.callEventSave(sessionLet, line, status, "用户端:${res}")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe()
}
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
/**
......@@ -17,7 +18,9 @@ object AudioImIn {
private fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
/**
* 发送自定义通知
*/
......
......@@ -107,7 +107,7 @@
android:id="@+id/tv_notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已通话时长"
android:text="剩余时长:"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/tv_remain_time"
......@@ -129,6 +129,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_totalDuration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_notes"
......@@ -232,7 +233,7 @@
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_marginTop="1dp"
android:src="@drawable/audiohome_muteon"
android:src="@drawable/audioim_home_muteon_enable"
android:visibility="visible" />
<TextView
......@@ -302,11 +303,12 @@
android:src="@drawable/audioim_img_hands_free_unuse" />
<TextView
android:id="@+id/hands_free_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_hands_free"
android:layout_marginTop="8dp"
android:text="免提"
android:text="扬声器已关"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
......
......@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件
// 配置资源重命名插件
resConfig {
new_prefix = 'confide_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
apply from : '../maven_push.gradle'
kapt {
arguments {
......@@ -17,16 +11,11 @@ kapt {
}
android {
// compileSdkVersion rootProject.ext.android["compileSdkVersion"]
// buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
// minSdkVersion rootProject.ext.android["minSdkVersion"]
// targetSdkVersion rootProject.ext.android["targetSdkVersion"]
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
......@@ -54,12 +43,6 @@ android {
enabled true
}
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
//设置JDK1.8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
......@@ -85,7 +68,6 @@ dependencies {
implementation "com.ydl:jjdxm-ijkplayer:0.0.33"
api rootProject.ext.dependencies["ydl-user-router"]
implementation modularPublication('com.ydl:m-consultant-api')
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-media')
......@@ -96,7 +78,8 @@ dependencies {
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')
implementation modularPublication('com.ydl:m-consultant-api')
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
......@@ -109,5 +92,6 @@ dependencies {
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
}
}
modular {
packageName "com.ydl.confide"
// 模块发布需要的参数
publish {
modules {
xlzx {
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-confide-module-xlzx"
// 上报的业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-confide-module-ydl"
// 上报的业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-confide-api"
version = rootProject.ext.ydlPublishVersion["${childProject.getName()}-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
......@@ -9,5 +9,7 @@
<activity
android:name=".intro.ExpertIntroActivity"
android:screenOrientation="portrait" />
<activity android:name=".home.ConfideSearchActivity"
android:screenOrientation="portrait"/>
</application>
</manifest>
package com.ydl.confide.home
import android.content.Context
import android.content.Intent
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import android.view.WindowManager
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.TextView
import com.ydl.confide.R
import com.ydl.confide.home.constants.FinalString
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import kotlinx.android.synthetic.main.confide_search_activity.*
class ConfideSearchActivity : BaseActivity() {
override fun initDataAndEvent() {
val keyWord = intent.getStringExtra(FinalString.CONFIDE_SEARCH_KEY_WORD)
if (!TextUtils.isEmpty(keyWord)){
etSearch?.setText(keyWord)
iv_delete_icon.visibility = View.VISIBLE
}
etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
val keyword = etSearch!!.text.trim().toString()
//埋点
ActionCountUtils.record("listen_counselor_list_page","listen_counselor_list_search_click",keyword)
val intent = Intent()
intent.putExtra(FinalString.CONFIDE_SEARCH_KEY_WORD, keyword)
setResult(RESULT_OK,intent)
finish()
}
true
}
findViewById<TextView>(R.id.tv_search_cancle).setOnClickListener {
setResult(RESULT_OK)
finish()
}
if (etSearch.requestFocus()) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
val isShowing = imm.showSoftInput(etSearch, InputMethodManager.SHOW_IMPLICIT)
if (!isShowing) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
}
}
etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
if (TextUtils.isEmpty(s)) {
iv_delete_icon.visibility = View.INVISIBLE
} else {
iv_delete_icon.visibility = View.VISIBLE
}
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
iv_delete_icon.setOnClickListener {
etSearch.setText("")
}
}
override fun layoutResId(): Int {
return R.layout.confide_search_activity
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ package com.ydl.confide.home.bean
*/
data class ConfideHomeAllFiltersBean(
var page : Int,
//通过倾诉师的名字搜索
var keywords : String,
//选择的综合排序Id
var selectSort : ConfideHomeFiterItemBean?,
//选择的性别id
......@@ -19,4 +21,6 @@ data class ConfideHomeAllFiltersBean(
val selectGoodData : ArrayList<ConfideHomeFiterItemBean>?,
//当前列表已存在专家uid列表
var notInUid : ArrayList<Int> = ArrayList()
)
\ No newline at end of file
......@@ -30,4 +30,6 @@ data class ConfideHomeDataBean(
/**
* 为你推荐Id 本地使用 用于区分音频播放区域
*/
var recommendId : Int)
\ No newline at end of file
var recommendId : Int,
var keyword : String = "")
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.ydl.confide.home.bean
class DialStatus {
var confideLine: Int? = null
var linkUrl: String? = ""
var remainingTime: RemainingTime? = null
}
......
......@@ -20,6 +20,8 @@ interface IConfideHomeConfig{
const val TYPE_RECOMMEND = 5
const val TYPE_SOUND = 6
const val TYPE_VIDEO_SHOW = 7
const val TYPE_SEARCH = 8
const val TYPE_EMPTY = 9
const val TYPE_FOOTER = 999
/**
* section id. 与上面相对应
......@@ -31,6 +33,8 @@ interface IConfideHomeConfig{
const val SECTION_RECOMMEND = 10005
const val SECTION_SOUND = 10006
const val SECTION_CONSULTANT = 10007
const val SECTION_SEARCH = 10008
const val SECTION_EMPTY = 10009
const val SECTION_FOOTER = 19999
......
......@@ -19,4 +19,9 @@ public class FinalString {
//连接倾听未绑定手机提示
public static final String TEL_BINDPHONE = "电话连接需要绑定手机哦~";
public static final String CONFIDE_SEARCH_KEY_WORD = "confide_key_word";
public static final int SEARCH_REQUEST_CODE = 1;
}
......@@ -3,7 +3,8 @@ package com.ydl.confide.home.event
data class ChangeAnotherExpertEvent(
var doctorID: String,
var title: String,
var uid: String
var uid: String,
var linkUrl: String
)
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
......@@ -132,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址
*/
override fun consultantClick(doctorId: String?, confideId: String?, uid: String?) {
override fun consultantClick(doctorId: String?, confideId: String?, uid: String?,listenFree : Boolean?, expertUrl:String?) {
confideId?.let {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
mContext as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it),
doctorId!!, uid = uid
doctorId!!, uid = uid, listenFree = listenFree ?: false,expertUrl = expertUrl?:""
)
}
}
......
......@@ -73,7 +73,7 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址
*/
fun consultantClick(doctorId: String?, confideId: String?, uid: String?)
fun consultantClick(doctorId: String?, confideId: String?, uid: String?, listenFree: Boolean?= false, expertUrl : String?="")
fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?)
......
......@@ -38,7 +38,7 @@ interface ConfideHomeApi {
// 1=在线 3-通话中 2-离线
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("auth/listen/dialchangestatus")
fun getDialStatus(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<DialStatus>>
fun getDialStatus(@Query("doctorId") doctorId: String, @Query("listenVersion")listenVersion : String = "2.1"): Observable<BaseAPIResponse<DialStatus>>
@GET
fun recommendDoctor(
......
......@@ -51,6 +51,7 @@ class ConfideHomeHttpImpl private constructor() : IConfideHomeHttp {
val sb = StringBuffer()
sb.append("page").append("=").append(param.page).append("&")
.append("keywords").append("=").append(param.getKeywords()).append("&")
.append("sortType").append("=").append(param.getSortType()).append("&")
.append("sexType").append("=").append(param.getSexType()).append("&")
.append("ageType").append("=").append(param.getAgeType()).append("&")
......
......@@ -30,6 +30,8 @@ class ConfideRecommendParam private constructor(builder: Builder){
*/
private var goodType : String = ""
private var keyWords : String = ""
//当前列表已存在专家uid列表
var notInUid : ArrayList<Int> = ArrayList()
......@@ -49,6 +51,10 @@ class ConfideRecommendParam private constructor(builder: Builder){
return goodType
}
fun getKeywords() : String{
return keyWords
}
init {
this.page = builder.page
this.sortType = builder.sortType
......@@ -56,6 +62,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
this.ageType = builder.ageType
this.goodType = builder.goodType
this.notInUid = builder.notInUid
this.keyWords = builder.keyWords
}
class Builder {
......@@ -65,6 +72,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
internal var ageType : String = ""
internal var goodType : String = ""
internal var notInUid : ArrayList<Int> = ArrayList()
internal var keyWords : String = ""
fun page(page: Int): Builder {
this.page = page
......@@ -91,9 +99,17 @@ class ConfideRecommendParam private constructor(builder: Builder){
return this
}
fun keyWords(keyWords: String): Builder {
this.keyWords = keyWords
return this
}
fun build() : ConfideRecommendParam{
return ConfideRecommendParam(this)
}
}
}
......
......@@ -13,7 +13,7 @@ import com.yidianling.common.tools.RxImageTool
* @Company 壹点灵
* @date 2018/9/25
*/
class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
class ConfideHomeRecycleViewListener() : RecyclerView.OnScrollListener() {
/**
* 筛选模块位置
*/
......@@ -23,6 +23,15 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
*/
private var move = false
private lateinit var listener: HideScrollListener
private var visible = true
constructor(listener: HideScrollListener):this(){
this.listener = listener
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
//在这里进行第二次滚动(最后的距离)
......@@ -37,6 +46,15 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
recyclerView.scrollBy(0, top)
}
}
if (dy > 0 && visible) {
visible = false
listener.onHide()
} else if (dy < 0 && !visible) {
visible = true
listener.onShow()
}
}
/**
......@@ -54,7 +72,7 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
mRecyclerView.scrollBy(0, 1)
val childAt = mRecyclerView.getChildAt(mIndex)
if (childAt !is ConfideHomeFilterView) return
val top = childAt.top
val top = childAt.top - childAt.height
if(top==0 || top==1){
//已滚动到顶部
......@@ -82,4 +100,6 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
// move = true
// }
}
}
\ No newline at end of file
package com.ydl.confide.home.listener
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.util.Log
import android.view.View
import android.widget.EditText
import android.widget.ImageView
import android.widget.RelativeLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.widget.ConfideHomeFilterView
import com.ydl.ydlcommon.base.BaseActivityMgr
import com.ydl.ydlcommon.utils.KeyboardChangeListener
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
/**
* @author yuanwai
......@@ -22,9 +32,14 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
private var mSuspensionHeight: Int = RxImageTool.dip2px(48f)
private var mSearchViewHeight: Int = RxImageTool.dip2px(48f)
private var filterView: ConfideHomeFilterView? = null
private var searchView: RelativeLayout? = null
private var divView: View? = null
private var searchText = ""
private var adapter: ConfideHomeAdapter? = null
fun setFilterView(filterView: ConfideHomeFilterView, divView: View) {
......@@ -32,6 +47,17 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
this.divView = divView
}
fun setFilterView(
filterView: ConfideHomeFilterView,
searchView: RelativeLayout,
divView: View
) {
this.filterView = filterView
this.divView = divView
this.searchView = searchView
}
fun setSectionAdapter(adapter: ConfideHomeAdapter) {
this.adapter = adapter
}
......@@ -41,6 +67,11 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
if (null != filterView) {
mSuspensionHeight = filterView!!.height
}
if (searchView != null) {
mSearchViewHeight = searchView!!.height
}
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
......@@ -49,24 +80,42 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
return
}
val manager = recyclerView!!.layoutManager as LinearLayoutManager
val findFirstCompletelyVisibleItemPosition =
manager.findFirstCompletelyVisibleItemPosition();
if (findFirstCompletelyVisibleItemPosition != 0 && findFirstCompletelyVisibleItemPosition != 1) {
searchView?.visibility = View.VISIBLE
} else {
searchView?.visibility = View.INVISIBLE
}
if (mCurrentPosition != manager.findFirstVisibleItemPosition()) {
mCurrentPosition = manager.findFirstVisibleItemPosition()
}
LogUtil.e("http----------------type="+adapter!!.getItemViewType(mCurrentPosition))
if (adapter!!.getItemViewType(mCurrentPosition) == IConfideHomeConfig.TYPE_RECOMMEND) {
LogUtil.e("http----------------type=" + adapter!!.getItemViewType(mCurrentPosition))
if (adapter!!.getItemViewType(mCurrentPosition + 1) == IConfideHomeConfig.TYPE_RECOMMEND) {
var view = manager.findViewByPosition(mCurrentPosition + 1)
if (view != null) {
if (view.top <= mSuspensionHeight) {
filterView!!.visibility = View.VISIBLE
divView?.visibility = View.VISIBLE
} else {
if (view is ConfideHomeFilterView) {
if (view.top <= mSuspensionHeight) {
filterView!!.visibility = View.VISIBLE
divView?.visibility = View.VISIBLE
} else {
// filterView!!.visibility = View.INVISIBLE
filterView!!.visibility = View.INVISIBLE
divView?.visibility = View.INVISIBLE
}
}
}
}else if (adapter!!.getItemViewType(mCurrentPosition) == IConfideHomeConfig.TYPE_RECOMMEND || adapter!!.getItemViewType(mCurrentPosition) == IConfideHomeConfig.TYPE_SOUND){
} else if (adapter!!.getItemViewType(mCurrentPosition + 1) == IConfideHomeConfig.TYPE_RECOMMEND || adapter!!.getItemViewType(
mCurrentPosition + 1
) == IConfideHomeConfig.TYPE_SOUND
) {
filterView!!.visibility = View.VISIBLE
divView?.visibility = View.VISIBLE
}else {
} else {
filterView!!.visibility = View.INVISIBLE
divView?.visibility = View.INVISIBLE
}
......
package com.ydl.confide.home.listener
interface HideScrollListener {
fun onHide()
fun onShow()
}
\ No newline at end of file
......@@ -98,6 +98,10 @@ class ConfdieServiceImpl : IConfideService {
YDLavManager.instances.init(app, avManagerKey)
}
override fun isOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
}
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
......
......@@ -14,6 +14,7 @@ import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.confide.home.bean.ConnectParamJava
import com.ydl.confide.home.constants.FinalString
import com.ydl.confide.home.http.ConfideHomeDataManager
import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.webview.TellData
......@@ -73,6 +74,27 @@ class ConfideWebServiceImpl {
tellData: TellData?,
callType: String?
) {
if (!YDLavManager.isOnlineRtm) {
YDLavManager.instances.login(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) {
toDial(id, type, callType, activity, tellData)
} else {
ToastUtil.toastShort("网络通话错误代码001")
}
}
}else{
toDial(id, type, callType, activity, tellData)
}
}
@SuppressLint("CheckResult")
private fun toDial(
id: Int,
type: Int,
callType: String?,
activity: Activity,
tellData: TellData?
) {
ConfideHomeDataManager.getHttp()
.connectionJava(ConnectParamJava("" + id, "" + type, callType))
.subscribeOn(Schedulers.io())
......
......@@ -54,7 +54,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
tvSexTitle.text = "性别筛选"
tvAgeTitle.text = "年龄筛选"
if (null == mAllFiltersBean){
mAllFiltersBean = ConfideHomeAllFiltersBean(allFiltersBean.page,allFiltersBean.selectSort,allFiltersBean.selectSex,allFiltersBean.selectAgeData,allFiltersBean.selectGoodData)
mAllFiltersBean = ConfideHomeAllFiltersBean(allFiltersBean.page,"",allFiltersBean.selectSort,allFiltersBean.selectSex,allFiltersBean.selectAgeData,allFiltersBean.selectGoodData)
}
initData(sexData,ageData,mAllFiltersBean!!)
initSexData(view,mAllFiltersBean!!)
......
......@@ -490,6 +490,10 @@ class ConfideHomeUtils {
if (-1 != allFiltersBean.page) {
param.page(allFiltersBean.page)
}
if (null != allFiltersBean.keywords){
param.keyWords(allFiltersBean.keywords)
}
//综合排序
if (null != allFiltersBean.selectSort && !TextUtils.isEmpty(allFiltersBean.selectSort!!.id) && "-1" != allFiltersBean.selectSort!!.id) {
param.sortType(allFiltersBean.selectSort!!.id!!)
......
......@@ -16,9 +16,15 @@ fun TextView.confideLineText(line: Int) {
3 -> {
text = "通话中"
}
4->{
4 -> {
text = "继续倾诉"
}
5 -> {
text = "已离线,可预约"
}
6 -> {
text = "已离线,可留言"
}
}
}
......
......@@ -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.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString(), bodyBean.listenFree)
}
2 -> {
//跳转私聊 并发送自定义消息
......
......@@ -94,7 +94,8 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
"1"
)
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString(), bodyBean.listenFree,bodyBean.linkUrl)
}
img_head.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "2")
......@@ -344,7 +345,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if (bodyBean.confideLine == 3) {
}
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString(), bodyBean.listenFree)
}
2 -> {
//跳转私聊 并发送自定义消息
......
......@@ -99,7 +99,7 @@ class ExpertIntroActivity : AppCompatActivity() {
binding.viewPager.adapter = adapter
binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
adapter.onSelect(position)
adapter.onSelect(position, lastSelectPos)
if (position == data.size - 1 && lastSelectPos < position) {
loadMore()
}
......
......@@ -166,7 +166,7 @@ internal class IntroAdapter(
ijkVideoView?.pause()
}
fun onSelect(position: Int) {
fun onSelect(position: Int, lastPos:Int) {
curPos = position
onLoadDialStatus(position)
if (!ConfideNetworkUtil.isWifi(context) && !hasAgreePlayWithoutWiFi) {
......@@ -177,6 +177,15 @@ internal class IntroAdapter(
// entry.value.seekTo(0)
entry.value.start()
} else {
if (entry.key == lastPos) {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_playtime_click",
data[lastPos].confideId ?: "",
if (data[lastPos].isVideo) "1" else "2",
(entry.value.currentPosition / 1000F).toString()
)
}
entry.value.seekTo(0)
entry.value.pause()
}
......
......@@ -2,6 +2,7 @@ package com.ydl.confide.intro
import android.app.Activity
import android.net.Uri
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.widget.SeekBar
......@@ -11,9 +12,11 @@ import androidx.databinding.ObservableInt
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.dou361.ijkplayer.widget.IjkVideoView
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.ydl.audioim.YDLavManager
import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding
......@@ -35,6 +38,8 @@ import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException
import java.net.URLDecoder
import java.net.URLEncoder
import java.util.concurrent.TimeUnit
......@@ -77,6 +82,40 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
)
val status = item.lineStatus.get()
when (status) {
5 -> {
if (!TextUtils.isEmpty(item.linkedUrl.get())) {
val linkUri = Uri.parse(item.linkedUrl.get())
if (linkUri != null) {
val host = linkUri.host
if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity
try {
var params = URLDecoder.decode(
linkUri.getQueryParameter("params"),
"UTF-8"
)
ARouter.getInstance().build("/new_h5/h5")
.withSerializable("routerParam", params).navigation()
} catch (e: NullPointerException) {
com.yidianling.common.tools.LogUtil.e("params参数为空")
} catch (e: UnsupportedEncodingException) {
com.yidianling.common.tools.LogUtil.e("解码错误")
} catch (e: UnsupportedOperationException) {
com.yidianling.common.tools.LogUtil.e("这不是一个uri格式的地址")
}
}
}
}
}
6 -> {
if (!item.uid.isNullOrBlank()) {
(itemView.context as? Activity)?.let { it1 ->
ARouter.getInstance().navigation(IImService::class.java)
?.startChatBySessionId(it1, item.uid!!)
}
}
}
2, 3 -> {//离线,通话中
(itemView.context as? Activity)?.let { aty ->
findRouteService(IImService::class.java).startChat(aty, item.uid!!, 0, 0)
......@@ -84,8 +123,14 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
else -> {
if (!item.confideId.isNullOrBlank()) {
ConfideWebServiceImpl().connectionJava(item.confideId!!.toInt(), 3, it.context as Activity, null) {
showDoctorDetail(item, true)
if (!YDLavManager.isOnlineRtm) {
YDLavManager.instances.login(
PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ ->
showPayOrDetail(item, it)
}
} else {
showPayOrDetail(item, it)
}
}
}
......@@ -131,7 +176,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item.confideId ?: "",
"4"
)
showDoctorDetail(item,false)
showDoctorDetail(item, false)
}
binding.ivAvatar.setOnClickListener {
ActionCountUtils.record(
......@@ -147,7 +192,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item.confideId ?: "",
"3"
)
showDoctorDetail(item,false)
showDoctorDetail(item, false)
}
binding.vDisableClick.setOnClickListener { }
binding.btnShare.setOnClickListener {
......@@ -226,12 +271,19 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/" + R.drawable.first_order))
.setUri(Uri.parse("res://drawable/" + R.drawable.confide_first_order))
.setOldController(binding.confideFirstFree.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
binding.confideFirstFree.controller = controller
val freeController: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/" + R.drawable.confide_free))
.setOldController(binding.free.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
binding.free.controller = freeController
binding.seekbar.progress = 0
binding.seekbar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
......@@ -263,6 +315,17 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
if (item.isVideo) View.GONE else if (item.playUrl.isNullOrBlank()) View.GONE else View.VISIBLE
}
private fun showPayOrDetail(item: VideoViewModel, it: View) {
ConfideWebServiceImpl().connectionJava(
item.confideId!!.toInt(),
3,
it.context as Activity,
null
) {
showDoctorDetail(item, true)
}
}
fun onAttach(videoView: IjkVideoView) {
this.video = videoView
binding.videoView.addView(videoView)
......@@ -322,15 +385,18 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
disposable?.dispose()
}
private fun showDoctorDetail(item: VideoViewModel,toPay:Boolean) {
private fun showDoctorDetail(item: VideoViewModel, toPay: Boolean) {
item.confideId?.let {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)+ if(toPay) "&payPage=1" else ""
val url =
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it) + if (toPay) "&payPage=1" else ""
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
itemView.context as FragmentActivity,
url,
item.doctorId!!,
uid = item.uid
uid = item.uid,
listenFree = item.listenFree.get(),
expertUrl = item.linkedUrl.get() ?: ""
)
}
}
......@@ -352,6 +418,8 @@ class VideoViewModel {
var uid: String? = null
var doctorId: String? = null
var confideId: String? = null
var listenFree = ObservableBoolean(false)
var linkedUrl = ObservableField<String>("")
}
private fun genMinProgramPath(url: String): String {
......@@ -363,6 +431,7 @@ private fun genMinProgramPath(url: String): String {
internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
name.set(bean.confidedName)
avatar.set(bean.confidedIcon)
linkedUrl.set(bean.linkUrl)
val num = bean.confideNum?.replace("人", "") ?: "0"
count.set("倾诉人次 $num")
intro.set(bean.confideContent)
......@@ -385,6 +454,11 @@ internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
uid = bean.uid?.toString()
doctorId = bean.doctorId
confideId = bean.confidedId
if (bean.listenFree == null) {
listenFree.set(false)
} else {
listenFree.set(bean.listenFree!!)
}
return this
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="40dp"/>
<solid android:color="#F7F7F7" />
<stroke android:width="1px" android:color="#E6E6E6"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="29dp"
android:height="29dp"
android:viewportWidth="29"
android:viewportHeight="29">
<path
android:pathData="M14.5,14.5m-14.5,0a14.5,14.5 0,1 1,29 0a14.5,14.5 0,1 1,-29 0"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
<path
android:pathData="M20.2426,8.6932C18.9653,7.6331 17.3222,7.1176 15.6208,7.2388C15.3959,7.258 15.2304,7.4463 15.2496,7.6712C15.2559,7.7747 15.3054,7.8742 15.3831,7.951C15.4616,8.0192 15.5692,8.0562 15.6727,8.05C17.1662,7.9498 18.6111,8.3931 19.7304,9.3251C20.8506,10.2486 21.5134,11.5269 21.6149,12.9262C21.6283,13.1248 21.7836,13.2783 21.9786,13.2988C22.0041,13.3015 22.021,13.3032 22.0474,13.2974C22.2722,13.2782 22.4378,13.0899 22.4185,12.865C22.3072,11.2332 21.5368,9.755 20.2426,8.6932Z"
android:strokeWidth="1"
android:fillColor="#5ECEA9"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
<path
android:pathData="M15.6922,10.0665C16.5646,10.0038 17.4031,10.2634 18.0577,10.8037C18.7048,11.3346 19.0896,12.0779 19.15,12.89C19.1634,13.0886 19.3187,13.2421 19.5137,13.2626C19.5391,13.2652 19.5561,13.267 19.5824,13.2612C19.8073,13.242 19.9728,13.0537 19.9536,12.8288C19.8825,11.7927 19.3902,10.8494 18.569,10.1802C17.7563,9.5119 16.7112,9.1792 15.6403,9.2552C15.4154,9.2745 15.2499,9.4628 15.2691,9.6877C15.2799,9.9117 15.4673,10.0857 15.6922,10.0665Z"
android:strokeWidth="1"
android:fillColor="#5ECEA9"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
<path
android:pathData="M15.1838,11.9674C15.2624,12.0357 15.3699,12.0727 15.4734,12.0664C15.9138,12.0356 16.3373,12.1658 16.6685,12.4406C16.992,12.7061 17.1844,13.0778 17.2103,13.4834C17.2238,13.6819 17.3791,13.8354 17.5656,13.855C17.591,13.8577 17.6165,13.8604 17.6343,13.8537C17.8592,13.8344 18.0247,13.6461 18.0055,13.4212C17.9603,12.7907 17.6604,12.2192 17.1628,11.8154C16.6737,11.4125 16.0436,11.2092 15.3952,11.261C15.1703,11.2803 15.0048,11.4686 15.024,11.6935C15.0557,11.7997 15.1053,11.8992 15.1838,11.9674Z"
android:strokeWidth="1"
android:fillColor="#5ECEA9"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
<path
android:pathData="M19.0824,17.506C18.6476,17.1991 18.1958,16.9178 17.7951,16.7132C17.1472,16.3722 16.8573,16.3295 16.7039,16.3295C16.3714,16.3295 16.0816,16.5 15.8514,16.841C15.7065,17.0542 15.5956,17.3014 15.4933,17.5401C15.4422,17.6509 15.3569,17.864 15.2887,17.9749C15.1609,17.9322 14.854,17.8044 14.3084,17.4293C13.7713,17.0627 13.1831,16.5853 12.7398,16.1505C12.305,15.7072 11.8276,15.119 11.461,14.5734C11.0859,14.0193 10.958,13.7209 10.9154,13.593C11.0262,13.5248 11.2308,13.4395 11.3587,13.3799C11.5974,13.2776 11.8446,13.1667 12.0492,13.0218C12.3817,12.7916 12.5522,12.5018 12.5522,12.1693C12.5522,12.0073 12.5096,11.726 12.1686,11.0696C11.964,10.6774 11.6826,10.2171 11.3757,9.7823C11.1456,9.4584 10.8046,8.9895 10.438,8.6144C10.0117,8.1711 9.6878,7.975 9.3724,7.975C8.6477,7.975 7.8549,8.9383 7.5395,9.3475C7.2411,9.7653 6.525,10.8224 6.525,11.8283C6.525,12.7661 7.1388,13.9681 7.6588,14.8121C8.3494,15.9289 9.2956,17.1394 10.3357,18.205L10.6767,18.546C11.7423,19.5861 12.9444,20.5409 14.0611,21.2314C14.9051,21.7515 16.0986,22.3653 17.0364,22.3653C18.0423,22.3653 19.0994,21.6492 19.5086,21.3423C19.9178,21.0354 20.8812,20.234 20.8812,19.5094C20.8812,19.1939 20.6851,18.8615 20.2418,18.4352C19.8752,18.0857 19.4063,17.7362 19.0824,17.506Z"
android:strokeWidth="1"
android:fillColor="#5ECEA9"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
<path
android:pathData="M10.3186,12.7405C10.0032,12.9536 9.8498,13.2094 9.8583,13.5163C9.8583,13.6527 9.8753,14.0704 10.6085,15.1531C11.0092,15.7413 11.5292,16.3892 12.0151,16.8837C12.5011,17.3525 13.1404,17.8811 13.7287,18.2818C14.8113,19.0234 15.2291,19.032 15.3825,19.032C15.6809,19.032 15.9366,18.87 16.1412,18.5631C16.2606,18.3841 16.3629,18.1539 16.4481,17.9408C16.5163,17.7788 16.5931,17.6083 16.6613,17.4889C16.6954,17.4293 16.7209,17.3952 16.738,17.3781C16.8147,17.3952 16.9852,17.4548 17.3092,17.6253C17.6416,17.8044 18.0423,18.0431 18.4174,18.3073C19.3552,18.9552 19.7473,19.3986 19.8411,19.5435C19.8155,19.5946 19.7559,19.7055 19.6109,19.876C19.4234,20.0976 19.1506,20.3363 18.8607,20.558C18.1958,21.0524 17.5138,21.3423 17.0449,21.3423C16.5078,21.3423 15.6212,20.9842 14.6153,20.3619C13.5667,19.714 12.4243,18.8103 11.4098,17.8214L11.0859,17.4889C10.097,16.4745 9.1933,15.3321 8.5454,14.275C7.9231,13.2605 7.5651,12.3739 7.5651,11.8368C7.5651,11.3594 7.8549,10.686 8.3494,10.0125C8.5625,9.7141 8.8097,9.4498 9.0228,9.2623C9.1933,9.1174 9.3042,9.0492 9.3553,9.0321C9.5002,9.1259 9.9435,9.518 10.5914,10.4558C10.8557,10.8394 11.0944,11.2401 11.2734,11.5726C11.4439,11.8965 11.5036,12.067 11.5207,12.1437C11.5036,12.1608 11.4695,12.1864 11.4098,12.2205C11.282,12.2972 11.1115,12.3739 10.941,12.4421C10.7193,12.5274 10.5062,12.6211 10.3186,12.7405Z"
android:strokeWidth="1"
android:fillColor="#5ECEA9"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>
......@@ -3,8 +3,8 @@
android:shape="rectangle">
<corners
android:radius="8dp"/>
android:radius="26dp"/>
<solid android:color="#ffffff"/>
<solid android:color="#61CEAC"/>
</shape>
\ No newline at end of file
......@@ -2,10 +2,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@color/confide_61CEAC"
android:endColor="@color/confide_48CC95"/>
<!-- <gradient-->
<!-- android:startColor="@color/confide_61CEAC"-->
<!-- android:endColor="@color/confide_48CC95"/>-->
<corners android:radius="8dp" />
<solid android:color="@color/white"/>
<corners android:radius="15dp" />
</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">
<size android:width="1dp" />
<span style="font-family: Arial, Helvetica, sans-serif;"/>
<solid android:color="@color/platform_main_theme" />
</shape>
\ No newline at end of file
......@@ -6,5 +6,5 @@
android:startColor="#61CEAC" />
<stroke
android:width="1dp"
android:color="#69FFFFFF" />
android:color="#48CC95" />
</shape>
\ No newline at end of file
......@@ -6,5 +6,5 @@
android:startColor="#D5D6D7" />
<stroke
android:width="1dp"
android:color="#69FFFFFF" />
android:color="#BBC1CD" />
</shape>
\ No newline at end of file
......@@ -6,5 +6,5 @@
android:startColor="#F6B37F" />
<stroke
android:width="1dp"
android:color="#69FFFFFF" />
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:radius="26dp" />
<gradient
android:endColor="#FE745B"
android:startColor="#FF8772" />
<stroke
android:width="1dp"
android:color="#FE745B" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="7dp"
android:height="8dp"
android:viewportWidth="7"
android:viewportHeight="8">
<path
android:pathData="M0,0h7v7h-7z"
android:strokeAlpha="0"
android:strokeWidth="1"
android:fillColor="#54B6F3"
android:fillType="nonZero"
android:strokeColor="#00000000"
android:fillAlpha="0"/>
<path
android:pathData="M2.7,7.41143l-0.55918,-0.50312l2.42266,-2.69199l-2.56348,-2.69814l0.54551,-0.51816l3.04199,3.20264z"
android:strokeWidth="1"
android:fillColor="#55B7F3"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>
......@@ -83,12 +83,24 @@
app:layout_constraintCircleRadius="70dp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/free"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/first_order"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"/>
app:layout_constraintCircleRadius="70dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<LinearLayout
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/empty_rl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:layout_marginTop="100dp"
android:orientation="vertical"
>
<ImageView
android:id="@+id/empty_img"
android:layout_width="180dp"
android:layout_height="120dp"
android:src="@drawable/platform_ico_img_zixun_empty" />
<TextView
android:id="@+id/hint_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_35"
android:text="没有搜到相关信息,换个关键词看看吧"
android:textColor="@color/platform_color_999999"
android:textSize="14dp" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -16,12 +16,13 @@
<com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="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_height="52dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
......@@ -33,14 +34,14 @@
android:elevation="2dp"
android:paddingBottom="1dp"
android:paddingRight="@dimen/platform_dp_8"
android:visibility="gone"
tools:visibility="visible">
android:visibility="visible">
<ImageView
android:id="@+id/confide_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/confide_call_logo"
android:layout_marginStart="8dp"
android:src="@drawable/confide_call_logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
......@@ -57,8 +58,9 @@
android:gravity="center_vertical"
android:maxLines="1"
android:text="智能推荐,一键倾诉"
android:textColor="@color/platform_color_333333"
android:textColor="@color/white"
android:textSize="14dp"
android:textStyle="bold"
android:layout_marginStart="@dimen/platform_dp_8"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/confide_logo"
......@@ -85,9 +87,10 @@
android:paddingRight="@dimen/platform_dp_7"
android:text="我要倾诉"
android:layout_marginTop="@dimen/platform_dp_12"
android:textColor="@color/white"
android:textColor="#55CDA0"
android:textSize="13sp"
android:drawableRight="@drawable/confide_right_arrow" />
android:textStyle="bold"
app:drawableRightCompat="@drawable/confide_right_arrow" />
<ImageView
android:id="@+id/confideRed"
......@@ -137,11 +140,75 @@
android:background="#80000000"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/rl_search_head"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_48"
android:background="@color/white"
android:visibility="gone"
tools:visibility="gone">
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/confide_dp_15"
android:layout_marginRight="@dimen/confide_dp_15"
android:background="@drawable/confide_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/platform_dp_25"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/confide_icon_input_search"
android:tag="tag_search_input_img" />
<TextView
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:hint="请输入倾诉师姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@drawable/confide_edit_cursor_drawable"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
</RelativeLayout>
<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:layout_below="@+id/rl_search_head"
android:visibility="gone"
tools:visibility="gone"/>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_search"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_48"
android:descendantFocusability="blocksDescendants"
>
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/confide_dp_15"
android:layout_marginRight="@dimen/confide_dp_15"
android:background="@drawable/confide_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/platform_dp_25"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/confide_icon_input_search"
android:tag="tag_search_input_img" />
<TextView
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:hint="请输入倾诉师姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@drawable/confide_edit_cursor_drawable"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_search"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_48"
android:paddingStart="15dp"
android:tag="tag_search_input"
>
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginRight="60dp"
android:background="@drawable/confide_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/confide_icon_input_search"
android:tag="tag_search_input_img" />
<EditText
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="请输入倾诉师姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@drawable/confide_edit_cursor_drawable"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
<TextView
android:id="@+id/tv_search_cancle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:padding="5dp"
android:text="取消"
android:textColor="#242424"
android:textSize="15dp" />
</RelativeLayout>
<View
android:id="@+id/v_topLine"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="@+id/rl_search"
android:layout_marginTop="@dimen/platform_dp_6"
android:background="@color/platform_color_E0E0E0"
/>
</LinearLayout>
\ No newline at end of file
......@@ -100,7 +100,7 @@
android:layout_width="160dp"
android:layout_height="47dp"
android:layout_marginBottom="28dp"
android:background="@{item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
android:background="@{(item.lineStatus == 5 || item.lineStatus == 6) ? @drawable/confide_offline_book_bg : item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
......@@ -166,13 +166,24 @@
app:layout_constraintCircleRadius="70dp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/free"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
android:visibility="@{item.listenFree?View.VISIBLE:View.GONE}"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"
tools:ignore="MissingConstraints" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/confide_first_free"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp" />
app:layout_constraintCircleRadius="70dp"
tools:ignore="MissingConstraints" />
<TextView
android:id="@+id/tvTag"
......
......@@ -27,6 +27,7 @@ import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.ui.LogoLoadingView
......@@ -42,6 +43,7 @@ import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.adapter.ExpertSearchAdapter
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.listener.OnExpertClickListener
import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.listener.OnSortItemSelectedListener
import com.yidianling.consultant.model.bean.*
......@@ -89,8 +91,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) &&
(ffrom.startsWith("ATK_android_yyjlcs"))
(ffrom.endsWith(ChannelConfig.Xinliceshiyiyu.name))
) {
//抑郁焦虑测试
rl_hot_fix_for_huawei.visibility = View.GONE
} else {
rl_hot_fix_for_huawei.visibility = View.VISIBLE
......@@ -142,6 +145,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
const val FROM_FIND_EXPERT = 1
const val FROM_ONLINE_EXPERT = 2
const val PAGE_SIZE = 15
//列表点击回来不刷新列表
var needRefresh = true;
}
private val allFilter = AllFilter() //当前筛选
......@@ -192,7 +197,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
srlContainer.isEnabled = i >= 0
})
doctorAdapter = ExpertSearchAdapter(mContext, this, doctorList)
doctorAdapter = ExpertSearchAdapter(mContext, this, doctorList,object :OnExpertClickListener{
override fun onExpertClick() {
needRefresh = false
}
})
rvExperts.adapter = doctorAdapter
val layoutManager = LinearLayoutManager(
......@@ -1420,7 +1430,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onResume() {
super.onResume()
refresh(false)
if (needRefresh){
refresh(false)
}else{
//
needRefresh = true
}
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6")
}
......
......@@ -61,7 +61,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if (allFilter.categoryId2List.size>0){
val categoryMap2 = HashMap<String, Any>()
val categoryIdMap2 = HashMap<String, Any>()
categoryIdMap2["in"] = allFilter.categoryId2List
categoryIdMap2["in"] = allFilter.categoryId2List.toSortedSet().toList()
categoryMap2["product_cates.category_id2"] = categoryIdMap2
categoryList.add(categoryMap2)
}
......@@ -69,7 +69,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if (allFilter.categoryId3List.size>0){
val categoryMap3 = HashMap<String, Any>()
val categoryIdMap3 = HashMap<String, Any>()
categoryIdMap3["in"] = allFilter.categoryId3List
categoryIdMap3["in"] = allFilter.categoryId3List.toSortedSet().toList()
categoryMap3["product_cates.category_id3"] = categoryIdMap3
categoryList.add(categoryMap3)
}
......@@ -105,7 +105,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
val wayMap = HashMap<String, Any>()
wayMap["in"] = way
filterMap["service_type_list.service_type"] = wayMap
filterMap["product_specs.spec_id"] = wayMap
}
// 服务均价
if (allFilter.priceRanges != null) {
......@@ -187,9 +187,6 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
fieldsMap["doctor_name"] = true
fieldsMap["uid"] = true
fieldsMap["chat_status"] = true
// fieldsMap["consult_status"] = true
// fieldsMap["listen_status"] = true
// fieldsMap["booking_status"] = true
fieldsMap["gender"] = true
fieldsMap["years"] = true
fieldsMap["head"] = true
......
......@@ -26,6 +26,7 @@ import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.consultant.IExpertSearchView
import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.listener.OnExpertClickListener
import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn
......@@ -46,7 +47,8 @@ import java.math.BigDecimal
class ExpertSearchAdapter(
private val context: Context,
private val expertSearchView: IExpertSearchView,
private val listData: ArrayList<ExpertServiceItem>
private val listData: ArrayList<ExpertServiceItem>,
private val onExpertClick: OnExpertClickListener? = null
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
......@@ -547,6 +549,7 @@ class ExpertSearchAdapter(
if (!TextUtils.isEmpty(cateId)) {
linkUrl = URLUtils.appendParmas(linkUrl, "cateId", cateId)
}
onExpertClick?.onExpertClick()
TempH5RouteUtils.tempH5Route(linkUrl)
// 埋点
......@@ -574,6 +577,7 @@ class ExpertSearchAdapter(
doctor.id ?: ""
)
}
onExpertClick?.onExpertClick()
//判断是否已登录
if (!ConsultantIn.getUserImpl().loginByOneKeyLogin(context, true)) {
return@setOnClickListener
......
package com.yidianling.consultant.listener
/**
* 倾诉列表点击事件
* */
interface OnExpertClickListener {
/**
* 用户解决咨询列表点击后返回会刷新列表数据问题
* */
fun onExpertClick()
}
\ No newline at end of file
......@@ -37,7 +37,11 @@ import kotlin.math.roundToInt
* 筛选弹窗
* Created by zqk on 17-9-15.
*/
class FilterPopupWindow(private val context: Context, private val filterData: Filters, private val tempFilter: AllFilter) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
class FilterPopupWindow(
private val context: Context,
private val filterData: Filters,
private val tempFilter: AllFilter
) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private val mDisposableList = CompositeDisposable()
......@@ -139,7 +143,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
tempFilter.showType = filterData.showType[0]
tempFilter.ages.clear()
tempFilter.doctorEdu.clear()
tempFilter.enquiries.clear()
// 擅长人群
tempFilter.specialityCrowd.clear()
tempFilter.others.clear()
......@@ -158,17 +161,26 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
showTypeViews[1].isSelected = true
for (v in enquiryViews) {
v.isSelected = false
if (v is TextView) {
v.paint.isFakeBoldText = false
val textView: TextView = v.findViewById(R.id.tvFilterName)
val ivIcon: ImageView = v.findViewById(R.id.iv_consultant_method)
textView.paint.isFakeBoldText = false
tempFilter.enquiries.forEach {
if (textView.text.toString() == it.value) {
Glide.with(context)
.load(it.unCheckUrl)
.into(ivIcon)
}
}
}
tempFilter.enquiries.clear()
for (v in ageViews) {
v.isSelected = false
if (v is TextView) {
v.paint.isFakeBoldText = false
}
}
for (v in goodAtViews){
for (v in goodAtViews) {
v.isSelected = false
v.paint.isFakeBoldText = false
}
......@@ -325,6 +337,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
fun addSubscription(disposable: Disposable) {
mDisposableList.add(disposable)
}
/**
* 其他选择
* */
......@@ -413,13 +426,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
if (text == "展开") {
view.tv_crowd_open.text = "收起"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_close)
for (i in 20 until goodAtViews.size){
for (i in 20 until goodAtViews.size) {
goodAtViews[i].visibility = View.VISIBLE
}
} else {
view.tv_crowd_open.text = "展开"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_open)
for (i in 20 until goodAtViews.size){
for (i in 20 until goodAtViews.size) {
goodAtViews[i].visibility = View.GONE
}
}
......@@ -452,7 +465,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
}
}
if (index>19){
if (index > 19) {
textView.visibility = View.GONE
}
goodAtViews.add(textView)
......@@ -460,6 +473,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
}
}
/**
* 年龄
* */
......@@ -500,6 +514,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
view.flAge.addView(textView)
}
}
/**
* 学历
* */
......@@ -545,8 +560,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, enquiry) in filterData.enquiry.withIndex()) {
val llLayout = View.inflate(context, R.layout.consultant_method_item_filter, null)
val textView:TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon:ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val textView: TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon: ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f)
params.setMargins(
......@@ -561,7 +576,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
.load(enquiry.unCheckUrl)
.into(ivIcon)
enquiryViews.add(view)
enquiryViews.add(llLayout)
if (tempFilter.enquiries.contains(enquiry)) {
llLayout.isSelected = true
textView.paint.isFakeBoldText = true
......
......@@ -6,7 +6,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvRegion"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/platform_white"
android:layout_weight="1"
......@@ -15,7 +15,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvSub"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/platform_color_F7F7F7"
android:layout_weight="2"
......
......@@ -101,7 +101,7 @@ dependencies {
implementation modularPublication('com.ydl:m-course-api')
implementation modularPublication('com.ydl:m-fm-api')
implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-confide-api')
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-pay"]
......
......@@ -137,7 +137,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
initListeners();
// initDatas();
setTabSelection(0);
StatusBarUtils.Companion.setCustomStatusView(this,members_title_rel,true);
StatusBarUtils.Companion.setCustomStatusViewForMembers(this,members_title_rel,true);
}
private void initEvent() {
......
......@@ -37,6 +37,7 @@ import com.yidianling.dynamic.trendList.adapter.RecommendTopicListAdapter
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTER_STATE_NO_DATA
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_LOAD_MORE
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_INIT
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
if (trend_list_no_datas_rel!!.visibility != View.GONE) {
trend_list_no_datas_rel!!.visibility = View.GONE
}
if (cdl!!.visibility != View.VISIBLE) {
cdl!!.visibility = View.VISIBLE
}
}
private fun showErrorView() {
if (page == 1) {
cdl!!.visibility = View.GONE
trend_list_no_datas_rel!!.visibility = View.VISIBLE
} else {
cdl!!.visibility = View.VISIBLE
trend_list_no_datas_rel!!.visibility = View.GONE
}
}
......@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
} else {
LogUtil.i("get datas no more data$data")
trendsDatas!!.addAll(data)
if (trendsDatas == null || trendsDatas!!.size <= 0) {
cdl!!.visibility = View.GONE
if (trendsDatas == null || trendsDatas!!.size == 0) {
mRcvAdapter!!.setDatas(trendsDatas, FOOTRE_STATE_INIT)
if (page == 1) {
mRcvAdapter!!.notifyDataSetChanged()
}
trend_list_no_datas_rel!!.visibility = View.VISIBLE
return
}
......
<?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/trends_lastr_swl"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:background="@color/dynamic_white">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/cdl"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/trends_rcv"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/trends_rcv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dynamic_f5f5f5"
android:descendantFocusability="blocksDescendants"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/image_scroll_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="85dp"
android:layout_marginRight="28dp"
android:padding="0dp"
android:background="@color/dynamic_white"
android:src="@drawable/dynamic_newsfeed_top"
android:visibility="visible"
app:backgroundTint="@color/dynamic_white"
app:borderWidth="0dp"
app:fabSize="mini"
android:scaleType="center"
app:layout_anchor="@+id/trends_rcv"
app:layout_anchorGravity="bottom|right|end"
app:layout_behavior="com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/recommend_trend_add_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:background="@color/platform_main_theme"
android:elevation="3dp"
android:padding="0dp"
android:src="@drawable/dynamic_newsfeed_new2"
app:backgroundTint="@color/platform_main_theme"
app:borderWidth="0dp"
app:fabSize="normal"
app:layout_anchor="@+id/trends_rcv"
app:layout_anchorGravity="bottom|right|end"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
android:layout_height="match_parent"
android:background="@color/dynamic_f5f5f5"
android:descendantFocusability="blocksDescendants"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<RelativeLayout
android:id="@+id/trend_list_no_datas_rel"
......@@ -77,7 +31,7 @@
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/dynamic_blank"/>
android:src="@drawable/dynamic_blank" />
<TextView
android:layout_width="wrap_content"
......@@ -86,11 +40,44 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:text="暂无相关记录~"
android:textColor="@color/dynamic_text_gray"/>
android:textColor="@color/dynamic_text_gray" />
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/image_scroll_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="28dp"
android:layout_marginBottom="85dp"
android:background="@color/dynamic_white"
android:padding="0dp"
android:scaleType="center"
android:src="@drawable/dynamic_newsfeed_top"
android:visibility="visible"
app:backgroundTint="@color/dynamic_white"
app:borderWidth="0dp"
app:fabSize="mini"
app:layout_anchor="@+id/trends_rcv"
app:layout_anchorGravity="bottom|right|end"
app:layout_behavior="com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/recommend_trend_add_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:background="@color/platform_main_theme"
android:elevation="3dp"
android:padding="0dp"
android:src="@drawable/dynamic_newsfeed_new2"
app:backgroundTint="@color/platform_main_theme"
app:borderWidth="0dp"
app:fabSize="normal"
app:layout_anchor="@+id/trends_rcv"
app:layout_anchorGravity="bottom|right|end" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout>
</com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout>
\ No newline at end of file
......@@ -82,7 +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(':api:confide')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
......
......@@ -38,6 +38,7 @@ class HomeConfideBean : HomeItemBaseBean {
var confideLine: Int = 0
var confideAddress: String? = null
var confidePraise: String? = null
var confidePraiseScore: String? = null
/**
* 实际费用
*/
......@@ -63,5 +64,7 @@ class HomeConfideBean : HomeItemBaseBean {
* 红包展示文本
*/
var couponText : String? = null
var listenFree: Boolean? = null
}
}
......@@ -176,7 +176,13 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
if (!TextUtils.isEmpty(doctorName)) {
searchText = doctorName
}
home_tv.setOnClickListener { homeEvent?.searchTvClick(searchText) }
home_tv.setOnClickListener {
homeEvent?.searchTvClick(searchText)
}
iv_search_icon.setOnClickListener {
homeEvent?.searchTvClick(searchText)
}
home_tv.text = searchText
}
......
......@@ -2,18 +2,19 @@ package com.yidianling.home.ui.view
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Paint
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.blankj.utilcode.util.SpanUtils
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConfideBean
import kotlinx.android.synthetic.ydl.home_confide_expert_info_view.view.*
import kotlinx.android.synthetic.ydl.home_confide_item_layout.view.*
/**
* @author jiucheng
......@@ -34,7 +35,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.home_confide_expert_info_view, this)
View.inflate(context, R.layout.home_confide_item_layout, this)
}
fun setData(bean: HomeConfideBean.BodyBean?, position: Int, isLast: Boolean) {
......@@ -44,12 +45,21 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
}
//设置头像
setHead(bean)
setListenAndScore(bean)
setFreeStatus(bean)
setConfideTag(bean)
setLineStatus(bean)
//设置名称
tv_name.text = bean.confidedName
//设置倾诉标签View的最大宽度
tag_view.setConfideWidth()
// tag_view.setConfideWidth()
//咨询师标签
tag_view.initData(bean.confidedTag as MutableList<String>)
// tag_view.initData(bean.confidedTag as MutableList<String>)
//设置向TA倾诉人数
setConfideNum(bean)
//设置接通率文案
......@@ -57,7 +67,11 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
//设置向TA倾诉按钮状态
setConfideButton(bean)
//设置红包、原价
setCoupon(bean)
// setCoupon(bean)
//设置咨询师简介
tv_content.text = bean.confideContent
//最后一项显示分割线
if (isLast) {
view_line.visibility = View.GONE
......@@ -73,11 +87,22 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
* 设置头像
*/
private fun setHead(bean: HomeConfideBean.BodyBean) {
val op = SimpleImageOpConfiger()
op.errorPic = R.drawable.platform_head_place_hold_pic
op.loadingPic = R.drawable.platform_head_place_hold_pic
op.transform = 0
YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
// val op = SimpleImageOpConfiger()
// op.errorPic = R.drawable.platform_head_place_hold_pic
// op.loadingPic = R.drawable.platform_head_place_hold_pic
// op.transform = 0
// YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
//这样处理 是防止 滑动过程中 反复去加载图片
if (!TextUtils.isEmpty(bean.confidedIcon) && img_head.getTag(R.id.img_head) != bean.confidedIcon) {
GlideApp.with(context)
.load(bean.confidedIcon)
// .override(dp96, dp96)
.into(img_head)
img_head.setTag(R.id.img_head, bean.confidedIcon)
}
}
/**
......@@ -135,41 +160,102 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
}
}
private fun setListenAndScore(bodyBean: HomeConfideBean.BodyBean) {
SpanUtils.with(price_content).append(bodyBean.confideFee)
.setForegroundColor(resources.getColor(R.color.home_confide_fe6040)).setFontSize(18, true)
.append("元").setForegroundColor(resources.getColor(R.color.home_confide_fe6040))
.setFontSize(11, true)
.append("/25分钟").setForegroundColor(resources.getColor(R.color.home_confide_aaaeba))
.setFontSize(11, true)
.create()
tv_score.text = bodyBean.confidePraiseScore
}
/**
* 设置红包、原价
* 设置在线状态
*/
@SuppressLint("SetTextI18n")
private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) {
private fun setLineStatus(bodyBean: HomeConfideBean.BodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 4 -> {
tv_online.text = "在线"
tv_online.setBackgroundResource(R.drawable.home_confide_online_main)
}
2 -> {
tv_online.text = "离线"
tv_online.setBackgroundResource(R.drawable.home_confide_offline_bg)
}
3 -> {
tv_online.text = "通话中"
tv_online.setBackgroundResource(R.drawable.home_confide_online_main)
}
}
}
if(!TextUtils.isEmpty(bodyBean.couponText)){
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
}else{
tvCoupon.visibility = View.GONE
private fun setConfideTag(bodyBean: HomeConfideBean.BodyBean) {
if (null == bodyBean.confidedTag || bodyBean.confidedTag!!.isEmpty()) {
return
}
if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
tvOriginalPrice.visibility = View.GONE
}else{
tvOriginalPrice.visibility = View.VISIBLE
val originalBuffer = StringBuffer()
originalBuffer.append(bodyBean.confideFee).append("元/次")
tvOriginalPrice.text = originalBuffer.toString()
//添加删除线
tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
var i = 0
val sb = StringBuilder()
for (tag in bodyBean.confidedTag!!) {
if (i > 4) break
sb.append(tag).append(" | ")
i++
}
try {
val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
val confideFee = bodyBean.confideFee!!.toFloat().toInt()
if (couponMoney >= confideFee){
tv_price.text = "¥0"
}else{
val price = confideFee - couponMoney
tv_price.text = "¥"+price.toString()
}
}catch (e:Exception){
//防止数据类型变化引起奔溃
if (sb.length > 3) {
sb.setLength(sb.length - 3)
}
flowlayout_tag.text = sb.toString()
}
private fun setFreeStatus(bodyBean: HomeConfideBean.BodyBean) {
if (bodyBean.listenFree == true && bodyBean.confideLine == 1) {
confide_free_logo.visibility = VISIBLE
Glide.with(context)
.load(R.drawable.home_confide__free)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(confide_free_logo)
} else {
confide_free_logo.visibility = GONE
}
}
/**
* 设置红包、原价
*/
@SuppressLint("SetTextI18n")
private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) {
// if(!TextUtils.isEmpty(bodyBean.couponText)){
// tvCoupon.text = bodyBean.couponText
// tvCoupon.visibility = View.VISIBLE
// }else{
// tvCoupon.visibility = View.GONE
// }
// if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
// tvOriginalPrice.visibility = View.GONE
// }else{
// tvOriginalPrice.visibility = View.VISIBLE
// val originalBuffer = StringBuffer()
// originalBuffer.append(bodyBean.confideFee).append("元/次")
// tvOriginalPrice.text = originalBuffer.toString()
// //添加删除线
// tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
// }
// try {
// val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
// val confideFee = bodyBean.confideFee!!.toFloat().toInt()
//
// if (couponMoney >= confideFee){
// tv_price.text = "¥0"
// }else{
// val price = confideFee - couponMoney
// tv_price.text = "¥"+price.toString()
// }
// }catch (e:Exception){
// //防止数据类型变化引起奔溃
// }
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#4d000000" />
</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="#4d000000" />
</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:topRightRadius="100dp"
android:bottomRightRadius="100dp"/>
<solid android:color="#40FFFFFF" />
</shape>
\ No newline at end of file
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