4

I'm trying to simply import an image into android studio, but the only way it works right is if you select it as a launcher icon, which you can't use within the app.

Here's a screenshot of my issue:

one

slinden77
  • 3,378
  • 2
  • 37
  • 35
user2322082
  • 658
  • 1
  • 6
  • 18

2 Answers2

2

You can do it with this tool:

https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html#foreground.space.trim=1&foreground.space.pad=0&foreColor=607d8b%2C0&crop=0&backgroundShape=square&backColor=ffffff%2C100&effects=none

You also can use a plugin and do it inside Android Studio. Here there is an explanation:

How to import set of icons into Android Studio project

EDITED:

To set the background to transparent you just have to select shape none in this tool I mentioned. With the image asset you are using you don't have this option.

Community
  • 1
  • 1
mlg
  • 5,248
  • 1
  • 14
  • 17
  • I was able to solve my issue by using this tool, downloading this zip, and manually dragging the files into the relevant drawable folders in my project – user2322082 Jun 13 '16 at 17:40
  • I think I was trying to do this because i thought drawableLeft had to be in the drawable folder, but iirc I found out it doesn't have to be, and you can just add your image as a launcher icon and reference it in xml with @mipmap/***** – user2322082 Jun 24 '16 at 13:16
0

Not really sure what your problem seems to be, however PNG assets are alpha enabled, you should be able to import your image with transparent background with no problems.

Why don't you try intelliJ's Android Drawable Importer Plugin. With it you are able to select the asset, specify your color (if you want to), change the target resource name and select all the resolutions you want to import. It also has a Batch Drawable Import functionality that helps simplify repetitive import tasks.

Rogério Peixoto
  • 2,176
  • 2
  • 23
  • 31
  • While yes, importing an image asset is alpha enabled, it's not capable of more than 1 color, which is what I need. See the image i linked. – user2322082 Jun 14 '16 at 14:30