Commit 078525fc by 万齐军

merge release

parents 83c54fcc cea87958
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.2'
version = '1.0.3'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
......@@ -38,5 +38,7 @@ interface IConfideService : IProvider {
uid: String
)
fun isOnlineRtm():Boolean
fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?)
}
\ No newline at end of file
......@@ -9,11 +9,15 @@ 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.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
......@@ -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
......@@ -91,11 +95,15 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
YdlCommonRouterManager.initYdlCommonRoute(PlatformTempCommonRouteImpl())
// 初始化一键登录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()
reLoadData()
requestPermission()
bt_mdt.setOnClickListener {
val intent = Intent(this, MDTLoginActivity::class.java)
......@@ -115,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()
......@@ -160,7 +168,9 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
startActivity(Intent(this, CollectSexAndBirthActivity::class.java))
}
bt_to_confide.setOnClickListener {
YDLavManager.instances.login(ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid)
YDLavManager.instances.login(
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
)
startActivity(Intent(this, ConfideHomeActivity::class.java))
}
......@@ -226,7 +236,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_privacy.setOnClickListener {
startActivity(Intent(this@MainActivity, TestAppActivity::class.java))
}
}
......@@ -240,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()
}
}
}
......@@ -266,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() {
......@@ -280,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() {
......@@ -288,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")
......@@ -297,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()
......@@ -318,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
}
......
......@@ -44,12 +44,12 @@ class JsMethod(private val webView: WebView?) {
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" -> {
......
ext {
dev_mode = false
dev_mode = false //组件发布的时候需要设置为false
ydl2PublishVersion = "0.2.0.3-SNAPSHOT"
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.42",
"m-consultant" : "0.0.60.70",
"m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.74",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.55",
"m-home" : "0.0.23.95",
"m-im" : "0.0.21.63",
"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.81",
"m-tests" : "0.0.24.18",
"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.44",
"ydl-platform" : "0.0.41.51",
//第二步 若干
"ydl-webview" : "0.0.38.94",
"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.38",
"ydl-flutter-base": "0.0.14.44",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
......@@ -214,7 +214,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydl2PublishVersion}", //组件化项目中的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
//基础组件 <<--- 先发这个,发完改这里的版本号
......@@ -234,7 +234,7 @@ ext {
"ydl-m-home-api" : "com.ydl:m-home-api:${ydlPublishVersion["m-home-api"]}",
"ydl-m-consultant-api" : "com.ydl:m-consultant-api:1.0.0",
"ydl-m-dynamic-api" : "com.ydl:m-dynamic-api:1.0.0",
"ydl-m-confide-api" : "com.ydl:m-confide-api:1.0.2",
"ydl-m-confide-api" : "com.ydl:m-confide-api:1.0.3",
"ydl-m-course-api" : "com.ydl:m-course-api:1.0.0",
]
......
......@@ -688,9 +688,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
......@@ -146,7 +146,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
uid = arguments?.getString(KEY_UID)
listen_free = arguments?.getBoolean(KEY_LISTEN_FREE) ?: false
onLoadDialStatus(doctorId)
// +
wv_content = view.findViewById<ProgressWebView>(com.ydl.webview.R.id.wv_content)
wv_content.progressbar.visibility = View.GONE
close_webview_Icon = view.findViewById<View>(R.id.close_webview_Icon)
......@@ -396,7 +395,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
layout_change_text.visibility = View.VISIBLE
this.doctorId = doctorId
onLoadDialStatus(doctorId)
this.expertUrl = linkUrl
callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})")
}
......@@ -453,6 +451,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onProgressChanged(view: WebView, newProgress: Int) {
if (newProgress == 100) {
wv_content.progressbar.visibility = View.GONE
} else {
if (wv_content.progressbar.visibility == View.GONE) {
wv_content.progressbar.visibility = View.VISIBLE
}
wv_content.progressbar.progress = newProgress
}
if (newProgress == 100) {
callJsFun(wv_content, "setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
}
super.onProgressChanged(view, newProgress)
......@@ -586,7 +592,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
if (resp.code == "200") {
layoutCall.visibility = View.VISIBLE
lineStatus = resp.data?.confideLine ?: 2
expertUrl = resp.data?.linkUrl ?: ""
if (isLogin && listen_free) {
free.visibility = View.VISIBLE
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
......
......@@ -10,11 +10,11 @@ import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.TextView
import android.view.animation.AccelerateInterpolator
import android.view.animation.DecelerateInterpolator
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.SimpleItemAnimator
import com.alibaba.android.arouter.facade.annotation.Route
......@@ -24,6 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.audioim.YDLavManager
import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.home.adapter.ConfideHomeAdapter
......@@ -247,17 +248,29 @@ class ConfideHomeActivity :
}
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) {
ConfideWebServiceImpl().connectionJava(
confidedId.toInt(),
3,
this@ConfideHomeActivity,
null
) {
showDoctorDetail(confidedId, doctorId)
if (!YDLavManager.isOnlineRtm) {
YDLavManager.instances.login(
PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ ->
showPayOrDetail(confidedId, doctorId)
}
} else {
showPayOrDetail(confidedId, doctorId)
}
}
}
private fun showPayOrDetail(confidedId: String, doctorId: String) {
ConfideWebServiceImpl().connectionJava(
confidedId.toInt(),
3,
this@ConfideHomeActivity,
null
) {
showDoctorDetail(confidedId, doctorId)
}
}
private fun showDoctorDetail(confideId: String, doctorId: String) {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId) + "&payPage=1"
ConfideBottomSheetDialogFragment()
......
......@@ -2,6 +2,7 @@ package com.ydl.confide.home.bean
class DialStatus {
var confideLine: Int? = null
var linkUrl: String? = ""
var remainingTime: RemainingTime? = null
}
......
......@@ -114,6 +114,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() {
......
......@@ -17,6 +17,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse
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
......@@ -153,6 +154,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()
.submitOrderAndPay(ConnectParamJava("" + id, "" + type, callType ?: ""))
.subscribeOn(Schedulers.io())
......
......@@ -16,6 +16,7 @@ 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
......@@ -122,13 +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)
}
}
}
......@@ -313,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)
......
<?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
......@@ -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
......@@ -6,5 +6,5 @@
android:startColor="#FF8772" />
<stroke
android:width="1dp"
android:color="#69FFFFFF" />
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>
......@@ -22,7 +22,7 @@
<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"
......@@ -40,7 +40,8 @@
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"
......
......@@ -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
......@@ -90,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
......
......@@ -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"
......
......@@ -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
......@@ -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
}
......
......@@ -62,7 +62,8 @@
android:layout_below="@+id/tv_name_layout"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="6dp"
android:layout_marginEnd="@dimen/platform_dp_10"
android:layout_toLeftOf="@+id/tv_consult_chat"
android:layout_marginRight="@dimen/platform_dp_10"
android:layout_toEndOf="@+id/img_consult_head"
android:orientation="horizontal" />
......
......@@ -154,10 +154,10 @@
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_width="@dimen/platform_dp_26"
android:layout_height="@dimen/platform_dp_14"
android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp"
android:paddingLeft="12dp"
android:src="@drawable/home_icon_search"/>
<TextView
......
......@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.lifecycle.ILifecycleable;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.Utils;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.im.bean.MsgData;
import com.yidianling.im.config.constants.ImConstants;
......@@ -64,6 +65,9 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
}
((MsgListItemView) convertView).setData(mDataList.get(position));
convertView.setOnClickListener(v -> {
if (Utils.isFastClick()) {
return;
}
//动态消息暂时不需要访问以下接口
boolean fla = false;
//判断是否是跳转专家主页
......
......@@ -6,6 +6,7 @@ import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.Handler;
......@@ -50,6 +51,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.AnimUtils;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.Utils;
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
......@@ -185,6 +187,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private TextView tv_all_comment_desc;
private ImageView tv_all_comment_go;
private ImCommentBannerView comment_banner_view;
private TextView tvCommentCount;
private ImRedStarGradeView good_num_icons;
......@@ -259,8 +262,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
top_expert_info_ll = rootView.findViewById(R.id.top_expert_info_ll);
top_expert_info_cl = rootView.findViewById(R.id.top_expert_info_cl);
comment_banner_view_ll = rootView.findViewById(R.id.comment_banner_view_ll);
tv_all_comment_desc = rootView.findViewById(R.id.tv_all_comment_desc);
tv_all_comment_go = rootView.findViewById(R.id.tv_all_comment_go);
tvCommentCount = rootView.findViewById(R.id.tv_comment_count);
comment_banner_view = rootView.findViewById(R.id.comment_banner_view);
messageListView = rootView.findViewById(R.id.messageListView); // 消息列表
top_view_container = rootView.findViewById(R.id.top_view_container); // 消息列表
......@@ -851,13 +855,24 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
int commentCounter = ActionHandlerStorage.getL(sessionId).getInfo().commentCounter;
tv_all_comment_desc.setText(String.valueOf(commentCounter));
String commentCountInfo = String.format("评价(%d)", commentCounter);
tvCommentCount.setText(commentCountInfo);
Drawable drawable = getResources().getDrawable(R.drawable.platform_right_arrow);
drawable.setBounds(0, 0, 36, 36);
tvCommentCount.setCompoundDrawables(null, null, drawable, null);
tvCommentCount.setCompoundDrawablePadding(4);
H5Params params = new H5Params(ActionHandlerStorage.getL(sessionId).getInfo().commentCounterUrl, "");
View.OnClickListener onClickListener = v -> NewH5Activity.start(getActivity(), params);
tv_all_comment_desc.setOnClickListener(onClickListener);
tv_all_comment_go.setOnClickListener(onClickListener);
View.OnClickListener onClickListener = v -> {
if (Utils.isFastClick()) {
return;
}
ActionCountUtils.Companion.baiDuCountSign3("chat_page", "evaluate_lick_click", "", "", "");
NewH5Activity.start(getActivity(), params);
};
tvCommentCount.setOnClickListener(onClickListener);
comment_banner_view.initData(ActionHandlerStorage.getL(sessionId).getInfo().commentList);
......
......@@ -315,50 +315,15 @@
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:lines="1"
android:text="评价"
android:textColor="@color/platform_main_theme"
android:textSize="12dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="1dp"
android:lines="1"
android:text="("
android:textColor="@color/platform_main_theme"
android:textSize="12dp" />
<TextView
android:id="@+id/tv_all_comment_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:lines="1"
android:textColor="@color/platform_main_theme"
android:textSize="12dp"
tools:text="18714" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="1dp"
android:lines="1"
android:text=")"
android:textColor="@color/platform_main_theme"
android:textSize="12dp" />
<ImageView
android:id="@+id/tv_all_comment_go"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="center"
android:src="@drawable/platform_right_arrow" />
android:id="@+id/tv_comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical"
android:lines="1"
android:textColor="@color/platform_main_theme"
android:textSize="12sp"
tools:text="评价(10086)" />
</LinearLayout>
......
......@@ -5,32 +5,37 @@ package com.yidianling.muse.bean
* Created by xj on 2019/9/16.
*/
class MeditationPlayModuleBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
constructor() : super(false)
constructor(isRealEmpty: Boolean) : super(isRealEmpty)
var meditationId:Long? = null
var mediaId:Long? = null
var mediaType:Int?=null
var playDetailUrl:String? = null
var meditationId: Long? = null
var mediaId: Long? = null
var mediaType: Int? = null
var playDetailUrl: String? = null
val minProgramId: String? = null
val cateId: Int? = null
val tagId: String? = null
val mark: Int? = null
var mediaList: ArrayList<MeditationDetail>? = null
data class MeditationDetail(
val meditationType:Int? = null,
val mediaId:Long?=null,
val meditationId:Long,
val title:String,
val author:String,
val coverImageUrl:String,
val mediaUrl:String,
val duration:Float?=null,
val status:Int,
val broadcastTime:Int,
val businessType:Int,
val buried:String?=null,
val desc:String?=null,
val coverImageUrlIcon:String
)
val meditationType: Int? = null,
val mediaId: Long? = null,
val meditationId: Long,
val title: String,
val author: String,
val coverImageUrl: String,
val mediaUrl: String,
val duration: Float? = null,
val status: Int,
val broadcastTime: Int,
val businessType: Int,
val buried: String? = null,
val desc: String? = null,
val coverImageUrlIcon: String,
val videoId: String? = null
)
override fun toString(): String {
return "MeditationPlayModuleBean(meditationId=$meditationId, mediaId=$mediaId, mediaType=$mediaType, playDetailUrl=$playDetailUrl, mediaList=$mediaList)"
......
......@@ -11,6 +11,7 @@ import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.DialogFragment
import com.bumptech.glide.Glide
import com.umeng.socialize.bean.SHARE_MEDIA
......@@ -31,6 +32,8 @@ class ShareMeditationDialog : DialogFragment() {
private var llQQZone: LinearLayout? = null
private var llQQFriend: LinearLayout? = null
private var cslLayout: ConstraintLayout?=null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, R.style.share_meditation_dialog)
......@@ -49,21 +52,19 @@ class ShareMeditationDialog : DialogFragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.layout_share_meditation_dialog, container)
initView(view)
return view
}
private fun initView(view: View?) {
val shareImageUrl = arguments?.getString(KEY_SHARE_IMAGE_URL)?:""
val shareTitle = arguments?.getString(KEY_SHARE_TITLE)?:""
val shareContent = arguments?.getString(KEY_SHARE_CONTENT)?:""
val shareUrl = arguments?.getString(KEY_SHARE_URL)?:""
val shareImageUrl = arguments?.getString(KEY_SHARE_IMAGE_URL) ?: ""
val shareTitle = arguments?.getString(KEY_SHARE_TITLE) ?: ""
val shareContent = arguments?.getString(KEY_SHARE_CONTENT) ?: ""
val shareUrl = arguments?.getString(KEY_SHARE_URL) ?: ""
val shareMiniId = arguments?.getString(KEY_SHARE_MINI_ID) ?: ""
val shareMiniPath = arguments?.getString(KEY_SHARE_MINI_PATH) ?: ""
ivSharePicture = view?.findViewById(R.id.iv_share_picture)
......@@ -80,15 +81,22 @@ class ShareMeditationDialog : DialogFragment() {
llSave = view?.findViewById(R.id.ll_save_picture)
llQQZone = view?.findViewById(R.id.ll_qq_zone)
llQQFriend = view?.findViewById(R.id.ll_qq_friend)
cslLayout = view?.findViewById(R.id.csl_root_layout)
cslLayout?.setOnClickListener {
dismiss()
}
llWeChat?.setOnClickListener {
ShareUtils.shareTo(
SHARE_MEDIA.WEIXIN,
ShareUtils.shareSmailWeixin(
activity as Activity,
shareTitle,
shareUrl,
shareContent,
shareImageUrl
shareImageUrl,
path = shareMiniPath,
id = shareMiniId,
shareListener = null
)
dismiss()
}
......@@ -147,13 +155,24 @@ class ShareMeditationDialog : DialogFragment() {
private const val KEY_SHARE_URL = "key_share_url"
private const val KEY_SHARE_CONTENT = "key_share_content"
private const val KEY_SHARE_IMAGE_URL = "key_share_image_url"
fun newInstance(shareTitle:String,shareUrl:String,shareContent:String,shareImageUrl: String): ShareMeditationDialog {
private const val KEY_SHARE_MINI_ID = "key_share_mini_id"
private const val KEY_SHARE_MINI_PATH = "key_share_mini_path"
fun newInstance(
shareTitle: String,
shareUrl: String,
shareContent: String,
shareImageUrl: String,
miniId: String,
miniPath: String
): ShareMeditationDialog {
val args = Bundle()
args.putString(KEY_SHARE_TITLE, shareTitle)
args.putString(KEY_SHARE_CONTENT, shareContent)
args.putString(KEY_SHARE_URL, shareUrl)
args.putString(KEY_SHARE_IMAGE_URL, shareImageUrl)
args.putString(KEY_SHARE_MINI_ID, miniId)
args.putString(KEY_SHARE_MINI_PATH, miniPath)
val fragment = ShareMeditationDialog()
fragment.arguments = args
return fragment
......
......@@ -18,6 +18,9 @@
android:screenOrientation="portrait"
android:theme="@style/tests_NoTitleTheme"
/>
<activity android:name=".search.TestSearchKeyActivity"
android:screenOrientation="portrait"
android:theme="@style/tests_NoTitleTheme"/>
<!--测评首页-->
<activity
android:name=".home.NewTestHomeActivity"
......
......@@ -14,4 +14,6 @@ class TestListCommand : BaseCommand() {
var tab: String? = null
@JvmField
var keyword: String? = null
@JvmField
var type: Int = 0
}
\ No newline at end of file
package com.yidianling.tests.list.model.bean;
import com.flyco.tablayout.listener.CustomTabEntity;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/7/27
*/
public class TrendTabEntity implements CustomTabEntity {
public String title;
public int selectedIcon;
public int unSelectedIcon;
public TrendTabEntity(String title, int selectedIcon, int unSelectedIcon) {
this.title = title;
this.selectedIcon = selectedIcon;
this.unSelectedIcon = unSelectedIcon;
}
@Override
public String getTabTitle() {
return title;
}
@Override
public int getTabSelectedIcon() {
return selectedIcon;
}
@Override
public int getTabUnselectedIcon() {
return unSelectedIcon;
}
}
......@@ -117,8 +117,8 @@ class TestListRecyclerAdapter(private val context: Context,
tvCoupon.visibility = View.GONE
textView.setPadding(dp5!!,dp2!!,dp5!!,dp2!!)
textView.text = "免费"
textView.setBackgroundResource(R.drawable.tests_testhome_recom_price_bg)
textView.setTextColor(Color.parseColor("#34CD65"))
textView.setBackgroundResource(R.drawable.tests_testhome_recom_price_red_bg)
textView.setTextColor(Color.parseColor("#FF5B05"))
}else{
var newPrice = TestHomeUtils.getOriginalPrice(tvCoupon,price,couponMoney)
textView.setPadding(0,dp5!!,dp5!!,0)
......
......@@ -33,8 +33,9 @@ import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.tests_activity_test_search.*
import kotlinx.android.synthetic.main.tests_item_hot_search.view.*
@Route(path ="/tests/search")
class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView, View.OnClickListener {
@Route(path = "/tests/search")
class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView,
View.OnClickListener {
private var isFirstLoad = true
override fun getStatusViewOptions(): StatusBarOptions {
......@@ -76,7 +77,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
}
fun initData() {
var lastCouponMoney = SharedPreferencesEditor.getString(TestHomeUtils.TEST_MAX_COUPON_MONEY_SP_KEY)
var lastCouponMoney =
SharedPreferencesEditor.getString(TestHomeUtils.TEST_MAX_COUPON_MONEY_SP_KEY)
if (!TextUtils.isEmpty(lastCouponMoney)) {
searchAdapter?.couponMoney = lastCouponMoney
hotSearchAdapter?.couponMoney = lastCouponMoney
......@@ -95,8 +97,16 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
private fun initRecyclerView() {
swipe_refresh_layout.isEnabled = false
searchAdapter = TestListRecyclerAdapter(this, searchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH)
hotSearchAdapter = TestListRecyclerAdapter(this, hotSearchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH)
searchAdapter = TestListRecyclerAdapter(
this,
searchedTestList,
TestListRecyclerAdapter.PAGE_TYPE_SEARCH
)
hotSearchAdapter = TestListRecyclerAdapter(
this,
hotSearchedTestList,
TestListRecyclerAdapter.PAGE_TYPE_SEARCH
)
searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
TestsIn.getTestsImpl().testDetailH5(data.id.toString())
......@@ -106,7 +116,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
TestsIn.getTestsImpl().testDetailH5(data.id.toString())
}
headerHotSearch = View.inflate(this, R.layout.tests_header_hot_search, null) as LinearLayout?;
headerHotSearch =
View.inflate(this, R.layout.tests_header_hot_search, null) as LinearLayout?;
searchHeader = View.inflate(this, R.layout.tests_header_search_list, null);
tvSearchHint = searchHeader?.findViewById(R.id.tv_search_hint);
......@@ -135,13 +146,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
onScrollListener = object : EndlessRecyclerViewScrollListener(layoutManager) {
override fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView?) {
if (isSearch) {
mPresenter.searchTests(keyword, searchListCurrentPage)
mPresenter.searchTests(keyword, searchListCurrentPage, 0)
}
}
}
rv_hot_list.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if (!isFirstLoad && dx!=0 && dx!=0) {
if (!isFirstLoad && dx != 0 && dx != 0) {
hideSoftInput()
}
}
......@@ -168,7 +179,14 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
})
etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
doSearch()
keyword = etSearch.text.toString()
if (TextUtils.isEmpty(keyword)) {
ToastUtil.toastShort(getString(R.string.tests_no_search_keyword_hint))
} else {
val intent = Intent(this, TestSearchKeyActivity::class.java)
intent.putExtra("keyword", keyword)
startActivity(intent)
}
}
true
}
......@@ -193,7 +211,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
isSearch = true
searchListCurrentPage = 1
onScrollListener.resetState()
mPresenter.searchTests(keyword, searchListCurrentPage)
mPresenter.searchTests(keyword, searchListCurrentPage, 0)
}
fun hideSoftInput() {
......@@ -241,11 +259,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
headerHotSearch?.visibility = View.VISIBLE
flHotSearch?.removeAllViews()
for (index in keywordData.indices) {
val view = LayoutInflater.from(this).inflate(R.layout.tests_item_recommend_hot_search, flHotSearch, false)
val view = LayoutInflater.from(this)
.inflate(R.layout.tests_item_recommend_hot_search, flHotSearch, false)
view.tvHotSearch.text = keywordData[index].keyWord
view.setOnClickListener {
etSearch.setText(keywordData[index].keyWord)
doSearch()
val intent = Intent(this, TestSearchKeyActivity::class.java)
intent.putExtra("keyword", keywordData[index].keyWord)
startActivity(intent)
}
flHotSearch?.addView(view)
......
package com.yidianling.tests.search
import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.tabs.TabLayout
import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.R
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.Test
import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import com.yidianling.tests.router.TestsIn
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.tests_activity_test_key_search.*
class TestSearchKeyActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(),
TestSearchView, View.OnClickListener {
private var keyWord: String? = ""
private var searchListCurrentAllPage = 1
private var searchListCurrentPastPage = 1
private var searchListCurrentFreePage = 1
private val TYPE_ALL = "all"
private val TYPE_PAST = "past"
private val TYPE_FREE = "free"
private lateinit var onScrollListener: EndlessRecyclerViewScrollListener
private var currentSelectedPage = TYPE_ALL
var title = arrayOf("全部", "付费", "免费")
private var searchAdapter: TestListRecyclerAdapter? = null
private val searchedTestList: MutableList<Test> = ArrayList()
override fun createPresenter(): TestSearchPresenter = TestSearchPresenter()
override fun layoutResId(): Int {
return R.layout.tests_activity_test_key_search
}
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, statusBarDarkMode = true)
}
override fun initDataAndEvent() {
EventBus.getDefault().register(this)
this.keyWord = intent.getStringExtra("keyword")
setupListeners()
initView()
initRecyclerView()
tv_search_key_empty?.text = String.format("为您找到以下跟“%s”有关的内容", keyWord)
etKeySearch?.setText(keyWord)
}
private fun initView() {
for (i in title) {
val tab = tabLayout.newTab().setText(i);
tabLayout.addTab(tab)
}
}
private fun initRecyclerView() {
swipe_refresh_layout_key.isEnabled = false
searchAdapter = TestListRecyclerAdapter(
this,
searchedTestList,
TestListRecyclerAdapter.PAGE_TYPE_SEARCH
)
var lastCouponMoney =
SharedPreferencesEditor.getString(TestHomeUtils.TEST_MAX_COUPON_MONEY_SP_KEY)
if (!TextUtils.isEmpty(lastCouponMoney)) {
searchAdapter?.couponMoney = lastCouponMoney
}
searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
TestsIn.getTestsImpl().testDetailH5(data.id.toString())
}
rv_search_key_list.adapter = searchAdapter
val layoutManager = LinearLayoutManager(
this,
LinearLayoutManager.VERTICAL,
false
)
rv_search_key_list.layoutManager = layoutManager
onScrollListener = object : EndlessRecyclerViewScrollListener(layoutManager) {
override fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView?) {
when (currentSelectedPage) {
TYPE_ALL -> {
mPresenter.searchTests(keyWord, searchListCurrentAllPage, 0)
}
TYPE_PAST -> {
mPresenter.searchTests(keyWord, searchListCurrentPastPage, 1)
}
TYPE_FREE -> {
mPresenter.searchTests(keyWord, searchListCurrentFreePage, 2)
}
}
}
}
rv_search_key_list.addOnScrollListener(onScrollListener)
}
private fun setupListeners() {
tvKeyBack.setOnClickListener(this)
etKeySearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
if (TextUtils.isEmpty(s.toString())) {
}
}
})
etKeySearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
this.keyWord = etKeySearch.text.toString()
tv_search_key_empty?.text = String.format("为您找到以下跟“%s”有关的内容", keyWord)
if (TextUtils.isEmpty(keyWord)) {
ToastUtil.toastShort(getString(R.string.tests_no_search_keyword_hint))
} else {
doSearch(keyWord)
}
}
true
}
tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
when (tab?.text.toString()) {
"全部" -> {
currentSelectedPage = TYPE_ALL
searchListCurrentAllPage = 1
mPresenter.searchTests(keyWord, searchListCurrentAllPage, 0)
}
"付费" -> {
currentSelectedPage = TYPE_PAST
searchListCurrentPastPage = 1
mPresenter.searchTests(keyWord, searchListCurrentPastPage, 1)
}
"免费" -> {
currentSelectedPage = TYPE_FREE
searchListCurrentFreePage = 1
mPresenter.searchTests(keyWord, searchListCurrentFreePage, 2)
}
}
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
}
fun doSearch(keyword: String?) {
currentSelectedPage = TYPE_ALL
searchListCurrentAllPage = 1
mPresenter.searchTests(keyword, searchListCurrentAllPage, 0)
tabLayout.getTabAt(0)?.select()
}
override fun showLoadingView() {
swipe_refresh_layout_key.isRefreshing = true
}
override fun hideLoadingView() {
swipe_refresh_layout_key.isRefreshing = false
}
override fun showError(msg: String) {
ToastUtil.toastShort(msg)
}
override fun showNoResultView() {
llKeyEmpty.visibility = View.VISIBLE
iv_Key_empty.visibility = View.VISIBLE
tv_text_search_empty.visibility = View.VISIBLE
}
override fun hideNoResultView() {
llKeyEmpty.visibility = View.GONE
}
override fun showSearchResultView(testList: List<Test>?, page: Int) {
hideSoftInput()
if (page == 1) {
rv_search_key_list.adapter = searchAdapter
onScrollListener.resetState()
searchedTestList.clear()
}
if (testList != null && testList.isNotEmpty()) {
searchedTestList.addAll(testList)
searchAdapter?.notifyDataSetChanged()
} else {
searchAdapter?.hasMore = false
searchAdapter?.notifyDataSetChanged()
}
when (currentSelectedPage) {
TYPE_ALL -> {
searchListCurrentAllPage++
}
TYPE_PAST -> {
searchListCurrentPastPage++
}
TYPE_FREE -> {
searchListCurrentFreePage++
}
}
}
fun hideSoftInput() {
val view = this.currentFocus
if (view != null) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(view.windowToken, 0)
}
}
override fun onRecommendSearchListResponse(testList: List<RecommendSearchItemBean>) {
}
override fun onHotRecommendResponse(datalist: List<Test>) {
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.tvKeyBack -> {
finish()
}
}
}
override fun onResume() {
super.onResume()
//每次可见,更新优惠券信息
TestHomeUtils.updateCouponMoney()
}
fun onEvent(updateCouponMoneyEvent: UpdateCouponMoneyEvent) {
searchAdapter?.couponMoney = updateCouponMoneyEvent.money
searchAdapter?.notifyDataSetChanged()
}
override fun onDestroy() {
super.onDestroy()
EventBus.getDefault().unregister(this)
}
}
......@@ -79,7 +79,7 @@ class TestSearchPresenter : SimplePresenter<TestSearchView>() {
})
}
fun searchTests(keyword: String?, page: Int) {
fun searchTests(keyword: String?, page: Int, type: Int) {
if (page == 1) {
mView.showLoadingView()
}
......@@ -88,6 +88,7 @@ class TestSearchPresenter : SimplePresenter<TestSearchView>() {
cmd.tab = "search"
cmd.page = page
cmd.keyword = keyword
cmd.type = type
TestRetrofitApi.getTestRetrofitApi()
.fetchTestList(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io())
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<item android:gravity="center">
<shape>
<size
android:width="@dimen/platform_dp_20"
android:height="@dimen/platform_dp_4" />
<corners android:radius="@dimen/platform_dp_5" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="3dp" />
<solid android:color="#1AFF5B05" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".list.view.TestListActivity">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".list.view.TestListActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/platform_title_bar_height"
android:background="@color/white"
android:gravity="center_vertical"
>
android:gravity="center_vertical">
<ImageView
android:id="@+id/iv_test_list_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:src="@drawable/tests_icon_test_back"
/>
android:src="@drawable/tests_icon_test_back" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="@drawable/tests_bg_test_search_input"
android:orientation="horizontal"
android:layout_marginRight="15dp"
>
android:background="@drawable/tests_bg_test_search_input"
android:orientation="horizontal">
<ImageView
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp"
android:src="@drawable/tests_search_gray"/>
android:src="@drawable/tests_search_gray" />
<TextView
android:id="@+id/tv_test_search"
......@@ -48,7 +45,7 @@
android:textColor="#BFBFBF"
android:textSize="@dimen/platform_default_text_size_small"
android:textStyle="normal"
android:typeface="sans"/>
android:typeface="sans" />
</LinearLayout>
......@@ -66,50 +63,51 @@
android:layout_width="72dp"
android:layout_height="match_parent"
android:background="#F7F7F7"
app:pa_indicator_color="@color/platform_main_theme"
app:pa_tab_height="44dp"
app:pa_tab_indicator_margin="13dp"
app:pa_tab_mode="scrollable"
app:pa_indicator_color="@color/platform_main_theme"
/>
app:pa_tab_mode="scrollable" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
>
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_sort"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
>
android:orientation="horizontal">
<com.flyco.tablayout.CommonTabLayout
android:id="@+id/tab_tabLayout"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="44dp"
android:layout_centerInParent="true"
app:tl_indicator_anim_enable="true"
app:tl_indicator_color="#2BB5F5"
app:tl_indicator_height="4dp"
app:tl_textBold="BOTH"
app:tl_indicator_corner_radius="@dimen/platform_dp_5"
app:tl_indicator_width="@dimen/platform_dp_20"
app:tl_textSelectColor="@color/platform_black"
app:tl_textUnselectColor="@color/platform_color_999999"
app:tl_textsize="@dimen/platform_sp_16" />
<com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_sort"
style="@style/tests_FilterTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginLeft="@dimen/platform_dp_16"
android:layout_marginLeft="@dimen/platform_dp_26"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="综合排序"
android:textColor="@color/platform_color_242424"
/>
android:textColor="@color/platform_color_999999" />
<com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_filter"
style="@style/tests_FilterTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:paddingLeft="15dp"
android:text="全部"
android:textColor="@color/platform_color_242424"
/>
</LinearLayout>
<RelativeLayout
......@@ -119,16 +117,14 @@
<com.ydl.ydlcommon.view.verticaltablayout.VerticalViewPager
android:id="@+id/vvp_test"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
android:layout_height="match_parent" />
<View
android:id="@+id/view_mask"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#3c000000"
android:visibility="gone"
/>
android:visibility="gone" />
</RelativeLayout>
......
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/clContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context=".search.TestSearchActivity">
<LinearLayout
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:layout_height="45dp"
android:gravity="center_vertical"
app:layout_constraintTop_toTopOf="parent">
<com.ydl.ydlcommon.view.DeleteEditTextView
android:id="@+id/etKeySearch"
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:background="@drawable/tests_bg_test_search_input"
android:drawableStart="@drawable/tests_search_gray"
android:drawableLeft="@drawable/tests_search_gray"
android:drawablePadding="8dp"
android:ems="10"
android:hint="输入标题与内容"
android:imeOptions="actionSearch"
android:inputType="text|textPersonName"
android:lines="1"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textCursorDrawable="@color/platform_color_42C1FF"
android:textSize="14sp" />
<TextView
android:id="@+id/tvKeyBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:padding="10dp"
android:text="@string/platform_cancel"
android:textColor="@color/platform_color_999999" />
</LinearLayout>
<TextView
android:id="@+id/tv_search_key_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:padding="15dp" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="44dp"
app:tabIndicator="@drawable/tests_bg_indicator_search"
app:tabIndicatorColor="#2BB5F5"
app:tabIndicatorFullWidth="false"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#F7F7F7" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout_key"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_search_key_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/llKeyEmpty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/iv_Key_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:src="@drawable/platform_ico_img_zixun_empty"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_text_search_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="没有搜到相关信息,换个关键词看看吧"
android:visibility="gone"
android:gravity="center" />
</LinearLayout>
</RelativeLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
......@@ -34,7 +34,7 @@
android:maxLines="2"
android:minHeight="24dp"
android:minLines="2"
android:textColor="#666"
android:textColor="#C5C5C5"
android:textSize="12sp"
tools:text="这里是副标题,这里是副标题,这里是副标题,这里是副标题"/>
......
......@@ -30,7 +30,7 @@
android:layout_marginRight="146dp"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#666"
android:textColor="#B5B5B5"
android:textSize="12sp"
android:lineSpacingExtra="4dp"
android:minLines="2"
......
......@@ -30,4 +30,9 @@
<item name="colorAccent">@color/platform_main_theme</item>
</style>
<style name="tests_MyTabLayout" parent="TextAppearance.Design.Tab">
<item name="android:textStyle">bold</item>
</style>
</resources>
\ No newline at end of file
package com.yidianling.user.bean
data class EvaluateOrderBean(
val consultOrder: Boolean? = null,
val listenOrder: Boolean? = null
)
......@@ -67,9 +67,21 @@ public class DatePickerDialogFragment extends BaseDialogFragment implements Date
@Override
public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
this.year = year;
this.month = monthOfYear;
this.day = dayOfMonth;
if (isDataAfter(view)) {
Calendar mCalendar = Calendar.getInstance();
view.init(mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), mCalendar.get(Calendar.DAY_OF_MONTH), this);
}
}
private boolean isDataAfter(DatePicker datePicker) {
Calendar mCalendar = Calendar.getInstance();
Calendar tempCalendar = Calendar.getInstance();
tempCalendar.set(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth(), 0, 0, 0);
if (tempCalendar.after(mCalendar)) {
return true;
} else {
return false;
}
}
......
......@@ -101,14 +101,14 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
text_userName.setOnClickListener(this)
jtv_test.setOnClickListener(this)
swipe_refresh_layout.setOnRefreshListener(this)
rootView.findViewById<View>(R.id.ll_trade_order).setOnClickListener(this)
rootView.findViewById<View>(R.id.csl_trade_order).setOnClickListener(this)
rootView.findViewById<View>(R.id.jtv_introduce).setOnClickListener(this)
rootView.findViewById<View>(R.id.iv_edit_info).setOnClickListener(this)
//分享
rootView.findViewById<View>(R.id.iv_share).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_my_courses).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_red_packet).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_call_order).setOnClickListener(this)
rootView.findViewById<View>(R.id.csl_call_order).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_account).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_guanzhu).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_my_trends).setOnClickListener(this)
......@@ -124,6 +124,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
.into(iv_mine_logo)
refreshCouponData()
}
override fun initDataAndEventLazy() {}
......@@ -199,26 +201,78 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
refreshCouponData()
}
private fun getConfideOrder(uid: String) {
MineHttpImpl.getInstance().getHasConfideOrder(uid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
if ("200" == response.code) {
if (response.data != null) {
if (response.data.listenOrder == true) {
iv_confide_tip.visibility = View.VISIBLE
getLocal().setConfide(true)
} else {
iv_confide_tip.visibility = View.GONE
getLocal().setConfide(false)
}
if (response.data.consultOrder == true) {
iv_order_tip.visibility = View.VISIBLE
getLocal().setConsult(true)
} else {
iv_order_tip.visibility = View.GONE
getLocal().setConsult(false)
}
}else{
getLocal().setConfide(false)
getLocal().setConsult(false)
}
}else{
getLocal().setConfide(false)
getLocal().setConsult(false)
}
},{
getLocal().setConfide(false)
getLocal().setConsult(false)
})
}
/**
* 更新优惠券信息
*/
@SuppressLint("CheckResult")
private fun refreshCouponData() {
val userInfo = getUserInfo() ?: return
//获取用户信息
MineHttpImpl.getInstance().getNewCoupon(BaseCommand())
.compose(netCheck())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response: BaseResponse<CouponNumBean> ->
if (response.data != null) {
if (response.data?.count ?: 0 > 0) {
view_new_coupon.visibility = View.VISIBLE
getLocal().setCoupon(false)
getLocal().setConfide(false)
getLocal().setConsult(false)
val userInfo = getUserInfo()
userInfo?.uid?.let { uid ->
getConfideOrder(uid)
//获取用户信息
MineHttpImpl.getInstance().getNewCoupon(BaseCommand())
.compose(netCheck())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response: BaseResponse<CouponNumBean> ->
if (response.data != null) {
if (response.data?.count ?: 0 > 0) {
view_new_coupon.visibility = View.VISIBLE
getLocal().setCoupon(true)
} else {
view_new_coupon.visibility = View.GONE
getLocal().setCoupon(false)
}
} else {
view_new_coupon.visibility = View.INVISIBLE
getLocal().setCoupon(false)
}
}) { throwable: Throwable? ->
getLocal().setCoupon(false)
}
}) { throwable: Throwable? -> }
}
}
/**
......@@ -265,7 +319,6 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
} else {
jtv_about_us?.setLeftRedDotVisibility(View.GONE)
}
//切换环境按钮逻辑
debugChangeEnvironment()
}
......@@ -409,7 +462,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
startActivity(Intent(activity, PrivacyActivity::class.java))
}
} else if (id == R.id.ll_trade_order) { //预约
} else if (id == R.id.csl_trade_order) { //预约
count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "预约订单")
mActivity?.let { activity ->
if (!startLoginByStatus(activity, true)) {
......@@ -431,7 +484,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
provide(ICourseService::class.java).startMyCourseActivity(activity)
}
} else if (id == R.id.ll_call_order) { //倾诉
} else if (id == R.id.csl_call_order) { //倾诉
count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "倾诉记录")
mActivity?.let { activity ->
if (!startLoginByStatus(activity, true)) {
......
......@@ -406,6 +406,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 21001:
......@@ -432,6 +433,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
case 21003:
if (imgUri != null) {
showProgressDialog("保存中...");
String path = fileUtils.getPathByUri4kitkat(this, imgUri);
Bitmap bitmap = BitmapFactory.decodeFile(path);
bitmap = fileUtils.getZoomImage(bitmap, 200);
......@@ -569,12 +571,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
*/
@SuppressLint("CheckResult")
void uploadImage(final String path, final int requestCode) {
runOnUiThread(new Runnable() {
@Override
public void run() {
showProgressDialog("保存中...");
}
});
UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.uploadHead(new HeadParam(new File(path)))
......@@ -610,6 +607,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
.transform(new GlideCircleTransform(PersonalInfoActivity.this))
.into(persion_head_iv);
}
dismissProgressDialog();
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
......
......@@ -18,4 +18,16 @@ interface AppLocal {
fun putUpdate(update: Boolean)
fun getCoupon():Boolean
fun setCoupon(have:Boolean)
fun getConsult():Boolean
fun setConsult(have: Boolean)
fun getConfide():Boolean
fun setConfide(have: Boolean)
}
\ No newline at end of file
......@@ -16,9 +16,13 @@ internal class AppLocalImpl private constructor(): AppLocal {
return Holder.INSTANCE
}
private val APP = "app"
private val RED_POCKET_TIME = "red_pocket_time"
private val UPDATE = "update"
private const val APP = "app"
private const val RED_POCKET_TIME = "red_pocket_time"
private const val UPDATE = "update"
private const val CONFIDE = "confide"
private const val CONSULT = "consult"
private const val COUPON = "coupon"
}
......@@ -38,6 +42,30 @@ internal class AppLocalImpl private constructor(): AppLocal {
getAppSP().edit().putBoolean(UPDATE, update).apply()
}
override fun getCoupon(): Boolean {
return getAppSP().getBoolean(COUPON, false)
}
override fun setCoupon(have: Boolean) {
getAppSP().edit().putBoolean(COUPON, have).apply()
}
override fun getConsult(): Boolean {
return getAppSP().getBoolean(CONSULT, false)
}
override fun setConsult(have: Boolean) {
getAppSP().edit().putBoolean(CONSULT, have).apply()
}
override fun getConfide(): Boolean {
return getAppSP().getBoolean(CONFIDE, false)
}
override fun setConfide(have: Boolean) {
getAppSP().edit().putBoolean(CONFIDE, have).apply()
}
private fun getAppSP(): SharedPreferences {
return BaseApp.getApp().getSharedPreferences(APP, Context.MODE_PRIVATE)
}
......
......@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.mine.bean.AccountBean
......@@ -95,4 +96,12 @@ interface MineApi {
@POST("sms/list")
fun getSysMsgList(@FieldMap params: Map<String, String>): Observable<BaseResponse<String>>
/**
* 倾诉订单是否有待评价
*/
@POST("consult/user/order/isEvaluateOrder")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun hasConfideOrder(@Body body: RequestBody):Observable<BaseAPIResponse<EvaluateOrderBean>>
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.mine.*
import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean
......@@ -47,4 +48,6 @@ interface MineHttp {
fun getSysMsgList(param: MsgListParam): Observable<BaseResponse<String>>
fun getHasConfideOrder(uid: String): Observable<BaseAPIResponse<EvaluateOrderBean>>
}
\ No newline at end of file
......@@ -6,10 +6,14 @@ import com.ydl.ydlcommon.data.http.*
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.mine.*
import com.yidianling.user.mine.APPWillUpParam
import com.yidianling.user.mine.FeedBackParam
import com.yidianling.user.mine.FundListParam
import com.yidianling.user.mine.RechargeParam
import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.FeedBackDetailBean
......@@ -18,6 +22,7 @@ import io.reactivex.Observable
import okhttp3.MediaType
import okhttp3.RequestBody
import java.io.File
import java.util.*
class MineHttpImpl private constructor() : MineHttp {
......@@ -127,6 +132,14 @@ class MineHttpImpl private constructor() : MineHttp {
.flatMap { getAppApi().getSysMsgList(it) }
}
override fun getHasConfideOrder(uid: String): Observable<BaseAPIResponse<EvaluateOrderBean>> {
var param = WeakHashMap<String, String>().toMutableMap()
param["uid"] = uid
val body =
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), param.toString())
return getAppApi().hasConfideOrder(body)
}
object Holder {
val INSTANCE = MineHttpImpl()
}
......
......@@ -12,7 +12,6 @@ import android.view.View
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import com.blankj.utilcode.util.ToastUtils
import com.mobile.auth.gatewayauth.*
import com.mobile.auth.gatewayauth.model.TokenRet
import com.ydl.ydlcommon.base.BaseActivity
......@@ -131,10 +130,13 @@ object OneKeyLoginHelp {
*/
private fun toLoginActivity() {
if (mOpenPageIsSuccess) {
RegisterAndLoginActivity.start(mActivity, isFromOneKey = true, isFromGuide = false)
RegisterAndLoginActivity.start(mActivity, isFromOneKey = true, isFromGuide = mIsFromGuide)
} else {
RegisterAndLoginActivity.start(mActivity, false, mIsFromGuide)
}
if (!mIsFromGuide) {
quitLoginPage()
}
}
/**
......@@ -150,7 +152,10 @@ object OneKeyLoginHelp {
if (mOpenPageIsSuccess) {
RegisterAndLoginActivity.start(mActivity)
} else {
RegisterAndLoginActivity.start(mActivity, isFromOneKey = false, isFromGuide = true)
RegisterAndLoginActivity.start(mActivity, isFromOneKey = false, isFromGuide = !isOpenDialog)
}
if (!mIsFromGuide) {
quitLoginPage()
}
}
}
......@@ -630,7 +635,10 @@ object OneKeyLoginHelp {
if (mOpenPageIsSuccess) {
RegisterAndLoginActivity.start(context)
} else {
RegisterAndLoginActivity.start(context, isFromOneKey = false, isFromGuide = true)
RegisterAndLoginActivity.start(context, isFromOneKey = false, isFromGuide = !isOpenDialog)
}
if (isOpenDialog) {
quitLoginPage()
}
}
}
......
......@@ -113,7 +113,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
intent.putExtra(IS_FROM_GUIDE, isFromGuide)
context.startActivity(intent)
}
/**
* 注意:此方法仅限于启动页调用,其他页面不要调用此方法
*/
......@@ -723,7 +722,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
super.onBackPressed()
}
} else {
OneKeyLoginHelp.checkEnvAvailable(PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN)
if (!OneKeyLoginHelp.mIsFromGuide) {
finish()
}else{
OneKeyLoginHelp.checkEnvAvailable(PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN)
}
super.onBackPressed()
}
} else {
......
......@@ -354,9 +354,8 @@
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_call_order"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/csl_call_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -365,10 +364,25 @@
android:orientation="vertical">
<ImageView
android:id="@+id/iv_confide"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="3dp"
android:src="@drawable/user_mine_ic_qinshu_record" />
android:src="@drawable/user_mine_ic_qinshu_record"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_confide_tip"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/user_mine_background_red_point_new_coupon"
android:visibility="gone"
app:layout_constraintCircle="@id/iv_confide"
app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="13dp"
tools:visibility="visible" />
<TextView
android:layout_width="wrap_content"
......@@ -376,12 +390,15 @@
android:layout_marginTop="8dp"
android:text="倾诉记录"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_confide" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/ll_trade_order"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/csl_trade_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -390,10 +407,25 @@
android:orientation="vertical">
<ImageView
android:id="@+id/iv_trade_order"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="3dp"
android:src="@drawable/user_mine_ic_order" />
android:src="@drawable/user_mine_ic_order"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_order_tip"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/user_mine_background_red_point_new_coupon"
android:visibility="gone"
app:layout_constraintCircle="@id/iv_trade_order"
app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="13dp"
tools:visibility="visible" />
<TextView
android:layout_width="wrap_content"
......@@ -401,9 +433,12 @@
android:layout_marginTop="8dp"
android:text="预约订单"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_trade_order" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
......
package com.ydl.ydlcommon.base.config
/**
* 渠道枚举
* */
enum class ChannelConfig {
/**
* @property Xinliceshiyiyu 抑郁焦虑测试
* @property Ydl 壹点灵
* @property android 旧版壹点灵
* @property ATK_3 秘密倾诉
* @property ATK_4 心理测试
* @property ATK_5 心理FM
* @property ATK_6 525心理
* @property ATK_7 旧版心理咨询
*
* */
Xinliceshiyiyu,Ydl,android,ATK_3,ATK_4,ATK_5,ATK_6,ATK_7
}
\ No newline at end of file
......@@ -14,10 +14,13 @@ class ShareData : Serializable {
var cover: String? = null
var desc: String? = null
// just for Meditation
var type:String? = null
// just for Meditation
var type: String? = null
var isDarkMode = false
// 兼容评价列表分享H5传参数据结构
var imageBase64: String? = null
//分享到动态url
var url: String? = null
......
......@@ -2,6 +2,7 @@ package com.ydl.ydlcommon.data
import com.meituan.android.walle.WalleChannelReader
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.bean.GlobalInfo
import com.ydl.ydlcommon.router.YdlCommonOut
......@@ -10,7 +11,7 @@ import com.ydl.ydlcommon.router.YdlCommonOut
* e-mail : zhangwch@yidianling.com
* time : 2018/05/03
*/
class PlatformRamImpl private constructor(): IPlatformRam {
class PlatformRamImpl private constructor() : IPlatformRam {
private var globalInfo: GlobalInfo? = null
......@@ -31,14 +32,18 @@ class PlatformRamImpl private constructor(): IPlatformRam {
private val ydlChannel: String by lazy {
val appFrom = BaseApp.instance.getGlobalConfig().appFrom;
var channel = WalleChannelReader.getChannel(YdlCommonOut.getApp())
if (channel.isNullOrEmpty()){
channel = "${appFrom}_zhuzhan"
return@lazy channel!!
if (appFrom.endsWith(ChannelConfig.Xinliceshiyiyu.name)) {
//新版channel拼接规则
return@lazy appFrom
} else {
if (channel.isNullOrEmpty()) {
channel = "${appFrom}_zhuzhan"
return@lazy channel!!
}
channel = appFrom + "_" + channel
channel ?: "android"
}
channel = appFrom+"_"+channel
channel ?: "android"
}
override fun getChannelName(): String {
......
......@@ -5,6 +5,7 @@ import android.content.Context;
import android.text.TextUtils;
import com.meituan.android.walle.WalleChannelReader;
import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.config.ChannelConfig;
import com.yidianling.common.tools.LogUtil;
import com.ydl.ydlcommon.BuildConfig;
import com.ydl.ydlcommon.data.PlatformDataManager;
......@@ -101,15 +102,15 @@ public class BuryPointUtils {
private static String getShareTitle() {
String ffrom = PlatformDataManager.INSTANCE.getRam().getChannelName();
if (ffrom.startsWith("ATK_3")) {
if (ffrom.startsWith(ChannelConfig.ATK_3.name())) {
return "秘密倾诉";
} else if (ffrom.startsWith("ATK_4")) {
} else if (ffrom.startsWith(ChannelConfig.ATK_4.name())) {
return "心理测试";
} else if (ffrom.startsWith("ATK_5")) {
} else if (ffrom.startsWith(ChannelConfig.ATK_5.name())) {
return "心理FM";
} else if (ffrom.startsWith("ATK_6")) {
} else if (ffrom.startsWith(ChannelConfig.ATK_6.name())) {
return "525心理";
} else if (ffrom.startsWith("ATK_7")) {
} else if (ffrom.startsWith(ChannelConfig.ATK_7.name())) {
return "心理咨询";
} else {
return "壹点灵";
......
......@@ -1097,6 +1097,20 @@ class StatusBarUtils {
statusBarLightMode(context)
}
}
/**
* 适配 One Plus手机顶部返回按钮被截取问题
*/
fun setCustomStatusViewForMembers(context: Activity,statusView:View,isDarkMode:Boolean = false) {
val params = statusView.layoutParams
setTransparentForImageView(context, null)
val statusBarHeight = StatusBarUtils.getStatusBarHeight(context)
params.height = RxImageTool.dp2px(48f) + statusBarHeight
statusView.setPadding(0, statusBarHeight - 25, 0, 0)
if (isDarkMode) {
statusBarLightMode(context)
}
}
}
//====================设置Activity状态栏View END====================
......
......@@ -9,6 +9,7 @@ import android.view.View
import android.widget.PopupWindow
import android.widget.RelativeLayout
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.view.dialog.CommonDialog
......@@ -63,7 +64,7 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
}
private fun setMoreMsg() {
if (PlatformDataManager.getRam().getChannelName().startsWith("ATK_3")) {
if (PlatformDataManager.getRam().getChannelName().startsWith(ChannelConfig.ATK_3.name)) {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 2, null)
} else {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 3, null)
......
......@@ -117,7 +117,13 @@ public class TRTCCalling {
* 是否正在接听界面
*/
public boolean mIsBeingInvited = false;
private String mRoomId = "0";
/**
* 记录进入房间需要的一些信息(vivo,小米手机有后台弹出界面的权限,导致app后台状态下,消费掉通话邀请信令,再进入app无法打开通话邀请界面)
*/
public String mRoomId = "";
public String mUserId = "";
public String mInviteId = "";
/**
* 当前邀请列表
* C2C通话时会记录自己邀请的用户
......@@ -187,7 +193,7 @@ public class TRTCCalling {
public MdtCallBack mdtCallBack;
public interface MdtCallBack{
public interface MdtCallBack {
void onReceiveNewInvitation(String roomId);
void onInviteeAccepted(String roomId);
......@@ -338,26 +344,26 @@ public class TRTCCalling {
private V2TIMSignalingListener mTIMSignallingListener = new V2TIMSignalingListener() {
@Override
public void onReceiveNewInvitation(String inviteID, String inviter, String groupID, List<String> inviteeList, String data) {
TRTCLogger.e(TAG, "onReceiveNewInvitation inviteID:" + inviteID + ", inviter:" + inviter
+ ", groupID:" + groupID + ", inviteeList:" + inviteeList + " data:" + data);
mRoomId = groupID;
TRTCLogger.e(TAG, "onReceiveNewInvitation inviteID:" + inviteID + ", inviter:" + inviter + ", groupID:" + groupID + ", inviteeList:" + inviteeList + " data:" + data);
final UserModel userModel = UserModelManager.getInstance().getUserModel();
for (String s : inviteeList) {
if (s.equals(userModel.userId)){
Intent intent = new Intent(mContext, YDLInvitionActivity.class);
intent.putExtra(Constant.ROOM_ID, groupID);
intent.putExtra(Constant.USER_ID, userModel.userId);
intent.putExtra(Constant.INVITE_ID, inviter);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
if (inviteeList.contains(userModel.userId)) {
mRoomId = groupID;
mUserId = userModel.userId;
mInviteId = inviter;
Intent intent = new Intent(mContext, YDLInvitionActivity.class);
intent.putExtra(Constant.ROOM_ID, groupID);
intent.putExtra(Constant.USER_ID, userModel.userId);
intent.putExtra(Constant.INVITE_ID, inviter);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
if (!mIsInRoom) {
startRing();
}
mdtCallBack.onReceiveNewInvitation(mRoomId);
}
if (!mIsInRoom){
startRing();
}
mdtCallBack.onReceiveNewInvitation(mRoomId);
}
@Override
......@@ -1194,13 +1200,6 @@ public class TRTCCalling {
return;
}
final UserModel userModel = UserModelManager.getInstance().getUserModel();
// Intent intent = new Intent(mContext, YDLInvitionActivity.class);
// intent.putExtra(Constant.ROOM_ID, groupId);
// intent.putExtra(Constant.USER_ID, userModel.userId);
// intent.putExtra(Constant.INVITE_ID, userIdList.get(0));
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// internalCall(userIdList, type, groupId);
}
/**
......@@ -2101,7 +2100,7 @@ public class TRTCCalling {
if (TextUtils.isEmpty(mCallingBellPath)) {
mMediaPlayHelper.start(R.raw.phone_ringing);
} else {
if (!mMediaPlayHelper.getMediaPlayer().isPlaying()){
if (!mMediaPlayHelper.getMediaPlayer().isPlaying()) {
mMediaPlayHelper.start(mCallingBellPath);
}
}
......
......@@ -59,10 +59,15 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
MDTRxActivityTool.addActivity(this);
handleIntent();
setContentView(R.layout.video_invition_activity);
TRTCCalling trtcCalling = TRTCCalling.sharedInstance(this);
// 响铃
TRTCCalling.sharedInstance(this).startRing();
trtcCalling.startRing();
// 正在被邀请
TRTCCalling.sharedInstance(this).mIsBeingInvited = true;
trtcCalling.mIsBeingInvited = true;
// 清除TRTCCalling类中记录的邀请信息
trtcCalling.mRoomId = "";
trtcCalling.mUserId = "";
trtcCalling.mInviteId = "";
// 发送清空通知栏的通知
EventBus.getDefault().post(new ClearJPushEvent());
initView();
......
......@@ -9,6 +9,7 @@ import android.widget.PopupWindow
import android.widget.RelativeLayout
import com.ydl.webview.IJavascriptHandler
import com.ydl.webview.R
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlCommonRouterManager
......@@ -98,7 +99,7 @@ class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : Relative
}
private fun setMoreMsg() {
if (PlatformDataManager.getRam().getChannelName().startsWith("ATK_3")) {
if (PlatformDataManager.getRam().getChannelName().startsWith(ChannelConfig.ATK_3.name)) {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 2, null)
} else {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 3, null)
......
......@@ -40,6 +40,8 @@ class ShareMeditationDialog : DialogFragment() {
private var tvQQFriend: TextView? = null
private var tvCancel: TextView? = null
private var cslLayout:ConstraintLayout?=null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, R.style.share_meditation_dialog)
......@@ -58,11 +60,8 @@ class ShareMeditationDialog : DialogFragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.layout_share_meditation_dialog, container)
initView(view)
return view
}
......@@ -73,8 +72,11 @@ class ShareMeditationDialog : DialogFragment() {
val shareTitle = arguments?.getString(KEY_SHARE_TITLE)
val shareContent = arguments?.getString(KEY_SHARE_CONTENT)
val shareCover = arguments?.getString(KEY_SHARE_COVER)
val miniId = arguments?.getString(KEY_SHARE_MINI_ID)
val miniPath = arguments?.getString(KEY_SHARE_MINI_PATH)
llRootLayout = view?.findViewById(R.id.csl_share_layout)
cslLayout = view?.findViewById(R.id.csl_root_layout)
llWeChat = view?.findViewById(R.id.ll_wechat_friend)
llCircleOfFriends = view?.findViewById(R.id.ll_wechat_circle_of_friends)
......@@ -95,14 +97,20 @@ class ShareMeditationDialog : DialogFragment() {
updateUI(isDarkMode == true)
cslLayout?.setOnClickListener {
dismiss()
}
llWeChat?.setOnClickListener {
ShareUtils.shareTo(
SHARE_MEDIA.WEIXIN,
ShareUtils.shareSmailWeixin(
activity as Activity,
shareTitle!!,
shareUrl!!,
shareContent!!,
shareCover!!
shareCover!!,
path = miniPath,
id = miniId,
shareListener = null
)
dismiss()
}
......@@ -191,15 +199,21 @@ class ShareMeditationDialog : DialogFragment() {
private const val KEY_SHARE_TITLE = "key_share_title"
private const val KEY_SHARE_CONTENT = "key_share_content"
private const val KEY_SHARE_COVER = "key_share_cover"
private const val KEY_SHARE_MINI_ID = "key_share_mini_id"
private const val KEY_SHARE_MINI_PATH = "key_share_mini_path"
fun newInstance(isDarkMode: Boolean,shareUrl:String,shareTitle:String,
shareContent:String,shareCover:String): ShareMeditationDialog {
fun newInstance(
isDarkMode: Boolean, shareUrl: String, shareTitle: String,
shareContent: String, shareCover: String, miniId: String, miniPath: String
): ShareMeditationDialog {
val args = Bundle()
args.putBoolean(KEY_SHARE_DARK_MODE, isDarkMode)
args.putString(KEY_SHARE_URL, shareUrl)
args.putString(KEY_SHARE_TITLE, shareTitle)
args.putString(KEY_SHARE_CONTENT, shareContent)
args.putString(KEY_SHARE_COVER, shareCover)
args.putString(KEY_SHARE_MINI_ID, miniId)
args.putString(KEY_SHARE_MINI_PATH, miniPath)
val fragment = ShareMeditationDialog()
fragment.arguments = args
......
......@@ -41,6 +41,7 @@ import com.ydl.view.ShareMeditationDialog;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.bean.ShareData;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.event.MeditationEvent;
import com.ydl.ydlcommon.modular.ModularServiceManager;
......@@ -51,6 +52,7 @@ import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.NetWorkSpeedUtils;
import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.utils.URLUtils;
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.ydl.ydlcommon.view.TitleBar;
......@@ -117,6 +119,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
protected String shareTitle;
protected String shareDesc;
private String cover;
private String miniId;
private String miniPath;
// 评价2.0新增字段 区分评价列表
private H5JsBean.H5JsCmd.Params paramsForCommentList;
private boolean isShareCommentList;
private boolean isDarkMode = false;
......@@ -520,6 +527,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
shareTitle = params.getShare().getTitle();
shareDesc = params.getShare().getDesc();
cover = params.getShare().getCover();
paramsForCommentList = params;
LogUtil.d("title: " + shareTitle + " url: " + shareUrl + " desc: " + shareDesc + " cover: " + cover);
new Handler(getMainLooper()).post(() -> initShareMenu());
}
......@@ -537,15 +545,17 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
shareTitle = params.getShare().getTitle();
shareDesc = params.getShare().getDesc();
cover = params.getShare().getCover();
miniId = params.getShare().getMinProgramId();
miniPath = params.getShare().getMinProgramPath();
isDarkMode = params.getShare().isDarkMode();
if(shareMeditationDialog == null){
if (shareMeditationDialog == null) {
shareMeditationDialog = ShareMeditationDialog.Companion.newInstance(isDarkMode,
shareUrl,shareTitle,shareDesc,cover);
shareUrl, shareTitle, shareDesc, cover, miniId, miniPath);
}
if (shareMeditationDialog!=null && !shareMeditationDialog.isAdded()){
shareMeditationDialog.show(getSupportFragmentManager(),"share_meditation");
if (shareMeditationDialog != null && !shareMeditationDialog.isAdded()) {
shareMeditationDialog.show(getSupportFragmentManager(), "share_meditation");
}
}else{
}else {
purl = params.getShare().getUrl();
shareUrl = params.getShare().getShare_url();
shareTitle = params.getShare().getTitle();
......@@ -1047,7 +1057,14 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initShareMenu() {
tb_title.setRightIcon(getResources().getDrawable(R.drawable.web_common_share));
tb_title.setOnRightTextClick((view, isActive) -> {
share(null, null);
ShareData shareData = paramsForCommentList.getShare();
if (shareData != null && "commentList".equals(shareData.getType())) {
isShareCommentList = true;
ActionCountUtils.Companion.record("experts_comment_list_page", "comment_share_click");
share(shareData.getImageBase64(), paramsForCommentList);
} else {
share(null, null);
}
});
LogUtil.d("setSeccessful");
}
......@@ -1440,7 +1457,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//如果未引入动态模块的话,隐藏分享至动态按钮
dialog = YDLShareDialog.Companion.style4(this, shareTitle, shareUrl, shareDesc, cover);
} else {
dialog = YDLShareDialog.Companion.style1(this, shareTitle, shareUrl, shareDesc, cover, minPath, minId);
if (isShareCommentList){
dialog = YDLShareDialog.Companion.style7(this, shareTitle, shareUrl, shareDesc, cover, minPath, minId);
}else {
dialog = YDLShareDialog.Companion.style1(this, shareTitle, shareUrl, shareDesc, cover, minPath, minId);
}
}
}
......
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