kevinmost
06/17/2017, 1:42 PMfun bindString(@StringRes stringRes: Int) = object : ReadOnlyProperty<Context, String> {
private var cached: String? = null
override fun getValue(thisRef: Context, property: KProperty<*>): String
= cached ?: thisRef.getString(stringRes).also { cached = it }
}
val favorites by bindString(R.string.favorites)