drawerlayout

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

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

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

半城伤御伤魂 提交于 2019-11-28 02:27:19
问题 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

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

我与影子孤独终老i 提交于 2019-11-28 01:35:46
问题 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

Navigation drawer and view pager in same activity

守給你的承諾、 提交于 2019-11-27 20:12:56
问题 I am trying to implement both navigation drawer and view pager in same activity. Navigation drawer works fine but the view pager is not working, also i am getting null pointer on right swipe when navigation drawer is opened (Null pointer at android. support. v4. widget. DrawerLayout. isContentView(DrawerLayout.java:840). I am attaching the main xml layout and code below. <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="fill_parent" android:layout_height=

Moving and resizing DrawerLayout's content on sliding

有些话、适合烂在心里 提交于 2019-11-27 19:11:57
I just came across this app and saw this custom animation for a DrawerLayout . I'm guessing it has to take a screenshot first, then draw a custom View in the Activity , but I'm not sure about that, nor the details. Does anyone know how to do this? You can do this by translating and scaling the content View in the onDrawerSlide() method of a DrawerListener on your DrawerLayout . Since the content View itself is resizing, and there's a separate TextView that appears in the bottom right corner, we'll stick both of these in another holder ViewGroup . If that label TextView isn't needed, the holder

Fullscreen navigation drawer

我们两清 提交于 2019-11-27 18:25:39
问题 I have a navigation drawer like this. What I want to do is open my drawer to fullscreen not half screen. How do I make this drawer to open as full screen? This is xml of drawerlayout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows=

How to implement a DrawerLayout with a visible handle

点点圈 提交于 2019-11-27 18:09:54
I have successfully implemented a NavigationDrawer for my application. My app displays a drawer that opens on the left of the screen. My problem is I need to add a button on the left. That button might be clicked or swiped to open the left drawer. That I can do. But the button is supposed to look like it's a part of the drawer that would overflow into the screen. That means the button should slide simultaneously as the drawer opens and closes. CLOSED STATE : OPENING STATE I tried adding the button into the left drawer's layout, but it seems you can't make stuff appear outside of its boundaries

DrawerLayout - Exception dispatching input event

最后都变了- 提交于 2019-11-27 14:00:24
问题 I recently started using the DrawerLayout in a new project about a week ago and it's all working fine. Apart from the odd times when swiping it in and out with my finger it'll crash. If I use the ActionBar Up/Home MenuItem though, it'll work fine every time. In LogCat i get two stacktraces that both seem to point to internal android places, so I don't quite know what to do to solve this. I just tried creating a new application to see if it was something I was doing before that was causing

Android MapView overlaps DrawerLayout

只谈情不闲聊 提交于 2019-11-27 13:58:05
问题 I have simple layout structure: DrawerLayout \-- FrameLayout // @+id/fragment_container \-- ListView // @+id/drawer_list By clicking of any drawer item I'm inserting/replacing fragment via FragmentTransaction.replace() into R.id.fragment_container with corresponding Fragment instance. One of those Fragments contains MapView . And it has rendering problems on different devices, but at the same time DDMS shows me right screenshot. EDITED Issue appears on such devices: Huawei U9508 , Android 4.0