Floating window shielding processing method, system and equipment and storage medium

By detecting specified events and adjusting the view level or display position of the floating window, the problem of floating window being blocked during application is solved, improving the user interaction experience and the stability of the floating window.

CN120066659APending Publication Date: 2025-05-30GUANGZHOU BAIGUOYUAN NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510231117.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

During the application process, the floating window is often affected by the application's event conflicts such as the half-screen panel, the pop-up keyboard page, the jump page, and the screen rotation, resulting in the floating window being blocked and affecting the user's interactive experience.

Method used

By detecting the specified event in the current interface, determine the reason for occlusion of the floating window, and adjust the view level or display position of the floating window according to the event type to avoid occlusion.

Benefits of technology

Effectively avoid suspended windows being blocked in abnormal scenes, improve the stability and usability of suspended windows in multi-task scenarios, and optimize user interaction experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066659A_ABST
    Figure CN120066659A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a floating window shielding processing method, system and device and a storage medium. According to the technical scheme provided by the embodiment of the invention, the specified event of the current interface is detected, and the triggering of the specified event has the display conflict with the floating window display of the current interface; under the condition of detecting that the specified event is triggered, determining shielding reason information of the floating window based on the specified event and a parent view of the floating window; and under the condition that the specified event is the first type of event, adjusting the view level of the floating window in the current interface to be the uppermost view level according to the floating window shielding reason information, and under the condition that the specified event is the second type of event, adjusting the display position of the floating window to a specified area according to the floating window shielding reason information. By the adoption of the technical means, it can be ensured that display of the floating window is not shielded, then it is ensured that a user normally operates the floating window, interaction experience of the user is improved, and stability and reliability of functional application of the floating window are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a method, system, device, and storage medium for handling floating window occlusion. Background Art

[0002] Currently, in the application interface operation scenario, the application of floating windows is often involved. A floating window is a small window that floats and displays on the application interface, and its main functions and values lie in enhancing the multitasking processing ability and operation efficiency. The floating window allows users to quickly access or operate other functions without leaving the current task. For example, in a live broadcast application, other functions of the application can be used through the floating window to achieve the convenience of multitasking switching. At the same time, the floating window can continuously display important information or status, such as the real-time call duration, network status, etc., enabling users to keep track of key dynamics at any time. In addition, the floating window can also serve as an entry for quick operations, providing users with a fast and efficient operation method to further optimize the interaction experience. Usually, in order to ensure that users can view and operate at any time, the floating window is set as the topmost view in the view hierarchy design.

[0003] However, during the application process of the floating window, it is often affected by event conflicts such as the application popping up a half-screen panel, popping up a keyboard page, page jumping, and screen rotation, resulting in the floating window being blocked. As a result, users cannot normally operate the corresponding floating window functions or misunderstand the function status, affecting the user's interaction experience. Summary of the Invention

[0004] Embodiments of the present application provide a method, system, device, and storage medium for handling floating window occlusion, which can handle events that cause floating window occlusion, avoid the floating window being blocked, and solve the technical problem that the floating window is blocked due to related event conflicts.

[0005] In a first aspect, embodiments of the present application provide a method for handling floating window occlusion, including:

[0006] Detect a specified event on the current interface, where the trigger of the specified event has a display conflict with the display of the floating window on the current interface;

[0007] When the specified event is detected to be triggered, determine the floating window occlusion cause information based on the specified event and the parent view of the floating window;

[0008] When the specified event is a first type of event, adjust the view hierarchy of the floating window on the current interface to the topmost view hierarchy according to the floating window occlusion cause information. When the specified event is a second type of event, adjust the display position of the floating window to a specified area according to the floating window occlusion cause information.

[0009] In a second aspect, an embodiment of the present application provides a floating window occlusion processing system, including:

[0010] A detection module configured to detect a specified event of the current interface, and the triggering of the specified event has a display conflict with the display of the floating window on the current interface;

[0011] A determination module configured to, when detecting the triggering of the specified event, determine floating window occlusion cause information based on the specified event and the parent view of the floating window;

[0012] A processing module configured to, when the specified event is a first type of event, adjust the view hierarchy of the floating window on the current interface to the topmost view hierarchy according to the floating window occlusion cause information, and when the specified event is a second type of event, adjust the display position of the floating window to a specified area according to the floating window occlusion cause information.

[0013] In a third aspect, an embodiment of the present application provides a floating window occlusion processing device, including:

[0014] A memory and one or more processors;

[0015] The memory is configured to store one or more programs;

[0016] 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.

[0017] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are configured to execute the floating window occlusion processing method as described in the first aspect when executed by a computer processor.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, and the computer program product contains instructions, and when the instructions run on a computer or a processor, the computer or the processor executes the floating window occlusion processing method as described in the first aspect.

[0019] In the embodiment of the present application, by detecting a specified event on the current interface, there is a display conflict between the trigger of the specified event and the display of the floating window on the current interface; when detecting the trigger of the specified event, based on the specified event and the parent view of the floating window, the floating window occlusion cause information is determined; when the specified event is a first type of event, according to the floating window occlusion cause information, the view hierarchy of the floating window on the current interface is adjusted to the topmost view hierarchy, and when the specified event is a second type of event, according to the floating window occlusion cause information, the display position of the floating window is adjusted to a specified area. By adopting the above technical means, by detecting the floating window occlusion cause information of different types of specified events and performing corresponding floating window occlusion processing based on the floating window occlusion cause information, it is ensured that the floating window display is not blocked, thereby ensuring that the user can operate the floating window normally, improving the user's interaction experience, and enhancing the stability and reliability of the floating window function application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a method for processing floating window occlusion provided by an embodiment of the present application;

[0021] Figure 2 is a flowchart for determining floating window occlusion cause information in an embodiment of the present application;

[0022] Figure 3 is another flowchart for determining floating window occlusion cause information in an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of floating window occlusion in an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of adjusting the display of the floating window in an embodiment of the present application;

[0025] Figure 6 is a schematic structural diagram of a floating window occlusion processing system provided by an embodiment of the present application;

[0026] Figure 7 is a schematic structural diagram of a floating window occlusion processing device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following provides a more detailed description of specific embodiments of this application with reference to the accompanying drawings. It can be understood that the specific embodiments described herein are merely for explaining this application and do not limit this application. Additionally, it should be noted that for ease of description, only parts related to this application are shown in the drawings rather than all content. Before discussing the 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 the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but it can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, and so on.

[0028] The floating window occlusion handling method provided by 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.

[0029] A floating window is a small window that floats and displays on the application interface. Its main functions and values lie in enhancing the multitasking processing ability and operation efficiency. It allows users to quickly access or operate other functions without leaving the current task. For example, in a live broadcast room, other functions of the application can be used through a small window to achieve the convenience of multitasking switching. At the same time, the floating window can continuously display important information or status, such as the real-time call duration, network status, etc., enabling users to always grasp the key dynamics. In addition, the floating window can also serve as an entry for quick operations, providing users with a fast and efficient operation method to further optimize the interaction experience.

[0030] In the view hierarchy design, the floating window is usually set as the topmost view to ensure that users can view and operate it at any time. However, due to special circumstances in specific scenarios, its display may still be affected, resulting in the phenomenon of being occluded. These problems mainly include the following categories:

[0031] Half-screen panel occlusion: When a half-screen panel (such as a sharing panel, selection list, settings menu, etc.) pops up in the application, the floating window may be covered under the panel.

[0032] Keyboard occlusion: In scenarios where text input is required, when the keyboard pops up, the position of the floating window may be covered by the keyboard, especially when the floating window is located in the bottom area of the screen.

[0033] Page coverage: The user jumps from the current interface to another full-screen page, such as entering Story, video playback mode, full-screen picture preview, etc.

[0034] Screen rotation: When the screen rotates, it will trigger the re-layout or redrawing of the interface. Especially when switching from portrait to landscape, the size and layout of the view may change significantly. If the position and size of the floating window are not adjusted dynamically, it may cause part or all of it to not appear on the screen.

[0035] The floating window being blocked will have an adverse impact on the user experience. After the floating window is blocked, the user may feel confused or inconvenienced, making the user think that there is a malfunction in the application. For example, in a call scenario, when the floating window is blocked, the user may mistakenly think that the call has ended abnormally. This misunderstanding may lead the user to take unnecessary actions and leave a bad experience for the user. Also, after the floating window is blocked, the user cannot access the functions of the floating window in a timely manner. For example, in a call scenario, the user may not be able to mute or hang up the call due to the floating window being blocked, and thus feel confused or inconvenienced. The user may mistakenly think that the function has malfunctioned and the call has ended abnormally.

[0036] In summary, a floating window is a small window that floats and displays on the application interface, mainly used to enhance multitasking capabilities and operation efficiency, and supports users to quickly access functions or obtain key information without leaving the current task. However, in specific scenarios, the floating window may be affected by factors such as a half-screen panel, the keyboard, being blocked by a full-screen page, and screen rotation, resulting in the user being unable to operate normally or misunderstanding the function status, thus causing a negative experience.

[0037] Obviously, in the implementation of the floating window, due to the limitations of the interface layout and interaction logic, it is difficult to avoid the problem of being blocked in some abnormal scenarios, such as being blocked by a half-screen panel, a pop-up keyboard, being covered by a full-screen view, and screen rotation, resulting in the user being unable to view or operate the functions of the floating window normally. And dealing with the floating window occlusion problem one by one for the above specific scenarios is often inefficient, which not only increases the complexity of application development and the cost of code maintenance, but also may miss some potential occlusion situations.

[0038] Based on this, a floating window occlusion processing method according to an embodiment of the present application is provided to avoid the floating window being blocked and solve the technical problem that the floating window is blocked due to related event conflicts. Through technical means such as dynamically adjusting the position of the floating window, dynamically adjusting the view hierarchy of the floating window, and dynamically detecting occlusion situations, the phenomenon that the floating window is blocked in abnormal scenarios is effectively avoided, and the stability and usability of the floating window in multitasking scenarios are significantly improved. Ensure that users can continuously use the floating window function under various complex interactions, thereby greatly optimizing the usage experience.

[0039] Embodiment:

[0040] Figure 1The flowchart of a floating window occlusion processing method provided by an embodiment of the present application is given. In this embodiment, the floating window occlusion processing method can be executed by a floating window occlusion processing device. The floating window occlusion processing device can be implemented in software and / or hardware. The floating window occlusion processing device can be composed of two or more physical entities or one physical entity. Generally speaking, the floating window occlusion processing device can be a terminal device such as a computer, a mobile phone, or a tablet.

[0041] The following takes the floating window occlusion processing device as the main body for executing the floating window occlusion processing method as an example for description. Refer to Figure 1 The floating window occlusion processing method specifically includes:

[0042] S110. Detect a specified event on the current interface, and the trigger of the specified event has a display conflict with the display of the floating window on the current interface.

[0043] When performing floating window occlusion processing in the present application, first, relevant events that may cause floating window occlusion on the current interface are detected, such as the above-mentioned half-screen panel, pop-up keyboard, full-screen view covering, and screen rotation, which have a display conflict with the display of the floating window on the current interface. The above events are defined as specified events. It can be understood that when a specified event is triggered, the display of the floating window will be blocked. Therefore, by detecting the trigger of this part of the specified events, the corresponding occlusion processing logic is further executed.

[0044] Optionally, the specified events include a view hierarchy update event, a system keyboard pop-up event, a floating window sliding and scaling event, and a screen rotation event. The view hierarchy update event is a first type of event, and the system keyboard pop-up event, the floating window sliding and scaling event, and the screen rotation event are second type of events;

[0045] Detecting the specified event on the current interface includes:

[0046] 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 on the current interface based on the interface view hierarchy change operation method;

[0047] When the specified event is a 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;

[0048] When the specified event is a floating window sliding and scaling event, detect the floating window sliding and scaling event on the current interface based on the gesture recognizer;

[0049] When the specified event is a screen rotation event, register a screen orientation change notification, and detect the screen rotation event on the current interface based on the screen orientation change notification.

[0050] Among them, the first type of event is the occlusion caused by the change in the hierarchical level of the floating window's parent view, and the second type of event is the occlusion of the floating window caused by the conflict in the display position of the floating window. Specifically, the occlusion detection of the floating window requires clarifying the possible occlusion timing, which is the prerequisite for performing occlusion detection. Therefore, it is necessary to monitor the triggering of specified events to lay the foundation for occlusion detection.

[0051] Among them, for the view hierarchical update event, since there may be a scenario where the floating window is occluded when adding a subview to the parent view. Therefore, by adding code in the parent view to monitor the addition event of the subview, the change in the view hierarchy can be captured in a timely manner. It should be noted that the view occluding the floating window is often dynamically generated, and its position and hierarchy cannot be predicted. Therefore, this operation cannot be uniformly implemented in all parent views. This application adopts the hook (hook function) technology to modify the system's interface view hierarchical change operation method UIView.willMoveToSuperview to achieve event capture when all view hierarchies change. The interface view hierarchical change operation method can globally and accurately capture the events of view hierarchical changes without the need to set up monitoring separately in each parent view, thus greatly improving the application development efficiency and the flexibility of floating window management. Through the above method, the view hierarchical update event of the current interface UIView can be captured.

[0052] For the system keyboard pop-up event, since the view hierarchy of the system keyboard in the system is higher than that of the application implementation, the floating window implemented by the application cannot be displayed above the system keyboard, resulting in the occlusion of the floating window. This application registers the system keyboard operation notifications provided by the system. The system keyboard operation notifications include the system keyboard display notification UIKeyboardWillShowNotification and the system keyboard hide notification. By registering the system keyboard UIKeyboardWillShowNotification, the keyboard display event can be monitored. Similarly, based on the system keyboard hide notification UIKeyboardWillHideNotification, the keyboard retraction event can be monitored. Through the above method, the system keyboard pop-up or retraction event can be captured.

[0053] For the floating window sliding and zooming events, since the floating window sliding and zooming may cause part or all of the floating window to appear in the invisible area of the screen, resulting in occlusion. Therefore, this application detects the floating window sliding and zooming events of the current interface through a gesture recognizer. Among them, the coordinate position of the floating window during sliding can be obtained by listening to the drag gesture recognizer UIPanGestureRecognizer. The final zoom size and coordinate position of the floating window can be obtained by listening to the pinch gesture recognizer UIPinchGestureRecognizer. The events of floating window sliding and zooming can be captured through the above methods.

[0054] For the screen rotation event, since the screen rotation will trigger the re-layout or redrawing of the interface, especially when switching from portrait to landscape, the size and layout of the view may change significantly. At this time, if the position and size of the floating window are not dynamically adjusted, it will cause part or all of it to not appear on the screen. Therefore, the screen rotation event is collected by registering the screen orientation change notification (UIDeviceOrientationDidChangeNotification) to make corresponding processing when the device orientation changes. When the device orientation switches from portrait to landscape, or from landscape back to portrait, the screen orientation change notification will be triggered, so that the current device orientation can be obtained through this notification. The event of device screen rotation can be captured through the above method.

[0055] Optionally, in practical applications, the specified events may also include events that cause display conflicts of the floating window, such as applying full-screen advertisements or notifications, application switching or background processes, window manager changes, etc. This application does not make a fixed limit on the specific specified events and does not make a fixed limit here.

[0056] Optionally, before triggering the floating window occlusion processing, it is also necessary to execute the corresponding floating window opening management and system keyboard management processes.

[0057] Among them, the floating window opening management process is as follows:

[0058] 1. The floating window is opened in the business scenario, and the floating window is added to the parent view, triggering step 2.

[0059] 2. Based on the view hierarchy listening of the interface view 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, go to step 3.

[0060] 3. If the parent view is not null, it means that the anti-blocking floating window framework logic BIUIFloatable has been added to the parent view, marking that there is an anti-blocking floating window processing flow currently, and the process ends.

[0061] 4. If the parent view is null, it means that the anti-blocking floating window processing flow has been removed from the parent view, marking that there is no anti-blocking floating window process currently, and the process ends.

[0062] The system performs floating window occlusion processing only when it determines that there is an anti-blocking floating window processing flow for the floating window.

[0063] The system keyboard management process is as follows:

[0064] 1. When the anti-blocking listening logic BIUIFloatableObserve captures the keyboard display or retraction event, if the event is keyboard display, then proceed to step 2. If the event is keyboard retraction, then proceed to step 3. Otherwise, the process ends.

[0065] 2. Keyboard is displayed, record the coordinates and size of the current keyboard. The process ends.

[0066] 3. Keyboard is retracted, record that there is no keyboard display currently, and the process ends.

[0067] Through the above method, it is possible to determine whether the anti-blocking floating window framework logic BIUIFloatable exists in the current interface and whether the system keyboard is displayed in the current interface, providing basic information for the subsequent floating window occlusion processing of the system.

[0068] S120. When detecting that a specified event is triggered, determine the floating window occlusion cause information based on the specified event and the parent view of the floating window.

[0069] Furthermore, when detecting that a specified event is triggered, the cause of the floating window occlusion can be analyzed according to the specified event in combination with the parent view of the floating window. Generally speaking, the reason for the floating window occlusion may be that the floating window view hierarchy is relatively low, or the display position of the floating window conflicts with the display position of the window corresponding to the specified event. Therefore, only by combining the specific type of the specified event with the relevant hierarchy information or display position of the parent view of the floating window, the floating window occlusion cause information can be analyzed.

[0070] Among them, referring to Figure 2 , when the specified event is a view hierarchy update event, determining the floating window occlusion cause information based on the specified event and the parent view of the floating window includes:

[0071] S1201. Obtain the parent view of the floating window based on the super view interface, and determine the array of each sub-view of the parent view;

[0072] S1202. Determine the floating window occlusion cause information based on the sorting of each sub - view array.

[0073] For a view hierarchy update event, initialize the occlusion cause array to be empty, define the occlusion cause array as variable R, which is used to store the floating window occlusion cause information. If the above - specified event is detected as a view hierarchy update event, the parent view of the floating window can be obtained through the system's super - view interface UIView.superview. Obtain all sub - view arrays of the floating window's parent view through the super - view interface UIView.subviews, and get the first one of the sub - view arrays. If the first sub - view is not equal to the floating window itself, the floating window is occluded. Record the sorting of each sub - view array to the occlusion cause variable R, and output the occlusion cause variable R as the floating window occlusion cause information. If the view with the hierarchical change does not contain the parent view of the floating window, or the first view of the floating window is equal to the floating window itself, it is determined that the current floating window is not occluded.

[0074] Optionally, referring to Figure 3 , in the case where the specified event is a system keyboard pop - up event, a floating window sliding and zooming event, or a screen rotation event, determine the floating window occlusion cause information based on the specified event and the parent view of the floating window, including:

[0075] S1203. Determine the display area of the parent view of the floating window in the current interface, and determine the safe area based on the parent view display area;

[0076] S1204. Determine the display position and size of the floating window, and determine the floating window occlusion cause information according to the safe area, the display position and size of the floating window.

[0077] In the case where the specified event is a system keyboard pop - up event, a floating window sliding and zooming event, or a screen rotation event, the floating window may be involved in position occlusion. At this time, initialize the display area of the floating window's parent view as the safe area, and define it as the safe area SafeFrame. Then, according to the size and position of the current floating window, determine whether the SafeFrame area contains the floating window area. If it contains, there is no position occlusion, and the floating window position occlusion detection process ends. If it does not contain, there is occlusion. At this time, record the safe area, the display position and size of the floating window to the occlusion cause variable R, and output it as the floating window occlusion cause information.

[0078] Optionally, after determining the display area of the parent view of the floating window in the current interface, it further includes:

[0079] In the case where the specified event is a system keyboard pop - up event, determine the system keyboard display area, and update the safe area based on the system keyboard display area.

[0080] Query the system keyboard status through the above anti-blocking monitoring logic BIUIFloatableObserve. If the system keyboard is currently being displayed, calculate the area size after removing the system keyboard display area based on the coordinates and size of the current system keyboard using the safe area SafeFrame, update the calculated area as the latest safe area SafeFrame, and then determine the occlusion reason information to ensure the accuracy of the safe area SafeFrame, making the subsequent occlusion handling operations accurate and reliable.

[0081] S130. When the specified event is a first-type event, adjust the view hierarchy of the floating window to the topmost view hierarchy in the current interface according to the floating window occlusion reason information. When the specified event is a second-type event, adjust the display position of the floating window to a specified area according to the floating window occlusion reason information.

[0082] Finally, based on the above floating window occlusion reason information, when processing different types of specified events, adjust the view hierarchy or display position of the floating window according to the floating window occlusion reason information.

[0083] When it is detected that the specified event is a first-type event (i.e., occlusion caused by the change of the floating window's parent view hierarchy), check whether the floating window is occluded by other views in the new layout according to the occlusion reason information. If the floating window is occluded, adjust the view hierarchy of the floating window to the topmost layer. When it is detected that the specified event is a second-type event (i.e., occlusion of the floating window caused by the conflict of the floating window's display position), check whether the floating window is occluded by the keyboard or pop-up window, etc., according to the occlusion reason information. If the floating window is occluded, recalculate a new display position based on the safe area SafeFrame, floating window position and size recorded in the occlusion reason information to ensure that it is not occluded.

[0084] Based on the above floating window occlusion handling process, the use stability of the floating window in multiple scenarios can be effectively improved, abnormal occlusion can be avoided, the user experience can be significantly improved, and the development and maintenance costs can be reduced at the same time. Through occlusion detection and anti-occlusion adjustment, the floating window remains visible and unoccluded when the half-screen panel pops up, the keyboard is displayed, or the page is switched. In scenarios such as audio and video calls and live broadcast floating windows, the floating window is not occluded, thus improving the user experience of using the floating window.

[0085] Optionally, when the specified event is a view hierarchy update event, adjusting the view hierarchy of the floating window to the topmost view hierarchy in the current interface according to the floating window occlusion reason information includes:

[0086] Call the parent view and move the sub-view array corresponding to the floating window in the parent view to the topmost view hierarchy based on the sub-view operation interface.

[0087] In the case where the specified event is a view hierarchy update event, it indicates that the occlusion is caused by the change of the floating window's parent view hierarchy. Then, the floating window's parent view is obtained through the system's superview interface UIView.superview, and the view hierarchy of the corresponding floating window is moved to the top layer of the parent view's view hierarchy through the view movement interface UIView.bringSubviewToFront.

[0088] Exemplarily, when adjusting the view hierarchy of the floating window to the top layer in the current interface, the adjustment methods are different for different operating systems such as Android, HarmonyOS, and iOS. Among them, in the Android system, to adjust the floating window to the top layer, the floating window permission needs to be obtained first. Using the WindowManager service, specify the window type TYPE_APPLICATION_OVERLAY to add a custom view and set the flag to ensure that the view is displayed above other applications, so as to adjust the floating window to the top layer of the current interface's view hierarchy; HarmonyOS creates a floating window view through the HarmonyOS API and uses system features such as intelligent multi-window to manage the position of the floating window, so as to adjust the floating window to the top layer of the current interface's view hierarchy. HarmonyOS can provide richer layout and view management methods to achieve flexible display of the floating window in the interface. iOS can achieve a similar effect by playing videos in the Picture in Picture mode. By integrating the Picture in Picture API, it allows the floating window to be displayed in a small window, so as to adjust the floating window to the top layer of the current interface's view hierarchy.

[0089] Further, in the case where the specified events are system keyboard pop-up events, floating window sliding and zooming events, and screen rotation events, the display position of the floating window is adjusted to a specified area according to the floating window occlusion cause information, including:

[0090] Based on the view framework interface, adjust the display position and size of the floating window, and adjust the display position of the floating window to within the safe area SafeFrame.

[0091] In the case where the specified events are system keyboard pop-up events, floating window sliding and zooming events, and screen rotation events, then set the position of the floating window within the safe area SafeFrame through the interface view framework interface UIView.frame. Among them, adjusting the display position of the floating window to within the safe area SafeFrame includes:

[0092] Adjust the floating window to the corresponding boundary position of the safe area by sticking to the edge according to the display position of the floating window.

[0093] By setting the floating window to stick to the edge, if it is closer to the top, bottom, left, or right side, it will stick to that side, thus completing the floating window setting process.

[0094] Exemplarily, refer 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, there is a display conflict between the two areas. Then, based on the above floating window occlusion processing method, referring to Figure 5 , by adjusting and updating the safe area SafeFrame of the floating window, adjusting the floating window area 11 into the updated safe area SafeFrame, and setting it against the edge, the two areas can be staggered to avoid display conflicts.

[0095] Through the above steps, the view hierarchy or display position of the floating window can be effectively adjusted according to different types of specified events and the occlusion reason information of the floating window, thereby improving the user experience.

[0096] As described above, by detecting the specified event of the current interface, there is a display conflict between the trigger of the specified event and the display of the floating window on the current interface; when it is detected that the specified event is triggered, the floating window occlusion reason information is determined based on the specified event and the parent view of the floating window; when the specified event is the first type of event, the view hierarchy of the floating window on the current interface is adjusted to the topmost view hierarchy according to the floating window occlusion reason information, and when the specified event is the second type of event, the display position of the floating window is adjusted to the specified area according to the floating window occlusion reason information. By adopting the above technical means, by detecting the floating window occlusion reason information of different types of specified events and performing corresponding floating window occlusion processing based on the floating window occlusion reason information, it is ensured that the display of the floating window is not blocked, thereby ensuring that the user can operate the floating window normally, improving the user's interaction experience, and enhancing the stability and reliability of the floating window function application.

[0097] Based on the above embodiments, Figure 6 is a schematic structural diagram of a floating window occlusion processing system provided by the present application. Refer 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.

[0098] Among them, the detection module 21 is configured to detect the specified event of the current interface, and there is a display conflict between the trigger of the specified event and the display of the floating window on the current interface;

[0099] The determination module 22 is configured to, when it is detected that the specified event is triggered, determine the floating window occlusion reason information based on the specified event and the parent view of the floating window;

[0100] The processing module 23 is configured to, when the specified event is the first type of event, adjust the view hierarchy of the floating window on the current interface to the topmost view hierarchy according to the floating window occlusion reason information, and when the specified event is the second type of event, adjust the display position of the floating window to the specified area according to the floating window occlusion reason information.

[0101] Specifically, 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, and the system keyboard pop-up event, floating window sliding and scaling events, and screen rotation events are second type of events;

[0102] Detect the specified events of the current interface, including:

[0103] In the case where 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;

[0104] In the case where the specified event is a 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;

[0105] In the case where the specified event is a floating window sliding and scaling event, detect the floating window sliding and scaling event of the current interface based on the gesture recognizer;

[0106] In the case where 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.

[0107] Among them, in the case where the specified event is a view hierarchy update event, determine the floating window occlusion reason information based on the specified event and the parent view of the floating window, including:

[0108] Obtain the parent view of the floating window based on the super view interface, and determine the array of each sub-view of the parent view;

[0109] Determine the floating window occlusion reason information based on the sorting of each sub-view array.

[0110] In the case where the specified event is a view hierarchy update event, adjust the view hierarchy of the floating window in the current interface to the topmost view hierarchy according to the floating window occlusion reason information, including:

[0111] Call the parent view, and move the sub-view array corresponding to the floating window in the parent view to the topmost view hierarchy based on the sub-view operation interface.

[0112] In the case where the specified event is a system keyboard pop-up event, floating window sliding and scaling event, or screen rotation event, determine the floating window occlusion reason information based on the specified event and the parent view of the floating window, including:

[0113] Determine the display area of the parent view of the floating window in the current interface, and determine the safe area based on the parent view display area;

[0114] Determine the display position and size of the floating window, and determine the floating window occlusion cause information based on the safe area, the display position and size of the floating window.

[0115] After determining the display area of the parent view of the floating window on the current interface, it further includes:

[0116] When the specified event is the system keyboard pop-up event, determine the system keyboard display area, and update the safe area based on the system keyboard display area.

[0117] When the specified events are the system keyboard pop-up event, the floating window sliding and scaling event, and the screen rotation event, adjust the display position of the floating window to the specified area according to the floating window occlusion cause information, including:

[0118] Adjust the display position and size of the floating window based on the view framework interface, and adjust the display position of the floating window to within the safe area.

[0119] Adjusting the display position of the floating window to within the safe area includes:

[0120] Adjust it to the corresponding boundary position of the safe area by sticking to the edge near the display position of the floating window.

[0121] As described above, by detecting the specified event of the current interface, there is a display conflict between the trigger of the specified event and the display of the floating window on the current interface; when detecting the trigger of the specified event, determine the floating window occlusion cause information based on the specified event and the parent view of the floating window; when the specified event is the first type of event, adjust the view hierarchy of the floating window on the current interface to the topmost view hierarchy according to the floating window occlusion cause information, and when the specified event is the second type of event, adjust the display position of the floating window to the specified area according to the floating window occlusion cause information. By adopting the above technical means, by detecting the floating window occlusion cause information of different types of specified events and performing corresponding floating window occlusion processing based on the floating window occlusion cause information, it is ensured that the floating window display is not blocked, thereby ensuring the normal operation of the floating window by the user, improving the user's interaction experience, and enhancing the stability and reliability of the floating window function application.

[0122] The floating window occlusion processing system provided by the embodiments of the present application can be configured to execute the floating window occlusion processing method provided by the above embodiments, and has the corresponding functions and beneficial effects.

[0123] On the basis of the above actual example, the embodiments of the present application also provide a floating window occlusion processing device, refer to Figure 7, 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 the program instructions / modules corresponding to the floating window occlusion processing method described in any embodiment of the present application (for example, the detection module, determination module, and processing module in the 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, that is, to implement the above-mentioned 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 the user settings and function controls of the device. The output device may include a display device such as a display screen. The above-provided floating window occlusion processing device can be configured to execute the floating window occlusion processing method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0124] Based on the above embodiments, an embodiment of the present application further provides a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are configured to execute a floating window occlusion processing method when executed by a computer processor. The storage medium can be any of various types of memory devices or storage devices. Of course, for the non-volatile computer-readable storage medium provided in the embodiment of the present application, its computer-executable instructions are not limited to the floating window occlusion processing method as described above, and can also execute related operations in the floating window occlusion processing method provided in any embodiment of the present application.

[0125] Based on the above embodiments, an embodiment of the present application further provides a computer program product. Essentially, or the part that contributes to the prior art, or all or part of the technical solution of the present application can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes several instructions for causing a computer device, a mobile terminal, or a processor therein to execute all or part of the steps of the floating window occlusion processing method described in each embodiment of the present application.

Claims

1. A floating window occlusion processing method, characterized in that: include: Detecting a specified event of the current interface, where the triggering of the specified event conflicts with the floating window display of the current interface; When the triggering of the specified event is detected, determining the reason information for occluding the floating window based on the specified event and the parent view of the floating window; In the case where the designated event is a first type of event, the view level of the floating window in the current interface is adjusted to the topmost view level according to the floating window occlusion reason information; in the case where the designated event is a second type of event, the display position of the floating window is adjusted to the designated area according to the floating window occlusion reason information.

2. The floating window occlusion processing method according to claim 1, characterized in that: The specified events include view level update events, system keyboard pop-up events, floating window sliding zoom events, and screen rotation events, wherein the view level update events are the first type of events, and the system keyboard pop-up events, the floating window sliding zoom events, and the screen rotation events are the second type of events; The detecting of the specified event of the current interface includes: In the case where the designated event is the view level update event, modifying the interface view level change operation method based on the hook function, and detecting the view level update event of the current interface based on the interface view level change operation method; In the case where the designated event is the system keyboard pop-up event, registering a system keyboard operation notification, and detecting the system keyboard pop-up event of the current interface based on the system keyboard operation notification; In a case where the designated event is the floating window sliding zoom event, detecting the floating window sliding zoom event of the current interface based on a gesture recognizer; In a case where the designated event is the screen rotation event, a screen direction change notification is registered, and the screen rotation event of the current interface is detected based on the screen direction change notification.

3. The floating window occlusion processing method according to claim 2, characterized in that: In the case where the designated event is the view level update event, the determining the floating window occlusion reason information based on the designated event and the parent view of the floating window includes: Obtain the parent view of the floating window based on the super view interface, and determine the arrays of each subview of the parent view; The floating window occlusion reason information is determined based on the order of each of the sub-view arrays.

4. The floating window occlusion processing method according to claim 3, characterized in that: In the case where the designated event is the view level update event, adjusting the view level of the floating window in the current interface to the top view level according to the floating window blocking reason information includes: The parent view is called, and based on the sub-view operation interface, the sub-view array corresponding to the floating window in the parent view is moved to the top view level of the parent view.

5. The floating window occlusion processing method according to claim 2, characterized in that: In the case where the designated event is the system keyboard pop-up event, the floating window sliding and zooming event, or the screen rotation event, the determining the floating window occlusion reason information based on the designated event and the parent view of the floating window includes: Determine a parent view display area of ​​the floating window in the current interface, and determine a safe area based on the parent view display area; The display position and size of the floating window are determined, and the reason information for shielding the floating window is determined according to the safety area, the display position and size of the floating window.

6. The floating window occlusion processing method according to claim 5, characterized in that: After determining that the floating window is in the parent view display area of ​​the current interface, the method further includes: In a case where the designated event is the system keyboard pop-up event, a system keyboard display area is determined, and the security area is updated based on the system keyboard display area.

7. The floating window occlusion processing method according to claim 5, characterized in that: In the case where the designated event is the system keyboard pop-up event, the floating window sliding and zooming event, and the screen rotation event, adjusting the display position of the floating window to the designated area according to the floating window blocking reason information includes: The display position and size of the floating window are adjusted based on the view frame interface, and the display position of the floating window is adjusted to be within the safe area.

8. The floating window occlusion processing method according to claim 7, characterized in that: The step of adjusting the display position of the floating window to within the safe area includes: According to the display position of the floating window, the floating window is adjusted to the corresponding boundary position of the safety area.

9. A floating window shading processing system, characterized in that: include: A detection module is configured to detect a specified event of the current interface, wherein the triggering of the specified event conflicts with the floating window display of the current interface; A determination module, configured to determine the floating window occlusion reason information based on the specified event and the parent view of the floating window when the specified event is detected to be triggered; The processing module is configured to adjust the view level of the floating window in the current interface to the topmost view level according to the floating window occlusion reason information when the designated event is a first type of event, and to adjust the display position of the floating window to a designated area according to the floating window occlusion reason information when the designated event is a second type of event.

10. A floating window occlusion processing device, 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, and when the computer-executable instructions are executed by a computer processor, they are configured to execute the floating window occlusion processing method according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the floating window occlusion processing method as described in any one of claims 1-8.

Citation Information

Cited By

  • Floating window obstruction processing method, system and device, and storage medium

    WO2026179258A1