How are useful searches by a class name? Now with ...
# android
i
How are useful searches by a class name? Now with Android composable, the problem is even worse. The framework forces you to create methods with a capital letter in a stand-alone file.
d
In Ide search by Symbols for composables or simply use "all" tab where you got all types of searches. I mean the "double shift" search popup.
e
isn't symbol search bound to ⌘O or ^N or something easy-to-reach like that by default?
a
They don't have to be in a standalone file and you can make classes as composables as long as you call a method that is a composable of it: SomeComponentClass().Render() (or another name for the method annotated with @Composable
👍 1
Though idk if I recommend doing it
You could also make that method an invoke operator method with parameters and it'll look just like a regular composable 🤷
z
Compose definitely doesn't force you to organize your code in any particular way. It makes some recommendations but those aren't enforced.
i
Oh @agrosner, what a small world. Yeah, the class wrapper is actually how I work surround this today. Also, I would advise against creating new instances inside your composable methods. Your rendering profiler would not like that 🙃
😂 1
@Zach Klippenstein (he/him) [MOD] they are if your a warnning phobic like I am, lol. I can't stand to see methods with a capital letter.
z
how do you create new objects then? 😛
I thought Android Studio disabled that warning for composable methods, at least it did at some point – did that regress?
a
no the warning isnt there on mine
2020.3.1 Artic Fox
not sure what hes seeing