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

Asked

Viewed 603 times

1

How could I add an image (drawable) in several dimensions at once, already creating high pixel density versions?

  • hdpi
  • xhdpi
  • xxhdpi
  • xxxhdpi

Would have some way to expedite this task?

  • 1

    For those who upgraded Android Studio to version 3.6.1 may have caused some conflict. I suggest downloading and installing the plugin: https://github.com/Vincent-Loi/android-drawable-importer-intellij-plugin

1 answer

2


There is a very valuable plugin that really helps speed up this task. It is 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 large screen devices, for example: xxhdpi or 2k.

Installation

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

Any questions, follow this post from Stackoverflow: /a/277662/94862

How To Use

Once installed, to use just do the following:

  1. In the Project tab, click on the right side.
  2. Go to New and choose Batch Drawable Import
  3. Click on + and add a high resolution image (preferably above 4000px)
  4. Under Source select xxxhdpi if your image is high resolution. Or select the criteria that it matches.
  5. After you finish making the settings, click OK and wait for Gradle to finish working.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.