Android页面圆形收起动画,Android的动画圆形菜单

CircularFloatingActionMenu

circularfab.gif

An animated, customizable circular floating menu for Android, inspired by Path app.

getting Started

RequirementsAPI> = 15

Installation

Grab the AAR from Maven Central by adding it as a dependency in your build.gradle file:dependencies {

compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'}

Alternatively, clone the repo and add library as a module to your project.

Usage

CircularFloatingActionMenu can be attached to any view in your layout.A Floating Action Button implementation is available in the library, with a similar look to new Material Design's FAB.

1 - Create a button to attach the menu :// in Activity ContextImageView icon =newImageView(this); // Create an iconicon.setImageDrawable( ... );FloatingActionButton actionButton =newFloatingActionButton.Builder(this)

. setContentView(icon)

. build();

2 - Create menu items :SubActionButton.Builder itemBuilder =newSubActionButton.Builder(this);// repeat many times:ImageView itemIcon =newImageView(this);

itemIcon.setImageDrawable( ... ); SubActionButton button1 = itemBuilder.setContentView(itemIcon).build();

3 - Create the menu with the items :FloatingActionMenu actionMenu =newFloatingActionMenu.Builder(this)

. addSubActionView(button1)

. addSubActionView(button2)

//.. .. attachTo(actionButton)

. build();

And you're ready to go!

Customization

Animations, start angle, end angle and radius are customizable via FloatingActionMenu.Builder.

FloatingActionMenu is the essential class for the menu.other two classes, FloatingActionButton and SubActionButton are just views and they can be replaced with any other view.you are completely free to create your own menu button and item views.

Existing FloatingActionButton and SubActionButton views are customizable too.these parameters can be changed via Builders of both classes :Theme (Light/Dark )

Background drawable

LayoutParams (width & height )

Content View

FloatingActionButton can be placed to one of 8 predefined positions on the screen.to place it somewhere else, extend it!

customizableButtons.png

customViews.png

Custom Animations

You can write your own animation handler class by extending from MenuAnimationHandler to completely customize menu opening and closing animations.

Then all you need is to create an instance of your custom animation handler and pass it to FloatingActionMenu.Builder via setAnimationHandler( ) method.

See CustomAnimationHandler in samples module for a sample animation handler.

Licence

CircularFloatingActionMenu is released under MIT Licence.see file LICENCE.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值