Commit 13999763 by 刘鹏

Merge remote-tracking branch 'origin/d/v4.3.99' into feat/lp/lp_v4.3.99

# Conflicts:
#	config.gradle
parents 39350be8 2f842f05
...@@ -36,12 +36,12 @@ class JsMethod { ...@@ -36,12 +36,12 @@ class JsMethod {
return true return true
} }
"show_loading" -> { "show_loading" -> {
val topActivity = BaseActivityMgr.INST.getTopActivity() // val topActivity = BaseActivityMgr.INST.getTopActivity()
Loading.show(topActivity) // Loading.show(topActivity)
return true return true
} }
"close_loading" -> { "close_loading" -> {
Loading.close() // Loading.close()
return true return true
} }
"open_app_eval_list"->{ "open_app_eval_list"->{
......
ext { ext {
kotlin_version = "1.3.21" kotlin_version = "1.3.21"
dev_mode = false dev_mode = false //组件发布的时候需要设置为false
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.50.42", "m-confide" : "0.0.50.45",
"m-consultant" : "0.0.60.71", "m-consultant" : "0.0.60.73",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.55", "m-user" : "0.0.62.71",
"m-home" : "0.0.23.95", "m-home" : "0.0.23.98",
"m-im" : "0.0.21.63", "m-im" : "0.0.21.66",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.79",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.81", "m-muse" : "0.0.28.84",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.22",
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
...@@ -23,15 +23,15 @@ ext { ...@@ -23,15 +23,15 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.25", "ydl-tuicore" : "0.0.25",
//第一步 //第一步
"ydl-platform" : "0.0.41.47", "ydl-platform" : "0.0.41.50",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.94", "ydl-webview" : "0.0.38.99",
"ydl-media" : "0.0.21.52", "ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.21", "ydl-pay" : "0.0.18.21",
"m-audioim" : "0.0.49.30.23", "m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.40",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
...@@ -91,33 +91,31 @@ ext { ...@@ -91,33 +91,31 @@ ext {
ydlCompileVersion = [ ydlCompileVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.50.42", "m-confide" : "0.0.50.45",
"m-consultant" : "0.0.60.71", "m-consultant" : "0.0.60.73",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.55", "m-user" : "0.0.62.71",
"m-home" : "0.0.23.95", "m-home" : "0.0.23.98",
"m-im" : "0.0.21.63", "m-im" : "0.0.21.66",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.79",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.84",
"m-muse" : "0.0.28.81", "m-tests" : "0.0.24.22",
"m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.25", "ydl-tuicore" : "0.0.25",
//第一步 //第一步
"ydl-platform" : "0.0.41.47", "ydl-platform" : "0.0.41.50",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.94", "ydl-webview" : "0.0.38.99",
"ydl-media" : "0.0.21.52", "ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.21", "ydl-pay" : "0.0.18.21",
"m-audioim" : "0.0.49.30.23", "m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.40",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
...@@ -283,7 +281,7 @@ ext { ...@@ -283,7 +281,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块 //flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块 "ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.44@aar", //flutter aar "ydl-flutter" : "com.ydl:ydl-flutter:0.0.46@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar // "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号 //基础组件 <<--- 先发这个,发完改这里的版本号
......
...@@ -145,7 +145,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -145,7 +145,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
uid = arguments?.getString(KEY_UID) uid = arguments?.getString(KEY_UID)
listen_free = arguments?.getBoolean(KEY_LISTEN_FREE) ?: false listen_free = arguments?.getBoolean(KEY_LISTEN_FREE) ?: false
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
// +
wv_content = view.findViewById<ProgressWebView>(com.ydl.webview.R.id.wv_content) wv_content = view.findViewById<ProgressWebView>(com.ydl.webview.R.id.wv_content)
wv_content.progressbar.visibility = View.GONE wv_content.progressbar.visibility = View.GONE
close_webview_Icon = view.findViewById<View>(R.id.close_webview_Icon) close_webview_Icon = view.findViewById<View>(R.id.close_webview_Icon)
...@@ -392,7 +391,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -392,7 +391,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
layout_change_text.visibility = View.VISIBLE layout_change_text.visibility = View.VISIBLE
this.doctorId = doctorId this.doctorId = doctorId
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
this.expertUrl = linkUrl
callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})") callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})")
} }
...@@ -449,6 +447,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -449,6 +447,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onProgressChanged(view: WebView, newProgress: Int) { override fun onProgressChanged(view: WebView, newProgress: Int) {
if (newProgress == 100) { 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) }})") callJsFun(wv_content, "setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
} }
super.onProgressChanged(view, newProgress) super.onProgressChanged(view, newProgress)
...@@ -582,7 +588,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -582,7 +588,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
if (resp.code == "200") { if (resp.code == "200") {
layoutCall.visibility = View.VISIBLE layoutCall.visibility = View.VISIBLE
lineStatus = resp.data?.confideLine ?: 2 lineStatus = resp.data?.confideLine ?: 2
expertUrl = resp.data?.linkUrl ?: ""
if (isLogin && listen_free) { if (isLogin && listen_free) {
free.visibility = View.VISIBLE free.visibility = View.VISIBLE
val controller: DraweeController = Fresco.newDraweeControllerBuilder() val controller: DraweeController = Fresco.newDraweeControllerBuilder()
......
...@@ -2,6 +2,7 @@ package com.ydl.confide.home.bean ...@@ -2,6 +2,7 @@ package com.ydl.confide.home.bean
class DialStatus { class DialStatus {
var confideLine: Int? = null var confideLine: Int? = null
var linkUrl: String? = ""
var remainingTime: RemainingTime? = null var remainingTime: RemainingTime? = null
} }
......
<?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 @@ ...@@ -3,8 +3,8 @@
android:shape="rectangle"> android:shape="rectangle">
<corners <corners
android:radius="8dp"/> android:radius="26dp"/>
<solid android:color="#ffffff"/> <solid android:color="#61CEAC"/>
</shape> </shape>
\ No newline at end of file
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<gradient <!-- <gradient-->
android:startColor="@color/confide_61CEAC" <!-- android:startColor="@color/confide_61CEAC"-->
android:endColor="@color/confide_48CC95"/> <!-- android:endColor="@color/confide_48CC95"/>-->
<corners android:radius="8dp" /> <solid android:color="@color/white"/>
<corners android:radius="15dp" />
</shape> </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 @@ ...@@ -22,7 +22,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/quick_consult_card" android:id="@+id/quick_consult_card"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="52dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
android:id="@+id/confide_logo" android:id="@+id/confide_logo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
...@@ -57,8 +58,9 @@ ...@@ -57,8 +58,9 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
android:text="智能推荐,一键倾诉" android:text="智能推荐,一键倾诉"
android:textColor="@color/platform_color_333333" android:textColor="@color/white"
android:textSize="14dp" android:textSize="14dp"
android:textStyle="bold"
android:layout_marginStart="@dimen/platform_dp_8" android:layout_marginStart="@dimen/platform_dp_8"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/confide_logo" app:layout_constraintStart_toEndOf="@id/confide_logo"
...@@ -85,9 +87,10 @@ ...@@ -85,9 +87,10 @@
android:paddingRight="@dimen/platform_dp_7" android:paddingRight="@dimen/platform_dp_7"
android:text="我要倾诉" android:text="我要倾诉"
android:layout_marginTop="@dimen/platform_dp_12" android:layout_marginTop="@dimen/platform_dp_12"
android:textColor="@color/white" android:textColor="#55CDA0"
android:textSize="13sp" android:textSize="13sp"
android:drawableRight="@drawable/confide_right_arrow" /> android:textStyle="bold"
app:drawableRightCompat="@drawable/confide_right_arrow" />
<ImageView <ImageView
android:id="@+id/confideRed" android:id="@+id/confideRed"
......
...@@ -38,10 +38,11 @@ import kotlinx.android.synthetic.main.consultant_activity_hot_search.* ...@@ -38,10 +38,11 @@ import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.* import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
@Route(path = "/consult/hot_search") @Route(path = "/consult/hot_search")
class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(), IHotSearchContract.View { class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(),
private lateinit var searchWordsAdapter:SearchWordsAdapter IHotSearchContract.View {
private lateinit var searchWordsAdapter: SearchWordsAdapter
private val searchSuggestList: ArrayList<SearchSuggestListBean> = ArrayList() private val searchSuggestList: ArrayList<SearchSuggestListBean> = ArrayList()
private var mSearchContent:String = "" private var mSearchContent: String = ""
private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data" private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name" private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15) private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
...@@ -88,7 +89,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -88,7 +89,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
private fun initViews() { private fun initViews() {
StatusBarUtils.statusBarLightMode(this) StatusBarUtils.statusBarLightMode(this)
maxWidth = (2 * RxDeviceTool.getScreenWidth(this@HotSearchActivity)) - RxImageTool.dip2px(60f) maxWidth =
(2 * RxDeviceTool.getScreenWidth(this@HotSearchActivity)) - RxImageTool.dip2px(60f)
dp42 = RxImageTool.dip2px(60f) dp42 = RxImageTool.dip2px(60f)
iv_delete_icon.setOnClickListener { iv_delete_icon.setOnClickListener {
...@@ -99,21 +101,21 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -99,21 +101,21 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false var isRecommendWords = false
if (searchSuggestList.isNotEmpty()&&searchSuggestList.size>0){ if (searchSuggestList.isNotEmpty() && searchSuggestList.size > 0) {
if (searchSuggestList[0].suggest_relations.size>0){ if (searchSuggestList[0].suggest_relations.size > 0) {
relatedWords = searchSuggestList[0].suggest_relations[0] relatedWords = searchSuggestList[0].suggest_relations[0]
isRecommendWords = true isRecommendWords = true
} }
if (TextUtils.isEmpty(relatedWords)&&!TextUtils.isEmpty(searchSuggestList[0].suggest_content)){ if (TextUtils.isEmpty(relatedWords) && !TextUtils.isEmpty(searchSuggestList[0].suggest_content)) {
relatedWords = searchSuggestList[0].suggest_content relatedWords = searchSuggestList[0].suggest_content
} }
doSearch(etSearch.text.toString(),relatedWords,isRecommendWords) doSearch(etSearch.text.toString(), relatedWords, isRecommendWords)
}else{ } else {
val searchWords = etSearch.text.toString() val searchWords = etSearch.text.toString()
if (TextUtils.isEmpty(searchWords)){ if (TextUtils.isEmpty(searchWords)) {
doSearch(searchWords,"",isRecommendWords) doSearch(searchWords, "", isRecommendWords)
}else{ } else {
getSearchWords(etSearch.text.toString(),true) getSearchWords(etSearch.text.toString(), true)
} }
} }
} }
...@@ -129,8 +131,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -129,8 +131,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
val data = ModularServiceManager.provide(IConsultantService::class.java).getGuideImage(5) val data = ModularServiceManager.provide(IConsultantService::class.java).getGuideImage(5)
if (data?.size ?: 0 > 0) { if (data?.size ?: 0 > 0) {
val imageUrl= data?.get(0)?.pic val imageUrl = data?.get(0)?.pic
iv_daoyi_image.visibility=View.VISIBLE iv_daoyi_image.visibility = View.VISIBLE
GlideApp.with(mContext) GlideApp.with(mContext)
.load(imageUrl) .load(imageUrl)
...@@ -138,7 +140,11 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -138,7 +140,11 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
iv_daoyi_image.setOnClickListener { iv_daoyi_image.setOnClickListener {
LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}") LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}")
ConsultAssistantEntryUtils.jumpConsultAssistant(this, data[0].location.toInt(),"learning") ConsultAssistantEntryUtils.jumpConsultAssistant(
this,
data[0].location.toInt(),
"learning"
)
} }
} }
...@@ -149,29 +155,35 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -149,29 +155,35 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false var isRecommendWords = false
if (searchSuggestList.isNotEmpty()&&searchSuggestList.size>0){ if (searchSuggestList.isNotEmpty() && searchSuggestList.size > 0) {
if (searchSuggestList[position].suggest_relations.size>0){ if (searchSuggestList[position].suggest_relations.size > 0) {
relatedWords = searchSuggestList[position].suggest_relations[0] relatedWords = searchSuggestList[position].suggest_relations[0]
isRecommendWords = true isRecommendWords = true
} }
if (TextUtils.isEmpty(relatedWords)&&!TextUtils.isEmpty(searchSuggestList[position].suggest_content)){ if (TextUtils.isEmpty(relatedWords) && !TextUtils.isEmpty(searchSuggestList[position].suggest_content)) {
relatedWords = searchSuggestList[position].suggest_content relatedWords = searchSuggestList[position].suggest_content
} }
} }
doSearch(searchSuggestList[position].suggest_content,relatedWords,isRecommendWords) doSearch(searchSuggestList[position].suggest_content, relatedWords, isRecommendWords)
// 埋点 // 埋点
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,ConsultBIConstants.POSITION_YDL_USER_ASSOCIATE_WORD_CLICK,etSearch.text.toString(),searchSuggestList[position].suggest_content,"app") ActionCountUtils.baiDuCountSign3(
ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
ConsultBIConstants.POSITION_YDL_USER_ASSOCIATE_WORD_CLICK,
etSearch.text.toString(),
searchSuggestList[position].suggest_content,
"app"
)
} }
etSearch.addTextChangedListener(object : TextWatcher { etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) { override fun afterTextChanged(s: Editable?) {
if (TextUtils.isEmpty(s)) { if (TextUtils.isEmpty(s)) {
iv_delete_icon.visibility = View.INVISIBLE iv_delete_icon.visibility = View.INVISIBLE
rv_search_words.visibility = View.GONE rv_search_words.visibility = View.GONE
getSearchWords("",false) getSearchWords("", false)
} else { } else {
iv_delete_icon.visibility = View.VISIBLE iv_delete_icon.visibility = View.VISIBLE
getSearchWords(s.toString(),false) getSearchWords(s.toString(), false)
} }
} }
...@@ -190,43 +202,53 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -190,43 +202,53 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
* 获取搜索联想词 * 获取搜索联想词
* @param isClickWords 是否是点击历史搜索、热门搜索等进行搜索 * @param isClickWords 是否是点击历史搜索、热门搜索等进行搜索
*/ */
private fun getSearchWords(searchContent:String,isClickWords:Boolean){ private fun getSearchWords(searchContent: String, isClickWords: Boolean) {
if (!TextUtils.isEmpty(searchContent)){ if (!TextUtils.isEmpty(searchContent)) {
mSearchContent = searchContent mSearchContent = searchContent
val map = HashMap<String, Any>() val map = HashMap<String, Any>()
map["content"] = searchContent map["content"] = searchContent
mPresenter.getSearchWords(map,searchContent,isClickWords) mPresenter.getSearchWords(map, searchContent, isClickWords)
}else{ } else {
rv_search_words.visibility = View.GONE rv_search_words.visibility = View.GONE
} }
} }
override fun getSearchWordsSuccess(searchWordsBean: SearchWordsBean,searchContent:String,isClickWords:Boolean) { override fun getSearchWordsSuccess(
if (isClickWords){ searchWordsBean: SearchWordsBean,
searchContent: String,
isClickWords: Boolean
) {
if (isClickWords) {
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false var isRecommendWords = false
if (!searchWordsBean.search_suggests.isNullOrEmpty()&&searchWordsBean.search_suggests.size>0){ if (!searchWordsBean.search_suggests.isNullOrEmpty() && searchWordsBean.search_suggests.size > 0) {
if (searchWordsBean.search_suggests[0].suggest_relations.size>0){ if (searchWordsBean.search_suggests[0].suggest_relations.size > 0) {
relatedWords = searchWordsBean.search_suggests[0].suggest_relations[0] relatedWords = searchWordsBean.search_suggests[0].suggest_relations[0]
isRecommendWords = true isRecommendWords = true
} }
if (TextUtils.isEmpty(relatedWords)&&!TextUtils.isEmpty(searchWordsBean.search_suggests[0].suggest_content)){ if (TextUtils.isEmpty(relatedWords) && !TextUtils.isEmpty(searchWordsBean.search_suggests[0].suggest_content)) {
relatedWords = searchWordsBean.search_suggests[0].suggest_content relatedWords = searchWordsBean.search_suggests[0].suggest_content
} }
} }
doSearch(searchContent,relatedWords,isRecommendWords) doSearch(searchContent, relatedWords, isRecommendWords)
}else{ } else {
searchSuggestList.clear() searchSuggestList.clear()
if (!searchWordsBean.search_suggests.isNullOrEmpty()){ if (!searchWordsBean.search_suggests.isNullOrEmpty()) {
rv_search_words.visibility = View.VISIBLE rv_search_words.visibility = View.VISIBLE
searchSuggestList.addAll(searchWordsBean.search_suggests) searchSuggestList.addAll(searchWordsBean.search_suggests)
searchWordsAdapter.notifyDataAndSetSearchWord(mSearchContent) searchWordsAdapter.notifyDataAndSetSearchWord(mSearchContent)
// 埋点 // 埋点
val sign2 = searchSuggestList.joinToString(","){it.suggest_content} val sign2 = searchSuggestList.joinToString(",") { it.suggest_content }
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,ConsultBIConstants.POSITION_YDL_USER_ASSOCIATE_WORD_VISIT,searchContent,sign2,"app") ActionCountUtils.baiDuCountSign3(
}else{ ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,
ConsultBIConstants.POSITION_YDL_USER_ASSOCIATE_WORD_VISIT,
searchContent,
sign2,
"app"
)
} else {
rv_search_words.visibility = View.GONE rv_search_words.visibility = View.GONE
} }
} }
...@@ -272,7 +294,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -272,7 +294,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
.inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false) .inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false)
view.tvHotSearch.text = keywordData[index].keyword view.tvHotSearch.text = keywordData[index].keyword
view.setOnClickListener { view.setOnClickListener {
getSearchWords(keywordData[index].keyword!!,true) getSearchWords(keywordData[index].keyword!!, true)
} }
flHotSearch.addView(view) flHotSearch.addView(view)
} }
...@@ -304,7 +326,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -304,7 +326,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
} }
view.setOnClickListener { view.setOnClickListener {
getSearchWords(etSearch.text.toString(),true) getSearchWords(hotSearchExpert[index].name!!, true)
} }
flHotExpert.addView(view) flHotExpert.addView(view)
} }
...@@ -366,7 +388,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -366,7 +388,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
break break
} }
view.setOnClickListener { view.setOnClickListener {
getSearchWords(historyStr,true) getSearchWords(historyStr, true)
} }
fl_search_history.addView(view) fl_search_history.addView(view)
} }
...@@ -386,14 +408,14 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -386,14 +408,14 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
* 搜索 * 搜索
* @param isRecommendWords 是否是推荐词 * @param isRecommendWords 是否是推荐词
*/ */
private fun doSearch(searchWords:String,relatedWords:String,isRecommendWords:Boolean) { private fun doSearch(searchWords: String, relatedWords: String, isRecommendWords: Boolean) {
val view = this.currentFocus val view = this.currentFocus
if (view != null) { if (view != null) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(view.windowToken, 0) imm.hideSoftInputFromWindow(view.windowToken, 0)
} }
ActionCountUtils.count(ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK,searchWords) ActionCountUtils.count(ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK, searchWords)
if (!TextUtils.isEmpty(searchWords)) { if (!TextUtils.isEmpty(searchWords)) {
historyList.remove(searchWords) historyList.remove(searchWords)
historyList.add(searchWords) historyList.add(searchWords)
...@@ -402,7 +424,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -402,7 +424,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
Gson().toJson(historyList) Gson().toJson(historyList)
) )
} }
ExpertSearchActivity.startSearch(this, searchWords,"14",relatedWords,isRecommendWords) ExpertSearchActivity.startSearch(this, searchWords, "14", relatedWords, isRecommendWords)
finish() finish()
} }
......
...@@ -37,7 +37,11 @@ import kotlin.math.roundToInt ...@@ -37,7 +37,11 @@ import kotlin.math.roundToInt
* 筛选弹窗 * 筛选弹窗
* Created by zqk on 17-9-15. * 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() private val mDisposableList = CompositeDisposable()
...@@ -139,7 +143,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -139,7 +143,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
tempFilter.showType = filterData.showType[0] tempFilter.showType = filterData.showType[0]
tempFilter.ages.clear() tempFilter.ages.clear()
tempFilter.doctorEdu.clear() tempFilter.doctorEdu.clear()
tempFilter.enquiries.clear()
// 擅长人群 // 擅长人群
tempFilter.specialityCrowd.clear() tempFilter.specialityCrowd.clear()
tempFilter.others.clear() tempFilter.others.clear()
...@@ -158,17 +161,26 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -158,17 +161,26 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
showTypeViews[1].isSelected = true showTypeViews[1].isSelected = true
for (v in enquiryViews) { for (v in enquiryViews) {
v.isSelected = false v.isSelected = false
if (v is TextView) { val textView: TextView = v.findViewById(R.id.tvFilterName)
v.paint.isFakeBoldText = false 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) { for (v in ageViews) {
v.isSelected = false v.isSelected = false
if (v is TextView) { if (v is TextView) {
v.paint.isFakeBoldText = false v.paint.isFakeBoldText = false
} }
} }
for (v in goodAtViews){ for (v in goodAtViews) {
v.isSelected = false v.isSelected = false
v.paint.isFakeBoldText = false v.paint.isFakeBoldText = false
} }
...@@ -325,6 +337,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -325,6 +337,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
fun addSubscription(disposable: Disposable) { fun addSubscription(disposable: Disposable) {
mDisposableList.add(disposable) mDisposableList.add(disposable)
} }
/** /**
* 其他选择 * 其他选择
* */ * */
...@@ -413,13 +426,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -413,13 +426,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
if (text == "展开") { if (text == "展开") {
view.tv_crowd_open.text = "收起" view.tv_crowd_open.text = "收起"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_close) 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 goodAtViews[i].visibility = View.VISIBLE
} }
} else { } else {
view.tv_crowd_open.text = "展开" view.tv_crowd_open.text = "展开"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_open) 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 goodAtViews[i].visibility = View.GONE
} }
} }
...@@ -452,7 +465,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -452,7 +465,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
} }
} }
if (index>19){ if (index > 19) {
textView.visibility = View.GONE textView.visibility = View.GONE
} }
goodAtViews.add(textView) goodAtViews.add(textView)
...@@ -460,6 +473,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -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 ...@@ -500,6 +514,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
view.flAge.addView(textView) view.flAge.addView(textView)
} }
} }
/** /**
* 学历 * 学历
* */ * */
...@@ -545,8 +560,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -545,8 +560,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, enquiry) in filterData.enquiry.withIndex()) { for ((index, enquiry) in filterData.enquiry.withIndex()) {
val llLayout = View.inflate(context, R.layout.consultant_method_item_filter, null) val llLayout = View.inflate(context, R.layout.consultant_method_item_filter, null)
val textView:TextView = llLayout.findViewById(R.id.tvFilterName) val textView: TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon:ImageView = llLayout.findViewById(R.id.iv_consultant_method) val ivIcon: ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f)) val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f) val marginNum = RxImageTool.dp2px(5f)
params.setMargins( params.setMargins(
...@@ -561,7 +576,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -561,7 +576,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
.load(enquiry.unCheckUrl) .load(enquiry.unCheckUrl)
.into(ivIcon) .into(ivIcon)
enquiryViews.add(view) enquiryViews.add(llLayout)
if (tempFilter.enquiries.contains(enquiry)) { if (tempFilter.enquiries.contains(enquiry)) {
llLayout.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvRegion" android:id="@+id/rvRegion"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_white" android:background="@color/platform_white"
android:layout_weight="1" android:layout_weight="1"
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvSub" android:id="@+id/rvSub"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_color_F7F7F7" android:background="@color/platform_color_F7F7F7"
android:layout_weight="2" android:layout_weight="2"
......
...@@ -137,7 +137,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -137,7 +137,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
initListeners(); initListeners();
// initDatas(); // initDatas();
setTabSelection(0); setTabSelection(0);
StatusBarUtils.Companion.setCustomStatusView(this,members_title_rel,true); StatusBarUtils.Companion.setCustomStatusViewForMembers(this,members_title_rel,true);
} }
private void initEvent() { private void initEvent() {
......
...@@ -37,6 +37,7 @@ import com.yidianling.dynamic.trendList.adapter.RecommendTopicListAdapter ...@@ -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
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTER_STATE_NO_DATA 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_LOAD_MORE
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_INIT
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
if (trend_list_no_datas_rel!!.visibility != View.GONE) { if (trend_list_no_datas_rel!!.visibility != View.GONE) {
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() { private fun showErrorView() {
if (page == 1) { if (page == 1) {
cdl!!.visibility = View.GONE
trend_list_no_datas_rel!!.visibility = View.VISIBLE trend_list_no_datas_rel!!.visibility = View.VISIBLE
} else { } else {
cdl!!.visibility = View.VISIBLE
trend_list_no_datas_rel!!.visibility = View.GONE trend_list_no_datas_rel!!.visibility = View.GONE
} }
} }
...@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
} else { } else {
LogUtil.i("get datas no more data$data") LogUtil.i("get datas no more data$data")
trendsDatas!!.addAll(data) trendsDatas!!.addAll(data)
if (trendsDatas == null || trendsDatas!!.size <= 0) { if (trendsDatas == null || trendsDatas!!.size == 0) {
cdl!!.visibility = View.GONE mRcvAdapter!!.setDatas(trendsDatas, FOOTRE_STATE_INIT)
if (page == 1) {
mRcvAdapter!!.notifyDataSetChanged()
}
trend_list_no_datas_rel!!.visibility = View.VISIBLE trend_list_no_datas_rel!!.visibility = View.VISIBLE
return return
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout <com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/trends_lastr_swl" android:id="@+id/trends_lastr_swl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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"> android:background="@color/dynamic_white">
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.recyclerview.widget.RecyclerView
android:id="@+id/cdl" android:id="@+id/trends_rcv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/dynamic_f5f5f5"
<androidx.recyclerview.widget.RecyclerView android:descendantFocusability="blocksDescendants"
android:id="@+id/trends_rcv" app:layout_behavior="@string/appbar_scrolling_view_behavior" />
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>
<RelativeLayout <RelativeLayout
android:id="@+id/trend_list_no_datas_rel" android:id="@+id/trend_list_no_datas_rel"
...@@ -77,7 +31,7 @@ ...@@ -77,7 +31,7 @@
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:src="@drawable/dynamic_blank"/> android:src="@drawable/dynamic_blank" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -86,11 +40,44 @@ ...@@ -86,11 +40,44 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:text="暂无相关记录~" android:text="暂无相关记录~"
android:textColor="@color/dynamic_text_gray"/> android:textColor="@color/dynamic_text_gray" />
</RelativeLayout> </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 ...@@ -176,7 +176,13 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
if (!TextUtils.isEmpty(doctorName)) { if (!TextUtils.isEmpty(doctorName)) {
searchText = 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 home_tv.text = searchText
} }
......
...@@ -154,10 +154,10 @@ ...@@ -154,10 +154,10 @@
<ImageView <ImageView
android:id="@+id/iv_search_icon" android:id="@+id/iv_search_icon"
android:layout_width="12dp" android:layout_width="@dimen/platform_dp_26"
android:layout_height="12dp" android:layout_height="@dimen/platform_dp_14"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp" android:paddingLeft="12dp"
android:src="@drawable/home_icon_search"/> android:src="@drawable/home_icon_search"/>
<TextView <TextView
......
...@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.lifecycle.ILifecycleable; ...@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.lifecycle.ILifecycleable;
import com.ydl.ydlcommon.data.http.RxUtils; import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer; import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.StringUtils; import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.Utils;
import com.ydl.ydlcommon.utils.remind.ToastHelper; import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.im.bean.MsgData; import com.yidianling.im.bean.MsgData;
import com.yidianling.im.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
...@@ -64,6 +65,9 @@ public class MsgListAdapter extends CommonAdapter<MsgData> { ...@@ -64,6 +65,9 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
} }
((MsgListItemView) convertView).setData(mDataList.get(position)); ((MsgListItemView) convertView).setData(mDataList.get(position));
convertView.setOnClickListener(v -> { convertView.setOnClickListener(v -> {
if (Utils.isFastClick()) {
return;
}
//动态消息暂时不需要访问以下接口 //动态消息暂时不需要访问以下接口
boolean fla = false; boolean fla = false;
//判断是否是跳转专家主页 //判断是否是跳转专家主页
......
...@@ -6,6 +6,7 @@ import android.animation.ValueAnimator; ...@@ -6,6 +6,7 @@ import android.animation.ValueAnimator;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.media.AudioManager; import android.media.AudioManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
...@@ -50,6 +51,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager; ...@@ -50,6 +51,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.AnimUtils; import com.ydl.ydlcommon.utils.AnimUtils;
import com.ydl.ydlcommon.utils.LogUtil; import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.Utils;
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils; import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig; import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper; import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
...@@ -185,6 +187,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -185,6 +187,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private TextView tv_all_comment_desc; private TextView tv_all_comment_desc;
private ImageView tv_all_comment_go; private ImageView tv_all_comment_go;
private ImCommentBannerView comment_banner_view; private ImCommentBannerView comment_banner_view;
private TextView tvCommentCount;
private ImRedStarGradeView good_num_icons; private ImRedStarGradeView good_num_icons;
...@@ -259,8 +262,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -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_ll = rootView.findViewById(R.id.top_expert_info_ll);
top_expert_info_cl = rootView.findViewById(R.id.top_expert_info_cl); top_expert_info_cl = rootView.findViewById(R.id.top_expert_info_cl);
comment_banner_view_ll = rootView.findViewById(R.id.comment_banner_view_ll); 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); comment_banner_view = rootView.findViewById(R.id.comment_banner_view);
messageListView = rootView.findViewById(R.id.messageListView); // 消息列表 messageListView = rootView.findViewById(R.id.messageListView); // 消息列表
top_view_container = rootView.findViewById(R.id.top_view_container); // 消息列表 top_view_container = rootView.findViewById(R.id.top_view_container); // 消息列表
...@@ -851,13 +855,24 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -851,13 +855,24 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
int commentCounter = ActionHandlerStorage.getL(sessionId).getInfo().commentCounter; 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, ""); H5Params params = new H5Params(ActionHandlerStorage.getL(sessionId).getInfo().commentCounterUrl, "");
View.OnClickListener onClickListener = v -> NewH5Activity.start(getActivity(), params); View.OnClickListener onClickListener = v -> {
tv_all_comment_desc.setOnClickListener(onClickListener); if (Utils.isFastClick()) {
tv_all_comment_go.setOnClickListener(onClickListener); 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); comment_banner_view.initData(ActionHandlerStorage.getL(sessionId).getInfo().commentList);
......
...@@ -315,50 +315,15 @@ ...@@ -315,50 +315,15 @@
android:layout_weight="1"/> android:layout_weight="1"/>
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/tv_comment_count"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center" android:layout_height="wrap_content"
android:lines="1" android:layout_gravity="center"
android:text="评价" android:gravity="center_vertical"
android:textColor="@color/platform_main_theme" android:lines="1"
android:textSize="12dp" /> android:textColor="@color/platform_main_theme"
android:textSize="12sp"
<TextView tools:text="评价(10086)" />
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" />
</LinearLayout> </LinearLayout>
......
package com.yidianling.muse.activity package com.yidianling.muse.activity
//import com.yidianling.muse.dialog.ChooseMusicDialog
import android.content.Intent import android.content.Intent
import android.media.MediaPlayer import android.media.MediaPlayer
import android.os.Bundle import android.os.Bundle
...@@ -17,6 +16,7 @@ import com.ydl.ydlcommon.base.BaseActivity ...@@ -17,6 +16,7 @@ import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.event.MeditationEvent import com.ydl.ydlcommon.event.MeditationEvent
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show import com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show
...@@ -58,6 +58,11 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -58,6 +58,11 @@ class PlayMeditationActivity : BaseActivity() {
private var mMediaUrl = "" private var mMediaUrl = ""
private var mMediaCoverUrl = "" private var mMediaCoverUrl = ""
private var mMinProgramId: String? = null
private var mCateId: Int? = null
private var mTagId: String? = null
private var mMark: Int? = null
private var mTitle = "" private var mTitle = ""
private var mDesc = "" private var mDesc = ""
private var mStatus = 0 private var mStatus = 0
...@@ -90,6 +95,11 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -90,6 +95,11 @@ class PlayMeditationActivity : BaseActivity() {
private var mBuried: String? = null private var mBuried: String? = null
private var mVideoId: String? = null
private var mIndexForMini = 0
private var mMinProgramPath: String? = null
/** /**
* 传递过来的mediaId 用于判断正在播放的是否是同一条音频 * 传递过来的mediaId 用于判断正在播放的是否是同一条音频
*/ */
...@@ -139,6 +149,11 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -139,6 +149,11 @@ class PlayMeditationActivity : BaseActivity() {
val module = it.data val module = it.data
mMediaId = module.mediaId mMediaId = module.mediaId
mMinProgramId = module.minProgramId
mCateId = module.cateId
mTagId = module.tagId
mMark = module.mark
meditations.clear() meditations.clear()
module.mediaList?.forEach { meditationPlayBean -> module.mediaList?.forEach { meditationPlayBean ->
...@@ -148,7 +163,10 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -148,7 +163,10 @@ class PlayMeditationActivity : BaseActivity() {
if (meditationPlayBean.mediaId == mMediaId) { if (meditationPlayBean.mediaId == mMediaId) {
currentMeditation = currentMeditation =
meditationPlayBean.copy(meditationType = mMeditationType,meditationId = mMeditationId!!) meditationPlayBean.copy(
meditationType = mMeditationType,
meditationId = mMeditationId!!
)
mMediaId = module?.mediaId ?: 0L mMediaId = module?.mediaId ?: 0L
mTitle = meditationPlayBean.title mTitle = meditationPlayBean.title
...@@ -168,56 +186,28 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -168,56 +186,28 @@ class PlayMeditationActivity : BaseActivity() {
collected = mStatus == 1 collected = mStatus == 1
mVideoId = meditationPlayBean.videoId
mIndexForMini = 0
updateUI() updateUI()
initMediaPlayer(mMediaUrl, currentPosition,mMediaIdFromLocal == mMediaId) formatMiniPath()
initMediaPlayer(
mMediaUrl,
currentPosition,
mMediaIdFromLocal == mMediaId
)
} }
} }
// mediaListLink = module.playDetailUrl?:""
//
// val mediaList = module.mediaList
// if(!mediaList.isNullOrEmpty()){
// val meditation = mediaList[0]
//
//
//
// currentMeditation = meditation.copy(meditationType = mMeditationType,meditationId = mMeditationId!!)
// mTitle = meditation.title
// mDesc = meditation.desc?:""
// mMediaUrl = meditation.mediaUrl
// mMediaCoverUrl = meditation.coverImageUrl
// val currentPosition = meditation.broadcastTime
// mBusinessType = meditation.businessType
// mBuried = meditation.buried
// mStatus = meditation.status
//
// collected = mStatus == 1
//
// updateUI()
//
// initMediaPlayer(
// mMediaUrl,
// currentPosition,
// mMediaIdFromLocal == mMediaId
// )
//
// //快进点击事件
// ActionCountUtils.baiDuCountSign3(
// MuseBIConstants.YDL_MUSE_MEDITATION_MUSIC_PLAY_PAGE,
// MuseBIConstants.YDL_MUSE_PLAY_PAGE_VISIT,
// currentMeditation?.title ?: "",
// mBuried ?: "",
// ""
// )
// }
} }
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
show(msg) show(msg)
} }
}) })
} else { } else {
MuseHttp.getInstance().getMeditationPlayDetail( MuseHttp.getInstance().getMeditationPlayDetail(
meditionType = 1, meditionType = 1,
mediaId = mMediaIdFromLocal!!, mediaId = mMediaIdFromLocal!!,
...@@ -231,17 +221,26 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -231,17 +221,26 @@ class PlayMeditationActivity : BaseActivity() {
val module = it.data val module = it.data
mMediaId = module.mediaId mMediaId = module.mediaId
mMinProgramId = module.minProgramId
mCateId = module.cateId
mTagId = module.tagId
mMark = module.mark
meditations.clear() meditations.clear()
module.mediaList?.forEach { meditationPlayBean -> module.mediaList?.forEachIndexed { index, meditationPlayBean ->
meditations.add(meditationPlayBean) meditations.add(meditationPlayBean)
if (meditationPlayBean.mediaId == mMediaId) { if (meditationPlayBean.mediaId == mMediaId) {
mIndexForMini = index
currentMeditation = currentMeditation =
meditationPlayBean.copy(meditationType = mMeditationType,meditationId = mMeditationId!!) meditationPlayBean.copy(
meditationType = mMeditationType,
meditationId = mMeditationId!!
)
mMediaId = module?.mediaId ?: 0L mMediaId = module?.mediaId ?: 0L
mTitle = meditationPlayBean.title mTitle = meditationPlayBean.title
...@@ -261,9 +260,17 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -261,9 +260,17 @@ class PlayMeditationActivity : BaseActivity() {
collected = mStatus == 1 collected = mStatus == 1
mVideoId = meditationPlayBean.videoId
formatMiniPath()
updateUI() updateUI()
initMediaPlayer(mMediaUrl, currentPosition,mMediaIdFromLocal == mMediaId) initMediaPlayer(
mMediaUrl,
currentPosition,
mMediaIdFromLocal == mMediaId
)
} }
} }
} }
...@@ -322,7 +329,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -322,7 +329,7 @@ class PlayMeditationActivity : BaseActivity() {
"" ""
) )
if (!mediaListLink.isNullOrBlank()) { if (!mediaListLink.isNullOrBlank()) {
ChooseMusicActivity.launch(this, H5Params(mediaListLink,"") ) ChooseMusicActivity.launch(this, H5Params(mediaListLink, ""))
} }
} }
...@@ -392,7 +399,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -392,7 +399,7 @@ class PlayMeditationActivity : BaseActivity() {
"" ""
) )
if(mMeditationType == 0){ if (mMeditationType == 0) {
if (mMeditationId != null && mMediaId != null) { if (mMeditationId != null && mMediaId != null) {
MediaPlayerTimeUtil.uploadPlayRecord( MediaPlayerTimeUtil.uploadPlayRecord(
meditationId = mMeditationId!!.toInt(), meditationId = mMeditationId!!.toInt(),
...@@ -407,7 +414,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -407,7 +414,7 @@ class PlayMeditationActivity : BaseActivity() {
finish() finish()
} }
}else{ } else {
if (quitDialog == null) { if (quitDialog == null) {
quitDialog = QuitMeditationDialog.newInstance() quitDialog = QuitMeditationDialog.newInstance()
} }
...@@ -441,9 +448,13 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -441,9 +448,13 @@ class PlayMeditationActivity : BaseActivity() {
mBuried ?: "", mBuried ?: "",
"" ""
) )
val event = MeditationFloatEvent(true, val event = MeditationFloatEvent(
meditation = currentMeditation?.copy(meditationType = mMeditationType,meditationId = true,
mMeditationId?:0)) meditation = currentMeditation?.copy(
meditationType = mMeditationType, meditationId =
mMeditationId ?: 0
)
)
EventBus.getDefault().post(event) EventBus.getDefault().post(event)
Handler().postDelayed({ Handler().postDelayed({
...@@ -466,13 +477,15 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -466,13 +477,15 @@ class PlayMeditationActivity : BaseActivity() {
shareTitle = mTitle, shareTitle = mTitle,
shareContent = mDesc, shareContent = mDesc,
shareUrl = mMediaUrl, shareUrl = mMediaUrl,
shareImageUrl = mMediaCoverUrl shareImageUrl = mMediaCoverUrl,
miniId = "gh_c154608001f0",
// miniId = mMinProgramId!!,
miniPath = mMinProgramPath!!
) )
} }
if (shareDialog != null && shareDialog?.isAdded == false) { if (shareDialog != null && shareDialog?.isAdded == false) {
shareDialog?.show(supportFragmentManager, ShareMeditationDialog.TAG) shareDialog?.show(supportFragmentManager, ShareMeditationDialog.TAG)
} }
} }
iv_time_off.setOnClickListener { iv_time_off.setOnClickListener {
...@@ -485,7 +498,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -485,7 +498,7 @@ class PlayMeditationActivity : BaseActivity() {
"" ""
) )
val intent = Intent(this, MeditationTimeOffActivity::class.java) val intent = Intent(this, MeditationTimeOffActivity::class.java)
intent.putExtra("BG_IMAGE_URL",mMediaCoverUrl) intent.putExtra("BG_IMAGE_URL", mMediaCoverUrl)
startActivityForResult(intent, request_code) startActivityForResult(intent, request_code)
} }
...@@ -499,7 +512,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -499,7 +512,7 @@ class PlayMeditationActivity : BaseActivity() {
"" ""
) )
val intent = Intent(this, MeditationTimeOffActivity::class.java) val intent = Intent(this, MeditationTimeOffActivity::class.java)
intent.putExtra("BG_IMAGE_URL",mMediaCoverUrl) intent.putExtra("BG_IMAGE_URL", mMediaCoverUrl)
startActivityForResult(intent, request_code) startActivityForResult(intent, request_code)
} }
...@@ -578,7 +591,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -578,7 +591,7 @@ class PlayMeditationActivity : BaseActivity() {
) )
var currentPosition = 0 var currentPosition = 0
meditations?.forEachIndexed { index, meditationDetail -> meditations?.forEachIndexed { index, meditationDetail ->
if (meditationDetail.mediaId == mMediaId){ if (meditationDetail.mediaId == mMediaId) {
currentPosition = index currentPosition = index
} }
} }
...@@ -595,17 +608,22 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -595,17 +608,22 @@ class PlayMeditationActivity : BaseActivity() {
) )
val meditation = meditations[currentPosition - 1] val meditation = meditations[currentPosition - 1]
currentMeditation = meditation.copy(meditationId = mMeditationId!!) currentMeditation = meditation.copy(meditationId = mMeditationId!!)
mMediaId = meditation.mediaId mMediaId = meditation.mediaId
mMediaCoverUrl = meditation.coverImageUrl mMediaCoverUrl = meditation.coverImageUrl
mMediaUrl = meditation.mediaUrl mMediaUrl = meditation.mediaUrl
val currentPosition = meditation.broadcastTime
mStatus = meditation.status mStatus = meditation.status
mTitle = meditation.title mTitle = meditation.title
mDesc = meditation.title mDesc = meditation.title
mVideoId = meditation.videoId
mIndexForMini = currentPosition - 1
formatMiniPath()
updateUI(needRefresh = false) updateUI(needRefresh = false)
initMediaPlayer(mMediaUrl, 0, mMediaIdFromLocal == mMediaId) initMediaPlayer(mMediaUrl, 0, mMediaIdFromLocal == mMediaId)
...@@ -627,7 +645,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -627,7 +645,7 @@ class PlayMeditationActivity : BaseActivity() {
) )
var currentPosition = 0 var currentPosition = 0
meditations?.forEachIndexed { index, meditationDetail -> meditations?.forEachIndexed { index, meditationDetail ->
if (meditationDetail.mediaId == mMediaId){ if (meditationDetail.mediaId == mMediaId) {
currentPosition = index currentPosition = index
} }
} }
...@@ -650,11 +668,15 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -650,11 +668,15 @@ class PlayMeditationActivity : BaseActivity() {
mMediaId = meditation.mediaId mMediaId = meditation.mediaId
mMediaCoverUrl = meditation.coverImageUrl mMediaCoverUrl = meditation.coverImageUrl
mMediaUrl = meditation.mediaUrl mMediaUrl = meditation.mediaUrl
val currentPosition = meditation.broadcastTime
mStatus = meditation.status mStatus = meditation.status
mTitle = meditation.title mTitle = meditation.title
mDesc = meditation.title mDesc = meditation.title
mVideoId = meditation.videoId
mIndexForMini = currentPosition + 1
formatMiniPath()
updateUI(needRefresh = false) updateUI(needRefresh = false)
...@@ -743,10 +765,11 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -743,10 +765,11 @@ class PlayMeditationActivity : BaseActivity() {
}) })
val isLoop = MediaPlayerManager.getInstance(this@PlayMeditationActivity)?.getTimeOffStatus() == true val isLoop =
MediaPlayerManager.getInstance(this@PlayMeditationActivity)?.getTimeOffStatus() == true
initPlayCompletionListener(isLoop = isLoop) initPlayCompletionListener(isLoop = isLoop)
MeditationFloatPermissionUtil.checkSuspendedWindowPermission(this){ MeditationFloatPermissionUtil.checkSuspendedWindowPermission(this) {
} }
...@@ -756,9 +779,9 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -756,9 +779,9 @@ class PlayMeditationActivity : BaseActivity() {
mMediaPlayer?.setOnCompletionListener { mMediaPlayer?.setOnCompletionListener {
val duration = currentMeditation?.duration?.toInt()?:0 val duration = currentMeditation?.duration?.toInt() ?: 0
val currentDuration = (mMediaPlayer?.currentPosition?:0)/1000 val currentDuration = (mMediaPlayer?.currentPosition ?: 0) / 1000
if(currentDuration==duration){ if (currentDuration == duration) {
val playTime = (seekbar_play_progress.progress / 1000.00).roundToInt() val playTime = (seekbar_play_progress.progress / 1000.00).roundToInt()
MediaPlayerTimeUtil.uploadPlayRecord( MediaPlayerTimeUtil.uploadPlayRecord(
...@@ -770,13 +793,12 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -770,13 +793,12 @@ class PlayMeditationActivity : BaseActivity() {
) )
} }
if (isLoop){ if (isLoop) {
if (isSingle || meditations.size == 1){ if (isSingle || meditations.size == 1) {
switchSound() switchSound()
// MediaPlayerManager.getInstance(this)?.setAudioPath(mMediaUrl) } else {
}else{ switchSound()
switchSound() }
}
} }
isPlaying = if (it.isPlaying) { isPlaying = if (it.isPlaying) {
...@@ -796,18 +818,20 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -796,18 +818,20 @@ class PlayMeditationActivity : BaseActivity() {
} }
private fun switchSound(){ private fun switchSound() {
var meditation:MeditationPlayModuleBean.MeditationDetail? = null var meditation: MeditationPlayModuleBean.MeditationDetail? = null
meditations?.forEachIndexed { index, meditationDetail -> meditations?.forEachIndexed { index, meditationDetail ->
if (meditationDetail.mediaId == mMediaId){ if (meditationDetail.mediaId == mMediaId) {
currentMeditationIndex = index currentMeditationIndex = index
} }
} }
if (mMeditationId == null || mMediaId == null) return if (mMeditationId == null || mMediaId == null) return
if (currentMeditationIndex < meditations.size - 1) { if (currentMeditationIndex < meditations.size - 1) {
meditation = meditations[currentMeditationIndex + 1] meditation = meditations[currentMeditationIndex + 1]
mIndexForMini = currentMeditationIndex + 1
} else { } else {
meditation = meditations[0] meditation = meditations[0]
mIndexForMini = 0
} }
currentMeditation = meditation.copy(meditationId = mMeditationId!!) currentMeditation = meditation.copy(meditationId = mMeditationId!!)
...@@ -819,6 +843,10 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -819,6 +843,10 @@ class PlayMeditationActivity : BaseActivity() {
mTitle = meditation.title mTitle = meditation.title
mDesc = meditation.title mDesc = meditation.title
mVideoId = meditation.videoId
formatMiniPath()
updateUI(needRefresh = false) updateUI(needRefresh = false)
initMediaPlayer(mMediaUrl, 0, mMediaIdFromLocal == mMediaId) initMediaPlayer(mMediaUrl, 0, mMediaIdFromLocal == mMediaId)
...@@ -826,7 +854,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -826,7 +854,7 @@ class PlayMeditationActivity : BaseActivity() {
private fun initMediaPlayer(path: String, current: Int, isSameOne: Boolean = false) { private fun initMediaPlayer(path: String, current: Int, isSameOne: Boolean = false) {
if (MediaPlayerManager.getInstance(this)?.getAudioPath()!=null && if (MediaPlayerManager.getInstance(this)?.getAudioPath() != null &&
MediaPlayerManager.getInstance(this)?.getMediaId() == mMediaId MediaPlayerManager.getInstance(this)?.getMediaId() == mMediaId
) { ) {
if (mMediaPlayer?.isPlaying == true) { if (mMediaPlayer?.isPlaying == true) {
...@@ -888,7 +916,8 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -888,7 +916,8 @@ class PlayMeditationActivity : BaseActivity() {
mTimer.schedule(object : TimerTask() { mTimer.schedule(object : TimerTask() {
override fun run() { override fun run() {
if (!isSeekbarChanging) { if (!isSeekbarChanging) {
seekbar_play_progress.progress = mMediaPlayer?.currentPosition ?: 0 seekbar_play_progress.progress =
mMediaPlayer?.currentPosition ?: 0
} }
} }
}, 0, 50) }, 0, 50)
...@@ -921,7 +950,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -921,7 +950,7 @@ class PlayMeditationActivity : BaseActivity() {
MediaPlayerManager.getInstance(this)?.setTimeOffStatus(true) MediaPlayerManager.getInstance(this)?.setTimeOffStatus(true)
initRxTimeOff((minute * 60 * 1000).toLong(), 1) initRxTimeOff((minute * 60 * 1000).toLong(), 1)
} }
val event = MeditationFloatEvent(false,time = (minute * 60 * 1000).toLong()) val event = MeditationFloatEvent(false, time = (minute * 60 * 1000).toLong())
EventBus.getDefault().post(event) EventBus.getDefault().post(event)
} else { } else {
initPlayCompletionListener() initPlayCompletionListener()
...@@ -931,13 +960,13 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -931,13 +960,13 @@ class PlayMeditationActivity : BaseActivity() {
tv_time_off.visibility = View.GONE tv_time_off.visibility = View.GONE
tv_time_off_pure_music.visibility = View.GONE tv_time_off_pure_music.visibility = View.GONE
mMediaPlayer?.isLooping = false mMediaPlayer?.isLooping = false
val event = MeditationFloatEvent(false,time = 0) val event = MeditationFloatEvent(false, time = 0)
EventBus.getDefault().post(event) EventBus.getDefault().post(event)
} }
} }
} }
private fun updateUI(needRefresh:Boolean = true){ private fun updateUI(needRefresh: Boolean = true) {
tv_title.text = mTitle tv_title.text = mTitle
tv_content.text = mDesc tv_content.text = mDesc
Glide.with(this) Glide.with(this)
...@@ -952,10 +981,10 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -952,10 +981,10 @@ class PlayMeditationActivity : BaseActivity() {
} }
) )
if(needRefresh){ if (needRefresh) {
if(MediaPlayerManager.getInstance(this)?.getTimeOffStatus() == true){ if (MediaPlayerManager.getInstance(this)?.getTimeOffStatus() == true) {
val timeOff = MediaPlayerManager.getInstance(this)?.getTimeOff() val timeOff = MediaPlayerManager.getInstance(this)?.getTimeOff()
if (timeOff!=null && timeOff>0 && mMeditationType!=null){ if (timeOff != null && timeOff > 0 && mMeditationType != null) {
initRxTimeOff(timeOff, mMeditationType!!) initRxTimeOff(timeOff, mMeditationType!!)
} }
} }
...@@ -1064,4 +1093,10 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -1064,4 +1093,10 @@ class PlayMeditationActivity : BaseActivity() {
const val request_code = 0x0001 const val request_code = 0x0001
} }
private fun formatMiniPath() {
mMinProgramPath = "/pages/player/index?share=1&meditationId=${mMeditationId}" +
"&meditionType=${mMeditationType}&mediaId=${mMediaId}&collectStatus=${mStatus}&index=${mIndexForMini}&videoId=${mVideoId}&cateId=${mCateId}&mark=${mMark}&tagId=${mTagId}"
LogUtil.d("Lancet======", mMinProgramPath)
}
} }
\ No newline at end of file
...@@ -5,32 +5,37 @@ package com.yidianling.muse.bean ...@@ -5,32 +5,37 @@ package com.yidianling.muse.bean
* Created by xj on 2019/9/16. * Created by xj on 2019/9/16.
*/ */
class MeditationPlayModuleBean : HomeItemBaseBean { class MeditationPlayModuleBean : HomeItemBaseBean {
constructor():super(false) constructor() : super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty) constructor(isRealEmpty: Boolean) : super(isRealEmpty)
var meditationId:Long? = null var meditationId: Long? = null
var mediaId:Long? = null var mediaId: Long? = null
var mediaType:Int?=null var mediaType: Int? = null
var playDetailUrl:String? = 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 var mediaList: ArrayList<MeditationDetail>? = null
data class MeditationDetail( data class MeditationDetail(
val meditationType:Int? = null, val meditationType: Int? = null,
val mediaId:Long?=null, val mediaId: Long? = null,
val meditationId:Long, val meditationId: Long,
val title:String, val title: String,
val author:String, val author: String,
val coverImageUrl:String, val coverImageUrl: String,
val mediaUrl:String, val mediaUrl: String,
val duration:Float?=null, val duration: Float? = null,
val status:Int, val status: Int,
val broadcastTime:Int, val broadcastTime: Int,
val businessType:Int, val businessType: Int,
val buried:String?=null, val buried: String? = null,
val desc:String?=null, val desc: String? = null,
val coverImageUrlIcon:String val coverImageUrlIcon: String,
) val videoId: String? = null
)
override fun toString(): String { override fun toString(): String {
return "MeditationPlayModuleBean(meditationId=$meditationId, mediaId=$mediaId, mediaType=$mediaType, playDetailUrl=$playDetailUrl, mediaList=$mediaList)" return "MeditationPlayModuleBean(meditationId=$meditationId, mediaId=$mediaId, mediaType=$mediaType, playDetailUrl=$playDetailUrl, mediaList=$mediaList)"
......
...@@ -60,10 +60,12 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -60,10 +60,12 @@ class ShareMeditationDialog : DialogFragment() {
private fun initView(view: View?) { private fun initView(view: View?) {
val shareImageUrl = arguments?.getString(KEY_SHARE_IMAGE_URL)?:"" val shareImageUrl = arguments?.getString(KEY_SHARE_IMAGE_URL) ?: ""
val shareTitle = arguments?.getString(KEY_SHARE_TITLE)?:"" val shareTitle = arguments?.getString(KEY_SHARE_TITLE) ?: ""
val shareContent = arguments?.getString(KEY_SHARE_CONTENT)?:"" val shareContent = arguments?.getString(KEY_SHARE_CONTENT) ?: ""
val shareUrl = arguments?.getString(KEY_SHARE_URL)?:"" 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) ivSharePicture = view?.findViewById(R.id.iv_share_picture)
...@@ -82,13 +84,15 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -82,13 +84,15 @@ class ShareMeditationDialog : DialogFragment() {
llQQFriend = view?.findViewById(R.id.ll_qq_friend) llQQFriend = view?.findViewById(R.id.ll_qq_friend)
llWeChat?.setOnClickListener { llWeChat?.setOnClickListener {
ShareUtils.shareTo( ShareUtils.shareSmailWeixin(
SHARE_MEDIA.WEIXIN,
activity as Activity, activity as Activity,
shareTitle, shareTitle,
shareUrl, shareUrl,
shareContent, shareContent,
shareImageUrl shareImageUrl,
path = shareMiniPath,
id = shareMiniId,
shareListener = null
) )
dismiss() dismiss()
} }
...@@ -147,13 +151,24 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -147,13 +151,24 @@ class ShareMeditationDialog : DialogFragment() {
private const val KEY_SHARE_URL = "key_share_url" private const val KEY_SHARE_URL = "key_share_url"
private const val KEY_SHARE_CONTENT = "key_share_content" private const val KEY_SHARE_CONTENT = "key_share_content"
private const val KEY_SHARE_IMAGE_URL = "key_share_image_url" private const val KEY_SHARE_IMAGE_URL = "key_share_image_url"
private const val KEY_SHARE_MINI_ID = "key_share_mini_id"
fun newInstance(shareTitle:String,shareUrl:String,shareContent:String,shareImageUrl: String): ShareMeditationDialog { 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() val args = Bundle()
args.putString(KEY_SHARE_TITLE, shareTitle) args.putString(KEY_SHARE_TITLE, shareTitle)
args.putString(KEY_SHARE_CONTENT, shareContent) args.putString(KEY_SHARE_CONTENT, shareContent)
args.putString(KEY_SHARE_URL, shareUrl) args.putString(KEY_SHARE_URL, shareUrl)
args.putString(KEY_SHARE_IMAGE_URL, shareImageUrl) args.putString(KEY_SHARE_IMAGE_URL, shareImageUrl)
args.putString(KEY_SHARE_MINI_ID, miniId)
args.putString(KEY_SHARE_MINI_PATH, miniPath)
val fragment = ShareMeditationDialog() val fragment = ShareMeditationDialog()
fragment.arguments = args fragment.arguments = args
return fragment return fragment
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/tests_NoTitleTheme" android:theme="@style/tests_NoTitleTheme"
/> />
<activity android:name=".search.TestSearchKeyActivity"
android:screenOrientation="portrait"
android:theme="@style/tests_NoTitleTheme"/>
<!--测评首页--> <!--测评首页-->
<activity <activity
android:name=".home.NewTestHomeActivity" android:name=".home.NewTestHomeActivity"
......
...@@ -14,4 +14,6 @@ class TestListCommand : BaseCommand() { ...@@ -14,4 +14,6 @@ class TestListCommand : BaseCommand() {
var tab: String? = null var tab: String? = null
@JvmField @JvmField
var keyword: String? = null var keyword: String? = null
@JvmField
var type: Int = 0
} }
\ No newline at end of file
...@@ -3,12 +3,13 @@ package com.yidianling.tests.list.view ...@@ -3,12 +3,13 @@ package com.yidianling.tests.list.view
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.core.content.ContextCompat
import androidx.viewpager.widget.ViewPager
import android.view.View import android.view.View
import android.widget.PopupWindow import android.widget.PopupWindow
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.viewpager.widget.ViewPager
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.android.material.tabs.TabLayout
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
...@@ -32,7 +33,8 @@ import com.yidianling.tests.search.TestSearchActivity ...@@ -32,7 +33,8 @@ import com.yidianling.tests.search.TestSearchActivity
import kotlinx.android.synthetic.main.tests_activity_test_category_list.* import kotlinx.android.synthetic.main.tests_activity_test_category_list.*
@Route(path = "/ceshi/category_list") @Route(path = "/ceshi/category_list")
class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListActivityPresenter>(), TestListActivityView, PopupWindow.OnDismissListener { class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListActivityPresenter>(),
TestListActivityView, PopupWindow.OnDismissListener {
private var isMine: Boolean = false private var isMine: Boolean = false
private var tabName: String? = null private var tabName: String? = null
...@@ -51,12 +53,13 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -51,12 +53,13 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
var selectedConditionList: HashMap<Int, HashMap<String, CategotyPopItem>> = HashMap() var selectedConditionList: HashMap<Int, HashMap<String, CategotyPopItem>> = HashMap()
var sortPopup: CategoryPopupWindow? = null; var sortPopup: CategoryPopupWindow? = null;
var filterPopup: CategoryPopupWindow? = null;
var currentPageIndex: Int = 0 var currentPageIndex: Int = 0
val SELECT_SORT: String = "SELECT_SORT" val SELECT_SORT: String = "SELECT_SORT"
val SELECT_FILTER: String = "SELECT_FILTER" val SELECT_FILTER: String = "SELECT_FILTER"
private var testCategoryAdapter: TestListPagerAdapter? = null private var testCategoryAdapter: TestListPagerAdapter? = null
var title = arrayOf("全部", "付费", "免费")
companion object { companion object {
private const val EXTRA_IS_MINE = "is_mine" private const val EXTRA_IS_MINE = "is_mine"
...@@ -116,15 +119,50 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -116,15 +119,50 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
showSortPopupWindow() showSortPopupWindow()
} }
dr_filter.setOnClickListener { for (i in title) {
showFilterPopupWindow() val tab = tab_tabLayout.newTab().setText(i)
tab_tabLayout.addTab(tab)
} }
tab_tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
when (tab?.text.toString()) {
"全部" -> {
selectFilterItem = filterList[0]
}
"付费" -> {
selectFilterItem = filterList[1]
}
"免费" -> {
selectFilterItem = filterList[2]
}
}
onDismiss()
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
mPresenter.fetchTestTypeList() mPresenter.fetchTestTypeList()
vvp_test.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { vvp_test.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) {} override fun onPageScrollStateChanged(state: Int) {}
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {} override fun onPageScrolled(
position: Int,
positionOffset: Float,
positionOffsetPixels: Int
) {
}
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
currentPageIndex = position currentPageIndex = position
...@@ -134,10 +172,13 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -134,10 +172,13 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
LogUtil.d("page selected: " + testCategory?.get(position)?.name) LogUtil.d("page selected: " + testCategory?.get(position)?.name)
BuryPointUtils.getInstance().createMap() BuryPointUtils.getInstance().createMap()
.put("test_type_click", testCategory?.get(position)?.name + "") .put("test_type_click", testCategory?.get(position)?.name + "")
.burryPoint("Testtype_click") .burryPoint("Testtype_click")
if (("my" == testCategory?.get(position)?.tab || "unpay" == testCategory?.get(position)?.tab) ) { if (("my" == testCategory?.get(position)?.tab || "unpay" == testCategory?.get(
TestsIn.loginByOneKeyLogin(this@TestCategoryListActivity,true) position
)?.tab)
) {
TestsIn.loginByOneKeyLogin(this@TestCategoryListActivity, true)
} }
} }
}) })
...@@ -154,33 +195,21 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -154,33 +195,21 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
filterList.add(CategotyPopItem("免费", "2")) filterList.add(CategotyPopItem("免费", "2"))
sortPopup = CategoryPopupWindow(this, sortPopup = CategoryPopupWindow(this,
sortList.toList() as ArrayList<CategotyPopItem>, object : CategoryConditionRecyclerViewAdapter.OnItemSelectedListener { sortList.toList() as ArrayList<CategotyPopItem>,
override fun onSortItemSelected(sortItem: CategotyPopItem) { object : CategoryConditionRecyclerViewAdapter.OnItemSelectedListener {
selectSortItem = sortItem override fun onSortItemSelected(sortItem: CategotyPopItem) {
if (selectSortItem.key == sortConditionDefaultKey) { selectSortItem = sortItem
updateFilterTextViewStatus(dr_sort, sortItem.value!!, true) if (selectSortItem.key == sortConditionDefaultKey) {
} else { updateFilterTextViewStatus(dr_sort, sortItem.value!!, true)
updateFilterTextViewStatus(dr_sort, sortItem.value!!, false) } else {
updateFilterTextViewStatus(dr_sort, sortItem.value!!, false)
}
sortPopup?.dismiss()
} }
sortPopup?.dismiss() })
}
})
filterPopup = CategoryPopupWindow(this,
filterList.toList() as ArrayList<CategotyPopItem>, object : CategoryConditionRecyclerViewAdapter.OnItemSelectedListener {
override fun onSortItemSelected(sortItem: CategotyPopItem) {
selectFilterItem = sortItem
if (selectFilterItem.key == filterConditionDefaultKey) {
updateFilterTextViewStatus(dr_filter, sortItem.value!!, true)
} else {
updateFilterTextViewStatus(dr_filter, sortItem.value!!, false)
}
filterPopup?.dismiss()
}
})
sortPopup?.setOnDismissListener(this) sortPopup?.setOnDismissListener(this)
filterPopup?.setOnDismissListener(this)
} }
override fun onDismiss() { override fun onDismiss() {
...@@ -200,24 +229,18 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -200,24 +229,18 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
updateFilterTextViewStatus(dr_sort, selectSortItem.value!!, false) updateFilterTextViewStatus(dr_sort, selectSortItem.value!!, false)
} }
if (selectFilterItem.key == filterConditionDefaultKey) { updateTabLayoutStatus(tab_tabLayout, selectFilterItem.value!!)
updateFilterTextViewStatus(dr_filter, selectFilterItem.value!!, true)
} else { } else {
updateFilterTextViewStatus(dr_filter, selectFilterItem.value!!, false) selectSortItem = CategotyPopItem("综合排序", sortConditionDefaultKey)
} selectFilterItem = CategotyPopItem("全部", filterConditionDefaultKey)
}else{
selectSortItem = CategotyPopItem("综合排序", sortConditionDefaultKey)
selectFilterItem= CategotyPopItem("全部", filterConditionDefaultKey)
updateFilterTextViewStatus(dr_sort, selectSortItem.value!!, true) updateFilterTextViewStatus(dr_sort, selectSortItem.value!!, true)
updateFilterTextViewStatus(dr_filter, selectFilterItem.value!!, true) updateTabLayoutStatus(tab_tabLayout, selectFilterItem.value!!)
} }
sortPopup?.adapter?.lastSelectText = selectSortItem.value sortPopup?.adapter?.lastSelectText = selectSortItem.value
filterPopup?.adapter?.lastSelectText = selectFilterItem.value
sortPopup?.adapter?.notifyDataSetChanged() sortPopup?.adapter?.notifyDataSetChanged()
filterPopup?.adapter?.notifyDataSetChanged()
} }
private fun updateConditionList() { private fun updateConditionList() {
...@@ -229,11 +252,11 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -229,11 +252,11 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
conditionList[SELECT_FILTER] = selectFilterItem conditionList[SELECT_FILTER] = selectFilterItem
selectedConditionList[currentPageIndex] = conditionList selectedConditionList[currentPageIndex] = conditionList
refreshFragmentPageData(selectSortItem.key!!,selectFilterItem.key!!) refreshFragmentPageData(selectSortItem.key!!, selectFilterItem.key!!)
} }
private fun refreshFragmentPageData(sort:String,filter:String) { private fun refreshFragmentPageData(sort: String, filter: String) {
testCategoryAdapter?.getFragmentByPosition(currentPageIndex)?.refreshListData(sort,filter) testCategoryAdapter?.getFragmentByPosition(currentPageIndex)?.refreshListData(sort, filter)
} }
...@@ -294,23 +317,38 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -294,23 +317,38 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
view_mask.visibility = View.VISIBLE view_mask.visibility = View.VISIBLE
} }
//显示筛选弹窗
private fun showFilterPopupWindow() {
filterPopup?.showAsDropDown(ll_sort)
view_mask.visibility = View.VISIBLE
}
private fun updateFilterTextViewStatus(tv: TextView, text: String, isNormal: Boolean) { private fun updateFilterTextViewStatus(tv: TextView, text: String, isNormal: Boolean) {
tv.text = text tv.text = text
if (isNormal) { if (isNormal) {
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault)) tv.setTextColor(ContextCompat.getColor(this, R.color.platform_color_999999))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
} else { } else {
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_main_theme)) tv.setTextColor(ContextCompat.getColor(this, R.color.platform_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.tests_ic_arrow_drop_down, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.tests_ic_arrow_drop_down, 0)
} }
} }
private fun updateTabLayoutStatus(tabLayout: TabLayout, text: String) {
when (text) {
"全部" -> {
tabLayout.getTabAt(0)?.select()
}
"付费" -> {
tabLayout.getTabAt(1)?.select()
}
"免费" -> {
tabLayout.getTabAt(2)?.select()
}
}
}
override fun onFailed(msg: String?) { override fun onFailed(msg: String?) {
ToastUtil.toastShort(msg ?: "") ToastUtil.toastShort(msg ?: "")
} }
......
...@@ -117,8 +117,8 @@ class TestListRecyclerAdapter(private val context: Context, ...@@ -117,8 +117,8 @@ class TestListRecyclerAdapter(private val context: Context,
tvCoupon.visibility = View.GONE tvCoupon.visibility = View.GONE
textView.setPadding(dp5!!,dp2!!,dp5!!,dp2!!) textView.setPadding(dp5!!,dp2!!,dp5!!,dp2!!)
textView.text = "免费" textView.text = "免费"
textView.setBackgroundResource(R.drawable.tests_testhome_recom_price_bg) textView.setBackgroundResource(R.drawable.tests_testhome_recom_price_red_bg)
textView.setTextColor(Color.parseColor("#34CD65")) textView.setTextColor(Color.parseColor("#FF5B05"))
}else{ }else{
var newPrice = TestHomeUtils.getOriginalPrice(tvCoupon,price,couponMoney) var newPrice = TestHomeUtils.getOriginalPrice(tvCoupon,price,couponMoney)
textView.setPadding(0,dp5!!,dp5!!,0) textView.setPadding(0,dp5!!,dp5!!,0)
......
...@@ -33,8 +33,9 @@ import de.greenrobot.event.EventBus ...@@ -33,8 +33,9 @@ import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.tests_activity_test_search.* import kotlinx.android.synthetic.main.tests_activity_test_search.*
import kotlinx.android.synthetic.main.tests_item_hot_search.view.* import kotlinx.android.synthetic.main.tests_item_hot_search.view.*
@Route(path ="/tests/search") @Route(path = "/tests/search")
class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView, View.OnClickListener { class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView,
View.OnClickListener {
private var isFirstLoad = true private var isFirstLoad = true
override fun getStatusViewOptions(): StatusBarOptions { override fun getStatusViewOptions(): StatusBarOptions {
...@@ -76,7 +77,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -76,7 +77,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
} }
fun initData() { 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)) { if (!TextUtils.isEmpty(lastCouponMoney)) {
searchAdapter?.couponMoney = lastCouponMoney searchAdapter?.couponMoney = lastCouponMoney
hotSearchAdapter?.couponMoney = lastCouponMoney hotSearchAdapter?.couponMoney = lastCouponMoney
...@@ -95,8 +97,16 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -95,8 +97,16 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
private fun initRecyclerView() { private fun initRecyclerView() {
swipe_refresh_layout.isEnabled = false swipe_refresh_layout.isEnabled = false
searchAdapter = TestListRecyclerAdapter(this, searchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH) searchAdapter = TestListRecyclerAdapter(
hotSearchAdapter = TestListRecyclerAdapter(this, hotSearchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH) this,
searchedTestList,
TestListRecyclerAdapter.PAGE_TYPE_SEARCH
)
hotSearchAdapter = TestListRecyclerAdapter(
this,
hotSearchedTestList,
TestListRecyclerAdapter.PAGE_TYPE_SEARCH
)
searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data -> searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
TestsIn.getTestsImpl().testDetailH5(data.id.toString()) TestsIn.getTestsImpl().testDetailH5(data.id.toString())
...@@ -106,7 +116,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -106,7 +116,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
TestsIn.getTestsImpl().testDetailH5(data.id.toString()) 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); searchHeader = View.inflate(this, R.layout.tests_header_search_list, null);
tvSearchHint = searchHeader?.findViewById(R.id.tv_search_hint); tvSearchHint = searchHeader?.findViewById(R.id.tv_search_hint);
...@@ -135,13 +146,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -135,13 +146,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
onScrollListener = object : EndlessRecyclerViewScrollListener(layoutManager) { onScrollListener = object : EndlessRecyclerViewScrollListener(layoutManager) {
override fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView?) { override fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView?) {
if (isSearch) { if (isSearch) {
mPresenter.searchTests(keyword, searchListCurrentPage) mPresenter.searchTests(keyword, searchListCurrentPage, 0)
} }
} }
} }
rv_hot_list.addOnScrollListener(object : RecyclerView.OnScrollListener() { rv_hot_list.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if (!isFirstLoad && dx!=0 && dx!=0) { if (!isFirstLoad && dx != 0 && dx != 0) {
hideSoftInput() hideSoftInput()
} }
} }
...@@ -168,7 +179,14 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -168,7 +179,14 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
}) })
etSearch.setOnEditorActionListener { _, actionId, _ -> etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) { 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 true
} }
...@@ -193,7 +211,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -193,7 +211,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
isSearch = true isSearch = true
searchListCurrentPage = 1 searchListCurrentPage = 1
onScrollListener.resetState() onScrollListener.resetState()
mPresenter.searchTests(keyword, searchListCurrentPage) mPresenter.searchTests(keyword, searchListCurrentPage, 0)
} }
fun hideSoftInput() { fun hideSoftInput() {
...@@ -241,11 +259,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -241,11 +259,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
headerHotSearch?.visibility = View.VISIBLE headerHotSearch?.visibility = View.VISIBLE
flHotSearch?.removeAllViews() flHotSearch?.removeAllViews()
for (index in keywordData.indices) { 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.tvHotSearch.text = keywordData[index].keyWord
view.setOnClickListener { view.setOnClickListener {
etSearch.setText(keywordData[index].keyWord) val intent = Intent(this, TestSearchKeyActivity::class.java)
doSearch() intent.putExtra("keyword", keywordData[index].keyWord)
startActivity(intent)
} }
flHotSearch?.addView(view) 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
}
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>() { ...@@ -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) { if (page == 1) {
mView.showLoadingView() mView.showLoadingView()
} }
...@@ -88,6 +88,7 @@ class TestSearchPresenter : SimplePresenter<TestSearchView>() { ...@@ -88,6 +88,7 @@ class TestSearchPresenter : SimplePresenter<TestSearchView>() {
cmd.tab = "search" cmd.tab = "search"
cmd.page = page cmd.page = page
cmd.keyword = keyword cmd.keyword = keyword
cmd.type = type
TestRetrofitApi.getTestRetrofitApi() TestRetrofitApi.getTestRetrofitApi()
.fetchTestList(NetworkParamsUtils.getMaps(cmd)) .fetchTestList(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io()) .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"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context=".list.view.TestListActivity"> tools:context=".list.view.TestListActivity">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/platform_title_bar_height" android:layout_height="@dimen/platform_title_bar_height"
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical" android:gravity="center_vertical">
>
<ImageView <ImageView
android:id="@+id/iv_test_list_back" android:id="@+id/iv_test_list_back"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:src="@drawable/tests_icon_test_back" android:src="@drawable/tests_icon_test_back" />
/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="32dp" android:layout_height="32dp"
android:background="@drawable/tests_bg_test_search_input"
android:orientation="horizontal"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
> android:background="@drawable/tests_bg_test_search_input"
android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="13dp" android:layout_width="13dp"
android:layout_height="13dp" android:layout_height="13dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:src="@drawable/tests_search_gray"/> android:src="@drawable/tests_search_gray" />
<TextView <TextView
android:id="@+id/tv_test_search" android:id="@+id/tv_test_search"
...@@ -48,7 +45,7 @@ ...@@ -48,7 +45,7 @@
android:textColor="#BFBFBF" android:textColor="#BFBFBF"
android:textSize="@dimen/platform_default_text_size_small" android:textSize="@dimen/platform_default_text_size_small"
android:textStyle="normal" android:textStyle="normal"
android:typeface="sans"/> android:typeface="sans" />
</LinearLayout> </LinearLayout>
...@@ -66,50 +63,49 @@ ...@@ -66,50 +63,49 @@
android:layout_width="72dp" android:layout_width="72dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#F7F7F7" android:background="#F7F7F7"
app:pa_indicator_color="@color/platform_main_theme"
app:pa_tab_height="44dp" app:pa_tab_height="44dp"
app:pa_tab_indicator_margin="13dp" app:pa_tab_indicator_margin="13dp"
app:pa_tab_mode="scrollable" app:pa_tab_mode="scrollable" />
app:pa_indicator_color="@color/platform_main_theme"
/>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical" android:orientation="vertical">
>
<LinearLayout <LinearLayout
android:id="@+id/ll_sort" android:id="@+id/ll_sort"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
android:orientation="horizontal" android:orientation="horizontal">
>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_tabLayout"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_weight="1"
app:tabIndicator="@drawable/tests_bg_indicator_search"
app:tabIndicatorColor="#2BB5F5"
app:tabIndicatorFullWidth="false"
app:tabSelectedTextColor="@color/platform_black"
app:tabTextColor="@color/platform_color_999999"
app:tabTextAppearance="@style/tests_MyTabLayout"
app:tabPaddingTop="@dimen/platform_dp_5" />
<com.ydl.ydlcommon.view.DrawableRightTextView <com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_sort" android:id="@+id/dr_sort"
style="@style/tests_FilterTextViewStyle" style="@style/tests_FilterTextViewStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="44dp" android:layout_marginTop="@dimen/platform_dp_4"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_height="@dimen/platform_dp_40"
android:layout_marginLeft="@dimen/platform_dp_26"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="综合排序" 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> </LinearLayout>
<RelativeLayout <RelativeLayout
...@@ -119,16 +115,14 @@ ...@@ -119,16 +115,14 @@
<com.ydl.ydlcommon.view.verticaltablayout.VerticalViewPager <com.ydl.ydlcommon.view.verticaltablayout.VerticalViewPager
android:id="@+id/vvp_test" android:id="@+id/vvp_test"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
/>
<View <View
android:id="@+id/view_mask" android:id="@+id/view_mask"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#3c000000" android:background="#3c000000"
android:visibility="gone" android:visibility="gone" />
/>
</RelativeLayout> </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: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" />
</LinearLayout>
</RelativeLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
android:maxLines="2" android:maxLines="2"
android:minHeight="24dp" android:minHeight="24dp"
android:minLines="2" android:minLines="2"
android:textColor="#666" android:textColor="#C5C5C5"
android:textSize="12sp" android:textSize="12sp"
tools:text="这里是副标题,这里是副标题,这里是副标题,这里是副标题"/> tools:text="这里是副标题,这里是副标题,这里是副标题,这里是副标题"/>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
android:layout_marginRight="146dp" android:layout_marginRight="146dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:textColor="#666" android:textColor="#B5B5B5"
android:textSize="12sp" android:textSize="12sp"
android:lineSpacingExtra="4dp" android:lineSpacingExtra="4dp"
android:minLines="2" android:minLines="2"
......
...@@ -30,4 +30,9 @@ ...@@ -30,4 +30,9 @@
<item name="colorAccent">@color/platform_main_theme</item> <item name="colorAccent">@color/platform_main_theme</item>
</style> </style>
<style name="tests_MyTabLayout" parent="TextAppearance.Design.Tab">
<item name="android:textStyle">bold</item>
</style>
</resources> </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 ...@@ -67,9 +67,21 @@ public class DatePickerDialogFragment extends BaseDialogFragment implements Date
@Override @Override
public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) { public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
this.year = year; if (isDataAfter(view)) {
this.month = monthOfYear; Calendar mCalendar = Calendar.getInstance();
this.day = dayOfMonth; 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;
}
} }
......
...@@ -43,6 +43,7 @@ import com.yidianling.user.api.event.RefreshRecentContactListEvent ...@@ -43,6 +43,7 @@ import com.yidianling.user.api.event.RefreshRecentContactListEvent
import com.yidianling.user.api.service.IAppService import com.yidianling.user.api.service.IAppService
import com.yidianling.user.constants.UserBIConstants.UserMyPageEvent import com.yidianling.user.constants.UserBIConstants.UserMyPageEvent
import com.yidianling.user.mine.bean.CouponNumBean import com.yidianling.user.mine.bean.CouponNumBean
import com.yidianling.user.mine.data.AppDataManager
import com.yidianling.user.mine.data.AppDataManager.getHttp import com.yidianling.user.mine.data.AppDataManager.getHttp
import com.yidianling.user.mine.data.AppDataManager.getLocal import com.yidianling.user.mine.data.AppDataManager.getLocal
import com.yidianling.user.mine.http.MineHttpImpl import com.yidianling.user.mine.http.MineHttpImpl
...@@ -101,14 +102,14 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -101,14 +102,14 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
text_userName.setOnClickListener(this) text_userName.setOnClickListener(this)
jtv_test.setOnClickListener(this) jtv_test.setOnClickListener(this)
swipe_refresh_layout.setOnRefreshListener(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.jtv_introduce).setOnClickListener(this)
rootView.findViewById<View>(R.id.iv_edit_info).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.iv_share).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_my_courses).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_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_account).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_guanzhu).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_guanzhu).setOnClickListener(this)
rootView.findViewById<View>(R.id.ll_my_trends).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_my_trends).setOnClickListener(this)
...@@ -124,6 +125,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -124,6 +125,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
.into(iv_mine_logo) .into(iv_mine_logo)
refreshCouponData() refreshCouponData()
} }
override fun initDataAndEventLazy() {} override fun initDataAndEventLazy() {}
...@@ -199,12 +202,59 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -199,12 +202,59 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
refreshCouponData() 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") @SuppressLint("CheckResult")
private fun refreshCouponData() { private fun refreshCouponData() {
getLocal().setCoupon(false)
getLocal().setConfide(false)
getLocal().setConsult(false)
val userInfo = getUserInfo() ?: return val userInfo = getUserInfo() ?: return
if (userInfo.uid != null) {
getConfideOrder(userInfo.uid!!)
}
//获取用户信息 //获取用户信息
MineHttpImpl.getInstance().getNewCoupon(BaseCommand()) MineHttpImpl.getInstance().getNewCoupon(BaseCommand())
.compose(netCheck()) .compose(netCheck())
...@@ -214,11 +264,17 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -214,11 +264,17 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
if (response.data != null) { if (response.data != null) {
if (response.data?.count ?: 0 > 0) { if (response.data?.count ?: 0 > 0) {
view_new_coupon.visibility = View.VISIBLE view_new_coupon.visibility = View.VISIBLE
getLocal().setCoupon(true)
} else { } else {
view_new_coupon.visibility = View.INVISIBLE view_new_coupon.visibility = View.GONE
getLocal().setCoupon(false)
} }
}else{
getLocal().setCoupon(false)
} }
}) { throwable: Throwable? -> } }) { throwable: Throwable? ->
getLocal().setCoupon(false)
}
} }
/** /**
...@@ -265,7 +321,6 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -265,7 +321,6 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
} else { } else {
jtv_about_us?.setLeftRedDotVisibility(View.GONE) jtv_about_us?.setLeftRedDotVisibility(View.GONE)
} }
//切换环境按钮逻辑 //切换环境按钮逻辑
debugChangeEnvironment() debugChangeEnvironment()
} }
...@@ -409,7 +464,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -409,7 +464,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
startActivity(Intent(activity, PrivacyActivity::class.java)) 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, "预约订单") count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "预约订单")
mActivity?.let { activity -> mActivity?.let { activity ->
if (!startLoginByStatus(activity, true)) { if (!startLoginByStatus(activity, true)) {
...@@ -431,7 +486,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -431,7 +486,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
provide(ICourseService::class.java).startMyCourseActivity(activity) 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, "倾诉记录") count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "倾诉记录")
mActivity?.let { activity -> mActivity?.let { activity ->
if (!startLoginByStatus(activity, true)) { if (!startLoginByStatus(activity, true)) {
......
...@@ -18,4 +18,16 @@ interface AppLocal { ...@@ -18,4 +18,16 @@ interface AppLocal {
fun putUpdate(update: Boolean) 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 { ...@@ -16,9 +16,13 @@ internal class AppLocalImpl private constructor(): AppLocal {
return Holder.INSTANCE return Holder.INSTANCE
} }
private val APP = "app" private const val APP = "app"
private val RED_POCKET_TIME = "red_pocket_time" private const val RED_POCKET_TIME = "red_pocket_time"
private val UPDATE = "update" 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 { ...@@ -38,6 +42,30 @@ internal class AppLocalImpl private constructor(): AppLocal {
getAppSP().edit().putBoolean(UPDATE, update).apply() 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 { private fun getAppSP(): SharedPreferences {
return BaseApp.getApp().getSharedPreferences(APP, Context.MODE_PRIVATE) return BaseApp.getApp().getSharedPreferences(APP, Context.MODE_PRIVATE)
} }
......
...@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP ...@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
import com.yidianling.user.mine.bean.AccountBean import com.yidianling.user.mine.bean.AccountBean
...@@ -95,4 +96,12 @@ interface MineApi { ...@@ -95,4 +96,12 @@ interface MineApi {
@POST("sms/list") @POST("sms/list")
fun getSysMsgList(@FieldMap params: Map<String, String>): Observable<BaseResponse<String>> 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 ...@@ -8,6 +8,7 @@ import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.bean.FundData import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.mine.* import com.yidianling.user.mine.*
import com.yidianling.user.mine.bean.AccountBean import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean import com.yidianling.user.mine.bean.BalanceBean
...@@ -47,4 +48,6 @@ interface MineHttp { ...@@ -47,4 +48,6 @@ interface MineHttp {
fun getSysMsgList(param: MsgListParam): Observable<BaseResponse<String>> 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.* ...@@ -6,10 +6,14 @@ import com.ydl.ydlcommon.data.http.*
import com.ydl.ydlcommon.utils.NetworkParamsUtils import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.message.param.MsgListParam 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.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.mine.APPWillUpParam
import com.yidianling.user.mine.* 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.AccountBean
import com.yidianling.user.mine.bean.BalanceBean import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.FeedBackDetailBean import com.yidianling.user.mine.bean.FeedBackDetailBean
...@@ -18,6 +22,7 @@ import io.reactivex.Observable ...@@ -18,6 +22,7 @@ import io.reactivex.Observable
import okhttp3.MediaType import okhttp3.MediaType
import okhttp3.RequestBody import okhttp3.RequestBody
import java.io.File import java.io.File
import java.util.*
class MineHttpImpl private constructor() : MineHttp { class MineHttpImpl private constructor() : MineHttp {
...@@ -127,6 +132,14 @@ class MineHttpImpl private constructor() : MineHttp { ...@@ -127,6 +132,14 @@ class MineHttpImpl private constructor() : MineHttp {
.flatMap { getAppApi().getSysMsgList(it) } .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 { object Holder {
val INSTANCE = MineHttpImpl() val INSTANCE = MineHttpImpl()
} }
......
...@@ -354,9 +354,8 @@ ...@@ -354,9 +354,8 @@
</RelativeLayout> </RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout android:id="@+id/csl_call_order"
android:id="@+id/ll_call_order"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
...@@ -365,10 +364,25 @@ ...@@ -365,10 +364,25 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/iv_confide"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_marginTop="3dp" 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 <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -376,12 +390,15 @@ ...@@ -376,12 +390,15 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="倾诉记录" android:text="倾诉记录"
android:textColor="@color/platform_color_999999" 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 <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_trade_order" android:id="@+id/csl_trade_order"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
...@@ -390,10 +407,25 @@ ...@@ -390,10 +407,25 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/iv_trade_order"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_marginTop="3dp" 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 <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -401,9 +433,12 @@ ...@@ -401,9 +433,12 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="预约订单" android:text="预约订单"
android:textColor="@color/platform_color_999999" 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> </LinearLayout>
......
...@@ -14,10 +14,13 @@ class ShareData : Serializable { ...@@ -14,10 +14,13 @@ class ShareData : Serializable {
var cover: String? = null var cover: String? = null
var desc: String? = null var desc: String? = null
// just for Meditation // just for Meditation
var type:String? = null var type: String? = null
var isDarkMode = false var isDarkMode = false
// 兼容评价列表分享H5传参数据结构
var imageBase64: String? = null
//分享到动态url //分享到动态url
var url: String? = null var url: String? = null
......
...@@ -1097,6 +1097,20 @@ class StatusBarUtils { ...@@ -1097,6 +1097,20 @@ class StatusBarUtils {
statusBarLightMode(context) 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==================== //====================设置Activity状态栏View END====================
......
...@@ -73,6 +73,8 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -73,6 +73,8 @@ class ShareMeditationDialog : DialogFragment() {
val shareTitle = arguments?.getString(KEY_SHARE_TITLE) val shareTitle = arguments?.getString(KEY_SHARE_TITLE)
val shareContent = arguments?.getString(KEY_SHARE_CONTENT) val shareContent = arguments?.getString(KEY_SHARE_CONTENT)
val shareCover = arguments?.getString(KEY_SHARE_COVER) 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) llRootLayout = view?.findViewById(R.id.csl_share_layout)
...@@ -96,13 +98,15 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -96,13 +98,15 @@ class ShareMeditationDialog : DialogFragment() {
updateUI(isDarkMode == true) updateUI(isDarkMode == true)
llWeChat?.setOnClickListener { llWeChat?.setOnClickListener {
ShareUtils.shareTo( ShareUtils.shareSmailWeixin(
SHARE_MEDIA.WEIXIN,
activity as Activity, activity as Activity,
shareTitle!!, shareTitle!!,
shareUrl!!, shareUrl!!,
shareContent!!, shareContent!!,
shareCover!! shareCover!!,
path = miniPath,
id = miniId,
shareListener = null
) )
dismiss() dismiss()
} }
...@@ -191,15 +195,21 @@ class ShareMeditationDialog : DialogFragment() { ...@@ -191,15 +195,21 @@ class ShareMeditationDialog : DialogFragment() {
private const val KEY_SHARE_TITLE = "key_share_title" private const val KEY_SHARE_TITLE = "key_share_title"
private const val KEY_SHARE_CONTENT = "key_share_content" private const val KEY_SHARE_CONTENT = "key_share_content"
private const val KEY_SHARE_COVER = "key_share_cover" 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, fun newInstance(
shareContent:String,shareCover:String): ShareMeditationDialog { isDarkMode: Boolean, shareUrl: String, shareTitle: String,
shareContent: String, shareCover: String, miniId: String, miniPath: String
): ShareMeditationDialog {
val args = Bundle() val args = Bundle()
args.putBoolean(KEY_SHARE_DARK_MODE, isDarkMode) args.putBoolean(KEY_SHARE_DARK_MODE, isDarkMode)
args.putString(KEY_SHARE_URL, shareUrl) args.putString(KEY_SHARE_URL, shareUrl)
args.putString(KEY_SHARE_TITLE, shareTitle) args.putString(KEY_SHARE_TITLE, shareTitle)
args.putString(KEY_SHARE_CONTENT, shareContent) args.putString(KEY_SHARE_CONTENT, shareContent)
args.putString(KEY_SHARE_COVER, shareCover) args.putString(KEY_SHARE_COVER, shareCover)
args.putString(KEY_SHARE_MINI_ID, miniId)
args.putString(KEY_SHARE_MINI_PATH, miniPath)
val fragment = ShareMeditationDialog() val fragment = ShareMeditationDialog()
fragment.arguments = args fragment.arguments = args
......
...@@ -41,6 +41,7 @@ import com.ydl.view.ShareMeditationDialog; ...@@ -41,6 +41,7 @@ import com.ydl.view.ShareMeditationDialog;
import com.ydl.ydl_router.manager.YDLRouterManager; import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.bean.ShareData;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.event.MeditationEvent; import com.ydl.ydlcommon.event.MeditationEvent;
import com.ydl.ydlcommon.modular.ModularServiceManager; import com.ydl.ydlcommon.modular.ModularServiceManager;
...@@ -51,6 +52,7 @@ import com.ydl.ydlcommon.utils.LogUtil; ...@@ -51,6 +52,7 @@ import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.NetWorkSpeedUtils; import com.ydl.ydlcommon.utils.NetWorkSpeedUtils;
import com.ydl.ydlcommon.utils.StatusBarUtils; import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.utils.URLUtils; 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.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper; import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.ydl.ydlcommon.view.TitleBar; import com.ydl.ydlcommon.view.TitleBar;
...@@ -117,6 +119,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -117,6 +119,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
protected String shareTitle; protected String shareTitle;
protected String shareDesc; protected String shareDesc;
private String cover; private String cover;
private String miniId;
private String miniPath;
// 评价2.0新增字段 区分评价列表
private H5JsBean.H5JsCmd.Params paramsForCommentList;
private boolean isShareCommentList;
private boolean isDarkMode = false; private boolean isDarkMode = false;
...@@ -520,6 +527,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -520,6 +527,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
shareTitle = params.getShare().getTitle(); shareTitle = params.getShare().getTitle();
shareDesc = params.getShare().getDesc(); shareDesc = params.getShare().getDesc();
cover = params.getShare().getCover(); cover = params.getShare().getCover();
paramsForCommentList = params;
LogUtil.d("title: " + shareTitle + " url: " + shareUrl + " desc: " + shareDesc + " cover: " + cover); LogUtil.d("title: " + shareTitle + " url: " + shareUrl + " desc: " + shareDesc + " cover: " + cover);
new Handler(getMainLooper()).post(() -> initShareMenu()); new Handler(getMainLooper()).post(() -> initShareMenu());
} }
...@@ -537,15 +545,17 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -537,15 +545,17 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
shareTitle = params.getShare().getTitle(); shareTitle = params.getShare().getTitle();
shareDesc = params.getShare().getDesc(); shareDesc = params.getShare().getDesc();
cover = params.getShare().getCover(); cover = params.getShare().getCover();
miniId = params.getShare().getMinProgramId();
miniPath = params.getShare().getMinProgramPath();
isDarkMode = params.getShare().isDarkMode(); isDarkMode = params.getShare().isDarkMode();
if(shareMeditationDialog == null){ if (shareMeditationDialog == null) {
shareMeditationDialog = ShareMeditationDialog.Companion.newInstance(isDarkMode, shareMeditationDialog = ShareMeditationDialog.Companion.newInstance(isDarkMode,
shareUrl,shareTitle,shareDesc,cover); shareUrl, shareTitle, shareDesc, cover, miniId, miniPath);
} }
if (shareMeditationDialog!=null && !shareMeditationDialog.isAdded()){ if (shareMeditationDialog != null && !shareMeditationDialog.isAdded()) {
shareMeditationDialog.show(getSupportFragmentManager(),"share_meditation"); shareMeditationDialog.show(getSupportFragmentManager(), "share_meditation");
} }
}else{ }else {
purl = params.getShare().getUrl(); purl = params.getShare().getUrl();
shareUrl = params.getShare().getShare_url(); shareUrl = params.getShare().getShare_url();
shareTitle = params.getShare().getTitle(); shareTitle = params.getShare().getTitle();
...@@ -1047,7 +1057,14 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1047,7 +1057,14 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initShareMenu() { private void initShareMenu() {
tb_title.setRightIcon(getResources().getDrawable(R.drawable.web_common_share)); tb_title.setRightIcon(getResources().getDrawable(R.drawable.web_common_share));
tb_title.setOnRightTextClick((view, isActive) -> { 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"); LogUtil.d("setSeccessful");
} }
...@@ -1440,7 +1457,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1440,7 +1457,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//如果未引入动态模块的话,隐藏分享至动态按钮 //如果未引入动态模块的话,隐藏分享至动态按钮
dialog = YDLShareDialog.Companion.style4(this, shareTitle, shareUrl, shareDesc, cover); dialog = YDLShareDialog.Companion.style4(this, shareTitle, shareUrl, shareDesc, cover);
} else { } 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