|
@@ -1,6 +1,10 @@
|
|
|
package com.grkj.iscs.view.fragment
|
|
package com.grkj.iscs.view.fragment
|
|
|
|
|
|
|
|
import android.graphics.PointF
|
|
import android.graphics.PointF
|
|
|
|
|
+import android.os.Bundle
|
|
|
|
|
+import android.view.GestureDetector
|
|
|
|
|
+import android.view.MotionEvent
|
|
|
|
|
+import android.view.View
|
|
|
import com.grkj.iscs.BusinessManager
|
|
import com.grkj.iscs.BusinessManager
|
|
|
import com.grkj.iscs.databinding.FragmentSwitchStatusBinding
|
|
import com.grkj.iscs.databinding.FragmentSwitchStatusBinding
|
|
|
import com.grkj.iscs.util.BitmapUtil
|
|
import com.grkj.iscs.util.BitmapUtil
|
|
@@ -10,7 +14,6 @@ import com.grkj.iscs.util.release
|
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
|
import com.grkj.iscs.view.iview.ISwitchStatusView
|
|
import com.grkj.iscs.view.iview.ISwitchStatusView
|
|
|
import com.grkj.iscs.view.presenter.SwitchStatusPresenter
|
|
import com.grkj.iscs.view.presenter.SwitchStatusPresenter
|
|
|
-import com.grkj.iscs.view.widget.CustomStationLayer
|
|
|
|
|
import com.grkj.iscs.view.widget.CustomSwitchStationLayer
|
|
import com.grkj.iscs.view.widget.CustomSwitchStationLayer
|
|
|
import com.onlylemi.mapview.library.MapViewListener
|
|
import com.onlylemi.mapview.library.MapViewListener
|
|
|
import com.sik.sikcore.thread.ThreadUtils
|
|
import com.sik.sikcore.thread.ThreadUtils
|
|
@@ -20,6 +23,8 @@ class SwitchStatusFragment :
|
|
|
private var mapRatio: Float = 1f
|
|
private var mapRatio: Float = 1f
|
|
|
private var stationLayer: CustomSwitchStationLayer? = null
|
|
private var stationLayer: CustomSwitchStationLayer? = null
|
|
|
private val mStationList = mutableListOf<CustomSwitchStationLayer.IsolationPoint>()
|
|
private val mStationList = mutableListOf<CustomSwitchStationLayer.IsolationPoint>()
|
|
|
|
|
+ private lateinit var gestureDetector: GestureDetector
|
|
|
|
|
+
|
|
|
override fun initPresenter(): SwitchStatusPresenter {
|
|
override fun initPresenter(): SwitchStatusPresenter {
|
|
|
return SwitchStatusPresenter()
|
|
return SwitchStatusPresenter()
|
|
|
}
|
|
}
|
|
@@ -28,11 +33,19 @@ class SwitchStatusFragment :
|
|
|
get() = FragmentSwitchStatusBinding.inflate(layoutInflater)
|
|
get() = FragmentSwitchStatusBinding.inflate(layoutInflater)
|
|
|
|
|
|
|
|
override fun initView() {
|
|
override fun initView() {
|
|
|
|
|
+ gestureDetector = GestureDetector(requireContext(), object :
|
|
|
|
|
+ GestureDetector.SimpleOnGestureListener() {
|
|
|
|
|
+ override fun onDoubleTap(e: MotionEvent): Boolean {
|
|
|
|
|
+ mBinding?.mapview?.currentRotateDegrees = 0f
|
|
|
|
|
+ return super.onDoubleTap(e)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
initMap()
|
|
initMap()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun onResume() {
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
super.onResume()
|
|
|
|
|
+ mBinding?.mapview?.visibility = View.VISIBLE
|
|
|
presenter?.getMapData {
|
|
presenter?.getMapData {
|
|
|
getMap(it)
|
|
getMap(it)
|
|
|
}
|
|
}
|
|
@@ -51,6 +64,7 @@ class SwitchStatusFragment :
|
|
|
|
|
|
|
|
override fun onPause() {
|
|
override fun onPause() {
|
|
|
super.onPause()
|
|
super.onPause()
|
|
|
|
|
+ mBinding?.mapview?.visibility = View.GONE
|
|
|
mBinding?.mapview?.release()
|
|
mBinding?.mapview?.release()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -124,6 +138,10 @@ class SwitchStatusFragment :
|
|
|
*/
|
|
*/
|
|
|
private fun initMap() {
|
|
private fun initMap() {
|
|
|
mBinding?.mapview?.isScaleAndRotateTogether = false
|
|
mBinding?.mapview?.isScaleAndRotateTogether = false
|
|
|
|
|
+ mBinding?.mapview?.setOnTouchListener { _, event ->
|
|
|
|
|
+ gestureDetector.onTouchEvent(event)
|
|
|
|
|
+ false
|
|
|
|
|
+ }
|
|
|
mBinding?.mapview?.setMapViewListener(object : MapViewListener {
|
|
mBinding?.mapview?.setMapViewListener(object : MapViewListener {
|
|
|
override fun onMapLoadSuccess() {
|
|
override fun onMapLoadSuccess() {
|
|
|
if (stationLayer != null) {
|
|
if (stationLayer != null) {
|