Kotlin: How can I let Android Studio implement int

2019-04-06 03:08发布

问题:

When implementing an interface in a Kotlin class:

When I press Alt+Enter on ClassName I can have the IDE add an interface's functions via 'implement members'.

It's kind of annoying that in Kotlin these functions are added at the top of the class. I would like them to be added at the end of the class (just like in Java).

How can I do that?

回答1:

Right now there is no possibility to control the order of the methods. Please watch the corresponding issue to get notified when this is implemented.



回答2:

On Android Studio 3.2: You can specify the desired location using the pointer, and use CTRL+I keymap. Then you need to choose the necessary methods, and Studio place them into your point position.