Android Open Source - Android-ParallaxHeaderViewPager Parallax Image View






From Project

Back to project page Android-ParallaxHeaderViewPager.

License

The source code is released under:

Apache License

If you think the Android project Android-ParallaxHeaderViewPager 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 com.flavienlaurent.notboringactionbar;
//  w ww  . j a  va2 s  . c o  m
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * Created by f.laurent on 21/11/13.
 * antoine-merle.com inspiration
 */
public class ParallaxImageView extends ImageView {

    private int mCurrentTranslation;

    public ParallaxImageView(Context context) {
        super(context);
    }

    public ParallaxImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ParallaxImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setCurrentTranslation(int currentTranslation) {
        mCurrentTranslation = currentTranslation;
        invalidate();
    }

    @Override
    public void draw(Canvas canvas) {
        canvas.save();
        canvas.translate(0, -mCurrentTranslation / 2)  ;
        super.draw(canvas);
        canvas.restore();
    }
}




Java Source Code List

com.astuetz.PagerSlidingTabStrip.java
com.flavienlaurent.notboringactionbar.AlphaForegroundColorSpan.java
com.flavienlaurent.notboringactionbar.KenBurnsSupportView.java
com.flavienlaurent.notboringactionbar.ParallaxImageView.java
com.kmshack.newsstand.MainActivity.java
com.kmshack.newsstand.SampleListFragment.java
com.kmshack.newsstand.ScrollTabHolderFragment.java
com.kmshack.newsstand.ScrollTabHolder.java