Skip to content

Commit

Permalink
Add a change missing from 5610368
Browse files Browse the repository at this point in the history
This adds a missing controller instantiation that was intended to
be part of commit 5610368.

Affects: https://ebce-lyrasis.atlassian.net/browse/PP-676
  • Loading branch information
io7m committed Nov 14, 2023
1 parent 31103d2 commit 886d57d
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import io.reactivex.disposables.Disposable
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import org.librarysimplified.r2.api.SR2Command
import org.librarysimplified.r2.api.SR2ControllerConfiguration
import org.librarysimplified.r2.api.SR2ControllerType
import org.librarysimplified.r2.api.SR2Event
import org.librarysimplified.r2.api.SR2Locator
Expand Down Expand Up @@ -67,8 +68,23 @@ class SR2SearchFragment private constructor(
ViewModelProvider(requireActivity(), SR2ReaderViewModelFactory(this.parameters))
.get(SR2ReaderViewModel::class.java)

val activity =
this.requireActivity()

this.controller =
this.readerModel.get()!!
this.readerModel.createOrGet(
configuration = SR2ControllerConfiguration(
bookFile = this.parameters.bookFile,
bookId = this.parameters.bookId,
context = activity,
ioExecutor = this.readerModel.ioExecutor,
contentProtections = this.parameters.contentProtections,
theme = this.parameters.theme,
uiExecutor = SR2UIThread::runOnUIThread,
scrollingMode = this.parameters.scrollingMode,
pageNumberingMode = this.parameters.pageNumberingMode,
),
).get().controller

this.toolbar =
view.findViewById(R.id.searchToolbar)
Expand Down

0 comments on commit 886d57d

Please sign in to comment.