A pager for Android with parallax effect

Overview

Android Arsenal

ParallaxPagerTransformer

A pager transformer for Android with parallax effect

Installation

in your build.gradle file

dependencies {
    // ...
    compile 'com.xgc1986.android:parallaxpagertransformer:1.0.4'
}

Usage

minSdkVersion 11

You only have to pass to the ParallaxTransformer the id of the element you want have the parallax effect

	//...
	import com.xgc1986.parallaxPagerTransformer.ParallaxPagerTransformer;

	public class MainActivity extends Activity {

		ViewPager mPager;
    	FragmentStatePagerAdapter mAdapter;

		public void onCreate(Bundle savedInstanceState) {
			/** ... **/

			mPager = (ViewPager) findViewById(R.id.pager);

        	// creating the parallaxTransformer, you only need to pass the id of the View (or ViewGroup) you want to do the parallax effect

        	mPager.setPageTransformer(false, new ParallaxPagerTransformer(R.id.parallaxContent));
        	mAdapter = new FragmentStatePagerAdapter(getSupportFragmentManager());
        	mAdapter.setPager(mPager);

        	/** ... **/
		}
	}

And that's all, you can see in action Here

Other works

Ripple Button

Android Arsenal

License

Copyright 2015 Javier Gonzalez

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Android Studio 0.8.+ Gradle import issue

    Android Studio 0.8.+ Gradle import issue

    Hello, I am getting following error while trying to sync Gradle after migrating from AS 0.6 to AS 0.8:

    Error:Module version com.xgc1986.ParallaxPagerTransformer:library:0.2-SNAPSHOT depends on libraries but is not a library itself

    I'm not sure how to resolve this one. Maybe somebody else had the same issue and figured it out.

    Regards

    opened by dbCoop 2
  • android:allowBackup conflict

    android:allowBackup conflict

    Good morning:

    Seems like you guys have in the library manifest, in the application tag, the android:allowBackup set on true.

    This raises conflict when i try to put in my own manifest the android:allowBackup to false, and the "tools:replace" feature seems like doesn't work in allowBackup, there's even an issue raised in code.google.com.

    A solution: remove in your manifest the android:allowBackup.

    Thanks.

    opened by RafaGonP 1
  • NullPointer Exception

    NullPointer Exception

    When pager is iset usiing the code in MainActivity, mPager.setAdapter(mAdapter);

    I get this error

    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.app.Fragment.setMenuVisibility(boolean)' on a null object reference at android.support.v4.app.FragmentStatePagerAdapter.instantiateItem(FragmentStatePagerAdapter.java:116) at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:837) at android.support.v4.view.ViewPager.populate(ViewPager.java:987) at android.support.v4.view.ViewPager.populate(ViewPager.java:919) at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) at android.view.View.measure(View.java:17448) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5465) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436) at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1083) at android.widget.LinearLayout.onMeasure(LinearLayout.java:615) at android.view.View.measure(View.java:17448) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5465) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at android.view.View.measure(View.java:17448) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5465) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436) at android.widget.LinearLayout.measureVertical(LinearLayout.java:722) at android.widget.LinearLayout.onMeasure(LinearLayout.java:613) at android.view.View.measure(View.java:17448) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5465) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2560) at android.view.View.measure(View.java:17448) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2031) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1189) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1402) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1077) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5884) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5312) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)

    opened by deepaksime 1
  • Project title

    Project title

    Thank you for the great library. I think the title is confusing. You can make lots of things Parallax. By the title, we cannot know what the library is doing. The same goes for the description as well.

    Name suggestion: ParallaxBackgroundViewPager Or ParallaxBackgroundPagerTransformer

    opened by tasomaniac 1
  • Migrate from JCenter

    Migrate from JCenter

    In may this library won't be available from JCenter: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

    Please migrate this library to some other repository

    opened by nicemak 1
  • Cannot set 'scaleX' to Float.NaN exception when pages pulled quickly, with possible solution

    Cannot set 'scaleX' to Float.NaN exception when pages pulled quickly, with possible solution

    The problem mentioned in https://github.com/nonzeroapps/whatisnewdialog/issues/13

    possible solution

    adding !Float.isNaN(sc) as here: https://github.com/nonzeroapps/whatisnewdialog/issues/13#issuecomment-570759865

    at Line: https://github.com/xgc1986/ParallaxPagerTransformer/blob/2483fd51c6a2e6e6859e4a21272d9e92995e5407/parallaxpagertransformer/src/main/java/com/xgc1986/parallaxPagerTransformer/ParallaxPagerTransformer.java#L37

    opened by osamz 0
  • What about fragments?

    What about fragments?

    Each fragment has its own xml file, and each xml has its own layout with its own ids... how to implement PPT in this case? I think multiple ids is necessary. thanks.

    opened by andersonbadari 1
  • minSdkVersion in lib is 16 and not 11 as the documentation states

    minSdkVersion in lib is 16 and not 11 as the documentation states

    The lib seems to work in API 11, but gradle.build in the lib project specifies minSdkVersion 16 which is generating issues in projects using lower sdk versions: https://github.com/xgc1986/ParallaxPagerTransformer/blob/master/parallaxpagertransformer/build.gradle#L22

    I am having this issue when using the ParallaxPagerTransformer lib in my project using minSdkVersion 15:

    Error:Execution failed for task ':app:processDebugManifest'.

    Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.xgc1986.android:parallaxpagertransformer:1.0.4] /MyApp/app/build/intermediates/exploded-aar/com.xgc1986.android/parallaxpagertransformer/1.0.4/AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.xgc1986.parallaxpagerlibrary" to force usage

    opened by arlm001 1
Owner
Javier Gonzalez
Javier Gonzalez
This library provides easy ways to add onboarding or pager screens with different animation and indicators.

WalkThroughAndroid Make amazing OnBoarding Screens easily for your app with different colorful animations, fonts, styles, and many more. Customize you

MindInventory 33 Sep 9, 2022
Onboarding sample project with view pager & shared preferences

Onboarding Sample Project When the application is first downloaded, we go to onboarding from the splash screen. We keep the information that onboardin

Feyza Ürkut 2 Jun 29, 2022
A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android

android-flip Aphid FlipView is a UI component to accomplish the flipping animation like Flipboard does. A pre-built demo APK file for Android OS 2.2+

Bo 2.8k Dec 21, 2022
Android ImageViews animated by Ken Burns Effect

KenBurnsView Android library that provides an extension to ImageView that creates an immersive experience by animating its drawable using the Ken Burn

Flávio Faria 2.7k Jan 2, 2023
Android L Ripple effect wrapper for Views

Material Ripple Layout Ripple effect wrapper for Android Views Including in your project compile 'com.balysv:material-ripple:1.0.2' Check for latest v

Balys Valentukevicius 2.3k Dec 29, 2022
Implementation of Ripple effect from Material Design for Android API 9+

RippleEffect ExpandableLayout provides an easy way to create a view called header with an expandable view. Both view are external layout to allow a ma

Robin Chutaux 4.9k Dec 30, 2022
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.

EtsyBlur EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the past Etsy app. Try out the sa

Manabu S. 755 Dec 29, 2022
[] Easily have blurred and transparent background effect on your Android views.

##[DEPRECATED] BlurBehind Easily have blurred and transparent background effect on your Android views. Before API level 14 there was a Window flag cal

Gokberk Ergun 516 Nov 25, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
:sparkles: An easy way to implement an elastic touch effect for Android.

ElasticViews ✨ An easy way to implement an elastic touch effect for Android. Including in your project Gradle Add below codes to your root build.gradl

Jaewoong Eum 763 Dec 29, 2022
An easy, flexible way to add a shimmering effect to any view in an Android app.

Shimmer for Android Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as a

Facebook 5.1k Dec 26, 2022
Memory efficient shimmering effect for Android applications by Supercharge.

DEPRECATED - ShimmerLayout Attention: This tool is now deprecated. Please switch to Shimmer for Android or any other shimmer effect solution. ShimmerL

Supercharge 2.5k Jan 4, 2023
Library provides an easy way to a add shimmer effect in Android Compose project.

Add a shimmer effect to the layout in Android Compose

Valery 66 Dec 14, 2022
"Gooey-Effect" for android-compose

Gooey effect for android-compose "Gooey" is a library made to use "gooey-effect" that exists as a CSS trick in android-compose. Download repositories

SeokHo-Im 5 Oct 12, 2022
ViewAnimator view with a lollipop style reveal effect

ViewRevealAnimator Widget ViewAnimator view with a lollipop style reveal effect. Regular animation can be set (just like the default ViewAnimator) for

Alessandro Crugnola 339 Jun 3, 2022
Library project to display DialogFragment with a blur effect.

BlurDialogFragment This project allows to display DialogFragment with a burring effect behind. The blurring part is achieved through FastBlur algorith

tvbarthel 2.1k Dec 29, 2022
explosive dust effect for views

ExplosionField explosive dust effect for views Getting started In your build.gradle: dependencies { compile 'tyrantgit:explosionfield:1.0.1' } Ex

null 3.6k Dec 29, 2022
Glass-break effect for views

BrokenView Glass-break effect for views. Demo Download APK Usage Android Studio dependencies { compile 'com.zys:brokenview:1.0.3' } Eclipse Just pu

null 859 Dec 30, 2022
Wave effect of activity animation

WaveCompat Wave effect of activity animation How to use 1. Bind wave touch helper to a view which will start an activity when it clicked: WaveTouchHel

WangJie 348 Nov 29, 2022