Last active
January 9, 2018 01:08
-
-
Save scottroemeschke/5ad4500db75f09b2d98353f290a0326d to your computer and use it in GitHub Desktop.
part of androiddev weekly questions help
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
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