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!
Related
The SlidingMenu library is an excellent third party library and I've already used it for a long time. Now I know Android provides a new navigation pattern using Navigation Drawer. It looks like the sliding menu. So is there anyone who already uses these two both? What is the difference and what are the pros and cons? Thanks a lot.
SlidingMenu library is a third party api which uses a RelativeLayout inside. The main advantage is customization according to your requirement. Buy your layouts have to be based on a viewgroup, unfortunatly this negates the <merge> optimisations.
Navigation Drawer is available in the Support Library of android it uses DrawerLayout inside. The main advantage is improved performance.
They also have different visual effects. SlidingMenu looks like horizontal scroll view. Sliding it in will push the main content out.
Pros :
It comes with cool entrance / exit animations for the menu content.
Depending on what Activity you use it on, it can be placed below the Action Bar or next to it (pushing the Action Bar too)
You can explicitly set the touch mode via a setter: margin or full screen. In full screen mode touching anywhere on the screen will open the menu. In margin, only when you slide from the edge of screen will the menu open.
Cons :
You can only control the shadow of the side menu
Navigation Drawer / Drawer Layout looks like an additional top level view in a frame layout. Sliding it in will mask the main content.
Pros :
If you use v4 support lib then it's already there.
You can control both the side menu shadow and obscure the main
content via setScrimColor e.g when the drawer is opened, a fade-in
alpha layer will appear above the main content. This is good to visually separate the content and the menu especially when both have a same color.
Cons:
It can only be placed below ActionBar
There is no setter for touch mode and by default you can only do margin touch mode. Doing a full screen touch mode (like Youtube) involves a lot of work
I think the best advantage is that It is official Google code, I mean it just works and works excellent.
The main disadvantage is that it is very basic to use, I mean... you cannot put two navigation drawer in the same activity or fragment, you can only use one in left and that's it.
You already said it yourself. Sliding menu is third party. Navigation drawer is official. Both have the same purpose, but third party libraries might implementing it slightly differently, depending on which one you use.
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.
i'm building an app and i really want to align buttons to the left using ABS (action bar sherlock) 4.0
I really like the dropbox interface as shown under this:
So, my question is: How can i align the buttons to the left and how can i jump between views in ViewFlow using buttons?
I've seen that people can add tabs to their ABS, but not with the title like the Dropbox interface.
Thanks.
Also if u need my sourcecode i will add it later if needed.
Regards
Stian Instebø
setCustomView() is the magic method you might be looking for.
To achieve the same layout shown in the Dropbox app, you would first call setDisplayShowHomeEnabled(false) on your ActionBar.
Next, you could define the layout for the buttons somewhere in XML. Once this is done, calling setCustomView(R.layout.my_actionbar_nav) will do the trick. (It will now be positioned on the left-hand side of the ActionBar).
It'll be your responsibility to wire up the appropriate onClick listeners for your layout's inner button Views, but it's not a bad price to pay for setting up custom navigation.
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
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