Skip to content
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

Add autosaveEnabled configuration #289

Merged
merged 4 commits into from Sep 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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_ENABLED = "autosaveEnabled";

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_ENABLED)) {
configureAutosaveEnabled(configuration.getBoolean(AUTOSAVE_ENABLED));
}
}
}

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