Skip to content

Commit

Permalink
[TIMOB-24442] Fix Ti.UI.View.rect x and y properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Mar 9, 2017
1 parent 142fc52 commit db9a1cc
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -314,10 +314,13 @@ public boolean handleMessage(Message msg)
if (view != null) {
View v = view.getOuterView();
if (v != null) {
int position[] = new int[2];
v.getLocationInWindow(position);

TiDimension nativeWidth = new TiDimension(v.getWidth(), TiDimension.TYPE_WIDTH);
TiDimension nativeHeight = new TiDimension(v.getHeight(), TiDimension.TYPE_HEIGHT);
TiDimension nativeLeft = new TiDimension(v.getLeft(), TiDimension.TYPE_LEFT);
TiDimension nativeTop = new TiDimension(v.getTop(), TiDimension.TYPE_TOP);
TiDimension nativeLeft = new TiDimension(position[0], TiDimension.TYPE_LEFT);
TiDimension nativeTop = new TiDimension(position[1], TiDimension.TYPE_TOP);

// TiDimension needs a view to grab the window manager, so we'll just use the decorview of the current window
View decorView = TiApplication.getAppCurrentActivity().getWindow().getDecorView();
Expand Down

0 comments on commit db9a1cc

Please sign in to comment.