|
@@ -24,21 +24,23 @@
|
|
|
package com.sybotan.android.demo.activities
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
+import android.content.Context
|
|
|
import android.content.Intent
|
|
|
import android.graphics.Color
|
|
|
import android.graphics.PointF
|
|
|
import android.os.Bundle
|
|
|
import android.os.Environment
|
|
|
+import android.text.TextUtils
|
|
|
import android.util.Log
|
|
|
import android.view.Gravity
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
-import android.webkit.WebSettings
|
|
|
import android.webkit.WebView
|
|
|
import android.webkit.WebViewClient
|
|
|
import android.widget.TextView
|
|
|
import android.widget.Toast
|
|
|
import android.widget.*
|
|
|
+import androidx.appcompat.widget.LinearLayoutCompat
|
|
|
import androidx.recyclerview.widget.GridLayoutManager
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
@@ -53,6 +55,7 @@ import com.afollestad.materialdialogs.MaterialDialog
|
|
|
import com.arashivision.sdkcamera.camera.InstaCameraManager
|
|
|
import com.arashivision.sdkcamera.camera.callback.ICameraChangedCallback
|
|
|
import com.arashivision.sdkcamera.camera.callback.ICaptureStatusListener
|
|
|
+import com.bumptech.glide.Glide
|
|
|
import com.google.gson.Gson
|
|
|
import com.lzy.okgo.OkGo
|
|
|
import com.lzy.okgo.callback.FileCallback
|
|
@@ -60,22 +63,29 @@ import com.lzy.okgo.model.Response
|
|
|
import com.sybotan.android.demo.R
|
|
|
import com.sybotan.android.demo.activities.poc.DeviceActivity
|
|
|
import com.sybotan.android.demo.activities.poc.RelationActivity
|
|
|
+import com.sybotan.android.demo.adapter.PictureAdapter
|
|
|
import com.sybotan.android.demo.adapter.PipeAdapter
|
|
|
import com.sybotan.android.demo.bean.result.*
|
|
|
import com.sybotan.android.demo.graphy.GraphyHelper
|
|
|
import com.sybotan.android.demo.retrofit.BaseViewModelInterface
|
|
|
-import com.sybotan.android.demo.tools.DensityUtils
|
|
|
-import com.sybotan.android.demo.tools.WordWrapView
|
|
|
-import com.sybotan.android.demo.tools.NetworkManager
|
|
|
+import com.sybotan.android.demo.retrofit.Constant
|
|
|
+import com.sybotan.android.demo.tools.*
|
|
|
+import com.sybotan.android.demo.view.MaxHeightRecyclerView
|
|
|
import com.sybotan.android.demo.viewmodel.GraphyVM
|
|
|
import com.sybotan.android.graphy.SGraphyView
|
|
|
import com.sybotan.android.graphy.events.SGraphyViewMoveEvent
|
|
|
+import com.yuyh.library.imgsel.ImageLoader
|
|
|
+import com.yuyh.library.imgsel.ImgSelConfig
|
|
|
import com.zbar.lib.CaptureActivity
|
|
|
+import io.reactivex.ObservableEmitter
|
|
|
import org.greenrobot.eventbus.EventBus
|
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
import org.jetbrains.anko.doAsync
|
|
|
+import org.jetbrains.anko.startActivity
|
|
|
import org.jetbrains.anko.textColor
|
|
|
import org.jetbrains.anko.uiThread
|
|
|
+import org.json.JSONException
|
|
|
+import org.json.JSONObject
|
|
|
import java.io.*
|
|
|
import java.text.SimpleDateFormat
|
|
|
import java.util.*
|
|
@@ -101,6 +111,16 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
var isAddBaseMap: Boolean = false
|
|
|
}
|
|
|
|
|
|
+ //选择图片
|
|
|
+ private val REQUEST_CODE_PIC = 0X102
|
|
|
+
|
|
|
+ // 自定义图片加载器
|
|
|
+ private val loader =
|
|
|
+ ImageLoader { context: Context?, path: String?, imageView: ImageView? ->
|
|
|
+ Glide.with(
|
|
|
+ context
|
|
|
+ ).load(path).into(imageView)
|
|
|
+ }
|
|
|
private lateinit var spacePipeModel: java.util.ArrayList<SpacePipeModel>
|
|
|
|
|
|
/** viewModel */
|
|
@@ -122,7 +142,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
lateinit var from: String
|
|
|
|
|
|
/** 实际距离 */
|
|
|
- val distance = 2500f
|
|
|
+ val distance = 5000f
|
|
|
|
|
|
/** 缩放后的同比例距离 */
|
|
|
var realDistance = 0f
|
|
@@ -136,6 +156,18 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
/** 底图item */
|
|
|
lateinit var mapItem: BaseMapItem
|
|
|
|
|
|
+ /**
|
|
|
+ * 问题点坐标
|
|
|
+ */
|
|
|
+ val ProblemDot = Point()
|
|
|
+ var addPoint: PointItem? = null
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 问题图片列表
|
|
|
+ */
|
|
|
+ val beans: ArrayList<Photos> = ArrayList()
|
|
|
+ lateinit var pictureAdapter: PictureAdapter
|
|
|
+
|
|
|
@Subscribe
|
|
|
fun test(msg: SGraphyViewMoveEvent) {
|
|
|
Log.d(TAG, "msg=$msg")
|
|
@@ -145,20 +177,22 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
private lateinit var graphyView: SGraphyView
|
|
|
private lateinit var quesDetail: RelativeLayout
|
|
|
private lateinit var spaceStructure: LinearLayout
|
|
|
+ private lateinit var doneSpaceStructure: LinearLayout
|
|
|
private lateinit var spaceName: TextView
|
|
|
+ private lateinit var spaceName3: TextView
|
|
|
+ private lateinit var spaceName4: TextView
|
|
|
private lateinit var spaceName2: TextView
|
|
|
- private lateinit var equipLl:LinearLayout
|
|
|
- private lateinit var drawLl:LinearLayout
|
|
|
- private lateinit var equipLocation:TextView
|
|
|
- private lateinit var qrcodeLl:LinearLayout
|
|
|
- private lateinit var addDot:TextView
|
|
|
- private lateinit var nfc:TextView
|
|
|
- private lateinit var qrcodeLocation:TextView
|
|
|
+ private lateinit var equipLl: LinearLayout
|
|
|
+ private lateinit var drawLl: LinearLayout
|
|
|
+ private lateinit var equipLocation: TextView
|
|
|
+ private lateinit var qrcodeLl: LinearLayout
|
|
|
+ private lateinit var addDot: TextView
|
|
|
+ private lateinit var nfc: TextView
|
|
|
+ private lateinit var qrcodeLocation: TextView
|
|
|
private lateinit var modelCheckBox: CheckBox
|
|
|
private lateinit var modelSubmit: TextView
|
|
|
private lateinit var sceneCheckBox: CheckBox
|
|
|
private lateinit var sceneSubmit: TextView
|
|
|
- private lateinit var codeEdit: EditText
|
|
|
private lateinit var qrcode: TextView
|
|
|
private lateinit var qrcodeCancel: TextView
|
|
|
private lateinit var pipeCancel: TextView
|
|
@@ -169,6 +203,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
private lateinit var drawEquip: TextView
|
|
|
private lateinit var drawPipe: TextView
|
|
|
private lateinit var piprRv: RecyclerView
|
|
|
+ private lateinit var problemPicRecycler: MaxHeightRecyclerView
|
|
|
private lateinit var equipCancel: TextView
|
|
|
private lateinit var equipNext: TextView
|
|
|
private lateinit var equipEdit: EditText
|
|
@@ -181,15 +216,24 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
private lateinit var eqPipeCnct: TextView
|
|
|
private lateinit var equipWwv: WordWrapView
|
|
|
private lateinit var pipeWwv: WordWrapView
|
|
|
- private lateinit var roof : RadioButton
|
|
|
+ private lateinit var roof: RadioButton
|
|
|
private lateinit var floor: RadioButton
|
|
|
private lateinit var wall: RadioButton
|
|
|
private lateinit var air: RadioButton
|
|
|
private lateinit var quesTv: TextView
|
|
|
private lateinit var quesSubmit: TextView
|
|
|
+ private lateinit var addSpaceDetail: TextView
|
|
|
+ private lateinit var addSpaceDetail2: TextView
|
|
|
+ private lateinit var resetSpaceState: TextView
|
|
|
private lateinit var qrcodeEdit: EditText
|
|
|
private lateinit var webview: WebView
|
|
|
private lateinit var quesIma: ImageView
|
|
|
+ private lateinit var problemLl: LinearLayoutCompat
|
|
|
+ private lateinit var problemClose: TextView
|
|
|
+ private lateinit var problemDone: TextView
|
|
|
+ private lateinit var problemSave: TextView
|
|
|
+ private lateinit var equipDetail: TextView
|
|
|
+ private lateinit var equipDelete: TextView
|
|
|
|
|
|
/**
|
|
|
* 创建Activity时的回调函数
|
|
@@ -241,7 +285,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
/** 网络请求回调处理 */
|
|
|
initViewModel()
|
|
|
|
|
|
- initGrid()
|
|
|
+// initGrid()
|
|
|
return
|
|
|
} // Function onCreate()
|
|
|
|
|
@@ -309,10 +353,12 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
private fun initView() {
|
|
|
graphyView = findViewById(R.id.graphyView)
|
|
|
quesDetail = findViewById(R.id.quesDetail)
|
|
|
- quesDetail = findViewById(R.id.quesDetail)
|
|
|
spaceStructure = findViewById(R.id.spaceStructure)
|
|
|
+ doneSpaceStructure = findViewById(R.id.doneSpaceStructure)
|
|
|
spaceName = findViewById(R.id.spaceName)
|
|
|
spaceName2 = findViewById(R.id.spaceName2)
|
|
|
+ spaceName3 = findViewById(R.id.spaceName3)
|
|
|
+ spaceName4 = findViewById(R.id.spaceName4)
|
|
|
equipLl = findViewById(R.id.equipLl)
|
|
|
drawLl = findViewById(R.id.drawLl)
|
|
|
equipLocation = findViewById(R.id.equipLocation)
|
|
@@ -324,7 +370,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
modelSubmit = findViewById(R.id.modelSubmit)
|
|
|
sceneCheckBox = findViewById(R.id.sceneCheckBox)
|
|
|
sceneSubmit = findViewById(R.id.sceneSubmit)
|
|
|
- codeEdit = findViewById(R.id.codeEdit)
|
|
|
qrcode = findViewById(R.id.qrcode)
|
|
|
qrcodeCancel = findViewById(R.id.qrcodeCancel)
|
|
|
pipeCancel = findViewById(R.id.pipeCancel)
|
|
@@ -335,6 +380,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
drawEquip = findViewById(R.id.drawEquip)
|
|
|
drawPipe = findViewById(R.id.drawPipe)
|
|
|
piprRv = findViewById(R.id.piprRv)
|
|
|
+ problemPicRecycler = findViewById(R.id.problemPicRecycler)
|
|
|
equipCancel = findViewById(R.id.equipCancel)
|
|
|
equipNext = findViewById(R.id.equipNext)
|
|
|
equipEdit = findViewById(R.id.equipEdit)
|
|
@@ -348,14 +394,23 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
equipWwv = findViewById(R.id.equipWwv)
|
|
|
pipeWwv = findViewById(R.id.pipeWwv)
|
|
|
roof = findViewById(R.id.roof)
|
|
|
- floor= findViewById(R.id.floor)
|
|
|
- wall= findViewById(R.id.wall)
|
|
|
+ floor = findViewById(R.id.floor)
|
|
|
+ wall = findViewById(R.id.wall)
|
|
|
air = findViewById(R.id.air)
|
|
|
quesTv = findViewById(R.id.quesTv)
|
|
|
quesSubmit = findViewById(R.id.quesSubmit)
|
|
|
qrcodeEdit = findViewById(R.id.qrcodeEdit)
|
|
|
webview = findViewById(R.id.webview)
|
|
|
quesIma = findViewById(R.id.quesIma)
|
|
|
+ addSpaceDetail = findViewById(R.id.addSpaceDetail)
|
|
|
+ addSpaceDetail2 = findViewById(R.id.addSpaceDetail2)
|
|
|
+ resetSpaceState = findViewById(R.id.resetSpaceState)
|
|
|
+ problemLl = findViewById(R.id.problemLl)
|
|
|
+ problemClose = findViewById(R.id.problemClose)
|
|
|
+ problemDone = findViewById(R.id.problemDone)
|
|
|
+ problemSave = findViewById(R.id.problemSave)
|
|
|
+ equipDetail = findViewById(R.id.equipDetail)
|
|
|
+ equipDelete = findViewById(R.id.equipDelete)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -370,6 +425,81 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
from = floor.getString("from")!!
|
|
|
}
|
|
|
|
|
|
+ private fun addPic() {
|
|
|
+ val config: ImgSelConfig = ImgSelConfig.Builder(this, loader) // 是否多选
|
|
|
+ .multiSelect(true) // 是否记住上次选中记录, 仅当multiSelect为true的时候配置,默认为true
|
|
|
+ .rememberSelected(false) // 确定按钮文字颜色
|
|
|
+ .btnTextColor(Color.WHITE) // 使用沉浸式状态栏
|
|
|
+ .statusBarColor(resources.getColor(R.color.blue_2E3679)) // 返回图标ResId
|
|
|
+ .backResId(R.mipmap.back_gray).title("选择图片").titleColor(Color.WHITE).titleBgColor(
|
|
|
+ resources.getColor(R.color.blue_2E3679)
|
|
|
+ ) // .allImagesText("All Images")
|
|
|
+ .needCrop(false).cropSize(1, 1, 200, 200) // 第一个是否显示相机
|
|
|
+ .needCamera(true) // 最大选择图片数量
|
|
|
+ .build()
|
|
|
+ //选择图片activity
|
|
|
+ //选择图片activity
|
|
|
+ Repair_ImgSelActivity.startActivity(this, config, REQUEST_CODE_PIC)
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun doPicDatas(pathList: List<String>?) {
|
|
|
+ LocalDataOperation.getInstance().dealLocalData<Photos>(this) { name, params ->
|
|
|
+ when (name) {
|
|
|
+ LocalDataOperation.SHOW_DIALOG_IN_MAIN -> ToastUtils.showMyToast("图片上传中")
|
|
|
+ LocalDataOperation.DEAL_IO_DATA -> {
|
|
|
+ val emitter =
|
|
|
+ params as ObservableEmitter<String>
|
|
|
+ for (s in pathList!!) {
|
|
|
+ Log.e("已选择图片的路径为-----", s!!)
|
|
|
+ val path: String =
|
|
|
+ PictureUtils.compressImage(s, getOfflineImagePath(), 100)
|
|
|
+ val picFile = File(path)
|
|
|
+ if (picFile.exists()) {
|
|
|
+ val key = picFile.name
|
|
|
+ if (isHaveInternet()) {
|
|
|
+ val url: String = Constant.ServerImgIPUp + key
|
|
|
+ val str = UploadImage.uploadFiles(picFile, url)
|
|
|
+ if (!TextUtils.isEmpty(str)) {
|
|
|
+ var resultString: String? = null
|
|
|
+ try {
|
|
|
+ val `object` = JSONObject(str)
|
|
|
+ resultString = `object`.getString("Result")
|
|
|
+ } catch (e: JSONException) {
|
|
|
+ e.printStackTrace()
|
|
|
+ }
|
|
|
+ if ("success" == resultString) {
|
|
|
+ val photos = Photos()
|
|
|
+ photos.itemType = 0
|
|
|
+ photos.path = path
|
|
|
+ photos.key = key
|
|
|
+ beans.add(photos)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ val photos = Photos()
|
|
|
+ photos.itemType = 0
|
|
|
+ photos.path = path
|
|
|
+ photos.key = key
|
|
|
+ beans.add(photos)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ emitter.onNext("")
|
|
|
+ }
|
|
|
+ LocalDataOperation.DEAL_DATA_NEXT -> {
|
|
|
+ ToastUtils.showMyToast("图片上传完毕")
|
|
|
+ pictureAdapter.notifyDataSetChanged()
|
|
|
+ }
|
|
|
+ LocalDataOperation.DEAL_DATA_ERROR -> {
|
|
|
+ ToastUtils.showMyToast("图片上传失败")
|
|
|
+ }
|
|
|
+ else -> {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 防止用户连续点击
|
|
@@ -405,28 +535,241 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
scene.setOnSingleTopUp(object : FloorScene.OnSingleTopUp {
|
|
|
@SuppressLint("SetJavaScriptEnabled")
|
|
|
override fun onSingUp(x: Float, y: Float) {
|
|
|
- //设置
|
|
|
- val settings: WebSettings = webview.getSettings()
|
|
|
- settings.javaScriptEnabled = true
|
|
|
- settings.defaultTextEncodingName = "utf-8"
|
|
|
- settings.builtInZoomControls = true
|
|
|
- settings.loadsImagesAutomatically = true
|
|
|
- settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.SINGLE_COLUMN
|
|
|
- webview.webViewClient = MyWebViewClient()
|
|
|
- webview.loadUrl("http://60.205.177.43:8000/APP/#/")
|
|
|
- if (isFastDoubleClick()) {
|
|
|
- if (isAddBaseMap) {
|
|
|
- scene.removeItem(mapItem)
|
|
|
- isAddBaseMap = false
|
|
|
- webview.visibility = View.GONE
|
|
|
- } else {
|
|
|
- mapItem.zOrder = 1000000f
|
|
|
- mapItem.isVisible = true
|
|
|
- scene.addItem(mapItem)
|
|
|
- isAddBaseMap = true
|
|
|
- webview.visibility = View.VISIBLE
|
|
|
+ //如果只是查看模式,可以选中空间,进行空间内业务操作
|
|
|
+ if ("normal".equals(scene.type)) {
|
|
|
+ var hasChose = false
|
|
|
+ for (space in scene.tunableSpaceList) {
|
|
|
+ val polygonContainsPoint = Lasso.isPolygonContainsPoint(
|
|
|
+ space.mPoints,
|
|
|
+ android.graphics.Point(x.toInt(), -y.toInt())
|
|
|
+ )
|
|
|
+ if (polygonContainsPoint) {
|
|
|
+ if (hasChose) {
|
|
|
+ if (space.calculateArea() < scene.choseSpace!!.calculateArea()) {
|
|
|
+ space.outPaint.color = Color.rgb(0xbd, 0xe8, 0xfe)
|
|
|
+ space.outPaint.strokeWidth = 500f
|
|
|
+ space.paint.color = Opt.spaceChoseColor
|
|
|
+ scene.mapType = "space"
|
|
|
+ scene.choseSpace = space
|
|
|
+ hasChose = true
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ space.outPaint.color = Color.rgb(0xbd, 0xe8, 0xfe)
|
|
|
+ space.paint.color = Opt.spaceChoseColor
|
|
|
+ space.outPaint.strokeWidth = 500f
|
|
|
+ scene.mapType = "space"
|
|
|
+ scene.choseSpace = space
|
|
|
+ hasChose = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ space.paint.color = Opt.spaceColor
|
|
|
+ space.outPaint.strokeWidth = 50f
|
|
|
+ space.outPaint.color = Color.rgb(0xff, 0xff, 0xff)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!hasChose) {
|
|
|
+ scene.mapType = "nothing"
|
|
|
+ scene.choseSpace = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ var outSide = false
|
|
|
+ //计算控制点的边界
|
|
|
+ //是否已经拥有该点
|
|
|
+ /** 打点业务 */
|
|
|
+ if ("dot".equals(scene.type)) {
|
|
|
+// for (space in scene.spaceList) {
|
|
|
+// val polygonContainsPoint = Lasso.isPolygonContainsPoint(
|
|
|
+// space.mPoints,
|
|
|
+// android.graphics.Point(x.toInt(), -y.toInt())
|
|
|
+// )
|
|
|
+// outSide = true
|
|
|
+// space.paint.color = Opt.spaceChoseColor
|
|
|
+// space.outPaint.color = Color.rgb(0xbd, 0xe8, 0xfe)
|
|
|
+// }
|
|
|
+// val point = Point()
|
|
|
+// point.mX = x
|
|
|
+// point.mY = y
|
|
|
+// var item = PointItem(point)
|
|
|
+// item.isVisible = true
|
|
|
+// item.zOrder = 100000f
|
|
|
+// scene.pointItemList.add(item)
|
|
|
+
|
|
|
+ if (addPoint != null) {
|
|
|
+ scene.removeItem(addPoint!!)
|
|
|
+ scene.pointItemList.remove(addPoint)
|
|
|
+ }
|
|
|
+ ProblemDot.mX = x
|
|
|
+ ProblemDot.mY = y
|
|
|
+ addPoint = graphyHelper.addPoint(ProblemDot)
|
|
|
+
|
|
|
+ //添加问题点业务
|
|
|
+ for (item in scene.pointItemList) {
|
|
|
+ item.isVisible = scene.isShowSpace
|
|
|
+ item.zOrder = 100000f
|
|
|
+ scene.addItem(item)
|
|
|
+ }
|
|
|
+ if (!outSide) {
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //打点业务
|
|
|
+// if ("dot".equals(scene.type)) {
|
|
|
+// if (addPoint != null) {
|
|
|
+// scene.removeItem(addPoint!!)
|
|
|
+// }
|
|
|
+// ProblemDot.mX = x
|
|
|
+// ProblemDot.mY = y
|
|
|
+// addPoint = graphyHelper.addPoint(ProblemDot)
|
|
|
+// return
|
|
|
+// }
|
|
|
+
|
|
|
+ //绘制管道业务
|
|
|
+ else if ("pipe".equals(scene.type)) {
|
|
|
+ var pipe = PipeLine()
|
|
|
+ var pointf = PointF()
|
|
|
+ pointf.x = x
|
|
|
+ pointf.y = -y
|
|
|
+ scene.pipeLineList.add(pointf)
|
|
|
+ pipe.points!!.addAll(scene.pipeLineList)
|
|
|
+ var item = PipeLineItem(pipe, null)
|
|
|
+ item!!.isVisible = true
|
|
|
+ item!!.zOrder = 100000f
|
|
|
+ scene.drawingPipeItemList.add(item)
|
|
|
+ for (item in scene.drawingPipeItemList) {
|
|
|
+ item.isVisible = scene.isShowSpace
|
|
|
+ item.zOrder = 100000f
|
|
|
+ scene.addItem(item)
|
|
|
+ }
|
|
|
+
|
|
|
+ //绘制二维码
|
|
|
+ } else if ("qrcode".equals(scene.type)) {
|
|
|
+ scene.point.mX = x
|
|
|
+ scene.point.mY = y
|
|
|
+
|
|
|
+ if (scene.item != null) {
|
|
|
+ scene.removeItem(scene.item!!)
|
|
|
+ }
|
|
|
+ scene.item =
|
|
|
+ QrcodeItem(this@GraphyActivity, scene.point, null, scene.defaultPointScale)
|
|
|
+ scene.item!!.isVisible = true
|
|
|
+ scene.item!!.zOrder = 100000f
|
|
|
+ scene.addItem(scene.item!!)
|
|
|
+
|
|
|
+ //绘制设备
|
|
|
+ } else if ("equip".equals(scene.type)) {
|
|
|
+ scene.point.mX = x
|
|
|
+ scene.point.mY = y
|
|
|
+
|
|
|
+ if (scene.eqItem != null) {
|
|
|
+ scene.removeItem(scene.eqItem!!)
|
|
|
+ }
|
|
|
+
|
|
|
+ /* //吸附算法
|
|
|
+ var dist = 500.00
|
|
|
+ for (index in 0..scene.choseSpace!!.mPoints.size - 1) {
|
|
|
+
|
|
|
+
|
|
|
+ val point1 = scene.choseSpace!!.mPoints.get(index)
|
|
|
+ var point2 = PointF()
|
|
|
+ if (index == scene.choseSpace!!.mPoints.size - 1) {
|
|
|
+ point2 = scene.choseSpace!!.mPoints.get(0)
|
|
|
+ } else {
|
|
|
+ point2 = scene.choseSpace!!.mPoints.get(index + 1)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ val l1 = Math.sqrt(Math.pow(Math.abs(point1.x - point2.x).toDouble(), 2.0) + Math.pow(Math.abs(point1.y - point2.y).toDouble(), 2.0)).toFloat()
|
|
|
+ val l2 = Math.sqrt(Math.pow(Math.abs(point1.x - x).toDouble(), 2.0) + Math.pow(Math.abs(point1.y + y).toDouble(), 2.0)).toFloat()
|
|
|
+ val l3 = Math.sqrt(Math.pow(Math.abs(point2.x - x).toDouble(), 2.0) + Math.pow(Math.abs(point2.y + y).toDouble(), 2.0)).toFloat()
|
|
|
+ val halfP = (l1 + l2 + l3) / 2
|
|
|
+ val s = Math.sqrt(halfP * (halfP - l1) * (halfP - l2) * (halfP - l3).toDouble())
|
|
|
+ val h = 2 * s / l1
|
|
|
+ if (h < dist) {
|
|
|
+ dist = h
|
|
|
+ var k1: Float
|
|
|
+ if (point1.x - point2.x == 0f) {
|
|
|
+ k1 = 0f
|
|
|
+ } else {
|
|
|
+ k1 = (point1.y - point2.y) / (point1.x - point2.x)
|
|
|
+ }
|
|
|
+
|
|
|
+ val b1 = point1.y - k1 * point1.x
|
|
|
+
|
|
|
+ var k2: Float
|
|
|
+ if (k1 == 0f) {
|
|
|
+ k2 = 0f
|
|
|
+ } else {
|
|
|
+ k2 = -1 / k1
|
|
|
+ }
|
|
|
+
|
|
|
+ val b2 = y - k2 * x
|
|
|
+
|
|
|
+ val x1 = (b2 - b1) / (k1 - k2)
|
|
|
+ val y1 = k2 * (x) + b2
|
|
|
+
|
|
|
+ if (point1.x - point2.x == 0f) {
|
|
|
+ scene.point.mX = point1.x
|
|
|
+ if (Math.abs(k1) == 0f) {
|
|
|
+ scene.point.mY = y
|
|
|
+ } else {
|
|
|
+ if (point1.y - point2.y == 0f) {
|
|
|
+ scene.point.mY = -point1.y
|
|
|
+ } else {
|
|
|
+ scene.point.mY = y1
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (Math.abs(k1) == 0f) {
|
|
|
+ scene.point.mX = x
|
|
|
+ } else {
|
|
|
+ scene.point.mX = x1
|
|
|
+ }
|
|
|
+ if (point1.y - point2.y == 0f) {
|
|
|
+ scene.point.mY = -point1.y
|
|
|
+ } else {
|
|
|
+ scene.point.mY = y1
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }*/
|
|
|
+
|
|
|
+ scene.eqItem =
|
|
|
+ EquipItem(this@GraphyActivity, scene.point, null, scene.defaultPointScale)
|
|
|
+ scene.eqItem!!.isVisible = true
|
|
|
+ scene.eqItem!!.zOrder = 10000012f
|
|
|
+ scene.addItem(scene.eqItem!!)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //设置
|
|
|
+// val settings: WebSettings = webview.getSettings()
|
|
|
+// settings.javaScriptEnabled = true
|
|
|
+// settings.defaultTextEncodingName = "utf-8"
|
|
|
+// settings.builtInZoomControls = true
|
|
|
+// settings.loadsImagesAutomatically = true
|
|
|
+// settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.SINGLE_COLUMN
|
|
|
+// webview.webViewClient = MyWebViewClient()
|
|
|
+// webview.loadUrl("http://60.205.177.43:8000/APP/#/")
|
|
|
+// if (isFastDoubleClick()) {
|
|
|
+// if (isAddBaseMap) {
|
|
|
+// scene.removeItem(mapItem)
|
|
|
+// isAddBaseMap = false
|
|
|
+// webview.visibility = View.GONE
|
|
|
+// } else {
|
|
|
+// mapItem.zOrder = 1000000f
|
|
|
+// mapItem.isVisible = true
|
|
|
+// scene.addItem(mapItem)
|
|
|
+// isAddBaseMap = true
|
|
|
+// webview.visibility = View.VISIBLE
|
|
|
+// }
|
|
|
+// }
|
|
|
if ("pipe".equals(scene.type)) {
|
|
|
return
|
|
|
}
|
|
@@ -444,10 +787,15 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
quesDetail.visibility = View.GONE
|
|
|
if (!scene.choseSpace!!.data.jobStatus.equals("03")) {
|
|
|
spaceStructure.visibility = View.VISIBLE
|
|
|
- spaceName.text = scene.choseSpace!!.data.localName
|
|
|
+ doneSpaceStructure.visibility = View.GONE
|
|
|
graphyVM.getProblem(scene.choseSpace)
|
|
|
-
|
|
|
+ } else {
|
|
|
+ doneSpaceStructure.visibility = View.VISIBLE
|
|
|
+ spaceStructure.visibility = View.GONE
|
|
|
}
|
|
|
+ spaceName.text = scene.choseSpace!!.data.localName
|
|
|
+ spaceName3.text = scene.choseSpace!!.data.localName
|
|
|
+ spaceName4.text = scene.choseSpace!!.data.localName
|
|
|
graphyVM.getQrcode(scene.choseSpace)
|
|
|
} else {
|
|
|
if (equipLl.visibility == View.GONE) {
|
|
@@ -462,10 +810,12 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
//未选中空间
|
|
|
} else if (scene.mapType.equals("nothing")) {
|
|
|
spaceStructure.visibility = View.GONE
|
|
|
+ doneSpaceStructure.visibility = View.GONE
|
|
|
qrcodeLl.visibility = View.GONE
|
|
|
quesDetail.visibility = View.GONE
|
|
|
equipLl.visibility = View.GONE
|
|
|
drawLl.visibility = View.GONE
|
|
|
+ problemLl.visibility = View.GONE
|
|
|
for (item in scene.pointItemList) {
|
|
|
scene.removeItem(item)
|
|
|
}
|
|
@@ -480,17 +830,10 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
scene.qrcodeItemList.clear()
|
|
|
}
|
|
|
|
|
|
- //打点业务
|
|
|
- if ("dot".equals(scene.type)) {
|
|
|
- scene.type = "normal"
|
|
|
- addDot.alpha = 1f
|
|
|
- scene.choseSpace?.let { graphyVM.addProblem(it, x, y) }
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
//查看模式下,判断问题点选中逻辑
|
|
|
if ("normal".equals(scene.type)) {
|
|
|
realDistance = distance * scene.defaultPointScale / graphyView.scale
|
|
|
+ var hasChoose = false
|
|
|
for (point in scene.pointItemList) {
|
|
|
val sqrt = Math.sqrt(
|
|
|
Math.pow(
|
|
@@ -499,11 +842,15 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
|
|
|
).toInt()
|
|
|
if (sqrt < realDistance) {
|
|
|
+ hasChoose = true
|
|
|
showDotDetail(point)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if (!hasChoose) {
|
|
|
+ problemLl.visibility = View.GONE
|
|
|
+ }
|
|
|
+ var hasChooseEquip = false
|
|
|
for (point in scene.equipList) {
|
|
|
val sqrt = Math.sqrt(
|
|
|
Math.pow(
|
|
@@ -512,14 +859,26 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
|
|
|
).toInt()
|
|
|
if (sqrt < realDistance) {
|
|
|
- Toast.makeText(
|
|
|
- this@GraphyActivity,
|
|
|
- "${point.data.type}\n${point.data.remark}\n${point.data.position}",
|
|
|
- Toast.LENGTH_LONG
|
|
|
- ).show()
|
|
|
+ hasChooseEquip = true
|
|
|
+ equipDetail.alpha = 1f
|
|
|
+ equipDelete.alpha = 1f
|
|
|
+ equipDetail.isEnabled = true
|
|
|
+ equipDelete.isEnabled = true
|
|
|
+ equipDetail.setOnClickListener {
|
|
|
+ startActivity<EquipDetailActivity>()
|
|
|
+ }
|
|
|
+ equipDelete.setOnClickListener {
|
|
|
+ point.data.type
|
|
|
+ }
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ if (!hasChooseEquip) {
|
|
|
+ equipDetail.alpha = 0.5f
|
|
|
+ equipDelete.alpha = 0.5f
|
|
|
+ equipDetail.isEnabled = false
|
|
|
+ equipDelete.isEnabled = false
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -528,6 +887,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
qrcodeLl.visibility = View.VISIBLE
|
|
|
qrcodeLocation.setText("(${scene.point.mX},${scene.point.mY})")
|
|
|
spaceStructure.visibility = View.GONE
|
|
|
+ doneSpaceStructure.visibility = View.GONE
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -536,7 +896,8 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
|
|
|
private fun checkSdCardEnabled(): Boolean {
|
|
|
if (!InstaCameraManager.getInstance().isSdCardEnabled()) {
|
|
|
- Toast.makeText(this, "No SD card inserted or Not enough free space", Toast.LENGTH_SHORT).show()
|
|
|
+ Toast.makeText(this, "No SD card inserted or Not enough free space", Toast.LENGTH_SHORT)
|
|
|
+ .show()
|
|
|
return false
|
|
|
}
|
|
|
return true
|
|
@@ -581,18 +942,21 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
|
|
|
/** 设置空间的任务状态完成 */
|
|
|
sceneSubmit.setOnClickListener {
|
|
|
- graphyVM.setJob(scene.choseSpace, codeEdit.text.toString(), "05")
|
|
|
+ graphyVM.setJob(scene.choseSpace, "05")
|
|
|
}
|
|
|
|
|
|
/** 设置空间的任务状态完成 */
|
|
|
modelSubmit.setOnClickListener {
|
|
|
- graphyVM.setJob(scene.choseSpace, codeEdit.text.toString(), "03")
|
|
|
+ graphyVM.setJob(scene.choseSpace, "03")
|
|
|
}
|
|
|
|
|
|
/** 打点按钮 */
|
|
|
addDot.setOnClickListener {
|
|
|
scene.type = "dot"
|
|
|
- addDot.alpha = 0.3f
|
|
|
+ spaceStructure.visibility = View.GONE
|
|
|
+ problemLl.visibility = View.VISIBLE
|
|
|
+ initProblemPicture()
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/** 绑定二维码按钮 */
|
|
@@ -632,7 +996,12 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
pipeNext.setOnClickListener {
|
|
|
for (model in pipeTypeList) {
|
|
|
if (model.isCheck) {
|
|
|
- graphyVM.addPipe(model, scene.pipeLineList, pipeEdit.text.toString(), scene.choseSpace)
|
|
|
+ graphyVM.addPipe(
|
|
|
+ model,
|
|
|
+ scene.pipeLineList,
|
|
|
+ pipeEdit.text.toString(),
|
|
|
+ scene.choseSpace
|
|
|
+ )
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -707,6 +1076,42 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
eqEqVv.setOnClickListener { skipRelationship("eq_eq_vv", "eq_eq") }
|
|
|
/** 连接 */
|
|
|
eqPipeCnct.setOnClickListener { skipRelationship("eq_pipe_cnct", "eq_pipe") }
|
|
|
+ /** 跳转空间详情 */
|
|
|
+ addSpaceDetail.setOnClickListener { startActivity<SpaceDetailActivity>() }
|
|
|
+ /** 跳转空间详情 */
|
|
|
+ addSpaceDetail2.setOnClickListener { startActivity<SpaceDetailActivity>() }
|
|
|
+ /** 重置空间状态 */
|
|
|
+ resetSpaceState.setOnClickListener { }
|
|
|
+ /** 问题-关闭 */
|
|
|
+ problemClose.setOnClickListener {
|
|
|
+ if (addPoint != null) {
|
|
|
+ scene.removeItem(addPoint!!)
|
|
|
+ scene.pointItemList.remove(addPoint)
|
|
|
+ }
|
|
|
+ scene.type = "normal"
|
|
|
+ problemLl.visibility = View.GONE
|
|
|
+ }
|
|
|
+ /** 问题-已解决 */
|
|
|
+ problemDone.setOnClickListener {
|
|
|
+
|
|
|
+ }
|
|
|
+ /** 问题-保存 */
|
|
|
+ problemSave.setOnClickListener {
|
|
|
+ scene.choseSpace?.let { graphyVM.addProblem(it, ProblemDot.mX, ProblemDot.mY) }
|
|
|
+ scene.type = "normal"
|
|
|
+ problemLl.visibility = View.GONE
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun initProblemPicture() {
|
|
|
+ beans.clear()
|
|
|
+ val photo = Photos()
|
|
|
+ photo.itemType = 1
|
|
|
+ beans.add(photo)
|
|
|
+ pictureAdapter = PictureAdapter(this, beans, "", false, 0, 85)
|
|
|
+ pictureAdapter.setOnPicAdd { addPic() }
|
|
|
+ problemPicRecycler.setLayoutManager(GridLayoutManager(this, 3))
|
|
|
+ problemPicRecycler.adapter = pictureAdapter
|
|
|
}
|
|
|
|
|
|
private fun skipRelationship(code: String, type: String) {
|
|
@@ -798,8 +1203,11 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
for (model in list) {
|
|
|
var position = gson.fromJson(model.position, Position::class.java)
|
|
|
val polygonContainsPoint = Lasso.isPolygonContainsPoint(
|
|
|
- mPoints,
|
|
|
- android.graphics.Point(position.x.toFloat().toInt(), position.y.toFloat().toInt())
|
|
|
+ mPoints,
|
|
|
+ android.graphics.Point(
|
|
|
+ position.x.toFloat().toInt(),
|
|
|
+ position.y.toFloat().toInt()
|
|
|
+ )
|
|
|
)
|
|
|
if (polygonContainsPoint) {
|
|
|
val point = Point()
|
|
@@ -845,7 +1253,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
point.mX = position.x.toFloat()
|
|
|
point.mY = position.y.toFloat()
|
|
|
|
|
|
- graphyHelper.addQrcode(point)
|
|
|
+ graphyHelper.addQrcode(this, point)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -974,7 +1382,9 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
}, this, buildingId, floorId)
|
|
|
graphyVM.getSpaceJob(from)
|
|
|
}
|
|
|
- val graphyHelper : GraphyHelper = GraphyHelper(scene)
|
|
|
+
|
|
|
+ val graphyHelper: GraphyHelper = GraphyHelper(scene, this)
|
|
|
+
|
|
|
/**
|
|
|
* 刷新地图上管线
|
|
|
*/
|
|
@@ -1097,13 +1507,13 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
|
|
|
|
|
|
spaceStructure.visibility = View.GONE
|
|
|
+ doneSpaceStructure.visibility = View.GONE
|
|
|
quesDetail.visibility = View.GONE
|
|
|
drawLl.visibility = View.GONE
|
|
|
equipLl.visibility = View.GONE
|
|
|
|
|
|
scene.type = "normal"
|
|
|
modelCheckBox.isChecked = false
|
|
|
- codeEdit.setText("")
|
|
|
equipLocation.setText("")
|
|
|
roof.isChecked = false
|
|
|
floor.isChecked = false
|
|
@@ -1117,23 +1527,28 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
*/
|
|
|
private fun showDotDetail(point: PointItem) {
|
|
|
spaceStructure.visibility = View.GONE
|
|
|
- quesDetail.visibility = View.VISIBLE
|
|
|
- quesTv.setText(
|
|
|
- "这是描述问题的文本,左侧是拍照图片。" +
|
|
|
- "\n问题编码:${point.data.id}" +
|
|
|
- "\nx轴:${point.data.mX}" +
|
|
|
- "\ny轴:${point.data.mY}" +
|
|
|
- "\n点击下方“问题已解决”按钮后可关闭该问题点。"
|
|
|
- )
|
|
|
- quesTv.setOnClickListener {
|
|
|
-// Toast.makeText(this@GraphyActivity, InstaCameraManager.getInstance(). + "======", Toast.LENGTH_LONG).show()
|
|
|
- }
|
|
|
+ doneSpaceStructure.visibility = View.GONE
|
|
|
+// quesDetail.visibility = View.VISIBLE
|
|
|
+// quesTv.setText(
|
|
|
+// "这是描述问题的文本,左侧是拍照图片。" +
|
|
|
+// "\n问题编码:${point.data.id}" +
|
|
|
+// "\nx轴:${point.data.mX}" +
|
|
|
+// "\ny轴:${point.data.mY}" +
|
|
|
+// "\n点击下方“问题已解决”按钮后可关闭该问题点。"
|
|
|
+// )
|
|
|
+// quesTv.setOnClickListener {
|
|
|
+//// Toast.makeText(this@GraphyActivity, InstaCameraManager.getInstance(). + "======", Toast.LENGTH_LONG).show()
|
|
|
+// }
|
|
|
+
|
|
|
+ problemLl.visibility = View.VISIBLE
|
|
|
+ initProblemPicture()
|
|
|
|
|
|
/** 问题已解决按钮 */
|
|
|
- quesSubmit.setOnClickListener {
|
|
|
+ problemDone.setOnClickListener {
|
|
|
graphyVM.closeProblem(point, scene.choseSpace)
|
|
|
spaceStructure.visibility = View.VISIBLE
|
|
|
quesDetail.visibility = View.GONE
|
|
|
+ problemLl.visibility = View.GONE
|
|
|
scene.pointItemList.remove(point)
|
|
|
scene.removeItem(point)
|
|
|
if (scene.pointItemList.isEmpty()) {
|
|
@@ -1141,6 +1556,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
scene.removeItem(item)
|
|
|
}
|
|
|
}
|
|
|
+ quesDetail.visibility = View.GONE
|
|
|
graphyVM.getSpaceJob(from)
|
|
|
}
|
|
|
}
|
|
@@ -1185,6 +1601,15 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
graphyVM.getSpaceEq(scene.choseSpace)
|
|
|
}
|
|
|
}
|
|
|
+ REQUEST_CODE_PIC -> {
|
|
|
+ if (resultCode == RESULT_OK) {
|
|
|
+ if (data != null) {
|
|
|
+ val pathList: List<String>? =
|
|
|
+ data.getStringArrayListExtra(Repair_ImgSelActivity.INTENT_RESULT)
|
|
|
+ doPicDatas(pathList)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
else -> {
|
|
|
}
|
|
|
}
|
|
@@ -1241,7 +1666,9 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
if (urls == null || urls.size == 0) {
|
|
|
return
|
|
|
}
|
|
|
- val localFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString() + "/SDK_DEMO_CAPTURE"
|
|
|
+ val localFolder =
|
|
|
+ Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
|
|
|
+ .toString() + "/SDK_DEMO_CAPTURE"
|
|
|
val fileNames = arrayOfNulls<String>(urls.size)
|
|
|
val localPaths = arrayOfNulls<String>(urls.size)
|
|
|
var needDownload = false
|
|
@@ -1263,11 +1690,11 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
return
|
|
|
}
|
|
|
val dialog: MaterialDialog = MaterialDialog.Builder(this)
|
|
|
- .title(R.string.osc_dialog_title_downloading)
|
|
|
- .content(getString(R.string.osc_dialog_msg_downloading, urls.size, 0, 0))
|
|
|
- .cancelable(false)
|
|
|
- .canceledOnTouchOutside(false)
|
|
|
- .show()
|
|
|
+ .title(R.string.osc_dialog_title_downloading)
|
|
|
+ .content(getString(R.string.osc_dialog_msg_downloading, urls.size, 0, 0))
|
|
|
+ .cancelable(false)
|
|
|
+ .canceledOnTouchOutside(false)
|
|
|
+ .show()
|
|
|
val successfulCount = AtomicInteger(0)
|
|
|
val errorCount = AtomicInteger(0)
|
|
|
for (i in localPaths.indices) {
|
|
@@ -1285,10 +1712,18 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
}
|
|
|
|
|
|
private fun checkDownloadCount() {
|
|
|
- dialog.setContent(getString(R.string.osc_dialog_msg_downloading, urls.size, successfulCount.toInt(), errorCount.toInt()))
|
|
|
+ dialog.setContent(
|
|
|
+ getString(
|
|
|
+ R.string.osc_dialog_msg_downloading,
|
|
|
+ urls.size,
|
|
|
+ successfulCount.toInt(),
|
|
|
+ errorCount.toInt()
|
|
|
+ )
|
|
|
+ )
|
|
|
if (successfulCount.toInt() + errorCount.toInt() >= urls.size) {
|
|
|
// PlayAndExportActivity.launchActivity(this@CaptureActivity, localPaths)
|
|
|
- val time = SimpleDateFormat("HH:mm:ss").format(Date(System.currentTimeMillis()))
|
|
|
+ val time =
|
|
|
+ SimpleDateFormat("HH:mm:ss").format(Date(System.currentTimeMillis()))
|
|
|
quesTv.text = quesTv.text.toString() + "\n$time:下载完成"
|
|
|
dialog.dismiss()
|
|
|
}
|