├── README.md
├── library
├── .gitignore
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── yayandroid
│ │ │ └── parallaxlistview
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── yayandroid
│ │ │ └── parallaxlistview
│ │ │ ├── ParallaxImageView.java
│ │ │ ├── ParallaxListView.java
│ │ │ └── ParallaxViewHolder.java
│ │ └── res
│ │ └── values
│ │ └── parallax_attrs.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library.iml
├── maven_push.gradle
└── settings.gradle
└── sample
├── .gitignore
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── yayandroid
│ │ └── parallaxlistview
│ │ └── sample
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── yayandroid
│ │ └── parallaxlistview
│ │ └── sample
│ │ ├── MainActivity.java
│ │ └── TestAdapter.java
│ └── res
│ ├── layout
│ ├── activity_main.xml
│ └── item.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ ├── test_image_1.jpg
│ ├── test_image_2.jpg
│ ├── test_image_3.png
│ ├── test_image_4.jpg
│ └── test_image_5.png
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── sample.iml
└── settings.gradle
/README.md:
--------------------------------------------------------------------------------
1 | # ParallaxListView
2 | [](http://unmaintained.tech/)
3 |
4 | **This library is no longer maintained, please use [ParallaxRecyclerView][0] instead.**
5 |
6 | This library will provide you to have Parallax effect on every item of your ListView.
7 | Sample shows how to implement this features as async image loading with [Picasso][1]
8 |
9 | 
10 |
11 | Compatibility
12 | -------------
13 | This library works on 2.2+ probably earlier as well, but i didn't even bother to test because i believe at some point we have to stop supporting every version ;)
14 |
15 | Usage
16 | -----
17 | Get your ParallaxListView instance, and set its adapter as shown in sample. You need to provide a ParallaxImageView, which will handle parallax effect, on your listView's item.
18 |
19 | In your adapter create a ViewHolder which extends ParallaxViewHolder. You need to use these specifications:
20 |
21 | ```java
22 | viewHolder.itemView = convertView;
23 | viewHolder.setBackgroundImage((ParallaxImageView) convertView.findViewById(R.id.parallaxImageView));
24 | ```
25 |
26 | And this method needs to be called on getView method to notify ParallaxImageView that will be displayed once again, so it will re-center itselfs.
27 |
28 | ```java
29 | viewHolder.getBackgroundImage().reuse();
30 | ```
31 |
32 | If you wish to change Parallax effects ratio, you can simple call `setParallaxRatio` on code, or you can set it by xml with `parallax_ratio` attribute.
33 |
34 | ## Download
35 | Add library dependency to your `build.gradle` file:
36 |
37 | [](http://search.maven.org/#search%7Cga%7C1%7CParallaxListView)
38 | ```groovy
39 | dependencies {
40 | compile 'com.yayandroid:ParallaxListView:1.1'
41 | }
42 | ```
43 |
44 | References
45 | ----------
46 |
47 | This library has been built by our designer's insistence. She's seen [JBParallaxCell library on IOS][2] and want it to have in Android as well. Researches lead me to [this repository][3] but it wasn't quite affective as it is on IOS, so here ParallaxListView.
48 |
49 | ## License
50 | ```
51 | The MIT License (MIT)
52 |
53 | Copyright (c) 2015 yayandroid
54 |
55 | Permission is hereby granted, free of charge, to any person obtaining a copy
56 | of this software and associated documentation files (the "Software"), to deal
57 | in the Software without restriction, including without limitation the rights
58 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
59 | copies of the Software, and to permit persons to whom the Software is
60 | furnished to do so, subject to the following conditions:
61 |
62 | The above copyright notice and this permission notice shall be included in
63 | all copies or substantial portions of the Software.
64 |
65 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
67 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
68 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
69 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
70 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
71 | THE SOFTWARE.
72 | ```
73 |
74 | [0]: https://github.com/yayaa/ParallaxRecyclerView
75 | [1]: https://github.com/square/picasso
76 | [2]: https://github.com/jberlana/JBParallaxCell
77 | [3]: https://github.com/bopbi/Android-Parallax-ListView-Item
78 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .idea
3 | .DS_Store
4 | /local.properties
5 | /build
6 | /captures
7 |
--------------------------------------------------------------------------------
/library/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/library/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | minSdkVersion 8
9 | targetSdkVersion 22
10 | versionCode 2
11 | versionName "1.1"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | }
24 |
25 | apply from: '../maven_push.gradle'
--------------------------------------------------------------------------------
/library/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/yahyabayramoglu/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/library/app/src/androidTest/java/com/yayandroid/parallaxlistview/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/library/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/library/app/src/main/java/com/yayandroid/parallaxlistview/ParallaxImageView.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Bitmap;
6 | import android.graphics.Matrix;
7 | import android.graphics.drawable.Drawable;
8 | import android.net.Uri;
9 | import android.util.AttributeSet;
10 | import android.widget.ImageView;
11 |
12 | /**
13 | * Created by yahyabayramoglu on 15/04/15.
14 | */
15 | public class ParallaxImageView extends ImageView {
16 |
17 | private final float DEFAULT_PARALLAX_RATIO = 1.2f;
18 | private float parallaxRatio = DEFAULT_PARALLAX_RATIO;
19 |
20 | private boolean DEFAULT_CENTER_CROP = true;
21 | private boolean shouldCenterCrop = DEFAULT_CENTER_CROP;
22 |
23 | private boolean needToTranslate = true;
24 | private ParallaxImageListener listener;
25 |
26 | private int rowHeight = -1;
27 | private int rowYPos = -1;
28 | private int recyclerViewHeight = -1;
29 | private int recyclerViewYPos = -1;
30 |
31 | public interface ParallaxImageListener {
32 | int[] requireValuesForTranslate();
33 | }
34 |
35 | public ParallaxImageView(Context context) {
36 | super(context);
37 | init(context, null);
38 | }
39 |
40 | public ParallaxImageView(Context context, AttributeSet attrs) {
41 | super(context, attrs);
42 | init(context, attrs);
43 | }
44 |
45 | public ParallaxImageView(Context context, AttributeSet attrs, int defStyleAttr) {
46 | super(context, attrs, defStyleAttr);
47 | init(context, attrs);
48 | }
49 |
50 | private void init(Context context, AttributeSet attrs) {
51 | setScaleType(ImageView.ScaleType.MATRIX);
52 |
53 | if (attrs != null) {
54 | TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ParallaxImageView, 0, 0);
55 | this.parallaxRatio = ta.getFloat(R.styleable.ParallaxImageView_parallax_ratio, DEFAULT_PARALLAX_RATIO);
56 | this.shouldCenterCrop = ta.getBoolean(R.styleable.ParallaxImageView_center_crop, DEFAULT_CENTER_CROP);
57 | ta.recycle();
58 | }
59 | }
60 |
61 | /**
62 | * This trick was needed because there is no way to detect when image is displayed,
63 | * we need to translate image for very first time as well. This will be needed only
64 | * if you are using async image loading...
65 | *
66 | * # If only there was another way to get notified when image has displayed.
67 | */
68 | // region EnsureTranslate
69 | @Override
70 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
71 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
72 | ensureTranslate();
73 | }
74 |
75 | @Override
76 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
77 | super.onLayout(changed, left, top, right, bottom);
78 | ensureTranslate();
79 | }
80 |
81 | @Override
82 | public void setImageDrawable(Drawable drawable) {
83 | super.setImageDrawable(drawable);
84 | ensureTranslate();
85 | }
86 |
87 | @Override
88 | public void setImageBitmap(Bitmap bm) {
89 | super.setImageBitmap(bm);
90 | ensureTranslate();
91 | }
92 |
93 | @Override
94 | public void setImageResource(int resId) {
95 | super.setImageResource(resId);
96 | ensureTranslate();
97 | }
98 |
99 | @Override
100 | public void setImageURI(Uri uri) {
101 | super.setImageURI(uri);
102 | ensureTranslate();
103 | }
104 | // endregion
105 |
106 | /**
107 | * Notify this view when it is back on recyclerView, so we can reset.
108 | */
109 | public void reuse() {
110 | needToTranslate = true;
111 | }
112 |
113 | public void centerCrop(boolean enable) {
114 | this.shouldCenterCrop = enable;
115 | }
116 |
117 | public void setParallaxRatio(float parallaxRatio) {
118 | this.parallaxRatio = parallaxRatio;
119 | }
120 |
121 | public void setListener(ParallaxImageListener listener) {
122 | this.listener = listener;
123 | }
124 |
125 | public ParallaxImageListener getListener() {
126 | return listener;
127 | }
128 |
129 | public synchronized boolean doTranslate() {
130 | if (getDrawable() == null) {
131 | return false;
132 | }
133 |
134 | if (getListener() != null && getValues()) {
135 | calculateAndMove();
136 | return true;
137 | } else {
138 | return false;
139 | }
140 | }
141 |
142 | private boolean ensureTranslate() {
143 | if (needToTranslate) {
144 | needToTranslate = !doTranslate();
145 | }
146 | return !needToTranslate;
147 | }
148 |
149 | private boolean getValues() {
150 | int[] values = getListener().requireValuesForTranslate();
151 | if (values == null)
152 | return false;
153 |
154 | this.rowHeight = values[0];
155 | this.rowYPos = values[1];
156 | this.recyclerViewHeight = values[2];
157 | this.recyclerViewYPos = values[3];
158 | return true;
159 | }
160 |
161 | private void calculateAndMove() {
162 | float distanceFromCenter = (recyclerViewYPos + recyclerViewHeight) / 2 - rowYPos;
163 |
164 | int imageHeight = getDrawable().getIntrinsicHeight();
165 | float scale = 1;
166 | if (shouldCenterCrop) {
167 | scale = recomputeImageMatrix();
168 | imageHeight *= scale;
169 | }
170 |
171 | float difference = imageHeight - rowHeight;
172 | float move = (distanceFromCenter / recyclerViewHeight) * difference * parallaxRatio;
173 |
174 | moveTo((move / 2) - (difference / 2), scale);
175 | }
176 |
177 | private float recomputeImageMatrix() {
178 | float scale;
179 | final int viewWidth = getWidth() - getPaddingLeft() - getPaddingRight();
180 | final int viewHeight = getHeight() - getPaddingTop() - getPaddingBottom();
181 | final int drawableWidth = getDrawable().getIntrinsicWidth();
182 | final int drawableHeight = getDrawable().getIntrinsicHeight();
183 |
184 | if (drawableWidth * viewHeight > drawableHeight * viewWidth) {
185 | scale = (float) viewHeight / (float) drawableHeight;
186 | } else {
187 | scale = (float) viewWidth / (float) drawableWidth;
188 | }
189 |
190 | return scale;
191 | }
192 |
193 | private void moveTo(float move, float scale) {
194 | Matrix imageMatrix = getImageMatrix();
195 | if (scale != 1) {
196 | imageMatrix.setScale(scale, scale);
197 | }
198 |
199 | float[] matrixValues = new float[9];
200 | imageMatrix.getValues(matrixValues);
201 | float current = matrixValues[Matrix.MTRANS_Y];
202 | imageMatrix.postTranslate(0, move - current);
203 |
204 | setImageMatrix(imageMatrix);
205 | invalidate();
206 | }
207 |
208 | }
--------------------------------------------------------------------------------
/library/app/src/main/java/com/yayandroid/parallaxlistview/ParallaxListView.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.AbsListView;
6 | import android.widget.ListView;
7 |
8 | /**
9 | * Created by yahyabayramoglu on 14/04/15.
10 | */
11 | public class ParallaxListView extends ListView {
12 |
13 | private OnScrollListener scrollListener;
14 |
15 | public ParallaxListView(Context context) {
16 | super(context);
17 | init();
18 | }
19 |
20 | public ParallaxListView(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | init();
23 | }
24 |
25 | public ParallaxListView(Context context, AttributeSet attrs, int defStyleAttr) {
26 | super(context, attrs, defStyleAttr);
27 | init();
28 | }
29 |
30 | private void init() {
31 | setOnScrollListener(defaultListener);
32 | }
33 |
34 | private OnScrollListener defaultListener = new OnScrollListener() {
35 | @Override
36 | public void onScrollStateChanged(AbsListView view, int scrollState) {
37 | if (scrollListener != null)
38 | scrollListener.onScrollStateChanged(view, scrollState);
39 | }
40 |
41 | @Override
42 | public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
43 |
44 | for (int i = 0; i < view.getChildCount(); i++) {
45 | if(view.getChildAt(i).getTag() != null)
46 | ((ParallaxViewHolder) view.getChildAt(i).getTag()).animateImage();
47 | }
48 |
49 | if (scrollListener != null)
50 | scrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
51 | }
52 | };
53 |
54 | @Override
55 | public void setOnScrollListener(OnScrollListener listener) {
56 | if (listener != defaultListener)
57 | scrollListener = listener;
58 | else
59 | super.setOnScrollListener(listener);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/library/app/src/main/java/com/yayandroid/parallaxlistview/ParallaxViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview;
2 |
3 | import android.view.View;
4 | import android.widget.ListView;
5 |
6 | /**
7 | * Created by yahyabayramoglu on 14/04/15.
8 | */
9 | public abstract class ParallaxViewHolder implements ParallaxImageView.ParallaxImageListener {
10 |
11 | public View itemView;
12 | private ParallaxImageView backgroundImage;
13 |
14 | public void setBackgroundImage(ParallaxImageView backgroundImage) {
15 | this.backgroundImage = backgroundImage;
16 | this.backgroundImage.setListener(this);
17 | }
18 |
19 | public ParallaxImageView getBackgroundImage() {
20 | return backgroundImage;
21 | }
22 |
23 | @Override
24 | public int[] requireValuesForTranslate() {
25 | if (itemView.getParent() == null)
26 | return null;
27 |
28 | int[] itemPosition = new int[2];
29 | itemView.getLocationOnScreen(itemPosition);
30 |
31 | int[] recyclerPosition = new int[2];
32 | ((ListView) itemView.getParent()).getLocationOnScreen(recyclerPosition);
33 |
34 | return new int[]{itemView.getMeasuredHeight(), itemPosition[1], ((ListView) itemView.getParent()).getMeasuredHeight(), recyclerPosition[1]};
35 | }
36 |
37 | public void animateImage() {
38 | getBackgroundImage().doTranslate();
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/library/app/src/main/res/values/parallax_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/library/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | POM_NAME=ParallaxListView Library
21 | POM_ARTIFACT_ID=ParallaxListView
22 | POM_PACKAGING=aar
23 | VERSION_NAME=1.1
24 | VERSION_CODE=2
25 | GROUP=com.yayandroid
26 |
27 | POM_DESCRIPTION=ParallaxListView Library
28 | POM_URL=https://github.com/yayaa/ParallaxListView
29 | POM_SCM_URL=https://github.com/yayaa/ParallaxListView
30 | POM_SCM_CONNECTION=scm:https://github.com/yayaa/ParallaxListView.git
31 | POM_SCM_DEV_CONNECTION=scm:https://github.com/yayaa/ParallaxListView.git
32 | POM_LICENCE_NAME=MIT License
33 | POM_LICENCE_URL=http://www.opensource.org/licenses/mit-license.php
34 | POM_LICENCE_DIST=repo
35 | POM_DEVELOPER_ID=yayaa
36 | POM_DEVELOPER_NAME=Yahya BAYRAMOGLU
37 |
38 | SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
39 | RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2
--------------------------------------------------------------------------------
/library/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/library/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/library/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/library/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/library/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/library/library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/library/maven_push.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | apply plugin: 'maven'
18 | apply plugin: 'signing'
19 |
20 | def isReleaseBuild() {
21 | return VERSION_NAME.contains("SNAPSHOT") == false
22 | }
23 |
24 | def getReleaseRepositoryUrl() {
25 | return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
26 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
27 | }
28 |
29 | def getSnapshotRepositoryUrl() {
30 | return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
31 | : "https://oss.sonatype.org/content/repositories/snapshots/"
32 | }
33 |
34 | def getRepositoryUsername() {
35 | return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
36 | }
37 |
38 | def getRepositoryPassword() {
39 | return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
40 | }
41 |
42 | afterEvaluate { project ->
43 | uploadArchives {
44 | repositories {
45 | mavenDeployer {
46 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
47 |
48 | pom.groupId = GROUP
49 | pom.artifactId = POM_ARTIFACT_ID
50 | pom.version = VERSION_NAME
51 |
52 | repository(url: getReleaseRepositoryUrl()) {
53 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
54 | }
55 | snapshotRepository(url: getSnapshotRepositoryUrl()) {
56 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
57 | }
58 |
59 | pom.project {
60 | name POM_NAME
61 | packaging POM_PACKAGING
62 | description POM_DESCRIPTION
63 | url POM_URL
64 |
65 | scm {
66 | url POM_SCM_URL
67 | connection POM_SCM_CONNECTION
68 | developerConnection POM_SCM_DEV_CONNECTION
69 | }
70 |
71 | licenses {
72 | license {
73 | name POM_LICENCE_NAME
74 | url POM_LICENCE_URL
75 | distribution POM_LICENCE_DIST
76 | }
77 | }
78 |
79 | developers {
80 | developer {
81 | id POM_DEVELOPER_ID
82 | name POM_DEVELOPER_NAME
83 | }
84 | }
85 | }
86 | }
87 | }
88 | }
89 |
90 | signing {
91 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
92 | sign configurations.archives
93 | }
94 |
95 | //task androidJavadocs(type: Javadoc) {
96 | //source = android.sourceSets.main.allJava
97 | //}
98 |
99 | //task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
100 | //classifier = 'javadoc'
101 | //from androidJavadocs.destinationDir
102 | //}
103 |
104 | task androidSourcesJar(type: Jar) {
105 | classifier = 'sources'
106 | from android.sourceSets.main.java.sourceFiles
107 | }
108 |
109 | artifacts {
110 | archives androidSourcesJar
111 | }
112 | }
--------------------------------------------------------------------------------
/library/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .idea
3 | .DS_Store
4 | /local.properties
5 | /build
6 | /captures
7 |
--------------------------------------------------------------------------------
/sample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sample/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/sample/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.yayandroid.parallaxlistview.sample"
9 | minSdkVersion 8
10 | targetSdkVersion 22
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:22.0.0'
25 |
26 | compile 'com.yayandroid:ParallaxListView:1.1'
27 | compile 'com.squareup.picasso:picasso:2.5.2'
28 | }
--------------------------------------------------------------------------------
/sample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/yahyabayramoglu/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/sample/app/src/androidTest/java/com/yayandroid/parallaxlistview/sample/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview.sample;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/sample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/yayandroid/parallaxlistview/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview.sample;
2 |
3 | import android.support.v7.app.ActionBarActivity;
4 | import android.os.Bundle;
5 |
6 | import com.yayandroid.parallaxlistview.ParallaxListView;
7 |
8 | /**
9 | * Created by yahyabayramoglu on 14/04/15.
10 | */
11 | public class MainActivity extends ActionBarActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_main);
17 |
18 | ParallaxListView parallaxListView = (ParallaxListView) findViewById(R.id.parallaxListView);
19 | parallaxListView.setDividerHeight(20);
20 | parallaxListView.setAdapter(new TestAdapter(this));
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/yayandroid/parallaxlistview/sample/TestAdapter.java:
--------------------------------------------------------------------------------
1 | package com.yayandroid.parallaxlistview.sample;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.TextView;
9 |
10 | import com.squareup.picasso.Picasso;
11 | import com.yayandroid.parallaxlistview.ParallaxImageView;
12 | import com.yayandroid.parallaxlistview.ParallaxViewHolder;
13 |
14 | /**
15 | * Created by yahyabayramoglu on 14/04/15.
16 | */
17 | public class TestAdapter extends BaseAdapter {
18 |
19 | private Context context;
20 | private LayoutInflater inflater;
21 | private String[] imageUrls = new String[]{
22 | "http://yayandroid.com/data/github_library/parallax_listview/test_image_0.jpg",
23 | "http://yayandroid.com/data/github_library/parallax_listview/test_image_1.jpg",
24 | "http://yayandroid.com/data/github_library/parallax_listview/test_image_2.jpg",
25 | "http://yayandroid.com/data/github_library/parallax_listview/test_image_3.png",
26 | "http://yayandroid.com/data/github_library/parallax_listview/test_image_4.jpg",
27 | "http://yayandroid.com/data/github_library/parallax_listview/test_image_5.png",
28 | };
29 |
30 | public TestAdapter(Context context) {
31 | this.context = context;
32 | this.inflater = LayoutInflater.from(context);
33 | }
34 |
35 | @Override
36 | public View getView(int position, View convertView, ViewGroup parent) {
37 | ViewHolder viewHolder;
38 | if (convertView == null) {
39 | convertView = inflater.inflate(R.layout.item, parent, false);
40 |
41 | viewHolder = new ViewHolder();
42 | viewHolder.textView = (TextView) convertView.findViewById(R.id.testText);
43 | viewHolder.itemView = convertView;
44 | viewHolder.setBackgroundImage((ParallaxImageView) convertView.findViewById(R.id.parallaxImageView));
45 | convertView.setTag(viewHolder);
46 | } else {
47 | viewHolder = (ViewHolder) convertView.getTag();
48 | }
49 |
50 | Picasso.with(context).load(imageUrls[position % imageUrls.length]).into(viewHolder.getBackgroundImage());
51 | viewHolder.textView.setText("Row " + position);
52 |
53 | // # CAUTION:
54 | // Important to call this method
55 | viewHolder.getBackgroundImage().reuse();
56 |
57 | return convertView;
58 | }
59 |
60 | @Override
61 | public int getCount() {
62 | return 50;
63 | }
64 |
65 | @Override
66 | public Object getItem(int position) {
67 | return null;
68 | }
69 |
70 | @Override
71 | public long getItemId(int position) {
72 | return position;
73 | }
74 |
75 | /**
76 | * # CAUTION:
77 | * ViewHolder must extend from ParallaxViewHolder
78 | */
79 | static class ViewHolder extends ParallaxViewHolder {
80 |
81 | private TextView textView;
82 |
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/layout/item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/test_image_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xxhdpi/test_image_1.jpg
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/test_image_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xxhdpi/test_image_2.jpg
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/test_image_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xxhdpi/test_image_3.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/test_image_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xxhdpi/test_image_4.jpg
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/test_image_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/app/src/main/res/mipmap-xxhdpi/test_image_5.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ParallaxListView
3 |
4 | Hello world!
5 | Settings
6 |
7 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.1.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/sample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/sample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yayaa/ParallaxListView/246b52e4bb4f7e407557abd8c7cbe3ef3fcd8408/sample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/sample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jun 15 09:24:25 EEST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/sample/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/sample/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/sample/sample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/sample/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------