Commit Graph

218 Commits

Author SHA1 Message Date
Daniel Micay
c033acd326 update Material Components library to 1.11.0 2023-12-25 11:40:37 -05:00
Daniel Micay
0be0fe524c update Material Components library to 1.10.0 2023-11-12 18:07:14 -05:00
octocorvus
1342f0cd21 bump targetSdk to 34 2023-10-22 02:31:13 -04:00
octocorvus
e0c0a9c136 build: hook viewer build tasks to gradle 2023-09-16 04:20:38 -04:00
octocorvus
627a566c2f viewer: use esbuild to bundle pdf viewer and worker
This improves maintainability:
1. no need to hardcode each script file in Android code
2. no need to symlink pdf.js and pdf.worker.js
3. adds sourcemaps in debug builds to help debug some pdf.js related
   issues
2023-09-16 04:20:38 -04:00
Daniel Micay
06e7bfe67d update SDK to 34 (Android 14) 2023-08-25 18:31:25 -04:00
Daniel Micay
30a97d7b47 update Android build tools to 34.0.0 2023-07-30 13:33:19 -04:00
Daniel Micay
00a0b05bae increment version to 18 2023-07-30 13:33:19 -04:00
Daniel Micay
c7241646fe increment version to 17 2023-07-30 13:33:19 -04:00
Hanouta
20d6c4ea9f decrease minimum zoom ratio to 0.2 2023-07-03 19:21:54 -04:00
Hanouta
0060e2cb73 set zoomRatio to fit document to screen size 2023-07-03 19:21:29 -04:00
Daniel Micay
a820314362 update Material library to 1.9.0 2023-07-03 19:12:00 -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
octocorvus
6f40b25b31 add eslint config and missing semicolons 2023-06-09 11:33:53 -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
fb59568765 update Android Gradle Plugin to 8.0.0
fix: update JDK to 17 for AGP 8.0
fix: enable buildConfig build feature
refactor: remove unnecessary android.enableR8.fullMode
2023-04-14 08:37:42 -04:00
octocorvus
bb14ba1a25 bugfix: make text layer position absolute and use CSS transform to al...
...ign it to canvas

Fixes a bug where there was empty space above pdf page, when page
rotation is 90 or 270 degrees.

Testing: open pdf and try all rotations (0, 90, 180 and 270 degrees)
with various zoom levels (especially, max and min zoom levels), and make
sure that text layer is aligned properly to the canvas and there aren't
any unwanted blank spaces. Finally, repeat the same testing procedure
for landscape mode.

To check if text layer is aligned properly on debug builds, toggle text
layer visibility from menu or use chrome dev tools.
2023-04-09 09:32:58 -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
octocorvus
d445c48f3c code style changes
- js: use double quotes consistently
- js: use strict equality operator everywhere
- js: end all statements with semi colon
- css: remove redundant unit of measures
2023-03-24 19:45:49 -04:00
octocorvus
69696ae2a9 use CSS transform to rotate text layer
Newer pdf.js versions don't automatically rotate text layer based on
viewport's rotation, instead they now set the value of the attribute
"data-main-rotation" to value of rotation in degrees. So, we now apply
CSS transformation to the text layer depending on the value of that
attribute.
2023-03-24 19:45:49 -04:00
octocorvus
2dea11799c use --scale-factor variable to set text layer font size
Newer pdf.js versions requires this variable to be set equal to the
actual scale (zoom ratio), to properly set font size in text layer div.
2023-03-24 19:45:49 -04:00
octocorvus
f5a1452a2d migrate away from deprecated APIs
- renderTextLayer: use textContentSource parameter instead of textContentStream
- renderTextLayer: pass a div for the container argument
2023-03-24 19:45:49 -04:00
octocorvus
2935bd4b27 migrate to pdfjs-dist npm package 2023-03-24 19:45:49 -04:00
amalgame21
8d44658c80 Always shows previous and next page button in any Display size 2023-02-19 10:01:40 -05:00
Daniel Micay
6db24ef23d update build tools version to 33.0.2 2023-02-11 05:36:29 -05:00
Daniel Micay
deba479a69 update AndroidX appcompat library to 1.6.1 2023-02-08 14:45:45 -05:00
Daniel Micay
424010af1c use Gradle toolchain support 2023-02-01 21:43:25 -05:00
Daniel Micay
284fc306fc update Material library to 1.8.0 2023-02-01 20:47:56 -05:00
Xsims
c6fb2aceda Add document name in toolbar 2023-01-27 02:08:50 -05:00
Daniel Micay
7f59118453 update AndroidX appcompat library to 1.6.0 2023-01-13 19:54:54 -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
Daniel Micay
b8dcc33696 remove legacy roundIcon attribute 2022-12-25 10:38:50 -05:00
Patryk Mis
aaa93a6f88 update build tools to 33.0.1 2022-12-20 04:31:08 -05:00
loryeam
1cf1c7ec28 horizontally and vertically center canvas and text layer
Also fixes an issue where text layer is not exactly on top of the canvas when
canvas width is less than screen width (which happens often in landscape mode or
when fully zoomed out)
2022-12-05 03:20:08 -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
Daniel Micay
ed3cf2c08f remove no-op allowBackup
This was added to silence a now removed lint check.
2022-10-29 21:11:07 -04:00
smdyv
e1dd3db05a Bump material from 1.6.1 to 1.7.0 2022-10-25 15:14:35 -04:00
Daniel Micay
eead76ad86 increment version to 16 2022-10-04 12:31:21 -04:00
loryeam
fbd6c45c3f fix a typo in viewer.js which can cause cache miss 2022-10-04 12:23:18 -04: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