@@ -109,26 +109,18 @@ enum ScrollDir {
109
109
110
110
private ScrollDir scrollDir = ScrollDir .NONE ;
111
111
112
- /**
113
- * Rendered parts go to the cache manager
114
- */
112
+ /** Rendered parts go to the cache manager */
115
113
CacheManager cacheManager ;
116
114
117
- /**
118
- * Animation manager manage all offset and zoom animation
119
- */
115
+ /** Animation manager manage all offset and zoom animation */
120
116
private AnimationManager animationManager ;
121
117
122
- /**
123
- * Drag manager manage all touch events
124
- */
118
+ /** Drag manager manage all touch events */
125
119
private DragPinchManager dragPinchManager ;
126
120
127
121
PdfFile pdfFile ;
128
122
129
- /**
130
- * The index of the current sequence
131
- */
123
+ /** The index of the current sequence */
132
124
private int currentPage ;
133
125
134
126
/**
@@ -145,68 +137,46 @@ enum ScrollDir {
145
137
*/
146
138
private float currentYOffset = 0 ;
147
139
148
- /**
149
- * The zoom level, always >= 1
150
- */
140
+ /** The zoom level, always >= 1 */
151
141
private float zoom = 1f ;
152
142
153
- /**
154
- * True if the PDFView has been recycled
155
- */
143
+ /** True if the PDFView has been recycled */
156
144
private boolean recycled = true ;
157
145
158
- /**
159
- * Current state of the view
160
- */
146
+ /** Current state of the view */
161
147
private State state = State .DEFAULT ;
162
148
163
- /**
164
- * Async task used during the loading phase to decode a PDF document
165
- */
149
+ /** Async task used during the loading phase to decode a PDF document */
166
150
private DecodingAsyncTask decodingAsyncTask ;
167
151
168
- /**
169
- * The thread {@link #renderingHandler} will run on
170
- */
152
+ /** The thread {@link #renderingHandler} will run on */
171
153
private final HandlerThread renderingHandlerThread ;
172
- /**
173
- * Handler always waiting in the background and rendering tasks
174
- */
154
+ /** Handler always waiting in the background and rendering tasks */
175
155
RenderingHandler renderingHandler ;
176
156
177
157
private PagesLoader pagesLoader ;
178
158
179
159
Callbacks callbacks = new Callbacks ();
180
160
181
- /**
182
- * Paint object for drawing
183
- */
161
+ /** Paint object for drawing */
184
162
private Paint paint ;
185
163
186
- /**
187
- * Paint object for drawing debug stuff
188
- */
164
+ /** Paint object for drawing debug stuff */
189
165
private Paint debugPaint ;
190
166
191
- /**
192
- * Policy for fitting pages to screen
193
- */
167
+ /** Policy for fitting pages to screen */
194
168
private FitPolicy pageFitPolicy = FitPolicy .WIDTH ;
195
169
196
170
private int defaultPage = 0 ;
197
171
198
- /**
199
- * True if should scroll through pages vertically instead of horizontally
200
- */
172
+ /** True if should scroll through pages vertically instead of horizontally */
201
173
private boolean swipeVertical = true ;
202
174
203
175
private boolean enableSwipe = true ;
204
176
205
177
private boolean doubletapEnabled = true ;
206
178
207
- /**
208
- * Pdfium core for loading and rendering PDFs
209
- */
179
+ /** Pdfium core for loading and rendering PDFs */
210
180
private PdfiumCore pdfiumCore ;
211
181
212
182
private ScrollHandle scrollHandle ;
@@ -237,26 +207,18 @@ ScrollHandle getScrollHandle() {
237
207
*/
238
208
private boolean renderDuringScale = false ;
239
209
240
- /**
241
- * Antialiasing and bitmap filtering
242
- */
210
+ /** Antialiasing and bitmap filtering */
243
211
private boolean enableAntialiasing = true ;
244
212
private PaintFlagsDrawFilter antialiasFilter =
245
213
new PaintFlagsDrawFilter (0 , Paint .ANTI_ALIAS_FLAG | Paint .FILTER_BITMAP_FLAG );
246
214
247
- /**
248
- * Spacing between pages, in px
249
- */
215
+ /** Spacing between pages, in px */
250
216
private int spacingPx = 0 ;
251
217
252
- /**
253
- * pages numbers used when calling onDrawAllListener
254
- */
218
+ /** pages numbers used when calling onDrawAllListener */
255
219
private List <Integer > onDrawPagesNums = new ArrayList <>(10 );
256
220
257
- /**
258
- * Construct the initial view
259
- */
221
+ /** Construct the initial view */
260
222
public PDFView (Context context , AttributeSet set ) {
261
223
super (context , set );
262
224
@@ -449,9 +411,7 @@ public boolean isRecycled() {
449
411
return recycled ;
450
412
}
451
413
452
- /**
453
- * Handle fling animation
454
- */
414
+ /** Handle fling animation */
455
415
@ Override
456
416
public void computeScroll () {
457
417
super .computeScroll ();
@@ -626,9 +586,7 @@ private void drawWithListener(Canvas canvas, int page, OnDrawListener listener)
626
586
}
627
587
}
628
588
629
- /**
630
- * Draw a given PagePart on the canvas
631
- */
589
+ /** Draw a given PagePart on the canvas */
632
590
private void drawPart (Canvas canvas , PagePart part ) {
633
591
// Can seem strange, but avoid lot of calls
634
592
RectF pageRelativeBounds = part .getPageRelativeBounds ();
@@ -708,9 +666,7 @@ public void loadPages() {
708
666
redraw ();
709
667
}
710
668
711
- /**
712
- * Called when the PDF is loaded
713
- */
669
+ /** Called when the PDF is loaded */
714
670
void loadComplete (PdfFile pdfFile ) {
715
671
state = State .LOADED ;
716
672
@@ -1126,41 +1082,32 @@ public List<PdfDocument.Link> getLinks(int page) {
1126
1082
return pdfFile .getPageLinks (page );
1127
1083
}
1128
1084
1129
- /**
1130
- * Use an asset file as the pdf source
1131
- */
1085
+ /** Use an asset file as the pdf source */
1132
1086
public Configurator fromAsset (String assetName ) {
1133
1087
return new Configurator (new AssetSource (assetName ));
1134
1088
}
1135
1089
1136
- /**
1137
- * Use a file as the pdf source
1138
- */
1090
+ /** Use a file as the pdf source */
1139
1091
public Configurator fromFile (File file ) {
1140
1092
return new Configurator (new FileSource (file ));
1141
1093
}
1142
1094
1143
- /**
1144
- * Use URI as the pdf source, for use with content providers
1145
- */
1095
+ /** Use URI as the pdf source, for use with content providers */
1146
1096
public Configurator fromUri (Uri uri ) {
1147
1097
return new Configurator (new UriSource (uri ));
1148
1098
}
1149
1099
1150
- /**
1151
- * Use bytearray as the pdf source, documents is not saved
1152
- */
1100
+ /** Use bytearray as the pdf source, documents is not saved */
1153
1101
public Configurator fromBytes (byte [] bytes ) {
1154
1102
return new Configurator (new ByteArraySource (bytes ));
1155
1103
}
1156
1104
1105
+ /** Use stream as the pdf source. Stream will be written to bytearray, because native code does not support Java Streams */
1157
1106
public Configurator fromStream (InputStream stream ) {
1158
1107
return new Configurator (new InputStreamSource (stream ));
1159
1108
}
1160
1109
1161
- /**
1162
- * Use custom source as pdf source
1163
- */
1110
+ /** Use custom source as pdf source */
1164
1111
public Configurator fromSource (DocumentSource docSource ) {
1165
1112
return new Configurator (docSource );
1166
1113
}
0 commit comments