Closed GauravCreed closed 2 years ago
@mjdenham
I want to differentiate these two book testaments in app, is it possible?
Thanks (_)
@mjdenham and @huperniketes
I think we found the solution, but I don't know this is correct or not?
val isNewTestament get() = activeWindowPageManagerProvider.activeWindowPageManager.currentVersePage.currentBibleVerse.currentBibleBook.ordinal >= BibleBook.MATT.ordinal
Thanks(_)
@GauravCreed why do you tag random people? People who watch this repository and can help, will help if they have time. I consider it spam to tag random people and am asking you to stop.
I'd say if it works then you probably got it, but I'm not very familiar with that type of code. @tuomas2 might easily know if it's the right practice or not what you've posted, but he sees all issues and will also help when he gets time.
I think we found the solution, but I don't know this is correct or not?
val isNewTestament get() = activeWindowPageManagerProvider.activeWindowPageManager.currentVersePage.currentBibleVerse.currentBibleBook.ordinal >= BibleBook.MATT.ordinal
That solution is indeed used in DocumentControl.kt:58.
You could make extension to BibleBook as follows
val BibleBook.isNewTestament get() = this.ordinal >= BibleBook.MATT.ordinal
Then you could use it directly from BibleBook instances:
val book: BibleBook
...
if(book.isNewTestament) {
...
}
Hi @timbze
Sorry for my inconvenient behavior, I will take note for the next time.
@huperniketes
can we differentiate Old Testament and New Testament from "BibleBook" model in book name, chapter and verse selection screen? Thanks (_).