Android Open Source - Android-ParallaxHeaderViewPager Parallax Image View

From Project

Back to project page Android-ParallaxHeaderViewPager.


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.util.AttributeSet;
import android.widget.ImageView;

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

    private int mCurrentTranslation;

    public ParallaxImageView(Context 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;

    public void draw(Canvas canvas) {;
        canvas.translate(0, -mCurrentTranslation / 2)  ;

Java Source Code List