Commit Graph

90 Commits

Author SHA1 Message Date
Hanouta 0060e2cb73 set zoomRatio to fit document to screen size 2023-07-03 19:21:29 -04:00
octocorvus 457cbc9e98 update MIN_WEBVIEW_RELEASE to 92
This is the minimum supported Chromium version for PDF.js v3.8.162.
2023-07-03 19:01:17 -04:00
octocorvus 123bcf30a8 make DocumentPropertiesLoader#load private 2023-06-28 00:12:28 -04:00
octocorvus bfb5e4a538 fix file size parsing issue causing crash
Opening a PDF using Storage Access Framework (SAF) causes the app to
crash in some cases, when the file is not present on the device's
internal storage (for example, on Proton Drive).
2023-06-28 00:12:28 -04:00
Daniel Micay 29a004091e minor whitespace fixes 2023-04-22 09:33:16 -04:00
Pratyush 195bba7891 replace custom file size parser with AOSP implementation 2023-04-20 11:18:14 -04:00
Pratyush 17c7c84296 rewrite DocumentPropertiesLoader in kotlin 2023-04-20 11:18:14 -04:00
Pratyush 61607858ef convert remaining fragments to kotlin 2023-04-20 11:18:11 -04:00
octocorvus ae1c0874ce add option to toggle text layer visibility on debug builds
This is to ease debugging text layer on debug builds.
2023-03-24 19:45:49 -04:00
Xsims c6fb2aceda Add document name in toolbar 2023-01-27 02:08:50 -05:00
Daniel Micay 48910db7c6 silence spurious getParcelable deprecation warning 2022-12-28 12:15:34 -05:00
Daniel Micay fd510a3c19 avoid deprecated DialogFragment onActivityCreated 2022-12-28 12:08:22 -05:00
octocorvus ac4aa0bbb9 [webview] set minimum font size to 1px
This fixes an issue where some text layer divs (those with font
size < 8px) gets misaligned due to webview setting their font size
to 8px.
2022-12-04 18:32:28 -05:00
Pratyush 8d0caf65a2 avoid `NullPointerException` 2022-10-03 00:21:53 -04:00
Pratyush 221e45cd52 handle `NumberFormatException` caused by `Integer.parseInt` 2022-10-03 00:21:53 -04:00
Pratyush ee87e43bcb handle `OutOfMemoryError | IllegalArgumentException` 2022-10-03 00:21:47 -04:00
Pratyush 5fadf7f47d replace deprecated api uses 2022-10-03 00:21:31 -04:00
Pratyush 7ff831769e add missing NonNull annotation 2022-10-03 00:21:31 -04:00
Pratyush 18761b3e4a replace deprecated api uses 2022-09-30 17:25:49 -04:00
Pratyush 8a308b69e5 apply DynamicColors when available 2022-09-30 17:25:47 -04:00
Daniel Micay ee3605428e minor cleanup 2022-09-12 22:27:03 -04:00
Pratyush ea9a57fabe Improve password UI/UX 2022-09-12 02:15:53 -04:00
Pratyush 68fc48d3a9 add on (doc) loaded callback 2022-09-12 02:08:42 -04:00
quh4gko8 ff11df007f Build against android 13, resolve new deprecated APIs 2022-09-10 22:44:02 -04:00
Daniel Micay 6a7982ce80 move snackbar to root view 2022-05-06 10:12:30 -04:00
Daniel Micay 1a3e816cfc simplify error string for error while opening PDF 2022-05-06 10:10:18 -04:00
Daniel Micay c6113df31d extend Permissions Policy
These aren't supported by Chromium yet but they're standardized and it
makes sense to explicitly forbid them.
2022-05-06 10:07:59 -04:00
Pratyush 87c71ddac2 added support for encrypted PDF
based on https://github.com/GrapheneOS/PdfViewer/pull/17

Signed-off-by: Pratyush <codelab@pratyush.dev>
Co-authored-by: Tommy-Geenexus <tomgapplicationsdevelopment@gmail.com>
Co-authored-by: empratyush <codelab@pratyush.dev>
2022-05-06 10:07:59 -04:00
Daniel Micay 96651d02af remove obsolete zoom in / zoom out menu actions 2022-05-06 10:07:59 -04:00
Pratyush eb6eb8046c added feature to save document 2022-05-06 10:07:50 -04:00
Pratyush ba9a6c8206 replace deprecated startActivityForResult 2022-04-22 04:24:25 -04:00
emschu 0c21e13459 add basic support to share documents via an additional item in options menu, add share icon
Signed-off-by: emschu <emschu@mailbox.org>
2022-03-20 05:14:05 -04:00
Daniel Micay 5c5bd0851d rename package to app.grapheneos.pdfviewer too 2022-02-25 16:26:22 -05:00
smdyv e6add76a9f Handle out-of-date WebView
Disable the open document menu item and show the user a relevant view.
2022-02-25 09:59:58 -05:00
smdyv 6ed3aed8ad Display content edge-to-edge 2022-02-23 17:14:28 -05:00
smdyv 7b0948383a Add margins to toolbar 2022-02-20 12:23:13 -05:00
smdyv 8453e2f2c6 Use M3 theme 2022-02-19 09:06:31 -05:00
smdyv c743c0d6a7 Create layout for the PDF viewer activity
Updating insets is no longer necessary because the layout reserves the
space for the top app bar and frees it up in full-screen mode so the
WebView can fill the entire screen.
2022-02-19 08:32:15 -05:00
smdyv fdf2cf8c27 Use view binding instead of findViewById
Provides null safety and type safety
2022-02-18 06:09:22 -05:00
MHShetty 5f5e1682a0 Add dark app theme support 2022-02-13 04:19:20 -05:00
Daniel Micay 993923ff92 Revert "solve API 30 deprecation with getSystemWindowInsetTop"
This reverts commit 851dd55d43.
2022-02-07 00:31:22 -05:00
June 5984291b44 Replace deprecated usages of getActivity with requireActivity, replace onClick with lambda, and use NonNull
Signed-off-by: June <june@eridan.me>
2022-02-05 23:51:21 -05:00
June 61247aaa6a Explicitly require NonNull in areas where it shouldn't/never will be
Signed-off-by: June <june@eridan.me>
2022-02-05 23:50:54 -05:00
June 259a2afe7a Don't use C-style arrays, use parseBoolean, remove redundant explicit type
Signed-off-by: June <june@eridan.me>
2022-02-05 23:50:54 -05:00
June 91dbb9adfb Don't use mWebView to set WebView debugging
Signed-off-by: June <june@eridan.me>
2022-02-05 23:50:54 -05:00
June 851dd55d43 solve API 30 deprecation with getSystemWindowInsetTop
Signed-off-by: June <june@eridan.me>
2022-02-05 23:50:54 -05:00
June 5494376175 Use expression lambda instead of statement lambda
Signed-off-by: June <june@eridan.me>
2022-02-05 23:50:54 -05:00
June 9dca01a0ee Replace valueOf with their respective data type functions 2022-02-03 11:09:57 -05:00
Daniel Micay c7329644b2 disable idle-detection in Permissions-Policy 2021-11-24 02:19:18 -05:00
Daniel Micay 2cdd5f967e handle deprecation of resource ids as constants 2021-11-21 16:02:22 -05:00