From 4992a087474fb4764c0af2d00c1f95e9bf412169 Mon Sep 17 00:00:00 2001 From: Andrey Rahimov Date: Fri, 20 Nov 2015 11:50:00 +0200 Subject: [PATCH] Add support for Android 2.2, bump up sdk versions and gradle plugin --- build.gradle | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- library/build.gradle | 10 +++++----- .../expandablelayout/library/ExpandableLayout.java | 8 ++++++-- sample/build.gradle | 10 +++++----- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 90fac3f..0ea1766 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.android.tools.build:gradle:1.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -14,10 +14,10 @@ buildscript { allprojects { - version = VERSION_NAME - group = GROUP +// version = VERSION_NAME +// group = GROUP repositories { jcenter() } -} +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 01af84a..84ab366 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip diff --git a/library/build.gradle b/library/build.gradle index 5aece0e..28d7d83 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" + compileSdkVersion 23 + buildToolsVersion "23.0.1" defaultConfig { - minSdkVersion 14 - targetSdkVersion 21 + minSdkVersion 8 + targetSdkVersion 23 versionCode 7 versionName "1.3" } @@ -22,4 +22,4 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) } -apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' +//apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' \ No newline at end of file diff --git a/library/src/main/java/com/andexert/expandablelayout/library/ExpandableLayout.java b/library/src/main/java/com/andexert/expandablelayout/library/ExpandableLayout.java index f1a85ab..7d008df 100644 --- a/library/src/main/java/com/andexert/expandablelayout/library/ExpandableLayout.java +++ b/library/src/main/java/com/andexert/expandablelayout/library/ExpandableLayout.java @@ -82,7 +82,11 @@ private void init(final Context context, AttributeSet attrs) final View contentView = View.inflate(context, contentID, null); contentView.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); contentLayout.addView(contentView); - contentLayout.setVisibility(GONE); + //workaround for android pre 14sdk + contentLayout.getLayoutParams().height = 1; + contentLayout.setVisibility(View.INVISIBLE); + contentLayout.requestLayout(); + headerLayout.setOnClickListener(new OnClickListener() { @Override @@ -148,7 +152,7 @@ private void collapse(final View v) protected void applyTransformation(float interpolatedTime, Transformation t) { if(interpolatedTime == 1) { - v.setVisibility(View.GONE); + v.setVisibility(View.INVISIBLE); isOpened = false; } else{ diff --git a/sample/build.gradle b/sample/build.gradle index 4bb44e6..a03835a 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" + compileSdkVersion 23 + buildToolsVersion "23.0.1" defaultConfig { - minSdkVersion 14 - targetSdkVersion 21 + minSdkVersion 8 + targetSdkVersion 23 versionCode 1 versionName "1.0" } @@ -21,4 +21,4 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':library') -} +} \ No newline at end of file