GithubHelp home page GithubHelp logo

valeriysek / parallaxeverywhere Goto Github PK

View Code? Open in Web Editor NEW

This project forked from narfss/parallaxeverywhere

0.0 0.0 0.0 19.09 MB

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

License: MIT License

Shell 8.01% Java 91.99%

parallaxeverywhere's Introduction

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.

parallaxeverywhere's People

Contributors

narfss avatar alexodus avatar borysstach avatar ashishg656 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.