简体   繁体   中英

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. Anyone knows how to do that? Is it possible to implement it without any support libraries. I already implemented 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

You can use material arc menu https://github.com/saurabharora90/MaterialArcMenu

Usage

Add a dependency to your 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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