Floating window display method and device, equipment and storage medium
By carrying the suspended window function in the foreground process and using window tokens to realize view level switching, the problem that each process in the existing technology needs to develop suspended windows separately is solved, reducing development costs and optimizing the interactive experience.
Patent Information
- Application Number
- CN202411669952.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, the development of the suspended window function requires development of each process separately, resulting in high development costs.
By hosting the floating window function in the foreground process and using a window token to represent the view level of the display interface, the floating window can be switched in the display interface of different view levels.
It greatly reduces the development cost of floating windows, widens the application scope of floating windows, simplifies the steps of switching display of floating windows, and optimizes the interactive experience of the application.
Smart Images

Figure CN119621210A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for displaying a floating window. Background Art
[0002] A process is an independently running instance that has independent memory space and system resources and can execute tasks independently. Each process has its own memory space and system resources.
[0003] In the related art, a floating window will be displayed in the display interface of the foreground process. By independently developing the floating window function on the foreground process, the floating window can be displayed when the foreground process is started. If the display interface of other active processes is displayed on the display interface of the foreground process, then if the active process has developed the floating window function, the floating window will be displayed in the display interface of the active process. If the active process has not independently developed the floating window function, the floating window will not be displayed in the display interface of the active process. If the active process has not independently developed the floating window function, but the active process has the floating window permission authorized by the system, the floating window can also be displayed in the display interface of the active process.
[0004] However, the above method of independently developing a floating window for each process has a high development cost. Summary of the invention
[0005] The embodiment of the present application provides a method, device, equipment and storage medium for displaying a floating window. The technical solution provided by the embodiment of the present application is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for displaying a floating window is provided, the method comprising:
[0007] Displaying a foreground display interface of an application, wherein the foreground display interface is displayed based on a foreground process, and the foreground process is used to manage the foreground display process of the application;
[0008] In the case where the foreground process carries a floating window function, a floating window corresponding to the floating window function is displayed in the foreground display interface, and the floating window holds a window token of the foreground display interface, and the window token is used to identify the view level of the display interface;
[0009] After the first activity process is started, the first activity interface is overlaid on the foreground display interface, the first activity interface is displayed based on the first activity process, and the first activity process is different from the foreground process;
[0010] In a case where the floating window holds the window token of the first active interface, the floating window is displayed in the first active interface.
[0011] According to one aspect of an embodiment of the present application, a floating window display device is provided, the device comprising:
[0012] A foreground display module, used to display the foreground display interface of the application, wherein the foreground display interface is displayed based on the foreground process, and the foreground process is used to manage the foreground display process of the application;
[0013] A floating window display module, used for displaying a floating window corresponding to the floating window function in the foreground display interface when the foreground process carries the floating window function, wherein the floating window holds a window token of the foreground display interface, and the window token is used to identify the view level of the display interface;
[0014] A first display module, configured to overlay and display a first activity interface on the foreground display interface after the first activity process is started, wherein the first activity interface is displayed based on the first activity process, and the first activity process is different from the foreground process;
[0015] A floating window switching module is used to display the floating window in the first activity interface when the floating window holds the window token of the first activity interface.
[0016] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned floating window display method.
[0017] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned floating window display method.
[0018] According to one aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned floating window display method.
[0019] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0020] By using a window token to represent the view level of the display interface, when the floating window holds the window token of the foreground display interface, the view level of the floating window is the same as the view level of the foreground display interface, so that the floating window is displayed in the foreground display interface, and then when the first active interface is displayed on the foreground display interface, the floating window is switched to hold the window token of the first active interface, so that the view level of the floating window is the same as the view level of the first active interface, and the floating window is displayed in the first active interface. Compared with the related art that requires the development of a floating window function for each process separately, the technical solution provided by the present application switches the floating window to display interfaces of different view levels through the foreground process, which greatly reduces the development cost of the floating window, broadens the application scope of the floating window, simplifies the steps of switching the display of the floating window, and optimizes the interactive experience of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0022] Figure 2 is a flow chart of a method for displaying a floating window provided by an embodiment of the present application;
[0023] Figure 3 This is a schematic diagram of a floating window switching display in different display interfaces provided by an embodiment of the present application;
[0024] Figure 4 is a flow chart of a method for displaying a floating window provided by another embodiment of the present application;
[0025] Figure 5 This is a schematic diagram of multiple floating windows switched and displayed in different display interfaces provided by an embodiment of the present application;
[0026] Figure 6 is a flow chart of a method for displaying a floating window provided by another embodiment of the present application;
[0027] Figure 7 is a block diagram of a display device for a floating window provided by an embodiment of the present application;
[0028] Figure 8 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0030] Please refer to Figure 1, which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as a floating window display system. The solution implementation environment may include: a terminal device 10 and a server 20.
[0031] The number of terminal devices 10 can be one or more. The terminal device 10 can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a game console, an e-book reader, a multimedia player, a wearable device, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc.
[0032] The terminal device 10 may be installed with a client of an application program. The application program is an application program that runs based on a background process and a foreground process. The foreground process runs on the terminal device 10, and the background process can run on the terminal device 10 or on the server 20. The foreground process is used to implement interaction between the application program and the user. The foreground process of the application program is associated with the active process. The user can start the active process through the foreground process in the application program, so that the display interface of the active process will be covered on the display interface of the foreground process.
[0033] The application does not limit the type of application, including but not limited to music applications, video applications, social applications, game applications, web applications, etc. Optionally, the application can be an application that needs to be downloaded and installed, or an application that can be used instantly, which is not limited in the application.
[0034] The server 20 is used to provide background services for the client of the application program installed and running in the terminal device 10. For example, the server 20 can be the background server of the above application program. The server 20 can be an independent physical server, or a server cluster composed of multiple servers, or a cloud computing service center. Optionally, the server 20 provides background services for the application programs in multiple terminal devices 10 at the same time. The terminal device 10 and the server 20 can communicate with each other through the network.
[0035] In the related art, after the application is started, the foreground display interface of the application is displayed. If the foreground process carries the floating window function, the floating window is displayed in the foreground display interface. After the first active process is started, the first active interface is overlaid on the foreground display interface, and if the first active process carries the floating window function, the floating window is displayed in the first active interface. If the first active process does not carry the floating window function, the floating window is not displayed in the first active interface. If the active process does not independently develop the floating window function, but the active process has the floating window permission authorized by the system, the floating window can also be displayed in the display interface of the active process.
[0036] In the embodiment of the present application, after the application is started, the foreground display interface of the application is displayed. If the foreground process carries the floating window function, the floating window is displayed in the foreground display interface. At this time, the floating window holds the window token of the foreground display interface, and the window token is used to identify the view level of the display interface. After the first active process is started, the first active interface is overlaid on the foreground display interface. If the floating window is switched to hold the window token of the first active interface, the floating window is displayed in the first active interface.
[0037] Please refer to Figure 2 , which shows a flow chart of a method for displaying a floating window provided by an embodiment of the present application. The execution subject of each step of the method may be a terminal device. The method may include at least one of the following steps 210 to 240:
[0038] Step 210, displaying the foreground display interface of the application, the foreground display interface is displayed based on the foreground process, and the foreground process is used to manage the foreground display process of the application.
[0039] The terminal device is provided with a foreground process of the application, which is used to manage the foreground display process of the application, and is mainly used to realize the display of the application on the terminal device and the interaction between the application and the user. The background process of the application is a process running in the background, which can be run in the terminal device or in the server, and this application does not limit it. The foreground process needs to be run based on the interaction between the user and the terminal device, and the background process can still run without the interaction between the user and the terminal device.
[0040] In response to an operation on an application, the foreground display interface of the application is displayed on the terminal device based on the foreground process. The foreground display interface can be any display interface of the application. For example, in response to a startup operation on an application, the initial interface of the application is displayed, and the foreground display interface is the interface. For another example, in response to a trigger operation on any control in the initial interface, the display interface corresponding to the control is displayed, and the foreground display interface is the display interface corresponding to the control.
[0041] Step 220, when the foreground process carries the floating window function, a floating window corresponding to the floating window function is displayed in the foreground display interface. The floating window holds the window token of the foreground display interface, and the window token is used to identify the view level of the display interface.
[0042] Optionally, the floating window function can be a function set based on the application characteristics of the application, and the floating window function is related to the function of the application. For example, if the application is a music application, the floating window function can be music playback, music pause, music switching, lyrics display and other music-related functions. For another example, if the application is a social application, the floating window function can be information display, voice playback, voice call, video call and other social-related functions. Optionally, the floating window function can be a function widely used in any application, and the floating window function has nothing to do with the application characteristics of the application, and the floating window function is not specifically related to the function of the application. For example, the floating window function can be interface switching, interface screenshots, notification display, quick application and other functions applicable to any application.
[0043] The foreground process carries the floating window function, which means that the foreground process contains the program code of the floating window function, and the floating window function runs based on the foreground process. Since the floating window function is used to implement the operation of the floating window, when the floating window function is carried in the foreground process, the foreground process can manage the operation process of the floating window.
[0044] When the floating window function is carried in the foreground process, the floating window is displayed in the foreground display interface while the foreground display interface of the application is displayed.
[0045] The window token is used to identify the view level of the display interface. The window is a container of the view level, which is used to organize and manage different elements in the display interface. Each window has a corresponding window token, which is used to identify the view level of the window, and can also be understood as being used to identify the view level of the display interface. When there are multiple windows open in an application, such as dialog windows, active windows, pop-up windows, etc., each window has its own window token, which is used to identify the view level of each window. For example, when the display interface of the dialog window is overlaid on the display interface of the active window, the window token of the dialog window is different from the window token of the active window, and the view level of the dialog window is higher than the view level of the active window, that is, the view level of the display interface of the dialog window is higher than the view level of the display interface of the active window.
[0046] The window token of the foreground display interface is used to identify the view level of the foreground display interface. The floating window does not conform to the window characteristics, so the floating window itself does not have a window token. Since the floating window function is carried by the foreground process, the floating window holds the window token of the foreground display interface, so that the view level of the floating window is the same as the view level of the foreground display interface, and the floating window is displayed in the foreground display interface.
[0047] In some embodiments, the first foreground display interface of the application is displayed, and a floating window is displayed in the first foreground display interface. The first foreground display interface is any foreground display interface of the application, and the floating window holds the window token of the first foreground display interface. In response to a switching operation on the first foreground display interface, the first foreground display interface is switched to display the second foreground display interface, and a floating window is displayed in the second foreground display interface. The second foreground display interface is different from the first foreground display interface, and the floating window is switched to hold the window token of the second foreground display interface. It should be noted here that there is no association between the view level of the first foreground display interface and the view level of the second foreground display interface. The view level of the first foreground display interface can be higher than the view level of the second foreground display interface, or lower than the view level of the second foreground display interface, or equal to the view level of the second foreground display interface. This application does not limit this.
[0048] Step 230: After the first activity process is started, the first activity interface is overlaid on the foreground display interface. The first activity interface is displayed based on the first activity process, and the first activity process is different from the foreground process.
[0049] The first active process is a process different from the foreground process. The first active process is set in the terminal device, but the operation of the first active process and the operation of the foreground process are independent of each other. The foreground process can send a process start notification to the first active process to prompt the start of the first active process. After the first active process is started, the first activity interface is overlaid on the foreground display interface.
[0050] The first active process includes but is not limited to a music type active process, a video type active process, a game type active process, a live broadcast type active process, etc. The process type of the first active process may be different from the process type of the foreground process, or may be the same as the process type of the foreground process. For example, if the foreground process is the foreground process of a music application, the first active process may be an active process of another type, or may be an active process of a music type. If the first active process is an active process of a music type, then the first active process is an active process of a music type different from the foreground process.
[0051] For starting the first activity process, optionally, the first activity process may be started in response to a trigger operation on the first activity control. The first activity control is a start control of the first activity process, and the first activity control is displayed in the foreground display interface. The trigger operation on the first activity control may be a user clicking operation on the first activity control. After the user clicks the first activity control on the foreground display interface, the foreground process is triggered to send a process start notification to the first activity process, prompting the first activity process to start. After the first activity process starts, the first activity interface is overlaid on the foreground display interface.
[0052] Optionally, the startup of the first active process can also be self-starting. For example, the first active process can be set to self-start after the foreground process starts for a first time period, or the first active process can be set to self-start after the number of interactions between the foreground process and the user reaches a first threshold, or the first active process can be set to self-start at the same time as the foreground process starts, etc., which is not limited in this application. During the operation of the foreground process, after the first active process is self-started, the first activity interface is overlaid on the foreground display interface. Exemplarily, the first active process is an advertising type activity process, and the first activity process is automatically started 10 minutes after the foreground process is started. After the first activity process is started, the first activity interface is overlaid on the foreground display interface.
[0053] In some embodiments, after the first active process is started, the first active process is triggered to send a first switching instruction to the foreground process, the first switching instruction is used to prompt the foreground process to switch the window token held by the floating window, and the first switching instruction includes the window token of the first active interface. According to the first switching instruction, the foreground process is triggered to switch the window token of the foreground display interface held by the floating window to the window token of the first active interface.
[0054] The window token of the first active interface is used to identify the view level of the first active interface. Since the first active interface is displayed over the foreground display interface, the view level of the first active interface is higher than the view level of the foreground display interface. The first switching instruction is used to prompt the foreground process to switch the window token of the foreground display interface originally held by the floating window to the window token of the first active interface, that is, the first switching instruction changes the view level of the floating window from the view level of the foreground display interface where it was originally located to the view level of the first active interface, so that the floating window moves from the foreground display interface originally displayed to the first active interface.
[0055] If the first switching instruction includes the window token of the first active interface, the first active process sends the window token of the first active interface to the foreground process. After receiving the first switching instruction, the foreground process switches the window token of the foreground display interface held by the floating window to the window token of the first active interface.
[0056] By changing the window token held by the floating window, changing the view level of the floating window, and changing the view level of the floating window to the view level of the first active interface, the floating window is displayed in the first active interface, which simplifies the steps of switching the display of the floating window, greatly reduces the development cost of the floating window, and improves the user experience.
[0057] Step 240: When the floating window holds the window token of the first active interface, display the floating window in the first active interface.
[0058] When the floating window holds the window token of the first active interface, the view level of the floating window is the view level of the first active interface, so that the floating window is displayed in the first active interface.
[0059] The technical solution provided by the embodiment of the present application adopts a window token to represent the view level of the display interface, so that when the floating window holds the window token of the foreground display interface, the view level of the floating window is the same as the view level of the foreground display interface, so that the floating window is displayed in the foreground display interface, and then when the first active interface is displayed on the foreground display interface, the floating window is switched to hold the window token of the first active interface, so that the view level of the floating window is the same as the view level of the first active interface, and the floating window is displayed in the first active interface. Compared with the related art that requires the development of a floating window function for each process separately, the technical solution provided by the present application switches the floating window to be displayed in display interfaces of different view levels through the foreground process, which greatly reduces the development cost of the floating window, broadens the application scope of the floating window, simplifies the steps of switching the display of the floating window, and optimizes the interactive experience of the application.
[0060] Figure 3 A schematic diagram showing the switching display of a floating window in different display interfaces is shown. In display interface 1, the floating window holds the window token of display interface 1, so the view level of the floating window is the same as the view level of display interface 1, and the floating window is displayed in display interface 1. The view level of display interface 2 is different from the view level of display interface 1, and the view level of display interface 2 can be higher than the view level of display interface 1 or lower than the view level of display interface 1. Therefore, after the window token of display interface 1 held by the floating window is switched to the window token of display interface 2, the view level of the floating window is changed to the view level of display interface 2, so that the floating window is displayed in display interface 2.
[0061] In some embodiments, the above step 240 further includes step 250. Step 250 includes at least one step among sub-steps 251-253.
[0062] Sub-step 251, after the first activity process is closed, the first activity interface is restored to be displayed as the foreground display interface.
[0063] Regarding the closing of the first active process, optionally, if the first active process is started in response to a trigger operation on the first active control, the first active process is closed in response to a trigger operation on the second active control. The second active control is a closing control for the first active process, and the second active control is displayed in the first active interface. The trigger operation on the second active control may be a user clicking operation on the second active control, and after the user clicks the second active control on the first active interface, the closing of the first active process is triggered, and after the first active process is closed, the first active interface is closed, and the terminal device resumes displaying the first active interface as the foreground display interface.
[0064] Optionally, if the startup of the first active process is self-starting, the closing of the first active process is also self-closing. For example, if the first active process is set to self-start after the foreground process starts the first time period, the first active process can be set to self-close after the first active process starts the second time period, and the length of the second time period can be the same as or different from the length of the first time period. If the first active process is set to self-start after the number of interactions between the foreground process and the user reaches a first threshold, the first active process can be set to self-close after the number of interactions between the first active process and the user reaches a second threshold, and the second threshold can be the same as or different from the first threshold. If the first active process is set to self-start at the same time as the foreground process is started, the first active process can be set to self-close after the first active process starts the second time period, or it can be set to self-close after the number of interactions between the first active process and the user reaches the second threshold, and so on. This application does not limit this. During the operation of the first active process, after the first active process is self-closed, the terminal device restores the display of the foreground display interface from the first activity interface. Exemplarily, the first activity process is an advertisement type activity process, which is automatically started 10 minutes after the foreground process is started, and is automatically closed 10 minutes after the first activity process is started. Then, the terminal device restores the first activity interface to the foreground display interface.
[0065] Sub-step 252, triggering the foreground process to switch the window token of the first active interface held by the floating window to the window token of the foreground display interface.
[0066] The foreground process manages the running process of the floating window. Therefore, after closing the first activity interface, the foreground process will be triggered to switch the window token held by the floating window, and the window token of the first activity process held by the floating window will be switched to the window token of the foreground display interface.
[0067] Sub-step 253, when the floating window recovers the window token of the foreground display interface, the floating window is displayed in the foreground display interface.
[0068] When the floating window recovers to hold the window token of the foreground display interface, the view level of the floating window is restored to the view level of the foreground display interface, so that the floating window is displayed in the foreground display interface.
[0069] After the first active process is closed, the view level of the floating window is restored to the view level of the foreground display interface, so that the floating window is displayed in the foreground display interface, and free switching of the floating window between different view levels is achieved, which not only reduces the development cost of the floating window, but also further expands the application scope of the floating window.
[0070] In some embodiments, step 240 is followed by step 260. There is no order relationship between step 260 and step 250, and both are steps that can be performed after step 240. Step 260 includes at least one step of sub-steps 261-262.
[0071] Sub-step 261, in response to a start operation on a second active process, overlaying and displaying a second active interface on the first active interface, wherein the second active interface is displayed based on the second active process, and the second active process is different from both the foreground process and the first active process.
[0072] The second active process is a process different from both the foreground process and the first active process. The second active process is set in the terminal device, but the operation of the second active process is independent of the operation of the foreground process and the operation of the first active process. The first active process can send a process start notification to the second active process to prompt the start of the second active process. After the second active process is started, the second activity interface is displayed overlaid on the first activity interface.
[0073] The second active process includes, but is not limited to, a music-type active process, a video-type active process, a game-type active process, a live broadcast-type active process, etc. The process type of the second active process may be different from the process type of the foreground process and the process type of the first active process, or may be the same as the process type of the foreground process, or the same as the process type of the first active process. For example, if the foreground process is the foreground process of a music application and the first active process is a game-type active process, then the second active process may be another type of active process, or may be a music-type active process or a game-type active process. If the second active process is a music-type active process, then the second active process is a music-type active process different from the foreground process. If the second active process is a game-type active process, then the second active process is a game-type active process different from the first active process.
[0074] For starting the second activity process, optionally, the second activity process may be started in response to a trigger operation on a third activity control. The third activity control is a start control for the second activity process, and the third activity control is displayed in the first activity interface. The trigger operation on the third activity control may be a user clicking operation on the third activity control. After the user clicks the third activity control on the first activity interface, the first activity process is triggered to send a process start notification to the second activity process, prompting the second activity process to start. After the second activity process starts, the second activity interface is displayed overlaid on the first activity interface.
[0075] Optionally, the startup of the second activity process can also be self-starting. For example, the second activity process can be set to self-start after the first activity process is started for a third time period, or the second activity process can be set to self-start after the number of interactions between the first activity process and the user reaches a third threshold, or the second activity process can be set to self-start at the same time as the first activity process is started, and so on. This application is not limited to this. During the operation of the first activity process, after the second activity process is self-started, the second activity interface is displayed overlaid on the first activity interface. Exemplarily, the second activity process is an advertising type activity process, and the second activity process is automatically started 10 minutes after the first activity process is started. After the second activity process is started, the second activity interface is displayed overlaid on the first activity interface.
[0076] In some embodiments, after the second active process is started, the second active process is triggered to send a third switching instruction to the foreground process, the third switching instruction is used to prompt the foreground process to switch the window token held by the floating window, and the third switching instruction includes the window token of the second active interface. According to the third switching instruction, the foreground process is triggered to switch the window token of the first active interface held by the floating window to the window token of the second active interface.
[0077] Sub-step 262: displaying the floating window in the second active interface when the floating window holds the window token of the second active interface.
[0078] The window token of the second active interface is used to identify the view level of the second active interface. Since the second active interface is displayed over the first active interface, the view level of the second active interface is higher than the view level of the first active interface. The third switching instruction is used to prompt the foreground process to switch the window token of the first active interface originally held by the floating window to the window token of the second active interface, that is, the third switching instruction changes the view level of the floating window from the view level of the first active interface where it was originally located to the view level of the second active interface, so that the floating window moves from the originally displayed first active interface to the second active interface.
[0079] If the third switching instruction includes the window token of the second active interface, the second active process will send the window token of the second active interface to the foreground process. After receiving the third switching instruction, the foreground process will switch the window token of the first active interface held by the floating window to the window token of the second active interface.
[0080] When the floating window holds the window token of the second active interface, the view level of the floating window is the view level of the second active interface, so that the floating window is displayed in the second active interface.
[0081] The above method realizes moving the floating window to the second active interface when the second active interface is displayed overlaid on the first active interface, thereby realizing switching display of floating windows between multiple levels and expanding the functional application of floating windows.
[0082] In some embodiments, after the second active process is closed, the second active interface is restored to display as the first active interface, and the foreground process is triggered to switch the window token of the second active interface held by the floating window to the window token of the first active interface. When the floating window is restored to hold the window token of the first active interface, the floating window is displayed in the first active interface.
[0083] The switching of the window token held by the floating window is performed by the foreground process. If it is necessary to switch the window token held by the floating window to the window token of the display interface of other processes except the foreground process, the other process sends a switching instruction to the foreground process to prompt the foreground process to switch the window token held by the floating window, and the switching instruction contains the window token of the display interface of the other process. The foreground process switches the window token held by the floating window to the window token of the display interface of the other process according to the switching instruction. If it is necessary to switch the window token of the display interface of other processes except the foreground process to the window token of the foreground display interface, when closing other processes, it will directly trigger the foreground process to switch the window token of the display interface of other processes held by the floating window to the window token of the foreground display interface.
[0084] Please refer to Figure 4 , which shows a flow chart of a method for displaying a floating window provided by another embodiment of the present application. The execution subject of each step of the method may be a terminal device. The method may include at least one of the following steps 410 to 440:
[0085] Step 410, displaying the foreground display interface of the application, the foreground display interface is displayed based on the foreground process, and the foreground process is used to manage the foreground display process of the application.
[0086] Step 420, when there are multiple floating window functions in the foreground process, floating windows corresponding to the multiple floating window functions are displayed in the foreground display interface, and each floating window holds a window token of the foreground display interface.
[0087] Optionally, multiple floating window functions can be functions set based on the application characteristics of the application, or can be functions widely used in any application. They can also include functions set based on the application characteristics of the application, and functions widely used in any application. This application does not limit this.
[0088] When the foreground process carries multiple floating window functions, each floating window holds the window token of the foreground display interface, and the view level of each floating window is the same as the view level of the foreground display interface. Therefore, while displaying the foreground display interface of the application, multiple floating windows are displayed in the foreground display interface.
[0089] Step 430: After the third activity process is started, a third activity interface is overlaid on the foreground display interface. The third activity interface is displayed based on the third activity process, and the third activity process is different from the foreground process.
[0090] The third active process is a process different from the foreground process. The third active process is set in the terminal device, but the operation of the third active process is independent of the operation of the foreground process. The foreground process can send a process start notification to the third active process to prompt the start of the third active process. After the third active process is started, the third activity interface is overlaid on the foreground display interface.
[0091] The third active process includes but is not limited to a music type active process, a video type active process, a game type active process, a live broadcast type active process, etc. The process type of the third active process may be different from the process type of the foreground process, or may be the same as the process type of the foreground process. For example, if the foreground process is the foreground process of a music application, the third active process may be an active process of another type, or may be an active process of a music type. If the third active process is an active process of a music type, then the third active process is an active process of a music type different from the foreground process.
[0092] For starting the third active process, optionally, the third active process may be started in response to a trigger operation on a fourth active control. The fourth active control is a start control for the third active process, and the fourth active control is displayed in the foreground display interface. The trigger operation on the fourth active control may be a click operation on the fourth active control by the user. After the user clicks the fourth active control on the foreground display interface, the foreground process is triggered to send a process start notification to the third active process, prompting the third active process to start. After the third active process starts, the third activity interface is displayed overlaid on the foreground display interface.
[0093] Optionally, the startup of the third active process can also be self-starting. For example, the third active process can be set to self-start after the foreground process starts the fourth time period, or the third active process can be set to self-start after the number of interactions between the foreground process and the user reaches a fourth threshold, or the third active process can be set to self-start at the same time as the foreground process starts, etc., which is not limited in this application. During the operation of the foreground process, after the third active process is self-started, the third activity interface is overlaid on the foreground display interface. Exemplarily, the third active process is an advertising type activity process, and the third activity process is automatically started 10 minutes after the foreground process is started. After the third activity process is started, the third activity interface is overlaid on the foreground display interface.
[0094] In some embodiments, the third active process is triggered to send a second switching instruction to the foreground process, the second switching instruction is used to prompt the foreground process to switch the window token held by at least one floating window, the second switching instruction includes the window token of the third active interface, and at least one floating window has an associated relationship with the third active process. According to the second switching instruction, the foreground process is triggered to switch the window token of the foreground display interface held by at least one floating window to the window token of the third active interface.
[0095] The window token of the third active interface is used to identify the view level of the third active interface. Since the third active interface is displayed over the foreground display interface, the view level of the third active interface is higher than the view level of the foreground display interface. The second switching instruction is used to prompt the foreground process to switch the window token of the foreground display interface originally held by at least one floating window to the window token of the third active interface, that is, the second switching instruction changes the view level of at least one floating window from the view level of the foreground display interface where it was originally located to the view level of the third active interface, so that the at least one floating window is moved from the originally displayed foreground display interface to the third active interface.
[0096] If the second switching instruction includes the window token of the third active interface, the third active process will send the window token of the third active interface to the foreground process. After receiving the second switching instruction, the foreground process will switch the window token of the foreground display interface held by at least one floating window to the window token of the third active interface.
[0097] The at least one floating window mentioned above is a floating window that is associated with the third active process among the multiple floating windows. Optionally, the floating window that is associated with the third active process is related to the process characteristics of the third active process. Specifically, the function provided by the floating window that is associated with the third active process is related to the process characteristics of the third active process. For example, if the third active process is a music-type active process, the floating window that is associated with the third active process refers to a floating window that can provide music-related functions, such as a floating window that can provide a music playback function, a floating window that can provide a music pause function, a floating window that can provide a music switching function, etc. Optionally, the floating window that is associated with the third active process is set by the technical personnel, and this application does not limit it.
[0098] Step 440: Display at least one floating window in the third activity interface when at least one floating window among the multiple floating windows holds a window token of the third activity interface.
[0099] When at least one of the multiple floating windows holds the window token of the third active interface, the view level of the at least one floating window is the view level of the third active interface, so that the at least one floating window is displayed in the third active interface.
[0100] Figure 5 A schematic diagram showing multiple floating windows being switched and displayed in different display interfaces is shown. In display interface 1, both floating window 1 and floating window 2 hold the window token of display interface 1, so the view level of floating window 1 and the view level of floating window 2 are the same as the view level of display interface 1, and floating window 1 and floating window 2 are displayed in display interface 1. The view level of display interface 2 is different from the view level of display interface 1, and the view level of display interface 2 can be higher than the view level of display interface 1 or lower than the view level of display interface 1. Therefore, after the window token of display interface 1 held by floating window 2 is switched to the window token of display interface 2, the view level of floating window 2 is changed to the view level of display interface 2, so that floating window 2 is displayed in display interface 2. Since the window token of display interface 1 held by floating window 1 is not switched, the view level of floating window 1 is still the view level of display interface 1, so that floating window 1 is not displayed in display interface 2.
[0101] When displaying multiple floating windows in the foreground display interface, the window token held by at least one floating window with an associated relationship is switched, so that at least one floating window is displayed in the third activity interface, and the displayed floating window conforms to the process characteristics of the third activity process, thereby optimizing the interactive experience of the application.
[0102] In some embodiments, after the third activity process is closed, the third activity interface is restored to be displayed as the foreground display interface; the foreground process is triggered to switch the window token of the third activity interface held by at least one floating window to the window token of the foreground display interface; when at least one floating window is restored to hold the window token of the foreground display interface, multiple floating windows are displayed in the foreground display interface.
[0103] Please refer to Figure 6 , which shows a flow chart of a method for displaying a floating window provided by another embodiment of the present application. The execution subject of each step of the method may be a terminal device. The method may include at least one of the following steps 610 to 640:
[0104] Step 610, displaying the foreground display interface of the application, the foreground display interface is displayed based on the foreground process, and the foreground process is used to manage the foreground display process of the application.
[0105] Step 620: When the foreground process does not carry the floating window function, the floating window is not displayed in the foreground display interface.
[0106] Step 630, when the first activity process carries the floating window function, after the first activity process is started, the first activity interface is overlaid on the foreground display interface, and a floating window is displayed in the first activity interface, and the floating window holds the window token of the first activity interface.
[0107] The first active process carries the floating window function, which means that the first active process contains the program code of the floating window function, and the floating window function runs based on the first active process. Since the floating window function is used to realize the operation of the floating window, when the floating window function is carried in the first active process, the first active process can manage the operation process of the floating window. And since the floating window function is carried in the first active process, the floating window holds the window token of the first active interface, so that the view level of the floating window is the same as the view level of the first active interface, and the floating window is displayed in the first active interface.
[0108] In some embodiments, a display interface of a first active process is displayed, and a floating window is displayed in the first active interface. The one display interface is any display interface of the first active process, and the floating window holds a window token of the one display interface. In response to a switching operation on the one display interface, the one display interface is switched to display another display interface, and a floating window is displayed in the other display interface. The other display interface is different from the one display interface, and the floating window is switched to hold a window token of the other display interface. It should be noted here that there is no association between the view level of one display interface and the view level of another display interface. The view level of one display interface can be higher than the view level of another display interface, or lower than the view level of another display interface, or equal to the view level of another display interface. This application does not limit this.
[0109] Step 640: After the first activity process is closed, the first activity interface is restored to be displayed as the foreground display interface, and the floating window is not displayed in the foreground display interface.
[0110] After the first activity process is closed, the floating window function can no longer be switched, so after the first activity interface is restored to be displayed as the foreground display interface, the floating window is not displayed in the foreground display interface.
[0111] The specific process of step 640 may refer to the above embodiment and will not be introduced again here.
[0112] By carrying the floating window function in the first active process when the foreground process does not carry the floating window function, the floating window is displayed only after the first active process is started, which can meet the usage needs of some users and improve the interactive experience of some users.
[0113] In some embodiments, the floating window function can be carried by a background process, and neither the foreground process nor the first active process carries the floating window function. After the first active process is started, the first active interface is displayed on the foreground display interface, triggering the first active process to send the window token of the first active interface to the background process, and the background process switches the window token held by the floating window to the window token of the first active interface, and then the floating window is displayed in the first active interface. After the first active process is closed, the foreground process is triggered to send the window token of the foreground display interface to the background process, and the background process switches the window token of the first active interface held by the floating window to the window token of the foreground display interface, and then the floating window is displayed in the foreground display interface.
[0114] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0115] Please refer to Figure 7 , which shows a block diagram of a floating window display device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned floating window display method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the terminal device described above, or it can be set in the terminal device. Figure 7 As shown, the device 700 may include: a foreground display module 710, a floating window display module 720, a first display module 730 and a floating window switching module 740.
[0116] The foreground display module 710 is used to display the foreground display interface of the application. The foreground display interface is displayed based on the foreground process. The foreground process is used to manage the foreground display process of the application.
[0117] The floating window display module 720 is used to display a floating window corresponding to the floating window function in the foreground display interface when the foreground process carries the floating window function. The floating window holds the window token of the foreground display interface, and the window token is used to identify the view level of the display interface.
[0118] The first display module 730 is used to overlay and display a first activity interface on the foreground display interface after the first activity process is started, wherein the first activity interface is displayed based on the first activity process, and the first activity process is different from the foreground process.
[0119] The floating window switching module 740 is configured to display the floating window in the first active interface when the floating window holds the window token of the first active interface.
[0120] In some embodiments, the apparatus 700 further includes a token switching module, wherein the token switching module is configured to:
[0121] Triggering the first active process to send a first switching instruction to the foreground process, where the first switching instruction is used to prompt the foreground process to switch the window token held by the floating window, and the first switching instruction includes the window token of the first active interface;
[0122] According to the first switching instruction, the foreground process is triggered to switch the window token of the foreground display interface held by the floating window to the window token of the first active interface.
[0123] In some embodiments, the apparatus 700 further includes a recovery display module, wherein the recovery display module is configured to:
[0124] After the first activity process is closed, the first activity interface is restored to be displayed as the foreground display interface;
[0125] Triggering the foreground process to switch the window token of the first active interface held by the floating window to the window token of the foreground display interface;
[0126] When the floating window recovers the window token of the foreground display interface, the floating window is displayed in the foreground display interface.
[0127] In some embodiments, the apparatus 700 further includes a second display module, wherein the second display module is configured to:
[0128] In response to a start operation on a second active process, overlaying and displaying a second active interface on the first active interface, wherein the second active interface is displayed based on the second active process, and the second active process is different from both the foreground process and the first active process;
[0129] In a case where the floating window holds the window token of the second activity interface, the floating window is displayed in the second activity interface.
[0130] In some embodiments, the device 700 further includes a floating window selection and display module, and the floating window selection and display module is used to:
[0131] In the case where the foreground process carries multiple floating window functions, the floating windows corresponding to the multiple floating window functions are displayed in the foreground display interface, and each of the floating windows holds a window token of the foreground display interface;
[0132] After the third activity process is started, a third activity interface is displayed overlaid on the foreground display interface, wherein the third activity interface is displayed based on the third activity process, and the third activity process is different from the foreground process;
[0133] When at least one floating window among the plurality of floating windows holds a window token of the third active interface, the at least one floating window is displayed in the third active interface.
[0134] In some embodiments, the floating window selection display module is used to:
[0135] Triggering the third active process to send a second switching instruction to the foreground process, the second switching instruction is used to prompt the foreground process to switch the window token held by the at least one floating window, the second switching instruction includes the window token of the third active interface, and the at least one floating window is associated with the third active process;
[0136] According to the second switching instruction, the foreground process is triggered to switch the window token of the foreground display interface held by the at least one floating window to the window token of the third active interface.
[0137] In some embodiments, the floating window display module 720 is further used to:
[0138] In the case where the foreground process does not carry the floating window function, the floating window is not displayed in the foreground display interface;
[0139] In the case where the floating window function is carried in the first activity process, after the first activity process is started, the first activity interface is overlaid and displayed on the foreground display interface, and the floating window is displayed in the first activity interface, and the floating window holds the window token of the first activity interface;
[0140] After the first activity process is closed, the first activity interface is restored to be displayed as the foreground display interface, and the floating window is not displayed in the foreground display interface.
[0141] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0142] Please refer to Figure 8 , which shows a block diagram of a computer device 800 provided in one embodiment of the present application. The computer device 800 may be any electronic device with data calculation, processing and storage functions. The computer device 800 may be used to implement the floating window display method provided in the above embodiment.
[0143] Typically, the computer device 800 includes a processor 801 and a memory 802 .
[0144] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI processor for processing computing operations related to machine learning.
[0145] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned floating window display method.
[0146] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the computer device 800, and the computer device 800 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.
[0147] In an illustrative embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor of a computer device, the floating window display method is implemented. Optionally, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0148] In an exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned floating window display method.
[0149] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0150] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for displaying a floating window, characterized in that: The method comprises: Displaying a foreground display interface of an application, wherein the foreground display interface is displayed based on a foreground process, and the foreground process is used to manage the foreground display process of the application; In the case where the foreground process carries a floating window function, a floating window corresponding to the floating window function is displayed in the foreground display interface, and the floating window holds a window token of the foreground display interface, and the window token is used to identify the view level of the display interface; After the first activity process is started, the first activity interface is overlaid on the foreground display interface, the first activity interface is displayed based on the first activity process, and the first activity process is different from the foreground process; In a case where the floating window holds the window token of the first active interface, the floating window is displayed in the first active interface.
2. The method according to claim 1, characterized in that In the case where the floating window holds the window token of the first active interface, before displaying the floating window in the first active interface, the method further includes: Triggering the first active process to send a first switching instruction to the foreground process, where the first switching instruction is used to prompt the foreground process to switch the window token held by the floating window, and the first switching instruction includes the window token of the first active interface; According to the first switching instruction, the foreground process is triggered to switch the window token of the foreground display interface held by the floating window to the window token of the first active interface.
3. The method according to claim 1, characterized in that The method further comprises: After the first activity process is closed, the first activity interface is restored to be displayed as the foreground display interface; Triggering the foreground process to switch the window token of the first active interface held by the floating window to the window token of the foreground display interface; When the floating window recovers the window token of the foreground display interface, the floating window is displayed in the foreground display interface.
4. The method according to claim 1, characterized in that: The method further comprises: In response to a start operation on a second active process, overlaying and displaying a second active interface on the first active interface, wherein the second active interface is displayed based on the second active process, and the second active process is different from both the foreground process and the first active process; In a case where the floating window holds the window token of the second activity interface, the floating window is displayed in the second activity interface.
5. The method according to claim 1, characterized in that The method further comprises: In the case where the foreground process carries multiple floating window functions, the floating windows corresponding to the multiple floating window functions are displayed in the foreground display interface, and each of the floating windows holds a window token of the foreground display interface; After the third activity process is started, a third activity interface is displayed overlaid on the foreground display interface, wherein the third activity interface is displayed based on the third activity process, and the third activity process is different from the foreground process; When at least one floating window among the plurality of floating windows holds a window token of the third active interface, the at least one floating window is displayed in the third active interface.
6. The method according to claim 5, characterized in that In the case where at least one of the plurality of floating windows holds the window token of the third active interface, before displaying the at least one floating window in the third active interface, the method further includes: Triggering the third active process to send a second switching instruction to the foreground process, the second switching instruction is used to prompt the foreground process to switch the window token held by the at least one floating window, the second switching instruction includes the window token of the third active interface, and the at least one floating window is associated with the third active process; According to the second switching instruction, the foreground process is triggered to switch the window token of the foreground display interface held by the at least one floating window to the window token of the third active interface.
7. The method according to claim 1, characterized in that The method further comprises: In the case where the foreground process does not carry the floating window function, the floating window is not displayed in the foreground display interface; In the case where the floating window function is carried in the first activity process, after the first activity process is started, the first activity interface is overlaid and displayed on the foreground display interface, and the floating window is displayed in the first activity interface, and the floating window holds the window token of the first activity interface; After the first activity process is closed, the first activity interface is restored to be displayed as the foreground display interface, and the floating window is not displayed in the foreground display interface.
8. A floating window display device, characterized in that: The device comprises: A foreground display module, used to display the foreground display interface of the application, wherein the foreground display interface is displayed based on the foreground process, and the foreground process is used to manage the foreground display process of the application; A floating window display module, used for displaying a floating window corresponding to the floating window function in the foreground display interface when the foreground process carries the floating window function, the floating window holding the window token of the foreground display interface, and the window token is used to identify the view level of the display interface; A first display module, configured to overlay and display a first activity interface on the foreground display interface after the first activity process is started, wherein the first activity interface is displayed based on the first activity process, and the first activity process is different from the foreground process; A floating window switching module is used to display the floating window in the first activity interface when the floating window holds the window token of the first activity interface.
9. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the floating window display method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the floating window display method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product includes a computer program, and the computer program is loaded and executed by a processor to implement the floating window display method according to any one of claims 1 to 7.