Skip to content
This repository was archived by the owner on Jul 22, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta5'
classpath 'com.novoda:bintray-release:0.3.4'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:bintray-release:0.8.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Jan 23 09:50:54 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
15 changes: 9 additions & 6 deletions library/src/main/java/link/fls/swipestack/SwipeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.animation.Animator;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewPropertyAnimator;
import android.view.animation.OvershootInterpolator;

import link.fls.swipestack.util.AnimationUtils;
Expand Down Expand Up @@ -138,15 +139,16 @@ private void resetViewPosition() {
private void swipeViewToLeft(int duration) {
if (!mListenForTouchEvents) return;
mListenForTouchEvents = false;
mObservedView.animate().cancel();
mObservedView.animate()
.x(-mSwipeStack.getWidth() + mObservedView.getX())
final ViewPropertyAnimator animator = mObservedView.animate();
animator.cancel();
animator.x(-mSwipeStack.getWidth() + mObservedView.getX())
.rotation(-mRotateDegrees)
.alpha(0f)
.setDuration(duration)
.setListener(new AnimationUtils.AnimationEndListener() {
@Override
public void onAnimationEnd(Animator animation) {
animator.setListener(null);
mSwipeStack.onViewSwipedToLeft();
}
});
Expand All @@ -155,15 +157,16 @@ public void onAnimationEnd(Animator animation) {
private void swipeViewToRight(int duration) {
if (!mListenForTouchEvents) return;
mListenForTouchEvents = false;
mObservedView.animate().cancel();
mObservedView.animate()
.x(mSwipeStack.getWidth() + mObservedView.getX())
final ViewPropertyAnimator animator = mObservedView.animate();
animator.cancel();
animator.x(mSwipeStack.getWidth() + mObservedView.getX())
.rotation(mRotateDegrees)
.alpha(0f)
.setDuration(duration)
.setListener(new AnimationUtils.AnimationEndListener() {
@Override
public void onAnimationEnd(Animator animation) {
animator.setListener(null);
mSwipeStack.onViewSwipedToRight();
}
});
Expand Down