【开源】BlurNavigationDrawer
BlurNavigationDrawer
- https://github.com/charbgr/BlurNavigationDrawer
介绍:
背景模糊的Navigation Drawer。可以设置参数达到不同的模糊效果。运行效果:
![]()
使用说明:
layout中声明
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<!-- If you don't use v7 support library include this: <com.charbgr.BlurNavigationDrawer.v4.BlurDrawerLayout app:drawerUpImageId="@drawable/ic_drawer ... > --><com.charbgr.BlurNavigationDrawer.v7.BlurDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" app:blurRadius="19" app:downScaleFactor="8.0" app:openDescription="@string/navigation_drawer_open" app:closeDescription="@string/navigation_drawer_close" app:toolbar="@+id/toolbarRef" ... > |
把
|
1
2
3
4
5
6
7
|
mDrawerToggle = new ActionBarDrawerToggle( getActivity(), /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */ R.string.navigation_drawer_open, /* "open drawer" description for accessibility */ R.string.navigation_drawer_close /* "close drawer" description for accessibility */); |
换成
|
1
2
3
4
5
6
7
|
mDrawerToggle = new BlurActionBarDrawerToggle( getActivity(), /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */ R.string.navigation_drawer_open, /* "open drawer" description for accessibility */ R.string.navigation_drawer_close /* "close drawer" description for accessibility */); |
然后设置你的radius和down scale factor
|
1
2
|
mDrawerToggle.setRadius(15);mDrawerToggle.setDownScaleFactor(6.0f); |
posted on 2015-05-04 10:35 wasdchenhao 阅读(197) 评论(0) 收藏 举报

浙公网安备 33010602011771号