Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 219548b

Browse files
committed
Rename getters and comments
1 parent 1e3a6c8 commit 219548b

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DecodingAsyncTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ protected Throwable doInBackground(Void... params) {
4848
try {
4949
PdfDocument pdfDocument = docSource.createDocument(pdfView.getContext(), pdfiumCore, password);
5050
pdfFile = new PdfFile(pdfiumCore, pdfDocument, pdfView.getPageFitPolicy(), getViewSize(),
51-
userPages, pdfView.isSwipeVertical(), pdfView.getSpacingPx(), pdfView.doAutoSpacing(),
52-
pdfView.doFitEachPage());
51+
userPages, pdfView.isSwipeVertical(), pdfView.getSpacingPx(), pdfView.isAutoSpacingEnabled(),
52+
pdfView.isFitEachPage());
5353
return null;
5454
} catch (Throwable t) {
5555
return t;

android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DragPinchManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float ve
197197
if (!pdfView.isSwipeEnabled()) {
198198
return false;
199199
}
200-
if (pdfView.doPageFling()) {
200+
if (pdfView.isPageFlingEnabled()) {
201201
if (pdfView.pageFillsScreen()) {
202202
onBoundedFling(velocityX, velocityY);
203203
} else {

android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PDFView.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,20 +1164,20 @@ public int getSpacingPx() {
11641164
return spacingPx;
11651165
}
11661166

1167-
public boolean doAutoSpacing() {
1167+
public boolean isAutoSpacingEnabled() {
11681168
return autoSpacing;
11691169
}
11701170

11711171
public void setPageFling(boolean pageFling) {
11721172
this.pageFling = pageFling;
11731173
}
11741174

1175-
public boolean doPageFling() {
1175+
public boolean isPageFlingEnabled() {
11761176
return pageFling;
11771177
}
11781178

1179-
private void setSpacing(int spacing) {
1180-
this.spacingPx = Util.getDP(getContext(), spacing);
1179+
private void setSpacing(int spacingDp) {
1180+
this.spacingPx = Util.getDP(getContext(), spacingDp);
11811181
}
11821182

11831183
private void setAutoSpacing(boolean autoSpacing) {
@@ -1196,11 +1196,11 @@ private void setFitEachPage(boolean fitEachPage) {
11961196
this.fitEachPage = fitEachPage;
11971197
}
11981198

1199-
public boolean doFitEachPage() {
1199+
public boolean isFitEachPage() {
12001200
return fitEachPage;
12011201
}
12021202

1203-
public boolean doPageSnap() {
1203+
public boolean isPageSnap() {
12041204
return pageSnap;
12051205
}
12061206

android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/PdfFile.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ class PdfFile {
6464
/** Calculated document length (width or height, depending on swipe mode) */
6565
private float documentLength = 0;
6666
private final FitPolicy pageFitPolicy;
67-
/** If every page should fit to the screen as best as possible regardless of relative size */
68-
private boolean fitEachPage;
67+
/**
68+
* True if every page should fit separately according to the FitPolicy,
69+
* else the largest page fits and other pages scale relatively
70+
*/
71+
private final boolean fitEachPage;
6972
/**
7073
* The pages the user want to display in order
7174
* (ex: 0, 2, 2, 8, 8, 1, 1, 1)

0 commit comments

Comments
 (0)