Created
January 30, 2019 17:34
-
-
Save ReneeVandervelde/edef5611119685247a4886512e97eb8d to your computer and use it in GitHub Desktop.
Simple example of fetching info from an Android SDK class
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
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