Floating window obstruction processing method, system and device, and storage medium
Patent Information
- Application Number
- PCT/CN2025/136314
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-28
- Filing Date
- 2025-11-20
- Publication Date
- 2026-09-03
Smart Images

Figure CN2025136314_03092026_PF_FP_ABST
Abstract
Description
A method, system, device, and storage medium for handling floating window obstruction.
[0001] This application claims priority to Chinese Patent Application No. 202510231117.9, filed on February 28, 2025, entitled "A method, system, device and storage medium for handling the obstruction of a floating window", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, and in particular to a method, system, device and storage medium for handling floating window occlusion. Background Technology
[0003] Currently, floating windows are frequently used in application interface operation scenarios. A floating window is a small window that floats on the application interface, its main function and value being to improve multitasking capabilities and operational efficiency. Floating windows allow users to quickly access or operate other functions without leaving the current task; for example, in live streaming applications, using a floating window to access other application functions facilitates convenient multitasking switching. Simultaneously, floating windows can continuously display important information or statuses, such as real-time call duration and network status, allowing users to stay informed about key developments. Furthermore, floating windows can serve as entry points for quick operations, providing users with fast and efficient operation methods, further optimizing the interactive experience. Typically, to ensure users can view and operate at any time, floating windows are set as the topmost view in the view hierarchy design.
[0004] However, floating windows are often affected by events such as pop-up half-screen panels, pop-up keyboard pages, page jumps, and screen rotation during application, which can cause the floating window to be obscured. This can prevent users from operating the corresponding floating window function normally or cause them to misunderstand the function status, thus affecting the user's interactive experience. Summary of the Invention
[0005] This application provides a method, system, device, and storage medium for handling floating window occlusion, which can process events that cause floating window occlusion, prevent floating window from being occluded, and solve the technical problem of floating window occlusion caused by related event conflicts.
[0006] In a first aspect, embodiments of this application provide a method for handling floating window occlusion, including:
[0007] Detect a specified event on the current screen where the triggering of the specified event conflicts with the display of the floating window on the current screen.
[0008] If a specified event is detected, determine the reason for the floating window being obscured based on the specified event and the parent view of the floating window;
[0009] If the specified event is a first type of event, adjust the view level of the floating window in the current interface to the top view level according to the floating window occlusion reason information. If the specified event is a second type of event, adjust the display position of the floating window to the specified area according to the floating window occlusion reason information.
[0010] In a second aspect, embodiments of this application provide a floating window occlusion handling system, comprising:
[0011] The detection module is configured to detect a specified event on the current interface. The triggering of the specified event conflicts with the display of the floating window on the current interface.
[0012] The module is configured to determine the cause of the floating window's occlusion based on the specified event and the floating window's parent view when a specified event is detected.
[0013] The processing module is configured to adjust the view level of the floating window in the current interface to the top view level based on the floating window occlusion reason information when the specified event is a first type event, and to adjust the display position of the floating window to the specified area based on the floating window occlusion reason information when the specified event is a second type event.
[0014] In a third aspect, embodiments of this application provide a floating window occlusion processing device, comprising:
[0015] Memory and one or more processors;
[0016] The memory is configured to store one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the floating window occlusion processing method as described in the first aspect.
[0018] In a fourth aspect, embodiments of this application provide a non-volatile computer-readable storage medium storing computer-executable instructions that, when executed by a computer processor, are configured to perform the floating window occlusion processing method as described in the first aspect.
[0019] In a fifth aspect, embodiments of this application provide a computer program product containing instructions that, when executed on a computer or processor, cause the computer or processor to perform the floating window occlusion processing method as described in the first aspect.
[0020] This application embodiment detects a specified event on the current interface, where the triggering of the specified event conflicts with the display of the floating window on the current interface. Upon detecting the specified event, it determines the cause of the floating window occlusion based on the specified event and the parent view of the floating window. If the specified event is a first-type event, the floating window's view hierarchy on the current interface is adjusted to the topmost view hierarchy based on the occlusion cause information. If the specified event is a second-type event, the floating window's display position is adjusted to a specified area based on the occlusion cause information. By employing the above technical means, by detecting the cause information of floating window occlusion for different types of specified events, and performing corresponding floating window occlusion processing based on the cause information, the floating window display is ensured to be unobstructed, thereby ensuring normal user operation of the floating window, improving the user's interactive experience, and enhancing the stability and reliability of the floating window function. Attached Figure Description
[0021] Figure 1 is a flowchart of a floating window occlusion processing method provided in an embodiment of this application;
[0022] Figure 2 is a flowchart of a floating window obstruction cause information determination in an embodiment of this application;
[0023] Figure 3 is a flowchart of another method for determining the cause of floating window obstruction in an embodiment of this application;
[0024] Figure 4 is a schematic diagram of the floating window obstruction in an embodiment of this application;
[0025] Figure 5 is a schematic diagram of the floating window adjustment display in an embodiment of this application;
[0026] Figure 6 is a structural schematic diagram of a floating window shading system provided in an embodiment of this application;
[0027] Figure 7 is a structural schematic diagram of a suspended window blocking device provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0029] The floating window occlusion handling method provided in this application aims to detect the floating window occlusion cause information of different types of specified events, and perform corresponding floating window occlusion handling based on the floating window occlusion cause information to ensure that the floating window display is not occluded.
[0030] A floating window is a small window that floats on the application interface, primarily serving to enhance multitasking capabilities and operational efficiency. It allows users to quickly access or operate other functions without leaving their current task. For example, in a live streaming room, a small window can be used to access other application functions, facilitating convenient multitasking. Simultaneously, a floating window can continuously display important information or statuses, such as real-time call duration and network status, allowing users to stay informed about key developments. Furthermore, a floating window can serve as a shortcut entry point, providing users with a fast and efficient way to operate, further optimizing the interactive experience.
[0031] Floating windows are typically placed at the top of the view hierarchy to ensure users can view and interact with them at any time. However, due to specific circumstances in certain scenarios, their display can still be affected, resulting in them being obscured. These issues mainly fall into the following categories:
[0032] Half-screen panel obstruction: When a half-screen panel pops up in the application (such as a share panel, selection list, settings menu, etc.), the floating window may be covered by the panel.
[0033] Keyboard obstruction: In scenarios requiring text input, the floating window may be covered by the keyboard when it pops up, especially when the floating window is located at the bottom of the screen.
[0034] Page overlay: Users are redirected from the current screen to another full-screen page, such as entering a Story, video playback mode, or full-screen image preview.
[0035] Screen rotation: Screen rotation triggers a rearrangement or redraw of the interface, especially when switching from portrait to landscape mode, where the size and layout of views may change significantly. If the position and size of the floating window are not dynamically adjusted, it may partially or completely disappear from the screen.
[0036] Obstructing a floating window can negatively impact the user experience. When a floating window is obstructed, users may feel confused or inconvenienced, leading them to believe the application is malfunctioning. For example, in a call scenario, if the floating window is obstructed, the user might mistakenly believe the call has ended abruptly. This misunderstanding could cause the user to take unnecessary actions, resulting in a poor user experience. Furthermore, obstructed floating windows also prevent users from accessing their functions promptly. For instance, in a call scenario, a user might be unable to mute or hang up the phone because the floating window is obstructed, causing confusion or inconvenience. Users might mistakenly believe the function is malfunctioning or the call has ended abruptly.
[0037] In summary, a floating window is a small window that floats on the application interface, primarily used to improve multitasking capabilities and operational efficiency, allowing users to quickly access functions or obtain key information without leaving the current task. However, in certain scenarios, floating windows may be obstructed by half-screen panels, keyboards, full-screen pages, screen rotation, etc., affecting their display and causing users to be unable to operate them normally or misunderstand the function status, thus resulting in a negative experience.
[0038] Clearly, in implementing floating windows, due to limitations in interface layout and interaction logic, it's difficult to avoid obstruction in certain abnormal scenarios, such as being covered by a half-screen panel, a pop-up keyboard, a full-screen view, or screen rotation, preventing users from properly viewing or operating the floating window's functions. Addressing these specific scenarios one by one to resolve floating window obstruction issues is often inefficient, increasing application development complexity and code maintenance costs, and potentially overlooking other potential obstruction scenarios.
[0039] Based on this, an embodiment of this application provides a method for handling floating window occlusion, to prevent the floating window from being obscured and to solve the technical problem of floating window occlusion caused by related event conflicts. By dynamically adjusting the floating window position, dynamically adjusting the floating window view hierarchy, and dynamically detecting occlusion, the method effectively avoids the phenomenon of the floating window being obscured in abnormal scenarios, significantly improving the stability and usability of the floating window in multi-tasking scenarios. This ensures that users can continuously use the floating window function under various complex interactions, thereby greatly optimizing the user experience.
[0040] Example:
[0041] Figure 1 shows a flowchart of a floating window occlusion processing method provided in an embodiment of this application. The floating window occlusion processing method provided in this embodiment can be executed by a floating window occlusion processing device. The floating window occlusion processing device can be implemented by software and / or hardware. The floating window occlusion processing device can be composed of two or more physical entities, or it can be composed of a single physical entity. Generally speaking, the floating window occlusion processing device can be a terminal device such as a computer, mobile phone, or tablet.
[0042] The following description uses the floating window occlusion processing device as an example to illustrate the floating window occlusion processing method. Referring to Figure 1, the floating window occlusion processing method specifically includes:
[0043] S110. Detect a specified event on the current interface. The triggering of the specified event conflicts with the display of the floating window on the current interface.
[0044] When handling floating window occlusion, this application first detects events on the current interface that may cause the floating window to be occluded, such as the aforementioned half-screen panel, pop-up keyboard, full-screen view overlay, and screen rotation, which conflict with the display of the floating window on the current interface. These events are defined as specified events. It is understood that when a specified event is triggered, the floating window display will be obscured. Therefore, by detecting the triggering of these specified events, the corresponding occlusion handling logic is further executed.
[0045] Optionally, the specified events include view hierarchy update events, system keyboard pop-up events, floating window sliding and scaling events, and screen rotation events. The view hierarchy update event is a first type of event, while the system keyboard pop-up event, floating window sliding and scaling event, and screen rotation event are second type of events.
[0046] Detect specified events on the current screen, including:
[0047] When the specified event is a view hierarchy update event, modify the interface view hierarchy change operation method based on the hook function, and detect the view hierarchy update event of the current interface based on the interface view hierarchy change operation method.
[0048] When the specified event is the system keyboard pop-up event, register a system keyboard operation notification, and detect the system keyboard pop-up event of the current interface based on the system keyboard operation notification;
[0049] When the specified event is the floating window swipe zoom event, the floating window swipe zoom event of the current interface is detected based on the gesture recognizer;
[0050] If the specified event is a screen rotation event, register a screen orientation change notification, and detect the screen rotation event of the current interface based on the screen orientation change notification.
[0051] The first type of event is occlusion caused by changes in the parent view hierarchy of the floating window, while the second type is occlusion caused by conflicts in the floating window's display position. Specifically, occlusion detection of the floating window requires identifying the possible timing of occlusion, which is a prerequisite for occlusion detection. Therefore, it is necessary to listen for the triggering of specific events to provide a basis for occlusion detection.
[0052] Regarding view hierarchy update events, there are scenarios where the floating window might be obscured when a child view is added to the parent view. Therefore, by adding code to the parent view to listen for the child view's addition event, changes in the view hierarchy can be captured promptly. It should be noted that the view obscuring the floating window is often dynamically generated, and its position and hierarchy are unpredictable, making it impossible to uniformly implement this operation across all parent views. This application uses hook technology to modify the system's UIView.willMoveToSuperview method for handling view hierarchy changes, enabling event capture when all view hierarchy changes occur. This method can globally and accurately capture view hierarchy change events without needing to set up listeners individually in each parent view, thus greatly improving application development efficiency and the flexibility of floating window management. Using the above method, the view hierarchy update event of the current UIView can be captured.
[0053] For system keyboard pop-up events, because the system keyboard's view hierarchy in the system is higher than the application's view hierarchy, the application's floating window cannot be displayed above the system keyboard, resulting in the floating window being obscured. This application addresses this by registering system keyboard operation notifications, including the system keyboard display notification `UIKeyboardWillShowNotification` and the system keyboard hide notification. By registering the system keyboard `UIKeyboardWillShowNotification`, one can listen for keyboard display events. Similarly, based on the system keyboard hide notification `UIKeyboardWillHideNotification`, one can listen for keyboard hide events. The above method can capture system keyboard pop-up or hide events.
[0054] For floating window swipe and zoom events, since swiping and zooming may cause the floating window to partially or completely appear in an invisible area of the screen, resulting in occlusion, this application uses a gesture recognizer to detect floating window swipe and zoom events on the current interface. Specifically, by listening to the drag gesture recognizer UIPanGestureRecognizer, the coordinate position of the floating window during the swipe can be obtained. By listening to the zoom gesture recognizer UIPinchGestureRecognizer, the final zoomed size and coordinate position of the floating window can be obtained. The above method can capture floating window swipe and zoom events.
[0055] For screen rotation events, screen rotation triggers a restatement or redraw of the interface, especially when switching from portrait to landscape mode, where the size and layout of the view may change significantly. If the position and size of the floating window are not dynamically adjusted at this time, it may partially or completely disappear from the screen.
[0056] To address this, screen rotation events are captured through registration with the UIDeviceOrientationDidChangeNotification feature, allowing for appropriate handling when the device's orientation changes. The notification is triggered when the device switches from portrait to landscape or back, providing information about the current device orientation. This method effectively captures screen rotation events.
[0057] Optionally, in practical applications, the specified events may also include events that cause conflicts in the display of floating windows, such as application full-screen advertisements or notifications, application switching or background processes, and changes in the window manager. This application does not impose fixed restrictions on the specific specified events, and such restrictions are not imposed here.
[0058] Optionally, before triggering the floating window occlusion process, it is also necessary to execute the corresponding floating window opening management and system keyboard management processes.
[0059] The floating window activation management process is as follows:
[0060] 1. When a business scenario enables a floating window, the floating window is added to the parent view, triggering step 2.
[0061] 2. Based on the view hierarchy listener of the UIView in the anti-occlusion listening logic BIUIFloatableObserve, capture whether the view currently added to the parent view integrates the anti-occlusion floating window framework logic BIUIFloatable. If not, it is not related to the floating window, and the process ends; otherwise, proceed to step 3.
[0062] 3. If the parent view is not empty, it means that the anti-occlusion floating window framework logic BIUIFloatable has been added to the parent view, marking that there is currently an anti-occlusion floating window processing flow, and the process ends.
[0063] 4. If the parent view is empty, it means that the anti-obstruction floating window processing flow has been removed from the parent view, marking that there is currently no anti-obstruction floating window process, and the process ends.
[0064] The system will only perform floating window obstruction processing if it determines that there is an anti-obstruction floating window processing procedure.
[0065] The system keyboard management process is as follows:
[0066] 1. Anti-occlusion listening logic: When BIUIFloatableObserve captures the keyboard show or collapse event, if the event is keyboard show, proceed to step 2. If the event is keyboard collapse, proceed to step 3. Otherwise, the process ends.
[0067] 2. Keyboard display, recording the current keyboard coordinates and size. End of process.
[0068] 3. The keyboard is hidden, and it is noted that no keyboard is currently displayed. The process ends.
[0069] The above methods can be used to determine whether the current interface has the anti-obstruction floating window framework logic BIUIFloatable, and whether the current interface displays the system keyboard, providing basic information for subsequent floating window obstruction handling in the system.
[0070] S120. When a specified event is detected, determine the cause information of the floating window occlusion based on the specified event and the parent view of the floating window.
[0071] Furthermore, upon detecting the triggering of a specified event, the cause of the floating window's obstruction can be analyzed based on this specified event and the parent view of the floating window. Generally, the obstruction may be caused by the floating window's view being at a lower level, or by a conflict between the floating window's display position and the display position of the window corresponding to the specified event. Therefore, by simply analyzing the specific type of the specified event and the relevant hierarchical information or display position of the floating window's parent view, the cause of the floating window's obstruction can be determined.
[0072] Referring to Figure 2, when the specified event is a view hierarchy update event, the cause information for the floating window's occlusion is determined based on the specified event and the floating window's parent view, including:
[0073] S1201. Obtain the parent view of the floating window based on the super view interface, and determine the array of each child view of the parent view;
[0074] S1202. Determine the cause of the floating window occlusion based on the sorting of each subview array.
[0075] For view hierarchy update events, the occlusion reason array is initialized to empty, and a variable R is defined to store the occlusion reason information of the floating window. If the specified event is detected as a view hierarchy update event, the parent view of the floating window can be obtained through the system's superview interface UIView.superview. The array of all subviews of the parent view of the floating window is obtained through the superview interface UIView.subviews. The first subview in the subview array is retrieved. If the first subview is not equal to the floating window itself, then the floating window is occluded. The order of each subview array is recorded in the occlusion reason variable R, and the occlusion reason variable R is output as the floating window occlusion reason information. If the view whose hierarchy has changed does not contain the parent view of the floating window, or if the first view of the floating window is equal to the floating window itself, then it is determined that the current floating window is not occluded.
[0076] Optionally, referring to Figure 3, when the specified event is a system keyboard pop-up event, a floating window zoom event, or a screen rotation event, the floating window occlusion cause information is determined based on the specified event and the parent view of the floating window, including:
[0077] S1203. Determine the parent view display area of the floating window in the current interface, and determine the safe area based on the parent view display area;
[0078] S1204. Determine the display position and size of the floating window, and determine the reason for the floating window being obstructed based on the security area, the display position and size of the floating window.
[0079] When the specified event is a system keyboard pop-up event, a floating window zoom-in event, or a screen rotation event, the floating window may be subject to positional occlusion. In this case, the parent view display area of the floating window is initialized as a safe area, defined as SafeFrame. Then, based on the current size and position of the floating window, it is determined whether the SafeFrame area contains the floating window area. If it does, there is no positional occlusion, and the floating window positional occlusion detection process ends. If it does not, there is occlusion, and the display position and size of the safe area and the floating window are recorded in the occlusion cause variable R, and the output is the floating window occlusion cause information.
[0080] Optionally, after determining the display area of the floating window in the parent view of the current interface, the following steps are also included:
[0081] If the specified event is the system keyboard pop-up event, determine the system keyboard display area and update the security area based on the system keyboard display area.
[0082] The BIUIFloatableObserve logic used to listen for occlusion checks the system keyboard status. If the system keyboard is currently being displayed, the system keyboard's coordinates and size are used to calculate the size of the area excluding the keyboard display area using the SafeFrame. The calculated area is then updated to the latest SafeFrame to determine the cause of occlusion. This ensures the accuracy of the SafeFrame and makes subsequent occlusion handling operations accurate and reliable.
[0083] S130. If the specified event is a first type event, adjust the view level of the floating window on the current interface to the top view level according to the floating window occlusion reason information. If the specified event is a second type event, adjust the display position of the floating window to the specified area according to the floating window occlusion reason information.
[0084] Finally, based on the above information about the reasons for the floating window's occlusion, when processing different types of specified events, the view level or display position of the floating window is adjusted according to the occlusion reason information.
[0085] When a specified event of type 1 is detected (i.e., occlusion caused by a change in the parent view hierarchy of the floating window), the system checks whether the floating window is obscured by other views in the new layout based on the occlusion cause information. If the floating window is obscured, its view hierarchy is adjusted to the top. When a specified event of type 2 is detected (i.e., occlusion caused by a floating window display position conflict), the system checks whether the floating window is obscured by a keyboard or pop-up window, etc., based on the occlusion cause information. If the floating window is obscured, a new display position is recalculated based on the SafeFrame area, the floating window's position, and its size recorded in the occlusion cause information, ensuring it is not obscured.
[0086] Based on the above-described floating window occlusion handling process, the stability of floating windows in various scenarios can be effectively improved, abnormal occlusion can be avoided, user experience can be significantly improved, and development and maintenance costs can be reduced. Through occlusion detection and anti-occlusion adjustment, the floating window remains visible and unobstructed when a half-screen panel pops up, the keyboard is displayed, or the page is switched. In audio and video call and live streaming floating window scenarios, the floating window is not obstructed, thereby improving the user experience of the floating window.
[0087] Optionally, when the specified event is a view hierarchy update event, the view hierarchy of the floating window in the current interface is adjusted to the top view hierarchy based on the floating window occlusion reason information, including:
[0088] Call the parent view, and based on the child view operation interface, move the array of child views corresponding to the floating window in the parent view to the top view level of the parent view.
[0089] When the specified event is a view hierarchy update event, it indicates that the occlusion is caused by a change in the parent view hierarchy of the floating window. In this case, the parent view of the floating window is obtained through the system's superview interface UIView.superview, and then the view movement interface UIView.bringSubviewToFront is used to move the view hierarchy of the corresponding floating window to the top of the parent view's view hierarchy.
[0090] For example, when adjusting the view hierarchy of a floating window to the topmost view hierarchy on the current screen, the adjustment methods differ for different operating systems such as Android, HarmonyOS, and iOS. In Android, adjusting the floating window to the top requires obtaining floating window permissions first. Using the WindowManager service, specifying the TYPE_APPLICATION_OVERLAY window type allows adding a custom view and setting a flag to ensure the view is displayed above other applications, thus adjusting the floating window to the topmost view hierarchy of the current screen. HarmonyOS, on the other hand, creates a floating window view through the HarmonyOS API and utilizes system features such as intelligent multi-window management to adjust the floating window's position, thereby adjusting it to the topmost view hierarchy of the current screen. HarmonyOS offers richer layout and view management methods, enabling flexible display of floating windows within the interface. iOS can achieve a similar effect by playing videos in picture-in-picture mode. By integrating the picture-in-picture API, it allows the floating window to be displayed in a small window, thus adjusting the floating window to the topmost view hierarchy of the current screen.
[0091] Furthermore, when the specified events are system keyboard pop-up events, floating window zoom-in events, and screen rotation events, the display position of the floating window is adjusted to the specified area based on the floating window occlusion reason information, including:
[0092] Adjust the display position and size of the floating window based on the view frame interface, and adjust the display position of the floating window to within the safe frame area.
[0093] When the specified events are system keyboard pop-up events, floating window zoom-in events, and screen rotation events, the floating window's position is set within the safe frame using the UIView.frame interface. Adjusting the floating window's display position within the safe frame includes:
[0094] Adjust the floating window to the corresponding boundary position of the safe area based on its display position.
[0095] The floating window setup process is completed by setting the edge to whichever side it is closest to (top, bottom, left, or right).
[0096] For example, referring to Figure 4, there is a display conflict between the floating window area 11 and the system keyboard area 12. When the system keyboard is displayed, the two areas conflict. Based on the above floating window occlusion handling method, referring to Figure 5, by adjusting and updating the floating window safe frame, adjusting the floating window area 11 to the updated safe frame, and setting it to the edge, the two areas can be staggered to avoid display conflict.
[0097] By following the steps above, the view hierarchy or display position of the floating window can be effectively adjusted based on different types of specified events and the reasons for the floating window's obstruction, thereby improving the user experience.
[0098] As described above, by detecting a specified event on the current interface, a display conflict arises between the triggering of the specified event and the display of the floating window on the current interface. Upon detecting the triggering of the specified event, the cause of the floating window occlusion is determined based on the specified event and the parent view of the floating window. If the specified event is a first-type event, the view hierarchy of the floating window on the current interface is adjusted to the top view hierarchy based on the cause of the occlusion. If the specified event is a second-type event, the display position of the floating window is adjusted to a specified area based on the cause of the occlusion. By employing the above technical means, by detecting the cause of floating window occlusion for different types of specified events, and performing corresponding floating window occlusion processing based on the cause of the occlusion, the floating window display is ensured to be unobstructed, thereby ensuring normal user operation of the floating window, improving the user's interactive experience, and enhancing the stability and reliability of the floating window function.
[0099] Based on the above embodiments, Figure 6 is a structural schematic diagram of a floating window occlusion processing system provided in this application. Referring to Figure 6, the floating window occlusion processing system provided in this embodiment specifically includes: a detection module 21, a determination module 22, and a processing module 23.
[0100] Among them, the detection module 21 is configured to detect a specified event on the current interface, and the triggering of the specified event conflicts with the display of the floating window on the current interface;
[0101] Module 22 is configured to determine the cause information of the floating window occlusion based on the specified event and the parent view of the floating window when a specified event is detected.
[0102] The processing module 23 is configured to adjust the view level of the floating window in the current interface to the top view level according to the floating window occlusion reason information when the specified event is a first type event, and to adjust the display position of the floating window to the specified area according to the floating window occlusion reason information when the specified event is a second type event.
[0103] Specifically, the specified events include view hierarchy update events, system keyboard pop-up events, floating window sliding and scaling events, and screen rotation events. View hierarchy update events are the first type of events, while system keyboard pop-up events, floating window sliding and scaling events, and screen rotation events are the second type of events.
[0104] Detect specified events on the current screen, including:
[0105] When the specified event is a view hierarchy update event, modify the interface view hierarchy change operation method based on the hook function, and detect the view hierarchy update event of the current interface based on the interface view hierarchy change operation method.
[0106] When the specified event is the system keyboard pop-up event, register a system keyboard operation notification, and detect the system keyboard pop-up event of the current interface based on the system keyboard operation notification;
[0107] When the specified event is the floating window swipe zoom event, the floating window swipe zoom event of the current interface is detected based on the gesture recognizer;
[0108] If the specified event is a screen rotation event, register a screen orientation change notification, and detect the screen rotation event of the current interface based on the screen orientation change notification.
[0109] Specifically, when the specified event is a view hierarchy update event, the cause of the floating window's occlusion is determined based on the specified event and the floating window's parent view, including:
[0110] Obtain the parent view of the floating window based on the superview interface, and determine the array of child views of the parent view;
[0111] The reason for the floating window being obscured is determined based on the sorting of each subview array.
[0112] When the specified event is a view hierarchy update event, adjust the view hierarchy of the floating window in the current interface to the top view hierarchy based on the floating window occlusion reason information, including:
[0113] Call the parent view, and based on the child view operation interface, move the array of child views corresponding to the floating window in the parent view to the top view level of the parent view.
[0114] When the specified event is a system keyboard pop-up event, a floating window zoom event, or a screen rotation event, the cause of the floating window occlusion is determined based on the specified event and the parent view of the floating window, including:
[0115] Determine the display area of the floating window in the parent view of the current interface, and determine the safe area based on the display area of the parent view;
[0116] Determine the display position and size of the floating window, and determine the reason for the floating window being obstructed based on the safe area, the display position and size of the floating window.
[0117] After determining the display area of the floating window in the parent view of the current interface, the following is also included:
[0118] If the specified event is the system keyboard pop-up event, determine the system keyboard display area and update the security area based on the system keyboard display area.
[0119] When the specified events are system keyboard pop-up event, floating window zoom-in event, and screen rotation event, adjust the display position of the floating window to the specified area according to the floating window occlusion reason information, including:
[0120] Adjust the display position and size of the floating window based on the view frame interface, and adjust the display position of the floating window to the safe area.
[0121] Adjust the display position of the floating window to a safe area, including:
[0122] Adjust the floating window to the corresponding boundary position of the safe area based on its display position.
[0123] As described above, by detecting a specified event on the current interface, a display conflict arises between the triggering of the specified event and the display of the floating window on the current interface. Upon detecting the triggering of the specified event, the cause of the floating window occlusion is determined based on the specified event and the parent view of the floating window. If the specified event is a first-type event, the view hierarchy of the floating window on the current interface is adjusted to the top view hierarchy based on the cause of the occlusion. If the specified event is a second-type event, the display position of the floating window is adjusted to a specified area based on the cause of the occlusion. By employing the above technical means, by detecting the cause of floating window occlusion for different types of specified events, and performing corresponding floating window occlusion processing based on the cause of the occlusion, the floating window display is ensured to be unobstructed, thereby ensuring normal user operation of the floating window, improving the user's interactive experience, and enhancing the stability and reliability of the floating window function.
[0124] The floating window occlusion processing system provided in this application embodiment can be configured to execute the floating window occlusion processing method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0125] Based on the above practical examples, this application also provides a floating window occlusion processing device. Referring to FIG7, the floating window occlusion processing device includes: a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The memory, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the floating window occlusion processing method described in any embodiment of this application (e.g., a detection module, a determination module, and a processing module in a floating window occlusion processing system). The communication module is configured to perform data transmission. The processor executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory, thereby implementing the above-described floating window occlusion processing method. The input device can be configured to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device may include a display device such as a screen. The floating window occlusion processing device provided above can be configured to execute the floating window occlusion processing method provided in the above embodiments, possessing corresponding functions and beneficial effects.
[0126] Based on the above embodiments, this application also provides a non-volatile computer-readable storage medium storing computer-executable instructions. These computer-executable instructions, when executed by a computer processor, are configured to perform a floating window occlusion processing method. The storage medium can be any type of memory device or storage device. Of course, the computer-executable instructions of the non-volatile computer-readable storage medium provided in this application are not limited to the floating window occlusion processing method described above; they can also perform related operations in the floating window occlusion processing method provided in any embodiment of this application.
[0127] Based on the above embodiments, this application also provides a computer program product. The technical solution of this application, in essence or in other words, the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes several instructions to cause a computer device, mobile terminal, or processor therein to execute all or part of the steps of the floating window occlusion processing method described in the various embodiments of this application.
Claims
1. A method for handling the obstruction of a floating window, characterized in that, include: Detect a specified event on the current interface, where the triggering of the specified event conflicts with the display of the floating window on the current interface; If the specified event is detected, the cause information of the floating window being obscured is determined based on the specified event and the parent view of the floating window; If the specified event is a first type of event, adjust the view level of the floating window on the current interface to the top view level according to the floating window occlusion reason information. If the specified event is a second type of event, adjust the display position of the floating window to the specified area according to the floating window occlusion reason information.
2. The method for handling the obstruction of a floating window according to claim 1, characterized in that, The specified events include view hierarchy update events, system keyboard pop-up events, floating window sliding and scaling events, and screen rotation events. The view hierarchy update event is the first type of event, and the system keyboard pop-up event, floating window sliding and scaling event, and screen rotation event are the second type of events. The detection of specified events on the current interface includes: When the specified event is the view hierarchy update event, modify the interface view hierarchy change operation method based on the hook function, and detect the view hierarchy update event of the current interface based on the interface view hierarchy change operation method. If the specified event is the system keyboard pop-up event, register a system keyboard operation notification, and detect the system keyboard pop-up event on the current interface based on the system keyboard operation notification; When the specified event is the floating window sliding and zooming event, the floating window sliding and zooming event of the current interface is detected based on the gesture recognizer; If the specified event is the screen rotation event, register a screen orientation change notification, and detect the screen rotation event of the current interface based on the screen orientation change notification.
3. The method for handling the obstruction of a floating window according to claim 2, characterized in that, When the specified event is the view hierarchy update event, determining the cause of the floating window occlusion based on the specified event and the parent view of the floating window includes: Obtain the parent view of the floating window based on the superview interface, and determine the array of child views of the parent view; The cause of the floating window occlusion is determined based on the sorting of each of the subview arrays.
4. The method for handling the obstruction of a floating window according to claim 3, characterized in that, When the specified event is the view hierarchy update event, adjusting the view hierarchy of the floating window in the current interface to the top view hierarchy based on the floating window occlusion reason information includes: The parent view is invoked, and the subview array corresponding to the floating window in the parent view is moved to the topmost view level of the parent view based on the subview operation interface.
5. The method for handling the obstruction of a suspended window according to claim 2, characterized in that, When the specified event is the system keyboard pop-up event, the floating window zoom-in event, or the screen rotation event, determining the floating window occlusion cause information based on the specified event and the floating window's parent view includes: Determine the parent view display area of the floating window in the current interface, and determine the safe area based on the parent view display area; Determine the display position and size of the floating window, and determine the reason for the floating window being obstructed based on the security area, the display position and size of the floating window.
6. The method for handling the obstruction of a suspended window according to claim 5, characterized in that, After determining the display area of the floating window in the parent view of the current interface, the following is also included: If the specified event is the system keyboard pop-up event, determine the system keyboard display area and update the security area based on the system keyboard display area.
7. The method for handling the obstruction of a suspended window according to claim 5, characterized in that, When the specified event is the system keyboard pop-up event, the floating window sliding and scaling event, or the screen rotation event, adjusting the display position of the floating window to the specified area according to the floating window occlusion reason information includes: Adjust the display position and size of the floating window based on the view frame interface, and adjust the display position of the floating window to the safe area.
8. The method for handling the obstruction of a suspended window according to claim 7, characterized in that, Adjusting the display position of the floating window to the safe area includes: Adjust the floating window to the corresponding boundary position of the safe area based on its display position.
9. A floating window shading treatment system, characterized in that, include: The detection module is configured to detect a specified event on the current interface, where the triggering of the specified event conflicts with the display of the floating window on the current interface. The determination module is configured to determine the cause information of the floating window occlusion based on the specified event and the parent view of the floating window when the specified event is detected. The processing module is configured to, when the specified event is a first type of event, adjust the view level of the floating window in the current interface to the top view level according to the floating window occlusion reason information, and when the specified event is a second type of event, adjust the display position of the floating window to the specified area according to the floating window occlusion reason information.
10. A device for handling the obstruction of a suspended window, characterized in that, include: Memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the floating window occlusion processing method as described in any one of claims 1-8.
11. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores computer-executable instructions that, when executed by a computer processor, are configured to perform the floating window occlusion processing method as described in any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a computer or processor, cause the computer or processor to perform the floating window occlusion processing method as described in any one of claims 1-8.