|
|
@@ -1,9 +1,6 @@
|
|
|
package com.grkj.iscs_mars.view.fragment
|
|
|
|
|
|
-import android.graphics.Color
|
|
|
import android.graphics.PointF
|
|
|
-import android.view.animation.DecelerateInterpolator
|
|
|
-import android.widget.FrameLayout
|
|
|
import android.widget.ImageView
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
import com.grkj.iscs_mars.R
|
|
|
@@ -21,9 +18,6 @@ import com.grkj.iscs_mars.view.iview.IWorkshopView
|
|
|
import com.grkj.iscs_mars.view.presenter.WorkshopPresenter
|
|
|
import com.grkj.iscs_mars.view.widget.CustomMarkLayerSample
|
|
|
import com.onlylemi.mapview.library.MapViewListener
|
|
|
-import com.takusemba.spotlight.Spotlight
|
|
|
-import com.takusemba.spotlight.Target
|
|
|
-import com.takusemba.spotlight.shape.RoundedRectangle
|
|
|
import com.zhy.adapter.recyclerview.CommonAdapter
|
|
|
import com.zhy.adapter.recyclerview.base.ViewHolder
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
@@ -84,30 +78,7 @@ class WorkshopFragment(val changePage: (PageChangeBO) -> Unit) :
|
|
|
}
|
|
|
|
|
|
mBinding?.tvCreate?.setOnClickListener {
|
|
|
- val bind = mBinding ?: return@setOnClickListener
|
|
|
- val targets = ArrayList<Target>()
|
|
|
-
|
|
|
- val tipsRoot = FrameLayout(requireContext())
|
|
|
- val tips = layoutInflater.inflate(R.layout.tips_workshop_layout, tipsRoot)
|
|
|
- val tipsTarget = Target.Builder()
|
|
|
- .setAnchor(bind.mapRoot!!)
|
|
|
- .setShape(RoundedRectangle(295f, 540f, 20f))
|
|
|
- .setOverlay(tips)
|
|
|
- .build()
|
|
|
-
|
|
|
- targets.add(tipsTarget)
|
|
|
-
|
|
|
- // 做引导提示
|
|
|
- val spotlight = Spotlight.Builder(requireActivity())
|
|
|
- .setTargets(targets)
|
|
|
- .setBackgroundColor(Color.parseColor("#DD000000"))
|
|
|
- .setDuration(1000L)
|
|
|
- .setAnimation(DecelerateInterpolator(2f))
|
|
|
- .build()
|
|
|
-
|
|
|
- spotlight.start()
|
|
|
- // 点击背景认为结束演示
|
|
|
- tips.setOnClickListener { spotlight.finish() }
|
|
|
+ changePage(PageChangeBO(1, mPointList[0].workstationId, machineryName = mPointList[0].name))
|
|
|
}
|
|
|
|
|
|
initMap()
|
|
|
@@ -177,7 +148,6 @@ class WorkshopFragment(val changePage: (PageChangeBO) -> Unit) :
|
|
|
Executor.repeatOnMain({
|
|
|
val isAllBitmapLoaded = mPointList.all { it.ticketList.take(4).all { it.bitmap != null } }
|
|
|
if (isAllBitmapLoaded) {
|
|
|
- mBinding?.mapview?.currentZoom = 0.51f
|
|
|
mBinding?.mapview?.refreshWorld()
|
|
|
}
|
|
|
return@repeatOnMain !isAllBitmapLoaded
|
|
|
@@ -192,7 +162,6 @@ class WorkshopFragment(val changePage: (PageChangeBO) -> Unit) :
|
|
|
mBinding?.mapview?.isScaleAndRotateTogether = false
|
|
|
mBinding?.mapview?.setMapViewListener(object : MapViewListener {
|
|
|
override fun onMapLoadSuccess() {
|
|
|
- mBinding?.mapview?.currentZoom = 0.51f
|
|
|
mBinding?.mapview?.post {
|
|
|
// 要加null判断,否则loadMap的时候会调用onMapLoadSuccess导致多次创建layer
|
|
|
if (markLayer != null) {
|
|
|
@@ -202,9 +171,9 @@ class WorkshopFragment(val changePage: (PageChangeBO) -> Unit) :
|
|
|
markLayer = CustomMarkLayerSample(mBinding?.mapview, mPointList)
|
|
|
markLayer?.setMarkIsClickListener(object : CustomMarkLayerSample.MarkIsClickListener {
|
|
|
override fun markIsClick(index: Int, btnIndex: Int, isClickIcon: Boolean) {
|
|
|
- if (btnIndex == -1) {
|
|
|
- changePage(PageChangeBO(1, mPointList[index].workstationId, machineryName = mPointList[index].name))
|
|
|
- }
|
|
|
+// if (btnIndex == -1) {
|
|
|
+// changePage(PageChangeBO(1, mPointList[index].workstationId, machineryName = mPointList[index].name))
|
|
|
+// }
|
|
|
}
|
|
|
})
|
|
|
mBinding?.mapview?.addLayer(markLayer)
|