Skip to content

Conversation

@okwasniewski
Copy link
Contributor

@okwasniewski okwasniewski commented Oct 27, 2023

Summary:

The goal of this PR is to migrate from deprecated [UIScreen mainScreen] and get the displayScale from currentTraitCollection. Both of those return the same values.

Changelog:

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Test Plan:

Go to Dimensions example and check that everything works as expected

Before

After

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Oct 27, 2023
@analysis-bot
Copy link

analysis-bot commented Oct 27, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,653,251 +4
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,035,012 -4
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 3648886
Branch: main

@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@matthargett
Copy link
Contributor

@javache was there an issue during the Phabricator import?

@github-actions
Copy link

github-actions bot commented Nov 1, 2023

This pull request was successfully merged by @okwasniewski in ace81ff.

When will my fix make it into a release? | Upcoming Releases

@github-actions github-actions bot added the Merged This PR has been merged. label Nov 1, 2023
Othinn pushed a commit to Othinn/react-native that referenced this pull request Jan 9, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

## Changelog:

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

### Before

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

### After

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 10, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 14, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski added a commit to callstack/react-native-visionos that referenced this pull request Jan 31, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

## Changelog:

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

### Before

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

### After

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski added a commit to callstack/react-native-visionos that referenced this pull request Feb 6, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

## Changelog:

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

### Before

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

### After

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski added a commit to callstack/react-native-visionos that referenced this pull request Apr 5, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

## Changelog:

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

### Before

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

### After

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
okwasniewski added a commit to callstack/react-native-visionos that referenced this pull request Jun 24, 2024
…facebook#41214)

Summary:
The goal of this PR is to migrate from deprecated `[UIScreen mainScreen]` and get the `displayScale` from currentTraitCollection. Both of those return the same values.

## Changelog:

[IOS] [CHANGED] - retrieve screen scale from trait collection instead of UIScreen mainScreen

Pull Request resolved: facebook#41214

Test Plan:
Go to Dimensions example and check that everything works as expected

### Before

<img src="https://github.com/facebook/react-native/assets/52801365/53141e67-63e2-4c3b-818e-6a232aae8a5b" height="500" />

### After

<img src="https://github.com/facebook/react-native/assets/52801365/33728fce-0298-459c-b63e-a0b8ea34bde1" height="500" />

Reviewed By: NickGerleman

Differential Revision: D50736794

Pulled By: javache

fbshipit-source-id: d512cba1120204be95caf43ac9916f6597e2ccc8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants