@sjudd Hey, I believe you're one of the maintainers of Glide. Is it a planned feature? Does Glide's team want help from the community on this? Jetpack Compose is going to stable soon, I believe later this month or next month
Nobody works on Picasso. If you want something in the next N years definitely use Coil. Or Glide. Or whatever. They're all fine.
Image loading is a terrible, horrible business to be in. It's been really nice not being in that business for the last few years. I don't see a reason to resume. I certainly have no intent to support it anymore. Picasso accomplished its goal of moving the ecosystem out of the painful image loaders of 2011/2012 to the fluent and extensible ones we know today. But it's filled with technical debt and the legacy of poor design (at least, in hindsight) and is currently very, very stuck between a major refactor and redesign with no end in sight.
The Compose Compiler plugin can generate reports / metrics around certain compose-specific concepts that can be useful to understand what is happening with some of your compose code at a fine-grained level.
// val onClickB = { viewModel.incState() }
// val onClickC = { viewModel.incStateFlow() }
val onClickB = remember { { viewModel.incState() } }
val onClickC = remember { { viewModel.incStateFlow() } }
とすべて remember 扱いにします。
イメージしていたログ出力になりました。
■ 「::」を使う
こんな記述はどう? というので書き換えてみます。
// val onClickB = { viewModel.incState() }
// val onClickC = { viewModel.incStateFlow() }
// val onClickB = remember { { viewModel.incState() } }
// val onClickC = remember { { viewModel.incStateFlow() } }
val onClickB = viewModel::incState
val onClickC = viewModel::incStateFlow
これもイメージしていたログ出力になりました。
少し驚きました。
■ State 取得部分はどうなの?
Screen 自体が recompose されてるのなら、こうしたほうがいいのでは?
// val countB by viewModel.countState
// val countC by viewModel.countStateFlow.collectAsStateWithLifecycle()
val countB by remember { viewModel.countState }
val countC by remember { viewModel.countStateFlow }.collectAsStateWithLifecycle()