Open a new project.
First Look about the logic and ideas to do:
* To load a pdf file we need to pick the path to the pdf document by click the FAB button.
* Once picked we need to show the file in a linear layout.
* And we must define to display the file with correct pdf page number and give a possibility to step forward or back.
* At last we give the possibility to show the file at a specific page number we enter in a EditText.
-> We can realize that with buttons for back and forward or do it more comfortable with a ViewPager to swipe left (go back) or right (go forward).
(Read the tutorial How to use Fragment Adapter component for first understanding of ViewPager.)
But instead of Fragments we show a custom view inside the ViewPager and bind it with a ListMap.
💡We use here the filepicker dialog component instead the old filepicker component. With the old filepicker component we only can filter a kind of files like text-, audio- or image-files. But here we need only to show except pdf files. So we use the filepicker dialog component to do this.
To use this component it's necessary to import and activate the Filepicker V1.1.1 local library.
(Read the How to use Filepicker dialog component tutorial.
To remember here the library link to copy:
com.github.angads25:filepicker:1.1.1
Once downloaded activate the library.)
No comments:
Post a Comment