9

I'm trying to add a custom view where I'm able to receive the path of the class by an attribute and create it in runtime and I want it to work like the app:layoutManager in RecyclerView, if you try to add the path of your class, Android Studio shows the autocomplete and even the . works.. How??

android studio autocomplete

It's not a question about adding attributes, I already had a look the RecyclerView code and it is receiving a string and then, the string is used to create the instance in runtime.

enter image description here

enter image description here

I would be really thankful if someone can help me with this.

jmarkstar
  • 1,335
  • 14
  • 21
  • My best guess is that this feature is tied into the IDE itself. But I don't have any source for this guess. – João Paulo Sena Mar 31 '21 at 11:32
  • I didn't find the solution but take a look on this https://stackoverflow.com/a/31207367/5422725 discussion and other answers. I think @Joao is right. This feature is tied with IDE. – Eugene Troyanskii Apr 01 '21 at 15:38

1 Answers1

0
  • I think it depends on the IDE and the best answer that i can give you is that it searches throw the children of the top class.
  • For example androidx is the top class so it will search throw it's children, then recyclerview and it will go throw it like this.
  • I'm not sure but i think it's using some kind of decision tree algorithm and you can see here for more information.
danial iranpour
  • 282
  • 1
  • 2
  • 11