John Dior
09/08/2023, 4:15 AMromainguy
09/08/2023, 4:22 AMromainguy
09/08/2023, 4:24 AMcurioustechizen
09/08/2023, 4:31 AMPablichjenkov
09/08/2023, 4:32 AMorientation
property defined in a FrameLayout, when it really is just meant to the LinearLayout. Compose gives you that kind of protectionJohn Dior
09/08/2023, 4:46 AMromainguy
09/08/2023, 4:47 AMromainguy
09/08/2023, 4:47 AMJohn Dior
09/08/2023, 4:48 AMromainguy
09/08/2023, 4:50 AMromainguy
09/08/2023, 4:51 AMJohn Dior
09/08/2023, 4:53 AMromainguy
09/08/2023, 4:55 AMromainguy
09/08/2023, 4:56 AMJohn Dior
09/08/2023, 5:01 AMascii
09/08/2023, 7:43 AMascii
09/08/2023, 7:45 AMHrodrick
09/08/2023, 12:40 PMsongAddition
is declared within the render
method, why do you expect it to be available in the renderTextField
method? That is not possible even in OOP.
3. Continuing from that, you are violating one of the principles of compose, which is state hoisting. It means you should leverage onStateChange listeners to the top place where your uiState is declared. Usually it will be in the ViewModel, which you will inject into a Composable root function.
4. To solve the problem with the align, you have two options:
a. Declare the renderTextField
function as an extension: ColumnScope.renderTextField
which will allow you to use align but you will only be able to call the function within a ColumnScope.
b. Directly receive a Modifier as the first parameter and set the align from the render
function when you call renderTextField
. This is the recommended way as it allows for easier reusability and customization
Good luck, let. me know if you have any questionJohn Dior
09/08/2023, 3:48 PMromainguy
09/08/2023, 3:56 PMPablichjenkov
09/08/2023, 4:03 PMinheritance
not all oop principles.Hrodrick
09/08/2023, 4:05 PMJohn Dior
09/08/2023, 4:06 PM