is there any option in Android Studio from which, ...
# android
p
is there any option in Android Studio from which, we can customize the default imports ,so we don't have to add the kotlin synthetic library again and again in every activity file.
m
If by "default imports", you mean you want the Kotlin synthetic properties to be on par with
String
and not require an
import
, Android Studio has nothing to do with it. The
import
rules are from the Kotlin compiler.
p
No, I didn't mean it.
I wanted to know that there are always by default imports in the Android studio when we create new activity. So, we don
SO, we don't have to import some libraries every time, that we will sure that we need in every file.
m
The contents of the activity class file that you create from the new-activity wizard come from your chosen template. AFAIK, there is no documented way to change those templates, let alone have those changes survive Studio updates.
p
yeah sure
Google is updating a lot
🤣
a
The docs are here: https://www.jetbrains.com/help/idea/using-file-and-code-templates.html As I see, there is a default template for an Android Activity in the "other" section, but only for Java. You're welcome to submit a feature request to Google to add similar Kotlin templates: http://issuetracker.google.com/.
m
That is for an unrelated concept of "templates" that Studio inherits from IDEA. The templates associated with the new-activity and new-project wizards are separate and are not covered by that documentation. Thanks, though!
🙏 1
p
Thanks you so much.