Skip to content

Add autosaveEnabled configuration #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class ConfigurationAdapter {
private static final String PAGE_MODE_DOUBLE = "double";
private static final String PAGE_MODE_AUTO = "automatic";
private static final String FIRST_PAGE_ALWAYS_SINGLE = "firstPageAlwaysSingle";
private static final String AUTOSAVE_DISABLED = "disableAutomaticSaving";

private final PdfActivityConfiguration.Builder configuration;

Expand Down Expand Up @@ -148,6 +149,9 @@ public ConfigurationAdapter(@NonNull Context context, ReadableMap configuration)
if (configuration.hasKey(FIRST_PAGE_ALWAYS_SINGLE)) {
configureFirstPageAlwaysSingle(configuration.getBoolean(FIRST_PAGE_ALWAYS_SINGLE));
}
if (configuration.hasKey(AUTOSAVE_DISABLED)) {
configureAutosaveEnabled(!configuration.getBoolean(AUTOSAVE_DISABLED));
}
}
}

Expand Down Expand Up @@ -329,6 +333,10 @@ private void configureFirstPageAlwaysSingle(final boolean firstPageAlwaysSingle)
configuration.firstPageAlwaysSingle(firstPageAlwaysSingle);
}

private void configureAutosaveEnabled(final boolean autosaveEnabled) {
configuration.autosaveEnabled(autosaveEnabled);
}

public PdfActivityConfiguration build() {
return configuration.build();
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "1.25.7",
"version": "1.25.8",
"description": "A React Native module for the PSPDFKit library.",
"keywords": [
"react native",
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Catalog",
"version": "1.25.7",
"version": "1.25.8",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down