I've made a navigation drawer in my app. Inside my navigation drawer is a ListView. It's a simple list view with text items. The Gmail android app has a ListView with headers.
(source: phonedog.com)
As you can see, the words: INBOX, RECENT LABELS, ALL LABELS are headers. I would like to implement exactly those type of headers into my app. Is this feature an inbuilt android thing or do I have to create something custom. If yes then how.
Let me know if you need any more info.
Thanks in Advance.
Related
I'm trying to create a navigation drawer like this:
facebook side chat
inside the navigation drawer,I need a login page instead of a list,like this:
side login page
I didn't find any helpful libraries for doing this (SlidingMenu was the library nearest to the solution) and I found just side menu with a list of elements.
Could you please suggest me a solution/library to use?
Thank you very much.
You can implement by overriding drawer slide listener. Here it is well explained https://stackoverflow.com/a/33588398/4804264
You can write a custom Viewgroup to control the View(your side menu).
And using the ValueAnimator, you can slide the menu from the side.
Custom components
Custom
Property Animation
I use this library:
https://github.com/mikepenz/MaterialDrawer
I would like to have a right NavigationDrawer with a ListView (or a lot of items) inside and I get items from DB inside the Fragment and when user click on items on the NavigationDrawer I get data from another DB and show it on Fragment.
and I have a questions:
is possible to create a right Drawer inside a Fragment? or is better to create a new right Drawer in MainActivity and change the navigation item inside the Fragment?
Just use brand new Navigation View from recenlty released Android Design Support Library by Google.
Here are links for you:
official documentation, always a good read: https://developer.android.com/reference/android/support/design/widget/NavigationView.html
nicely written blog post about Navigation View: http://antonioleiva.com/navigation-view/
and last but not least, sample app using new Android Design Library: https://github.com/antoniolg/MaterializeYourApp
To have Navigation View on the right, just set android:layout_gravity to end.
As from design point of view, you should always use left sided Navigation Drawer, it is possible to make it right sided, but its recommended to leave it at the left side.
Another thing is that you do not need to use 3rd party navigation drawer libraries.Since there is a Design library by google, which supports the material design navigation view.
Here is a link for the library:
https://developer.android.com/tools/support-library/features.html
And here is another useful link:
https://guides.codepath.com/android/Design-Support-Library
Here is the link for the Navigation Drawer: https://guides.codepath.com/android/Fragment-Navigation-Drawer
As for your question the appropriate way is to create the drawer always in the main activity onCreate() method.
as I pursue my study on android app development I came across this app from apple and I was wondering if, is there a way to imitate the navigation drawer in this screen shot?!
See it's an expandable navigation drawer. a list view with some items that are expandable. Is there an actual way to imitate this on android?
Thank you very much again for all of your help.
You can recreate that drawer.
You can use the ExpandableListView within the Navigation Drawer. And of course you'll have to create your own parent and child item layouts for the listview. As well as appropriate styling. You can use tutorials to do this, first create the navigation drawer, then create the expandablelistview and put it within the navaigation drawer layout.
I'd also like to note on that screen shot, the drawer is incorrect. It should slide out below the action bar, over-top of the activity (like in the link). It should not slide the entire application window to the right like how some apps do.
Use a Custom ListView for this, see here for that: How To Create A Custom Listview - Android Example
Also, you will have to create specialized buttons that have a different look than standard holo buttons, see here for that: How to create custom button in Android using XML Styles
Finally, I do not believe it is possible to directly clone the navigation drawer, as the app you showed doesn't have an open sourced app (as far as I know).
I'm really new to Android and I want to implement listview and tab action bar:
Home page:
A list that has action bar on top with two tabs (swipe left/right).
The items in the list are clickable.
Detail page:
One of the tab will just have some content
The other is another list with unclickable items
What should I use?
A listview activity or a listview fragment for the home page?
Or does anyone know of an example that is similar to this?
I don't care about backwards compatibility (for now)
Thanks in advance!!
I think this Android Developers' tutorial is pretty self explanatory. You should be able to figure it out from that.
I'd suggest you go with fragments as they're the newest way; whereas activities are getting old now. This will make it easier for your application to accommodate future Android updates.
This may also help you out regarding Fragments.
I'm trying to figure out how to create a User Information dropdown menu exactly like what evernote uses in the screen shot below.
Dropdowns and normal spinners don't seem to support a Header value where the Username is.
Does anyone have any ideas how to to implement something like this with a header, custom fields in the dropdown list and spinner icon in bottom right of header.
Also, the sample at http://developer.android.com/guide/topics/ui/actionbar.html#Dropdown is not what I need unless it can be expanded for header and custom entries.
Supporting Android 3.1+
Here's the screenshot