From 3280a3c60642a9a5472671b034d5f2eada950357 Mon Sep 17 00:00:00 2001 From: Mazen Rashed Date: Wed, 19 Dec 2018 15:58:23 +0200 Subject: [PATCH 1/5] update gradle, build version and build tools --- build.gradle | 7 ++- gradle/wrapper/gradle-wrapper.properties | 4 +- library/android-artifacts.gradle | 24 --------- library/bintray-publish.gradle | 69 ------------------------ library/build.gradle | 35 +++--------- sample/build.gradle | 17 +++--- 6 files changed, 21 insertions(+), 135 deletions(-) delete mode 100644 library/android-artifacts.gradle delete mode 100644 library/bintray-publish.gradle diff --git a/build.gradle b/build.gradle index 9293c6e..0a7769d 100644 --- a/build.gradle +++ b/build.gradle @@ -3,10 +3,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' + classpath 'com.android.tools.build:gradle:3.2.1' + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,5 +17,7 @@ buildscript { allprojects { repositories { jcenter() + mavenCentral() + google() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 582a42b..e0a91a7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Jun 23 11:31:54 JST 2016 +#Wed Dec 19 15:35:51 EET 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.6-all.zip diff --git a/library/android-artifacts.gradle b/library/android-artifacts.gradle deleted file mode 100644 index f8d302d..0000000 --- a/library/android-artifacts.gradle +++ /dev/null @@ -1,24 +0,0 @@ -task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} - -task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' - from androidJavadocs.destinationDir -} - -task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.sourceFiles -} - -task androidJar(type: Jar) { - from 'build/intermediates/classes/release' -} - -artifacts { - archives androidSourcesJar - archives androidJavadocsJar - archives androidJar -} \ No newline at end of file diff --git a/library/bintray-publish.gradle b/library/bintray-publish.gradle deleted file mode 100644 index 3aa6e2b..0000000 --- a/library/bintray-publish.gradle +++ /dev/null @@ -1,69 +0,0 @@ -apply plugin: 'maven-publish' -apply plugin: 'com.jfrog.bintray' - -publishing { - publications { - mavenJava(MavenPublication) { - groupId GROUP - version VERSION_NAME - artifactId ARTIFACT_ID -// artifact androidJar - artifact "build/outputs/aar/library-release.aar" - artifact androidJavadocsJar - artifact androidSourcesJar - pom.withXml { - Node root = asNode() - root.appendNode('name', ARTIFACT_ID) - root.appendNode('description', POM_DESCRIPTION) - root.appendNode('url', POM_URL) - - def issues = root.appendNode('issueManagement') - issues.appendNode('system', 'github') - issues.appendNode('url', ISSUE_URL) - - def scm = root.appendNode('scm') - scm.appendNode('url', POM_SCM_URL) - scm.appendNode('connection', POM_SCM_CONNECTION) - scm.appendNode('developerConnection', POM_SCM_DEV_CONNECTION) - - def license = root.appendNode('licenses').appendNode('license') - license.appendNode('name', POM_LICENCE_NAME) - license.appendNode('url', POM_LICENCE_URL) - license.appendNode('distribution', POM_LICENCE_DIST) - - def developer = root.appendNode('developers').appendNode('developer') - developer.appendNode('id', POM_DEVELOPER_ID) - developer.appendNode('name', POM_DEVELOPER_NAME) - developer.appendNode('email', POM_DEVELOPER_EMAIL) - } - } - } -} - -def getBintrayUserProperty() { - return hasProperty('bintrayUser') ? bintrayUser : "" -} - -def getBintrayApiKeyProperty() { - return hasProperty('bintrayApiKey') ? bintrayApiKey : "" -} - -bintray { - user = bintrayUserProperty - key = bintrayApiKeyProperty - publications = ['mavenJava'] - - dryRun = false - publish = false - pkg { - repo = 'maven' - name = ARTIFACT_ID - licenses = ['Apache-2.0'] - labels = ['android'] - - version { - name = VERSION_NAME - vcsTag = VERSION_NAME - } - } -} \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index f320be6..4530e48 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,40 +1,17 @@ apply plugin: 'com.android.library' android { - compileSdkVersion COMPILE_SDK_VERSION as int - buildToolsVersion BUILD_TOOLS_VERSION + buildToolsVersion '28.0.3' + compileSdkVersion 28 defaultConfig { - minSdkVersion MIN_SDK_VERSION as int - targetSdkVersion TARGET_SDK_VERSION as int - versionCode VERSION_CODE as int - versionName VERSION_NAME + minSdkVersion 19 + targetSdkVersion 28 } } dependencies { - compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.android.support:recyclerview-v7:23.4.0' + compile 'com.android.support:appcompat-v7:28.0.0' + compile 'com.android.support:recyclerview-v7:28.0.0' } -android.libraryVariants.all { variant -> - if (variant.buildType.isDebuggable()) { - return; // Skip debug builds. - } - task("javadoc${variant.name.capitalize()}", type: Javadoc) { - description "Generates Javadoc for $variant.name." - source = variant.javaCompile.source - ext.androidJar = System.getenv("ANDROID_HOME") + - "/platforms/${android.compileSdkVersion}/android.jar" - classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar) - } - - task("bundleJavadoc${variant.name.capitalize()}", type: Jar) { - description "Bundles Javadoc into zip for $variant.name." - classifier = "javadoc" - from tasks["javadoc${variant.name.capitalize()}"] - } -} - -apply from: 'android-artifacts.gradle' -apply from: 'bintray-publish.gradle' \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle index 3fe6074..017e25a 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion COMPILE_SDK_VERSION as int - buildToolsVersion BUILD_TOOLS_VERSION + buildToolsVersion '28.0.3' + compileSdkVersion 28 defaultConfig { applicationId "com.yqritc.recyclerviewflexibledivider.sample" - minSdkVersion MIN_SDK_VERSION as int - targetSdkVersion TARGET_SDK_VERSION as int - versionCode VERSION_CODE as int - versionName VERSION_NAME + minSdkVersion 19 + targetSdkVersion 28 + versionCode 15 + versionName "1.5.0" } buildTypes { release { @@ -21,7 +21,6 @@ android { dependencies { compile project(':library') -// compile 'com.yqritc:recyclerview-flexibledivider:1.4.0' - compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.android.support:recyclerview-v7:23.4.0' + compile 'com.android.support:appcompat-v7:28.0.0' + compile 'com.android.support:recyclerview-v7:28.0.0' } From 921d55c7c427a1ff1cdbcc33d35234f0e83790ac Mon Sep 17 00:00:00 2001 From: Mazen Rashed Date: Wed, 19 Dec 2018 16:02:09 +0200 Subject: [PATCH 2/5] Migrate to AndroidX --- gradle.properties | 4 +++- library/build.gradle | 4 ++-- .../FlexibleDividerDecoration.java | 14 +++++++------- .../HorizontalDividerItemDecoration.java | 6 +++--- .../VerticalDividerItemDecoration.java | 6 +++--- sample/build.gradle | 4 ++-- .../sample/ComplexActivity.java | 8 ++++---- .../sample/ComplexAdapter.java | 2 +- .../sample/DrawableActivity.java | 8 ++++---- .../sample/PaintActivity.java | 8 ++++---- .../sample/SimpleActivity.java | 8 ++++---- .../sample/SimpleAdapter.java | 2 +- .../sample/SimpleGridActivity.java | 8 ++++---- sample/src/main/res/layout/activity_sample.xml | 2 +- 14 files changed, 43 insertions(+), 41 deletions(-) diff --git a/gradle.properties b/gradle.properties index 048bda4..e7463a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,4 +19,6 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=yqritc POM_DEVELOPER_NAME=yqritc POM_DEVELOPER_EMAIL=yqritc@gmail.com -ISSUE_URL=https://github.com/yqritc/RecyclerView-FlexibleDivider/issues \ No newline at end of file +ISSUE_URL=https://github.com/yqritc/RecyclerView-FlexibleDivider/issues +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index 4530e48..d077148 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -11,7 +11,7 @@ android { } dependencies { - compile 'com.android.support:appcompat-v7:28.0.0' - compile 'com.android.support:recyclerview-v7:28.0.0' + compile 'androidx.appcompat:appcompat:1.1.0-alpha01' + compile 'androidx.recyclerview:recyclerview:1.1.0-alpha01' } diff --git a/library/src/main/java/com/yqritc/recyclerviewflexibledivider/FlexibleDividerDecoration.java b/library/src/main/java/com/yqritc/recyclerviewflexibledivider/FlexibleDividerDecoration.java index 26a765a..793c3b7 100644 --- a/library/src/main/java/com/yqritc/recyclerviewflexibledivider/FlexibleDividerDecoration.java +++ b/library/src/main/java/com/yqritc/recyclerviewflexibledivider/FlexibleDividerDecoration.java @@ -7,13 +7,13 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorRes; -import android.support.annotation.DimenRes; -import android.support.annotation.DrawableRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.widget.GridLayoutManager; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.ColorRes; +import androidx.annotation.DimenRes; +import androidx.annotation.DrawableRes; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; /** diff --git a/library/src/main/java/com/yqritc/recyclerviewflexibledivider/HorizontalDividerItemDecoration.java b/library/src/main/java/com/yqritc/recyclerviewflexibledivider/HorizontalDividerItemDecoration.java index aefa9d6..d08d6d5 100644 --- a/library/src/main/java/com/yqritc/recyclerviewflexibledivider/HorizontalDividerItemDecoration.java +++ b/library/src/main/java/com/yqritc/recyclerviewflexibledivider/HorizontalDividerItemDecoration.java @@ -3,9 +3,9 @@ import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.DimenRes; -import android.support.v4.view.ViewCompat; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.DimenRes; +import androidx.core.view.ViewCompat; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; /** diff --git a/library/src/main/java/com/yqritc/recyclerviewflexibledivider/VerticalDividerItemDecoration.java b/library/src/main/java/com/yqritc/recyclerviewflexibledivider/VerticalDividerItemDecoration.java index a7562cc..4cd57b3 100644 --- a/library/src/main/java/com/yqritc/recyclerviewflexibledivider/VerticalDividerItemDecoration.java +++ b/library/src/main/java/com/yqritc/recyclerviewflexibledivider/VerticalDividerItemDecoration.java @@ -3,9 +3,9 @@ import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.DimenRes; -import android.support.v4.view.ViewCompat; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.DimenRes; +import androidx.core.view.ViewCompat; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; /** diff --git a/sample/build.gradle b/sample/build.gradle index 017e25a..51780d8 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -21,6 +21,6 @@ android { dependencies { compile project(':library') - compile 'com.android.support:appcompat-v7:28.0.0' - compile 'com.android.support:recyclerview-v7:28.0.0' + compile 'androidx.appcompat:appcompat:1.1.0-alpha01' + compile 'androidx.recyclerview:recyclerview:1.1.0-alpha01' } diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexActivity.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexActivity.java index c299f55..df51102 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexActivity.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexActivity.java @@ -5,10 +5,10 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.OrientationHelper; -import android.support.v7.widget.RecyclerView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.OrientationHelper; +import androidx.recyclerview.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; import android.view.View; diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexAdapter.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexAdapter.java index e401a02..c686ae6 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexAdapter.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/ComplexAdapter.java @@ -7,7 +7,7 @@ import android.graphics.Color; import android.graphics.DashPathEffect; import android.graphics.Paint; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/DrawableActivity.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/DrawableActivity.java index c57bc12..e130986 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/DrawableActivity.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/DrawableActivity.java @@ -5,10 +5,10 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.OrientationHelper; -import android.support.v7.widget.RecyclerView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.OrientationHelper; +import androidx.recyclerview.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/PaintActivity.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/PaintActivity.java index 4bcd705..6e0f71c 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/PaintActivity.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/PaintActivity.java @@ -8,10 +8,10 @@ import android.graphics.DashPathEffect; import android.graphics.Paint; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.OrientationHelper; -import android.support.v7.widget.RecyclerView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.OrientationHelper; +import androidx.recyclerview.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; import android.view.View; diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleActivity.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleActivity.java index 9ac740f..5fa89b9 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleActivity.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleActivity.java @@ -5,10 +5,10 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.OrientationHelper; -import android.support.v7.widget.RecyclerView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.OrientationHelper; +import androidx.recyclerview.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleAdapter.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleAdapter.java index 14696f1..319d146 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleAdapter.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleAdapter.java @@ -1,7 +1,7 @@ package com.yqritc.recyclerviewflexibledivider.sample; import android.content.Context; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleGridActivity.java b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleGridActivity.java index 5f9b673..11ddc14 100644 --- a/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleGridActivity.java +++ b/sample/src/main/java/com/yqritc/recyclerviewflexibledivider/sample/SimpleGridActivity.java @@ -5,10 +5,10 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.GridLayoutManager; -import android.support.v7.widget.OrientationHelper; -import android.support.v7.widget.RecyclerView; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.OrientationHelper; +import androidx.recyclerview.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; diff --git a/sample/src/main/res/layout/activity_sample.xml b/sample/src/main/res/layout/activity_sample.xml index 53dfde2..0648abf 100644 --- a/sample/src/main/res/layout/activity_sample.xml +++ b/sample/src/main/res/layout/activity_sample.xml @@ -8,7 +8,7 @@ android:paddingTop="@dimen/activity_vertical_margin" tools:context=".SimpleActivity"> - From aeb630aea45e1f9dcd0bf2b8738452482f05a759 Mon Sep 17 00:00:00 2001 From: mazenrashed Date: Wed, 19 Dec 2018 16:06:58 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a560904..c1f1dac 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Android library providing simple way to control divider items of RecyclerView [Release Note] (https://github.com/yqritc/RecyclerView-FlexibleDivider/releases) +AndroidX # Gradle ```groovy repositories { @@ -18,7 +19,18 @@ repositories { } dependencies { - compile 'com.yqritc:recyclerview-flexibledivider:1.4.0' + implementation 'com.github.mazenrashed:RecyclerView-FlexibleDivider:1.5.0' +} +``` +Support lib +# Gradle +```groovy +repositories { + jcenter() +} + +dependencies { + implementation 'com.yqritc:recyclerview-flexibledivider:1.4.0' } ``` From 296791f476a030162d43e801d7a3b8da791193e8 Mon Sep 17 00:00:00 2001 From: mazenrashed Date: Wed, 19 Dec 2018 16:07:37 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1f1dac..37fa7e8 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Android library providing simple way to control divider items of RecyclerView [Release Note] (https://github.com/yqritc/RecyclerView-FlexibleDivider/releases) -AndroidX -# Gradle + +# Gradle (AndroidX) ```groovy repositories { jcenter() @@ -22,8 +22,8 @@ dependencies { implementation 'com.github.mazenrashed:RecyclerView-FlexibleDivider:1.5.0' } ``` -Support lib -# Gradle + +# Gradle (Support lib) ```groovy repositories { jcenter() From f9578d6da37d0c51febba3ffa17e854dce9fc77f Mon Sep 17 00:00:00 2001 From: mazenrashed Date: Wed, 19 Dec 2018 16:12:04 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 37fa7e8..e305fa5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Android library providing simple way to control divider items of RecyclerView ```groovy repositories { jcenter() + maven { url 'https://jitpack.io' } } dependencies {