drawerlayout

Fullscreen navigation drawer

无人久伴 提交于 2019-11-29 04:20:40
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="true"> <include android:id="@+id/toolbar_layout" layout="@layout/app_toolbar" android:layout_width=

ActionBarActivity with ActionBarDrawerToggle - Not using drawerImageRes

扶醉桌前 提交于 2019-11-29 01:09:47
问题 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

Android Material风格的应用(三)--DrawerLayout

泄露秘密 提交于 2019-11-28 22:08:34
添加抽屉导航 Android Material风格的应用(一)--AppBar TabLayout Android Material风格的应用(二)--RecyclerView Android Material风格的应用(三)--DrawerLayout Android Material风格的应用(四)--FloatActionButton Android Material风格的应用(五)--CollapsingToolbar 工程源码 创建导航菜单 res/menu/menu-natigation.xml <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:icon="@drawable/ic_home_black_24dp" android:tint="@color/button_grey" android:title="One" /> <item android:icon="@drawable/ic_favorite_black_24dp" android:tint="@color/button_grey" android:title="Two"/> <item android

Android MapView overlaps DrawerLayout

怎甘沉沦 提交于 2019-11-28 21:34:30
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.4 (API 15) HTC Desire A9191 , Android 2.3.5 (API 10) There is no issue on such devices: Samsung Galaxy

How to open Drawer Layout only with button?

最后都变了- 提交于 2019-11-28 20:56:05
I'm working on application that has a tab structure, and use sliding movements to move through the tabs. But now, I want to apply Drawer Layout. The problem is that the Drawer has slide to open events. How I can delete this event? My idea was that the Drawer only could open and close with a button. Is this possible? Thanks! Just write drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); to prevent menu from listening to gesture and use openDrawer and closeDrawer to change menu visibility By default the DrawerLayout is initially hidden from the view unless you put a code to open the

Navigation drawer and view pager in same activity

心已入冬 提交于 2019-11-28 17:55:27
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="fill_parent" > </android.support.v4.view.ViewPager> <android.support.v4.widget.DrawerLayout xmlns:android

Is it possible to use something other than a listview as sliding drawer in drawerlayout

此生再无相见时 提交于 2019-11-28 16:51:20
I would like to have for example a LinearLayout or a RelativeLayout sliding from the left of the screen instead of a lone ListView . I tried to use à LinearLayout with android:layout_gravity="start" and i had this error at runtime: ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout$LayoutParams here's the layout file: <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" android

Method setDrawerListener is deprecated

旧时模样 提交于 2019-11-28 15:13:28
问题 While I'm doing something on my app, I see that the navigation drawer on my app reduced its size. But I'm not doing anything on that. Then, after checking the code, I saw that setDrawerListener is deprecated. Does anyone has a solution to this? Any help will do. Thank you in advance! drawerLayout.setDrawerListener(actionBarDrawerToggle); 回答1: Use addDrawerListener() instead. 回答2: Replace: drawer.setDrawerListener(...); with drawer.addDrawerListener(...); public void setDrawerListener

Wrong size and click behavior for Views in DrawerLayout

强颜欢笑 提交于 2019-11-28 14:22:58
I have a layout for an Activity that I'm trying to add a navigation drawer to. The problem is, to work properly, I need to use: <android.support.v4.widget.DrawerLayout instead of: <RelativeLayout but it messes things up. My ProgressBar becomes much bigger, my RecyclerView doesn't work, the app logs me out when I click something, etc. My layout XML: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.st.mf.UserAreaActivity" android:layout_width=

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