Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Fonte Link

Aqui está a resposta:

scale_fab_in.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXScale="0"
    android:fromYScale="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1"
    android:toYScale="1"
    android:interpolator="@android:interpolator/overshoot"/>

scale_fab_out.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="400"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="0"
    android:interpolator="@android:interpolator/overshoot"/>

A partir daqui:

http://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318https://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

Aqui está a resposta:

scale_fab_in.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXScale="0"
    android:fromYScale="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1"
    android:toYScale="1"
    android:interpolator="@android:interpolator/overshoot"/>

scale_fab_out.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="400"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="0"
    android:interpolator="@android:interpolator/overshoot"/>

A partir daqui:

http://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

Aqui está a resposta:

scale_fab_in.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXScale="0"
    android:fromYScale="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1"
    android:toYScale="1"
    android:interpolator="@android:interpolator/overshoot"/>

scale_fab_out.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="400"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="0"
    android:interpolator="@android:interpolator/overshoot"/>

A partir daqui:

https://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

adicionou 384 caracteres ao conteúdo
Fonte Link
Cícero Moura
  • 1,1mil
  • 5
  • 10

Aqui está a resposta:

The button is just scaling from 0 to 1 with OvershootInterpolator. It should be something like this:scale_fab_in.xml

ScaleAnimation<?xml animversion="1.0" =encoding="utf-8"?>
<scale newxmlns:android="http://schemas.android.com/apk/res/android"
 ScaleAnimation(0,1,0,1);   android:duration="500"
anim.setFillBefore(true);    android:fromXScale="0"
anim.setFillAfter(true);    android:fromYScale="0"
anim.setFillEnabled(true);    android:pivotX="50%"
anim.setDuration(300);    android:pivotY="50%"
anim.setInterpolator(new OvershootInterpolator());   android:toXScale="1"
fab.startAnimation(anim);    android:toYScale="1"
    android:interpolator="@android:interpolator/overshoot"/>

http://developer.android.com/reference/android/view/animation/OvershootInterpolator.htmlscale_fab_out.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="400"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="0"
    android:interpolator="@android:interpolator/overshoot"/>

Respondida aquiA partir daqui:

http://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

Aqui está a resposta:

The button is just scaling from 0 to 1 with OvershootInterpolator. It should be something like this:

ScaleAnimation anim = new ScaleAnimation(0,1,0,1);
anim.setFillBefore(true);
anim.setFillAfter(true);
anim.setFillEnabled(true);
anim.setDuration(300);
anim.setInterpolator(new OvershootInterpolator());
fab.startAnimation(anim);

http://developer.android.com/reference/android/view/animation/OvershootInterpolator.html

Respondida aqui:

http://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

Aqui está a resposta:

scale_fab_in.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromXScale="0"
    android:fromYScale="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1"
    android:toYScale="1"
    android:interpolator="@android:interpolator/overshoot"/>

scale_fab_out.xml

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="400"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="0"
    android:toYScale="0"
    android:interpolator="@android:interpolator/overshoot"/>

A partir daqui:

http://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318

Fonte Link
Cícero Moura
  • 1,1mil
  • 5
  • 10

Aqui está a resposta:

The button is just scaling from 0 to 1 with OvershootInterpolator. It should be something like this:

ScaleAnimation anim = new ScaleAnimation(0,1,0,1);
anim.setFillBefore(true);
anim.setFillAfter(true);
anim.setFillEnabled(true);
anim.setDuration(300);
anim.setInterpolator(new OvershootInterpolator());
fab.startAnimation(anim);

http://developer.android.com/reference/android/view/animation/OvershootInterpolator.html

Respondida aqui:

http://stackoverflow.com/questions/27922191/floating-action-button-animation/27922318#27922318