Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. 5 years 11 months ago #13800

  • tim_burnham
  • tim_burnham's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
I have created a feature in my app where you single tap or double tap the page and it will go to full screen. I just upgraded from 2.0 to 3.15 and I now use PDFLayoutView in place of PDFReader/PDFView. When I go to full screen the entire page will refresh and start from the first page and the zoom is removed. All the single tap does is show or hide the toolbar like this:

((AppCompatActivity)getActivity()).getSupportActionBar().show();
or
((AppCompatActivity)getActivity()).getSupportActionBar().hide();

It was working good in PDFReader. Is there any way to stop the entire page refresh?

Please Log in or Create an account to join the conversation.

Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. 5 years 11 months ago #13802

  • tim_burnham
  • tim_burnham's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
In the PDFReader sample app version 3.15, I can reproduce this. I use the OnInk() event and put the following code
private void onInk()
{
if(this.getActionBar().isShowing()) {
this.getActionBar().hide();
}
else{
this.getActionBar().show();
}
}

Comment or remove everything below it in the function.

Zoom in the PDF and go to another page other than page 1. When you hide/show the action bar the PDF will go to its initial state.

Please Log in or Create an account to join the conversation.

Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. 5 years 11 months ago #13808

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
we can't reproduce the issue in the demo project because we don't have an ActionBar.
So can you please send us a sample project, we will check it for you.

Please Log in or Create an account to join the conversation.

Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. 5 years 11 months ago #13811

  • tim_burnham
  • tim_burnham's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
Here is your sample project that I modified www.dropbox.com/s/ynmx9zcqu9jy2uy/PDFVie...ResizeIssue.zip?dl=0. Make sure your configuration is set to "PDFReader". Open a PDF and zoom in and go to another page. Tap the "Ink" button. I replaced the OnInk function of PDFReaderAct.java with this

private void onInk()
{
if(this.getActionBar().isShowing()) {
this.getActionBar().hide();
}
else{
this.getActionBar().show();
}
}

You don't have to download my project just follow the steps above and replace the OnInk() function in PDFReaderAct.java.

Please Log in or Create an account to join the conversation.

Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. 5 years 11 months ago #13812

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
PDFReader is deprecated since two years and we don't support it any more.
Please create a new sample project based on PdfLayoutView.

Please Log in or Create an account to join the conversation.

Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. 5 years 11 months ago #13815

  • tim_burnham
  • tim_burnham's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
I understand this. I didn't think your current sample project would have the deprecated PDFReader after 2 years. I do use PdfLayoutView in my project. I modified your sample to use PdfLayoutView the link is here www.dropbox.com/s/znmvs9amt1f95jz/PDFSample.zip?dl=0. You will need to turn on storage permissions in the Android settings to choose a PDF file.

I have users that are missing the full-screen feature. When the app goes to full screen the PDF loses zoom and goes back to the first page.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum