[6.6.0]接管记录编辑弹窗控制不能多次点击出现多个
This commit is contained in:
@@ -293,7 +293,7 @@ class ReportTypeWindow constructor(activity: Activity): IMoGoDevaToolsListener {
|
||||
/**
|
||||
* 设置弹窗展示状态
|
||||
*/
|
||||
fun setWindowShowStatus(isShow: Boolean){
|
||||
private fun setWindowShowStatus(isShow: Boolean){
|
||||
isShowing = isShow
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private var level2Name: String = ""
|
||||
private var level3Name: String = ""
|
||||
|
||||
private var isShowing: Boolean = false //弹窗是否是展示状态
|
||||
|
||||
init {
|
||||
initFloatWindow()
|
||||
}
|
||||
@@ -448,15 +450,31 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
tvTakeOverTime.text = mActivity.resources.getString(R.string.take_over_time) +
|
||||
millis2String(mTakeOverRecordInfo.faultStartTime, TimeUtils.getHourMinSecondFormat())
|
||||
}
|
||||
setWindowShowStatus(true)
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null){
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
setWindowShowStatus(false)
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取弹窗展示状态
|
||||
*/
|
||||
fun getWindowShowStatus(): Boolean{
|
||||
return isShowing
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置弹窗展示状态
|
||||
*/
|
||||
private fun setWindowShowStatus(isShow: Boolean){
|
||||
isShowing = isShow
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ class TakeOverRecordView @JvmOverloads constructor(
|
||||
private var clickListener: ClickListener? = null
|
||||
private val selectedUploadRecord = ArrayList<TakeOverRecordInfo>()
|
||||
private var recordList: MutableList<TakeOverRecordInfo> ?= null
|
||||
private var takeOverReasonWindow: TakeOverReasonWindow ?= null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_take_over_record, this, true)
|
||||
@@ -80,13 +81,19 @@ class TakeOverRecordView @JvmOverloads constructor(
|
||||
//展示接管原因窗口
|
||||
val activity = context as? FragmentActivity
|
||||
?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||
val takeOverReasonWindow = TakeOverReasonWindow(activity)
|
||||
takeOverReasonWindow.setClickListener(object: TakeOverReasonWindow.ClickListener{
|
||||
override fun onSaveReason(info: TakeOverRecordInfo) {
|
||||
takeOverListAdapter?.notifyRecordItemChanged(info)
|
||||
}
|
||||
})
|
||||
takeOverReasonWindow.showFloatWindow(takeOverRecordInfo)
|
||||
if(takeOverReasonWindow == null){
|
||||
takeOverReasonWindow = TakeOverReasonWindow(activity)
|
||||
takeOverReasonWindow?.setClickListener(object: TakeOverReasonWindow.ClickListener{
|
||||
override fun onSaveReason(info: TakeOverRecordInfo) {
|
||||
takeOverListAdapter?.notifyRecordItemChanged(info)
|
||||
}
|
||||
})
|
||||
}
|
||||
if(takeOverReasonWindow?.getWindowShowStatus() == true){
|
||||
ToastUtils.showShort("接管原因弹窗已存在,请先编辑现有接管原因")
|
||||
}else{
|
||||
takeOverReasonWindow?.showFloatWindow(takeOverRecordInfo)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSelectRecord(
|
||||
|
||||
Reference in New Issue
Block a user