Android Open Source - StikkyHeader Icon Action Bar Animator






From Project

Back to project page StikkyHeader.

License

The source code is released under:

Apache License

If you think the Android project StikkyHeader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package it.carlom.stickyheader.example.animator;
/* ww w .j a  v a  2 s.  c  o  m*/
import android.app.Activity;
import android.view.View;

import it.carlom.stikkyheader.core.animator.AnimatorBuilder;
import it.carlom.stikkyheader.core.animator.HeaderStikkyAnimator;


public class IconActionBarAnimator extends HeaderStikkyAnimator {

    private final int resIdLayoutToAnimate;
    private final View homeActionBar;


    public IconActionBarAnimator(final Activity activity, int resIdLayoutToAnimate) {

        this.resIdLayoutToAnimate = resIdLayoutToAnimate;

        homeActionBar = activity.findViewById(android.R.id.home);

    }

    @Override
    public AnimatorBuilder getAnimatorBuilder() {

        View mViewToAnimate = getHeader().findViewById(resIdLayoutToAnimate);

        AnimatorBuilder animatorBuilder = AnimatorBuilder.create()
            .applyScale(mViewToAnimate, AnimatorBuilder.buildViewRect(homeActionBar))
            .applyTranslation(mViewToAnimate, AnimatorBuilder.buildViewRect(homeActionBar));

        return animatorBuilder;
    }
}




Java Source Code List

it.carlom.stickyheader.example.MainActivity.java
it.carlom.stickyheader.example.animator.IO2014HeaderAnimator.java
it.carlom.stickyheader.example.animator.IconActionBarAnimator.java
it.carlom.stickyheader.example.fragment.ActionBarImageFragment.java
it.carlom.stickyheader.example.fragment.FadeOutInterpolatedFragment.java
it.carlom.stickyheader.example.fragment.IO2014HeaderFragment.java
it.carlom.stickyheader.example.fragment.MainFragment.java
it.carlom.stickyheader.example.fragment.ParallaxStikkyFragment.java
it.carlom.stickyheader.example.fragment.SimpleStikkyFragment.java
it.carlom.stikkyheader.core.HeaderAnimator.java
it.carlom.stikkyheader.core.StikkyHeaderBuilder.java
it.carlom.stikkyheader.core.StikkyHeader.java
it.carlom.stikkyheader.core.animator.AnimatorBuilder.java
it.carlom.stikkyheader.core.animator.BaseStickyHeaderAnimator.java
it.carlom.stikkyheader.core.animator.HeaderStikkyAnimator.java