mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-17 12:19:12 +08:00
Add measureInWindow on Android
Summary:public This adds the capability to get a View in absolute position on the screen, not just relative to the RootView. This is the Android implementation Reviewed By: andreicoman11 Differential Revision: D2939170 fb-gh-sync-id: 658f1ebe6a458088f657a7469389add1a12222cd shipit-source-id: 658f1ebe6a458088f657a7469389add1a12222cd
This commit is contained in:
committed by
facebook-github-bot-4
parent
f9e81d9bcc
commit
b26f699c9a
@@ -380,8 +380,8 @@ public class UIImplementation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the location on screen, width, and height of the given view and returns the values
|
||||
* via an async callback.
|
||||
* Determines the location on screen, width, and height of the given view relative to the root
|
||||
* view and returns the values via an async callback.
|
||||
*/
|
||||
public void measure(int reactTag, Callback callback) {
|
||||
// This method is called by the implementation of JS touchable interface (see Touchable.js for
|
||||
@@ -391,6 +391,15 @@ public class UIImplementation {
|
||||
mOperationsQueue.enqueueMeasure(reactTag, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the location on screen, width, and height of the given view relative to the device
|
||||
* screen and returns the values via an async callback. This is the absolute position including
|
||||
* things like the status bar
|
||||
*/
|
||||
public void measureInWindow(int reactTag, Callback callback) {
|
||||
mOperationsQueue.enqueueMeasureInWindow(reactTag, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Measures the view specified by tag relative to the given ancestorTag. This means that the
|
||||
* returned x, y are relative to the origin x, y of the ancestor view. Results are stored in the
|
||||
|
||||
Reference in New Issue
Block a user