Skip to content

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

Merged
merged 4 commits into from
Jul 21, 2019
Merged

Feat/orientation support #476

merged 4 commits into from
Jul 21, 2019

Conversation

Inbal-Tish
Copy link
Collaborator

No description provided.

…arousel-related components (ActionBar's demo screen, MainScreen)
…ix for Carousel-related components (ActionBar's demo screen, MainScreen)"

This reverts commit 0dbe448.
@Inbal-Tish Inbal-Tish added the WIP label Jul 18, 2019
@Inbal-Tish Inbal-Tish changed the title Feat/orientation support [WIP] Feat/orientation support Jul 18, 2019
@Inbal-Tish Inbal-Tish removed the WIP label Jul 18, 2019
@Inbal-Tish Inbal-Tish requested a review from ethanshar July 18, 2019 09:19
setStatusBarHeight();
}

/* Orientation */
Copy link
Collaborator

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);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah. Got it. Ok

updateConstants();
});

export function getOrientation() {
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@ethanshar ethanshar merged commit 7cfa780 into master Jul 21, 2019
@Inbal-Tish Inbal-Tish deleted the feat/orientation_support branch July 22, 2019 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants