完成了事件面板中的样式以及数量标记
This commit is contained in:
@@ -11,6 +11,7 @@ import com.mogo.module.v2x.V2XConst.MODULE_NAME
|
||||
import com.mogo.module.v2x.V2XServiceManager
|
||||
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
|
||||
import com.mogo.module.v2x.presenter.EventPanelPresenter
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.*
|
||||
|
||||
@@ -24,13 +25,10 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
private val TAG = "EventPanelFragment"
|
||||
|
||||
private val tabsTitle = arrayOf("出行动态", "周边事件", "我的分享")
|
||||
private var fragments: Array<Fragment>? = null
|
||||
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
|
||||
private var selectPosition = 0
|
||||
|
||||
companion object {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
@@ -73,13 +71,21 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
hidePanel()
|
||||
}
|
||||
|
||||
btnShowOrHidePanels.setOnClickListener {
|
||||
if (clPanelContainer.visibility == View.GONE) {
|
||||
llEventMore.setOnClickListener {
|
||||
if (!isPanelShow()) {
|
||||
showPanel()
|
||||
} else {
|
||||
hidePanel()
|
||||
}
|
||||
}
|
||||
|
||||
val historyMessage = V2XSQLiteUtils.getScenarioHistoryData()
|
||||
if (historyMessage != null && historyMessage.size > 0) {
|
||||
tvEventCount.visibility = View.VISIBLE
|
||||
tvEventCount.text = "${historyMessage.size}"
|
||||
} else {
|
||||
tvEventCount.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -94,16 +100,13 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
fun showPanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment show panel")
|
||||
clPanelContainer.visibility = View.VISIBLE
|
||||
btnShowOrHidePanels.text = "隐藏面板"
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, true)
|
||||
}
|
||||
|
||||
fun hidePanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment hide panel")
|
||||
clPanelContainer.visibility = View.GONE
|
||||
btnShowOrHidePanels.text = "显示面板"
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, false)
|
||||
|
||||
}
|
||||
|
||||
fun isPanelShow(): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user