fix: 合并代码
This commit is contained in:
@@ -39,6 +39,8 @@ class MainActivity : BaseActivity() {
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
private val viewModel by viewModels<MainViewModel>()
|
||||
|
||||
var switchFragment = false
|
||||
|
||||
//注入地图控制器
|
||||
@Inject
|
||||
lateinit var mapController: NIMapController
|
||||
@@ -116,9 +118,9 @@ class MainActivity : BaseActivity() {
|
||||
viewModel.liveDataMenuState.observe(this) {
|
||||
binding.mainActivityMenu.isSelected = it
|
||||
if (it == true) {
|
||||
binding.mainActivityMenuLayout.visibility = View.VISIBLE
|
||||
binding.mainActivityMenuGroup.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.mainActivityMenuLayout.visibility = View.GONE
|
||||
binding.mainActivityMenuGroup.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
}
|
||||
@@ -226,6 +228,32 @@ class MainActivity : BaseActivity() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* zoomin
|
||||
*/
|
||||
fun zoomInOnclick(view: View) {
|
||||
mapController.animationHandler.zoomIn()
|
||||
}
|
||||
|
||||
/**
|
||||
* zoomOut
|
||||
*/
|
||||
fun zoomOutOnclick(view: View) {
|
||||
mapController.animationHandler.zoomOut()
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
fun onSwitchFragment() {
|
||||
switchFragment = !switchFragment
|
||||
binding.mainActivityFragmentSwitch.isSelected = switchFragment
|
||||
if (switchFragment) {
|
||||
binding.mainActivityFragmentGroup.visibility = View.GONE
|
||||
} else {
|
||||
binding.mainActivityFragmentGroup.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击录音按钮
|
||||
|
||||
@@ -216,6 +216,7 @@ class MainViewModel @Inject constructor(
|
||||
linkId = linkId,
|
||||
geometry = element.geometry,
|
||||
bottomText = SignUtil.getSignBottomText(element),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||
elementCode = element.code
|
||||
)
|
||||
)
|
||||
|
||||
@@ -26,6 +26,7 @@ class SignAdapter(private var itemListener: ((Int, SignBean) -> Unit?)? = null)
|
||||
bd.signMainIcon.background = holder.viewBinding.root.context.getDrawable(item.iconId)
|
||||
bd.signMainIcon.text = item.iconText
|
||||
bd.signBottomText.text = item.bottomText
|
||||
bd.signBottomRightText.text = item.bottomRightText
|
||||
bd.root.setOnClickListener {
|
||||
itemListener?.invoke(position, item)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user