Y
Y
York Princess2019-01-09 16:53:16
Android
York Princess, 2019-01-09 16:53:16

How to determine the absolute height of a View after rotation?

I have a main layout, inside of which there is another layout that rotates. Inside the rotating layout there are views arranged in a circle. The task is to calculate the view that is above all after rotation. I tried all possible variations of taking Y using the Android API, but every time I get not what I need. I need to get the absolute Y coordinate relative to the screen, or at least relative to the main layout and not the one in which the views are located. Does anyone have any idea?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
York Princess, 2019-01-12
@Princess_York

getLocationOnScreen()still solved the problem. The problem was in the animation method. RotateAnimationwas used as the first available option, which played a cruel joke. This method is not in vain considered obsolete. It only changes the position of the view visually, but the coordinates didn't change physically.
For those who are interested, a simple game like "Wheel of Fortune" was implemented, where the search for the dropped result is performed by searching for the highest TextView located on the "wheel". The implementation is rather crutch and unpretentious, but it was conceived as such.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question