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();
已下载
0