Android bottom menu - android

I’ve created a bottom menu and used a relative layout to place it there but I don’t know if I’m going about this the right way. It’s a PNG bar with three images on it one for maps, one for facilities and one for search which all should lead to a three different activities.
How do I make each image a button, I know how to make the whole bar a button, in a webpage you can add an image map and create hotspost with the three links.
How do I do that in an Android application?
Cheers,
Mike.

How do I make each image a button
You use three images, and use each in an ImageButton.
Even better would be to follow platform conventions, either:
Using an ordinary options menu, which will automatically be hoisted to your action bar on Android 3.0+, and where you can make some of those be toolbar buttons if you want for immediate clickablilty
Using an action bar library for all Android versions, such as ActionBarSherlock, so you have the same behavior everywhere, including the toolbar buttons where there is room

Related

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.

How do I place the three vertical android dots wherever I want within my app, but will still trigger the menu?

I'm building an android game that doesn't have an action bar. Even though I don't have an action bar, I still want the three vertical dots placed somewhere within my app. I'm not sure if I have to create my own image file that contains the dots, or if there's some way to move the dots in the layout manager in eclipse. Then when these dots are selected I want it to do the vertical drop down menu option like it does in the action bar.
Also I want the dots to disappear in android phones running under android 4.0, so that they can just use the normal menu button. Is this possible? It would be even better if I could get the three dots to trigger the menu in phones below 4.0 but I don't think that's possible so I'd rather just hide it entirely.
Thanks.
I'm not sure if I have to create my own image file that contains the dots
The standard overflow icon should be in your SDK.
or if there's some way to move the dots in the layout manager in eclipse
No.
Then when these dots are selected I want it to do the vertical drop down menu option like it does in the action bar.
You are welcome to implement your own PopupMenu for displaying a menu.
Also I want the dots to disappear in android phones running under android 4.0, so that they can just use the normal menu button
You are welcome to call setVisibility() on whatever you are using for your image whenever the mood strikes you. You will also need to arrange to display your own menu for MENU button presses.
IOW, you will need to roll your own menu system: displaying your trigger, displaying the menu based on the trigger, and doing something on menu choice selections. You are welcome to crib bits of this from the AppCompat action bar in the Android Support package, or perhaps ActionBarSherlock, if you wish.
It would be even better if I could get the three dots to trigger the menu in phones below 4.0
Since you are writing it all yourself, you are welcome to have it do whatever you want.

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.

How Does Skype Do The Android View At The Top?

I am trying to find the name of the built in widget that is used to make the static bar at the top of the Skype app for Android. Does anyone know? I think it adds easy button functionality.
Also, how within that bar they have a button to change the user's status. It pops up a pretty bubble with an animation. Is this something built into a library or custom?
The action bar wasn't included until 3.0 as its the same app thats used for both tablets and smartphones, and on a tablet, the menu is still present, not shifted to where the action bar should be.
Its more likely they have each activities content in a scrollview, and a static layout pinned to the top of the page,
If you make your activities that will be using the top bar extend a base activity class that includes handlers for the static layout at the top of each page, and define the layout separately to be included in each activity's layout where it is required.
As for the bubble that animates out, it will be part of the layout but hidden, or not part of the layout, but inflated from xml pragmatically. i dont know what the exact animation is that makes it zoom in from the center though. The actual bubble will be another layout, wrapped in a FrameLayout so i sits nicely on top of the current activities layout.
Hope some of this was helpful
Check out ActionBarSherlock for a library that lets you easily implement action bar on pre-Honeycomb devices.
The static bar thar you are talking about is the action bar. It's included as standard in the version 3.0 of the API but you can also use libraries that provides you a very likely widget.
I use a modified version of GreenDroid library... You can also install the GreenDroid Catalog application from the Market to take a look.
Ah! of course you can change the color using styles!

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