摘要 |
Disclosed are a method, device and terminal for implementing rotation of a floating window. The method comprises: providing, by user equipment, a picture container supporting a rotation attribute for a user interface (UI) floating window view; adding the UI floating window view to the picture container; when the orientation is changed, acquiring a rotation angle of the UI floating window view, redrawing the rotated UI floating window view, and acquiring a rotation reduction matrix; and when a user click event is detected, performing rotation reduction conversion on the coordinates at the user click position. The technical solution of the present invention has the beneficial effects of low calculation quantity, high processing efficiency and natural appearance of a floating window UI component. |
主权项 |
1. A method for implementing rotation of a floating window, comprising:
providing, by a terminal device, an image container supporting a rotation attribute for a user interface (UI) floating window view to be displayed; adding, by the terminal device, the UI floating window view into the image container; when an orientation corresponding to a stack-top application in an activated-state application stack of a system and/or an orientation detected by a gravity sensor of the system is changed, acquiring, by the terminal device, a rotation angle of the UI floating window view, redrawing the UI floating window view which has been rotated according to the rotation angle and the image container, and acquiring a rotation recovery matrix; and when a user click event is detected, performing, by the terminal device, rotation recovery transformation on coordinates of a user click position according to the rotation recovery matrix and the image container, to obtain coordinates in the UI floating window view which coordinates correspond to the user click position before the UI floating window view is rotated, so that the event can be delivered to an internal UI component of the floating window which corresponds to the event before the UI floating window view is rotated. |