Colton Idle
01/24/2021, 6:29 PMResources
into a composable as a parameter?
👍 or 👎Adam Powell
01/24/2021, 6:31 PMColton Idle
01/24/2021, 6:34 PMbitmap = imageFromResource(resources, R.drawable.image1)
Which is weird since the same composable also has Text() with text = stringResource(id = R.string.mystring)
So really only images require a ResourceAdam Powell
01/24/2021, 6:55 PMResources
object I wouldn't bother over just doing AmbientContext.current.resources
where you need it. The benefits you'd usually get from making it a parameter can't really materialize since both Context and Resources objects in Android are so weird and tied to requirements that the system gives you one and you can't meaningfully construct your own to alter behavior like other dependenciesAdam Powell
01/24/2021, 6:56 PMAdam Powell
01/24/2021, 6:58 PMcontext.obtainStyledAttributes
calls that views perform at construction. The batch operations have less overheadAdam Powell
01/24/2021, 6:59 PMAdam Powell
01/24/2021, 7:00 PMAdam Powell
01/24/2021, 7:03 PMColton Idle
01/24/2021, 7:05 PMIf that's just the android frameworkYep. It's just the android framework Resourcesobject I wouldn't bother over just doingResources
Colton Idle
01/24/2021, 7:09 PMalorma
01/24/2021, 7:19 PMColton Idle
01/24/2021, 7:23 PM