At some point in an Android project you will need to import some drawables - be it toolbar icons, images, UI features - in res/drawable
directory. Most of the times you have images scaled for the most common qualifiers (drawable-hdpi
, drawable-mdpi
, drawable-xdpi
, drawable-xxdpi
, ...).
So we need to do three, four, even five file copy/pastes for each drawable:
external_dir/drawable-mdpi/file.png -> my_package/drawable-mdpi/file.png external_dir/drawable-hdpi/file.png -> my_package/drawable-hdpi/file.png external_dir/drawable-xdpi/file.png -> my_package/drawable-xdpi/file.png external_dir/drawable-xxdpi/file.png -> my_package/drawable-xxdpi/file.png
That is annoying if you have to import multiple pics. Is there an easy, quick way to transfer these four instances of file.png
right in the corresponding package folder? Some function implemented in the IDE? Some easy workaround?
My workflow until now has been:
external_dir
, search for file.png
, get the four instances in a single list, drag&drop into Android Studio, then for each pic right click on the nav bar, Copy
, and Paste
in the corresponding package directory. Not really better!Any advice?
Edit - I'm not really asking for "advices" of course - I want to know if there's a way to drop the number of moves to one (or such).
Drag and drop your images directly onto the Resource Manager window in Android Studio. Alternatively, you can click the plus icon (+), choose Import Drawables, as shown in figure 3, and then select the files and folders that you want to import. Figure 3: Select Import Drawables from the dropdown menu.
Check android-drawable-importer-intellij-plugin
This became a lot easier since Android Studio 3.4. Simply go to the Resource Manager
-tab and click the little add-button add resources to the module
. [
Then select the drawables you would like to import. If you placed the drawables in folders with the same name like the qualifiers (drawable-mdpi, drawable-hdpi. drawable-xhdpi and so on), the tool will automatically know were to add them.
The only thing still missing in my opinion is adding the drawables to a certain flavorDimension.
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