react-native-macos/ReactAndroid
Jakub Kinst b020e7c440 Fix calculating View position within a Window in split-screen mode on Android (#28449)
Summary:
On Android, when using split-screen mode, the Window-relative position of a native View is not calculated properly when the app is running on the right (or bottom) half of the screen. The coordinates are currently calculated only based on View.getLocationOnScreen() with subtracting status bar height. Scenarios, where the window does not fill the entire screen (such as split-screen mode) are not supported.

We need to use a more general solution to subtract the actual position of the window from position of the view within the screen. This PR fixes the issue by subtracting coordinates of the Window retrieved from View.getWindowVisibleDisplayFrame(), which covers all scenarios when Window can be in a different position than the screen (incl. status bar offset).

## Changelog

[Android] [Fixed] - Calculating view position within the window in split-screen mode
Pull Request resolved: https://github.com/facebook/react-native/pull/28449

Test Plan:
1. Run an app in split-screen mode on the right half of the screen
2. Call UIManagerModule.measureInWindow() from JS to fetch a position of a View within a Window
3. Observe the wrong coordinates returned
4. Try the same with the fix

Reviewed By: mdvacca

Differential Revision: D21246297

Pulled By: shergin

fbshipit-source-id: 1f54b1a5d6610be17bf05521200304db2ba263ab
2020-04-26 22:14:33 -07:00
..
libs Upgrade Android support library to version 28 in RN 2019-01-22 10:44:53 -08:00
src Fix calculating View position within a Window in split-screen mode on Android (#28449) 2020-04-26 22:14:33 -07:00
.npmignore Don't publish /ReactAndroid/build to npm, update version on master 2015-10-12 11:11:40 -07:00
DevExperience.md Updating the URLs to point at new domain name reactnative.dev 2020-02-24 13:09:11 -08:00
README.md Updating the URLs to point at new domain name reactnative.dev 2020-02-24 13:09:11 -08:00
build.gradle PlatformColor implementations for iOS and Android (#27908) 2020-03-02 15:12:09 -08:00
gradle.properties Bump SoLoader version to 0.8.2 2020-02-12 10:10:39 -08:00
proguard-rules.pro Add ProGuard rule for hermes (#28571) 2020-04-09 13:48:55 -07:00
release.gradle Tidy up license headers [1/n] 2019-10-16 10:06:33 -07:00

README.md

Building React Native for Android

See the docs on the website.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.