Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ThePalaceProject/android-core into …
Browse files Browse the repository at this point in the history
…feature/update-libraries

# Conflicts:
#	simplified-app-palace/build.gradle.kts
  • Loading branch information
nunommts committed Nov 8, 2023
2 parents 556cc6f + a1abaf4 commit 06d5a93
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 228 deletions.
403 changes: 206 additions & 197 deletions README-CHANGES.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion org.thepalaceproject.android.platform
3 changes: 1 addition & 2 deletions simplified-app-palace/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ dependencies {
implementation(libs.androidx.viewpager)
implementation(libs.androidx.viewpager2)
implementation(libs.androidx.webkit)
implementation(libs.azam.ulidj)
implementation(libs.commons.compress)
implementation(libs.firebase.analytics)
implementation(libs.firebase.annotations)
Expand Down Expand Up @@ -617,6 +618,4 @@ dependencies {
implementation(libs.truevfs.driver.zip)
implementation(libs.truevfs.kernel.impl)
implementation(libs.truevfs.kernel.spec)
implementation(libs.ulid.kotlin)
implementation(libs.ulid.kotlin.jvm)
}
3 changes: 1 addition & 2 deletions simplified-books-time-tracking/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ dependencies {
implementation(libs.rxandroid2)
implementation(libs.rxjava2)
implementation(libs.slf4j)
implementation(libs.ulid.kotlin)
implementation(libs.ulid.kotlin.jvm)
implementation(libs.azam.ulidj)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.nypl.simplified.books.time.tracking

import android.content.Context
import io.azam.ulidj.ULID
import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
Expand All @@ -11,7 +12,6 @@ import org.librarysimplified.audiobook.api.PlayerEvent
import org.nypl.simplified.accounts.api.AccountID
import org.nypl.simplified.profiles.controller.api.ProfilesControllerType
import org.slf4j.LoggerFactory
import ulid.ULID
import java.io.File
import java.net.URI
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -183,7 +183,7 @@ class TimeTrackingService(

private fun createTimeTrackingEntry() {
currentTimeTrackingEntry = TimeTrackingEntry(
id = ULID.randomULID(),
id = ULID.random(),
duringMinute = dateFormatter.print(DateTime.now()),
secondsPlayed = 0
)
Expand Down
3 changes: 1 addition & 2 deletions simplified-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ val dependencyObjects = listOf(
libs.truevfs.driver.zip,
libs.truevfs.kernel.impl,
libs.truevfs.kernel.spec,
libs.ulid.kotlin,
libs.ulid.kotlin.jvm,
libs.azam.ulidj,
)

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class CatalogBookDetailFragment : Fragment(R.layout.book_detail) {
this.onBookStatusHeld(status, bookPreviewStatus)
}
is BookStatus.Loaned -> {
this.onBookStatusLoaned(status, book.book, bookPreviewStatus)
this.onBookStatusLoaned(status, book.book)
}
is BookStatus.Holdable -> {
this.onBookStatusHoldable(status, bookPreviewStatus)
Expand Down Expand Up @@ -825,13 +825,10 @@ class CatalogBookDetailFragment : Fragment(R.layout.book_detail) {

private fun onBookStatusLoaned(
bookStatus: BookStatus.Loaned,
book: Book,
bookPreviewStatus: BookPreviewStatus
book: Book
) {
this.buttons.removeAllViews()

var createPreviewButton = bookPreviewStatus != BookPreviewStatus.None

when (bookStatus) {
is BookStatus.Loaned.LoanedNotDownloaded -> {
this.buttons.addView(
Expand All @@ -849,23 +846,8 @@ class CatalogBookDetailFragment : Fragment(R.layout.book_detail) {
)
}
)

if (createPreviewButton) {
this.buttons.addView(this.buttonCreator.createButtonSpace())
this.buttons.addView(
this.buttonCreator.createReadPreviewButton(
bookFormat = parameters.feedEntry.probableFormat,
onClick = {
viewModel.openBookPreview(parameters.feedEntry)
}
)
)
}
}
is BookStatus.Loaned.LoanedDownloaded -> {
// the book preview button can be ignored
createPreviewButton = false

when (val format = book.findPreferredFormat()) {
is BookFormat.BookFormatPDF,
is BookFormat.BookFormatEPUB -> {
Expand Down Expand Up @@ -912,8 +894,7 @@ class CatalogBookDetailFragment : Fragment(R.layout.book_detail) {
}
)
)
} else if (!createPreviewButton) {
// add spaces on both sides if there aren't any other buttons
} else {
this.buttons.addView(this.buttonCreator.createButtonSizedSpace(), 0)
this.buttons.addView(this.buttonCreator.createButtonSizedSpace())
}
Expand Down

0 comments on commit 06d5a93

Please sign in to comment.