How to control when import is replaced by a template in Android Studio in Kotlin files

I noticed that for 4 imports from the same package, auto-import will just add the import to 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 5th import will cause auto-import to switch to a wildcard:

import android.support.v7.widget.*

Is there a way to save auto-import, but tell him not to do this, or change the threshold? I don't mind having a long import list, it feels ... familiar.

+4
source share
1 answer

You can set this in the “Kotlin Code Style” section in the settings:

Import

+7
source

Source: https://habr.com/ru/post/1686073/


All Articles