Ellen Spertus
08/13/2022, 1:37 AMOliver.O
08/13/2022, 9:23 AMMutableState
properties as a source of truth would ease understanding. That combination could provide a good basis for getting a glimpse on how attractive UIs are created today.Youssef Shoaib [MOD]
08/13/2022, 1:26 PMOliver.O
08/13/2022, 1:52 PMEllen Spertus
08/13/2022, 6:24 PMOliver.O
08/13/2022, 7:36 PMEllen Spertus
08/14/2022, 3:31 AMOliver.O
08/14/2022, 12:28 PMArkadii Ivanov
08/14/2022, 5:59 PMOliver.O
08/15/2022, 3:15 PMModifier.recomposeHighlighter()
on Row
, which will quickly color the entire board in yellow to red (source code).
An alternative would be a Board
comprising an array of cells, each cell having a mutable state, and then using a Cell
Composable enclosing the different cell types. Only the mutable state on the cell level would then change, allowing Compose to skip everything but the Cell
Composable.
Again, it's not necessarily a problem in this case, but when introducing UI concepts or showing examples to newbies, I'd start with habits that avoid common problems. In this case, pushing state reads down the tree as far as possible (also recommended in Compose best practices). When to short-cut such practices would be the topic of a later lesson.oletjens
08/16/2022, 2:03 PMOliver.O
08/16/2022, 3:44 PMYoussef Shoaib [MOD]
08/16/2022, 3:55 PMoletjens
08/16/2022, 4:26 PMOliver.O
08/16/2022, 4:48 PMoletjens
08/16/2022, 4:56 PMEllen Spertus
08/16/2022, 5:25 PM