drawerlayout

In Robolectric, how do I get around DrawerLayout must be measured with MeasureSpec.EXACTLY error?

こ雲淡風輕ζ 提交于 2019-11-30 06:18:47
I'm trying to add a DrawerLayout to my application for navigation, and I'm testing my application with Robolectric (I've seen this problem both with Robolectric 2.1.1 and 2.1-SNAPSHOT - 2.2-20130712.161723-17) I'm using the following xml for the base of my drawer layout. I encounter the error in Robolectric when I have the andioid:layout_width or android:layout_height set to be "match_parent" on the Drawer Layout. <?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

DrawerLayout on top of Actionbar

自闭症网瘾萝莉.ら 提交于 2019-11-30 04:40:13
问题 When using the drawer layout is there a way to overlay the drawer view over the action bar? I do not want to hide the action bar when the drawer is shown. I want the action bar to simply stay put, but be sent to the background. An example of this is the iOS Play Music app... My current implementation hides and shows the action bar when the drawer state changes, but I do not like this user experience. public void onDrawerClosed(View view) { getActionBar().show(); invalidateOptionsMenu(); }

ActionBarActivity with ActionBarDrawerToggle - Not using drawerImageRes

老子叫甜甜 提交于 2019-11-30 03:39:49
Working from this android example, I've attempted to create an app that uses the support version (android.support.v4 and android.support.v7). The example creates a menu drawer that looks like this and my code gets this Notice the icon is different and the way it moves is different, well in my version it doesn't move. Example code public class MainActivity extends Activity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; private CharSequence mDrawerTitle; private CharSequence mTitle; private String[] mPlanetTitles; @Override

How to disable DrawerLayout Shadow

十年热恋 提交于 2019-11-30 01:56:54
问题 I am trying to disable the DrawerLayout shadow and i am not finding the relevant answer. can anyone please assist thanks in advance i have also tried setDrawerLayout(null,Gravity.Left) but it still does not work 回答1: mDrawerLayout.setScrimColor(Color.TRANSPARENT); I'm Assuming that's what you mean. The shadow on the drawers (in between the drawer and the background content) is disabled by default and can be set with the setDrawerShadow(Drawable shadowDrawable, int gravity) setDrawerShadow(int

vertical DrawerLayout or SlidingPaneLayout

你。 提交于 2019-11-29 20:52:51
The latest Android Support Library introduced the DrawerLayout to implement the common UX pattern where you slide right or left to show a navigation menu. What I'd love to have is a vertical DrawerLayout with the same API, that can be pulled down/up from the top/bottom of my layout. Since 4.2 the old SlidingDrawer has been deprecated and I haven't heard about some new Widget that implements the same functionality. Can the DrawerLayout be extended somehow to implement the vertical swipe UX pattern? Does google provide some different widget to implement it? Google Music for instance has

Runtime DrawerLayout must be measured with MeasureSpec.EXACTLY excpetion

痴心易碎 提交于 2019-11-29 10:04:58
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 hardcoding my height and width if possible. The beginning of the file looks like this. This way, it crushes.

What do you need to pass to v4.widget.DrawerLayout.isDrawerOpen()/.openDrawer()/.closeDrawer()

心已入冬 提交于 2019-11-29 09:06:20
I've been trying to move my code across to the DrawerLayout as suggested by android here as SlidingDrawer is deprecated. My problem is that so far DrawerLayout seems to be either very badly implemented, has unhelpful error messages (no defensive programming) and/or isn't explained well enough in the documentation. the isDrawerOpen() method is described here : public boolean isDrawerOpen (View drawer) Check if the given drawer view is currently in an open state. To be considered "open" the drawer must have settled into its fully visible state. To check for partial visibility use isDrawerVisible

Android - How to implement a NavigationDrawer that is partially visible at all times?

喜夏-厌秋 提交于 2019-11-29 07:33:06
I would like to have a NavigationDrawer in my Android project that shows the ListView partially at all times, and the items are also clickable, but when the user drags the drawer full ListView appears. Below image is what I'm trying to achieve: First one is the "Normal view" where you can see the small icons. Second one is when the user slides the navigation drawer so that it opens. Third one is when back in the normal view the user clicks A and C, so that the icons change their colour. Any recommendations how to do this? Thanks for answering :) I came across this open source library, https:/

In Robolectric, how do I get around DrawerLayout must be measured with MeasureSpec.EXACTLY error?

坚强是说给别人听的谎言 提交于 2019-11-29 06:07:15
问题 I'm trying to add a DrawerLayout to my application for navigation, and I'm testing my application with Robolectric (I've seen this problem both with Robolectric 2.1.1 and 2.1-SNAPSHOT - 2.2-20130712.161723-17) I'm using the following xml for the base of my drawer layout. I encounter the error in Robolectric when I have the andioid:layout_width or android:layout_height set to be "match_parent" on the Drawer Layout. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout

How to show the DrawerLayout when sliding from left to right, no matter where?

六眼飞鱼酱① 提交于 2019-11-29 04:23:10
background google has introduced the DrawerLayout, which shows a menu on the left area of the screen when you click on the "up" button of the action bar. because the library isn't supported yet on actionBarSherlock, there is already a way to overcome it using this project . it already has variants on many apps: currents, gmail, hangouts, youtube... the question on the "currents" app (and in youtube) , when the user slides the (most-left) page from left to right , the DrawerLayout appears, no matter where the finger has started the touch . how can i achieve the same effect? maybe i should use