Answer the question
In order to leave comments, you need to log in
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
getLocationOnScreen()
still solved the problem. The problem was in the animation method. RotateAnimation
was 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 questionAsk a Question
731 491 924 answers to any question