-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from PSPDFKit/reinhard/pdfui-fragment
Make PdfView use PdfUiFragment instead of PdfFragment
- Loading branch information
Showing
10 changed files
with
305 additions
and
480 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
android/src/main/java/com/pspdfkit/views/ConfigurationChangeReportingPdfUiFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.pspdfkit.views; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.pspdfkit.configuration.activity.PdfActivityConfiguration; | ||
import com.pspdfkit.ui.PdfUiFragment; | ||
|
||
/** This {@link PdfUiFragment} reports when the {@link PdfActivityConfiguration} was changed. */ | ||
public class ConfigurationChangeReportingPdfUiFragment extends PdfUiFragment { | ||
|
||
@Nullable private OnConfigurationChangedListener onConfigurationChangedListener; | ||
|
||
public void setOnConfigurationChangedListener(@Nullable OnConfigurationChangedListener listener) { | ||
this.onConfigurationChangedListener = listener; | ||
} | ||
|
||
@Override | ||
public void performApplyConfiguration(@NonNull PdfActivityConfiguration configuration) { | ||
super.performApplyConfiguration(configuration); | ||
|
||
if (this.onConfigurationChangedListener != null) { | ||
onConfigurationChangedListener.onConfigurationChanged(); | ||
} | ||
} | ||
|
||
/** Listener that is notified when the user changes the configuration (scroll direction etc.) via the UI. */ | ||
public interface OnConfigurationChangedListener { | ||
|
||
/** Called when the configuration changed, reset your {@link com.pspdfkit.ui.PdfFragment} listeners in here. */ | ||
void onConfigurationChanged(); | ||
} | ||
} |
487 changes: 209 additions & 278 deletions
487
android/src/main/java/com/pspdfkit/views/PdfView.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.