I'm facing an weird behaviour of navigation drawer so if someone can help...
I have a navigation drawer filled by an adapter (like list of Object : title and icon).
In Activity
mNavItems = NavBarUtil.listItem(); // List of object
mBinding.navList.setAdapter(new DrawerListAdapter(this, mNavItems));
The view for drawer is just a simple ListView.
The weird behaviour is that when the keyboard appears (whatever it comes), the order of the items in navigationDrawer change... it's like, displaying the keyboard recalculate all the view.
Just wanna precise that all listener for item work fine, the issue is just about the view like icon and title...
Thanks you guys
Related
I am using a NavigationDrawer in my application and I am loading in the drawer a ListView. When the drawer is opened, it covers almost half of an Activity which contains also a ListView.
The problem that I face is that if I tap on the drawer(not on an item contained in the drawer), a ListView item from my Activity gets the click event and then starts an activity associated with that list item.
Is it possible to restrict the clickable area of the drawer only to the list items?
I assume your drawer layout is more complex than just a simple ListView, if you have place to tap on the drawer.
In that case, you could simple specify
android:clickable="true" for your top drawer layout (LinearLayout, RelativeLayout or whatever you use).
I have a list view in my navigation and while I am scrolling down or up my list view I accidentally close drawer too. I don't want my users to face that issue. How can I make drawer only closable from border like it opens only from border?
I have a list view and a navigation drawer I want to make an application in which clicking on item on a list view will open a navigation drawer for each item. For example list view are students and in navigation drawers we have tests, achievments and informations different for each student. I have no idea how to do it and I need a clue to start with.
I will be very greatful for each advice,
You can open NavigationDrawer whenever you need by
private DrawerLayout mDrawerLayout;
if (mDrawerLayout.isDrawerOpen(listView)) {
mDrawerLayout.closeDrawer(listView);
} else {
mDrawerLayout.openDrawer(listView);
}
But you shouldn't do it.
This is not what a NavigationDrawer is for. You should opt for, for instance, a PopupMenu for it.
Or you can choose from many interactive libraries. Consider SwipeListView. It will show all the options you want to show when a user swipes the ListView item (student).
Try looking into learning about Fragments and listview adapters.
Google has a detailed tutorial for working with the navigation drawer, http://developer.android.com/training/implementing-navigation/nav-drawer.html.
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.
In my app, I want to use an ActionBar Spinner for navigation, although I know that this is not really the purpose of the Spinner. My problem is, that the first item in the Menu list is selected automatically when the Activity is started and a click on this first item doesn't trigger the Listener, as long as the first item is "active". What is the best and least hacky way to implement a fully working navigation menu looking exactly the same as the Spinner menu of the Actionbar? (i.e. with this small arrow on the bottom right etc.)