Skip to content

Commit b620a82

Browse files
authored
2.2.1 (#464)
1 parent 4e655a1 commit b620a82

File tree

3 files changed

+19
-27
lines changed

3 files changed

+19
-27
lines changed

test-app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.5.21'
4+
ext.kotlin_version = '1.5.31'
55

66
repositories {
77
google()
88
mavenCentral()
99
jcenter()
1010
}
1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.0.0'
12+
classpath 'com.android.tools.build:gradle:7.0.2'
1313

1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515

test-app/r2-testapp/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ group = 'com.github.readium'
1717

1818
int major = 2
1919
int minor = 2
20-
int patch = 0
21-
int build = 28
20+
int patch = 1
21+
int build = 29
2222
String type = ""
2323

2424
def version = "$major.$minor.$patch"
@@ -84,7 +84,7 @@ dependencies {
8484
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
8585
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
8686

87-
final READIUM_VERSION = 'develop-SNAPSHOT'
87+
final READIUM_VERSION = '2.1.0'
8888
if (findProject(':r2-shared')) {
8989
implementation project(':r2-shared')
9090
} else {
@@ -111,19 +111,19 @@ dependencies {
111111
implementation "com.github.readium:r2-lcp-kotlin:$READIUM_VERSION"
112112
}
113113

114-
implementation 'androidx.core:core-ktx:1.5.0'
115-
implementation "androidx.activity:activity-ktx:1.2.3"
116-
implementation "androidx.appcompat:appcompat:1.3.0"
114+
implementation 'androidx.core:core-ktx:1.6.0'
115+
implementation "androidx.activity:activity-ktx:1.3.1"
116+
implementation "androidx.appcompat:appcompat:1.3.1"
117117
implementation "androidx.browser:browser:1.3.0"
118118
implementation "androidx.cardview:cardview:1.0.0"
119-
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
120-
implementation "androidx.fragment:fragment-ktx:1.3.5"
119+
implementation "androidx.constraintlayout:constraintlayout:2.1.0"
120+
implementation "androidx.fragment:fragment-ktx:1.3.6"
121121
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
122122
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
123123
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
124124
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
125125
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
126-
implementation "androidx.paging:paging-runtime-ktx:3.0.0"
126+
implementation "androidx.paging:paging-runtime-ktx:3.0.1"
127127
implementation "androidx.recyclerview:recyclerview:1.2.1"
128128
implementation "androidx.viewpager2:viewpager2:1.0.0"
129129
implementation "androidx.webkit:webkit:1.4.0"
@@ -135,13 +135,13 @@ dependencies {
135135
implementation ("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") {
136136
exclude group: 'org.parboiled'
137137
}
138-
implementation "com.google.android.material:material:1.3.0"
138+
implementation "com.google.android.material:material:1.4.0"
139139
implementation "com.jakewharton.timber:timber:4.7.1"
140140
// AM NOTE: needs to stay this version for now (June 24,2020)
141141
//noinspection GradleDependency
142142
implementation "com.squareup.picasso:picasso:2.5.2"
143143
implementation "joda-time:joda-time:2.10.10"
144-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-native-mt"
144+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0"
145145
// AM NOTE: needs to stay this version for now (June 24,2020)
146146
//noinspection GradleDependency
147147
implementation 'org.jsoup:jsoup:1.13.1'
@@ -159,7 +159,7 @@ dependencies {
159159
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
160160
testImplementation "junit:junit:4.13.2"
161161

162-
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
163-
androidTestImplementation "androidx.test:runner:1.3.0"
162+
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
163+
androidTestImplementation "androidx.test:runner:1.4.0"
164164

165165
}

test-app/r2-testapp/src/main/java/org/readium/r2/testapp/catalogs/CatalogViewModel.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,10 @@ class CatalogViewModel(application: Application) : AndroidViewModel(application)
9292
showProgressBar.set(false)
9393
}
9494

95-
private fun getDownloadURL(publication: Publication): URL? {
96-
var url: URL? = null
97-
val links = publication.links
98-
for (link in links) {
99-
val href = link.href
100-
if (href.contains(Publication.EXTENSION.EPUB.value) || href.contains(Publication.EXTENSION.LCPL.value)) {
101-
url = URL(href)
102-
break
103-
}
104-
}
105-
return url
106-
}
95+
private fun getDownloadURL(publication: Publication): URL? =
96+
publication.links
97+
.firstOrNull { it.mediaType.isPublication }
98+
?.let { URL(it.href) }
10799

108100
private suspend fun addPublicationToDatabase(
109101
href: String,

0 commit comments

Comments
 (0)