Skip to content

Instantly share code, notes, and snippets.

@scottroemeschke
Last active January 9, 2018 01:08
Show Gist options
  • Save scottroemeschke/5ad4500db75f09b2d98353f290a0326d to your computer and use it in GitHub Desktop.
Save scottroemeschke/5ad4500db75f09b2d98353f290a0326d to your computer and use it in GitHub Desktop.
part of androiddev weekly questions help
interface UserLocationTracker {
fun getUserLocation(): String
}
class AndroidUserLocationTracker(val context: Context): UserLocationTracker {
@Override
fun getUserLocation(): String {
context.getUserLocationOrWhatever()
}
}
class MyPresenter(val locationTracker: UserLocationTracker) {
fun displayUserLocation(){
view.showLocation(locationTracker.getUserLocation())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment