Skip to content

Instantly share code, notes, and snippets.

@ReneeVandervelde
Created January 30, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ReneeVandervelde/edef5611119685247a4886512e97eb8d to your computer and use it in GitHub Desktop.
Save ReneeVandervelde/edef5611119685247a4886512e97eb8d to your computer and use it in GitHub Desktop.
Simple example of fetching info from an Android SDK class
class UserInfoFormatter(
private val resources: Resources
) {
fun getDisplayName(user: User) {
if (user.name.isNullOrEmpty()) {
return resources.getString(R.string.name_unknown)
} else {
return user.name
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment