Commit 98d04232 authored by wanglei's avatar wanglei

...

parent e95f51cb
......@@ -100,7 +100,7 @@ object LocationShareListUtils {
}
fun deleteViewer(device: String, callBacK: (result: Boolean) -> Unit) {
fun deleteShare(device: String, callBacK: (result: Boolean) -> Unit) {
Thread {
val data = JSONObject()
data.put("device", device)
......@@ -112,6 +112,7 @@ object LocationShareListUtils {
.put("bp", bp)
.toString()
val paramJson = AESHelper.encrypt(body)
LogEx.logDebug(TAG, "paramJson=$paramJson")
runCatching {
val result = ReportUtils.doPost(deleteUrl, HashMap(), paramJson)
LogEx.logDebug(TAG, "result=$result")
......
......@@ -7,7 +7,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.animation.LinearInterpolator
import androidx.activity.addCallback
import androidx.core.location.LocationManagerCompat.requestLocationUpdates
import androidx.lifecycle.lifecycleScope
import com.base.locationsharewhite.BuildConfig
import com.base.locationsharewhite.R
......@@ -87,10 +86,26 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
changeViewingBeanPosition(true, true, true)
},
moreClick = { anchorView, item ->
showViewerMoreDialog(anchorView)
moreClick = { anchorView, viewingBean: ViewingBean ->
showViewerMoreDialog(anchorView,
renameAction = {
},
deleteAction = {
LocationShareListUtils.deleteShare(viewingBean.device) { result ->
runOnUiThread {
if (result) {
toast("delete success")
binding.ivRefresh.callOnClick()
} else {
toast("delete failed")
}
}
}
}
)
}
)
binding.rvViewing.adapter = adapter
}
......@@ -366,7 +381,6 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
}
override fun onPause() {
super.onPause()
locationPresenter.cancelLocationUpdates()
......
......@@ -70,7 +70,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
})
adapter.moreAction = { anchorView, viewerBean ->
showViewerMoreDialog(anchorView, deleteAction = {
LocationShareListUtils.deleteViewer(viewerBean.device) {
LocationShareListUtils.deleteShare(viewerBean.device) {
runOnUiThread {
toast(it.toString())
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment