Skip to content

Commit 564a74f

Browse files
committed
update build config, fix daimajia#397
1 parent d7a5759 commit 564a74f

File tree

7 files changed

+38
-25
lines changed

7 files changed

+38
-25
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:1.0.0'
11+
classpath 'com.android.tools.build:gradle:2.2.3'
1212
classpath 'com.github.dcendents:android-maven-plugin:1.2'
1313

1414
// NOTE: Do not place your application dependencies here; they belong

demo/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android {
2626

2727
dependencies {
2828
compile project(":library")
29-
compile 'com.android.support:recyclerview-v7:21.0.0'
29+
compile 'com.android.support:recyclerview-v7:25.1.1'
3030
compile 'com.daimajia.easing:library:1.0.0@aar'
3131
compile 'com.daimajia.androidanimations:library:1.1.2@aar'
3232
compile 'com.nineoldandroids:library:2.4.0'

demo/src/main/java/com/daimajia/swipedemo/adapter/util/RecyclerItemClickListener.java

+5
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) {
3737
@Override
3838
public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) {
3939
}
40+
41+
@Override
42+
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
43+
44+
}
4045
}

gradle.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ VERSION_NAME=1.2.0
2222
VERSION_CODE=22
2323
GROUP=com.daimajia.swipelayout
2424

25-
ANDROID_BUILD_MIN_SDK_VERSION=8
26-
ANDROID_BUILD_TARGET_SDK_VERSION=21
27-
ANDROID_BUILD_SDK_VERSION=21
28-
ANDROID_BUILD_TOOLS_VERSION=21.0.0
25+
ANDROID_BUILD_MIN_SDK_VERSION=9
26+
ANDROID_BUILD_TARGET_SDK_VERSION=25
27+
ANDROID_BUILD_SDK_VERSION=25
28+
ANDROID_BUILD_TOOLS_VERSION=25.0.2
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Apr 10 15:27:10 PDT 2013
1+
#Wed Mar 08 17:06:52 CST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

library/build.gradle

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ android {
55
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
66

77
defaultConfig {
8-
minSdkVersion 8
8+
minSdkVersion 9
99
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
1010
}
1111
}
1212

1313
dependencies {
14-
compile 'com.android.support:recyclerview-v7:21.0.0'
15-
compile 'com.android.support:support-v4:22.1.1'
14+
compile 'com.android.support:recyclerview-v7:25.1.1'
15+
compile 'com.android.support:support-v4:25.1.1'
1616
}
1717
apply from: './gradle-mvn-push.gradle'
1818

19-
apply plugin: 'android-maven'
2019
// build a jar with source files
2120
task sourcesJar(type: Jar) {
2221
from android.sourceSets.main.java.srcDirs

library/src/main/java/com/daimajia/swipe/SwipeLayout.java

+22-13
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public class SwipeLayout extends FrameLayout {
5959
private boolean mSwipeEnabled = true;
6060
private boolean[] mSwipesEnabled = new boolean[]{true, true, true, true};
6161
private boolean mClickToClose = false;
62-
private float mWillOpenPercentAfterOpen=0.75f;
63-
private float mWillOpenPercentAfterClose=0.25f;
62+
private float mWillOpenPercentAfterOpen = 0.75f;
63+
private float mWillOpenPercentAfterClose = 0.25f;
6464

6565
public enum DragEdge {
6666
Left,
@@ -403,17 +403,17 @@ else if (mCurrentDragEdge == DragEdge.Bottom && newTop > getPaddingTop())
403403
/**
404404
* save children's bounds, so they can restore the bound in {@link #onLayout(boolean, int, int, int, int)}
405405
*/
406-
private void captureChildrenBound(){
406+
private void captureChildrenBound() {
407407
View currentBottomView = getCurrentBottomView();
408-
if(getOpenStatus()==Status.Close){
408+
if (getOpenStatus() == Status.Close) {
409409
mViewBoundCache.remove(currentBottomView);
410410
return;
411411
}
412412

413413
View[] views = new View[]{getSurfaceView(), currentBottomView};
414414
for (View child : views) {
415415
Rect rect = mViewBoundCache.get(child);
416-
if(rect==null){
416+
if (rect == null) {
417417
rect = new Rect();
418418
mViewBoundCache.put(child, rect);
419419
}
@@ -794,14 +794,15 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
794794
void layoutPullOut() {
795795
View surfaceView = getSurfaceView();
796796
Rect surfaceRect = mViewBoundCache.get(surfaceView);
797-
if(surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
797+
if (surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
798798
if (surfaceView != null) {
799799
surfaceView.layout(surfaceRect.left, surfaceRect.top, surfaceRect.right, surfaceRect.bottom);
800800
bringChildToFront(surfaceView);
801801
}
802802
View currentBottomView = getCurrentBottomView();
803803
Rect bottomViewRect = mViewBoundCache.get(currentBottomView);
804-
if(bottomViewRect == null) bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.PullOut, surfaceRect);
804+
if (bottomViewRect == null)
805+
bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.PullOut, surfaceRect);
805806
if (currentBottomView != null) {
806807
currentBottomView.layout(bottomViewRect.left, bottomViewRect.top, bottomViewRect.right, bottomViewRect.bottom);
807808
}
@@ -810,14 +811,15 @@ void layoutPullOut() {
810811
void layoutLayDown() {
811812
View surfaceView = getSurfaceView();
812813
Rect surfaceRect = mViewBoundCache.get(surfaceView);
813-
if(surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
814+
if (surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
814815
if (surfaceView != null) {
815816
surfaceView.layout(surfaceRect.left, surfaceRect.top, surfaceRect.right, surfaceRect.bottom);
816817
bringChildToFront(surfaceView);
817818
}
818819
View currentBottomView = getCurrentBottomView();
819820
Rect bottomViewRect = mViewBoundCache.get(currentBottomView);
820-
if(bottomViewRect == null) bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.LayDown, surfaceRect);
821+
if (bottomViewRect == null)
822+
bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.LayDown, surfaceRect);
821823
if (currentBottomView != null) {
822824
currentBottomView.layout(bottomViewRect.left, bottomViewRect.top, bottomViewRect.right, bottomViewRect.bottom);
823825
}
@@ -1043,10 +1045,12 @@ public boolean isBottomSwipeEnabled() {
10431045
public void setBottomSwipeEnabled(boolean bottomSwipeEnabled) {
10441046
this.mSwipesEnabled[DragEdge.Bottom.ordinal()] = bottomSwipeEnabled;
10451047
}
1048+
10461049
/***
10471050
* Returns the percentage of revealing at which the view below should the view finish opening
10481051
* if it was already open before dragging
1049-
* @returns The percentage of view revealed to trigger, default value is 0.25
1052+
*
1053+
* @returns The percentage of view revealed to trigger, default value is 0.25
10501054
*/
10511055
public float getWillOpenPercentAfterOpen() {
10521056
return mWillOpenPercentAfterOpen;
@@ -1055,22 +1059,27 @@ public float getWillOpenPercentAfterOpen() {
10551059
/***
10561060
* Allows to stablish at what percentage of revealing the view below should the view finish opening
10571061
* if it was already open before dragging
1062+
*
10581063
* @param willOpenPercentAfterOpen The percentage of view revealed to trigger, default value is 0.25
10591064
*/
10601065
public void setWillOpenPercentAfterOpen(float willOpenPercentAfterOpen) {
10611066
this.mWillOpenPercentAfterOpen = willOpenPercentAfterOpen;
10621067
}
1068+
10631069
/***
10641070
* Returns the percentage of revealing at which the view below should the view finish opening
10651071
* if it was already closed before dragging
1066-
* @returns The percentage of view revealed to trigger, default value is 0.25
1072+
*
1073+
* @returns The percentage of view revealed to trigger, default value is 0.25
10671074
*/
10681075
public float getWillOpenPercentAfterClose() {
10691076
return mWillOpenPercentAfterClose;
10701077
}
1078+
10711079
/***
10721080
* Allows to stablish at what percentage of revealing the view below should the view finish opening
10731081
* if it was already closed before dragging
1082+
*
10741083
* @param willOpenPercentAfterClose The percentage of view revealed to trigger, default value is 0.75
10751084
*/
10761085
public void setWillOpenPercentAfterClose(float willOpenPercentAfterClose) {
@@ -1324,7 +1333,7 @@ protected void processHandRelease(float xvel, float yvel, boolean isCloseBeforeD
13241333
if (currentDragEdge == null || surfaceView == null) {
13251334
return;
13261335
}
1327-
float willOpenPercent = (isCloseBeforeDragged ? mWillOpenPercentAfterClose : mWillOpenPercentAfterOpen););
1336+
float willOpenPercent = (isCloseBeforeDragged ? mWillOpenPercentAfterClose : mWillOpenPercentAfterOpen);
13281337
if (currentDragEdge == DragEdge.Left) {
13291338
if (xvel > minVelocity) open();
13301339
else if (xvel < -minVelocity) close();
@@ -1563,7 +1572,7 @@ public void setDragEdge(DragEdge dragEdge) {
15631572
setCurrentDragEdge(dragEdge);
15641573
}
15651574

1566-
protected void onViewRemoved(View child) {
1575+
public void onViewRemoved(View child) {
15671576
for (Map.Entry<DragEdge, View> entry : new HashMap<DragEdge, View>(mDragEdges).entrySet()) {
15681577
if (entry.getValue() == child) {
15691578
mDragEdges.remove(entry.getKey());

0 commit comments

Comments
 (0)