Skip to content

Commit

Permalink
update slider panel item distance/bearing information when GPS permis…
Browse files Browse the repository at this point in the history
…sion is wllowed for first time
  • Loading branch information
jairrab committed Oct 7, 2019
1 parent bac81ce commit 6f42910
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class MainMapView : BaseFragment() {
currentLocationName.observe(viewLifecycleOwner, Observer {
binding.currentLocationNameTv.text = it
binding.currentLocationNameTv.visibility = View.VISIBLE
helper.list.updateRecyclerView(binding.recyclerview)
})

currentLocationGps.observe(viewLifecycleOwner, Observer {
Expand Down Expand Up @@ -95,9 +96,6 @@ class MainMapView : BaseFragment() {

mapboxMap = it

/*mapboxMap?.uiSettings?.setCompassMargins(0,
20f.convertToPixel().toInt(), 20f.convertToPixel().toInt(), 0)*/

this@MainMapView.viewModel.downloadLocations()

helper.location.enableLocationComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ internal class ViewList @Inject constructor(
recyclerAdapter.mapPoints = mapPoints
recyclerView.adapter = recyclerAdapter
}

fun updateRecyclerView(recyclerView: RecyclerView) {
val layoutManager = recyclerView.layoutManager as LinearLayoutManager
recyclerAdapter.notifyItemRangeChanged(
layoutManager.findFirstVisibleItemPosition(),
layoutManager.findLastVisibleItemPosition()
)
}
}

0 comments on commit 6f42910

Please sign in to comment.