react-native-pdf 6.7.6 → 6.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/PdfView.js CHANGED
@@ -40,6 +40,8 @@ export default class PdfView extends Component {
40
40
  singlePage: PropTypes.bool,
41
41
  onPageSingleTap: PropTypes.func,
42
42
  onScaleChanged: PropTypes.func,
43
+ showsHorizontalScrollIndicator: PropTypes.bool,
44
+ showsVerticalScrollIndicator: PropTypes.bool,
43
45
  };
44
46
 
45
47
  static defaultProps = {
@@ -62,6 +64,8 @@ export default class PdfView extends Component {
62
64
  },
63
65
  onScaleChanged: (scale) => {
64
66
  },
67
+ showsHorizontalScrollIndicator: true,
68
+ showsVerticalScrollIndicator: true,
65
69
  };
66
70
 
67
71
  constructor(props) {
package/README.md CHANGED
@@ -168,6 +168,10 @@ react-native run-ios
168
168
  ### ChangeLog
169
169
  <details>
170
170
  <summary>ChangeLog details</summary>
171
+ v6.7.7
172
+ 1. Added: add support for customizable scroll indicators in PdfView component (#904)
173
+ 2. Fixed: fix field values not being visible on android. issue #864 :bug: (#896)
174
+
171
175
  v6.7.6
172
176
  1. Fixed: Add missing 'enableDoubleTapZoom' to fabric codegen source (#832)
173
177
  2. Fixed: added missing 'scrollEnabled' prop (#842)
@@ -387,5 +391,4 @@ Set the current page of the PDF component. pageNumber is a positive integer. If
387
391
  Example:
388
392
  ```
389
393
  this.pdf.setPage(42); // Display the answer to the Ultimate Question of Life, the Universe, and Everything
390
- ```
391
-
394
+ ```
@@ -126,6 +126,6 @@ dependencies {
126
126
  // The repo from zacharee is based on PdfiumAndroidKt, a much newer fork of PdfiumAndroid, with better maintenance and updated native libraries.
127
127
  implementation 'com.github.zacharee:AndroidPdfViewer:4.0.1'
128
128
  // Depend on PdfiumAndroidKt directly so this can be updated independently of AndroidPdfViewer as updates are provided.
129
- implementation 'io.legere:pdfiumandroid:1.0.19'
129
+ implementation 'io.legere:pdfiumandroid:1.0.24'
130
130
  implementation 'com.google.code.gson:gson:2.8.5'
131
131
  }
@@ -13,9 +13,10 @@ import android.view.View;
13
13
  import androidx.annotation.Nullable;
14
14
  import com.facebook.react.bridge.ReadableArray;
15
15
  import com.facebook.react.uimanager.BaseViewManagerDelegate;
16
- import com.facebook.react.uimanager.BaseViewManagerInterface;
16
+ import com.facebook.react.uimanager.BaseViewManager;
17
+ import com.facebook.react.uimanager.LayoutShadowNode;
17
18
 
18
- public class RNPDFPdfViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RNPDFPdfViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
+ public class RNPDFPdfViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNPDFPdfViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
20
  public RNPDFPdfViewManagerDelegate(U viewManager) {
20
21
  super(viewManager);
21
22
  }
@@ -479,40 +479,8 @@ using namespace facebook::react;
479
479
  }
480
480
  }
481
481
 
482
- if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"showsHorizontalScrollIndicator"])) {
483
- if (_showsHorizontalScrollIndicator) {
484
- for (UIView *subview in _pdfView.subviews) {
485
- if ([subview isKindOfClass:[UIScrollView class]]) {
486
- UIScrollView *scrollView = (UIScrollView *)subview;
487
- scrollView.showsHorizontalScrollIndicator = YES;
488
- }
489
- }
490
- } else {
491
- for (UIView *subview in _pdfView.subviews) {
492
- if ([subview isKindOfClass:[UIScrollView class]]) {
493
- UIScrollView *scrollView = (UIScrollView *)subview;
494
- scrollView.showsHorizontalScrollIndicator = NO;
495
- }
496
- }
497
- }
498
- }
499
-
500
- if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"showsVerticalScrollIndicator"])) {
501
- if (_showsVerticalScrollIndicator) {
502
- for (UIView *subview in _pdfView.subviews) {
503
- if ([subview isKindOfClass:[UIScrollView class]]) {
504
- UIScrollView *scrollView = (UIScrollView *)subview;
505
- scrollView.showsVerticalScrollIndicator = YES;
506
- }
507
- }
508
- } else {
509
- for (UIView *subview in _pdfView.subviews) {
510
- if ([subview isKindOfClass:[UIScrollView class]]) {
511
- UIScrollView *scrollView = (UIScrollView *)subview;
512
- scrollView.showsVerticalScrollIndicator = NO;
513
- }
514
- }
515
- }
482
+ if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"showsHorizontalScrollIndicator"] || [changedProps containsObject:@"showsVerticalScrollIndicator"])) {
483
+ [self setScrollIndicators:self horizontal:_showsHorizontalScrollIndicator vertical:_showsVerticalScrollIndicator depth:0];
516
484
  }
517
485
 
518
486
  if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"scrollEnabled"])) {
@@ -928,6 +896,23 @@ using namespace facebook::react;
928
896
  return !_singlePage;
929
897
  }
930
898
 
899
+ - (void)setScrollIndicators:(UIView *)view horizontal:(BOOL)horizontal vertical:(BOOL)vertical depth:(int)depth {
900
+ // max depth, prevent infinite loop
901
+ if (depth > 10) {
902
+ return;
903
+ }
904
+
905
+ if ([view isKindOfClass:[UIScrollView class]]) {
906
+ UIScrollView *scrollView = (UIScrollView *)view;
907
+ scrollView.showsHorizontalScrollIndicator = horizontal;
908
+ scrollView.showsVerticalScrollIndicator = vertical;
909
+ }
910
+
911
+ for (UIView *subview in view.subviews) {
912
+ [self setScrollIndicators:subview horizontal:horizontal vertical:vertical depth:depth + 1];
913
+ }
914
+ }
915
+
931
916
  @end
932
917
 
933
918
  #ifdef RCT_NEW_ARCH_ENABLED
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-pdf",
3
- "version": "6.7.6",
3
+ "version": "6.7.7",
4
4
  "summary": "A react native PDF view component",
5
5
  "description": "A react native PDF view component, support ios and android platform",
6
6
  "main": "index.js",