-
Notifications
You must be signed in to change notification settings - Fork 734
Feat/orientation support #476
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
Conversation
…arousel-related components (ActionBar's demo screen, MainScreen)
…ix for Carousel-related components (ActionBar's demo screen, MainScreen)" This reverts commit 0dbe448.
src/helpers/Constants.js
Outdated
setStatusBarHeight(); | ||
} | ||
|
||
/* Orientation */ |
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.
you just pass the callback, instead of wrapping it since you don't pass any params
Dimensions.addEventListener('change', updateConstants);
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 don't understand...
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.
ah. Got it. Ok
src/helpers/Constants.js
Outdated
updateConstants(); | ||
}); | ||
|
||
export function getOrientation() { |
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.
What about keep an orientation var (like we do for screen width and height) that get update when orientation changes?
Theoretically, the orientation changes only when rotating the device, no need to calculate it each time, right?
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.
Sure
No description provided.