Commit 98d04232 authored by wanglei's avatar wanglei

...

parent e95f51cb
...@@ -100,7 +100,7 @@ object LocationShareListUtils { ...@@ -100,7 +100,7 @@ object LocationShareListUtils {
} }
fun deleteViewer(device: String, callBacK: (result: Boolean) -> Unit) { fun deleteShare(device: String, callBacK: (result: Boolean) -> Unit) {
Thread { Thread {
val data = JSONObject() val data = JSONObject()
data.put("device", device) data.put("device", device)
...@@ -112,6 +112,7 @@ object LocationShareListUtils { ...@@ -112,6 +112,7 @@ object LocationShareListUtils {
.put("bp", bp) .put("bp", bp)
.toString() .toString()
val paramJson = AESHelper.encrypt(body) val paramJson = AESHelper.encrypt(body)
LogEx.logDebug(TAG, "paramJson=$paramJson")
runCatching { runCatching {
val result = ReportUtils.doPost(deleteUrl, HashMap(), paramJson) val result = ReportUtils.doPost(deleteUrl, HashMap(), paramJson)
LogEx.logDebug(TAG, "result=$result") LogEx.logDebug(TAG, "result=$result")
......
...@@ -7,7 +7,6 @@ import android.view.LayoutInflater ...@@ -7,7 +7,6 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.core.location.LocationManagerCompat.requestLocationUpdates
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.base.locationsharewhite.BuildConfig import com.base.locationsharewhite.BuildConfig
import com.base.locationsharewhite.R import com.base.locationsharewhite.R
...@@ -87,10 +86,26 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea ...@@ -87,10 +86,26 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
changeViewingBeanPosition(true, true, true) changeViewingBeanPosition(true, true, true)
}, },
moreClick = { anchorView, item -> moreClick = { anchorView, viewingBean: ViewingBean ->
showViewerMoreDialog(anchorView) 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 binding.rvViewing.adapter = adapter
} }
...@@ -366,7 +381,6 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea ...@@ -366,7 +381,6 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
} }
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
locationPresenter.cancelLocationUpdates() locationPresenter.cancelLocationUpdates()
......
...@@ -70,7 +70,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() { ...@@ -70,7 +70,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
}) })
adapter.moreAction = { anchorView, viewerBean -> adapter.moreAction = { anchorView, viewerBean ->
showViewerMoreDialog(anchorView, deleteAction = { showViewerMoreDialog(anchorView, deleteAction = {
LocationShareListUtils.deleteViewer(viewerBean.device) { LocationShareListUtils.deleteShare(viewerBean.device) {
runOnUiThread { runOnUiThread {
toast(it.toString()) 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