drawerlayout

Moving and resizing DrawerLayout's content on sliding

此生再无相见时 提交于 2019-11-26 22:47:00
问题 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? 回答1: 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

How do I make DrawerLayout to display below the Toolbar?

只愿长相守 提交于 2019-11-26 19:59:33
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_gravity="left|start"> <!-- drawer content --> </LinearLayout> <!-- normal content view --> <LinearLayout android:layout

今日头条

一世执手 提交于 2019-11-26 17:37:09
<resources> <string name="app_name">头条</string> <string name="openDrawer">今日头条</string>\ <string name="closeDrawer">用户目录</string> </resources> /****/ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@mipmap/splash"/> </LinearLayout> /**splash <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns

ClassCastException android.widget.FrameLayout$LayoutParams to android.support.v4.widget.DrawerLayout$LayoutParams

删除回忆录丶 提交于 2019-11-26 16:04:41
问题 I'm working on the Navigation Drawer for Android. As per my requirement I was to display gridview and listview of items in the navigation drawer. I have created a linearLayout in the layout xml file and placed the two widgets(Grid view, and Listview) in the LinearLayout. When I run the file I'm getting the following error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.navigationdrawer3/com.example.navigationdrawer3.MainActivity}: java.lang.ClassCastException:

How to detect that the DrawerLayout started opening?

三世轮回 提交于 2019-11-26 15:51:54
问题 So I have tabs that I want to hide when the Navigation Drawer starts opening. The code I have hides them when it finished opening, but it's not what I want. mDrawerToggle = new ActionBarDrawerToggle( this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close ) { @Override public void onDrawerClosed(View view) { invalidateOptionsMenu(); setActionBarMode(ActionBar.NAVIGATION_MODE_TABS); } @Override public void onDrawerOpened(View drawerView) { invalidateOptionsMenu()

How animate Burger to Arrow with Appcompat v7 21, Toolbar and DrawerLayout

本秂侑毒 提交于 2019-11-26 15:37:46
问题 I am using the android.support.v7.widget.Toolbar with a android.support.v4.widget.DrawerLayout. It works fine, the Burger icon is shown when the Navigation Drawer is closed, and the Arrow icon is shown when the Drawer is open. I want to disable the drawer and animate the Burger icon into Arrow on some event in the app. I have tried to set the lock mode to closed, but the v7.app.ActionBarDrawerToggle is still showing the Burger and it opens the Drawer. mDrawerLayout.setDrawerLockMode

DrawerLayout Double Drawer (Left and Right Drawers simultaneously)

╄→гoц情女王★ 提交于 2019-11-26 15:03:26
I have an application, in which i want to implement a double drawer - one from the left and one from the right. Left drawer is for app navigation, right drawer is for result filtering. So, the layout is like this: <?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"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match

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 customize item background and item text color inside NavigationView?

安稳与你 提交于 2019-11-26 06:18:48
问题 I wanna achieve something like this shown in the Material Design Docs. colorControlHighlight is used for the Background on checked items. I need to customize: background unchecked text color checked text color unchecked 回答1: NavigationDrawer (NavigationView) has three options for configuration of checked/selected items. app:itemIconTint="@color/menu_text_color" //icon color app:itemTextColor="@color/menu_text_color" //text color app:itemBackground="@drawable/menu_background_color" /

DrawerLayout Double Drawer (Left and Right Drawers simultaneously)

限于喜欢 提交于 2019-11-26 04:09:08
问题 I have an application, in which i want to implement a double drawer - one from the left and one from the right. Left drawer is for app navigation, right drawer is for result filtering. So, the layout is like this: <?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\"> <LinearLayout xmlns:android