How to make Circular Logo in Action Bar? - android

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)

Related

actionbar up button, extend click area when no title or icon

My actionbar does not use an icon or a title, this makes the click area of the "up" button very small. How can I have a larger click area without a title and icon in the actionbar?
You can put an image where the app icon would be. Just make a transparent image to the width and height for each drawable size you need and put it in the drawable folder, call the image logo (#drawable/logo). You then need to tell the activity to use the logo, it's not hard and these links should help.
http://developer.android.com/guide/topics/ui/actionbar.html
http://developer.android.com/guide/topics/manifest/application-element.html#logo
One way to do it would be to set a custom icon for the "up" button in your app theme as so:
<item name="android:homeAsUpIndicator">#drawable/your_drawable</item>

Android: Homescreen Icons different than Menu Icons

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.

Styling Android ActionBar

The image will explain everything i need ;)
I'm looking for the exactly same style ( with the thin line also that is near to their logo) (keep in mind i have the logo drawable file )
UPDATE
Now i'm getting exactly what i want but i have one bug yet.
How to remove the arrow highilited in red? keep in mind i'm extending Sliding Menu
Have you tried getActionBar().setLogo( R.drawable.logo );
you can use getActionbar().setDisplayUseLogoEnabled(false); to remove the icon from the actionbar and then getActionBar().setDisplayShowHomeEnabled(true) to enable the arrow but the image you show looks like they created an image with an arrow and replaces the icon with that arrow image.
so in other words you would use this
getActionBar().setIcon();

ActionBar Sherlock Progress Bar in Icon space

I am using an Action bar in my project. I am displaying a progress bar via the below approach.
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
However, what I'd really like to do is replace the left most image icon with the progress indicator when arbitrary background processes run and then returns the usual icon when complete.
Can anyone tell me the steps needed to replace this icon with a functional Progress indicator. It only needs to be an intermediate one.
Looks like you can find some suggestions here: Android: dynamically change ActionBar icon?.
Specifically, you can access the icon by using
Activity.findViewById(android.R.id.home)
And then just set and re-set the icon as needed.
You need to build a custom layout for this and use actionbar.setCustomView(yourcustomlayout);
In your custom layout have an imageView(which is your app icon) and progress bar(initially which is set to invisible).
When running the background process just set the visibility between image view and progress bar.

ActionbarSherlock want to insert an image inbetween icon and Tabs

I have a tablet layout using ABS.
The Home (app) icon is displayed and my 4 tabs are shown to the right of it.
I'd like to insert an image (for advertising) inbetween the icon and tabs.
Does anybody know if it can be done?
Thanks in advance.
You can't insert an image between the icon and the tabs, but you could:
A. Use a logo drawable which has the icon and ad in it -- then add this by setting the android:logo attribute on your application or activity to your logo drawable.
or
B. Use a custom view and set this on the ActionBar with setCustomView(View view).

Categories

Resources