How can I build a multi-level expandable navigate UI? - android

I want to build a menu for restaurant. This is a tablet app, not on phone. The UI requires 3 parts. The left one is desired with a 2-level expandable navigation. When the client click one first-level item, system displays its second-level items. When the client change one first-level item, the new one will expand and the old one will automatically close. While client click a second-level item, the middle part will display the dishes in this category. Please refer the picture.
Main UI
Then, how should I design these parts? Can I put all in one activity? Or put 3 fragments for the 3 parts? I don't know if there are some differences of loading and refresh efficiency between the 2 ways.

expandable navigation
expandable navigation
Shopping Cart Click
fragment
First do three functions in two pieces

Related

How can I make a multi-level(more than 3 level) navigation drawer in android?

I am developing an android application where I need to put a navigation drawer which would have more than 3 levels.
What I want to do: If I click one item of my list in the drawer, a whole new list comes up in the drawer. This new list should also do the same when items of this list are clicked. This could go on for many levels.
What I have done till now: I am keeping an expandable list which expands when I click on any item. This design doesn't allow adding more levels.
Application which have similar drawers: svpply (please have a look at this application, it has a similar drawer)
I am a newbie in android development, try to add details to your ideas.
Thanks!
Have a single drawer keeping a FrameLayout.
Make all your list as ListFragment
Make Fragment Transaction on FrameLayout when a item is clicked.

Swipeable tabs and programmatically adding them

At the moment, I have a ListView filled with data and when an item is selected, a new activity is opened.
I want to change this so that when an item is selected, a new tab should be added with a certain title and the activity showed underneath that tab, I also want the user to be able to swipe between tabs.
After looking on the android development website, I found https://developer.android.com/design/building-blocks/tabs.html#scrollable which shows an example of the Play Store app and the scrollable tabs they have there. However, I cannot find any examples of this would be set up and also I could programmatically add tabs.
TheNewBoston If you are lost, you may want to go a few tutorials back to 84 in this list
On the side note, have you consider fragments and a viewpager?

How to swipe to same Fragment but with other data:?

I'm building this application where I have 2 activities. Both of them consist of 3 fragment - one for title, one for content and one for tab control. It is shown at image below.
First activity serves for showing list of some data's headers (item name etc.), search, app info etc. When user presses item in list, app takes him to another activity to show him detail of chosen item. This "details" activity has 6 different content fragments and user switch between them via buttons in tab control fragment (I did switching between content fragments by showing chosen one and hiding all others - I don't know if it's right way, it's my firs app so it came to my mind at first :) ).
And what I would like to do is: When I'm in detail and I swipe left/right then I want app to take me to previous/next item's detail, to same fragment where I currently was in (so not to next content fragment, but to detail of next item in 1st activity's list).
Is this somehow possible please? Because I have totally no clue how to do it :)
And what I would like to do is: When I'm in detail and I swipe
left/rigt then I want app to take me to previous/next item's detail,
to same fragment where I currently was in (so not to next content
fragment, but to detail of next item in 1st activity's list).
If you want to swipe left-right then you would need a ViewPager widget. I'm not sure how should your details activity behave so I'm providing you with two options. Do you want to be able to switch to the next/previous item's details only when a certain fragment is the one currently viewed by the user(from the 6 content fragments, which I assume are related and show various data for a single item)? If yes then in that desired fragment you would replace the current content of the fragment(which will only act as a container) with a ViewPager and use nested fragments for the actual content. If the user switches to the details of a previous/next item's details and then suddenly wants to see the data for that item from one of the remaining 5 content fragments then you would need to have some updates method on them to refresh the data to show the current item(a OnPageChangeListener will be useful here).
Second option, is if you want to allow the user to swipe left/right from any of the 6 content fragments. If this is the case you would use the same method as above but you'll modify each of those 6 fragments.
Showing the next/previous item is easy, just get some sort of identifier of the data(a position, id), retrieve the whole used data(as in the first activity) and then cycle between it.

android-adding tabs in view flipper

I am developing an android application in which I have creted a TabActivity. For each tab I am using a separate activity and a separate layout file. Actually this activity is a details screen which shows customer information. The user can click on an item in a listview activity in order to see customer's detailed info in the tab acticity. There he can use navigation buttons to navigate through the customers In a few words, if the listview displays 10 records and the user clicks on the first item the customer details.tabactivity opens and displays detailed info. Using the navigation butons the user can see the next or previous record.
Now, I would like to use a viewflipper in the details screen in order to use animations while navigating through the records and in the end. to use fling gestures instead of buttons. Nevertheless I haven't found a proper example of how to add a tabhost/tabactivity in the flipper. I also thought to create the tabs using one layout in order to add it to the viewflipper but then I have no way to create the tabs inside the activity that hosts the viewfliper.
Any help would be apreciated. Thank you in advance.
ps. I will create a basic app of what I am talking and upload if that would be helpful
The ViewPager may be more appropriate for what you are trying to do.

Should I use Activities or Views with tabs & lists?

I'm new to Java & Android development. I'm trying to develop an app that has 2 tabs, 1 tab has a listview inside of it. When you click on an item in the list, it takes you to another list.. and then you select another item, onto another list, ect.. until they reach the final page which I have setup as a non-selectable list. My question is.. should I create a new activity every time the user clicks on an item in the list? Or is that something normally done with changing views? If done with views, doesn't that pretty much disable their use of going back with the back button?
In the other tab I have an area with a list I guess in which you can remove items off of the list.. Now would I create a new activity for this and put this tab activity on every activity of the lists? I guess this part is what got me confused.. if I hadn't had the other tab my current setup of creating a new activity as the user drills down the lists worked just fine.
This all might sounds a little confusing but let me know if you guys need further explanation..
I would use changeable views only when the views are conceptually showing the same data from a different viewpoint. Since you say "it takes you to another list", I'd say use a separate activity.
As for the tab, my understanding is that you can model each tab as a separate activity, I'm not clear on why you would "put this tab activity on every activity of the lists"? Are you saying that one tab (the "remove" tab) is dependent on what's showing on the other tab ("the list tab")? Without knowing more about the context, but first instinct would be to use a separate "remove tab" activity and model the tab host as having separate activities per tab.

Categories

Resources