简体   繁体   English

如何在Android中实现弧形菜单动画

[英]How to implement arc menu animation in android

I am trying to implement one arc menu similar to this 我正在尝试实现一个类似于此的弧形菜单

I have one FloatingActionButton as shown in this demo , on clicking on that , 4 circle buttons should pop up with slow animation. 我有一个FloatingActionButton ,如本演示中所示,在单击该按钮时,应该弹出4个圆圈的按钮并显示慢速动画。 Anyone knows how to do that? 有人知道该怎么做吗? Is it possible to implement it without any support libraries. 是否有可能在没有任何支持库的情况下实现它。 I already implemented FloatingActionButton . 我已经实现了FloatingActionButton

See this library 看到这个图书馆

Include in your layout like this 这样包含在您的布局中

<com.capricorn.ArcMenu
     android:id="@+id/arc_menu_2"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     arc:fromDegrees="@dimen/menuFromDegrees"
     arc:toDegrees="@dimen/menuToDegrees"
     arc:childSize="@dimen/menuChildSize"/>

I have used following in by taking just necessary classes in project so no need to have un used classes you also have look 我通过在项目中仅学习必要的类来使用以下内容,因此无需使用未使用的类,

https://github.com/daCapricorn/ArcMenu https://github.com/daCapricorn/ArcMenu

You can use material arc menu https://github.com/saurabharora90/MaterialArcMenu 您可以使用材质弧菜单https://github.com/saurabharora90/MaterialArcMenu

Usage 用法

Add a dependency to your build.gradle: 向您的build.gradle添加一个依赖项:

dependencies {
compile 'com.sa90.materialarcmenu:library:1.3'

}



<com.sa90.materialarcmenu.ArcMenu
    android:id="@+id/arcMenu"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    app:menu_scr="@drawable/ic_dialog_dialer"
    app:menu_open="arc_left">

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab1"
        android:layout_width="wrap_content"
        android:src="@drawable/ic_dialog_email"
        android:layout_height="wrap_content" />

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:src="@drawable/ic_dialog_alert"
        android:layout_height="wrap_content" />

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:src="@drawable/ic_dialog_info"
        android:layout_height="wrap_content" />

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:src="@drawable/ic_dialog_map"
        android:layout_height="wrap_content" />

</com.sa90.materialarcmenu.ArcMenu>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM