Android-Material-Design相关用法
1.DrawerLayout 侧滑布局
To use a DrawerLayout, position your primary content view as the first child with a width and height of match_parent. Add drawers as child views after the main content view and set the layout_gravity appropriately. Drawers commonly use match_parent for height with a fixed width.
有两点需注意:主内容布局放在第一个,侧滑布局放在其后面,且包含layout_gravity这种侧滑位置
DrawerLayout.DrawerListener
can be used to monitor the state and motion of drawer views. Avoid performing expensive operations such as layout during animation as it can cause stuttering; try to perform expensive operations during theSTATE_IDLE
state.DrawerLayout.SimpleDrawerListener
offers default/no-op implementations of each callback method.
DrawerLayout.DrawerListener能监听侧滑过程,在回调中不要做费事操作.DrawerLayout.SimpleDrawerListener提供了默认操作,
ActionBarDrawerToggle实现了DrawerListener,提供滑动过程中actionbar的动画效果.
DrawerLayout.closeDrawer方法用于隐藏侧边菜单,DrawerLayout.openDrawer方法用于展开侧边菜单
未完待续…