Commit c4e3fc95 authored by wanglei's avatar wanglei

...

parent a64890fc
......@@ -29,6 +29,7 @@ import com.base.locationsharewhite.utils.BarUtils
import com.base.locationsharewhite.utils.LogEx
import com.base.locationsharewhite.utils.PermissionUtils.checkLocationPermission
import com.base.locationsharewhite.utils.SpStringUtils
import com.base.locationsharewhite.utils.SpStringUtils.VIEWER_NICKNAME_KEY
import com.base.locationsharewhite.utils.SpStringUtils.VIEWING_NICKNAME_KEY
import com.base.locationsharewhite.utils.SpStringUtils._DEVICE_NICKNAME_
import com.base.locationsharewhite.utils.ToastUtils.toast
......@@ -99,7 +100,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
startActivity(Intent(this, RenameActivity::class.java).apply {
putExtra("doWhat", RENAME_VIEWING_NICK_NAME)
putExtra("device", viewingBean.device)
putExtra("nickName", viewingBean.nickname)
putExtra("nickName", viewingBean.localNickName ?: viewingBean.nickname)
})
},
deleteAction = {
......@@ -412,7 +413,19 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
if (checkLocationPermission()) {
locationPresenter.requestLocationUpdates()
locationPresenter.startUploadMyLocation()
}
refreshNickName()
}
@SuppressLint("NotifyDataSetChanged")
private fun refreshNickName() = lifecycleScope.launch(Dispatchers.IO) {
val nickList = SpStringUtils.getSpStringList(VIEWING_NICKNAME_KEY)
adapter.items.map { viewing ->
changeLocalNickName(viewing, nickList)
}
launch(Dispatchers.Main) {
adapter.notifyDataSetChanged()
}
}
......
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