• Stars
    star
    439
  • Rank 99,247 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 11 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Paralloid - (Pah-rah-loid) The Android Parallax library - DEPRECATED.

Paralloid - DEPRECATED

DEPRECATED - Use the project for more of guide and ideas how to apply parallax techniques. I will not support this library anymore.

Paralloid - (Pah-rah-loid) The Android Parallax library

Compatible back to API 7

An example application, Paralloid Library Example, can be downloaded from the Play Store.

ParallaxScrollView is dead..

I originally wrote ParallaxScrollView a while back as proof of concept, people took surprisingly well to it; but from the get-go it was a fundamentally flawed.

Tightly-coupled and inflexible, made it difficult to maintain and confusing for people to use.

Features

Currently limited but will expand when requests.

  • Parallax another view when the parent scrolls.
  • Parallax multiple backgrounds.
  • Transformers, Parallax in different ways and directions

Supports:

  • ListView
  • ScrollView
  • HorizontalScrollView

Modular

Paralloid is designed to be modular and very loosely coupled (to an extent).

Two high level modules exist

  • paralloid - which is the library which everything extends from.
  • paralloidviews - which extends the library with a couple of pre-extended ScrollableViews.
  • paralloidexamples - which is of course the examples App.

Generally use paralloidviews as it contains everything you need to get going.

Getting Started

Dependency

Currently I only support Gradle

Locally:

Temporary steps from @therealkris.

  • First, I cloned the library into myproject/libs/paralloid.
  • In my settings.gradle, I added include ':libs:paralloid:paralloid', ':libs:paralloid:paralloidviews'.
  • In my build.gradle, I added compile project(':libs:paralloid:paralloid'), project(':libs:paralloid:paralloidviews').
  • In libs/paralloid/paralloid, I removed the uploadArchives {} block.
  • In libs/paralloid/paralloidviews, I removed the uploadArchives {} block AND changed the dependency to read: compile project(':libs:paralloid:paralloid') instead of compile project(':paralloid')

Or Repository (coming soon):

dependencies {
    compile 'uk.co.chrisjenx.paralloid:paralloid:0.1.+'
}

Layout

ScrollView

This is an example, please refer to the paralloidexample App for full code.

<FrameLayout ..>
<FrameLayout
		android:id="@+id/top_content"
           	android:layout_width="match_parent"
           	android:layout_height="192dp"/>

<uk.co.chrisjenx.paralloid.views.ParallaxScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

    <LinearLayout
    	android:id="@+id/scroll_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingTop="192dp"/>

</uk.co.chrisjenx.paralloid.views.ParallaxScrollView>
</FrameLayout>

Fragment

Inside your onViewCreated() or onCreateView().

//...
FrameLayout topContent = (FrameLayout) rootView.findViewById(R.id.top_content);
ScrollView scrollView = (ScrollView) rootView.findViewById(R.id.scroll_view);
if (scrollView instanceof Parallaxor) {
        ((Parallaxor) scrollView).parallaxViewBy(topContent, 0.5f);
}
// TODO: add content to top/scroll content

Thats it!

Have a look at the Parallaxor interface for applicable Parallax methods.

Custom Views

I tried to keep this as simple as possible, you can nearly copy and paste this.

  • Extend the Scrollable view (or the one you allready have).
  • Implement the Parallaxor interface.
  • Job done! See below for an example

Example implementation:

public class MyScrollView extends ScrollView implements Parallaxor {
  //...
  ParallaxViewController mParallaxViewController;

  // Call init() in constructors
  private void init() {
    mParallaxViewController = ParallaxViewController.wrap(this);
  }

  @Override
  protected void onScrollChanged(int l, int t, int oldl, int oldt) {
    super.onScrollChanged(l, t, oldl, oldt);
    mParallaxViewController.onScrollChanged(this, l, t, oldl, oldt);
  }

  // region Implementation of Parallaxor

  @Override
  public void parallaxViewBy(View view, float multiplier) {
    mParallaxViewController.parallaxViewBy(view, multiplier);
  }

  @Override
  public void parallaxViewBy(View view, Transformer transformer, float multiplier) {
    mParallaxViewController.parallaxViewBy(view, transformer, multiplier);
  }

  @Override
  public void parallaxViewBackgroundBy(View view, Drawable drawable, float multiplier) {
    mParallaxViewController.parallaxViewBackgroundBy(view, drawable, multiplier);
  }

  // endregion
}

More Repositories

1

Calligraphy

Custom fonts in Android the easy way...
Java
8,589
star
2

ParallaxScrollView

A Parallax ScrollView which takes a background and foreground views - DEPRECATED
Java
535
star
3

StaggeredGridView

Based of the google staggeredgridview that has been hidden from the ACL, this is an example based off of that.
Java
103
star
4

AndroidTimeLock

Will time lock a build and stop the user running it if its too old, useful for releasing dev builds.
Java
29
star
5

ScrollViewPager

ScrollView Pager that makes a ScrollView act like it has pages.
Java
18
star
6

KUPnP

"Kew-pin" is a lighter weight Kotlin based UPnP client, based on modern reactive principles.
Kotlin
16
star
7

KotlinPatterns

Some of my prefered ways to use Kotlin on Android
Kotlin
13
star
8

MultiTrack

MultiTrack the Tape replacement
Kotlin
13
star
9

coreos-elk

CoreOS ELK Setup
Shell
11
star
10

NodeSizer

NodeJS Image resizing proxy service
JavaScript
11
star
11

AutoComponent

Super lightweight lib that will generate a subcomponent.
Kotlin
9
star
12

DroidKaigi

Slides from DroidKaigi Layout Inflator talk.
6
star
13

lemmings

Low level test runner to run hundreds of emulators on a single machine in a preditable manner
Kotlin
5
star
14

Android-Talk-Demos

Set of presentations and demos for getting into android talk.
Java
4
star
15

AndroidMapLibrary

Android Lib for Google Maps Plugin to provide high performance mapping tools.
Java
4
star
16

wakemesleepme

Wake And Sleep Solution for RHoK
Java
3
star
17

LetsTalkAboutTypefaces

Slides and extras for a talk about Typefaces.
Java
3
star
18

Dagger-Dynamic-Features

How to use Dagger 2 and Android Dynamic features
Kotlin
2
star
19

SwimmingTimer

A Small little java program to help people in timing laps for a swimming Gala
Java
2
star
20

yakcov

Yet Another Kotlin COmpose Validation library
Kotlin
1
star
21

PepperElephant

Pepper Elephant is the collection of 25 years worth of shows history, songs, cast, crew, music and memories.
JavaScript
1
star
22

WaryOfDairy

WairyOfDairy NodeJS Backend.
JavaScript
1
star