Bottombar: Would be awesome to get the Material animation from the spec sheet.

Created on 17 Mar 2016  路  3Comments  路  Source: roughike/BottomBar

The spec sheet recommend using this kind of animation.

Would be awesome if you could implement it.

Thanks for your work BTW, it's a great lib.

enhancement

Most helpful comment

Will definitely implement that somehow.

And thanks, I really appreciate it.

All 3 comments

Will definitely implement that somehow.

And thanks, I really appreciate it.

FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

// we just would have to create 2 anim xml files with the animation.
transaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
transaction.replace(R.id.fragmentContainer, fragment);
transaction.commit();

Does somebody already has a similar animation?

Update: See response below

I've tried to get the same transition that we have in the spec. It looks more or less identical! Here my code:

anim/fade_out.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="@android:integer/config_shortAnimTime"
    android:fromAlpha="1"
    android:toAlpha="0"/>

anim/slide_in_up.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:duration="@android:integer/config_shortAnimTime"
        android:fromYDelta="5%p"
        android:toYDelta="0%p"/>

    <alpha
        android:duration="@android:integer/config_shortAnimTime"
        android:fromAlpha="0"
        android:toAlpha="1"/>
</set>

And in the fragmentManager set:

transaction.setCustomAnimations(R.anim.slide_in_up, R.anim.fade_out);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

avivcaspi picture avivcaspi  路  8Comments

german970814 picture german970814  路  8Comments

lamba92 picture lamba92  路  5Comments

rodrigobressan picture rodrigobressan  路  4Comments

zhangzhzh picture zhangzhzh  路  7Comments