question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose absolute coordinates of widgets on contentview

See original GitHub issue

Currently laid out widget coordinates relative to its parent are exposed by the bounds property. Access to absolute position of a widget on the screen may be useful for advanced animations.

Use case example: scroll view with complex layout. Goal: pop-up animation, scaling an arbitrary scroll view child widget to fit the screen (e.g. modal image details view with a fluid animation). Implementation suggestion:

  1. get the absolute coordinates of the widget.
  2. create a second twin widget and append it to the page using the absolute coordinates from (1).
  3. set visible of the first widget to false.
  4. animate the widget from (2).

Currently (1) is only possible by manually calculating the absolute coordinates of the widget (not easy with complex layouts) respecting the current scroll position.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mpostcommented, Feb 26, 2019

Negative bounds have never been supported on Android. We added clarified this in the documentation accordingly. The idea to get the view bounds is still valid though. For the moment you could traverse up the view hierarchy in a resize callback and add up the top/left coordinates.

0reactions
mpostcommented, Apr 23, 2019

@cookieguru Thanks for the heads up. Closing as resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Absolute positioning for SwiftUI views - a free Hacking with iOS
SwiftUI gives us two ways of positioning views: absolute positions using position() , and relative positions using offset() .
Read more >
saving state on compound view widgets - Stack Overflow
How do you save view widget instance state when, by using XML-defined widget layouts, components of the individual widget instances all have the...
Read more >
AbsoluteLayout - Android Developers
A layout that lets you specify exact locations (x/y coordinates) of its children. Absolute layouts are less flexible and harder to maintain than...
Read more >
https://unpkg.com/tabris@3.8.0/tabris.d.ts
To be passed to a JSX element or new-less * widget constructor call. ... Otherwise the image might turn out incorrectly exposed.
Read more >
Navigation Drawers and Such
For example, M9,2 means move to absolute coordinates (9,2), but m9,2 means move 9 in the x direction and 2 in the y...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found