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
Android Parallax-ViewPager

ParallaxViewPager Demo Usage <com.github.ybq.parallaxviewpager.ParallaxViewPager android:id="@+id/viewpager" android:layout_width="ma

ybq 588 Nov 29, 2022
Android App of Pager

Pager Pager allows you to communicate with people without any infrastructure based services like cellular network or Wifi. We make this possible by tr

Akshat Tiwari 0 Dec 1, 2021
Pager (especially for ViewPager) indicator in two styles: circle & fraction.

PagerIndicator Pager (especially for ViewPager) indicator in two styles: circle & fraction. Demo circle fraction Dependency implementation 'me.liangfe

Fei Liang 212 Nov 28, 2022
Pager (especially for ViewPager) indicator in two styles: circle & fraction.

PagerIndicator Pager (especially for ViewPager) indicator in two styles: circle & fraction. Demo circle fraction Dependency implementation 'me.liangfe

Fei Liang 212 Nov 28, 2022
Three material Dots Indicators for view pagers in Android !

Material View Pager Dots Indicator This library makes it possible to represent View Pager Dots Indicator with 3 different awesome styles ! It supports

Tommy Buonomo 2.8k Jan 5, 2023
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.

ViewPagerTransforms Library containing common animations needed for transforming ViewPager scrolling on Android v13+. This library is a rewrite of the

Ian Thomas 2.5k Dec 31, 2022
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Jake Wharton 10.2k Jan 3, 2023
ViewPagers library for Android

freepager Ready-to-use view pagers for your project. Based on Swipes navigation demo repository Usage: Gradle: dependencies { compile 'pro.alexza

Alex Zaitsev 460 Nov 25, 2022
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector Undergoing for some API changes for a 2.0 major version, see example usage in the sample module! What and why? Bored of dull looking rad

Iiro Krankka 1.1k Dec 9, 2022
Android library for fluid tablayout animation as seen on Snapchat.

SnapTabLayout Show some ❤️ and star the repo to support the project This library is the implementation of TabLayout as seen on popular messaging app S

Niranjan Kurambhatti 714 Dec 25, 2022
Android auto scroll viewpager or viewpager in viewpager

Android Auto Scroll ViewPager ViewPager which can auto scrolling, cycling, decelerating. ViewPager which can be slided normal in parent ViewPager. Att

Trinea 1.7k Dec 10, 2022
An android ViewPager extension allowing infinite scrolling

NO LONGER MAINTAINED LoopingViewPager An android ViewPager extension allowing infinite scrolling. You can use it with "standart" PagerAdapter (inflati

Leszek Mzyk 992 Nov 10, 2022
Augment Android's ViewPager with wrap-around functionality.

Infinite View Pager Augment Android's ViewPager with wrap-around functionality. Original StackOverflow question: http://stackoverflow.com/questions/75

Antony Tran 692 Dec 14, 2022
Android - A ViewPager page indicator that displays the current page number and (optionally) the page count

NumericPageIndicator A ViewPager page indicator that displays the current page number and (optionally) the page count. It can also display buttons to

Manuel Peinado Gallego 253 Nov 16, 2022
Android ViewPager template with cool animation.

glazy-viewpager ViewPager template with cool animation. Preview Dependencies compile 'com.android.support:palette-v7:25.2.0' Usage Refer the implement

Kannan Anbarasan 251 Nov 29, 2022
Don't write a ViewPager Adapter! Hook up your ViewPager to your data model using Android Data Binding Framework. With Kotlin support!

Don't write a ViewPager Adapter! Hook up your ViewPager to your data model using Android Data Binding Framework. Show some ❤️ ?? Sweet and short libra

Rakshak R.Hegde 180 Nov 18, 2022
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Jake Wharton 10.2k Jan 5, 2023
Android LiquidSwipe Library

Android LiquidSwipe Library

Chrisvin Jem 838 Dec 29, 2022
Android Concentric Onboarding library

Android Concentric Onboarding library

Chrisvin Jem 50 Sep 13, 2022