【开源】FilterMenu
FilterMenu
- https://github.com/linroid/FilterMenu
介绍:
动画效果非常生动的菜单,是根据dribbble上的概念设计而来:https://dribbble.com/shots/1956586-Filter-Menu,非常不错运行效果:
![]()
使用说明:
在布局文件中添加FilterMenuLayout
<com.linroid.filtermenu.library.FilterMenuLayout android:id="@+id/filter_menu" android:layout_width="match_parent" android:layout_height="match_parent" android:elevation="8dp" custom:expandedRadius="96dp" custom:collapsedRadius="24dp" custom:centerBottom="50dp" custom:centerRight="50dp" custom:primaryColor="#ff37aa4a" custom:primaryDarkColor="#ff20622b"> </com.linroid.filtermenu.library.FilterMenuLayout>
属性
<!--circle radius size when menu expanded--> custom:expandedRadius <!--circle radius size when menu collapsed--> custom:collapsedRadius <!--set the position of circle, the menu will auto align. You should only set two directions at most.--> custom:center[Left|Top|Right|Bottom] <!--primary color--> custom:primaryColor <!--color of inner circle when menu expanded--> custom:primaryDarkColor
在java代码中初始化菜单
FilterMenuLayout layout = (FilterMenuLayout) findViewById(R.id.filter_menu);
FilterMenu menu = new FilterMenu.Builder(this)
.addItem(R.drawable...)
.addItem(R.drawable...)
.attach(layout)
.withListener(new FilterMenu.OnMenuChangeListener() {
@Override
public void onMenuItemClick(View view, int position) {
}
@Override
public void onMenuCollapse() {
}
@Override
public void onMenuExpand() {
}
})
.build();
posted on 2015-04-29 10:17 wasdchenhao 阅读(231) 评论(0) 收藏 举报

浙公网安备 33010602011771号