Skip to content

Commit

Permalink
Merge pull request #2301 from quran/page_content_type_sealed
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed Jun 14, 2023
2 parents b5528dd + c008ea8 commit 08a0160
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class QuranDataPresenter @Inject internal constructor(

fun imagesVersion() = quranPageProvider.getImageVersion()

fun canProceedWithoutDownload() = quranPageProvider.getPageContentType() == PageContentType.IMAGE
fun canProceedWithoutDownload() = quranPageProvider.getPageContentType() == PageContentType.Image

fun fallbackToImageType() {
val fallbackType = quranPageProvider.getFallbackPageType()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.quran.data.source

enum class PageContentType {
IMAGE, LINE
sealed class PageContentType {
object Image : PageContentType()
data class Line(val ratio: Float, val allowOverlapOfLines: Boolean): PageContentType()
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface PageProvider {
@StringRes fun getPreviewTitle(): Int
@StringRes fun getPreviewDescription(): Int

fun getPageContentType(): PageContentType = PageContentType.IMAGE
fun getPageContentType(): PageContentType = PageContentType.Image
fun getFallbackPageType(): String? = null
fun getQaris(): List<Qari>
fun pageType(): String = ""
Expand Down

0 comments on commit 08a0160

Please sign in to comment.