Android: Homescreen Icons different than Menu Icons - android

Is it possible in Android to declare a HomescreenIcon for the user e.g. colored and inside the application the same Icon shown in the Action Bar just white?
In my case these are two different images i want to show. I defined the icon inside the AndroidManifest.xml but i can not find any option to change it for the ActionBar. It is always the same.

Yes, you can use android:logo in your manifest to provide the action bar image and android:icon to provide home screen icon. Both of them should be set to a drawable resource and can point to a different resources.

Related

How save image and set as application icon? android

I take image from gallery of camera. How i can set the image as Application icon?
I wanted write image to res/drawable as name "ic_launcher", but it is not possible.
How i can set the image as Application icon?
You cannot do any of the following at runtime:
Modify the icon used for your entry in the home screen launcher
Modify the icon used for your app in the Settings screen (e.g., list of installed apps)
Modify the icon used by default for the icon in an activity's action bar
You can, however, do the following at runtime:
Call setIcon() on the ActionBar to change the icon used in an activity's action bar
Show a different icon (or other image) in an app widget served by your app
Use a different icon for a shortcut that you attempt to add to the home screen via ACTION_CREATE_SHORTCUT
You can make multiple resolutions of the image for different screen densities. See android iconography style guide for details.
To use that icon go to AndroidManifest.xml and inside application tag use following property:
android:icon="#drawable/name_of_your_icon_file_without_extension"
Few points to note:
Use same file name for all screen densities. (e.g. ic_icon.png in all folders drawable-ldpi, drawable-mdpi, drawable-hdpi etc.)
Use transparent backgrounds for the icons
Hope this helps!

How to use a different icon for action bar

I made an icon for my Android app but I want to use a different file for the action bar. So on icon for app section, and one icon for action bar. How can I do that ?
From official documentation:
By default, the system uses your application icon in the action bar,
as specified by the icon attribute in the or
element. However, if you also specify the logo attribute, then the
action bar uses the logo image instead of the icon.
http://developer.android.com/guide/topics/ui/actionbar.html#Logo

How to make Circular Logo in Action Bar?

My requirement is to make Circular Icon to ActionBar. I used custom view to display circular image(you can see in the screenshot.) I want to use Home icon(In this case, green android icon) as a circular image. How can I make Home icon as a Circular Image??
Note: In my case I'm downloading images from Server and setting it to ActionBar using setLogo() or setIcon() method.
Make the image default logo of your application.
Change it in the manifest file or the drawable folder.
Action bar logo is mostly your application logo by default. So either Change your application logo to circular or whatever. If you want to change the app icon (logo). Use setLogo(int) or setLogo(Drawable) method of ActionBar. Don't forget to call setDisplayUseLogoEnabled(true)

Changing the menu icon-color/icon in Android Easy Share Action

I am trying to implement Easy Share Action for my Android application as describe in here. I was able to complete it successfully. But I need to change the Sharing Menu Item icon color or even icon. According to the given document we don't provide any icon in drawable folders.
You can download the Action Bar Icon Pack from here, locate the sharing icon you want whether holo light or dark.
For instance if you use holo light, the share icon is located in \Action Bar Icons\holo_light\01_core_share.
Should be easy to change the color of the drawables and copy to /res folder of your project.

How to Replace Icon and title with a png logo

By default the native ActionBar show app name with app icon on the left. I want to replace all this section
with a custom logo
searching seems that I have to edit the styles.xml file to customize the action bar, but I haven't understood what is the right way and what resolution should have the logo.
"By default, the system uses your application icon in the action bar, as specified by the icon attribute in the <application> or <activity> element. However, if you also specify the logo attribute, then the action bar uses the logo image instead of the icon."
source: http://developer.android.com/guide/topics/ui/actionbar.html
In order to remove the Title of the Activity you call ActionBar.setDisplayShowTitleEnabled(false);

Categories

Resources