How to import an automatically drawable in multiple dimensions in Android Studio?

0

How could I add a drawable image in multiple dimensions at once, already creating the high pixel density versions?

  • hdpi
  • xhdpi
  • xxhdpi
  • xxxhdpi

Would you have any way to expedite this task?

    
asked by anonymous 20.02.2018 / 21:08

1 answer

1

There is a very valuable plugin that really helps to streamline this task. It's called Android Drawable Importer .

Basically it does the same thing as Add an icon using Vector Asset in Android Studio for example, already creating support versions for devices of large screens, eg: xxhdpi or 2k.

Installation

To install, search for Android Drawable Importer in the plugins section in Android Studio preferences.

Any question, follow this StackOverflow post: link

How to use

Once installed, to use just do the following:

  • In the Project tab, click on the right side.
  • Go to New and choose Batch Drawable Import
  • Click on + and add a high resolution image (preferably above 4000px)
  • Under Source select xxxhdpi if your image is high resolution. Or select the criteria that it matches with.
  • After finishing making the settings, click OK and wait for Gradle to finish working.
  •     
    20.02.2018 / 21:08