Pop-up window management system, pop-up window control method, storage medium, and computer equipment

Through the view controller and pop-up window control unit of the pop-up window management system, the pop-up window view of the smartphone application is unified, which solves the problem of inconsistent pop-up window management in multiple modules, and realizes the stable display and closing of pop-up window views, avoiding the The window is chaotic and supports native operation effects.

CN113867870BActive Publication Date: 2025-01-10BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111153958.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-01-10
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

In the prior art, the multi-module pop-up view management of smartphone applications is not unified, resulting in confusion in window layers, interfering with each function pop-up view, and abnormal pages.

Method used

Provide a pop-up window management system, including pop-up window function module and pop-up window management module, connected through the API interface, and use the view controller and pop-up window control unit to uniformly manage the display and closing of pop-up window views, support weak reference table management, and avoid The window is confused.

Benefits of technology

It realizes unified management of pop-up views, avoids window confusion, supports native push and pop operation effects, and ensures that the window is released correctly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113867870B_ABST
    Figure CN113867870B_ABST
Patent Text Reader

Abstract

The present application discloses a pop-up window management system, a pop-up window control method, a storage medium, and a computer device. The system includes: at least one pop-up window function module and a pop-up window management module, the pop-up window management module is connected to the pop-up window function module through an API interface, the pop-up window management module includes a view controller and a pop-up window control unit, and the pop-up window control unit encapsulates a transition management class; the pop-up window function module is used to set a pop-up window view configuration item; the view controller is used to provide a pop-up window view display method and a pop-up window view closing method, and to construct a target view, and configure the target view as a pop-up window view according to the pop-up window view configuration item; the pop-up window control unit is used to call the pop-up window view display method provided by the view controller to control the display of the pop-up window view, and call the pop-up window view closing method provided by the view controller to control the closing of the pop-up window view.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a pop-up window management system, a pop-up window control method, a storage medium, and a computer device. Background Art

[0002] At present, in order to meet the needs of different users and increase user stickiness, smartphone applications have more and more functions. Many functions are implemented by embedding third-party SDKs, or the project is developed using components. Each module is divided by function, and the page is relatively independent. In many software, there are multiple pop-up views displayed at the same time. In the prior art, when displaying a page, the rootviewController root view controller of the current top view is obtained in real time, and the pop-up window to be displayed is displayed through the system interface, so that the window to be displayed is always kept at the top. When it is necessary to display windows of different modules at the same time, because the display methods of each module are not unified, they will compete for the top view added to the window or replace the window handle, resulting in a messy window layer, and the pop-up views of each function will interfere with each other, resulting in page abnormalities. Summary of the invention

[0003] In view of this, the present application provides a pop-up window management system, a pop-up window control method, a storage medium, and a computer device.

[0004] According to one aspect of the present application, a pop-up window management system is provided, the system comprising:

[0005] At least one pop-up window function module and a pop-up window management module, wherein the pop-up window management module is connected to the pop-up window function module through an API interface, the pop-up window management module includes a view controller and a pop-up window control unit, and the pop-up window control unit encapsulates a transition management class;

[0006] The pop-up window function module is used to set pop-up window view configuration items;

[0007] The view controller is used to provide a pop-up view display method and a pop-up view closing method, as well as to construct a target view, and configure the target view as a pop-up view according to the pop-up view configuration item;

[0008] The pop-up window control unit is used to call the pop-up window view display method provided by the view controller to control the display of the pop-up window view, and call the pop-up window view closing method provided by the view controller to control the closing of the pop-up window view.

[0009] Optionally, the pop-up window control unit is further used to add a weak reference to the pop-up window view displayed, add the pop-up window view to a weak reference table, and remove the closed pop-up window view from the weak reference table.

[0010] Optionally, the view controller is further used to add a listener to a preset listener event in the target view by inheriting a base class, and when the preset listener event is listened to, determine a subview configuration item corresponding to the pop-up window view, construct a target subview, and configure the target subview as a bullet window view according to the subview configuration item;

[0011] The pop-up window control unit is also used to determine whether the preset display element is blocked based on the preset display element position corresponding to the pop-up window view and the display position corresponding to the bullet window view, and adjust the pop-up window view or the bullet window view when it is determined that the preset display element is blocked.

[0012] Optionally, the preset monitoring event includes an input event;

[0013] The view controller is specifically used to add a listener to the input event in the target view, and when the input event is listened to, determine the keyboard configuration item corresponding to the pop-up window view, build a keyboard subview, and configure the keyboard subview as a keyboard pop-up window view according to the keyboard configuration item;

[0014] The pop-up control unit is specifically used to determine whether the input box is blocked based on the position of the input box corresponding to the pop-up view and the display position of the keyboard pop-up view, and move and / or scale the pop-up view when it is determined that the input box is blocked.

[0015] Optionally, the pop-up window function module is further used to configure a corresponding pop-up window function module identifier;

[0016] The pop-up control unit is also used to add the displayed pop-up view to a weak reference table corresponding to the pop-up function module identifier of the pop-up view, and when receiving an instruction to close all pop-up views, close the pop-up views in sequence according to the order from the top-level pop-up view to the bottom-level pop-up view corresponding to each weak reference table, and clear each weak reference table.

[0017] Optionally, the pop-up window control unit is also used to receive input parameters corresponding to the pop-up window view, compare the input parameters with the pop-up window view configuration items, determine the change parameters corresponding to the pop-up window view, and adjust the pop-up window view according to the change parameters.

[0018] Optionally, when the change parameter includes a window size scaling parameter of the pop-up window view, the pop-up window control unit keeps the center coordinate position of the pop-up window view unchanged, and scales the pop-up window view according to the window size scaling parameter.

[0019] Optionally, the system further comprises:

[0020] The navigation controller is used to determine the display direction of the pop-up view according to the display interface direction of the client and control the rotation of the pop-up view.

[0021] According to another aspect of the present application, a pop-up window control method is provided, comprising:

[0022] When a preset pop-up window display event occurs, obtaining a pop-up window view configuration item corresponding to the preset pop-up window display event;

[0023] Using a view controller to construct a target view corresponding to the preset pop-up window display event, and configuring the target view as a pop-up window view according to the pop-up window view configuration item;

[0024] Calling a pop-up window view display method provided by the view controller through a pop-up window control unit, and controlling the display of the pop-up window view according to the pop-up window view display method;

[0025] When a closing event corresponding to the pop-up window view occurs, the pop-up window view closing method provided by the view controller is called by the pop-up window control unit, and the closing of the pop-up window view is controlled according to the pop-up window view closing method.

[0026] Optionally, after controlling the display of the pop-up window view according to the pop-up window view display method, the method further includes:

[0027] Add a weak reference to the displayed pop-up window view, and add the pop-up window view to the weak reference table;

[0028] Correspondingly, after controlling the closing of the pop-up window view according to the pop-up window view closing method, the method further includes:

[0029] Remove the pop-up view from the weak reference table.

[0030] Optionally, configuring the target view as a pop-up window view according to the pop-up window view configuration item specifically includes:

[0031] Add a listener to the input event in the target view by inheriting the base class, and configure the target view after adding the listener as a pop-up window view according to the pop-up window view configuration item;

[0032] Correspondingly, after configuring the target view as a pop-up window view according to the pop-up window view configuration item, the method further includes:

[0033] When the input event is monitored, the keyboard configuration item corresponding to the pop-up window view is determined through the view controller, a keyboard subview is constructed, and the keyboard pop-up window view is configured according to the keyboard configuration item;

[0034] The pop-up control unit is used to determine whether the input box of the pop-up view is blocked by the keyboard pop-up view based on the input box position corresponding to the pop-up view and the keyboard pop-up view display position, and if the input box is blocked, the pop-up view is moved and / or scaled.

[0035] Optionally, adding a weak reference to the displayed pop-up window view and adding the pop-up window view to a weak reference table specifically includes:

[0036] Determine a pop-up window function module identifier corresponding to the pop-up window view, and add the pop-up window view to a weak reference table corresponding to the pop-up window function module identifier;

[0037] Accordingly, removing the pop-up window view from the weak reference table specifically includes:

[0038] Remove the pop-up window view from the weak reference table corresponding to the pop-up window function module identifier.

[0039] Optionally, after adding the pop-up window view to the weak reference table corresponding to the pop-up window function module identifier, the method further includes:

[0040] When a closing event occurs for all pop-up views, the pop-up views are closed in sequence according to the order from the topmost pop-up view to the bottommost pop-up view corresponding to each weak reference table, and each weak reference table is cleared.

[0041] Optionally, after controlling the display of the pop-up window view according to the pop-up window view display method, the method further includes:

[0042] When receiving the input parameter corresponding to the pop-up window view, the pop-up window control unit determines the change parameter corresponding to the pop-up window view according to the pop-up window configuration item corresponding to the pop-up window view and the input parameter;

[0043] The pop-up window view is adjusted according to the change parameter.

[0044] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned pop-up window control method is implemented.

[0045] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned pop-up window control method when executing the program.

[0046] By means of the above technical scheme, the present application provides a pop-up window management system, a pop-up window control method, a storage medium, and a computer device. The pop-up window management system includes a pop-up window function module and a pop-up window management module connected through an interface. The pop-up window management module includes a view controller and a pop-up window control unit. The view controller uniformly provides a method for displaying and closing the pop-up window view to the outside, and configures the pop-up window view according to the pop-up window view configuration item set in the pop-up window function module. The pop-up window control unit calls the display and closing method of the pop-up window view to control the display and closing of the pop-up window view, and adds a weak reference to the displayed pop-up window view, and writes it into a weak reference table, so as to realize unified management of the pop-up window view based on the weak reference table. Compared with the method in the prior art in which each pop-up window function module manages its own pop-up window view, the embodiment of the present application provides a unified method for displaying and closing the pop-up window view to the outside through the view controller, avoiding the confusion of the pop-up window view window caused by the inconsistent display methods of each module, and the transition management class of the pop-up window control unit is responsible for the display and closing of the pop-up window view, supporting the native push and pop operation effects in the pop-up window view.

[0047] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0049] Figure 1 A schematic diagram of a pop-up window control method provided in an embodiment of the present application is shown;

[0050] Figure 2 A schematic diagram showing a flow chart of another pop-up window control method provided in an embodiment of the present application is shown;

[0051] Figure 3 A schematic diagram of the structure of a pop-up window control device provided in an embodiment of the present application is shown;

[0052] Figure 4 A schematic structural diagram of another pop-up window control device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0053] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0054] In this embodiment, a pop-up window management system is provided. Figure 1 As shown, the system comprises:

[0055] At least one pop-up window function module and a pop-up window management module, wherein the pop-up window management module is connected to the pop-up window function module through an API interface, the pop-up window management module includes a view controller and a pop-up window control unit, and the pop-up window control unit encapsulates a transition management class;

[0056] The pop-up window function module is used to set pop-up window view configuration items;

[0057] The view controller is used to provide a pop-up view display method and a pop-up view closing method, as well as to construct a target view, and configure the target view as a pop-up view according to the pop-up view configuration item;

[0058] The pop-up window control unit is used to call the pop-up window view display method provided by the view controller to control the display of the pop-up window view, and call the pop-up window view closing method provided by the view controller to control the closing of the pop-up window view.

[0059] In the embodiment of the present application, the pop-up window management system includes a pop-up window function module and a pop-up window management module, wherein the pop-up window function module can be named separately and independently complete a set of program statements of certain functions, such as live broadcast, login, promotion activities, etc. These functions all involve pop-up window pages and will be independently connected to the project as modules. Each page pre-sets pop-up window view configuration items, which can specifically include pop-up window view configuration information such as pop-up window view size, display direction, whether to add keyboard monitoring, etc.

[0060] The pop-up window management module may specifically include a view controller and a pop-up window control unit, and provide an external API interface to connect with the pop-up window function module, and realize the communication connection between the pop-up window management module and the pop-up window function module through the interface. In this embodiment, a view controller can be constructed by establishing a unified BaseViewController, and the view controller provides a unified view display and closing method. When a preset pop-up window display event occurs, that is, when an event that can trigger the pop-up window display occurs, the view controller can construct a target view to be displayed, wherein the target view refers to the window content page to be displayed, such as a survey page, and the view controller configures the target view to a pop-up window view that matches the size and display direction of the pop-up window view according to the pop-up window view configuration item, and passes the pop-up window view to the pop-up window control unit. The pop-up window control unit displays the pop-up window view by calling the pop-up window view display method provided by the view controller, and adds a weak reference to the displayed pop-up window view and adds it to the weak reference table to realize the unified management of the pop-up window view. In addition, when the pop-up window view needs to be closed, the pop-up window control unit can find the corresponding pop-up window view in the weak reference table, and call the pop-up window view closing method to remove the pop-up window view object from the weak reference table to ensure that the window is released correctly.

[0061] By applying the technical solution of this embodiment, the pop-up window management system includes a pop-up window function module and a pop-up window management module connected through an interface, and the pop-up window management module includes a view controller and a pop-up window control unit. The view controller uniformly provides a method for displaying and closing the pop-up window view to the outside, and configures the pop-up window view according to the pop-up window view configuration items set in the pop-up window function module. The pop-up window control unit calls the display and closing method of the pop-up window view to control the display and closing of the pop-up window view, and adds a weak reference to the displayed pop-up window view, and writes it into a weak reference table, so as to achieve unified management of the pop-up window view based on the weak reference table. Compared with the method in the prior art in which each pop-up window function module manages its own pop-up window view, the embodiment of the present application provides a unified method for displaying and closing the pop-up window view to the outside through the view controller, avoiding confusion of the pop-up window view window caused by inconsistent display methods of each module, and is responsible for displaying and closing the pop-up window view through the transition management class of the pop-up window control unit, supporting native push and pop operation effects in the pop-up window view.

[0062] In an embodiment of the present application, optionally, the pop-up window control unit is also used to add a weak reference to the pop-up window view displayed, add the pop-up window view to a weak reference table, and remove the closed pop-up window view from the weak reference table.

[0063] In this embodiment, the pop-up window control unit can also add a weak reference to the displayed pop-up window view while displaying the pop-up window view, and add the pop-up window view with the added weak reference to the weak reference table to achieve unified management of the pop-up window view. In addition, when the pop-up window view needs to be closed, the pop-up window control unit can find the corresponding pop-up window view in the weak reference table, call the pop-up view closing method, remove the pop-up view object from the weak reference table, and ensure that the window is released correctly. By adding a weak reference to the pop-up window view and writing it to the weak reference table, it is convenient to uniformly manage and destroy the pop-up window view.

[0064] In an embodiment of the present application, optionally, the view controller is also used to add a listener to a preset listener event in the target view by inheriting a base class, and when the preset listener event is detected, determine the sub-view configuration item corresponding to the pop-up view, construct a target sub-view, and configure the target sub-view as a bullet window view according to the sub-view configuration item; the pop-up control unit is also used to determine whether the preset display element is blocked based on the preset display element position corresponding to the pop-up view and the display position corresponding to the bullet window view, and when it is determined that the preset display element is blocked, adjust the pop-up view or the bullet window view.

[0065] In the above embodiment, the view controller can automatically add a listener for the preset listener event in the target view page. During the display of the pop-up view, if a preset listener event occurs, the pop-up view configuration item corresponding to the preset listener event, that is, the subview configuration item corresponding to the pop-up view is determined, and the target subview is constructed, and the bullet window view is configured. Furthermore, before displaying the bullet window view, it can also be determined whether the bullet window view will block some preset display elements that need to be displayed in the pop-up view. If blockage is caused, the display of the pop-up view or the bullet window view should be adjusted to ensure that these predetermined elements will not be blocked due to the display of the pop-up view.

[0066] Optionally, the preset listening event includes an input event; the view controller is specifically used to add a listener to the input event in the target view, and when the input event is listened to, determines the keyboard configuration item corresponding to the pop-up view, and constructs a keyboard subview, and configures the keyboard subview as a keyboard pop-up view according to the keyboard configuration item; the pop-up control unit is specifically used to determine whether the input box is blocked based on the position of the input box corresponding to the pop-up view and the display position of the keyboard pop-up view, and when it is determined that the input box is blocked, moves and / or scales the pop-up view.

[0067] In the above embodiment, taking the preset listening event as an input event as an example, the view controller can automatically add keyboard listening for all input events in the target view page. When the user performs input operations such as username and password, a keyboard pop-up window view will pop up. In order to ensure that the keyboard pop-up window view does not block the input box, it can calculate whether the input box is blocked based on the keyboard height, the size of the input box window pop-up window, and the view position of the input box window, and complete adjustment operations such as moving the input box pop-up window page up and down. Figure 2 As shown, when the user enters the password, the input box may be blocked. At this time, the coordinate system of the input box will be converted first. According to the input box window size and H1 (the bottom position of the input box), it is converted to the bottom position of the input box in the entire screen (H2). The size of H2 (the bottom coordinate of the input box) and H3 (the top coordinate of the keyboard) are compared. When H2 is greater than H3, it means that the input box is blocked and the entire input box window needs to be moved up by a distance of H2-H3. On the contrary, when H2 is less than or equal to H3, it means that the input box is not blocked and no processing is required. The keyboard subview in the pop-up main view can still use the native push and pop methods to complete page switching, and there is no need to process keyboard events.

[0068] In addition, the preset monitoring event can also be a click event, a gesture event, etc., for example Figure 2 When the keyboard pops up, the user can click on any blank space outside the input box and keyboard to retract the keyboard. Or add some special graphic gestures to the pop-up view page, and some prompts will pop up after the gesture is triggered, giving users a small surprise and increasing interactivity. It should be noted that the user can define whether the pop-up view can block the preset display elements in the pop-up view. If the pop-up view can block related elements, such as when the user triggers the display of special effects through a specific gesture, the special effects will automatically disappear in a short time. In this case, you can directly configure and display the pop-up view without judging whether the preset display elements are blocked.

[0069] In an embodiment of the present application, optionally, the pop-up function module is also used to configure a corresponding pop-up function module identifier; the pop-up control unit is also used to add the displayed pop-up view to a weak reference table corresponding to the pop-up function module identifier of the pop-up view, and when an instruction to close all pop-up views is received, the pop-up views are closed in sequence according to the order from the top-level pop-up view to the bottom-level pop-up view corresponding to each weak reference table, and each weak reference table is cleared.

[0070] In the above embodiment, a unique identifier, i.e., a pop-up window function module identifier, can be set for each pop-up window function module, so as to construct a weak reference table for each module according to the unique identifier, and add the pop-up window views corresponding to different pop-up window function modules to the weak reference table corresponding to the unique identifier of the module, so as to facilitate the management of the pop-up window view of each pop-up window function module. When actively triggering the closing of the pop-up view, the closing API interface provided by the pop-up window control unit is called, and the unique identifier of the pop-up window function module corresponding to the pop-up window view is passed in. According to the unique identifier of the module, the view object is found in the corresponding weak reference table, and the closing method is called for the view, and the pop-up window view object is removed from the weak reference table to ensure that the pop-up view is correctly released. All displayed pop-up window views can also be closed at one time through the interface provided by the pop-up window control unit. In this case, the closing operation can be performed in sequence from the top window to the bottom layer according to the order of adding the pop-up window views in each weak reference table, and each pop-up window view is closed in sequence, and the weak reference table is cleared. It should be noted that if the pop-up window function module identifier is not set, the displayed pop-up window view can be added to the global default weak reference for unified management.

[0071] In an embodiment of the present application, optionally, the pop-up window control unit is also used to receive input parameters corresponding to the pop-up window view, compare the input parameters with the pop-up window view configuration items, determine the change parameters corresponding to the pop-up window view, and adjust the pop-up window view according to the change parameters.

[0072] In the above embodiment, the pop-up view configuration item may specifically include parameters such as the window size, display position, and display direction of the pop-up view. The pop-up view can be configured and displayed according to the above parameters. In addition, the window size, display position, and display direction of the pop-up view can also be adjusted. After the pop-up view is displayed, the window view size can be dynamically adjusted through the transition management class. For example, the window size in the pop-up view configuration item is a full-screen display, and the window size can be changed according to user operations to convert it into a mini mode display. The user operation data, that is, the incoming parameters, can be specifically passed to the pop-up control unit through the pop-up function module, and the new window size is passed through the API interface provided by the transition management class. The transition management class will recalculate the size and position of the window and re-render the page. In a specific application scenario, the incoming parameters can include multiple types. For example, by passing in position parameters, the window position of the pop-up page can be freely changed.

[0073] Optionally, when the change parameter includes a window size scaling parameter of the pop-up view, the pop-up control unit keeps the center coordinate position of the pop-up view unchanged and scales the pop-up view according to the window size scaling parameter. The center coordinates of the scaled window and the original window are kept consistent to satisfy the switching between normal mode and mini mode. For example, when scaling a pop-up view that displays a live broadcast screen, the switching between the two modes can be completed by clicking a button on the live broadcast page. The center position of the window after switching remains consistent, which can reduce the abruptness caused by the position change after switching.

[0074] In the embodiment of the present application, optionally, it also includes: a navigation controller, which is used to determine the display direction of the pop-up view according to the display interface direction of the client, and control the rotation of the pop-up view.

[0075] In the above embodiment, a navigationController can be established to uniformly handle the display direction and rotation operation of the pop-up view. Specifically, the navigation controller can read the display direction of the current display interface and use the read direction as the display direction of the pop-up view. For example, for a horizontal screen game, the display direction of the pop-up view can be determined to be horizontal. In addition, the holding direction of the client, such as a mobile phone, can be obtained in real time. When the holding direction changes from horizontal to vertical, the pop-up page can also change from horizontal to vertical.

[0076] In this embodiment, a pop-up window control method is provided, which can be applied to the pop-up window management system mentioned above. Figure 3 As shown, the method includes:

[0077] Step 101, when a preset pop-up window display event occurs, obtaining a pop-up window view configuration item corresponding to the preset pop-up window display event;

[0078] Step 102, using a view controller to construct a target view corresponding to the preset pop-up window display event, and configuring the target view as a pop-up window view according to the pop-up window view configuration item;

[0079] Step 103, calling a pop-up window view display method provided by the view controller through a pop-up window control unit, and controlling the display of the pop-up window view according to the pop-up window view display method;

[0080] Step 104, when a closing event corresponding to the pop-up window view occurs, the pop-up window view closing method provided by the view controller is called by the pop-up window control unit, and the closing of the pop-up window view is controlled according to the pop-up window view closing method.

[0081] In the above embodiment, when a preset pop-up window display event occurs, that is, when an event that can trigger the pop-up window display occurs, the view controller can construct a target view to be displayed, configure the target view as a pop-up window view that matches the pop-up window view size, display direction, etc. according to the pop-up window view configuration item, and pass the pop-up window view to the pop-up window control unit. The pop-up window control unit displays the pop-up window view by calling the pop-up window view display method provided by the view controller, and at the same time adds a weak reference to the displayed pop-up window view and adds it to the weak reference table to achieve unified management of the pop-up window view. In addition, when it is necessary to close the pop-up window view, the pop-up window control unit can find the corresponding pop-up window view in the weak reference table, and call the pop-up window view closing method to remove the pop-up window view object from the weak reference table to ensure that the window is released correctly.

[0082] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another pop-up window control method is provided, such as Figure 4 As shown, the method includes:

[0083] Step 201, when a preset pop-up window display event occurs, obtaining a pop-up window view configuration item corresponding to the preset pop-up window display event;

[0084] Step 202, using a view controller to construct a target view corresponding to the preset pop-up window display event, and adding a listener to the input event in the target view by inheriting a base class, and configuring the target view after adding the listener as a pop-up window view according to the pop-up window view configuration item;

[0085] Step 203, calling the pop-up window view display method provided by the view controller through the pop-up window control unit, and controlling the display of the pop-up window view according to the pop-up window view display method; determining the pop-up window function module identifier corresponding to the pop-up window view, and adding the pop-up window view to the weak reference table corresponding to the pop-up window function module identifier;

[0086] In the above embodiment, the pop-up view configuration item may specifically include parameters such as the window size, display position, and display direction of the pop-up view. The pop-up view may be configured and displayed according to the above parameters. In addition, the window size, display position, and display direction of the pop-up view may also be adjusted. When a preset pop-up display event occurs, that is, an event that can trigger the pop-up display occurs, the corresponding pop-up view configuration item is obtained, and the view controller is used to construct the target view to be displayed, and the view controller can automatically add a listener to the preset listener event in the target view page by inheriting the base class. Furthermore, the view controller is used to configure the target view as a pop-up view that matches the pop-up view configuration item, and the pop-up view is passed into the pop-up control unit. The pop-up view display method provided by the view controller is called by the pop-up control unit to display the pop-up view. At the same time, a weak reference is added to the displayed pop-up view and added to the weak reference table to achieve unified management of the pop-up view. Specifically, a unique identifier, namely, a pop-up function module identifier, can be set for each pop-up function module, thereby constructing a weak reference table for each module based on the unique identifier, and adding the pop-up views corresponding to different pop-up function modules to the weak reference table corresponding to the unique identifier of the module, thereby facilitating the management of the pop-up views of each pop-up function module.

[0087] Step 204, when the input event is monitored, determine the keyboard configuration item corresponding to the pop-up window view through the view controller, build a keyboard subview, and configure it as a keyboard pop-up window view according to the keyboard configuration item;

[0088] Step 205, using the pop-up window control unit to determine whether the input box of the pop-up window view is blocked by the keyboard pop-up window view according to the input box position corresponding to the pop-up window view and the keyboard pop-up window view display position, and if the input box is blocked, move and / or scale the pop-up window view;

[0089] In the above embodiment, during the display of the pop-up view, if a preset listening event occurs, the pop-up view configuration item corresponding to the preset listening event is determined, that is, the sub-view configuration item corresponding to the pop-up view, and the target sub-view is constructed, as well as the bullet window view is configured. Furthermore, before displaying the bullet window view, it can also be determined whether the bullet window view will block some preset display elements that need to be displayed in the pop-up view. If obstruction is caused, the display of the pop-up view or the bullet window view should be adjusted to ensure that these predetermined elements will not be blocked due to the display of the pop-up view.

[0090] For example, when monitoring the user's input events such as username and password that trigger the pop-up keyboard pop-up view, in order to ensure that the keyboard pop-up view does not block the input box, you can calculate whether the input box is blocked based on the keyboard height, the input box window pop-up size, and the view position of the input box window, and complete adjustment operations such as moving the input box pop-up page up and down.

[0091] Step 206, when receiving the input parameter corresponding to the pop-up window view, the pop-up window control unit determines the change parameter corresponding to the pop-up window view according to the pop-up window configuration item corresponding to the pop-up window view and the input parameter; and adjusts the pop-up window view according to the change parameter;

[0092] In the above embodiment, after the pop-up view is displayed, the window view size can be dynamically adjusted through the transition management class. For example, the window size in the pop-up view configuration item is a full-screen display, and the window size can be changed according to the user operation to convert it into a mini mode display. The user operation data, that is, the incoming parameters, can be passed into the pop-up control unit through the pop-up function module, and the new window size is passed in through the API interface provided by the transition management class. The transition management class will recalculate the size and position of the window and re-render the page, that is, determine the change parameters, and use the change parameters to adjust the pop-up view. In a specific application scenario, the incoming parameters can include multiple types, such as freely changing the window position of the pop-up page by passing in the position parameters.

[0093] Step 207, when a closing event corresponding to the pop-up window view occurs, the pop-up window view closing method provided by the view controller is called by the pop-up window control unit, the pop-up window view is closed according to the pop-up window view closing method, and the pop-up window view is removed from the weak reference table corresponding to the pop-up window function module identifier;

[0094] Step 208, when a closing event occurs for all pop-up views, the pop-up views are closed in sequence according to the order from the topmost pop-up view to the bottommost pop-up view corresponding to each weak reference table, and each weak reference table is cleared.

[0095] In the above embodiment, when the closing of the pop-up view is actively triggered, that is, when the closing event corresponding to the pop-up view occurs, the closing API interface provided by the pop-up control unit can be called, and the unique identifier of the pop-up function module corresponding to the pop-up view is passed in. According to the unique identifier of the module, the view object is found in the corresponding weak reference table, and the closing method is called for the view, and the pop-up view object is removed from the weak reference table to ensure that the pop-up view is correctly released. In addition, when the closing event of all pop-up views is monitored, all displayed pop-up views can be closed at one time through the interface provided by the pop-up control unit. In this case, the closing operation can be performed in sequence from the top-level window to the bottom-level window according to the order in which the pop-up views are added in each weak reference table, and each pop-up view is closed in sequence, and the weak reference table is cleared.

[0096] Based on the above Figure 3 to Figure 4 The method shown in the embodiment of the present application accordingly provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 3 to Figure 4 The pop-up window control method shown.

[0097] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0098] Based on the above Figure 3 to Figure 4 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 3 to Figure 4 The pop-up window control method shown.

[0099] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.

[0100] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0101] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.

[0102] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for the implementation of the present application. The above serial numbers of the present application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited to this, and any changes that can be thought of by those skilled in the art should fall within the scope of protection of the present application.

Claims

1. A pop-up window management system, characterized in that: The system comprises: At least one pop-up window function module and a pop-up window management module, wherein the pop-up window management module is connected to the pop-up window function module through an API interface, the pop-up window management module includes a view controller and a pop-up window control unit, and the pop-up window control unit encapsulates a transition management class; The pop-up window function module is used to set pop-up window view configuration items; The view controller is used to provide a pop-up view display method and a pop-up view closing method, as well as to construct a target view, and configure the target view as a pop-up view according to the pop-up view configuration item; The pop-up window control unit is used to call the pop-up window view display method provided by the view controller to control the display of the pop-up window view, add a weak reference to the displayed pop-up window view and add the pop-up window view to the weak reference table, and call the pop-up window view closing method provided by the view controller to control the closing of the pop-up window view, and remove the closed pop-up view from the weak reference table.

2. The system according to claim 1, characterized in that The view controller is further used to add a listener to a preset listener event in the target view by inheriting a base class, and when the preset listener event occurs, determine the subview configuration item corresponding to the pop-up window view, build a target subview, and configure the target subview as a bullet window view according to the subview configuration item; The pop-up window control unit is also used to determine whether the preset display element is blocked based on the preset display element position corresponding to the pop-up window view and the display position corresponding to the bullet window view, and adjust the pop-up window view or the bullet window view when it is determined that the preset display element is blocked.

3. The system according to claim 2, characterized in that The preset monitoring event includes an input event; The view controller is specifically used to add a listener to the input event in the target view, and when the input event is listened to, determine the keyboard configuration item corresponding to the pop-up window view, build a keyboard subview, and configure the keyboard subview as a keyboard pop-up window view according to the keyboard configuration item; The pop-up control unit is specifically used to determine whether the input box is blocked based on the position of the input box corresponding to the pop-up view and the display position of the keyboard pop-up view, and move and / or scale the pop-up view when it is determined that the input box is blocked.

4. The system according to claim 1, characterized in that The pop-up window function module is also used to configure the corresponding pop-up window function module identifier; The pop-up control unit is also used to add the displayed pop-up view to a weak reference table corresponding to the pop-up function module identifier of the pop-up view, and when receiving an instruction to close all pop-up views, close the pop-up views in sequence according to the order from the top-level pop-up view to the bottom-level pop-up view corresponding to each weak reference table, and clear each weak reference table.

5. The system according to claim 1, characterized in that The pop-up window control unit is also used to receive the input parameters corresponding to the pop-up window view, compare the input parameters with the pop-up window view configuration items, determine the change parameters corresponding to the pop-up window view, and adjust the pop-up window view according to the change parameters.

6. The system according to claim 1, characterized in that The system further comprises: The navigation controller is used to determine the display direction of the pop-up view according to the display interface direction of the client and control the rotation of the pop-up view.

7. A pop-up window control method, characterized in that: include: When a preset pop-up window display event occurs, obtaining a pop-up window view configuration item corresponding to the preset pop-up window display event; Using a view controller to construct a target view corresponding to the preset pop-up window display event, and configuring the target view as a pop-up window view according to the pop-up window view configuration item; Calling a pop-up window view display method provided by the view controller through a pop-up window control unit, controlling the display of the pop-up window view according to the pop-up window view display method, adding a weak reference to the displayed pop-up window view, and adding the pop-up window view to a weak reference table; When a closing event corresponding to the pop-up view occurs, the pop-up view closing method provided by the view controller is called by the pop-up control unit, the pop-up view is closed according to the pop-up view closing method, and the pop-up view is removed from the weak reference table.

8. The method according to claim 7, characterized in that The configuring the target view as a pop-up window view according to the pop-up window view configuration item specifically includes: Add a listener to the input event in the target view by inheriting the base class, and configure the target view after adding the listener as a pop-up window view according to the pop-up window view configuration item; Correspondingly, after configuring the target view as a pop-up window view according to the pop-up window view configuration item, the method further includes: When the input event is monitored, the keyboard configuration item corresponding to the pop-up window view is determined through the view controller, a keyboard subview is constructed, and the keyboard pop-up window view is configured according to the keyboard configuration item; The pop-up control unit is used to determine whether the input box of the pop-up view is blocked by the keyboard pop-up view based on the input box position corresponding to the pop-up view and the keyboard pop-up view display position, and if the input box is blocked, the pop-up view is moved and / or scaled.

9. The method according to claim 7, characterized in that: The adding a weak reference to the displayed pop-up window view and adding the pop-up window view to a weak reference table specifically includes: Determine a pop-up window function module identifier corresponding to the pop-up window view, and add the pop-up window view to a weak reference table corresponding to the pop-up window function module identifier; Accordingly, removing the pop-up window view from the weak reference table specifically includes: Remove the pop-up window view from the weak reference table corresponding to the pop-up window function module identifier.

10. The method according to claim 9, characterized in that After adding the pop-up window view to the weak reference table corresponding to the pop-up window function module identifier, the method further includes: When a closing event occurs for all pop-up views, the pop-up views are closed in sequence according to the order from the topmost pop-up view to the bottommost pop-up view corresponding to each weak reference table, and each weak reference table is cleared.

11. The method according to claim 7, characterized in that After controlling the display of the pop-up window view according to the pop-up window view display method, the method further includes: When receiving the input parameter corresponding to the pop-up window view, the pop-up window control unit determines the change parameter corresponding to the pop-up window view according to the pop-up window configuration item corresponding to the pop-up window view and the input parameter; The pop-up window view is adjusted according to the change parameter.

12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 7 to 11 is implemented.

13. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 7 to 11 is implemented.

Citation Information

Patent Citations

  • Pop-up window display method and system

    CN113190776A

  • iOS multi-scene convenient pop-up window tool and device, computer equipment and storage medium

    CN113254133A