I cannot find either one of these two views in the source, but have seen them both in many apps. Can anyone please tell me what they are called?
Thanks
The second one is an options menu from the action bar. I think it is implemented as a ListPopupWindow.
The first one is not part of the Android SDK, though there are various implementations floating around. Here is an example of one designed for use with Google Maps, for example. Here is one designed for the "quick actions" pattern.
I'm going to assume that they're custom made ones, so you won't find them in the standard Android libraries.
The second one I think is just the way that the default menu looks in ICS (and honeycomb for that matter). If you build for 4.0 and include the code for an options menu I think you'll get that UI by default. If you are looking to customize it check out this page http://developer.android.com/guide/topics/ui/actionbar.html and pay close attention to the "Adding drop down navigation" section.
The first one is not a part of the android UI, that is something specific to the facebook app.
Related
I want to make a moving list appear from the left of the screen of the activity in the android app.
Something like the facebook app shown below :
,,
how can I make something like that in an android app.
Thanks.
This is a very popular UI pattern called a sliding menu / slider. You can search for open source libraries / projects which implement this for you.
Here is the first one I found on google.
This one is useful if you want to support old (pre holo) android devices too. It's an addon to the excellent holoeverywhere library.
And last but not least, take a look at this official pattern by google which also implements the same behavior. The code for creating it is available here.
The concept behind this is that you are taking a screen grab of the current activity and then loading in the menu. Your not actually sliding between activities, your moving the screen shot. Thats a very basic explanation of whats happening.
If you search for slide navigation on github I'm sure you'll find something.
In my app I would like to have something quite similar to Android's built in popup menu (see link below), but it also needs to include checkboxes and images and I should be able to choose several checkboxes before closing (with the same button that opened it). Is it possible to do that with android popup menu? Is there a better way? Any chance there is a way to do it on android 2.1 (this the version on my demonstration device)?
Thanks for your time,
Lior
You can use the overflow menu in Android 3+. But there is a way to use it in lower APIs by just using ActionBar Sherlock. See the demo App of the ABS. There is also a demonstation of it.
It should look something like this.
I'm currently working on a port of an iPhone app into an Android. The iPhone app has a custom global navigation menu at the bottom of the screen, and when bringing this over to Android, it was suggested to replace this custom menu with the generic Option Menu (invoked via the option key on the device) to give it a more native Android look and feel.
The issue is that the menu itself has several layers (e.g. Three main option like A, B, C, and sub-options like A1, A2, A3). I've looked around but have not seen this sort of multi-level option menu on Android apps, so am looking for some guidelines on how this may be best achieved.
I've seen some questions on customizing the Option Menu such as this one; Android: customize application's menu (e.g background color); and they seem to suggest that the native framework doesn't support many options.
Should I be looking at a bit of hacking into the option menu (is this a good idea?), or looking at some other approach to modifying the app flow? Trying to understand what would be the best way to maintain a consistent user experience on Android, while reducing the level of variation from the iPhone app.
Thanks!
I've looked around but have not seen this sort of multi-level option menu on Android apps, so am looking for some guidelines on how this may be best achieved.
Options menus support sub-menus, but only one level deep (i.e., the menu can have a sub-menu, but a sub-menu cannot have a sub-sub-menu).
If you really need that (and want to violate the Android platform standards regarding menu depth), then you can easily implement this by using an AlertDialog with lists for every nested level of your menu. Visually those appear exactly the same like an options menu.
I've done something similar to what banana suggested. I would just add the reasoning behind the limitation is the myriad number or devices and screen resolutions that need to be supported. Multiple nested menus might look good on a tablet but not on a 5 inch screen so we need to keep that in mind.
For me, adding
android:onClick="onOptionsItemSelected"
to nested menu items worked.
I'm just mucking around with Android tablet stuff in 3.0. I have fragments set up to do the equivalent of UISplitViewController for iPad. Anyone know what the best solution to get something like the iPad UIPopOverController is?
I'm thinking the options are either a separate dialog or something in the Action Bar ...?
I haven't actually seen any Android tablets running 3.0 so not clear what the standard will be ...
Many thanks in advance
This may not be exactly what you are looking for because I'm not all that familiar with UIPopOverController but I think you can accomplish something similar using a Toast with a customized layout.
I would take a look at Creating Toast Notifications and see if it works for you.
Depending on the functionality needed it might work, otherwise you might need to look into trying to generate a modeless dialog with a custom layout.
As for your other question, yes options are generally stored in a separate activity within your application and following Honeycomb design the options activity would be accessible from the Action Bar and the options itself could be a fragment.
Its nothing official but I would crack open the source code to the contacts app for 2.0+ They emulate the popover UI using an Activity in a pretty creative way. It might be a little over kill as it was designed to be usable by any application not just itself. But it should help give you a nudge in the right direction.
Also depending on what the behavior you are looking for exactly a combination of fragments and action bar could be the way to go, but its not going to be as easy as iOS.
Desktop apps have top level menus (File, Edit, Search, ..., Help).
Web apps have very similar thing, menu tabs (Logo, Questions, Tags, Users, Badges, ...).
However I cannot find equivalent of top level menu in Android framework. Assume that my app has 5 main activities. According to menu design guidelines options menu should contain actions related to current activity. So how an app should allow users to easily switch to one of five main activities.
It seems that different apps solve the problem in different ways. Some have a tab list at the top of the screen, some at the bottom. Even Google applications aren't consisted in that field. Google Listen has an options menu item called 'Listen Home', however Listen main activity has no that options menu item. Others have two icons in app luncher which start two different activities from one app.
I realize that due to small phone screens Android apps have to be designed in a slightly different way than web or desktop apps. But I have a feeling that the app top level menu topic was omitted in Android framework. And developers are on their own here. Or am I missing something?
Update: this is Google blueprint for a great app
Update2: this an example app of these patterns
Update3: GreenDroid library helps a lot implementing these patters in your apps. It seems that dashboard and action bar patterns are becoming quite popular.
You should take a look at this Google I/O session: http://www.google.com/events/io/2010/sessions/android-ui-design-patterns.html
They talk about the design patterns they used for the Twitter application and basically the type of concept you are asking about. Basically, your activity should have a top bar that gives the user specific tasks to do in the view or allows them to switch into another activity.
Google has not implemented anything like this into the actual SDK yet so you're sort of on your own in terms of implementing it but the main concept is given in the presentation. This is the direction that Google would like to see Android shift into though.
Hopefully this helps you out somewhat.
The file/edit menus of desktop apps have a very different purpose than the questions/tags etc. tabs at the top of this webpage.
The contents of the file/edit menu should be implemented as in the options menu that appears when you press the menu button. This is, as you noted, to save space on the smaller screens.
App navigation like the questions/tags etc could be implemented using a Tab Layout. You are right that apps vary in whether or not the tabs are on the top or bottom, but I don't think thats a huge deal. In my unscientific look through apps on my phone, the bottom seems to be more common. However, I think it might depend on your specific implementation which you decide.
A lot of apps don't require any sort of navigation like that, and can get away with just having a path forward or back via the back button. I think this is preferable for a lot of applications, but won't work in all cases.
I'm not sure what more you would want built into the framework.. It seems like you can accomplish any kind of navigation desired with the above options.
You can look at the source of the Google IO app
ioshed