Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ All notable changes to this project will be documented in this file. Take a look

### Fixed

* Fix building with Kotlin 1.6.

#### Navigator

* Fixed turning pages of an EPUB reflowable resource with an odd number of columns. A virtual blank trailing column is appended to the resource when displayed as two columns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ internal class LicenseValidation(
is State.registerDevice -> registerDevice(state.documents.license, state.link)
is State.valid -> notifyObservers(state.documents, null)
is State.failure -> notifyObservers(null, state.error)
State.cancelled -> notifyObservers(null, null)
}
}
} catch (error: Exception) {
Expand Down Expand Up @@ -315,6 +316,8 @@ internal class LicenseValidation(
private suspend fun fetchStatus(license: LicenseDocument) {
val url = license.url(LicenseDocument.Rel.status, preferredType = MediaType.LCP_STATUS_DOCUMENT).toString()
// Short timeout to avoid blocking the License, since the LSD is optional.
// FIXME: To remove after bumping to Kotlin 1.6
@Suppress("DEPRECATION")
val data = network.fetch(url, timeout = Duration.seconds(5))
Comment on lines +319 to 321
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any API to create a Duration in seconds that doesn't give a deprecation warning either on Kotlin 1.5 or 1.6... Since we have the android.kotlinOptions.allWarningsAsErrors flag on in build.gradle, we need to suppress the deprecation warning for now to be able to build.

.getOrElse { throw LcpException.Network(it) }

Expand All @@ -329,6 +332,8 @@ internal class LicenseValidation(
private suspend fun fetchLicense(status: StatusDocument) {
val url = status.url(StatusDocument.Rel.license, preferredType = MediaType.LCP_LICENSE_DOCUMENT).toString()
// Short timeout to avoid blocking the License, since it can be updated next time.
// FIXME: To remove after bumping to Kotlin 1.6
@Suppress("DEPRECATION")
val data = network.fetch(url, timeout = Duration.seconds(5))
.getOrElse { throw LcpException.Network(it) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ArchiveFetcherTest {
@Test
fun `Reading a missing entry returns NotFound`() {
val resource = fetcher.get(Link(href = "/unknown"))
assertFailsWith<Resource.Exception.NotFound> { resource.lengthBlocking().getOrThrow() }
assertFailsWith<Resource.Exception.NotFound> { resource.readBlocking().getOrThrow() }
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ abstract class BaseReaderFragment : Fragment() {
private var mode: ActionMode? = null

// Available tint colors for highlight and underline annotations.
private val highlightTints = mapOf<@IdRes Int, @ColorInt Int>(
private val highlightTints = mapOf</*@IdRes*/ Int, /*@ColorInt*/ Int>(
R.id.red to Color.rgb(247, 124, 124),
R.id.green to Color.rgb(173, 247, 123),
R.id.blue to Color.rgb(124, 198, 247),
Expand Down