owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.82k stars 3.05k forks source link

Preview for PDF files #2489

Open shashvat-kedia opened 5 years ago

shashvat-kedia commented 5 years ago

Actual behaviour

On opening a PDF file the file is downloaded automatically.

Expected behaviour

Instead the file should be opened for preview and and option should be provided to the user to download the file.

Steps to reproduce

  1. Open any PDF file

Can this problem be reproduced with the official owncloud server? (url: https://demo.owncloud.org, user: test, password: test) Yes

jesmrec commented 5 years ago

you need to download the file to show it in the device, afaik

shashvat-kedia commented 5 years ago

@jesmrec Google drive supports this. They have a seperate option for downloading the pdf. I am researching more about how they do this.

jesmrec commented 5 years ago

ok, thanks for your effort!

shashvat-kedia commented 5 years ago

@jesmrec @davigonz The PDF file has to be downloaded on to the device. To support this functionality what we can do is instead of showing the a progress bar of the pdf download(current case) we can instead show the user a PDFView(this can be obtained using 3rd party libraries like AndroidPDFViewer) and load the PDF in that view hence allowing the user to view the PDF in the app itself. Then additional option can be provided to the user to download the file( the data corresponding to the file would already have been fetch to display it on the PDF View hence no extra bandwith would be required we will just have to create a File in the local storage and save the contents in it). If the user does not want to download the file it wont be an issue as the File for the PDF would not be created unless the user explicitly clicks the download button. What do you think?

davigonz commented 5 years ago

the data corresponding to the file would already have been fetch to display it on the PDF View hence no extra bandwith would be required we will just have to create a File in the local storage and save the contents in it

Does AndroidPDFViewer take care of this or should we do it manually?

shashvat-kedia commented 5 years ago

@davigonz The part of saving the PDF by creating a File will have to be done manually everything else is handled by the AndroidPDFViewer library.

shashvat-kedia commented 5 years ago

@jesmrec @davigonz Should I start with this then?

davigonz commented 5 years ago

Should I start with this then?

@sd1998 It would be better to finish https://github.com/owncloud/android/issues/2276 before

shashvat-kedia commented 5 years ago

@davigonz Shall I start working on this?

jesmrec commented 5 years ago

@michaelstingl @hosy , is this interesting to include in 2.12?

michaelstingl commented 5 years ago

@michaelstingl @hosy , is this interesting to include in 2.12?

2.12 is already pretty full, but if you @sd1998 would like to help here, it would be cool! 👍