CN-117527956-B - Control method, device, equipment and medium for displaying page in mobile phone application
Abstract
The invention relates to the field of digital medical treatment, in particular to a control method, a device, equipment and a medium for a display page in mobile phone application, wherein when a target control in the display page of the mobile phone application is subjected to mobile control, a container is built in the display page, and the target control is added in the container; the method comprises the steps of monitoring whether a touch event occurs in a display area of a container, determining the position when the touch event occurs as an initial position if the touch event occurs in the display area of the container, determining the position when the sliding event is ended as a stop position if the touch event is changed into a sliding event, determining the adsorption direction and the adsorption position of the container according to the stop position, controlling the container to move to the adsorption position, and filling preset adsorption animation in the display area between the position of the container and the adsorption position in real time in the moving process, wherein a custom animation effect is realized in a displayed page, and the operation experience of doctors in medical scenes is enriched.
Inventors
- HUANG YANG
Assignees
- 中国平安人寿保险股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20231107
Claims (10)
- 1. A control method for displaying a page in a mobile phone application is characterized by comprising the following steps: When a target control in a display page of a mobile phone application is subjected to movement control, constructing a container in the display page, and adding the target control in the container; monitoring whether a touch event occurs in a display area where the container is located, and if the touch event occurs in the display area where the container is located, determining the position when the touch event occurs as an initial position; Monitoring whether the touch event is changed into a sliding event according to the initial position, if so, enabling the container to move along a sliding track of the sliding event, and determining the position at the end of the sliding event as a stop position; and determining the adsorption direction and the adsorption position of the container according to the stop position, controlling the container to move to the adsorption position, and filling a preset adsorption animation in a display area between the position of the container and the adsorption position in real time in the moving process.
- 2. The control method according to claim 1, wherein the monitoring whether the touch event becomes a sliding event according to the initial position includes: after a preset time interval, monitoring whether a touch event occurs in a display area where the container is located, and if the touch event occurs in the display area where the container is located, determining the position when the touch event occurs as the current position; And calculating the distance between the current position and the initial position, detecting whether the distance is larger than or equal to a preset minimum sliding distance, and if the distance is detected to be larger than or equal to the preset minimum sliding distance, determining that the touch event is changed into a sliding event.
- 3. The control method according to claim 2, wherein after a preset time interval, monitoring whether a touch event occurs in a display area where the container is located comprises: And if the fact that the touch event does not occur in the display area where the container is located is monitored, determining that the touch event does not become a sliding event.
- 4. The control method according to claim 1, wherein the determining the suction direction and suction position of the container according to the stop position includes: Taking the lower left corner of the screen of the mobile phone application as an origin, acquiring a screen center abscissa value of the mobile phone application and an abscissa value in the stop position, and calculating a horizontal coordinate difference value between the screen center abscissa value and the abscissa value; When the horizontal coordinate difference value is a negative number, determining that the adsorption direction of the container is rightward, and the corresponding adsorption position is the right side of a screen applied by the mobile phone; and when the horizontal coordinate difference value is a positive number, determining that the adsorption direction of the container is left, and the corresponding adsorption position is left side of a screen applied by the mobile phone.
- 5. The control method according to claim 1, wherein the determining the suction direction and suction position of the container according to the stop position includes: Taking the lower left corner of the screen applied by the mobile phone as an origin, acquiring a screen center ordinate value of the screen applied by the mobile phone and an ordinate value in the stop position, and calculating a ordinate difference value between the screen center ordinate value and the ordinate value; When the difference value of the vertical coordinates is a negative number, determining that the adsorption direction of the container is upward, and the corresponding adsorption position is the upper side of a screen applied by the mobile phone; And when the difference value of the vertical coordinates is a positive number, determining that the adsorption direction of the container is downward, and the corresponding adsorption position is the lower side of the screen of the mobile phone application.
- 6. The control method of claim 1, wherein adding a target control in the container comprises: the target control is added to the container through the structural form of the xml file.
- 7. The control method of claim 1, wherein adding a target control in the container comprises: copying the target control in the display page, and adding the target control into the container.
- 8. A control device for displaying pages in a mobile phone application, the control device comprising: the container construction module is used for constructing a container in a display page of the mobile phone application when a target control is moved and controlled in the display page, and adding the target control in the container; the first detection module is used for monitoring whether a touch event occurs in the display area where the container is located, and if the touch event occurs in the display area where the container is located, determining the position when the touch event occurs as an initial position; The second detection module is used for monitoring whether the touch event is changed into a sliding event according to the initial position, enabling the container to move along the sliding track of the sliding event if the touch event is monitored to be changed into the sliding event, and determining the position at the end of the sliding event as a stop position; And the movement control module is used for determining the adsorption direction and the adsorption position of the container according to the stop position, controlling the container to move to the adsorption position, and filling a preset adsorption animation in a display area between the position of the container and the adsorption position in real time in the moving process.
- 9. A computer device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the processor implementing the control method according to any one of claims 1 to 7 when the computer program is executed.
- 10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the control method according to any one of claims 1 to 7.
Description
Control method, device, equipment and medium for displaying page in mobile phone application Technical Field The present invention relates to the field of digital medical technology, and in particular, to a control method, device, equipment and medium for displaying a page in a mobile phone application. Background The android platform interface involves many Animation effects to improve the user experience, and most applications in the prior art implement Animation of the control through Animation functions (Animation). These animation effects include movements of the control position, zooming in, zooming out, fading in, and combinations of several animations. For example, in a medical scenario, a doctor is assisted in viewing details of a patient's lesion by moving, zooming in, etc. the medical image received on the cell phone. Most of the controls on the interface inherit a unified View (i.e., view), and the container (ViewGroup) of View inherits from View, and the animation of the controls is essentially animation of View. Currently, animation effects such as movement and adsorption in a display page are realized by adding View to ViewGroup. However, because the drawing mechanism of the interface in the android platform is specified and cannot be changed, that is, the animation effect is realized by the animation framework of the android platform, so that the animation effect of the control cannot be controlled randomly, the experience of the user is poor, and therefore, how to improve the realization of the animation effect, and therefore, the experience of the user is improved, becomes a problem to be solved urgently. Disclosure of Invention In view of this, the embodiments of the present invention provide a control method, apparatus, device, and medium for displaying a page in a mobile phone application, so as to solve the problem of how to improve the realization of animation effects, thereby improving the experience of a user. In a first aspect, an embodiment of the present invention provides a control method for displaying a page in a mobile phone application, where the control method includes: When a target control in a display page of a mobile phone application is subjected to movement control, constructing a container in the display page, and adding the target control in the container; monitoring whether a touch event occurs in a display area where the container is located, and if the touch event occurs in the display area where the container is located, determining the position when the touch event occurs as an initial position; Monitoring whether the touch event is changed into a sliding event according to the initial position, if so, enabling the container to move along a sliding track of the sliding event, and determining the position at the end of the sliding event as a stop position; and determining the adsorption direction and the adsorption position of the container according to the stop position, controlling the container to move to the adsorption position, and filling a preset adsorption animation in a display area between the position of the container and the adsorption position in real time in the moving process. In a second aspect, an embodiment of the present invention provides a control device for displaying a page in a mobile phone application, where the control device includes: the container construction module is used for constructing a container in a display page of the mobile phone application when a target control is moved and controlled in the display page, and adding the target control in the container; the first detection module is used for monitoring whether a touch event occurs in the display area where the container is located, and if the touch event occurs in the display area where the container is located, determining the position when the touch event occurs as an initial position; The second detection module is used for monitoring whether the touch event is changed into a sliding event according to the initial position, enabling the container to move along the sliding track of the sliding event if the touch event is monitored to be changed into the sliding event, and determining the position at the end of the sliding event as a stop position; And the movement control module is used for determining the adsorption direction and the adsorption position of the container according to the stop position, controlling the container to move to the adsorption position, and filling a preset adsorption animation in a display area between the position of the container and the adsorption position in real time in the moving process. In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, where the processor implements the control method according to the first aspect when the computer program is executed. In a fourth asp