I noticed that for up to 4 imports from the same package, auto-import will simply append the import in the list:
import android.support.v7.widget.AppCompatImageButton
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.Toolbar
But adding a 5th import will make auto-import switch to a wildcard:
import android.support.v7.widget.*
Is there a way to keep auto-import on but tell it to not do that, or change the threshold? I don't mind having a long list of imports, it feels... familiar.
You can set this under the Kotlin "Code Style" section in Preferences:
The Android Kotlin Style Guide says:
Wildcard imports (of any type) are not allowed.
You can set your Android Studio preferences to remove all wildcard imports from Kotlin files.
Editor > Code Style > Kotlin
Use single name import
for Top-level Symbols
Use single name import
for Java Statics and Enum Members
-
symbol until it says Nothing to show
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With