Closed fivetran-tangyetong closed 2 years ago
Yeah this is awesome! Just having the content there is already a big win, plus the fact that it's all handled in one file is just so much better than my previous 8-file version.
A few ideas:
enum class Tutorial(val id: String) {
T0("0")
T1("1")
// ...
}
This would enable the removal of the else
clause at the end of the when
statement.
FYI the keyword I try to use for new features in the commit message is Feat
. So far I haven't used formal tools to search the codebase or triage commits and whatnot, but if ever we do it will be helpful to have all the same tags spelled the same.
Added the enum and relevant code, though I think I could use some feedback on the way I went about it.
Ok so my initial idea wasn't so good because I had not internalized that you really only pass strings to the navigation in Compose (I initially pictured just passing the enum for tutorials, which would have been so much simpler).
Here is an idea: make the TutorialsScreen
take the Tutorial
enum, and reconstruct that enum on the navigation side, before providing it as an argument to the Screen. See my commit for an implementation idea.
Adding the individual tutorial content to the screens. I have hard-coded retrieving the content for each of the screens, since I'm not sure if theres a better, more scalable way to handle this.
The title and headers are centered, and the paragraphs are aligned left.