Parallax everywhere is a library with alternative android widgets with parallax effects.

Overview

Parallax Everywhere#

Android Arsenal

Parallax everywhere (PEW) is a library with alternative android views using parallax effects.

Demo

You can try the demo app on google play.

https://play.google.com/store/apps/details?id=com.fmsirvent.ParallaxEverywhereSample

Views with effect?

Android view PEW view
ImageView PEWImageView
TextView PEWTextView

How it works?

  • Any parallax views (PEW*) needs to be inside a view with scroll events, ej: scrollView, listView, gridView....
  • Parallax effect on views will be related to its position on device screen.
  • Parallax effect in ImageView is calculated with left image in Scale mode centerCrop, centerInside or center. You can't make more parallax effect.
  • Parallax effect in no image views needs a size parallax parameter (read: Attributes)

Show me the code

Gradle dependencies:

compile 'com.fmsirvent:parallaxeverywhere:1.0.4'

Code in layout:

  <!-- add on top parent layout: xmlns:pew="http://schemas.android.com/apk/res-auto" -->


   <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:layout_margin="10dp"
        android:layout_weight="1">

        <com.fmsirvent.ParallaxEverywhere.PEWImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_margin="10dp"
            android:scaleType="centerCrop"
            android:src="@drawable/alicante_explanada" />

        <com.fmsirvent.ParallaxEverywhere.PEWTextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="10dp"
            android:gravity="bottom|center_horizontal"
            android:text="@string/alicante_explanada"
            android:textColor="@android:color/white"
            pew:block_parallax_x="true"
            pew:parallax_x="160dp"
            pew:parallax_y="160dp"
            pew:reverse="reverseY" />

    </FrameLayout>

Proguard:

-dontwarn com.fmsirvent.ParallaxEverywhere.**

Attributes

All PEW

  • reverse = ["none", "reverseX", "reverseY", "reverseBoth"] Change the direction of parallax effect. Default value "none".

  • block_parallax_x and block_parallax_y = "boolean" Blocks parallax effect. Default value false.

  • interpolation = ["linear", "accelerate_decelerate", "accelerate", "anticipate", "anticipate_overshoot", "bounce", "decelerate", "overshoot"] Animation interpolation. Default value "linear".

  • update_onDraw = = "boolean" Experimental attribute: update the parallax effect on draw event. Try if the parents don't has scroll. Now only works on +API:16 (Jelly bean). Default value false.

Only: no image PEW

  • parallax_x and parallax_y = "dimension" In non widgets images is necessary specify the size of parallax effect. The size will be split in half for each side. Default value 0.

License

ParallaxEverywhere is available under the MIT license. See the LICENSE file for more info.

Comments
  • PEWImageView to minSdkVersion=7

    PEWImageView to minSdkVersion=7

    Hi, this is my simple modification to port PEWImageView to minSdkVersion=7 (I tested it on Gingerbread, API Level 10). I fixed the wrong initialization of listeners: they must be initialized / destroyed on onAttachedToWindow/ onDetachedFromWindow events, not in constructors. If this PR is OK, you can change, in the same way, PEWTextView. Bye

    opened by alexodus 7
  • When PEWImageView is used as a item in RecyclerView or ListView with fixed image height

    When PEWImageView is used as a item in RecyclerView or ListView with fixed image height

    The problem is when PEWImageView is included as a list item in RecyclerView or ListView with fixed PEWImageView layout_height say 200dp and a loading image is placed on the ImageView till the image is loaded from server, and we are using parallax_y for animating PEWIMAGE items vertically ..

    Then if the image that came from server has higher width and less height,i.e. the bitmap when placed in the imageView will leave some empty space in vertical direction..

    Then in that case, the 'scrollSpaceY' instance variable of PEWImageView class is 0. But since earlier the placeholder image was present, the view has already been scrolled to some non zero value but now the view should be scrolled back to 0 since the scrollSpaceY value is zero now

    Calling invalidate() or requestLayout() do not make any difference I have tried all of them.

    The solution is checking for 'scrollSpaceY' in applyParallax() method. If this variable is non zero, perform scrolling on view But if this is zero, reset view scroll to 0 to remove changes made on the view due to the placeholder image...Since placeholder image was big enough to make view scroll.

    opened by ashishg656 3
  • aar manifest causing headaches

    aar manifest causing headaches

    the lib includes an unnecessary <application> tag in its AndroidManifest.xml and its children are confusing my build

    [warn] <projectdir>/src/main/AndroidManifest.xml:12:9 Error:
    [warn]  Attribute application@icon value=(@drawable/android:star_big_on) from AndroidManifest.xml:12:9
    [warn]  is also present at <projectdir>/target/aars/com.fmsirvent-parallaxeverywhere-1.0.1:11:9 value=(@drawable/ic_launcher)
    [warn]  Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:10:5 to override
    [warn] <projectdir>/src/main/AndroidManifest.xml:11:9 Error:
    [warn]  Attribute application@label value=(Macroid Starter) from AndroidManifest.xml:11:9
    [warn]  is also present at <projectdir>/target/aars/com.fmsirvent-parallaxeverywhere-1.0.1:12:9 value=(@string/app_name)
    [warn]  Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:10:5 to override
    [trace] Stack trace suppressed: run last android:processManifest for the full output.
    [error] (android:processManifest) Manifest merger failed with multiple errors, see logs
    
    opened by mikelpr 3
  • code-friendly PEWs

    code-friendly PEWs

    I'm writing my app in scala with the macroid dsl for the GUI code but the views weren't code-friendly

    • added interpolator setters
    • set the default interpolator on class init (it was being set by InterpolatorSelector on checkAttributes which isn't called from code at all - this and no setters made it null)
    • made the reverse*, updateOnDraw, blockParallax* and scrollSpace* (for textview) ivars public
    opened by mikelpr 1
  • Not work with fresco when I use setImageUri

    Not work with fresco when I use setImageUri

    Hello, I try to use PEverywhere with SimpleDraweeView and replace "extends ImageView" with "extends SimpleDraweeView" it'll work when I use setImageResouce(int resId) (and I'v override this method in the class, add invalidate() ), but not work with setImageUri(Uri uri),

    plz help!

    opened by HiCubee 0
  • LICENSE file is missed

    LICENSE file is missed

    According to README

    See the LICENSE file for more info.

    there should be LICENSE file.

    Could you please add it or give direct link to an external page? Thanks!

    opened by rgrigoryev 0
  • Parallax effect on PEWImageView inside GridView is unnoticeable

    Parallax effect on PEWImageView inside GridView is unnoticeable

    I'm using PEWImageView in order to add parallax effect to some images inside a GridView, the problem is that the parallax effect on the images is almost unnoticeable.. Is it possible to specify the velocity of the parallax effect? is there any method already defined?

    opened by Signoo 1
  • Not working with RecyclerView?

    Not working with RecyclerView?

    Do you have a sample on how this library works? Specifically with a RecyclerView if possible? I'm adding the PEWImageVIew to my row layout and it's not working.

    Anything I need to add to the view, or is it simply not compatible with a RecyclerView? i'm getting my image from a HTTP call, loading it in, maybe it's that?

    Edit: It seems the PEWTextView works, just not the PEWImageView?

    opened by MiralDesai 7
  • Parallax stops when PEWImageView is set to be a group in an ExpandableListView

    Parallax stops when PEWImageView is set to be a group in an ExpandableListView

    Hello,

    I am inflating a view with a PEWImageView in it. Like this:

    @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) this.currentContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        if (groupPosition == 0){
            Log.d("Inflating: ", "Show Image Parallax");
            convertView = inflater.inflate(R.layout.parallax_show_image_layout,null);
            parallaxImageShowView = convertView;
            parallaxImageView = (PEWImageView) convertView.findViewById(R.id.show_parallax_image);
            parallaxImageView.setReverseY(true);
            Picasso.with(currentContext).load(showInfoBundle.getString("showImageUrl")).into(parallaxImageView);
    

    }

    <com.fmsirvent.ParallaxEverywhere.PEWImageView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:scaleType="centerCrop"
        android:background="@color/c_black"
        pew:interpolation="accelerate"
        android:id="@+id/show_parallax_image"
        android:layout_alignParentStart="true" />
    

    After the list is scrolled to the bottom or close to the bottom when you scroll back up I noticed that parallax effect stops and the image gets stuck in the position that the interpolator animation moved it after it did the parallax effect as I was scrolling down. It will not act the same way as I scroll up. It does it once and thats it. The only solution is to re-inflate the view when the list is scrolled to the bottom, but that is costly. Can you suggest a solution to this or is it something that I am doing wrong ?

    Thank you.

    opened by arn95 3
Owner
fmSirvent
fmSirvent
Library for creating blur effects under Android UI elements

BlurTutorial Meet BlurTutorial, an Android-based library made by Cleveroad Hurry to check our newest library that helps to blur the background in Andr

Cleveroad 150 Dec 16, 2022
A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.

A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.

清茶 67 Dec 30, 2022
Bootstrap style widgets for Android, with Glyph Icons

Android-Bootstrap Android Bootstrap is an Android library which provides custom views styled according to the Twitter Bootstrap Specification. This al

Bearded Hen 7.3k Jan 3, 2023
Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.

Carbon Material Design implementation for Android 4.0 and newer. This is not the exact copy of the Lollipop's API and features. It's a custom implemen

null 3k Dec 30, 2022
A set of widgets to create smooth slideshows with ease.

Android SlideShow Widget A set of widgets to create smooth slide shows with ease. The slide show components are fully customizable and are not limited

MarvinLabs 211 Nov 20, 2022
Floating label input widgets

Android Floating Label Widgets A set of input widgets with a hint label that floats when input is not empty. Demo A demo of the widget is worth a thou

MarvinLabs 450 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 30, 2022
A cool Open Source CoverFlow view for Android with several fancy effects.

FancyCoverFlow THIS PROJECT IS NO LONGER MAINTAINED! What is FancyCoverFlow? FancyCoverFlow is a flexible Android widget providing out of the box view

David Schreiber-Ranner 1.1k Nov 10, 2022
effects for android notifications

#NiftyNotification effects for android notifications.base on (Crouton) ScreenShot Usage NiftyNotificationView.build(this,msg, effect,R.id.mLyout)

李涛 1.1k Nov 10, 2022
Sliding cards with pretty gallery effects.

SlidingCard Sliding cards with pretty gallery effects. Download Include the following dependency in your build.gradle file. Gradle: repositories {

mxn 681 Sep 7, 2022
Draggable views with rotation and skew/scale effects

DraggableView Draggable views with rotation and skew/scale effects. Usage Implement DragController.IDragViewGroup Create instance of DragController Ov

Eugene Levenetc 562 Nov 11, 2022
A new canvas drawing library for Android. Aims to be the Fabric.js for Android. Supports text, images, and hand/stylus drawing input. The library has a website and API docs, check it out

FabricView - A new canvas drawing library for Android. The library was born as part of a project in SD Hacks (www.sdhacks.io) on October 3rd. It is cu

Antwan Gaggi 1k Dec 13, 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
Android library providing bread crumbs to the support library fragments.

Hansel And Gretel Android library providing bread crumbs for compatibility fragments. Usage For a working implementation of this project see the sampl

Jake Wharton 163 Nov 25, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Dec 6, 2022
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Wizard Pager is a library that provides an example implementation of a Wizard UI on Android, it's based of Roman Nurik's wizard pager (https://github.com/romannurik/android-wizardpager)

Wizard Pager Wizard Pager is a library that provides an example implementation of a Wizard UI on Android, it's based of Roman Nurik's wizard pager (ht

Julián Suárez 520 Nov 11, 2022
Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

FancyToast-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ... ma

Shashank Singhal 1.2k Dec 26, 2022