Method for displaying transition animation on retractable screen, non-transitory computer-readable storage medium, and electronic device
View Patent ↗A display method, a non-transitory computer-readable storage medium, and an electronic device relates to the field of data processing. The method includes the following. A current state of the retractable screen is monitored, where the current state includes a static state and a motion state. A target transition animation is obtained when detecting that the retractable screen is switched from the static state to the motion state, where the change in the target transition animation corresponds to the motion state. A current image displayed on the retractable screen in the static sate is replaced with the target transition animation.
1 . A display method, performed by an electronic device having a retractable screen, the method comprising:
monitoring a current state of the retractable screen, wherein the current state comprises a static state and a motion state;
obtaining a target transition animation in response to detecting that the retractable screen is switched from the static state to the motion state, wherein a change in the target transition animation corresponds to the motion state; and
replacing a current image displayed on the retractable screen in the static state with the target transition animation, and displaying the target transition animation on the retractable screen in the motion state;
wherein the target transition animation comprises a bottom-layer animation and a motion special effect animation, the retractable screen has a visible region and a hidden region;
wherein the method further comprises:
obtaining displacement data of the retractable screen in the motion state; and
controlling a displacement of the motion special effect animation relative to the bottom-layer animation according to the displacement data, to make a distance between the motion special effect animation and a boundary line between the visible region and the hidden region less than or equal to a boundary distance threshold at any time.
2 . The method of claim 1 , wherein replacing the current image displayed on the retractable screen in the static state with the target transition animation comprises:
displaying the bottom-layer animation in both the visible region and the hidden region to replace the current image displayed on the retractable screen in the static state; and
displaying the motion special effect animation on an upper layer of the bottom-layer animation.
3 . The method of claim 1 , further comprising:
obtaining a moving velocity of the retractable screen in the motion state; and
controlling a playing velocity of the motion special effect animation according to the moving velocity to make the playing velocity of the motion special effect animation correspond to the moving velocity.
4 . The method of claim 3 , wherein the motion special effect animation comprises an animation movement, and controlling the playing velocity of the motion special effect animation according to the moving velocity comprises:
controlling a changing frequency of the animation movement according to the moving velocity.
5 . The method of claim 1 , wherein the distance between the motion special effect animation and the boundary line between the visible region and the hidden region is a vertical distance from a center point of the motion special effect animation to the boundary line.
6 . The method of claim 1 , wherein the distance between the motion special effect animation and the boundary line between the visible region and the hidden region is a vertical distance from a left edge or a right edge of the motion special effect animation to the boundary line.
7 . The method of claim 1 , wherein the motion special effect animation has a screen size smaller than the bottom-layer animation.
8 . The method of claim 1 , wherein the bottom-layer animation serves as a background animation of the target transition animation, and the motion special effect animation serves as a foreground animation of the target transition animation.
9 . The method of claim 1 , wherein the electronic device comprises a first housing, the visible region is a screen region of the retractable screen outside an accommodating space of the first housing, and the hidden region is a screen region of the retractable screen inside the accommodating space of the first housing.
10 . The method of claim 1 , further comprising:
calculating region area data of the visible region in response to detecting that the retractable screen is switched from the motion state to the static state;
determining a target resolution ratio according to the region area data, and generating a current image of the target resolution ratio; and
replacing the target transition animation with the current image of the target resolution ratio to recover display of the retractable screen in the static state.
11 . The method of claim 10 , wherein determining the target resolution ratio according to the region area data comprises:
obtaining a mapping relationship between region area data and image resolution ratios; and
determining the target resolution ratio according to the mapping relationship and the region area data of the visible region.
12 . The method of claim 1 , wherein replacing the current image displayed on the retractable screen in the static state with the target transition animation comprises:
determining an extension degree of the retractable screen;
determining a corresponding playing time-point of the target transition animation according to the extension degree; and
replacing the current image displayed on the retractable screen in the static state with the target transition animation at the playing time-point,
wherein a playing velocity of the target transition animation corresponds to a moving velocity of the retractable screen in the motion state.
13 . The method of claim 12 , wherein determining the extension degree of the retractable screen comprises:
determining a current visible region and a current hidden region of the retractable screen; and
calculating the extension degree according to an area of the current visible region and an area of the current hidden region.
14 . The method of claim 1 , wherein monitoring the current state of the retractable screen comprises:
establishing a monitoring process; and
monitoring, by means of the monitoring process, a control instruction for the retractable screen, and determining the current state of the retractable screen according to the control instruction.
15 . The method of claim 14 , wherein determining the current state of the retractable screen according to the control instruction comprises:
determining the current state of the retractable screen as the motion state in response to monitoring an extension instruction or a retraction instruction used for controlling the retractable screen; or
determining the current state of the retractable screen as the static state in response to monitoring a stop instruction or a wait instruction used for controlling the retractable screen.
16 . The method of claim 1 , wherein the electronic device comprises a driving member configured to control the retractable screen, and monitoring the current state of the retractable screen comprises:
determining the current state of the retractable screen as the motion state in response to monitoring that the driving member is in a power-on and operating state; or
determining the current state of the retractable screen as the static state in response to monitoring that the driving member is in a power-off state or a power-on and not operating state.
17 . A non-transitory computer-readable storage medium storing a computer program which, when executed by a processor, is configured to implement:
monitoring a current state of a retractable screen, wherein the current state comprises a static state and a motion state;
obtaining a target transition animation in response to detecting that the retractable screen is switched from the static state to the motion state, wherein a change in the target transition animation corresponds to the motion state; and
replacing a current image displayed on the retractable screen in the static state with the target transition animation, and displaying the target transition animation on the retractable screen in the motion state;
wherein the target transition animation comprises a bottom-layer animation and a motion special effect animation, the retractable screen has a visible region and a hidden region;
wherein the computer program, when executed by the processor, is further configured to implement:
obtaining displacement data of the retractable screen in the motion state; and
controlling a displacement of the motion special effect animation relative to the bottom-layer animation according to the displacement data, to make a distance between the motion special effect animation and a boundary line between the visible region and the hidden region less than or equal to a boundary distance threshold at any time.
18 . The non-transitory computer-readable storage medium of claim 17 , wherein in terms of replacing the current image displayed on the retractable screen in the static state with the target transition animation, the computer program, when executed by the processor, is configured to implement:
displaying the bottom-layer animation in both the visible region and the hidden region to replace the current image displayed on the retractable screen in the static state; and
displaying the motion special effect animation on an upper layer of the bottom-layer animation.
19 . An electronic device, comprising:
a processor; and
a memory configured to store executable instructions of the processor,
wherein the processor is configured to execute the executable instructions to execute:
monitoring a current state of a retractable screen, wherein the current state comprises a static state and a motion state;
obtaining a target transition animation in response to detecting that the retractable screen is switched from the static state to the motion state, wherein a change in the target transition animation corresponds to the motion state; and
replacing a current image displayed on the retractable screen in the static state with the target transition animation, and displaying the target transition animation on the retractable screen in the motion state;
wherein the target transition animation comprises a bottom-layer animation and a motion special effect animation, the retractable screen has a visible region and a hidden region;
wherein the processor is further configured to execute the executable instructions to execute:
obtaining displacement data of the retractable screen in the motion state; and
controlling a displacement of the motion special effect animation relative to the bottom-layer animation according to the displacement data, to make a distance between the motion special effect animation and a boundary line between the visible region and the hidden region less than or equal to a boundary distance threshold at any time.