Skip to content

Commit

Permalink
added 'total watcher' feature
Browse files Browse the repository at this point in the history
  • Loading branch information
captainAyan committed Jul 31, 2022
1 parent be3e5d7 commit 338c10e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class MapsActivity : AppCompatActivity(), OnMapReadyCallback {

val lng:Double = json.get("lng").toString().toDouble()
val lat:Double = json.get("lat").toString().toDouble()
this.newLocation(lat, lng)
val totalTrackers: Int = json.get("total_trackers").toString().toInt()
this.newLocation(lat, lng, totalTrackers)

}
} catch (e: URISyntaxException) {
Expand All @@ -108,7 +109,7 @@ class MapsActivity : AppCompatActivity(), OnMapReadyCallback {
mSocket?.disconnect()
}

private fun newLocation (lat:Double, lng:Double) {
private fun newLocation (lat:Double, lng:Double, totalTrackers:Int) {
Log.e("MAP ACTIVITY", "onCreate: GOT LOCATION")

val location = LatLng(lat, lng)
Expand Down Expand Up @@ -140,6 +141,7 @@ class MapsActivity : AppCompatActivity(), OnMapReadyCallback {
longitudeTv.text = location.longitude.toString()
latitudeTv.text = location.latitude.toString()
lastUpdateTv.text = sdf.format(Date())
watcherTv.text = totalTrackers.toString()
}

}
Expand Down

0 comments on commit 338c10e

Please sign in to comment.