Skip to content

Commit 340a770

Browse files
committed
- Updated Gradle Plugin to 3.4.1
- Updated Gradle to 5.4.1 - Using new Sky-UK Gradle maven plugin and dropped dcendents maven plugin - Implemented "prepareForReuse" in view holders - Added additional declarative extensions
1 parent 9f434a8 commit 340a770

File tree

15 files changed

+114
-282
lines changed

15 files changed

+114
-282
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ In this way every item of the recycler view has its own set of files, resulting
3737
## <a name="setup"></a>Setup
3838
In your gradle dependencies add:
3939
```groovy
40-
def recyclerAdapterVersion = "2.7.0" // change it with the version you want to use
40+
def recyclerAdapterVersion = "2.8.0" // change it with the version you want to use
4141
implementation "net.gotev:recycleradapter:$recyclerAdapterVersion"
4242
```
4343
This is the latest version: [ ![Download](https://api.bintray.com/packages/gotev/maven/recycler-adapter/images/download.svg) ](https://bintray.com/gotev/maven/recycler-adapter/_latestVersion)
@@ -91,6 +91,12 @@ open class ExampleItem(private val context: Context, private val text: String)
9191
get() = itemView
9292

9393
internal val titleField: TextView by lazy { title }
94+
95+
override fun prepareForReuse() {
96+
// Here you can perform operations to clear data from the holder
97+
// and free used resources, like bitmaps or other heavy weight
98+
// things
99+
}
94100
}
95101
}
96102
```

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
apply from: '../manifest.gradle'
66

77
repositories {
8-
jcenter()
98
google()
9+
jcenter()
1010
mavenCentral()
1111
}
1212

@@ -15,7 +15,6 @@ buildscript {
1515

1616
//classpath dependencies to import library project
1717
classpath "com.github.ben-manes:gradle-versions-plugin:$gradle_versions_plugin_version"
18-
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_gradle_version"
1918
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_plugin_version"
2019
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2120

@@ -26,8 +25,8 @@ buildscript {
2625

2726
allprojects {
2827
repositories {
29-
jcenter()
3028
google()
29+
jcenter()
3130
mavenCentral()
3231
}
3332
}

app/demo/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'com.android.application'
2-
apply plugin: 'kotlin-android-extensions'
32
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-android-extensions'
44

55
android {
66
compileSdkVersion target_sdk

app/demo/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

app/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ buildscript {
66
repositories {
77
google()
88
jcenter()
9+
mavenCentral()
910
}
1011

1112
dependencies {
1213
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1314
classpath "com.android.tools.build:gradle:$gradle_version"
1415
classpath "com.github.ben-manes:gradle-versions-plugin:$gradle_versions_plugin_version"
15-
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_gradle_version"
1616
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_plugin_version"
1717

1818
// NOTE: Do not place your application dependencies here; they belong
@@ -24,6 +24,7 @@ allprojects {
2424
repositories {
2525
google()
2626
jcenter()
27+
mavenCentral()
2728
}
2829
}
2930

gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ org.gradle.jvmargs=-Xmx1536m
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1717
# org.gradle.parallel=true
18+
19+
# Kotlin code style for this project: "official" or "obsolete":
20+
kotlin.code.style=official
21+
android.useAndroidX=true
22+
android.enableJetifier=true

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

manifest.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@ ext {
44

55
maintainer = 'Aleksandar Gotev'
66

7+
bintray_project_name = 'recycler-adapter'
78
library_description = 'Easily create a RecyclerView Adapter'
89
library_keywords = ['android', 'recycler', 'recyclerview', 'adapter', 'fast', 'easy']
910
library_licenses = ["Apache-2.0"]
1011
library_licenses_url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
1112
library_project_group = 'net.gotev'
12-
library_version = '2.7.0'
13+
library_version = '2.8.0'
1314
version_code = 5
1415
min_sdk = 18
1516
target_sdk = 28
1617
demo_app_id = 'net.gotev.recycleradapterdemo'
1718

1819
// Gradle classpath dependencies versions
1920
kotlin_version = '1.3.41'
20-
gradle_version = '3.3.2'
21-
maven_gradle_version = '2.1'
21+
gradle_version = '3.4.1'
2222
gradle_versions_plugin_version = '0.20.0'
2323
bintray_plugin_version = '1.7'
2424

2525
// Library and app testing dependencies versions
2626
junit_version = '4.12'
27-
androidx_test_core_version = '1.1.0'
28-
androidx_test_runner_version = '1.1.1'
29-
androidx_test_rules_version = '1.1.1'
30-
androidx_test_ext_junit_version = '1.1.0'
31-
androidx_test_ext_truth_version = '1.1.0'
32-
truth_version = '0.42'
33-
androidx_test_espresso_version = '3.1.1'
27+
androidx_test_core_version = '1.2.0'
28+
androidx_test_runner_version = '1.2.0'
29+
androidx_test_rules_version = '1.2.0'
30+
androidx_test_ext_junit_version = '1.1.1'
31+
androidx_test_ext_truth_version = '1.2.0'
32+
truth_version = '0.45'
33+
androidx_test_espresso_version = '3.2.0'
3434

3535
// Library and app dependencies versions
3636
androidx_recyclerview_version = '1.0.0'
3737
androidx_appcompat_version = '1.0.2'
3838

3939
// App dependencies
4040
okhttp_version = '3.14.2'
41-
retrofit_version = '2.5.0'
41+
retrofit_version = '2.6.0'
4242
rxjava2_version = '2.2.10'
4343
rxkotlin_version = '2.3.0'
4444
rxandroid_version = '2.1.1'
Lines changed: 22 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'com.github.dcendents.android-maven'
43
apply plugin: 'com.jfrog.bintray'
54
apply plugin: 'com.github.ben-manes.versions'
65

7-
// start - do not modify this if your project is on github
8-
def siteUrl = "https://github.com/${github_username}/${github_repository_name}"
9-
def gitUrl = siteUrl + '.git'
10-
def bugTrackerUrl = siteUrl + '/issues/'
11-
def projectName = "recycler-adapter-extensions"
12-
// end - do not modify this if your project is on github
6+
Properties properties = new Properties()
7+
if (project.rootProject.file("local.properties").exists()) {
8+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
9+
}
1310

1411
// start - module specific overrides of default values written in manifest.gradle
12+
def bintray_project_name = "recycler-adapter-extensions"
1513
def library_description = "RecyclerAdapter Extensions"
1614
def library_keywords = ['android', 'recycler', 'recyclerview', 'adapter', 'extensions', 'fast', 'easy']
1715
// end - module specific overrides
1816

17+
// start - do not modify this if your project is on github
18+
project.ext{
19+
mavDevelopers = [(properties.getProperty("bintray.user")):(maintainer)]
20+
mavSiteUrl = "https://github.com/${github_username}/${github_repository_name}"
21+
mavGitUrl = mavSiteUrl + '.git'
22+
bugTrackerUrl = mavSiteUrl + '/issues/'
23+
mavProjectName = bintray_project_name
24+
mavLibraryLicenses = ["Apache-2.0": 'http://www.apache.org/licenses/LICENSE-2.0.txt']
25+
mavLibraryDescription = library_description
26+
mavVersion = library_version
27+
}
28+
// end - do not modify this if your project is on github
29+
1930
group = library_project_group
2031
version = library_version
2132

@@ -73,60 +84,16 @@ dependencies {
7384

7485
}
7586

76-
// add the following information to the file: local.properties situated in the parent directory of
77-
// where this file is:
78-
//
79-
// bintray.user=gotev
80-
// bintray.apikey=api key got from the bintray profile
81-
//
82-
// be sure to add local.properties to the .gitignore!
83-
84-
Properties properties = new Properties()
85-
if (project.rootProject.file("local.properties").exists()) {
86-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
87-
}
88-
89-
install {
90-
repositories.mavenInstaller {
91-
pom.project {
92-
name projectName
93-
description library_description
94-
packaging 'aar'
95-
groupId library_project_group
96-
version version
97-
url siteUrl
98-
licenses {
99-
license {
100-
name library_licenses[0]
101-
url library_licenses_url
102-
}
103-
}
104-
developers {
105-
developer {
106-
id properties.getProperty("bintray.user")
107-
name maintainer
108-
}
109-
}
110-
scm {
111-
connection gitUrl
112-
developerConnection gitUrl
113-
url siteUrl
114-
115-
}
116-
}
117-
}
118-
}
119-
12087
bintray {
12188
user = properties.getProperty("bintray.user")
12289
key = properties.getProperty("bintray.apikey")
12390
configurations = ['archives']
12491
pkg {
12592
repo = "maven"
126-
name = projectName
93+
name = mavProjectName
12794
desc = library_description
128-
websiteUrl = siteUrl
129-
vcsUrl = gitUrl
95+
websiteUrl = mavSiteUrl
96+
vcsUrl = mavGitUrl
13097
issueTrackerUrl = bugTrackerUrl
13198
licenses = library_licenses
13299
labels = library_keywords
@@ -135,37 +102,4 @@ bintray {
135102
}
136103
}
137104

138-
task sourcesJar(type: Jar) {
139-
from android.sourceSets.main.java.srcDirs
140-
classifier = 'sources'
141-
}
142-
143-
task javadoc(type: Javadoc) {
144-
excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file.
145-
146-
title = "$projectName $project.version API"
147-
description "Generates Javadoc"
148-
source = android.sourceSets.main.java.srcDirs
149-
classpath += files(android.bootClasspath)
150-
exclude '**/BuildConfig.java', '**/R.java'
151-
options {
152-
windowTitle("$projectName $project.version Reference")
153-
locale = 'en_US'
154-
encoding = 'UTF-8'
155-
charSet = 'UTF-8'
156-
links("http://docs.oracle.com/javase/7/docs/api/");
157-
linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference");
158-
setMemberLevel(JavadocMemberLevel.PUBLIC)
159-
addStringOption('Xdoclint:none', '-quiet')
160-
}
161-
}
162-
163-
task javadocJar(type: Jar, dependsOn: javadoc) {
164-
classifier = 'javadoc'
165-
from javadoc.destinationDir
166-
}
167-
168-
artifacts {
169-
archives javadocJar
170-
archives sourcesJar
171-
}
105+
apply from: 'https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/master/gradle-mavenizer.gradle'

0 commit comments

Comments
 (0)