navigation-drawer

Android - How to change fragments in the Navigation Drawer

Deadly 提交于 2019-11-26 10:59:11
问题 I\'m fairly new to Android programming, but have been doing pretty well until now. I\'ve read a lot of answers to this question but can\'t seem to make mine work. Basically what I have is a MainActivity with a Navigation Drawer. I have two fragments correctly initialized with corresponding fragment layout xmls. Currently I can get my first fragment to show up when the app starts and when I click on each item in the drawer, the titles change; however, the fragment stays the same. Any

Navigation Drawer to switch activities instead of fragments

ⅰ亾dé卋堺 提交于 2019-11-26 10:08:15
问题 Is it possible to use a navigation drawer in android but instead of updating fragments, i would like to switch between activities as my means of navigation within the app. 回答1: Yes it is possible - it's what I did for my app. I already had a number of activities set up, and rather than convert them all to fragments, I wanted to tailor the navigation drawer to work across all of them. Unfortunately, it's not a quick workaround, so if you have the option of using fragments, I would go with that

How can I change separator color in NavigationView?

对着背影说爱祢 提交于 2019-11-26 09:23:12
问题 I\'m trying to use NavigationView to implement NavigationDrawer. I have added the separator by setting group id in menu. However I can\'t see the separator. I guess it is because the separator color is same as the background. So I want to change the separator color. But I find no way to change it. Can anyone help me? In screenshot, it seems have a room for separator between History and Settings , but you can\'t see it. activity_main.xml <?xml version=\"1.0\" encoding=\"utf-8\"?> <android

Navigation Drawer with backword compatibility android

时光怂恿深爱的人放手 提交于 2019-11-26 09:04:21
问题 I am having a application which is having four different activities. Now i want to add a navigation drawer in application to navigates those activities. Can any one give an example or tutorial for navigation drawer for different activity with back word compatibility.I have seen example for fragments but I need example for activities. 回答1: A new version of the v4 support library (release 13) which contains support for the Navigation Drawer pattern. Check out the below tutorial Links for

Navigation Drawer: set as always opened on tablets

自作多情 提交于 2019-11-26 08:54:55
问题 I am using the Navigation Drawer pattern from the support library: http://developer.android.com/training/implementing-navigation/nav-drawer.html I was trying to set it as always opened on tablet (as a side menu) Is that something possible with the current implementation, or do we have to create a new layout and a new structure with a Listview instead of reusing the same code? 回答1: Based on the idea of larger devices could have different layout files, I have created the follow project. https:/

How do I make DrawerLayout to display below the Toolbar?

孤人 提交于 2019-11-26 07:29:09
问题 How to make the drawer layout be below the actionbar/toolbar? I\'m using v7:21 app compat library with the new ToolBar view. Examples that I see looks like <android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:id=\"@+id/my_drawer_layout\" android:layout_width=\"match_parent\" android:layout_height=\"match_parent\"> <!-- drawer view --> <LinearLayout android:layout_width=\"304dp\" android:layout_height=\"match_parent\" android:layout

How to Display Navigation Drawer in all activities?

余生长醉 提交于 2019-11-26 07:26:57
问题 I have a Navigation Drawer which should appear in all my activities. I saw many questions similar to this & found a solution like Extending the MainActivity with the Other Activities . So i extended My Main Activity to my Second Activity.But the Drawer is not being showed in the Second Activity MainActivity public class MainActivity extends ActionBarActivity { private ListView mDrawerList; private DrawerLayout mDrawer; private CustomActionBarDrawerToggle mDrawerToggle; private String[]

Android 5.0 material design style navigation drawer for KitKat

喜夏-厌秋 提交于 2019-11-26 06:55:28
问题 I see that Android introduced new navigation drawer icons, drawer icon and back arrow icon. How can we use that in Kitkat supported apps. See Google\'s latest version of Newsstand app, which has the latest navigation drawer icons and animations. How can we implement that? I have tried setting the minSDK to 19 and complileSDK to 21 but it\'s using the old style icons. Is that self implemented? 回答1: You need to use the new Toolbar in the appcompat v21 and the new ActionBarDrawerToggle that is

How to change color of hamburger icon in material design navigation drawer

偶尔善良 提交于 2019-11-26 06:33:35
问题 I am following this example http://www.androidhive.info/2015/04/android-getting-started-with-material-design/ and in this example it is showing hamburger icon white,i want to customize it and make it black,but i am not able to find anything to how to change it,can any one tell how to customize it? Manifest <manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"info.androidhive.materialdesign\" > <uses-permission android:name=\"android.permission.INTERNET\"></uses

Android - Switch ActionBar Back Button to Navigation Button

霸气de小男生 提交于 2019-11-26 06:28:29
问题 I am having the following problem: I know how to set up a toolbar to show a back button icon instead of a burger button icon. From this: to this: using: getSupportActionBar().setDisplayHomeAsUpEnabled(true); Now, I want to do the reverse action, I want to go from back button icon to burger icon: to here: How can I do this? Update: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setSupportActionBar(mToolbar); getSupportActionBar()