-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination in ANDROID #18
Comments
The short answer is: by processing the text and cutting it into page-sized chunks. Longer answer: this means you cannot directly display the text in a webview, but you have to process it first. |
By processing the text do you mean that i need to parse the whole xhtml spine and setting spans for each tag?? |
From your comments on another issue I understand you're using HtmlSpanner now. This means you should already have a Spanned text, so now all you have to do is to take the right sub-string to leave you with exactly one page of text. My solution was to use a StaticLayout to measure how much text fits on the screen, and then put that sub-string in the TextView. Take a look at this code to see what I mean, but be careful: it's GPL licenced: |
Hi, I am also using staticLayout. But, My layout.getLineStart(topLine); and layout.getLineEnd(bottomLine) not working properly. It's giving topLine number+1 and bottomLine number +1 value :( I Have tried/searched lot but no luck. Could you please help me on this regard. |
Hi,
I have shown the spines in pages but what if the spine has a long data? How can i show them in pages?? I know there has been the same issue logged but i didnt get any help :( .
Thanks,
Ritika Mittal
The text was updated successfully, but these errors were encountered: