Commit 75b25194 by 范玉宾

Merge branch 'd/v4.3.99' into 'feat/lancet/review_2.0'

# Conflicts:
#   config.gradle
parents 31075c3f c5637804
...@@ -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"->{
......
...@@ -490,6 +490,15 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -490,6 +490,15 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
} }
@Override @Override
public void switchPushStatus(H5JsBean.H5JsCmd.Params params) {
if (params.getSwitchStatus() == 1) {
// MsgPushLifecycle.Companion.setH5Open(true);
} else {
// MsgPushLifecycle.Companion.setH5Open(false);
}
}
@Override
public void switchSound(int mediaId, long meditationId, int meditationType, int businessType, public void switchSound(int mediaId, long meditationId, int meditationType, int businessType,
String buried, String mediaUrl, String mediaCoverUrl, String buried, String mediaUrl, String mediaCoverUrl,
String title, String desc, int status) { String title, String desc, int status) {
......
...@@ -460,6 +460,9 @@ class WebJavascriptHandler : IJavascriptHandler{ ...@@ -460,6 +460,9 @@ class WebJavascriptHandler : IJavascriptHandler{
findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId, uid ?: "") findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId, uid ?: "")
} }
} }
"switch_push_status" -> {
wvEnventPro?.switchPushStatus(jsData.cmd?.params)
}
} }
} }
......
...@@ -201,4 +201,6 @@ public interface WebViewClientClickListener { ...@@ -201,4 +201,6 @@ public interface WebViewClientClickListener {
void getNextExpertStatus(String doctorID, String title, String uid, String linkUrl); void getNextExpertStatus(String doctorID, String title, String uid, String linkUrl);
//h5页面是否需要打开推送
void switchPushStatus(H5JsBean.H5JsCmd.Params params);
} }
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.44", "m-confide" : "0.0.50.45",
"m-consultant" : "0.0.60.68", "m-consultant" : "0.0.60.73",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.71", "m-user" : "0.0.62.71",
"m-home" : "0.0.23.95", "m-home" : "0.0.23.98",
"m-im" : "0.0.21.64", "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.84",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.21",
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
...@@ -23,7 +23,7 @@ ext { ...@@ -23,7 +23,7 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.25", "ydl-tuicore" : "0.0.25",
//第一步 //第一步
"ydl-platform" : "0.0.41.48", "ydl-platform" : "0.0.41.50",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.99", "ydl-webview" : "0.0.38.99",
...@@ -31,7 +31,7 @@ ext { ...@@ -31,7 +31,7 @@ ext {
"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.44", "m-confide" : "0.0.50.45",
"m-consultant" : "0.0.60.68", "m-consultant" : "0.0.60.73",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.71", "m-user" : "0.0.62.71",
"m-home" : "0.0.23.95", "m-home" : "0.0.23.98",
"m-im" : "0.0.21.64", "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.84",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.21",
"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.48", "ydl-platform" : "0.0.41.50",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.99", "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",
...@@ -264,7 +262,7 @@ ext { ...@@ -264,7 +262,7 @@ ext {
"ydl-pushagent" : "com.ydl:pushagent:0.1.1", "ydl-pushagent" : "com.ydl:pushagent:0.1.1",
"ydl-notracepoint" : "com.ydl:notracepoint-lib:0.2.3.3@aar", "ydl-notracepoint" : "com.ydl:notracepoint-lib:0.2.3.3@aar",
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar", "ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.2", "ydl-router" : "com.ydl:ydl-router:1.4.4",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar", "xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
"mmkv" : "com.tencent:mmkv-static:1.2.6", "mmkv" : "com.tencent:mmkv-static:1.2.6",
"arouter-api" : "com.alibaba:arouter-api:1.4.1", "arouter-api" : "com.alibaba:arouter-api:1.4.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
//基础组件 <<--- 先发这个,发完改这里的版本号 //基础组件 <<--- 先发这个,发完改这里的版本号
......
...@@ -33,6 +33,7 @@ import com.ydl.audioim.http.command.NoticePushCommand ...@@ -33,6 +33,7 @@ import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.audioim.http.command.PayLoad import com.ydl.audioim.http.command.PayLoad
import com.ydl.audioim.player.AudioPlayer import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.router.AudioImIn
import com.ydl.audioim.utils.AudioLogUtils import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.DateUtils import com.ydl.audioim.utils.DateUtils
import com.ydl.audioim.utils.onConfideEvent import com.ydl.audioim.utils.onConfideEvent
...@@ -636,6 +637,9 @@ class AudioHomeActivity : ...@@ -636,6 +637,9 @@ class AudioHomeActivity :
private fun setClickEvent() { private fun setClickEvent() {
//跳转客服小壹 //跳转客服小壹
jump_kefu.setOnClickListener { jump_kefu.setOnClickListener {
if (!AudioImIn.getUserService().loginByOneKeyLogin(this@AudioHomeActivity,true)) {
return@setOnClickListener
}
val imService = ARouter.getInstance().navigation(IImService::class.java) val imService = ARouter.getInstance().navigation(IImService::class.java)
imService?.startKefuChat(this, "", 0, 0) imService?.startKefuChat(this, "", 0, 0)
} }
......
...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager ...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack import com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
/** /**
...@@ -17,7 +18,9 @@ object AudioImIn { ...@@ -17,7 +18,9 @@ object AudioImIn {
private fun getImService(): IImService { private fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java) return ModularServiceManager.provide(IImService::class.java)
} }
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
/** /**
* 发送自定义通知 * 发送自定义通知
*/ */
......
...@@ -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
} }
......
...@@ -82,20 +82,24 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -82,20 +82,24 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
val status = item.lineStatus.get() val status = item.lineStatus.get()
when (status) { when (status) {
5 -> { 5 -> {
if (!TextUtils.isEmpty(item.linkedUrl.get())){ if (!TextUtils.isEmpty(item.linkedUrl.get())) {
val linkUri = Uri.parse(item.linkedUrl.get()) val linkUri = Uri.parse(item.linkedUrl.get())
if (linkUri != null) { if (linkUri != null) {
val host = linkUri.host val host = linkUri.host
if (!TextUtils.isEmpty(host) && host == "h5") { if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity //如果是h5,跳转至NewH5Activity
try { try {
var params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8") var params = URLDecoder.decode(
ARouter.getInstance().build("/new_h5/h5").withSerializable("routerParam", params).navigation() linkUri.getQueryParameter("params"),
}catch (e : NullPointerException){ "UTF-8"
)
ARouter.getInstance().build("/new_h5/h5")
.withSerializable("routerParam", params).navigation()
} catch (e: NullPointerException) {
com.yidianling.common.tools.LogUtil.e("params参数为空") com.yidianling.common.tools.LogUtil.e("params参数为空")
}catch (e : UnsupportedEncodingException){ } catch (e: UnsupportedEncodingException) {
com.yidianling.common.tools.LogUtil.e("解码错误") com.yidianling.common.tools.LogUtil.e("解码错误")
}catch (e : UnsupportedOperationException){ } catch (e: UnsupportedOperationException) {
com.yidianling.common.tools.LogUtil.e("这不是一个uri格式的地址") com.yidianling.common.tools.LogUtil.e("这不是一个uri格式的地址")
} }
} }
...@@ -118,7 +122,12 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -118,7 +122,12 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
} }
else -> { else -> {
if (!item.confideId.isNullOrBlank()) { if (!item.confideId.isNullOrBlank()) {
ConfideWebServiceImpl().connectionJava(item.confideId!!.toInt(), 3, it.context as Activity, null) { ConfideWebServiceImpl().connectionJava(
item.confideId!!.toInt(),
3,
it.context as Activity,
null
) {
showDoctorDetail(item, true) showDoctorDetail(item, true)
} }
} }
...@@ -165,7 +174,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -165,7 +174,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item.confideId ?: "", item.confideId ?: "",
"4" "4"
) )
showDoctorDetail(item,false) showDoctorDetail(item, false)
} }
binding.ivAvatar.setOnClickListener { binding.ivAvatar.setOnClickListener {
ActionCountUtils.record( ActionCountUtils.record(
...@@ -181,7 +190,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -181,7 +190,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item.confideId ?: "", item.confideId ?: "",
"3" "3"
) )
showDoctorDetail(item,false) showDoctorDetail(item, false)
} }
binding.vDisableClick.setOnClickListener { } binding.vDisableClick.setOnClickListener { }
binding.btnShare.setOnClickListener { binding.btnShare.setOnClickListener {
...@@ -363,16 +372,18 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -363,16 +372,18 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
disposable?.dispose() disposable?.dispose()
} }
private fun showDoctorDetail(item: VideoViewModel,toPay:Boolean) { private fun showDoctorDetail(item: VideoViewModel, toPay: Boolean) {
item.confideId?.let { item.confideId?.let {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)+ if(toPay) "&payPage=1" else "" val url =
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it) + if (toPay) "&payPage=1" else ""
ConfideBottomSheetDialogFragment() ConfideBottomSheetDialogFragment()
.showBottomSheetDialog( .showBottomSheetDialog(
itemView.context as FragmentActivity, itemView.context as FragmentActivity,
url, url,
item.doctorId!!, item.doctorId!!,
uid = item.uid, uid = item.uid,
listenFree = item.listenFree.get() listenFree = item.listenFree.get(),
expertUrl = item.linkedUrl.get() ?: ""
) )
} }
} }
......
...@@ -61,7 +61,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -61,7 +61,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if (allFilter.categoryId2List.size>0){ if (allFilter.categoryId2List.size>0){
val categoryMap2 = HashMap<String, Any>() val categoryMap2 = HashMap<String, Any>()
val categoryIdMap2 = HashMap<String, Any>() val categoryIdMap2 = HashMap<String, Any>()
categoryIdMap2["in"] = allFilter.categoryId2List categoryIdMap2["in"] = allFilter.categoryId2List.toSortedSet().toList()
categoryMap2["product_cates.category_id2"] = categoryIdMap2 categoryMap2["product_cates.category_id2"] = categoryIdMap2
categoryList.add(categoryMap2) categoryList.add(categoryMap2)
} }
...@@ -69,7 +69,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -69,7 +69,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if (allFilter.categoryId3List.size>0){ if (allFilter.categoryId3List.size>0){
val categoryMap3 = HashMap<String, Any>() val categoryMap3 = HashMap<String, Any>()
val categoryIdMap3 = HashMap<String, Any>() val categoryIdMap3 = HashMap<String, Any>()
categoryIdMap3["in"] = allFilter.categoryId3List categoryIdMap3["in"] = allFilter.categoryId3List.toSortedSet().toList()
categoryMap3["product_cates.category_id3"] = categoryIdMap3 categoryMap3["product_cates.category_id3"] = categoryIdMap3
categoryList.add(categoryMap3) categoryList.add(categoryMap3)
} }
...@@ -105,7 +105,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -105,7 +105,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
} }
val wayMap = HashMap<String, Any>() val wayMap = HashMap<String, Any>()
wayMap["in"] = way wayMap["in"] = way
filterMap["service_type_list.service_type"] = wayMap filterMap["product_specs.spec_id"] = wayMap
} }
// 服务均价 // 服务均价
if (allFilter.priceRanges != null) { if (allFilter.priceRanges != null) {
...@@ -187,9 +187,6 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -187,9 +187,6 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
fieldsMap["doctor_name"] = true fieldsMap["doctor_name"] = true
fieldsMap["uid"] = true fieldsMap["uid"] = true
fieldsMap["chat_status"] = true fieldsMap["chat_status"] = true
// fieldsMap["consult_status"] = true
// fieldsMap["listen_status"] = true
// fieldsMap["booking_status"] = true
fieldsMap["gender"] = true fieldsMap["gender"] = true
fieldsMap["years"] = true fieldsMap["years"] = true
fieldsMap["head"] = true fieldsMap["head"] = true
......
...@@ -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
......
...@@ -84,7 +84,7 @@ dependencies { ...@@ -84,7 +84,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'com.ydl:nim-base:1.1.0.4' implementation 'com.ydl:nim-base:1.1.0.7'
// implementation 'com.netease.nimlib:basesdk:8.5.0' // implementation 'com.netease.nimlib:basesdk:8.5.0'
implementation 'com.netease.nimlib:avchat:9.1.1' implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:9.1.1' implementation 'com.netease.nimlib:nrtc:9.1.1'
......
...@@ -371,9 +371,9 @@ public class SessionHelper { ...@@ -371,9 +371,9 @@ public class SessionHelper {
}; };
infoButton.iconId = R.drawable.im_more12x; infoButton.iconId = R.drawable.im_more12x;
buttons.add(infoButton); buttons.add(infoButton);
p2pCustomization.buttons = buttons; if (p2pCustomization != null){
p2pCustomization.buttons = buttons;
}
myP2pCustomization.withSticker = true; myP2pCustomization.withSticker = true;
return myP2pCustomization; return myP2pCustomization;
} }
......
...@@ -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;
//判断是否是跳转专家主页 //判断是否是跳转专家主页
......
...@@ -167,7 +167,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -167,7 +167,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
//读取未发送的临时消息 //读取未发送的临时消息
if (ActionHandlerStorage.getL(sessionId) != null) { if (ActionHandlerStorage.getL(sessionId) != null) {
if (messageFragment.getInputPanel()==null||messageFragment.getInputPanel().getInputContent() == null || messageFragment.getInputPanel().getInputContent().equals("")) { if (messageFragment.getInputPanel() == null || messageFragment.getInputPanel().getInputContent() == null || messageFragment.getInputPanel().getInputContent().equals("")) {
if (messageFragment.getInputPanel()!=null){ if (messageFragment.getInputPanel()!=null){
messageFragment.getInputPanel().setInputContent(ActionHandlerStorage.getL(sessionId).getImTempData(sessionId)); messageFragment.getInputPanel().setInputContent(ActionHandlerStorage.getL(sessionId).getImTempData(sessionId));
} }
...@@ -300,8 +300,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -300,8 +300,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
if (isFinishing()) { if (isFinishing()) {
//聊天返回时,检查是否有未发送内容,如果有则保存到ImTempData 临时map中,再次进入时读取 //聊天返回时,检查是否有未发送内容,如果有则保存到ImTempData 临时map中,再次进入时读取
if (messageFragment != null) { if (messageFragment != null) {
if (ActionHandlerStorage.getL(sessionId) != null) if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).saveImTempData(sessionId, messageFragment.getInputPanel().getInputContent()); ActionHandlerStorage.getL(sessionId).saveImTempData(sessionId, messageFragment.getInputPanel().getInputContent());
}
} }
ActionHandlerStorage.recycleL(sessionId); ActionHandlerStorage.recycleL(sessionId);
} }
......
...@@ -60,6 +60,7 @@ import com.ydl.ydlcommon.view.CircleImageView; ...@@ -60,6 +60,7 @@ import com.ydl.ydlcommon.view.CircleImageView;
import com.ydl.ydlcommon.view.dialog.CommonDialog; import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.event.CloseBottomWebviewEvent; import com.yidianling.im.event.CloseBottomWebviewEvent;
import com.yidianling.im.event.MultipleAnswerBean; import com.yidianling.im.event.MultipleAnswerBean;
import com.yidianling.im.event.MultipleSelectedEvent; import com.yidianling.im.event.MultipleSelectedEvent;
...@@ -311,7 +312,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -311,7 +312,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initView() { private void initView() {
if (ChatStatusCacheHelper.getStatusCache("chatEvent")&&SessionTypeEnum.Team!=sessionType) { if (ChatStatusCacheHelper.getStatusCache("chatEvent")&&SessionTypeEnum.Team != sessionType) {
// 获取首问语数据 // 获取首问语数据
ServiceImpl.Companion.getInstance().getFirstQuestion() ServiceImpl.Companion.getInstance().getFirstQuestion()
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
...@@ -326,22 +327,29 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -326,22 +327,29 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
ToastUtil.toastShort(throwable.getMessage()); ToastUtil.toastShort(throwable.getMessage());
}); });
} }
IP2PCustomActionHandler actionHandler = ActionHandlerStorage.getL(sessionId);
//是咨询师
boolean isExpert = null != actionHandler && actionHandler.getUserType() == 2;
//不是群聊
boolean notTeam = sessionType != SessionTypeEnum.Team;
//不是客服
boolean notKefu = !ImConstants.KEFUXIAOYI.equals(sessionId);
if (isExpert && notTeam && actionHandler.getInfo() != null && notKefu && actionHandler.getInfo().doctorId != null) {
String doctorId = actionHandler.getInfo().doctorId;
ServiceImpl.Companion.getInstance().canViewConsult(doctorId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response.code.equals("200")) {
if (response.data != null && response.data.getCanViewConsult()) {
rela_zixun.setVisibility(View.VISIBLE);
}
}
}
);
}
boolean isExpert = null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() == 2;
ServiceImpl.Companion.getInstance().canViewConsult(ActionHandlerStorage.getL(sessionId).getInfo().doctorId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response.code.equals("200")){
if (response.data!=null && response.data.getCanViewConsult()){
if (isExpert && sessionType != SessionTypeEnum.Team) {
rela_zixun.setVisibility(View.VISIBLE);
}
}
}
}
);
//有未完成订单或者有未评价订单时,显示订单布局 //有未完成订单或者有未评价订单时,显示订单布局
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) { if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
...@@ -359,7 +367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -359,7 +367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} else { } else {
titleBar.setTitleRightDraw(getResources().getDrawable(R.drawable.im_erduoxiaolv)); titleBar.setTitleRightDraw(getResources().getDrawable(R.drawable.im_erduoxiaolv));
} }
if (ActionHandlerStorage.getL(sessionId)!=null){ if (ActionHandlerStorage.getL(sessionId) != null){
titleBar.setTitle(ActionHandlerStorage.getL(sessionId).getInfo().name); titleBar.setTitle(ActionHandlerStorage.getL(sessionId).getInfo().name);
} }
// 初始化顶部专家信息栏 // 初始化顶部专家信息栏
......
...@@ -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
...@@ -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,48 @@ ...@@ -66,50 +63,48 @@
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:tabIndicatorHeight="3dp"
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_242424" />
/>
<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 +114,14 @@ ...@@ -119,16 +114,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"
app:tabIndicatorHeight="3dp" />
<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
...@@ -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;
}
} }
......
...@@ -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====================
......
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