sdeleuze
02/26/2016, 10:21 AMvoddan
02/26/2016, 10:22 AMmplatvoet
02/26/2016, 10:23 AMnatpryce
02/26/2016, 10:24 AMnatpryce
02/26/2016, 10:25 AMarcnor
02/26/2016, 10:48 AMarcnor
02/26/2016, 10:49 AMreza.shah
02/26/2016, 11:42 AMclass Attachment(val name: String) {
val isValidName = name.toLowerCase().endsWith(“.jpg”)
}
But not with this:
class Attachment(val name: String) {
val isValidName by lazy { name.toLowerCase().endsWith(".jpg") }
}
mikehearn
02/26/2016, 11:45 AMegslava
02/26/2016, 11:46 AMegslava
02/26/2016, 11:46 AMegslava
02/26/2016, 11:47 AMcompanion object {
val inactiveColor by lazy { colorRes(R.color.asset_inactive) }
}
egslava
02/26/2016, 11:47 AMyole
02/26/2016, 11:49 AMegslava
02/26/2016, 11:50 AMegslava
02/26/2016, 11:50 AMyole
02/26/2016, 11:50 AMegslava
02/26/2016, 11:51 AMinactiveColor
in scope of View instance, variable inactiveColor
will be calculated in every view. But I want cache it as a some global value.arcnor
02/26/2016, 11:51 AMmikehearn
02/26/2016, 11:52 AMrafal
02/26/2016, 11:57 AMApplicationContext
and from it retrieve your resources. And feel free to ask android-related questions in #C0B8M7BUYegslava
02/26/2016, 11:59 AMegslava
02/26/2016, 12:01 PMegslava
02/26/2016, 12:02 PMrafal
02/26/2016, 12:02 PMby lazyColor {resId}
arcnor
02/26/2016, 12:04 PMmikehearn
02/26/2016, 12:04 PMmikehearn
02/26/2016, 12:05 PMarcnor
02/26/2016, 12:06 PMarcnor
02/26/2016, 12:06 PM