-
Notifications
You must be signed in to change notification settings - Fork 62
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
Expose pageLayoutMode and isFirstPageAlwaysSingle configuration options #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
lib/configuration_options.dart
Outdated
const String pageLayoutModeAutomatic = "automatic"; | ||
const String pageLayoutModeSingle = "single"; | ||
const String pageLayoutModeDouble = "double"; | ||
const String iOSIsFirstPageAlwaysSingle = "isFirstPageAlwaysSingle"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there reasons to make this configuration option iOS specific?
Otherwise, I would extend it Android as well https://pspdfkit.com/api/android/reference/com/pspdfkit/configuration/PdfConfiguration.html#isFirstPageAlwaysSingle()
It would be an easy fix, I can do that: iOSIsFirstPageAlwaysSingle
would become isFirstPageAlwaysSingle
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if Android had this property, so I prefixed it with iOS
. If we have this property on Android, then I'm all for renaming it as long as we implement it on Android too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also just updated the Acceptance Criteria.
example/lib/main.dart
Outdated
iOSShowActionNavigationButtonLabels: false | ||
iOSShowActionNavigationButtonLabels: false, | ||
pageLayoutMode: 'automatic', | ||
iOSIsFirstPageAlwaysSingle: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this configuration option does not have any effect when in single page mode, it would probably make sense to switch pageLayoutMode
to double page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in a6b4b20
lib/configuration_options.dart
Outdated
const String androidSettingsMenuItems = "settingsMenuItems"; | ||
const String iOSSettingsMenuItems = "settingsMenuItems"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
androidSettingsMenuItems
and iOSSettingsMenuItems
) cannot match with the same string, or the Android part will crash because of the menu items that do not exist in the PSPDFKit for Android. (i.e. just use iOSSettingsMenuItems
instead of settingsMenuItems
and I'll refactor Android to const String androidSettingsMenuItems = "settingsMenuItems"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed in a6b4b20
Implement pageLayoutMode and isFirstPageAlwaysSingle configuration option for the Android part. Signed-off-by: Simone Arpe <simon.arpe@gmail.com>
Signed-off-by: Simone Arpe <simon.arpe@gmail.com>
The Android implementation LGTM! 👍 I also retested all the things on both iOS and Android and it works great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Solves #45
Details
This PR exposes page mode on iOS and page layout mode on Android.
This PR also exposes is first page always single configuration option.
Usage:
Acceptance Criteria