Skip to content

Commit

Permalink
Use the correct chapter numbering mode
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Apr 4, 2024
1 parent 086c2da commit ee222fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
10 changes: 8 additions & 2 deletions README-CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@
<c:release date="2024-04-04T00:00:00+00:00" is-open="false" ticket-system="org.lyrasis.jira" version="4.0.2">
<c:changes/>
</c:release>
<c:release date="2024-04-04T08:35:45+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="4.0.3">
<c:changes/>
<c:release date="2024-04-04T11:27:20+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="4.0.3">
<c:changes>
<c:change date="2024-04-04T11:27:20+00:00" summary="Use the correct page numbering mode.">
<c:tickets>
<c:ticket id="PP-1126"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
<c:ticket-systems>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.widget.CheckBox
import androidx.fragment.app.Fragment
import org.librarysimplified.r2.api.SR2PageNumberingMode
import org.librarysimplified.r2.api.SR2ScrollingMode
import org.librarysimplified.r2.views.SR2ReaderModel

class DemoFileSelectionFragment : Fragment(R.layout.demo_file_selection) {

Expand Down Expand Up @@ -45,12 +46,13 @@ class DemoFileSelectionFragment : Fragment(R.layout.demo_file_selection) {
}

this.demoLoaderPerChapterPageNumbering.setOnCheckedChangeListener { _, isChecked ->
DemoModel.perChapterNumbering = when (isChecked) {
SR2ReaderModel.perChapterNumbering = when (isChecked) {
true -> SR2PageNumberingMode.PER_CHAPTER
false -> SR2PageNumberingMode.WHOLE_BOOK
}
}

SR2ReaderModel.perChapterNumbering = SR2PageNumberingMode.WHOLE_BOOK
return layout
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.librarysimplified.r2.demo

import android.content.Context
import org.librarysimplified.r2.api.SR2PageNumberingMode
import org.librarysimplified.r2.api.SR2ScrollingMode
import java.io.File

Expand All @@ -19,10 +18,6 @@ object DemoModel {
var scrollMode: SR2ScrollingMode =
SR2ScrollingMode.SCROLLING_MODE_PAGINATED

@Volatile
var perChapterNumbering: SR2PageNumberingMode =
SR2PageNumberingMode.PER_CHAPTER

val database: DemoDatabase
get() = this.databaseField

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ object SR2ReaderModel {
var searchTerm: String =
""

@Volatile
var scrollMode: SR2ScrollingMode =
SR2ScrollingMode.SCROLLING_MODE_PAGINATED

@Volatile
var perChapterNumbering: SR2PageNumberingMode =
SR2PageNumberingMode.PER_CHAPTER
SR2PageNumberingMode.WHOLE_BOOK

private val viewCommandSource =
PublishSubject.create<SR2ReaderViewCommand>()
Expand Down

0 comments on commit ee222fa

Please sign in to comment.