navigation-drawer

gridview and navigation drawer not working together in android

混江龙づ霸主 提交于 2019-11-28 06:18:24
问题 I have downloaded code for gridview and code for navigation bar. Both codes are working fine individually but when I am trying to combine them its giving a runtime error "Unfortunately App Has Stopped". Below is my code : MainActivity.java public class MainActivity extends Activity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; private CharSequence mDrawerTitle; private CharSequence mTitle; private String[] mPlanetTitles;

Blur background of Navigation Drawer

久未见 提交于 2019-11-28 05:35:16
How would I go about create a live blur on a Navigation Drawer, so when you pull out the drawer the background of the list is blurred background of the fragment displayed behind it? I have looked but mainly found BitMap blurs, and nothing that is live. Tas Morf The process involves the following stages: Get a snapshot of the whole drawer layout. Crop it to the exact size of your menu. Downscale it quite a bit (a factor of 8 is pretty good). Blur that image. Have a custom view that displays part of an image right behind of where your menu will appear. As you slide the drawer show a larger part

Full width Navigation Drawer

你。 提交于 2019-11-28 04:54:46
I'd like to create a full width navigation drawer. Setting layout_width to match_parent on @+id/left_drawer yields in width of about 80% of screen space. This seems to be the standard behavior. Do I have to override onMeasure() of DrawerLayout ? My current code: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android

Disable hamburger to arrow animation

廉价感情. 提交于 2019-11-28 04:52:05
问题 I am trying to implement a two-drawer layout with the android v7 support library. I have a navigation drawer on the left (Gravity.START) side and a notification drawer on the right (Gravity.END) side. The problem is that I need the hamburger in the action bar to stay a hamburger when the notification drawer is pulled out, but stay animated and change to an arrow if the navigation drawer is pulled out. Currently it changes to an arrow when either one is pulled out. I have successfully disabled

Navigation drawer change color

你说的曾经没有我的故事 提交于 2019-11-28 04:50:59
问题 I am using Navigation drawer using this example. I want just change blue color to orange color how could I do this? I mean change listview selector color, actionbar selctor color everything. 回答1: You have to do 2 things for this. for listview create your customize listview selector (see answer @raghunandan ) for actionbar Go here create your style and set your style from manifest, set your application theme your created style 回答2: You can use a selector in drawable folder have selector.xml as

How to replace the hamburger icon used for ActionBarToggle on Android Toolbar with a custom drawable?

。_饼干妹妹 提交于 2019-11-28 04:41:27
I have implemented a basic ActionBarDrawerToggle using the new Toolbar in Android 5.0. However, I am unable to figure out how to change the default hamburger icon that is supplied. From the android documentation it says that "the given Activity will be linked to the specified DrawerLayout and the Toolbar's navigation icon will be set to a custom drawable... This drawable shows a Hamburger icon when drawer is closed and an arrow when drawer is open. It animates between these two states as the drawer opens." I currently have this all working correctly with the following code, however I want to

Android: NavigationDrawer/multiple activities/same menu

时光怂恿深爱的人放手 提交于 2019-11-28 03:52:11
What I am trying to do, is have a NavigationDrawer menu like this: NavigationDrawer I've figured out how to change layouts when menu items are clicked, but how do I load a new activity without losing the menu? My main question: For example let's say one of my menu options takes you to a layout where there are some buttons that do something. I need to load an accompanying activity/class, that will handle the actions and functionality of that specific "page" in the App. If another menu option takes you to a layout with only an image, for example, that would be another activity without all that

Runtime DrawerLayout must be measured with MeasureSpec.EXACTLY excpetion

ぐ巨炮叔叔 提交于 2019-11-28 03:25:48
问题 I'm following this tutorial from and I'm facing with a strange problem. It doesn't matter what's in my DrawerLayout , but if its layout_height or layout_width are set to anything other than hardcoded number, it throws this runtime exception. I've seeing plenty of reports of this error thrown when trying to render an output in the Graphical Layout tool, but couldn't find any on a runtime error. I have the latest support library, updated just now to version 21.0.2 I would like to avoid

push activity on the right when open drawer

天大地大妈咪最大 提交于 2019-11-28 03:08:55
I have implemented drawerlayout which slides from the right but it does not shift the activity the right like facebook does (See below image). How do I push the current activity to the right side when user taps on opendrawer button like in the above image.Currently it appears on top of activity and drops shadow.I really appreciate any help . Thanks in advance. I don't think you can implement it with the stock DrawerLayout , however with SlidingMenu you can, the GitHub repo here should explain all you need Although there is no default way to slide the activity along with navigation drawer we

DrawerLayout's item click - When is the right time to replace fragment?

旧时模样 提交于 2019-11-28 03:06:17
I'm developing an application which uses the navigation drawer pattern (With DrawerLayout). Each click on a drawer's item, replaces the fragment in the main container. However, I'm not sure when is the right time to do the fragment transaction? When the drawer starts closing? Or after it is closed? In google's documentaion example , you can see that they are doing the transaction right after the item click, and then close the drawer. As a result, the drawer seems laggy and not smooth, and it looks very bad (It happens in my application too). In Gmail and Google Drive applications, on the other