tyb
tyb

Reputation: 4749

Tips on how to build a layout like this one

Could anyone give me a tip on how to build a layout like in the following picture?

Viber for android  - VOIP app

The application i'm working on has absolutely nothing to do with VoIP but I'm trying to build something like this. One fixed toolbar at the bottom, an interchangeable middle pane with listviews, scrollviews or other, and another toolbar at the top which would change depending on the button selected on the bottom bar.

Also, would it be possible and good practice to keep all of this within a single activity?

Upvotes: 0

Views: 1793

Answers (4)

AndroidGuy
AndroidGuy

Reputation: 3451

The Android developer site is a good place to start. See

UI Guide

I also agree with the poster who recommended against this specific layout. It seems to have been developed for an iPhone and shouldn't be used "as is".

Upvotes: 1

Krylez
Krylez

Reputation: 17800

Do not use bottom bars. To give a more familiar UI, put all of those functions into the top bar. Start by looking at the source code for the ActionBarCompat project in your android sdk sample folder.

Upvotes: 1

FoamyGuy
FoamyGuy

Reputation: 46856

Also, would it be possible and good practice to keep all of this within a single activity?

-Yes for sure, and yes with a slight catch, depending on what you mean.

One approach would be to create your top and bottom bars inside their own XML. Then in your activity onCreate() inflate and add at the top and bottom of your Layout.

If the bottom bar will not change ever, then you could actually add that into the layouts you already have. If you do it that way, to handle the listeners you could create an Activity that contains just the bottom bar click listeners and then extend that with all of your other activities.

Since the top bar can change though you'll probably have to inflate and add the views to that at run time, that way you can react to what is going on to add / remove / present the appropriate views in the top bar.

Also just because it is somewhat of a pet peeve of mine:

When designing your bottom bar please seriously consider the fact that some devices have soft buttons directly underneath the touch screen. And they are rather close to the screen on some devices. Applications with a bottom bar that is not tall enough create an opportunity for the user to hit one of the system buttons instead of one of the bottom bar buttons as they are intending (or vice versa). Which from a users perspective I must say is VERY aggravating.

Upvotes: 1

Manfred Moser
Manfred Moser

Reputation: 29912

You should NOT build an interface like this. Don't use bottom bars! Don't use labelled back buttons on action views!

You should read the Android design guidelines and then work with tab views... and other stuff referenced there and build an Android app.

Upvotes: 6

Related Questions