Android Action bar direction RTL - android

I try what simon tell to do for change direction but it's doesn't working.
It's seems that for hundredth of a second it's work but when Action bar add the action buttons it's put the buttons at left instead at right.
What can be the problem? it's seems that somewhere in nmy code had line that tell freamwork to do otherwise?

The RTL value (true or false) is included in the flags in getApplicationInfo.flags.
As a long shot - is it possible that you are somehow changing the value?

The ability to set RTL was added in Android 4.2 if you are supporting this OS level or higher, this will be easier for you to accomplish.
Proof it is 4.2+: https://groups.google.com/forum/#!topic/actionbarsherlock/-npidM2Eo0w
Google post outlining how to change to RTL: https://plus.google.com/+AndroidDevelopers/posts/HuHNSb8V7s8
Otherwise, I would reference the SO question already pointed to in another comment if you are supporting an OS level older than 4.2: How to handle RTL languages on pre 4.2 versions of Android?

Related

AIR for Android: toggle SYSTEM_UI_FLAG_HIDE_NAVIGATION

I want to toggle SYSTEM_UI_FLAG_HIDE_NAVIGATION or SYSTEM_UI_FLAG_LOW_PROFILE flag when compiling with AIR for ANDROID, but I don't know how to to this. Probably I had to modify the name_of_app.xml ...
I want to 'try' to switch off the menu bar in an Android Tablet, but every methods I try are a mess ....
Any Help ??
Massimo
If you want to remove the statusbar (the bar at the top), you need to go fullscreen. You can do this either in your app.xml by setting <fullscreen>true</fullscreen> or in your app at runtime by setting stage.displayState = StageDisplayState.FULL_SCREEN;
If you are trying to hide the menubar (the soft-navigation present at the bottom of Nexus devices and a limited number of other Android devices), this will set those buttons to be in their minified state as well (they are not hidden, but are set to a simple glowing circle rather than the icon). I do not know if it is possible through AIR to hide the menubar completely. It should be possible using an AIR Native Extension, assuming it is possible at all, but that may (likely is) more trouble than it is worth for such a simple task.
For future reference, you can't set most Android flags through AIR. It simply is not supported. You can set uses-permission and uses-feature in your app.xml as Manifest additions, but that is it.

Android - Action bar at top and tabs at bottom of the page

I am a novice Android developer. I have just started learning Android programming. I want to know whether it is possible to add Action Bar with Action Icons at top of the page and Tabs at bottom of the page! If so someone please guide me how to implement a code for it!
Thanks in advance,
UDAY
AFAIK, you can add action buttons on the bottom, only if there is no room at the top, however to do this, you should activate "split" option of your action bar in activity:
To enable split action bar when using the support library, you must do two things:
Add uiOptions="splitActionBarWhenNarrow" to each <activity> element or to the element. This attribute is understood only by API level 14 and higher (it is ignored by older versions).
To support older versions, add a <meta-data> element as a child of each element that declares the same value for "android.support.UI_OPTIONS"
This is quote from official docs, I recommend you to read more on http://developer.android.com/guide/topics/ui/actionbar.html
By the way, if you want to support older versions of android sdk (less than 3) use ActionBarSherlock it is third-party lib, but it has very similar ip to official actionbar and supports any version of android sdk. To learn more about it visit actionBarSherlock Home Page
To answer your question: Yes
Read android documentation about Actionbars
http://developer.android.com/guide/topics/ui/actionbar.html
And you see there is something called Bottom bars.
They should not be used for navigation tho as you can read on at
http://developer.android.com/design/patterns/pure-android.html

Stacked ActionBar tab bar not filling parent

I'm creating Action Bar navigation tabs, but when the Action Bar is stacked the tabs are not getting the whole width space. I have a foto to illustrate it.
Is possible, in this case, giving to each tab 50% of the screen width?
Thank you
I'm editing to say that it's not a Sherlock Action Bar. And I'm working in a Samsung Galaxy Note 10.1 and in a Nexus 7. And now, testing it in the Nexus, I noticed that it's behaviour is different. Another screenshot:
I don't think that's feasible at the moment. I've been trying to do the same thing for the past few days, and here's what I have found so far.
The Android framework uses a class called ActionBarPolicy to set some rules regarding the ActionBar's behavior.
In this file (which can be found here : https://github.com/android/platform_frameworks_base/blob/master/core/java/com/android/internal/view/ActionBarPolicy.java), you'll find a method called getStackedTabMaxWidth() which returns a dimen value (currently set in the ressources at 160dip).
This value is used is the inner class TabView placed in ScrollingTabContainerView (https://github.com/android/platform_frameworks_base/blob/master/core/java/com/android/internal/widget/ScrollingTabContainerView.java). TabView is the private implementation of the ActionBar's TabBar.
Now I don't think this value nor this behavior can be modified, except maybe using Reflection. I don't know enough about it to do so, so if someone could manage such a thing, don't hesitate to say so, because this really is a bad behavior which doesn't look great on some tablets.
Android stacked action bar tabs do not have adjustable widths.
"Stacked action bar tabs now have a width limit. This prevents super-wide tabs that can span the whole screen. The cluster of tabs is centered if it does not span the full width. " https://android.googlesource.com/platform/frameworks/base/+/b8139af3dcae80c0030afd0354dc424a7c72c3d9
The solution is to use the TabLayout API from the Android Design Support Library released with Android 5.0. The Android Support library requires the appcompat library, but that dependency is resolved for you if you build using gradle.
For most developers, this will not be an issue, but the TabLayout setup requries at least SDK API level 22, because the appcompat dependency is compiled against 22. However, TabLayout does not have a runtime dependency on 22, meaning you can run it on devices up to API level 7.
tl;r - Use Tablayout from Android Design Library. Requires API level 22 on developer, but can run on older phones up to v7.

Custom Title Bar Similar to this one

I want to create a custom title bar, somewhat like this, in my Android app. Please pardon if my question seems idiotic, I'm a beginner. Can anyone tell me if it is a titlebar or an Action bar? Plus how can I give this Shaded Black color to my titlebar/action bar?
PS: I'm using GingerBread on my Android. My app will require minimum SDK version to be 4 but it targets Jelly bean too. In GingerBread, I can't make use of ActionBars. Please help me with the problem. It would be highly appreciated.
You will want to use the ActionBarSherlock library for this (which will allow you to use this all the way back to SDK version 4).
It is reasonably easy to style, and is for sure the right way to do this. Lots of examples for this, as it is a very popular library.
http://actionbarsherlock.com/
If you are wanting to target min API 4, then as you state you'll be unable to use the ActionBar.
So you could just create your bar as a LinearLayout or something with whatever buttons / icons you want on it and have it at the top of all of your Activities. If you have many of them it would probably be worth it to refactor the Bar (click handlers and such) handling into a subclass of Activity, and then extend that with all of your other activities.
The visual effect could be easily achived with a 9-patch png set as the background of a LinearLayout. Just make the gradient you want in photoshop/Gimp and drop it into draw9Patch to add the pixels on the edge that will allow it to stretch nicely to fit any screen.
Edit: using actionbar sherlock as others suggested is probably a better idea than doing it "manually" as I suggested.

Action Bar Sherlock like UItoolbar dark

I found this library and liked it. Know i am searching info how to use it. I am creating app which support from SDK 2.1 to 4.*.
So i downloaded ActionBarSherlock version 4.0. Imported library and made dependence to that library. I was needed to use Api level 15, because it is requirement for library usage.
So i imported project Demo from samples.
Everything look fine, but i really don't like this:
[2012-03-29 11:18:46 - SampleList] Displaying it with 'Locale Language ___Region __, sw320dp, w320dp, h533dp, Normal Screen, Long screen aspect ratio, Portrait Orientation, Normal, Day time, High Density, Finger-based touchscreen, Soft keyboard, No keyboard, Exposed navigation, Trackball navigation, Screen resolution 800x480' which is compatible, but will actually be displayed with another more specific version of the layout.
However i need this library creating navigation bar on top of all my layouts and change buttons action up to which layout i am.
So my target is to do this NavigationBar:
Maybe someone have done this with ActionBarsherlock and could help me ?
Also is it possible with ActionbarSherlock to do on Top Navigation Bar and on buttom Tab Bar with images ?
it should look similar:
Thanks
The library was designed to mimic the Ice Cream Sandwich action bar which has fundamental differences in both design and interaction patterns. I'm fairly certain that you could bastardize ActionBarSherlock into looking somewhat like UIToolbar, but it would be far easier to just create custom views to do this for you.
Also, please do not do this. Not a single Android user on the planet will thank you an iOS interface on an Android device.
http://developer.android.com/design/index.html

Categories

Resources