Using dropdown menus in tabs in Android - android

I'm a beginner in using Android. I'm trying to create an activity which contains 4 tabs (I'm using Google's SlidingTabLayout). One of the tabs is the "category" tab.
For this tab, I'm trying to have 5 options as a drop down menu. So I want the "category" tab to be selected by default and it shows 5 types and then when the user clicks one of the category types, a list view of corresponding category type will be shown.

In my opinion showing a drop down from one of the sliding tabs is a not a good and proper way.I think you should use Navigation Drawer for categories and the other corresponding category items should be shown in sliding tabs.Remove Category tab from sliding menu and show categories in Navigation Drawer and the corresponding sub categories should be in sliding tabs.That will be proper way and easy to manage.I think this will be a good idea.

Related

Android: Navigation Drawer, JSON Feed, RecylerView

So I have set-up a navigation drawer and a main layout that downloads JSON data and displays it in a RecyclerView in a tab fragment.
Now what I intend to achieve is that, when I click on a hardcoded item in the navigation drawer it calls the API corresponding to it, should filter the main RecyclerView based on the JSON parameter passed.
(eg: If the Main Layout RecyclerView shows all the Items that you can buy, and the Navigation Drawer contains items like Laptops, Cellphones, TV, Clothing etc and while clicking on NavDrawer item, it filters the RecyclerView to show only the items in that particular category)
Why don't you have fragments for each navigation drawer item? These drawers will make the API calls and present the received information in the RecycleViews they hold?
It would be much easier and better than reuse a single view to present different information on different actions...

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.

Navigation Drawer with 2 or more different listviews from the same side

So I have already read from Navigation Drawer and from Creating a Navigation Drawer.
I am trying to have two or more different listviews.
Basically the scenario is the user to be able to click to 3 different buttons and have three different listviews. So I have two thoughts or I will create 3 listviews and with onClickListener I will open a different ListView or else a dynamic Listview that for every button to show a different listview but without changing the actual layout of the listview.
And I also have one sub question:
Is it possible to block the sliding navigation drawer from the sides? because I want him only to be able to open it from a button click. (I have already the code for button click, but I don't how to block the drawer from opening when I slide the side).
So any help??

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?

Android - ActionBar when splitscreen (List/Detail)

I am new to fragments and Ive been wondering whats the correct answer to this.
I am having simple List > Detail type of application, where this was originally 2 activities, no fragments, each had their own actionbar (menu).
Now I want to migrate it to fragments.
Using fragments I created a classic tablet split view with list on the left, detail on the right. Obviously that being only one activity, only the list's actionbar (action items) is being displayed.
Where should I put the action items from the detail? What the correct pattern? Should I create an alternative resource folder with custom menu file for tablets which would consist of both list's and detail's menu items?
Thanks !
Just create a new fragment_details.xml for the details fragment's menu entries.
Inflate the menu directly from the fragment.
Inflate the base menu from the list fragment.
The activity should have no menu attached at all as all menu entries are attached to the one or the other fragment.
In the tablet case, android will merge the fragment's menu with the one from the list fragment.
On smaller screens, when only the details are shown, the fragment's menu is shown.

Categories

Resources