Mobile display method and device of suspension assembly, electronic equipment and medium
By adjusting the parent container of the floating component to full-screen size and determining the target position within the parent container, the problem of high system consumption during the movement of the floating component is solved, resulting in smoother movement operations and a better user experience.
Patent Information
- Application Number
- CN202511337881.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-12-26
AI Technical Summary
The movement of traditional floating components leads to high system process consumption, and frequent inter-process communication causes lag and delay.
When a movement operation is received, the size of the parent container corresponding to the floating component is adjusted to the full-screen size, and the target position parameters are determined within the parent container. This reduces frequent interactions with the system-level window manager and simplifies position determination through linear calculation and touch point mapping logic.
It reduces system resource consumption, improves the smoothness and responsiveness of floating component movement, reduces position update latency, and enhances user experience.
Smart Images

Figure CN121209752A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display technology, and more specifically, to a method, apparatus, electronic device, and medium for moving a suspended component in the field of display technology. Background Technology
[0002] A floating ball is a way to quickly access and operate applications provided by some smart terminal systems. It usually appears on the screen as a small circular icon. Users can click to expand customizable menus or toolbars. A variety of convenient operation functions can be achieved using the floating ball.
[0003] Once the floating ball is displayed on the desktop, users may need to move its position, which involves dragging it. Traditional methods of dragging the floating ball require frequent updates to its position via the window manager, resulting in excessive inter-process communication between the system process and the floating ball process, leading to high system resource consumption.
[0004] Therefore, how to implement movement operations on floating components to reduce system process consumption is an urgent problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, electronic device, and medium for moving a floating component. The method can reduce system process consumption during the movement of the floating component, thereby improving the responsiveness of moving the floating component and reducing the delay in updating the position of the floating component.
[0006] Firstly, a method for moving and displaying a floating component is provided, the method comprising: When a movement operation is received on the floating component on the display interface, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface. The parent container is used to constrain the display range of the floating component. Based on the operation information corresponding to the movement operation, determine the target position parameters of the floating component in the parent container; Based on the target position parameters, a floating component is displayed in the display interface.
[0007] In the above technical solution, upon receiving a movement operation for the floating component, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface; the target position parameters of the floating component within the parent container are determined, and then the floating component is displayed based on the target position parameters. Compared to existing technologies, where the position needs to be updated through the window manager every time the floating component moves, leading to frequent inter-process communication between the application process of the floating component and the system process of the window manager, this solution only expands the parent container to full screen at the start of the movement operation. All position parameter updates during the movement are completed within the parent container, eliminating the need for frequent interaction with the system-level window manager. This avoids stuttering caused by frequent inter-process communication and improves the smoothness of the floating component movement process. Furthermore, after making the parent container full-screen, the position change of the floating component only exists within the parent container. The window manager does not need to perceive changes within the parent container, avoiding frequent full-screen redraws caused by the window manager frequently receiving new positions, thus reducing processor resource consumption.
[0008] In conjunction with the first aspect, in some possible implementations, the method also includes: Get the initial position parameters of the floating component in the parent container; Based on the operation information corresponding to the movement operation, determine the target position parameters of the floating component in the parent container, including: Based on the initial position parameters and the displacement vector in the operation information, the target position parameters of the suspended component in the parent container are determined.
[0009] In the above technical solution, the initial position parameters of the floating component are used as the calculation benchmark. Combined with the displacement vector in the operation information, the linear calculation of the initial position parameters and displacement vector ensures that the component's movement trajectory is completely matched with the user's operation intention. This avoids position drift errors that may be caused by the cumulative displacement based on the real-time position, improves the accuracy of determining the updated position parameters of the floating component, realizes the dynamic position adjustment of the floating component, and enhances the user experience.
[0010] Combining the first aspect and the above implementation methods, in some possible implementation methods, the target position parameters of the floating component in the parent container are determined based on the operation information corresponding to the movement operation, including: Based on the operation information corresponding to the movement operation, determine the position parameters of the current touch point; The target position parameter of the floating component in the parent container is determined to be the position parameter of the current touch point.
[0011] In the above technical solution, since the size of the parent container is the full screen size, the device also collects the position parameters of the touch point based on the coordinate system of the full screen size. Therefore, the target position parameters of the floating component are determined directly according to the mapping logic between the touch point position and the target position of the floating component. This simplifies the interaction link to the greatest extent, eliminates the need for position parameter calculation, improves the efficiency of determining the target position parameters, and enables the floating component to move more quickly, avoiding the user feeling that the movement is sluggish and further improving the user experience.
[0012] In combination with the first aspect and the above implementation methods, in some possible implementations, the method further includes: When the move operation ends, the size of the parent container is adjusted from the full-screen size to the target size so that the parent container coincides with the floating component, where the target size is the current size of the floating component.
[0013] In the above technical solution, after the movement operation ends, the parent container shrinks from full-screen size to the component size and overlaps with the floating component. Users can operate the underlying content without closing the floating component, improving multitasking efficiency. The floating component's display does not interfere with operations on other interfaces. Furthermore, this process does not require destroying the parent container. When the floating component is moved again, the parent container's size can be adjusted back to full-screen size, avoiding resource waste caused by repeatedly creating and destroying containers. In addition, when multiple floating components exist on the interface simultaneously, each component's parent container only matches its own size, avoiding overlapping conflicts between full-screen containers. This allows multiple components to be laid out independently without interference, improving the interface's flexibility and scalability.
[0014] In combination with the first aspect and the above implementation methods, in some possible implementations, the method further includes: Upon receiving a launch operation from the target application, initialize the parent container corresponding to the floating component of the target application and cache the parent container in the view pool of the target application. When a movement operation is received on a floating component on the display interface, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface, including: When a move operation is received on the floating component corresponding to the target application on the display interface, the parent container in the view pool is called and the floating component is added as a child view of the parent container. Adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface.
[0015] In the above technical solution, when the target application starts, the parent container corresponding to the floating component is initialized and pre-stored. Subsequently, the parent container is directly called from the view pool, avoiding the repeated creation of new containers and the frequent allocation and reclamation of memory caused by destroying containers after use, thus reducing the risk of memory fragmentation. At the same time, by completing the creation of the parent container in advance, the time required to create the parent container when the floating component moves is saved, reducing the latency during the movement of the floating component, making the movement of the floating component smoother, and improving the user experience.
[0016] Combining the first aspect and the above implementation methods, in some possible implementations, when a movement operation on a floating component on the display interface is received, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface, including: When a move operation is received on a floating component on the display interface, the target interface of the window manager is called, where the target interface is used to adjust the size of the parent container; The target interface is used to adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface.
[0017] In the above technical solution, the physical boundaries of the screen are dynamically identified through the target interface of the window manager to determine the effective full-screen size visible to the user. This eliminates the need for manual monitoring of display mode changes and automatically updates the full-screen size accordingly. The full-screen size is then set to the size of the parent container, ensuring consistency between the parent container's size and the device's actual full-screen size. This prevents abnormal display of floating components due to size mismatches. Furthermore, the target interface of the window manager encapsulates the differences in full-screen size definitions across different system versions and device manufacturers. Developers no longer need to perform separate adaptations for each version or manufacturer; they can obtain a unified full-screen size conforming to the current system rules simply by calling the interface, reducing system development costs.
[0018] In combination with the first aspect and the above implementation methods, in some possible implementations, the method further includes: When the move operation ends, the current position parameter of the floating component is sent to the window manager so that the window manager updates the position parameter of the floating component to the current position parameter.
[0019] In the above technical solution, upon completion of the movement operation of the floating component, the current position parameter of the floating component after movement is sent to the window manager for parameter update. This avoids layout chaos caused by only updating the position of the component itself and lacking system-level conflict verification. Furthermore, synchronizing the position parameter to the system-level window manager only at the end of the movement operation reduces the number of inter-process communications between system processes and application processes, lowers system consumption during the movement of the floating component, avoids lag caused by frequent inter-process communication, and improves the efficiency of floating component movement and display.
[0020] Secondly, a movable display device with a floating component is provided, the device comprising: The processing module is used to adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface when a movement operation is received on the floating component on the display interface. The parent container is used to constrain the display range of the floating component. Based on the operation information corresponding to the movement operation, the target position parameters of the floating component in the parent container are determined. The display module is used to display floating components in the display interface based on the target position parameters.
[0021] In conjunction with the second aspect, in some possible implementations, the processing module is also used to obtain the initial position parameters of the floating component in the parent container; based on the initial position parameters and the displacement vector in the operation information, the target position parameters of the floating component in the parent container are determined.
[0022] In combination with the second aspect and the above implementation methods, in some possible implementation methods, the processing module is also used to determine the position parameters of the current touch point based on the operation information corresponding to the movement operation; and to determine the target position parameters of the floating component in the parent container as the position parameters of the current touch point.
[0023] In conjunction with the second aspect and the above implementation methods, in some possible implementation methods, the processing module is also used to adjust the size of the parent container from the full-screen size to the target size when the movement operation ends, so that the parent container coincides with the floating component, wherein the target size is the current size of the floating component.
[0024] In combination with the second aspect and the above implementation methods, in some possible implementation methods, the processing module is also used to initialize the parent container corresponding to the floating component of the target application when receiving the launch operation of the target application, and cache the parent container in the view pool of the target application; when receiving the move operation of the floating component corresponding to the target application on the display interface, call the parent container in the view pool and add the floating component as a child view of the parent container; and adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface.
[0025] In combination with the second aspect and the above implementation methods, in some possible implementation methods, the processing module is also used to call the target interface of the window manager when it receives a movement operation on the floating component on the display interface, wherein the target interface is used to adjust the size of the parent container; through the target interface, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface.
[0026] In combination with the second aspect and the above implementation methods, in some possible implementation methods, the processing module is also used to send the current position parameter of the floating component to the window manager when the movement operation ends, so that the window manager updates the position parameter of the floating component to the current position parameter.
[0027] Thirdly, an electronic device is provided, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the electronic device to perform the methods of the first aspect or any possible implementation thereof.
[0028] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0029] Fifthly, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation thereof. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of a suspension component provided in an embodiment of this application; Figure 2 This is a schematic flowchart illustrating a method for moving and displaying a floating component according to an embodiment of this application; Figure 3 This is a schematic diagram of a parent container provided in an embodiment of this application; Figure 4 This is a schematic diagram illustrating the movement process of a suspended ball according to an embodiment of this application; Figure 5 This is a schematic diagram illustrating the movement process of another suspended ball provided in an embodiment of this application; Figure 6 This is a schematic flowchart of another method for moving and displaying a floating component provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a mobile display device with a floating component provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0031] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0032] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0033] In traditional devices, setting function parameters requires users to open a specific settings program, search for relevant functions, and then modify the parameters. This process involves multiple steps and is relatively cumbersome. Furthermore, users may need to view multiple application interfaces simultaneously, but they can only switch between them in the background, making it difficult to view multiple interfaces at once, resulting in low convenience and flexibility. To improve operational efficiency and simplify function access paths, device manufacturers have designed a floating component. This component can float on top of existing interfaces, solving problems such as long function access paths, difficulty in accessing key information, and fragmented operations in multi-tasking scenarios inherent in traditional interface layouts.
[0034] Figure 1 This is a schematic diagram of a suspension component provided in an embodiment of this application. For example... Figure 1 As shown in (a), the floating component can be in the form of a floating ball. Using the floating ball, users can quickly return to the previous screen, return to the home screen, access the multitasking background, take screenshots, lock the screen, and perform other operations. It can also quickly launch frequently used applications, switch to recently used applications, adjust volume and brightness, and on some phones, the floating ball also supports screen recording and turning on the flashlight. For example... Figure 1 As shown in (b), the floating component can also be in the form of a floating window. The floating window allows users to quickly view and operate other applications or frequently used functions without exiting the current operation, such as replying to messages or controlling music playback. It can also push notifications in real time and continuously display information that needs to be checked frequently, such as stocks and weather, thereby reducing the cumbersomeness of switching applications and improving the convenience of operation and the efficiency of information acquisition.
[0035] When a floating component is displayed on the screen, the user can move or drag it to move it to the desired position. Traditionally, controlling the movement of a floating component involves using the WindowManager, a system-level window management service. The position of the floating component is determined by its horizontal (x) and vertical (y) coordinates in the layout parameters (LayoutParams). When the position needs to be updated, the application process calculates the new coordinates, updates the target position, and then calls the position update interface in the WindowManager to initiate a position update request. This causes the system to recalculate and redraw the floating component's position for real-time refresh. Because the application process continuously sends coordinate information to the WindowManager system process and verifies the new position of the floating component, frequent inter-process communication (IPC) is required during the movement. This can lead to processor overload (CPU or GPU) during position updates, and a significant drop in frame rate during fast dragging or moving.
[0036] In view of the problems existing in the prior art, this application provides a method, apparatus, electronic device, and medium for moving and displaying a floating component. When the method receives a user's movement operation on a floating component on the display interface, it first adjusts the size of the parent container corresponding to the floating component to the full-screen size of the display interface; then, based on the operation information corresponding to the movement operation, it determines the target position parameters of the floating component in the parent container, and displays the floating component on the display interface according to the target position parameters. This method reduces inter-process interaction between the floating component and the window manager, thereby improving the responsiveness to movement operations on the floating component, reducing latency when updating the floating component's position, and enhancing the user experience.
[0037] The following is combined with Figures 2 to 6 The method for moving and displaying a floating component provided in the embodiments of this application will be described in detail.
[0038] Figure 2 This is a schematic flowchart illustrating a method for moving a floating component according to an embodiment of this application. It should be understood that this method can be applied to an electronic device; or, to a processor in an electronic device; or, to a chip in a processor integrated into an electronic device.
[0039] For example, such as Figure 2 As shown, the method 200 includes: S201, when a movement operation is received on the floating component on the display interface, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface, wherein the parent container is used to constrain the display range of the floating component.
[0040] In this context, the parent container of the floating component is a transparent container. A parent container is a container-type component that can contain and manage other views (views / components). From the user's perspective, the parent container is invisible, while the floating component is visible.
[0041] For example, users can enable the display of a floating component of a target function (such as a quick settings function, a return to the desktop function, etc.) or a target application (video application, music application, chat application, etc.) through channels such as settings.
[0042] For example, a floating component has a corresponding parent container. After the floating component is displayed on the screen, the user can perform a position movement operation on the floating component, which can also be called a drag operation. When the device receives the user's movement operation on the floating component, it adjusts the size of the parent container corresponding to the floating component to match the full-screen size of the display interface.
[0043] For example, before receiving a move operation, the size of the parent container corresponding to the floating component can be the same as the size of the floating component. When the move operation is received, the size of the parent container is adjusted from the size of the floating component to the full-screen size of the display interface.
[0044] For example, the display size of a display device is typically described using the screen resolution. Upon receiving a movement operation on the floating component, if the full-screen size of the display interface is found to be 1920×1080px, the size of the parent container can be set to 1920×1080px to expand the parent container's area to the full screen. In this case, since the parent container is used to constrain the display area of the floating component, the floating component can be moved and displayed within the full screen area.
[0045] It should be understood that when a movement operation is received on a floating component on the display interface, it is the moment when the user first presses the floating component, preparing to perform a movement or drag operation; this event can be described as the TOUCH_DOWN event.
[0046] Figure 3 This is a schematic diagram of a parent container provided in an embodiment of this application. For example... Figure 3 As shown in (a), before receiving a move operation on the floating component, the size of the parent container can be the same as the size of the floating component, and their positions coincide; after receiving the move operation, the size of the parent container is adjusted as shown in (a). Figure 3As shown in (b) of the full-screen size, the floating component is located within the parent container and can be moved within the full-screen area of the parent container.
[0047] It should be noted that, Figure 3 The parent container shown is only used to illustrate the area of the parent container. In actual applications, the parent container is a transparent container and is not visible to the user, used to limit the displayable range of the floating component.
[0048] Optionally, when the user moves the floating component outside the parent container, the floating component is either not displayed or is hidden.
[0049] Optionally, the display interface can be the display interface of a mobile phone screen, computer screen, or vehicle screen, etc. This application embodiment does not specifically limit the type of display device.
[0050] In one implementation, upon receiving a startup operation from the target application, the parent container corresponding to the floating component of the target application is initialized, and the parent container is cached in the view pool of the target application. When a movement operation is received on a floating component on the display interface, the process of adjusting the size of the parent container corresponding to the floating component to the full-screen size of the display interface may specifically include: When a move operation is received on the floating component corresponding to the target application on the display interface, the parent container in the view pool is called and the floating component is added as a child view of the parent container. Adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface.
[0051] For example, when a user launches a target application, such as a music app or a navigation app, a parent container corresponding to the target application's floating component can be created and initialized. The initialized parent container is then cached in the target application's view pool. After the floating component is displayed, if a movement operation is received on the floating component on the display screen, the parent container of the application's corresponding floating component can be called from the view pool, and the floating component can be bound to the parent container, confirming that the floating component is a child view of the parent container. Afterward, the size of the parent container can be adjusted to the full-screen size of the display screen.
[0052] For example, during the initialization of the parent container, basic properties of the parent container can be set, such as setting the parent container to a transparent background to avoid obscuring the underlying interface; at the same time, touch event interception of the parent container can be enabled to prevent operation events from penetrating and affecting the underlying interface during the operation of the view in the parent container.
[0053] Optionally, during the initialization of the parent container, the initial size of the parent container can be set to WRAP_CONTENT to indicate that the size of the parent container is consistent with the size of the content displayed in the parent container, or the initial size can be set to a preset non-full-screen size, such as 200×200px, 1 / 4 screen size, etc., to avoid the parent container being displayed in full screen and affecting the user's operation of the underlying interface when there is no need to move the floating component.
[0054] In this embodiment, when the target application starts, the parent container corresponding to the floating component is initialized and pre-stored. Subsequently, the parent container is directly called from the view pool, avoiding the repeated creation of new containers and the frequent allocation and reclamation of memory caused by destroying containers after use, thus reducing the risk of memory fragmentation. At the same time, by completing the creation of the parent container in advance, the time required to create the parent container when the floating component moves is saved, reducing the latency during the movement of the floating component, making the movement of the floating component smoother, and improving the user experience.
[0055] In one implementation, when a movement operation is received on a floating component on the display interface, the process of adjusting the size of the parent container corresponding to the floating component to the full-screen size of the display interface may specifically include: When a move operation is received on a floating component on the display interface, the target interface of the window manager is called, where the target interface is used to adjust the size of the parent container; The target interface is used to adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface.
[0056] For example, when an operation to move a floating component on the display interface is received, the target interface in the window manager is called. Through the target interface, the size of the parent container corresponding to the floating component is adjusted from the current size to the full-screen size of the display interface.
[0057] For example, the window manager, as a system-level service, stores various size information of the display interface, such as the actual screen resolution. After receiving a movement operation on the floating component, the window manager can obtain the full-screen size of the display interface and set the size parameter value of the parent container to the aforementioned full-screen size to achieve size adjustment of the parent container.
[0058] In this embodiment, the physical boundaries of the screen are dynamically identified through the target interface of the window manager to determine the effective full-screen size visible to the user. This eliminates the need for manual monitoring of display mode changes and automatically updates the full-screen size accordingly. The full-screen size is then set to the size of the parent container, ensuring consistency between the parent container's size and the device's actual full-screen size. This prevents abnormal display of floating components due to size mismatches. By encapsulating the differences in full-screen size definitions across different system versions and device manufacturers using the window manager's target interface, developers no longer need to perform separate adaptations for each version or manufacturer. They can obtain a unified full-screen size conforming to the current system rules simply by calling the interface, reducing system development costs.
[0059] S202, Based on the operation information corresponding to the movement operation, determine the target position parameters of the floating component in the parent container.
[0060] The operation information corresponding to the movement operation may include the position information of the touch point corresponding to the movement operation, the movement displacement and movement direction during the movement operation, and the position parameters of the floating component may include the coordinates of the floating component in the parent container, etc.
[0061] For example, during the movement operation of a floating component, it can be understood as a long-press and drag operation performed on the floating component after the user clicks on it. This event can be described as the TOUCH_MOVE event. During this process, if a hand-raising event (TOUCH_UP event) is detected, it can be determined that the movement operation has ended; if no hand-raising event is detected, the position of the floating component is updated in real time according to the operation information corresponding to the movement operation.
[0062] For example, after adjusting the size of the parent container to full screen, the user can drag the floating component to move it within the full screen area. During the movement operation, the target position parameters of the floating component within the parent container can be determined based on the operation information corresponding to the movement operation.
[0063] For example, when the coordinate origin and coordinate description method of the display interface and the parent container are the same, since the size of the parent container is the full screen size, which is consistent with the full screen size of the display interface, the target position parameters of the floating component in the parent container are determined, which are also the target position parameters of the floating component in the full screen of the display interface.
[0064] In one implementation, the initial position parameter of the floating component in the parent container is obtained; The process of determining the target position parameters of the floating component in the parent container based on the operation information corresponding to the movement operation can specifically include: Based on the initial position parameters and the displacement vector in the operation information, the target position parameters of the suspended component in the parent container are determined.
[0065] For example, before the user drags the floating component to perform a movement operation, the initial position parameters of the floating component in the parent container can be determined; then the displacement vector during the movement operation can be monitored to determine the displacement on the horizontal and vertical axes. After that, the target position parameters of the floating component in the parent container after the movement operation can be determined by combining the initial position parameters and the displacement on the coordinate axes.
[0066] For example, Figure 4 This is a schematic diagram illustrating the movement process of a suspended ball according to an embodiment of this application. Figure 4 As shown, taking the lower left corner O of the display interface as the origin, the initial position of the floating ball is position 401, and the coordinates of the midpoint of the floating ball - point A are ( , The system detected that the user dragged the floating ball to position 402, which corresponds to a movement along the x-axis. Move along the y-axis Then the coordinates of the midpoint B after the movement can be determined as ( , That is, the target position parameter of the suspended ball indicates the coordinates of the midpoint of the suspended ball after the movement - point B is ( , ).
[0067] In this embodiment, the initial position parameters of the floating component are used as the calculation basis. Combined with the displacement vector in the operation information, the linear calculation of the initial position parameters and displacement vector ensures that the component's movement trajectory is completely matched with the user's operation intention. This avoids position drift errors that may be caused by the cumulative displacement based on the real-time position, improves the accuracy of determining the updated position parameters of the floating component, realizes the dynamic position adjustment of the floating component, and enhances the user experience.
[0068] In another implementation, the process of determining the target position parameters of the floating component in the parent container based on the operation information corresponding to the movement operation may also include: Based on the operation information corresponding to the movement operation, determine the position parameters of the current touch point; The target position parameter of the floating component in the parent container is determined to be the position parameter of the current touch point.
[0069] For example, the movement trajectory corresponding to the user's movement operation includes a series of touch points. In the process of determining the target position parameters of the floating component in the parent container, the position parameters of the touch points can also be directly collected. Based on the movement operation, the position parameters of the current touch point are determined in real time, and then the position parameters of the current touch point can be determined as the target position parameters of the floating component in the parent container.
[0070] In this embodiment, since the parent container is full-screen in size, the device also collects the position parameters of the touch point based on the full-screen coordinate system. Therefore, the target position parameters of the floating component are determined directly according to the mapping logic between the touch point position and the target position of the floating component. This simplifies the interaction chain to the greatest extent, eliminates the need for position parameter calculation, improves the efficiency of determining the target position parameters, and enables the floating component to move more quickly, avoiding the user feeling that the floating component moves sluggishly, thereby improving the user experience.
[0071] S203, based on the target position parameters, displays a floating component in the display interface.
[0072] For example, after determining the target position parameters of the floating component in the parent container, since the size of the parent container is now the full-screen size, which is consistent with the full-screen size of the display interface, the determined target position parameters of the floating component in the parent container, which is also the target position parameters of the floating component in the full-screen display interface, can be used to determine the target position of the floating component in the display interface and display the floating component in the target position in the display interface, so as to realize the position update of the floating component.
[0073] In one implementation, the midpoint of the floating component can be used as the operation point for the movement operation as the user drags and moves the floating component.
[0074] For example, when the center point of the floating component is used as the operation point for a movement operation, regardless of where the user clicks on the floating component to perform the movement operation, the operation point can be determined as the center point of the floating component. After the movement operation is completed, the coordinates of the current touch point can be determined as the updated center point coordinates of the floating component, and the floating component can be displayed using these center point coordinates.
[0075] In another implementation, as the user drags the floating component to move it, the user's touch point on the floating component can also be used as the operation point for the movement operation.
[0076] For example, Figure 5 This is a schematic diagram illustrating the movement process of another suspended ball provided in an embodiment of this application. For example... Figure 5As shown, the initial position of the floating ball is position 501. When the user touches point C on the floating ball and moves it, the position of point C within the floating ball can be analyzed and stored. After the user moves the floating ball from position 501 to position 502, the new position of the floating ball—position 502—is determined by combining the position of point C at position 501 and the coordinates of point D. During this process, point D is not determined as the midpoint coordinates of the new position of the floating ball after the movement. This avoids a deviation between the actual movement trajectory of the floating ball and the movement operation of the user's touch point during the dragging process, which would affect the user's visual experience.
[0077] In one implementation, at the end of the move operation, the size of the parent container is adjusted from the full-screen size to the target size so that the parent container coincides with the floating component, where the target size is the current size of the floating component.
[0078] For example, during a user's movement operation, the parent container is sized to the full screen, allowing the user to move the floating component to any position within the full-screen interface. When the movement operation ends, such as when the user releases the mouse or finger, the floating component has been moved to a new position. The system can then obtain the current size of the floating component and adjust the size of the parent container to be exactly the same as the size of the floating component, achieving overlap between the parent container and the floating component.
[0079] For example, because the parent container's properties indicate that it has the ability to intercept touch events, meaning that operations on the view (floating component) within the parent container will not affect the underlying display interface. After the movement operation ends, the user may need to operate on the underlying display interface. If the parent container is kept at full screen size, the user will be unable to operate on the underlying interface. Therefore, to restore the ability to operate on the underlying interface, the size of the parent container needs to be adjusted from full screen size to the same size as the floating component.
[0080] For example, users can adjust the size of the floating component, and when the size of the floating component changes, the size of the parent container corresponding to the floating component changes accordingly.
[0081] Optionally, during the user's movement of the floating component, other higher-priority operations may interrupt the movement. For example, if the user receives a notification from the application while the floating component is being moved, the movement operation may be interrupted. In this case, the position of the floating component can be left unchanged, maintaining its initial position to avoid erroneous movement.
[0082] In this embodiment, after the movement operation ends, the parent container shrinks from full-screen size to component size and overlaps with the floating component. Users can operate the underlying content without closing the floating component, improving multitasking efficiency. The floating component's display does not interfere with operations on other interfaces. Furthermore, this process does not require destroying the parent container. When the floating component is moved again, the parent container's size can be adjusted back to full-screen size, avoiding resource waste caused by repeatedly creating and destroying containers. In addition, when multiple floating components exist on the interface simultaneously, each component's parent container only matches its own size, avoiding overlapping conflicts between full-screen containers. This allows multiple components to be laid out independently without interference, improving the interface's flexibility and scalability.
[0083] In one implementation, when the move operation ends, the current position parameter of the floating component is sent to the window manager so that the window manager updates the position parameter of the floating component to the current position parameter.
[0084] For example, when the move operation ends, indicating that the user has moved the floating window to the final position that meets the current needs, the current position parameter of the floating component can be sent to the window manager so that the window manager can update the historical position parameter of the floating component to the current position parameter, so that the window manager can manage multiple interface windows on the display interface and ensure the normal display and operation of multiple interface windows.
[0085] For example, after receiving the current position parameter of the floating component, the window manager can automatically check whether the current position of the floating component will overlap with other elements, and avoid conflicts between elements through its own layout algorithm to ensure that multiple elements in the interface are displayed normally.
[0086] In this embodiment, upon completion of the movement operation of the floating component, the current position parameter of the floating component after movement is sent to the window manager for parameter update. This avoids layout chaos caused by only updating the position of the component itself and lacking system-level conflict verification. Furthermore, synchronizing the position parameter to the system-level window manager only at the end of the movement operation reduces the number of inter-process communications between system processes and application processes, lowers system consumption during the movement of the floating component, avoids lag caused by frequent inter-process communications, and improves the efficiency of the floating component's movement and display.
[0087] In summary, in this embodiment, upon receiving a movement operation on the floating component, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface; the target position parameters of the floating component within the parent container are determined, and the floating component is then displayed based on these parameters. Compared to existing technologies where the position needs to be updated via the window manager each time the floating component moves, leading to frequent inter-process communication between the application process of the floating component and the system process of the window manager, this solution only expands the parent container to full screen at the start of the movement operation. All position parameter updates during the movement are completed within the parent container, eliminating the need for frequent interaction with the system-level window manager. This avoids stuttering caused by frequent inter-process communication and improves the smoothness of the floating component movement. Furthermore, after making the parent container full-screen, the position change of the floating component only exists within the parent container. The window manager does not need to perceive changes within the parent container, avoiding frequent full-screen redraws caused by the window manager frequently receiving new positions, thus reducing processor resource consumption.
[0088] Figure 6 This is a schematic flowchart illustrating another method for moving a floating component according to an embodiment of this application. It should be understood that this method can be applied to an electronic device; or, to a processor in an electronic device; or, to a chip in a processor mounted in an electronic device.
[0089] For example, such as Figure 6 As shown, the method 600 includes: S601 receives drag operations on the floating component.
[0090] The floating components can include floating balls, floating windows, etc.; dragging operations are equivalent to... Figure 2 The movement operation is described in the relevant description.
[0091] For example, when a floating component is displayed on the screen, if the user needs to change the display position of the floating component, they can perform a drag operation on the floating component. For instance, the user can tap and move the floating component using a finger or stylus. At this time, the electronic device can receive the user's drag operation on the floating component.
[0092] For example, the parent container's touch event (onTouch) interface can be configured to listen for user touch events on the parent container. If the parent container listens for a TOUCH_DOWN event on a floating component within the parent container, it can be determined that a drag operation on the floating component has been detected.
[0093] S602 sets the size of the parent container of the floating component to the full-screen size.
[0094] The parent container is used to limit the display area of the floating component, meaning the floating component can only be displayed within the area corresponding to the parent container; furthermore, the parent container is a transparent container, which is invisible to the user.
[0095] For example, after receiving a user's drag operation on the floating component, the full-screen size of the electronic device's display interface is obtained, and the size of the parent container corresponding to the floating component is set to the full-screen size.
[0096] Optionally, the initial size of the parent container can be set to a preset non-full-screen size, or the initial size can be set to the same size as the floating component.
[0097] Alternatively, the implementation methods of S601 and S602 can be found in [reference needed]. Figure 2 The relevant description of S201 is not repeated here in the embodiments of this application.
[0098] S603, determine the position parameters of the floating component within the parent container based on the drag operation.
[0099] The position parameters of the floating component can include the coordinates of the midpoint of the floating component or the coordinates of a preset point.
[0100] For example, after setting the parent container of the floating component to full-screen size, the user can move the floating component within the full-screen area; during the user's drag operation, the position parameters of the floating component within the parent container can be determined based on the user's drag operation.
[0101] Alternatively, the implementation of S603 can be found in [reference needed]. Figure 2 The relevant description of S202 is not repeated here in the embodiments of this application.
[0102] S604, check if the drag operation has ended; if yes, execute S605; if no, execute S603.
[0103] For example, the system can detect in real time whether the user's drag operation has ended. If the drag operation has not ended, the system can update the position parameters of the floating component within the parent container in real time.
[0104] For example, if the parent container hears the TOUCH_UP event for the floating component, it can determine that the drag operation has ended. If the TOUCH_MOVE event for the floating component is continuously heard, it indicates that the drag operation has not ended.
[0105] S605, determine the final position parameters of the suspension component.
[0106] For example, after detecting the end of the drag operation, indicating that the user has moved the floating component to the desired position, the final position parameters of the floating component's movement can be determined.
[0107] S606 adjusts the size of the parent container of the floating component from the full-screen size to the size of the floating component.
[0108] For example, after determining the final position parameters of the floating component in the parent container, the size of the parent container is adjusted from the full-screen size to the same size as the floating component, and the parent container and the floating component are kept in the same position.
[0109] S607 sends the final position parameters to the window manager for position update.
[0110] For example, after the size of the parent container is adjusted, the final position parameters of the floating component are sent to the window manager for position update, so that the window manager can verify the position of the floating component.
[0111] Alternatively, the implementation methods of S604 to S607 can be found in [reference needed]. Figure 2 The relevant description of S203 is not repeated here in the embodiments of this application.
[0112] In summary, in this embodiment, upon receiving a drag operation, the size of the parent container is set to full-screen size, and the position of the floating component within the parent container is determined. This eliminates the need for frequent communication with the window manager or triggering global layout validation. During dragging, the view of the floating component is downgraded from the window level to a normal view level, and then upgraded back to the window level upon completion of the drag, avoiding system latency caused by frequent IPC during movement. During dragging, the processor only executes lightweight logic for displacement calculation and position updates, without handling global conflict detection in the window manager. System-level synchronization is performed only once after dragging ends, avoiding the overhead of high-frequency IPC communication. The parent container is shrunk to the size of the floating component, preventing interference with interface operations beneath the floating component and improving the user experience.
[0113] The above text combined Figures 1 to 6 The present application describes in detail the method for moving and displaying a floating component according to its embodiments; the following will be combined with Figure 7 and Figure 8 The apparatus embodiments of this application are described in detail below. It should be understood that the apparatus in the embodiments of this application can perform the various methods described in the foregoing embodiments of this application, that is, the specific working processes of the various products described below can be referred to the corresponding processes in the foregoing method embodiments.
[0114] Figure 7This is a schematic diagram of the structure of a mobile display device with a floating component provided in an embodiment of this application.
[0115] For example, such as Figure 7 As shown, the device 700 includes: The processing module 701 is used to adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface when a movement operation is received on the floating component on the display interface, wherein the parent container is used to constrain the display range of the floating component; and to determine the target position parameters of the floating component in the parent container based on the operation information corresponding to the movement operation. Display module 702 is used to display floating components in the display interface based on target position parameters.
[0116] In one possible implementation, the processing module 701 is further configured to obtain the initial position parameters of the suspended component in the parent container; and determine the target position parameters of the suspended component in the parent container based on the initial position parameters and the displacement vector in the operation information.
[0117] In one possible implementation, the processing module 701 is further configured to determine the position parameters of the current touch point based on the operation information corresponding to the movement operation; and determine the target position parameters of the floating component in the parent container as the position parameters of the current touch point.
[0118] In one possible implementation, the processing module 701 is further configured to adjust the size of the parent container from the full-screen size to the target size when the movement operation ends, so that the parent container coincides with the floating component, wherein the target size is the current size of the floating component.
[0119] In one possible implementation, the processing module 701 is further configured to initialize the parent container corresponding to the floating component of the target application when receiving the launch operation of the target application, and cache the parent container in the view pool of the target application; when receiving the move operation of the floating component corresponding to the target application on the display interface, call the parent container in the view pool and add the floating component as a child view of the parent container; and adjust the size of the parent container corresponding to the floating component to the full-screen size of the display interface.
[0120] In one possible implementation, the processing module 701 is further configured to call the target interface of the window manager when it receives a movement operation on the floating component on the display interface, wherein the target interface is used to adjust the size of the parent container; through the target interface, the size of the parent container corresponding to the floating component is adjusted to the full-screen size of the display interface.
[0121] In one possible implementation, the processing module 701 is further configured to send the current position parameter of the floating component to the window manager when the movement operation ends, so that the window manager updates the position parameter of the floating component to the current position parameter.
[0122] It should be noted that the aforementioned floating component's mobile display device is embodied in the form of a functional unit. The term "module" here can be implemented in software and / or hardware, without specific limitations.
[0123] For example, a "module" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuits, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuits, and / or other suitable components that support the described functions.
[0124] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0125] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0126] For example, such as Figure 8 As shown, the electronic device 800 includes a memory 801 and a processor 802. The memory 801 stores executable program code 803, and the processor 802 is used to call and execute the executable program code 803 to perform a floating component mobile display method.
[0127] Furthermore, embodiments of this application also protect an apparatus that may include a memory and a processor, wherein the memory stores executable program code, and the processor is used to call and execute the executable program code to perform a floating component movement display method provided in embodiments of this application.
[0128] This embodiment can divide the device into functional modules based on the above method example. For example, each module can correspond to a separate function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0129] When the functional modules are divided according to their respective functions, the device may also include [other components]. It should be noted that all relevant content regarding the steps involved in the above method embodiments can be referenced to the functional descriptions of the corresponding functional modules, and will not be repeated here.
[0130] It should be understood that the device provided in this embodiment is used to execute the above-described method for moving and displaying a floating component, and therefore can achieve the same effect as the above-described implementation method.
[0131] When using integrated units, the device may include a processing module and a storage module. When applied to an electronic device, the processing module can be used to control and manage the operation of the electronic device. The storage module can be used to support the execution of relevant program code by the electronic device.
[0132] The processing module may be a processor or a controller, which can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module may be a memory.
[0133] In addition, the device provided in the embodiments of this application may specifically be a chip, component or module. The chip may include a connected processor and a memory. The memory is used to store instructions. When the processor calls and executes the instructions, the chip can execute a floating component movement display method provided in the above embodiments.
[0134] This embodiment also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer, the computer executes the above-described related method steps to implement the floating component movement display method provided in the above embodiment.
[0135] The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROMs), microdrives, and magneto-optical disks, read-only memory (ROMs), random access memory (RAMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), dynamic random access memory (DRAMs), video random access memory (VRAMs), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0136] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement a floating component movement display method provided in the above embodiment.
[0137] In this embodiment, the device, computer-readable storage medium, computer program product, or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0138] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0139] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A moving display method of a suspended assembly, characterized by, The method comprises: when receiving a moving operation on a floating component on a display interface, adjusting a size of a parent container corresponding to the floating component to a full-screen size of the display interface, wherein the parent container is used to constrain a display range of the floating component; based on operation information corresponding to the moving operation, determining a target position parameter of the floating component in the parent container; based on the target position parameter, displaying the floating component in the display interface.
2. The method of claim 1, wherein, The method further comprises: obtaining an initial position parameter of the floating component in the parent container; the determining, based on operation information corresponding to the moving operation, of a target position parameter of the floating component in the parent container comprises: based on the initial position parameter and a displacement vector in the operation information, determining the target position parameter of the floating component in the parent container.
3. The method of claim 1, wherein, the determining, based on operation information corresponding to the moving operation, of a target position parameter of the floating component in the parent container comprises: based on the operation information corresponding to the moving operation, determining a position parameter of a current touch point; determining the target position parameter of the floating component in the parent container as the position parameter of the current touch point.
4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: when the moving operation ends, adjusting the size of the parent container from the full-screen size to a target size, so that the parent container coincides with the floating component, wherein the target size is a current size of the floating component.
5. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: when receiving a starting operation of a target application, performing an initialization operation on a parent container corresponding to a floating component of the target application, and caching the parent container into a view pool of the target application; the adjusting, when receiving a moving operation on a floating component on a display interface, of a size of a parent container corresponding to the floating component to a full-screen size of the display interface comprises: when receiving a moving operation on a floating component of the target application on a display interface, calling the parent container in the view pool, and adding the floating component as a child view of the parent container; adjusting a size of the parent container corresponding to the floating component to the full-screen size of the display interface.
6. The method according to any one of claims 1 to 3, characterized in that, the adjusting, when receiving a moving operation on a floating component on a display interface, of a size of a parent container corresponding to the floating component to a full-screen size of the display interface comprises: when receiving a moving operation on a floating component on a display interface, calling a target interface of a window manager, wherein the target interface is used to adjust the size of the parent container; through the target interface, adjusting a size of the parent container corresponding to the floating component to the full-screen size of the display interface.
7. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: when the moving operation ends, sending a current position parameter of the floating component to a window manager, so that the window manager updates a position parameter of the floating component to the current position parameter.
8. A mobile display device of a suspended assembly, characterized by, The device comprises: The processing module is configured to, when a movement operation on a floating component on a display interface is received, adjust a size of a parent container corresponding to the floating component to a full screen size of the display interface, wherein the parent container is configured to constrain a display range of the floating component; determine a target position parameter of the floating component in the parent container based on operation information corresponding to the movement operation. The display module is configured to display the floating component in the display interface based on the target position parameter.
9. An electronic device, comprising: The electronic device comprises: a memory configured to store executable program code; a processor configured to call and run the executable program code from the memory, so that the electronic device performs the 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, when the computer program is executed, the method according to any one of claims 1 to 7 is realized. The computer readable storage medium stores a computer program, when the computer program is executed, the method according to any one of claims 1 to 7 is realized.