Commit bbdbf5a5 by 严久程

咨询师列表页弹窗隐藏与显示

parent 1976718f
...@@ -44,7 +44,7 @@ ext { ...@@ -44,7 +44,7 @@ ext {
//第三步 若干 //第三步 若干
"m-confide" : "0.0.35", "m-confide" : "0.0.35",
"m-consultant" : "0.0.46", "m-consultant" : "0.0.48",
"m-fm" : "0.0.23", "m-fm" : "0.0.23",
"m-user" : "0.0.39", "m-user" : "0.0.39",
...@@ -84,7 +84,7 @@ ext { ...@@ -84,7 +84,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.27.1", "m-confide" : "0.0.27.1",
"m-consultant" : "0.0.26", "m-consultant" : "0.0.27",
"m-course" : "0.0.22", "m-course" : "0.0.22",
"m-fm" : "0.0.15", "m-fm" : "0.0.15",
"m-tests" : "0.0.4", "m-tests" : "0.0.4",
......
...@@ -9,9 +9,9 @@ import android.os.Bundle ...@@ -9,9 +9,9 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.view.ViewTreeObserver
import android.view.WindowManager import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R import com.yidianling.consultant.R
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.* import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.*
...@@ -45,15 +45,16 @@ class ConsultAssistantDialog( ...@@ -45,15 +45,16 @@ class ConsultAssistantDialog(
window.setWindowAnimations(R.style.consultant_expert_consult_assistant_dialog_animate) window.setWindowAnimations(R.style.consultant_expert_consult_assistant_dialog_animate)
if (!ConsultAssistantDialogUtils.INSTANCE.canShowDesc()) { if (!ConsultAssistantDialogUtils.INSTANCE.canShowDesc()) {
consultant_assistant_dialog_desc_ll.visibility =View.GONE consultant_assistant_dialog_desc_ll.visibility = View.GONE
consultant_assistant_dialog_desc_outside_ll.visibility = View.GONE consultant_assistant_dialog_desc_outside_ll.visibility = View.GONE
// refreshDialogLayout() refreshDialogLayout(ConsultAssistantDialogUtils.INSTANCE.minWidth)
} }
consultant_assistant_dialog_close.setOnClickListener { consultant_assistant_dialog_close.setOnClickListener {
if (minWidth == null) { if (minWidth == null) {
minWidth = (consultant_assistant.measuredWidth * 1.5).toInt() minWidth = (consultant_assistant.measuredWidth * 1.5).toInt()
} }
ConsultAssistantDialogUtils.INSTANCE.minWidth = minWidth!!
//一个dialog关闭左侧desc,所有导医左侧desc都关闭 //一个dialog关闭左侧desc,所有导医左侧desc都关闭
SharedPreferencesEditor.putString( SharedPreferencesEditor.putString(
ConsultAssistantDialogUtils.INSTANCE.ASSISTANT_DIALOG_SP_TAG, ConsultAssistantDialogUtils.INSTANCE.ASSISTANT_DIALOG_SP_TAG,
...@@ -97,19 +98,23 @@ class ConsultAssistantDialog( ...@@ -97,19 +98,23 @@ class ConsultAssistantDialog(
} }
public fun setDescHide() { public fun setDescHide() {
if(null != consultant_assistant_dialog_desc_ll) { if (null != consultant_assistant_dialog_desc_ll) {
consultant_assistant_dialog_desc_ll.visibility = View.GONE consultant_assistant_dialog_desc_ll.visibility = View.GONE
consultant_assistant_dialog_desc_outside_ll.visibility = View.GONE consultant_assistant_dialog_desc_outside_ll.visibility = View.GONE
refreshDialogLayout() refreshDialogLayout(ConsultAssistantDialogUtils.INSTANCE.minWidth)
} }
} }
// 刷新dialog布局,减小拦截点击区域 // 刷新dialog布局,减小拦截点击区域
fun refreshDialogLayout() { fun refreshDialogLayout(width: Int) {
val params = window.attributes val params = window.attributes
if (minWidth == null) {
minWidth = (consultant_assistant.measuredWidth * 1.5).toInt() if (width != 0) {
minWidth = width
} else {
minWidth = (RxImageTool.dp2px(60f) * 1.5) as Int
} }
params.width = minWidth!! params.width = minWidth!!
params.height = WindowManager.LayoutParams.WRAP_CONTENT params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.RIGHT + Gravity.BOTTOM params.gravity = Gravity.RIGHT + Gravity.BOTTOM
......
...@@ -30,6 +30,7 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -30,6 +30,7 @@ class ConsultAssistantDialogUtils private constructor() {
var consultAssistantActivityDialog: ConsultAssistantDialog? = null //咨询师列表activity页面展示的dialog var consultAssistantActivityDialog: ConsultAssistantDialog? = null //咨询师列表activity页面展示的dialog
var expertSearchActivityPageHasShown: Boolean = false // 专家咨询列表activity页面是否已经展示 var expertSearchActivityPageHasShown: Boolean = false // 专家咨询列表activity页面是否已经展示
var ASSISTANT_DIALOG_SP_TAG = "assistant_dialog_sp_tag" // 是否展示左侧文本的缓存key var ASSISTANT_DIALOG_SP_TAG = "assistant_dialog_sp_tag" // 是否展示左侧文本的缓存key
var minWidth = 0 // 最小宽度
/** /**
......
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