Add PdfSource and RenderQuality#167
Conversation
There was a problem hiding this comment.
Thank you for contributing to this project. This is your first pull request and we are so glad to have you onboard. We will review the request and get back to you soon. We love your contributions! Join our Discord community here to discuss this PR or ask questions.
|
Hi, Can you please resolve the conflicts caused due to merging old PRs. Appreicate the changes you made. |
|
there has been issues with small fonts being barely seen due to low pdf quality. Can we see this PR merge anytime soon if it helps with that issue? @afreakyelf |
|
Hi @miseke-ffw, can you please resolve the conflicts. Thank you! |
| lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, | ||
| statusCallBack: PdfRendererView.StatusCallBack? = null | ||
| statusCallBack: PdfRendererView.StatusCallBack? = null, | ||
| scrolledToTop: (Boolean) -> Unit = {}, |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| statusCallBack: PdfRendererView.StatusCallBack? = null | ||
| statusCallBack: PdfRendererView.StatusCallBack? = null, | ||
| scrolledToTop: (Boolean) -> Unit = {}, | ||
| onPageRendered: (page: Int) -> Unit = {}, |
There was a problem hiding this comment.
make lambdas as null by default
scrolledToTop: ((Boolean) -> Unit)? = null,
onPageRendered: ((page: Int) -> Unit)? = null,
| import android.net.Uri | ||
| import java.io.File | ||
|
|
||
| sealed class PdfSource { |
There was a problem hiding this comment.
why do you need class here? use sealed interface intead
|
Hi, I have taken over this pull request and added render quality and a simple (but not perfect) scroll to top functionality. |
|
@afreakyelf , @vitoksmile , please re-review this, thank you very much! :) |
| pageMargin, | ||
| enableLoadingForPages | ||
| enableLoadingForPages, | ||
| renderQuality |
There was a problem hiding this comment.
please add comma, so we avoid 2 lines changes in next PRs
renderQuality,
|
|
||
| if (cached != null && currentBoundPage == position) { | ||
| if (DEBUG_LOGS_ENABLED) Log.d("PdfViewAdapter", "✅ Loaded page $position from cache") | ||
| val aspectRatio = cached.width.toFloat() / cached.height.toFloat() |
There was a problem hiding this comment.
can height be zero somehow?
|
Can we see this pr merge soon? |
|
@afreakyelf can we expect to merge it soon? I was experiencing issue with this as I had a PDF with small text size and grey color and with default bitmap size (screen width) the text wasn't readable if you prefer more customizations, we can extend this to sealed interface RenderQuality {
val qualityMultiplier: Float
data object Normal : RenderQuality {
override val qualityMultiplier: Float = 1f
}
data object High : RenderQuality {
override val qualityMultiplier: Float = 2f
}
data object Ultra : RenderQuality {
override val qualityMultiplier: Float = 3f
}
data class Custom(
override val qualityMultiplier: Float,
) : RenderQuality
} |
No description provided.