Android Asset Studio: Creating icons with an image does not work - android

Is anyone else having this problem? http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html When i try to use an image and i upload the image it just turns out to be a grey box. I have tried in all different browsers and still no luck.

You probably have one of two issues.
1) To verify if the image is getting processed, make sure you select 'Launcher Icons' from the main screen as a test. Other icons are not full color, they are Grey or black or white. For Example, the icons for the Action Bar are supposed to be Grey (depending on theme). See the action bar design guidelines. If you see your icon, but it is square instead of it's native 'shape' you have the second issue.
2) Use gif (or png) as your original and make sure you set the transparent color when you created it.

The tool works well for me in several browsers. I suggest you try a different browser, and make sure your bitmap isn't corrupt.

Related

Android icon doesn't fit

I've been experiencing an issue with creating an icon that fits in any size and shape. I use Studio to do it, but I must be doing something wrong, because there is a small padding in it.
I add my image asset as background layer with nothing in foreground layer.
I've tried to fix it by trimming it and using huge icon source 1920*1280.
When I changed to new theme it turned out that few other apps on my phone(other devs) have same poor icons.
Also tried this
Creating an icon using foreground layer totally solves this issue.

How to Remove white Background from icon?

I have an app on android that create home shortcut icon.
The image of the icon is image that i set programmatically from the drawable
Now the problem is, when the shortcut was created on the home screen it's created with white background.
How do i remove that white backgroubd and set image to full size of icon?
Thank you all..
EDIT: the app i was talking about is app that i developed using android studio and just want to set full size of image when i create home shortcut
This is highly dependent on the launcher you use. The image looks like the standard google android 8+ (?) icon shape.
I theory it could be part of the icon you created but since you are asking this I doubt it.
In older versions of android the outer shape of the icons were individual, while rather cool and the outline correctly shown while dragging them etc many complained about the lack of a uniform look of all the icons in the app drawer etc.
It was introduced to make all icons seem more uniform.
Long pressing an empty space in the Google Pixel launcher for example shows a choice to go into the settings for the launcher and there you can change the shape all icons should have:
In addition to this, apps can take advantage of the various shapes and adapt to them and fill them out so to speak. See for example the Chrome icon while changing the icon shapes in the launcher settings.
Introduced in android 8: The feature is called adaptive icons.
See the docs about adaptive icons here:
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
That is because of adaptive icons - a feature of Android 8 and can't or shouldn't be changed. You can at best change the colour of the background.
i removed the white background from the launcher icon by following these guidelines https://developer.android.com/studio/write/image-asset-studio
a few more points
in the background layer, move the slider to resize the icon until you see no what would have been the white background.
in the manifest file, change the icons to reference the mipmap folder;
android:icon="#mipmap/yourlogo"
android:roundIcon="#mipmap/yourlogo"

Transparent image with shadow on android screen

I created a transparent image using gimp, and used it as Android apk icon. But when I installed the apk on my Galaxy S3, there is a shadow when display the icon on my screen. Since I can't post image as a new user, I posted the image at:
http://www.guangnaqu.com/P1030055.JPG
Please noticed that other apks' icons are ok. Also the icon displayed ok on Android emulator.
Please let me know how to fix this.
Thanks.
It might be TouchWiz causing the problem.
I had a similar issue in a previous form of TouchWiz where it would make an entirely new color background of its choosing.
1.Edit it with GIMP http://www.gimp.org/ for an invisible background. just throwing out options JIC it is the image editor
2.Try to give the background something like a 0.05% Shader background setting that cannot be distinguished by the phone screen, but is seen by the UI.

working with android 9 patch file not working

I have been trying to change the color of the gray that surrounds my custom tabs, I have tried looking for the answer on YouTube:
http://www.youtube.com/watch?v=IfrXE2R2nqM
http://www.youtube.com/watch?v=XMWlRXfKgtY
This helped me understand the process of 9-patch files but I must be doing something wrong for this not to work.
What I have tried doing so far:
In my project I see in the "Package Explorer" I see Android 4.1, which is in ...android-sdk/platforms/android-16. I opened that with winrar, went into res/drawable-mdpi and just to see if anything would change I replaced "tab_selected.9.png" and "tab_selected_v4.9.png" with the image of "tab_pressed.9.png". I then tried to compile my project just to see the same gray for the background of my tab buttons.
The current android project I am working on I placed the changed "tab_selected.9.png" and "tab_selected_v4.9.png" inside of my drawables folder and tried running it just to see the same thing.
Does anyone know what I am doing wrong, am I not compiling something or do I need to mess with different .9.png files? Or does anyone have a simple process just to change the gray color of these tabs? I guess the quick answer for me here is what would I have to do to get the image of "tab_pressed.9.png" to replace "tab_selected.9.png"
EDIT:
tab_selected.9.png
tab_pressed.9.png
Make sure the only pixels in the border are the 9-patch ones, either black (#f000 in ARGB) or fully transparent (#0000).
It's a normal to left some pixels with some transparency on those pixels that gets unnoticed at simple view.
This is a little tricky. Sometimes the stuff like the grey can creep in from the underlying Android layer. Sometimes things like tabhost have views that have to be overridden. I remember having to maek a selector drawable in XML to get the tabhost to work with custom items.

Detecting the background color of the option menu

I have realized that there are at least two background colors on Option menu of Android. On the HTC Hero, the background is white and on Samsung Galaxy S II, the background is black.
This became a problem when I set the icons for the background menus. Is there some way to detect the background color of the Option menus in Android?
Possible solutions:
Don't use icons.
Design icons according to the guidelines - http://developer.android.com/guide/practices/ui_guidelines/icon_design_menu.html. There are three different guidelines for up to 2.2 (white background), 2.3 (black background) and 3.0+, so it's a lot of work...
As Profete162 suggested, use #android:drawable/ic_menu_*
For Android 4.0+, you can also set the light / dark Holo theme, which is guaranteed (at least in theory) to remain unchanged across different phone manufacturers - so it'll look the same in HTC Sense, Samsung TouchWiz etc.
That's indeed a very annoying issue.
On my implementation, I always try to use standards icons from android.R.drawable.IC_menu_*, so I am sure these icons are part of the framework and users are always positively surprised to see their generic icons in my app!
That gives a really good continuity in the user experience on the device, but that doesn't answer your question, but at least provide a workaround.
Here are for instance all android 2.2 icons: http://androiddrawableexplorer.appspot.com/
You can trust me, using these icons will always fit your colors.
First of all to answer your title question:
You can reference and read the background of the options menu by reading the attributes of the current theme. The attribute for this is panelFullBackground. E.g. set it as the background of a textview in XML¹:
<TextView android:background="?android:attr/panelFullBackground"
... />
Note that the background seems to be a solid color, but it's not - it's actually a bitmap. If you look closely you can see a grey border at the top (android 2.3+), or a drop shadow (<= android 2.2), so its'a bit difficult. Luckily there is a different attribute called panelColorBackground which matches the background color of the drawable as close as possible. So if you want just the normal background color, use this instead.
¹ This can surely also be read from code, but I don't know how from the top of my head at the moment, maybe I'll look it up and edit it in later.
Regarding icons
So you have the color as stated above, but you still have to process it to know if it's a dark or a bright color. You can do that, but that's not the usual way to deal with these icons and probably a good bit of work until you cover all the possible cases - not to mention that you have to create icons for each variant.
Normally you should adopt the platform menu icon style. This works across all devices and looks familiar to your users (custom icons that dont follow this often look "wrong" - e.g. astro file manager does this I believe).
You can do that by hand (see the guidelines), but the way better alternative is the Android Asset Studio.
It comes in two flavors:
As a webapp
Integrated in the latest version of the ADT plugin for eclipse
(under File->New->Other->Android Icon Set)
The workflow for both is pretty similar, select the point "Menu Icon" and follow the wizard. It will promt you to enter a simple, black and white bitmap of your desired icon that just outlines it's shape. After you specified one, the asset studio will generate everything for you. Play a bit around with the "clipart" option, that has a few example bitmaps ready to see how it works. When finished, the webapp gives you a simple zip which can be extracted into your project directory, the eclipse version adds it directly to the project that you select in the wizard.
The background color can be anything, because its implemented in Framework by manufacturer. You can't read it, in fact you will never need to read it.
Just create your custom menu layout in res/menu folder, set style and use it.

Categories

Resources