update build config, fix #397
This commit is contained in:
parent
d7a5759784
commit
564a74fcc7
|
|
@ -8,7 +8,7 @@ buildscript {
|
|||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.0.0'
|
||||
classpath 'com.android.tools.build:gradle:2.2.3'
|
||||
classpath 'com.github.dcendents:android-maven-plugin:1.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ android {
|
|||
|
||||
dependencies {
|
||||
compile project(":library")
|
||||
compile 'com.android.support:recyclerview-v7:21.0.0'
|
||||
compile 'com.android.support:recyclerview-v7:25.1.1'
|
||||
compile 'com.daimajia.easing:library:1.0.0@aar'
|
||||
compile 'com.daimajia.androidanimations:library:1.1.2@aar'
|
||||
compile 'com.nineoldandroids:library:2.4.0'
|
||||
|
|
|
|||
|
|
@ -37,4 +37,9 @@ public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListen
|
|||
@Override
|
||||
public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ VERSION_NAME=1.2.0
|
|||
VERSION_CODE=22
|
||||
GROUP=com.daimajia.swipelayout
|
||||
|
||||
ANDROID_BUILD_MIN_SDK_VERSION=8
|
||||
ANDROID_BUILD_TARGET_SDK_VERSION=21
|
||||
ANDROID_BUILD_SDK_VERSION=21
|
||||
ANDROID_BUILD_TOOLS_VERSION=21.0.0
|
||||
ANDROID_BUILD_MIN_SDK_VERSION=9
|
||||
ANDROID_BUILD_TARGET_SDK_VERSION=25
|
||||
ANDROID_BUILD_SDK_VERSION=25
|
||||
ANDROID_BUILD_TOOLS_VERSION=25.0.2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#Wed Apr 10 15:27:10 PDT 2013
|
||||
#Wed Mar 08 17:06:52 CST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
||||
|
|
|
|||
|
|
@ -5,18 +5,17 @@ android {
|
|||
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
minSdkVersion 9
|
||||
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:recyclerview-v7:21.0.0'
|
||||
compile 'com.android.support:support-v4:22.1.1'
|
||||
compile 'com.android.support:recyclerview-v7:25.1.1'
|
||||
compile 'com.android.support:support-v4:25.1.1'
|
||||
}
|
||||
apply from: './gradle-mvn-push.gradle'
|
||||
|
||||
apply plugin: 'android-maven'
|
||||
// build a jar with source files
|
||||
task sourcesJar(type: Jar) {
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ public class SwipeLayout extends FrameLayout {
|
|||
private boolean mSwipeEnabled = true;
|
||||
private boolean[] mSwipesEnabled = new boolean[]{true, true, true, true};
|
||||
private boolean mClickToClose = false;
|
||||
private float mWillOpenPercentAfterOpen=0.75f;
|
||||
private float mWillOpenPercentAfterClose=0.25f;
|
||||
private float mWillOpenPercentAfterOpen = 0.75f;
|
||||
private float mWillOpenPercentAfterClose = 0.25f;
|
||||
|
||||
public enum DragEdge {
|
||||
Left,
|
||||
|
|
@ -403,9 +403,9 @@ public class SwipeLayout extends FrameLayout {
|
|||
/**
|
||||
* save children's bounds, so they can restore the bound in {@link #onLayout(boolean, int, int, int, int)}
|
||||
*/
|
||||
private void captureChildrenBound(){
|
||||
private void captureChildrenBound() {
|
||||
View currentBottomView = getCurrentBottomView();
|
||||
if(getOpenStatus()==Status.Close){
|
||||
if (getOpenStatus() == Status.Close) {
|
||||
mViewBoundCache.remove(currentBottomView);
|
||||
return;
|
||||
}
|
||||
|
|
@ -413,7 +413,7 @@ public class SwipeLayout extends FrameLayout {
|
|||
View[] views = new View[]{getSurfaceView(), currentBottomView};
|
||||
for (View child : views) {
|
||||
Rect rect = mViewBoundCache.get(child);
|
||||
if(rect==null){
|
||||
if (rect == null) {
|
||||
rect = new Rect();
|
||||
mViewBoundCache.put(child, rect);
|
||||
}
|
||||
|
|
@ -794,14 +794,15 @@ public class SwipeLayout extends FrameLayout {
|
|||
void layoutPullOut() {
|
||||
View surfaceView = getSurfaceView();
|
||||
Rect surfaceRect = mViewBoundCache.get(surfaceView);
|
||||
if(surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
|
||||
if (surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
|
||||
if (surfaceView != null) {
|
||||
surfaceView.layout(surfaceRect.left, surfaceRect.top, surfaceRect.right, surfaceRect.bottom);
|
||||
bringChildToFront(surfaceView);
|
||||
}
|
||||
View currentBottomView = getCurrentBottomView();
|
||||
Rect bottomViewRect = mViewBoundCache.get(currentBottomView);
|
||||
if(bottomViewRect == null) bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.PullOut, surfaceRect);
|
||||
if (bottomViewRect == null)
|
||||
bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.PullOut, surfaceRect);
|
||||
if (currentBottomView != null) {
|
||||
currentBottomView.layout(bottomViewRect.left, bottomViewRect.top, bottomViewRect.right, bottomViewRect.bottom);
|
||||
}
|
||||
|
|
@ -810,14 +811,15 @@ public class SwipeLayout extends FrameLayout {
|
|||
void layoutLayDown() {
|
||||
View surfaceView = getSurfaceView();
|
||||
Rect surfaceRect = mViewBoundCache.get(surfaceView);
|
||||
if(surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
|
||||
if (surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
|
||||
if (surfaceView != null) {
|
||||
surfaceView.layout(surfaceRect.left, surfaceRect.top, surfaceRect.right, surfaceRect.bottom);
|
||||
bringChildToFront(surfaceView);
|
||||
}
|
||||
View currentBottomView = getCurrentBottomView();
|
||||
Rect bottomViewRect = mViewBoundCache.get(currentBottomView);
|
||||
if(bottomViewRect == null) bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.LayDown, surfaceRect);
|
||||
if (bottomViewRect == null)
|
||||
bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.LayDown, surfaceRect);
|
||||
if (currentBottomView != null) {
|
||||
currentBottomView.layout(bottomViewRect.left, bottomViewRect.top, bottomViewRect.right, bottomViewRect.bottom);
|
||||
}
|
||||
|
|
@ -1043,10 +1045,12 @@ public class SwipeLayout extends FrameLayout {
|
|||
public void setBottomSwipeEnabled(boolean bottomSwipeEnabled) {
|
||||
this.mSwipesEnabled[DragEdge.Bottom.ordinal()] = bottomSwipeEnabled;
|
||||
}
|
||||
|
||||
/***
|
||||
* Returns the percentage of revealing at which the view below should the view finish opening
|
||||
* if it was already open before dragging
|
||||
* @returns The percentage of view revealed to trigger, default value is 0.25
|
||||
*
|
||||
* @returns The percentage of view revealed to trigger, default value is 0.25
|
||||
*/
|
||||
public float getWillOpenPercentAfterOpen() {
|
||||
return mWillOpenPercentAfterOpen;
|
||||
|
|
@ -1055,22 +1059,27 @@ public class SwipeLayout extends FrameLayout {
|
|||
/***
|
||||
* Allows to stablish at what percentage of revealing the view below should the view finish opening
|
||||
* if it was already open before dragging
|
||||
*
|
||||
* @param willOpenPercentAfterOpen The percentage of view revealed to trigger, default value is 0.25
|
||||
*/
|
||||
public void setWillOpenPercentAfterOpen(float willOpenPercentAfterOpen) {
|
||||
this.mWillOpenPercentAfterOpen = willOpenPercentAfterOpen;
|
||||
}
|
||||
|
||||
/***
|
||||
* Returns the percentage of revealing at which the view below should the view finish opening
|
||||
* if it was already closed before dragging
|
||||
* @returns The percentage of view revealed to trigger, default value is 0.25
|
||||
*
|
||||
* @returns The percentage of view revealed to trigger, default value is 0.25
|
||||
*/
|
||||
public float getWillOpenPercentAfterClose() {
|
||||
return mWillOpenPercentAfterClose;
|
||||
}
|
||||
|
||||
/***
|
||||
* Allows to stablish at what percentage of revealing the view below should the view finish opening
|
||||
* if it was already closed before dragging
|
||||
*
|
||||
* @param willOpenPercentAfterClose The percentage of view revealed to trigger, default value is 0.75
|
||||
*/
|
||||
public void setWillOpenPercentAfterClose(float willOpenPercentAfterClose) {
|
||||
|
|
@ -1324,7 +1333,7 @@ public class SwipeLayout extends FrameLayout {
|
|||
if (currentDragEdge == null || surfaceView == null) {
|
||||
return;
|
||||
}
|
||||
float willOpenPercent = (isCloseBeforeDragged ? mWillOpenPercentAfterClose : mWillOpenPercentAfterOpen););
|
||||
float willOpenPercent = (isCloseBeforeDragged ? mWillOpenPercentAfterClose : mWillOpenPercentAfterOpen);
|
||||
if (currentDragEdge == DragEdge.Left) {
|
||||
if (xvel > minVelocity) open();
|
||||
else if (xvel < -minVelocity) close();
|
||||
|
|
@ -1563,7 +1572,7 @@ public class SwipeLayout extends FrameLayout {
|
|||
setCurrentDragEdge(dragEdge);
|
||||
}
|
||||
|
||||
protected void onViewRemoved(View child) {
|
||||
public void onViewRemoved(View child) {
|
||||
for (Map.Entry<DragEdge, View> entry : new HashMap<DragEdge, View>(mDragEdges).entrySet()) {
|
||||
if (entry.getValue() == child) {
|
||||
mDragEdges.remove(entry.getKey());
|
||||
|
|
|
|||
Loading…
Reference in New Issue