app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
@@ -3,7 +3,6 @@
import android.app.Activity
import android.arch.lifecycle.Observer
import android.arch.lifecycle.ViewModelProviders
import android.content.DialogInterface
import android.content.Intent
import android.net.Uri
import android.os.Bundle
@@ -20,9 +19,9 @@
import cn.flightfeather.thirdapp.activity.ProblemDetailActivity
import cn.flightfeather.thirdapp.activity.PromiseActivity
import cn.flightfeather.thirdapp.adapter.IconsPageAdapter
import cn.flightfeather.thirdapp.bean.Mediafile
import cn.flightfeather.thirdapp.bean.Scense
import cn.flightfeather.thirdapp.bean.Subtask
import cn.flightfeather.thirdapp.bean.entity.Mediafile
import cn.flightfeather.thirdapp.bean.entity.Scense
import cn.flightfeather.thirdapp.bean.entity.Subtask
import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo
import cn.flightfeather.thirdapp.model.event.InspectionEvent
import cn.flightfeather.thirdapp.model.event.ProblemEvent
@@ -130,7 +129,7 @@
        super.onCreate(savedInstanceState)
        initIconViewPager()
//        initIconViewPager()
        initLocation()
        ll_show_hide_detail.setOnClickListener(this)
@@ -311,6 +310,7 @@
            result = result.and(it)
        }
        if (result) {
            initIconViewPager()
            showMenu()
            refreshMenuStatus(taskStatus)
@@ -604,8 +604,8 @@
                    timerTaskRunning = true
                }
                val lng = round(longitudeCurrent * 1000) / 1000
                val lat = round(latitudeCurrent * 1000) / 1000
                val lng = round(longitudeCurrent * 1000000) / 1000000
                val lat = round(latitudeCurrent * 1000000) / 1000000
                viewModel.inspection.value?.apply {
                    if (extension1 == null) {
@@ -624,7 +624,7 @@
                        val l1 = LatLng(lat, lng)
                        val l2 = LatLng(last[1], last[0])
                        val distance = AMapUtils.calculateLineDistance(l1, l2)
                        if (distance >= 5) {
                        if (distance >= 1 && distance < 1000 && lat != 0.0 && lng != 0.0) {
                            extension1 = "${extension1};${lng},${lat}"
                            //道路监测点和道路类型的场景,直接展示轨迹;其余场景只有管理员和政府部门可以查看
                            if (
@@ -684,10 +684,16 @@
    //开始导航
    private fun startNavi() {
        val sourceLatLng = LatLng(viewModel.scene.value?.getLatitude()!!, viewModel.scene.value?.getLongitude()!!)
        val amapNavi = AmapNavi(this)
        amapNavi.startNavi(sourceLatLng.latitude, sourceLatLng.longitude)
        if (viewModel.scene.value != null) {
            val sourceLatLng = LatLng(
                    viewModel.scene.value!!.latitude,
                    viewModel.scene.value!!.longitude
            )
            val amapNavi = AmapNavi(this)
            amapNavi.startNavi(sourceLatLng.latitude, sourceLatLng.longitude)
        } else {
            toast("导航目前不可用,请稍后再试")
        }
    }
    override fun onClick(v: View?) {