I am using ActionBar in my project. I want to change direction of ActionBar items means locate tab icons and logo in the right side of screen and locate menu items in the left side of screen. I googled but I didn't find any useful thing, aslo I read xml resource of theme and style in API 14 but again I didn't find any solution.
Action Bar now support right to left direction. It's introduced in the new API level 17 by
adding
android:supportsRtl attribute to the element in your
manifest file and set it “true"
have a look here for more information about managing the layouts from right to left RTL Layout Support
Related
I want to add two menu icon in action bar, but there's some extra space taken between them, and in this case, the app name not shown fully and also looking not good...
How can I omit these extra space around icons by setting padding or other way?
I have an app that has transparent actionBar and is using AppCompat support library. My problem is that I want to align my ActionBarTabs to the very left but there is some space left and I want to get rid of it. Also, how to properly align the icons with the rest ? Is that in the size of icons ?
Here is the screenshot of my app:
If you use a 24x24 icon you will be fine. Try go to here download any icons you want and use the icons with 24dp.png in filename and see how it looks.
how to make the bar in the top of the picture (see the link) (drawerbutton,"mes cercles",picture_pen)? by customizing the action bar or i make it manually?
https://drive.google.com/folderview?id=0B6Cz2zvfARSdOHJKSEppSzd6ZHM&usp=sharing
The ActionBar in that screenshot is custom-made. It is not built using Android's ActionBar controls. It appears that it was created using a RelativeLayout with a custom background, 1 button on each side and text in the middle of the layout. You can do this as well, however, it is considered best-practice to use Android's ActionBar, which can be themed partially. (Background, text color, buttons, logo, etc...)
Since Android's ActionBar is relatively new, you should use ActionBarSherlock, which adds compatibility to Android 2.x.
http://actionbarsherlock.com/
You can customize the actionbar in android to a very good extent , give it a solid / gradient background , customize the font face , add buttons , event give to different round corner values, also tabs are available , i suggest that method so you don't need plug-ins
the below two posts might be useful
android developers page / actionbar
Using the Android action bar (ActionBar) - Tutorial - Vogella
I have total 7 icons for my android app.
Can i split them for mobile in two actionbars top and bottom? I mean 2 icons in top actionbar and remaining icons should be in bottom actionbar.
The action bar can be automatically splitted if there is no place using the property splitActionBarWhenNarrow, example:
<application
android:uiOptions="splitActionBarWhenNarrow" > ....
Yes but you will have to do this in code, eg. instantiate the icons and add them to the correct actionbar view. There is no implementation logic for this available in the xml format as far as I know.
Is there a way to change the logo that appears in the ActionBar inside an Activity instead of listing it in the Manifest?
The reason I ask is I have an app for phones where I build a similar type of bar across the top with the launcher icon in the left corner similar to the ActionBar using an ImageView.
I also allow the user to change that image to one on their phone or on the internet. I am currently making the app work for tablets and would like to just use the ActionBar instead but can't figure out how to change the image based on the user. There is no method in the ActionBar class and I could not find a way to modify the icon or logo from the resources.
Anyone know if this is possible or could suggest something I could try?
Prior to the introduction in API 14 of the setIcon and setLogo methods that Jake mentions, you appear to be able to change the ActionBar logo by grabbing the view of android.R.id.home and setting a new drawable.
ImageView logo = (ImageView) findViewById(android.R.id.home);
logo.setImageDrawable(drawable);
API 14 introduced setIcon and setLogo methods.
As for 11 through 13 there's no easy way.
You could possibly use a custom navigation and hide the regular icon/logo by having your own layout mimic its functionality.
There is a homeLayout attribute in the action bar style which allows specifying an alternate layout resource to be used but it will always throw a ClassCastException since it is instantly cast to an internal class upon inflation (bug #21842).