- Posts: 7
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Hiding Android toolbar causes PDF to refresh and go to the start with no zoom.
- tim_burnham
- Topic Author
- Offline
- New Member
-
Less
More
IP: 107.4.111.19
7 years 9 months ago #13800
by tim_burnham
Hiding Android toolbar causes PDF to refresh and go to the start with no zoom. was created by tim_burnham
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?
((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?
- tim_burnham
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 7
- Thank you received: 0
IP: 107.4.111.19
7 years 9 months ago #13802
by tim_burnham
Replied by tim_burnham on topic Hiding Android toolbar causes PDF to refresh and go to the start with no zoom.
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.
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.
IP: 37.183.44.177
7 years 9 months ago #13808
by Davide
Replied by Davide on topic Hiding Android toolbar causes PDF to refresh and go to the start with no zoom.
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.
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.
- tim_burnham
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 7
- Thank you received: 0
IP: 107.4.111.19
7 years 9 months ago #13811
by tim_burnham
Replied by tim_burnham on topic Hiding Android toolbar causes PDF to refresh and go to the start with no zoom.
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.
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.
IP: 37.183.44.177
7 years 9 months ago #13812
by Davide
Replied by Davide on topic Hiding Android toolbar causes PDF to refresh and go to the start with no zoom.
Hi,
PDFReader is deprecated since two years and we don't support it any more.
Please create a new sample project based on PdfLayoutView.
PDFReader is deprecated since two years and we don't support it any more.
Please create a new sample project based on PdfLayoutView.
- tim_burnham
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 7
- Thank you received: 0
IP: 24.180.82.199
7 years 9 months ago #13815
by tim_burnham
Replied by tim_burnham on topic Hiding Android toolbar causes PDF to refresh and go to the start with no zoom.
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.
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.
Time to create page: 0.417 seconds