Action Bar, OutlookBar, Navigation bar with SDK 8 - android

I would like to get an action bar (navigation or outlook bar) which contains e.g. 6 Icons with text. If I click on an Icon, I would like to replace the content area of the outer control (nesting the 6 buttons) by an inner control in addition to a small back menu on top of it. The back button could also indicate the location where we are. So it is close to the outlook bar used within microsoft office.
I am using android:minSdkVersion="8". So I did not take a closer look to the android action bar. I am currently using the tab control. However, the tab control is not really what I want. Or can this be adjusted to provide my described functionality? I create controls at runtime, so I can tweek it, if someone knows how to get it close to what I am searching for. As alternative I would appreciate a library, with such a control.

Android Support Library, revision 18 extend support of ActionBar down to API v7. There are good instructions how you can import it (v7 appcompat) to your project.

Related

Android - Slide Menu like in Uber

I am looking to implement a menu like used on the Android Uber app.
It seems to be like an action bar on top with 3 small settings stripes on left side. (probably not a real action bar)
When clicking in that area a black menu slides out from the left and occupies 70% of the screen.
The right side of the screen still showing the map is darkened to keep focus on the menu.
I like that style, it looks good and everyone immediately knows how to use it.
I would like to have the same but don't know where to start or if there is maybe something available that would do something similar.
The actionbar itself only offers the menu on top right which is better for pure settings.
I also experimented with a split action bar having the menu items on bottom but that also seems superior to the clean interface Uber provides.
You want the Android Navigation Drawer. It's an Android sanctioned navigation pattern and more details about it can be found here. For some more technical documentation and an example of how to use it, you can find a sample over here. It works great with the Action Bar so shouldn't need anything too custom outside of what the Android v4 compat library gives you.

3 dot/settings in top bar buttons

When in some apps, there are those 3 dots in the top right of the app, on the action bar (not the home buttons), which allow for more options. In my app I have on, but I do not know how to make it do a method when it is clicked. Do I use android:onClick="METHOD_NAME ? Or do I need to setup a button variable in my activity class and setup and onClickListener? I have already tried both but I may be doing something wrong.
That three dots are the menu in the action bar. They are always shown on devices without a menu key.
See also the documentation for more details.
Three dots are called Overflow(very aptly named) and to use them you need to use ActionBar which is the top long, horizontal bar showing icons, other buttons along with the Overflow button.
Now in some devices where there is no physical menu button you will always see Overflow button.
Go through Docs and tutorials related to ActionBar but keep one thing in mind that ActionBar is only available for devices with android above HoneyComb. For android devices below 3.0 such as GingerBread or Froyo you will have to use compatibility libraries, so that will be an additional task.
And most notable libraries for this purpose are ActionBarSherlock and AppCompat.

Android how to make menu bar that appears at the side of the screen? Like Google Plus, Facebook menu on Android devices

I am developing an app on Android and would like to use the similar menu bar like Google Plus or Facebook, when you click the button, the menu bar will slide in and will not occupy the whole screen. Any ideas on that?
Thanks.
A pretty popular library for accomplishing the 'sliding menu' effect (or 'drawer' as the design guidelines on the Android developer website prefer to call it) is Jeremy Feinstein's SlidingMenu. It's also compatible with ActionBarSherlock, in case your project is using that too. Unfortunately, at this stage there is no component built into the SDK that allows you to do easily accomplish the same thing.
There are also a couple of alternative implementations for a sliding menu (do a search either here on SO or Google), but I haven't checked those out for a little while. If I recall correctly, there are especially some variations in terms of whether the ActionBar is supposed to slide along with the content or stay fixed at the top of the screen.
You can use FrameLayout in parent view and use translate animation in menu layout to show the slide in and slide out effect.

Design on Android 4.0 (Tab layout)

I'm not sure what direction to take with a Tabbed layout.
I am targeting sdk 15, min sdk 11. Are tabs better left in the action bar or in the "body". I am not designing for tablets with this app (yet), but it seems tablets have tabs in the Action bar and smaller screens do not.
One of the main reasons why I ask is because Google does have some info on tabs here:
http://developer.android.com/design/building-blocks/tabs.html
But I can't seem to find it in their new "Develop" section. So I don't know if this has been deprecated? There used to be a good example on Tab layouts.
You can still use them. They are not deprecated. In the post android 3.0 versions the tabs have been placed in the action bar on tablets. on phones they are below the action bar in portrait and again in the action bar in landscape. it's is considered a good practice to follow those standards as android developer suggests. Now i haven't used the new implementations but rather a compatibility library called ActionBarSherlock. it is actually pretty good and its almost exactly the same in terms of usage as the regular tabs. you can find some good samples on how to implement what you need in there.
Also i am pretty sure you can find all the samples in your android sdk folder under samples/android-14 for example.
I always felt that its easier to browse through them from there as opposed to developer.android.
Hope this helps you.
"If you use navigation tabs in your action bar, once the action items are separated on a narrow screen, the navigation tabs may be able to fit into the main action bar rather than be separated into the "stacked action bar." Specifically, if you've disabled the action bar icon and title (with setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false)), then the navigation tabs collapse into the main action bar."
http://developer.android.com/guide/topics/ui/actionbar.html
This is in fact part of the new design pattern.
If the tabs can fit into the main action bar, let them.
Usually if you're in portrait mode they wouldn't (except for the case stated in the above quote), but when you switch to landscape mode (or if you're on a tablet) they would easily fit.
Everything you find on the developer's site is recommended and is considered good practice. Further, the "design" and "develop" sections go hand in hand... the separation is not meant to imply that "only developers should look at 'develop'" or vice versa. You should treat each as equally important when writing your app.
So yes, it is recommended to implement your tabs with the action bar (as seen in FragmentTabs.java in the API Demos), and it is certainly not deprecated.

Customized navigation menu in Android

I'd like to create a navigation menu in my Android app: a bar always at the bottom of the screen, with 4 choices Home|Categories|Search|Favorites, and the current page highlighted.
It seems the options menu can hardly be customized, so I can't use it.
Do I have to add this navigation bar in every layout or is there any better solutions?
Thanks
Julien
It sounds like you're replicating an iPhone interface. As most Android phones have buttons along the bottom of the screen (Home, Back, etc) it's likely to be a bad idea to put navigation there as it's easy to hit the wrong one.
The Google-recommended approach is to use the Action Bar pattern, across the top of the screen, which is very clear, and means your app is consistent with others (look at Twitter, Google Maps, Facebook - they all use the action bar pattern).
From Honeycomb (v3.0) onwards:
http://developer.android.com/reference/android/app/ActionBar.html
A simple library to create an Action Bar on any version of Android
https://github.com/johannilsson/android-actionbar
To create an action bar that uses that library on versions earlier than 3.0, but uses the official implemention for v3.0+, try this:
https://github.com/JakeWharton/ActionBarSherlock
The action bar is highly customisable, but remember that a key to a nice user interface is consistency across the platform, i.e. your app consistent with other apps and the OS.
If you need a navigation with more items or items within a specific page, you can use TabLayout, but for your primary nav, use the action bar, that's what it's for.
Use the TabLayout

Categories

Resources