Last active
May 11, 2019 07:19
-
-
Save amanjeetsingh150/df98c5125f997b37d1368da7ca0a1698 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Begin of the journey when index of LatLng in list will be 0. | |
**/ | |
if (index == 0) { | |
BeginJourneyEvent beginJourneyEvent = new BeginJourneyEvent(); | |
beginJourneyEvent.setBeginLatLng(startPosition); | |
JourneyEventBus.getInstance().setOnJourneyBegin(beginJourneyEvent); | |
} | |
/** | |
End of the journey when index of LatLng in list will be last that is size()-1. | |
**/ | |
if (index == polyLineList.size() - 1) { | |
EndJourneyEvent endJourneyEvent = new EndJourneyEvent(); | |
endJourneyEvent.setEndJourneyLatLng( | |
new LatLng(polyLineList.get(index).latitude, | |
polyLineList.get(index).longitude)); | |
JourneyEventBus.getInstance().setOnJourneyEnd(endJourneyEvent); | |
} | |
/** | |
In CallBack of ValueAnimator we can get current location as | |
**/ | |
CurrentJourneyEvent currentJourneyEvent = new CurrentJourneyEvent(); | |
currentJourneyEvent.setCurrentLatLng(newPos); | |
JourneyEventBus.getInstance().setOnJourneyUpdate(currentJourneyEvent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment