Support Floating Action Button transformation for Android

Overview

GitHub license Download

Fab Transformation

This library supports Floating Action Button transformation in Material Design Guideline.

Screenshot

Demo1 Demo2

Sample App

Get it on Google Play

Installation

Add the dependency (jcenter) to your build.gradle.

dependencies {
    compile 'konifar:fab-transformation:1.0.0'
}

How to use

This is footer toolbar transformation example.

Layout

  1. Put Floating Action Button and transform view in your layout.
  2. Wrap transform view in Circular reveal container.
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    <!-- Any Fab is OK. (Third party library, your custom view and so on) -->
    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        style="@style/FabMargin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:src="@drawable/ic_share_white_24dp"
        app:backgroundTint="@color/blue_accent200"
        app:borderWidth="0dp" />

    <!-- You must wrap transform view in Circular reveal container -->
    <io.codetail.widget.RevealFrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">

        <!-- Transform view -->
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar_footer"
            android:layout_width="match_parent"
            android:layout_height="@dimen/footer"
            android:background="@color/blue_accent200"
            android:visibility="invisible">
            <!-- Put view you like -->
        </android.support.v7.widget.Toolbar>

    </io.codetail.widget.RevealFrameLayout>
</RelativeLayout>

Java

Transform fab to other view.

FabTransformation.with(fab)
                 .transformTo(toolbarFooter);

Transform other view to fab.

FabTransformation.with(fab)
                 .transformFrom(toolbarFooter);

Options

FabTransformation.with(fab)
                 .overlay(overlayView)
                 .duration(500)
                 .setListener(new FabTransformation.OnTransformListener() {
                                @Override
                                public void onStartTransform() {
                                    // 
                                }

                                @Override
                                public void onEndTransform() {
                                    //
                                }
                 })
                 .transformFrom(toolbarFooter);

Requirements

Android 2.3+

Credits

This library use following libraries.

Developed By

Yusuke Konishi (konifar) - [email protected]

License

The MIT License (MIT)

Copyright (c) 2015 Yusuke Konishi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Failed to resolve: com.nineoldandroids:library:2.4.0+

    Failed to resolve: com.nineoldandroids:library:2.4.0+

    I am using compile 'konifar:fab-transformation:1.0.0' But suddenly it is showing "Failed to resolve: com.nineoldandroids:library:2.4.0+"

    As konifar:fab-transformation:1.0.0 is using "com.nineoldandroids:library:2.4.0+" ; what to do now?

    opened by sudarshaana 8
  • adjust the center of anim

    adjust the center of anim

    Smoother animation

    Hello, I have used your animation library, but I found the animation is a bit stiff, and fab's revealOn animation can not make transformView all covered out. So, I think of a way, is to revealOn center placed in the center of transformView, so that the animation transition is smoother. You can look at my code, I hope to be able to adopt, thank you.

    你好,我已经使用过你的动画库了,但是我发现你的动画有点僵直,而且fab的revealOn动画不能把transformView全部覆盖掉。所以,我想了一个方法,就是把revealOn的中心放置在transformView的中心,从而使这个动画过渡更加平滑了。你可以看一下我的代码,希望能够采纳,谢谢你。

    opened by qiaoyunrui 7
  • Need ability to cancel animation when a view is destroyed

    Need ability to cancel animation when a view is destroyed

    When this view is used in a RecyclerView and the view detached due to user scrolling then it results in a crash. If the FabTransformation.Builder#transformFrom(..) or transformTo can return the Animator then we can cancel the transformation when the view is detached.

    Fatal Exception: java.lang.IllegalStateException: Cannot start this animator on a detached view!
           at android.view.RenderNode.addAnimator(RenderNode.java:812)
           at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300)
           at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282)
           at android.animation.RevealAnimator.<init>(RevealAnimator.java:37)
           at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:55)
           at com.konifar.fab_transformation.animation.FabAnimatorLollipop.revealOn(FabAnimatorLollipop.java:53)
           at com.konifar.fab_transformation.animation.FabAnimator$1.onAnimationEnd(FabAnimator.java:64)
           at com.konifar.fab_transformation.animation.FabAnimatorLollipop$4.onAnimationEnd(FabAnimatorLollipop.java:141)
           at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1114)
           at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239)
           at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766)
           at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
           at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
           at android.view.Choreographer.doCallbacks(Choreographer.java:670)
           at android.view.Choreographer.doFrame(Choreographer.java:603)
           at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
           at android.os.Handler.handleCallback(Handler.java:746)
           at android.os.Handler.dispatchMessage(Handler.java:95)
           at android.os.Looper.loop(Looper.java:148)
           at android.app.ActivityThread.main(ActivityThread.java:5443)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    
    opened by slashrootv200 0
  • View itself moving aside inside the layout.

    View itself moving aside inside the layout.

    I have two layouts inside the card view. I've set the transformation with Button to the another view and in that view the another button again traverse to the older view. The problem is both the buttons(Point of origin) which starts animations is moved when going back and forth. Its makes little bit enlarged and moved towards the end view of the transformations. Help me out !

    opened by ArunPandiyan 0
  • Slow animation

    Slow animation

    I'm trying the sheet reveal, but the animation is very slow. Any idea on how to improve it? I'm seeing this on my emulators as well as my own device which is API 23 Moto X Pure edition.

    opened by hatpick 0
  • Animation

    Animation

    Hi,

    Both in my testing application using your library and in your example application, the animation is not flowing. In particular, for the left side of the toolbar (or the top of the sheet) the end of the animation is jerky.

    Could you please give it a look?

    Thanks in advance. Marcello

    opened by marbat87 7
Owner
Yusuke Konishi
I'll be back.
Yusuke Konishi
MIPagerTransformer is an android library that provides a seamless image transformation experience.

MIPagerTransformerView -- MIPagerTransformer is an android library that provides a seamless image transformation experience. Overview ?? Shutter ?? Pa

MindInventory 21 Sep 17, 2022
Chandrasekar Kuppusamy 799 Nov 14, 2022
Android Library To Create Button With Multi Reactions like Facebook or Linkedin

ReactButton Android Library written in Java to Create ReactButton with Multi Reactions like Facebook or Linkedin ?? Default Reactions ?? Custom Reacti

Amr Hesham 103 Dec 15, 2022
A Toggling Add/Remove button

Cross View Add a CrossView to your layout <cdflynn.android.library.crossview.CrossView android:id="@+id/sample_cross_view" android

Collin Flynn 321 Nov 25, 2022
Backarrow-animation-example - Animate back arrow to close button in Compose using animated drawables

Animate Back Arrow to Close Icon in Compose This is a simple demo for animated v

Jose Mateo 3 Feb 17, 2022
Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

Codesoup 161 Jan 1, 2023
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

Stfalcon LLC 1.9k Jan 5, 2023
Support extension to use Android ViewBinding quickly and smooth transform from kotlin-synthetic-extension.

ViewBinding Delegate Extension Support extension to use Android ViewBinding quickly and smooth transform from kotlin-synthetic-extension. Binding inst

Cuong V. Nguyen 3 Dec 13, 2021
Image-search - An Image search android app with offline support

image-search Image search app built using bing image search API via paging 3. Fe

Suraj Vaishnav 3 Feb 17, 2022
A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.

PhotoEditor A Photo Editor library with simple, easy support for image editing using Paints, Text, Filters, Emoji and Sticker like stories. Features D

Burhanuddin Rashid 3.6k Jan 9, 2023
3D animation examples for support-v4 Fragment transition.

FragmentAnimations Animation examples for support.v4.Fragment transition. These animations do not depends on any external libraries. Usage Example In

Keita Kajiwara 1.1k Dec 14, 2022
A library support circular imageview with rotation animation

Circular Imageview with Rotate Animation This is a fast and efficient open source custom imageview for Android that allow to easy implement disc anima

Nhien Nguyen 5 Jul 24, 2022
A Flutter plugin thats support share files to social media like TikTok, Instagram, Facebook, WhatsApp, Telegram and more others...

Social Share Kit A Flutter plugin that's support share files to social media like Tiktok, Instagram, Facebook, WhatsApp, Telegram and more. This plugi

Kaique Gazola 2 Sep 2, 2022
A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android

android-flip Aphid FlipView is a UI component to accomplish the flipping animation like Flipboard does. A pre-built demo APK file for Android OS 2.2+

Bo 2.8k Dec 21, 2022
:rocket: Ultimate Android Reference - Your Road to Become a Better Android Developer

The goal of this project is to provide a hand-picked collection of Android libraries, tools, open-source projects, books, blogs, tutorials - you name

Aritra Roy 7.6k Jan 4, 2023
Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.

1. Add dependency dependencies { implementation 'com.hbb20:android-country-picker:X.Y.Z' } For latest version, 2. Decide your use-case

Harsh B. Bhakta 65 Dec 6, 2022
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
Actions for android animations. Inspired by libgdx scene2d actions.

Android Animations Actions Actions for android animations. Inspired by libgdx scene2d actions. The main goal of this project is making creating of com

dtx12 137 Nov 29, 2022
Android library for swipable gestures

Swipper Android Library for custom views to control brightness , volume and seek through swipable gestures . These views could easily replace the conv

Mobile Development Group 105 Dec 30, 2022