|
|
@@ -11,12 +11,12 @@ import androidx.recyclerview.widget.RecyclerView
|
|
|
import com.nova.brain.glass.R
|
|
|
import com.nova.brain.glass.databinding.ActivitySprayingResultBinding
|
|
|
import com.nova.brain.glass.helper.BitmapDecodeHelper
|
|
|
+import com.nova.brain.glass.helper.GlassMediaServiceHelper
|
|
|
import com.nova.brain.glass.helper.OfflineCmdListener
|
|
|
import com.nova.brain.glass.helper.OfflineCmdServiceHelper
|
|
|
import com.nova.brain.glass.helper.SprayingPhotoManager
|
|
|
import com.nova.brain.glass.model.ItemItem
|
|
|
import com.nova.brain.glass.viewmodel.SprayingResultVM
|
|
|
-import com.rokid.security.glass3.open.sdk.GlassSdk
|
|
|
import com.rokid.security.glass3.sdk.base.data.media.PhotoResolution
|
|
|
import com.rokid.security.system.server.media.callback.PhotoFileCallback
|
|
|
import com.xuqm.base.adapter.BasePagedAdapter
|
|
|
@@ -70,6 +70,9 @@ class SprayingResultActivity :
|
|
|
|
|
|
SprayingFinishActivity.ACTION_SUBMIT -> {
|
|
|
SprayingPhotoManager.clear()
|
|
|
+ startActivity(Intent(this, TaskListActivity::class.java).apply {
|
|
|
+ addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
|
+ })
|
|
|
finish()
|
|
|
}
|
|
|
}
|
|
|
@@ -108,8 +111,7 @@ class SprayingResultActivity :
|
|
|
val publicPicturesDir =
|
|
|
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
|
|
|
val file = File(publicPicturesDir, fileName)
|
|
|
- GlassSdk.getGlassMediaService()
|
|
|
- ?.takePhoto(PhotoResolution.RESOLUTION_480P, file.absolutePath)
|
|
|
+ GlassMediaServiceHelper.takePhoto(PhotoResolution.RESOLUTION_480P, file.absolutePath)
|
|
|
}
|
|
|
|
|
|
fun rest() {
|
|
|
@@ -185,15 +187,16 @@ class SprayingResultActivity :
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
OfflineCmdServiceHelper.addOnLineListener(listener)
|
|
|
- GlassSdk.getGlassMediaService()?.addPhotoCallback(mPhotoFileCallback)
|
|
|
+ GlassMediaServiceHelper.addPhotoCallback(mPhotoFileCallback)
|
|
|
}
|
|
|
override fun onPause() {
|
|
|
super.onPause()
|
|
|
OfflineCmdServiceHelper.removeOnLineListener(listener)
|
|
|
- GlassSdk.getGlassMediaService()?.removePhotoCallback(mPhotoFileCallback)
|
|
|
+ GlassMediaServiceHelper.removePhotoCallback(mPhotoFileCallback)
|
|
|
}
|
|
|
override fun onDestroy() {
|
|
|
super.onDestroy()
|
|
|
+ binding.iv.setImageDrawable(null)
|
|
|
}
|
|
|
|
|
|
private var isPhoto = false
|