Last active
May 11, 2019 07:19
-
-
Save amanjeetsingh150/48b07f8915d604844ec499d530139755 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
JourneyEventBus.getInstance().getOnJourneyEvent() | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Consumer<Object>() { | |
@Override | |
public void accept(Object o) throws Exception { | |
if (o instanceof BeginJourneyEvent) { | |
Snackbar.make(linearLayout, "Journey has started", | |
Snackbar.LENGTH_SHORT).show(); | |
} else if (o instanceof EndJourneyEvent) { | |
Snackbar.make(linearLayout, "Journey has ended", | |
Snackbar.LENGTH_SHORT).show(); | |
} else if (o instanceof CurrentJourneyEvent) { | |
/* | |
* This can be used to receive the current location update of the car | |
*/ | |
//Log.d(TAG,"Current "+((CurrentJourneyEvent) o).getCurrentLatLng()); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment