Added support for drawers opening from the top or bottom of the screen. #237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This primarily adds support for specifying
top
orbottom
in addition to the existingleft
andright
options for theside
prop. Here's a rundown of what's changed:left
have become a more generic version, likelength
isLeftOrRightSide()
function, returningtrue
if the drawer opens to the left or right side of the screen. Otherwise it openstop
orbottom
. It's used for things like determining which way the drawer should animate open, or whether to usegestureState.dx
orgestureState.dy
for example.getDeviceLength()
function to be used in place ofthis.state.viewport.width
(sincetop
orbottom
would need to usethis.state.viewport.height
instead)getGestureDelta(gestureState)
function to be used in place ofgestureState.dx
(sincetop
orbottom
would need to usegestureState.dy
)top
andbottom
options forside
.idea
folder from the repository (let me know if this is a bridge too far)top
andbottom
options.Let me know if this needs anything else before it can be merged.