Giter Site home page Giter Site logo

smarkseven / parallaximageview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from irimiaionut/parallaximageview

0.0 2.0 0.0 2.92 MB

Android library that enables the parallax effect like in IOS. Perfect for a login page and UX Experience

Java 100.00%

parallaximageview's Introduction

Parallax ImageView Android library

alt tag

1. Project

You have here a library that lets you use a imageview to simulate a 3D effect like on Amazon FirePhone and Iphone. To do so, the imageview is set with a margin and based on the phone's movement and interpreted with the Sensor.TYPE_ROTATION_VECTOR moves the margin so that it creates a 3D in depht effect.

2. Recommended usage

This can be used on any layout but keep in mind to check how it affects the overall behavior of the app(better no animations than interrupted ones). My recommendation would be to use it on light implementations like loginscreens / settings.

3. Recommended implementation

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_margin="0dip"
    tools:context="com.example.sensortest.MainActivity" >
    
    <com.android.irimiaionut.parallaxImageView.ParallaxImageView
        android:id="@+id/backgr"
        android:src="@drawable/backgr"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:scaleType="centerCrop"
        android:adjustViewBounds="true"/>
</RelativeLayout>
backgr = (ParallaxImageView) findViewById(R.id.backgr);
backgr.setMargins(300, 200);
backgr.setMultipliers(1.5f, 1.7f);

4. Notes

  • Solved some Galaxy devices exception for event.values on getRotationMatrixFromVector();
  • Min SDK 11

parallaximageview's People

Contributors

irimiadoru avatar irimiaionut avatar

Watchers

James Cloos avatar Allie Y 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.