navigation-drawer

Navigation Drawer and master/detail flow

最后都变了- 提交于 2019-11-28 10:06:08
问题 I try use two android templates (Navigation Drawer + Master/Details Flow). How can I use this two templates in one app? I will be grateful for any example. 回答1: Update: After being ask to do so by a moderator, I'm flagging this and another similar question (as duplicates). Those questions: How to implement navigation drawer with fragments master detail https://stackoverflow.com/questions/25403377/combine-navigation-drawer-and-master-detail-layout Original Answer: Faced with the same problem,

How to open a new fragment from the navigation drawer?

▼魔方 西西 提交于 2019-11-28 10:02:29
I'm using developer.android.com guides to build an app. I choosed "Navigation: Navigation Drawer" when I made a new project in Android Studio. I have searched the internet for answers to my questions but I can't find any that works. Sorry about this, I'm new to programming. How do I make my app open a new fragment in the main view when clicking in the navigation drawer? Is it possible to open multiple swipeable fragments with tabs when clicking in the navigation drawer? How do I make a "title" expandable/collapsible? http://developer.android.com/design/patterns/navigation-drawer.html http:/

How do I change Item title font color for an Item that contains a menu in Navigation Drawer

匆匆过客 提交于 2019-11-28 09:48:39
问题 I've been searching for a way to change a specific font color in my nav drawer. I can change the font colors for other item titles but not ones containing a menu. <group android:id="something" android:checkableBehavior="single> <item android:title="Menu Heading> <--This is what I want to change--> <menu> <item android:title="stuff"/> <--This i can change--> <item android:title="stuff"/> </menu> </item> </group> I can change all other title colors with app:itemTextColor in the main activity. I

Changing Navigation drawer icon on action bar android

喜欢而已 提交于 2019-11-28 09:37:27
I have created a NavigationDrawer in my app using the ActionBar. As showed in the picture above I want to change the NavigationDrawer toggle button icon to something I want. How can I change it? Here is my code:- mDrawerList.setOnItemClickListener(new SlideMenuClickListener()); // enabling action bar app icon and behaving it as toggle button getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.hamburger_button, //nav menu toggle icon R.string.app_name, // nav drawer open -

Right to left menu items Android in NavigationView

99封情书 提交于 2019-11-28 09:06:42
问题 im beginer of android. i design a navigation drawer like this: as you see all items in menu are on the right Except "SubHeader". how can i move "SubHeader" item to the right of this menu? i use all properties like gravity, layout gravity, layoutDirection to the SubHeaderItem but it doesn't work. my code is <android.support.design.widget.NavigationView android:layout_width="wrap_content" android:layout_height="match_parent" android:id="@+id/navigation_view" android:layout_gravity="end" android

Customising NavigationView - Adding dynamic headerView, Android Support Design Library

青春壹個敷衍的年華 提交于 2019-11-28 09:02:23
I tried the navigationView from the new android support design library. I want to have a dynamic headerview. Basically, my headerview will show something like quote of the day. I have like around 10 quotes and i want to randomly select a quote and display in a textview in the headerView. I also want to add onClick method for the headerView. Right now, I don't see any possibilities of changing the headerview layout programmatically. Any suggestions to implement this? first create header XML like lay_header.xml <TextView android:id="@+id/tvThought" android:layout_width="wrap_content" android

Navigation Drawer Menu Item Title Color in Android

无人久伴 提交于 2019-11-28 08:25:45
I have a problem changing the Menu Item Title Color in the Navigation Drawer I set the itemTextColor but it only changes the Color of the Items not the Title of the menu. Here is my Activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:openDrawer="start">

Can I open the drawer layout with animation programmatically?

假装没事ソ 提交于 2019-11-28 08:13:16
I created the app drawer by using the following library: http://developer.android.com/training/implementing-navigation/nav-drawer.html I want to show the Navigation Drawer with animation when opening the app. How can I do that? Predraw listener, aka the safeway Here is the predraw listener example. It will literally start the animation as soon as it can which maybe a little too fast. You might want to do a combination of this with a runnable shown second. I will not show the two combined, only separate. @Override protected void onCreate(Bundle savedInstanceState) { ... // Building NavDrawer

How to prevent closing Navigation drawer by touch outside the drawer

房东的猫 提交于 2019-11-28 08:02:43
问题 I have an Activity with Navigation Drawer. if user device is table and orientation is landscape - I not need to close drawer by click on item in drawer: if (!isTablet || context.getResources().getConfiguration().orientation==1) { mDrawerLayout.closeDrawer(Gravity.START); } It work. But if user touch the screen outside opened drawer - drawer closing. Using DrawerLayout.LOCK_MODE_LOCKED_OPEN is unsuitable bacause I need to save drawer sliding functions. How to prevent closing Navigation drawer

OnClick for navigation drawer header not working

不想你离开。 提交于 2019-11-28 07:27:24
I have a navigation drawer in my app which contains a header and some list items. The header has a textview which i want to make clickable but I am not able to do it. To get the id of this textview I used the following code, since it is in a different layout file compared to the one in the setContentView in onCreate. final LayoutInflater factory = getLayoutInflater(); final View textEntryView = factory.inflate(R.layout.header, null); TextView home = (TextView) textEntryView.findViewById(R.id.home); home.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {