Display method and related device
By caching and setting invisible elements in electronic devices and using disappearance-related animation types, the animations of removed and added elements are displayed simultaneously, solving the problem of discontinuous animation and improving the continuity and smoothness of the animation.
Patent Information
- Application Number
- PCT/CN2023/143336
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-09-11
AI Technical Summary
In the prior art, the animation effect is discontinuous and not smooth when elements change, especially when elements are removed and added, the disappearance and appearance animations cannot be displayed simultaneously.
By caching elements in advance in the electronic device and setting them to an invisible state, and using the disappearance-related animation type to set the newly added elements to CHANGE_DISAPPEARING, the disappearance animation of the removed elements and the appearance animation of the newly added elements can be displayed simultaneously.
The continuity and smoothness of the animation process are achieved, ensuring that the animations of removing and adding elements can be performed simultaneously, which improves the user experience.
Smart Images

Figure CN2023143336_12092025_PF_FP_ABST
Abstract
Description
A display method and related equipment Technical Field
[0001] The present application relates to the field of animation effects, and in particular to a display method and related equipment. Background Art
[0002] When a user uses a terminal device (also known as an electronic device), the terminal device often uses animation effects (i.e., animations) to provide a better visual experience. For example, when an element (e.g., a View object) displayed on the terminal device changes (e.g., an element is deleted or added), the terminal device will provide a corresponding animation effect. However, currently, the display of this animation effect is discontinuous and not smooth.
[0003] Summary of the Invention
[0004] The embodiment of the present application provides a display method and related equipment. According to the method, the electronic device can add and cache elements in advance and set them to an invisible state. When the element needs to be removed, the electronic device can set the animation type of the element to be removed to DISAPPEARING, and set the animation type of the cached element to CHANGE_DISAPPEARING, so that the animation of the cached element can be displayed while the disappearance animation of the element to be removed is displayed. In this way, the electronic device can simultaneously display the animation of removing elements and the animation of adding elements, making the entire animation more continuous.
[0005] In a first aspect, the present application provides a display method. The method can be applied to an electronic device including a display screen. The method may include: the electronic device may display X elements in a first area of the display screen; when a preset condition is met, the electronic device may remove N elements of the X elements from the first area, and move the newly added M elements to the first area for display. The animation type information of the N elements is first type information, and the animation type information of the M elements is second type information. The first type information is used to indicate that the animation disappears, and the second type information is used to indicate an animation that changes based on the disappearance of the animation. X, N, and M are all positive integers, N is less than or equal to X, and M is less than or equal to N.
[0006] It can be understood that in the original animation mechanism, the animation related to disappearance cannot be displayed at the same time as the animation related to appearance. Specifically, the animation corresponding to the animation type information used to indicate the disappearance of the animation and the animation corresponding to the animation type information used to indicate the appearance of the animation cannot be displayed at the same time. In the solution provided by the present application, when the preset conditions are met, the electronic device can remove one or more of the visible elements from the first area and move the new element to the first area for display. Moreover, the animation type information of the removed visible element is used to indicate the disappearance of the animation, while the animation type information of the new element is used to indicate the animation that changes based on the disappearance of the animation. The animations corresponding to these two types of animation type information can be displayed at the same time. This means that in the solution provided by the present application, the animation of the removed visible element and the animation of the new element can be displayed at the same time. This approach can make the entire animation process more continuous and smoother.
[0007] In some embodiments of the present application, the first area may be the area 1 mentioned below. The X elements in the first area may be all elements displayed in the area 1, that is, the total number of elements displayed in the area 1 is X.
[0008] In some embodiments of the present application, the animation type information may be the animation effect type mentioned below.
[0009] In combination with the first aspect, in one possible implementation, when a preset condition is met, the electronic device removes N elements out of the X elements from the first area. Specifically, this may include: when the electronic device detects a first operation of the user, the electronic device may remove N elements out of the X elements from the first area.
[0010] In the solution provided in this application, the user can choose to remove one or more elements in the first area as needed.
[0011] In some embodiments of the present application, the first operation may be a user operation on the N elements. It is understood that the user operation involved in the present application may be a touch operation, a gesture operation, or a voice control operation, etc., and the present application does not limit this. For example, the first operation may be a long press / double-click operation on the N elements.
[0012] In combination with the first aspect, in a possible implementation, the first operation is a sliding operation on the first area.
[0013] In some embodiments of the present application, the first operation may be a sliding operation on N elements in the first region. For example, as shown in FIG3A(a), the first operation may be a left sliding operation on the control 101.
[0014] In some embodiments of the present application, the electronic device can remove N elements from the first area simply by performing a specific operation on the first area, without requiring a sliding operation to be performed on the N elements. For example, N can be equal to X, and the electronic device can detect an up / down sliding operation on the first area. In response to the up / down sliding operation, the electronic device can remove all X elements from the first area.
[0015] In conjunction with the first aspect, in one possible implementation, when a preset condition is met, the electronic device removes N elements out of X elements from the first area. Specifically, this may include: when the matters corresponding to the N elements are in a target state, the electronic device may remove the N elements out of the X elements from the first area.
[0016] In the solution provided in this application, the electronic device can automatically remove one or more elements in the first area. Specifically, when the electronic device detects that the items corresponding to N elements out of X elements displayed in the first area are in the target state, the electronic device can remove the N elements from the first area.
[0017] In combination with the first aspect, in a possible implementation, the matters corresponding to the N elements are in a target state, which may specifically include: the matter corresponding to each of the N elements is in a completed state, a viewed state, or a canceled state.
[0018] In the solution provided in the present application, the target status may include a completed status, a viewed status, and a canceled status. When the matter corresponding to each of the N elements is in any of the states included in the target status, the electronic device may remove the N elements from the first area.
[0019] It is understood that if the item corresponding to the element has been completed, the item corresponding to the element is in a completed state. For example, if the current time is later than the arrival time of the user's travel item (such as the high-speed rail arrival time, the plane arrival time, etc.), it can be indicated that the travel item has been completed, and the electronic device can remove the elements corresponding to the travel item (such as controls 101 and controls 103) from the first area. For another example, if the current time is later than the processing time of the user's schedule item, it can be indicated that the schedule item has been completed, and the electronic device can remove the elements corresponding to the schedule item (such as control 102) from the first area.
[0020] Similarly, if the item corresponding to an element has been canceled, the item corresponding to the element is in a canceled state. This situation can be referred to the display scenario shown in Figure 3B. For example, if the electronic device detects the user's refund operation (such as a high-speed rail / plane / train ticket refund), it can indicate that the corresponding travel item has been canceled, and the electronic device can remove the element corresponding to the travel item from the first area. For another example, if the electronic device detects that the user cancels a schedule item (such as a schedule item originally added by the user in the calendar application or a schedule item automatically generated by the electronic device), it can indicate that the corresponding schedule item has been canceled, and the electronic device can remove the element corresponding to the schedule item from the first area.
[0021] Similarly, if the item corresponding to an element has been viewed by the user, the item corresponding to the element is in the viewed state. For example, if the electronic device detects a user operation on a waiting message in a text message application, which indicates that the waiting message has been viewed by the user, the electronic device can remove the element corresponding to the notification item represented by the waiting message from the first area.
[0022] In combination with the first aspect, in a possible implementation, the element displayed in the first area is a notification icon, and the notification icon includes at least one of a travel icon, a message icon, a schedule icon, and a weather icon.
[0023] In some embodiments of the present application, the travel icon may include icons related to travel matters (such as controls 101 and 103), the message icon may include icons related to text messages (such as control 104), the schedule icon may include icons related to schedule matters (such as control 102), and the weather icon may include icons related to weather conditions (such as control 106).
[0024] It is understandable that the notification icon can also include other icons (for example, icons related to sports and health, icons related to audio and video playback, Bluetooth icons, etc.), and this application does not limit this.
[0025] It is understandable that the elements displayed in the first area can also be other types of icons, pictures, etc., and this application does not limit this.
[0026] In conjunction with the first aspect, in one possible implementation, X is greater than N; the method may further include: if a preset condition is met, the electronic device may move other elements of the X elements except the N elements in the first area. The animation type information of the other elements of the X elements except the N elements is second type information.
[0027] In the solution provided in this application, the animation type information of the elements other than the N elements in the X elements is the same as the animation type information of the newly added M elements. The electronic device can simultaneously display the animation of the elements other than the N elements in the X elements and the animation of the newly added M elements, so that the entire animation process will be more continuous and smooth.
[0028] It is understandable that the relevant description of the above simultaneous display can be specifically referred to the relevant description of step S105 later.
[0029] With reference to the first aspect, in a possible implementation, the first type of information is a disappearing animation DISAPPEARING, and the second type of information is an animation CHANGE_DISAPPEARING generated due to disappearance.
[0030] In the solution provided in this application, the first type of information can be the disappearance animation provided by LayoutTransition, namely DISAPPEARING, and the second type of information can be the animation generated by disappearance provided by LayoutTransition, namely CHANGE_DISAPPEARING. DISAPPEARING and CHANGE_DISAPPEARING are animation effects related to disappearance. According to the existing animation mechanism, electronic devices can display disappearance-related animation effects at the same time, that is, electronic devices can display the above two animation effects at the same time.
[0031] In conjunction with the first aspect, in one possible implementation, an electronic device is provided with a first container, the first container including a first area and a second area, the first area being a visible area, the second area being used to cache newly added elements for the first container, and the elements in the second area being all invisible. The electronic device removes N of the X elements from the first area and moves the newly added M elements to before they are displayed in the first area, where the second area may include the M elements. The electronic device moving the M newly added elements to the first area for display may specifically include: the electronic device setting the M elements from an invisible state to a visible state, and moving the M elements from the second area to the first area for display.
[0032] In the solution provided in the present application, the electronic device can add a new element to a container, set the new element to an invisible state, and cache the new element to the user interface in advance. In this way, even if the new element is cached to the user interface, transparent pixels are displayed and the user cannot see the new element. Once the removal of the element in the container is triggered, the electronic device can set the cached new element to a visible state, and simultaneously display an animation of the element to be removed disappearing in the first area, and an animation of the new element appearing in the first area. The electronic device displays an animation of the new element appearing in the first area, which can specifically include: the electronic device can move it from the cache area to the visible area in the container based on the animation type information set for it.
[0033] In some embodiments of the present application, the first container may be the container 1 mentioned below, and the second area may be the area 2 mentioned below.
[0034] In combination with the first aspect, in a possible implementation manner, satisfying a preset condition may further include: X is equal to a first threshold, and the second region includes at least one element.
[0035] In the solution provided by this application, the number of elements that can be accommodated in the first area of the first container is limited, and the maximum number of elements that can be accommodated is a first threshold. When the number of elements that can be accommodated in the first area reaches the upper limit and there is at least one cached element, the electronic device can remove N elements from the X elements included in the first area from the first area and move the M elements cached in the second area (i.e., the newly added M elements) to the first area for display.
[0036] In some embodiments of the present application, the first threshold may be the threshold 1 mentioned below.
[0037] In combination with the first aspect, in a possible implementation, the M elements (ie, the M newly added elements) are the earliest added M elements among the elements included in the second region.
[0038] In the solution provided by this application, the electronic device can display the cached elements in the order of the time of addition. Of course, the electronic device can also display the cached elements according to other rules, which can be referred to later, and this application will not elaborate on them here.
[0039] In combination with the first aspect, in one possible implementation, when N is less than or equal to the total number of elements included in the second region, M is equal to N; when N is greater than the total number of elements included in the second region, M is equal to the total number of elements included in the second region.
[0040] In the solution provided in the present application, if the total number of elements included in the second area is not less than the number of elements to be removed from the first area, the electronic device will move as many cache elements in the second area to the first area as it removes elements from the first area. If the total number of elements included in the second area is less than the number of elements to be removed from the first area, the electronic device may move all cache elements in the second area to the first area.
[0041] In combination with the first aspect, in one possible implementation, the electronic device removes N elements out of X elements from the first area and moves the newly added M elements before the display in the first area. The method may also include: the electronic device can detect and respond to the user's second operation or new notification. When the number of elements included in the first area reaches a first threshold and the number of elements included in the second area does not reach a second threshold, the electronic device can add the first element to the second area and set the first element to an invisible state.
[0042] In the solution provided by this application, the number of elements that can be accommodated in both the first and second regions is limited. If the number of elements that can be accommodated in the second region does not reach the upper limit, the electronic device can cache the newly added elements in the second region so that when the element in the first region is subsequently triggered to be removed, the newly added elements and the elements in the first region can both be animated to disappear, thereby allowing the newly added elements and the visible elements in the first region to display animations simultaneously.
[0043] In some embodiments of the present application, the second operation may be a user operation to add a new element to container 1. For example, long pressing a visible element in container 1 and clicking a new element option. For another example, clicking a new notification option in the settings interface corresponding to container 1.
[0044] In some embodiments of the present application, newly added notification items may be notification items automatically created by the electronic device based on user operations (such as user operations for specific applications mentioned later). For example, the electronic device detects a new schedule item operation for a calendar application. In response to this operation, the electronic device may create a new schedule item. Accordingly, the electronic device may automatically create a corresponding notification item and a corresponding notification icon. For another example, the electronic device may detect a ticket purchase operation for a travel application. In response to this operation, the electronic device may automatically create a corresponding notification item and a corresponding notification icon.
[0045] In some embodiments of the present application, the second threshold may be the threshold 2 mentioned below.
[0046] In conjunction with the first aspect, in one possible implementation, the electronic device removes N of the X elements from the first area and moves the newly added M elements to be displayed before the first area. The method may also include: the electronic device may detect and respond to the user's second operation or newly added notification item, and when the number of elements included in the first area reaches a first threshold and the number of elements included in the second area reaches a second threshold, the electronic device may record the attributes of the first element. If a preset condition is met, the method may also include: if the total number of elements included in the second area is greater than N, the electronic device may add the first element to the second area and set the first element to an invisible state.
[0047] In the solution provided by this application, the number of elements that can be accommodated in both the first and second regions is limited. When the number of elements that can be accommodated in the second region reaches the upper limit, the electronic device can first record the attributes of the newly added elements so that the newly added elements can be cached in the second region in a timely manner after the number of elements in the second region decreases.
[0048] In a second aspect, the present application provides a display method. The method can be applied to an electronic device including a display screen. According to the method, the electronic device can display X elements in the first area of the display screen, and can also remove N elements of the X elements from the first area, and move the newly added M elements to the first area for display. The animation type information of the N elements is the first type of information, and the animation type information of the M elements is the second type of information. The first type of information is used to indicate that the animation disappears, and the second type of information is used to indicate an animation that changes based on the disappearance of the animation. X, N, and M are all positive integers, N is not greater than X, and M is not greater than N.
[0049] In the solution provided in the present application, the electronic device may not directly set the animation type information corresponding to the newly added element to the appearance animation (i.e., the animation type information used to indicate the appearance of the animation), but may set the animation type information corresponding to the newly added element to the animation that changes based on the disappearance of the animation (i.e., the second type of information), so that the animation type of the newly added element is a disappearance-related animation rather than an appearance-related animation. In this way, the animations of the newly added element and the removed element can be displayed at the same time, and the entire animation process will be more continuous and smoother.
[0050] In conjunction with the second aspect, in one possible implementation, X is greater than N; the method may further include: if a preset condition is met, the electronic device may move other elements of the X elements except the N elements in the first area. The animation type information of the other elements of the X elements except the N elements is the second type of information.
[0051] With reference to the second aspect, in a possible implementation manner, the first type of information is DISAPPEARING, and the second type of information is CHANGE_DISAPPEARING.
[0052] In conjunction with the second aspect, in one possible implementation, an electronic device is provided with a first container, the first container including a first area and a second area, the first area being a visible area, the second area being used to cache newly added elements for the first container, and the elements in the second area being all invisible. The electronic device removes N of the X elements from the first area and moves the newly added M elements to the first area before display, and the second area may include the M elements. The electronic device moving the M newly added elements to the first area for display may specifically include: the electronic device setting the M elements from an invisible state to a visible state, and moving the M elements from the second area to the first area for display.
[0053] In combination with the second aspect, in a possible implementation, the M elements (ie, the M newly added elements) are the earliest added M elements among the elements included in the second region.
[0054] In combination with the second aspect, in one possible implementation, when N is less than or equal to the total number of elements included in the second region, M is equal to N; when N is greater than the total number of elements included in the second region, M is equal to the total number of elements included in the second region.
[0055] In combination with the second aspect, in one possible implementation, the electronic device removes N of the X elements from the first area and moves the newly added M elements before the display of the first area. The method may also include: the electronic device can detect and respond to the user's second operation or new notification. When the number of elements included in the first area reaches a first threshold and the number of elements included in the second area does not reach a second threshold, the electronic device can add the first element to the second area and set the first element to an invisible state.
[0056] In conjunction with the second aspect, in one possible implementation, the electronic device removes N of the X elements from the first area and moves the newly added M elements to the front of the display in the first area. The method may also include: the electronic device may detect and respond to the user's second operation or newly added notification item, and when the number of elements included in the first area reaches a first threshold and the number of elements included in the second area reaches a second threshold, the electronic device may record the attributes of the first element. The method may also include: if the total number of elements included in the second area is greater than N, the electronic device may add the first element to the second area and set the first element to an invisible state.
[0057] In a third aspect, the present application provides a display method. The method can be applied to an electronic device including a display screen. According to the method, the electronic device can display X elements in a first area of the display screen, and can also receive a vertical synchronization (VSync) signal. In response to the VSync signal, the electronic device can exit the display of N removed elements in the first area and add M new elements to the first area.
[0058] In the solution provided in the present application, the VSync signal can trigger the electronic device to exit the display of N removed elements in the first area and to add new display of M new elements in the first area, which means that the exit display of N removed elements in the first area and the new display of M new elements in the first area can be understood as simultaneous display.
[0059] In some embodiments of the present application, before receiving a VSync signal, the electronic device may set animation type information for the N elements and the M elements, and measure, lay out, and draw the N elements and the M elements based on the animation type information to obtain a drawing result. After receiving the VSync signal, in response to the VSync signal, the electronic device may display the drawing result, thereby removing the N removed elements from the first area and adding the M newly added elements to the first area.
[0060] It is understandable that based on the vertical synchronization mechanism adopted by the image signal processor, the image signal processor will wait for the VSync signal of the display to be sent before rendering a new frame and updating the buffer.
[0061] It can be understood that exit display refers to the animation display of disappearing from the first area, and new display refers to the animation display of appearing in the first area. It is worth noting that the animation type corresponding to the new display of the M new elements does not belong to the appearance animation (i.e., APPEARING) mentioned later, but is an animation generated by disappearance (CHANGE_DISAPPEARING). The animation effect seen by the user is that the M new elements gradually appear in the first area.
[0062] In combination with the third aspect, in a possible implementation method, in response to a VSync signal, the electronic device exits the display of N removed elements in the first area and adds a new display of M new elements in the first area. Specifically, it may include: when a preset condition is met, the electronic device responds to the VSync signal and can exit the display of N removed elements in the first area and add a new display of M new elements in the first area.
[0063] In the solution provided in the present application, when preset conditions are met and a VSync signal is received, the electronic device can simultaneously exit the display of N removed elements in the first area and add new display of M new elements in the first area.
[0064] In some embodiments of the present application, when a preset condition is met, the electronic device may set the animation type information of the N elements to the first type information, and set the animation type information of the M elements to the second type information. The electronic device may measure, layout, and draw the N elements based on the first type information to obtain corresponding drawing results, and measure, layout, and draw the M elements based on the second type information to obtain corresponding drawing results. When a VSync signal is received, the electronic device may exit the first area (i.e., disappear in the first area) based on the drawing results corresponding to the N elements, and enter the first area (i.e., appear in the first area) based on the drawing results corresponding to the M elements.
[0065] In conjunction with the third aspect, in a possible implementation, satisfying a preset condition may specifically include: the electronic device detecting a first operation of the user.
[0066] In combination with the third aspect, in a possible implementation, the first operation is a sliding operation on the first area.
[0067] In conjunction with the third aspect, in a possible implementation, satisfying the preset condition may specifically include: the matters corresponding to the N elements are in a target state.
[0068] In combination with the third aspect, in a possible implementation, the matters corresponding to the N elements are in a target state, which may specifically include: the matter corresponding to each of the N elements is in a completed state, a viewed state, or a canceled state.
[0069] In combination with the third aspect, in a possible implementation, the element displayed in the first area is a notification icon, and the notification icon includes at least one of a travel icon, a message icon, a schedule icon, and a weather icon.
[0070] In combination with the third aspect, in a possible implementation, X is greater than N; the method may further include: in response to a VSync signal, the electronic device may further perform mobile display of other elements among the X elements in the first area except the N removed elements.
[0071] In the solution provided in the present application, in addition to the N elements removed from the first area and the newly added M elements, after receiving the VSync signal, the electronic device can also perform mobile display of other elements among the X elements included in the first area except the N removed elements.
[0072] In some embodiments of the present application, the animation type information of the other elements in the X elements except the N elements is the second type information.
[0073] In conjunction with the third aspect, in one possible implementation, the animation type information of the N elements is first type information, and the animation type information of the M elements is second type information. The first type information may be used to indicate that the animation disappears, and the second type information may be used to indicate an animation that changes based on the disappearance of the animation.
[0074] In combination with the third aspect, in a possible implementation manner, the first type of information is DISAPPEARING, and the second type of information is CHANGE_DISAPPEARING.
[0075] In conjunction with the third aspect, in one possible implementation, an electronic device is provided with a first container, the first container including a first area and a second area, the first area being a visible area, the second area being used to cache newly added elements for the first container, and the elements in the second area being all in an invisible state. Before the electronic device exits the display of N removed elements in the first area and displays M newly added elements in the first area, the second area may include the M elements. Before the electronic device displays the M newly added elements in the first area, the method may further include: the electronic device may set the M elements from an invisible state to a visible state.
[0076] In conjunction with the third aspect, in a possible implementation, satisfying a preset condition may further include: X is equal to a first threshold, and the second region includes at least one element.
[0077] In combination with the third aspect, in a possible implementation, the M elements (ie, the M newly added elements) are the earliest added M elements among the elements included in the second region.
[0078] In combination with the third aspect, in one possible implementation, when N is less than or equal to the total number of elements included in the second region, M is equal to N; when N is greater than the total number of elements included in the second region, M is equal to the total number of elements included in the second region.
[0079] In combination with the third aspect, in one possible implementation, the electronic device removes N elements out of X elements from the first area and moves the newly added M elements before the display in the first area. The method may also include: the electronic device can detect and respond to the user's second operation or new notification. When the number of elements included in the first area reaches a first threshold and the number of elements included in the second area does not reach a second threshold, the electronic device can add the first element to the second area and set the first element to an invisible state.
[0080] In conjunction with the third aspect, in one possible implementation, the electronic device removes N of the X elements from the first area and moves the newly added M elements to be displayed before the first area. The method may also include: the electronic device may detect and respond to the user's second operation or newly added notification item, and when the number of elements included in the first area reaches a first threshold and the number of elements included in the second area reaches a second threshold, the electronic device may record the attributes of the first element. If a preset condition is met, the method may also include: if the total number of elements included in the second area is greater than N, the electronic device may add the first element to the second area and set the first element to an invisible state.
[0081] In a fourth aspect, the present application provides an electronic device comprising: a display screen, one or more processors, and one or more memories; the display screen can be coupled to the one or more memories and the one or more processors, the display screen can be used to display a picture, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method described in the first aspect or any one of the implementations of the first aspect.
[0082] In a fifth aspect, the present application provides an electronic device comprising: a display screen, one or more processors, and one or more memories; the display screen can be coupled to the one or more memories and the one or more processors, the display screen can be used to display a picture, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method described in the second aspect or any one of the implementations of the second aspect.
[0083] In a sixth aspect, the present application provides an electronic device comprising: a display screen, one or more processors, and one or more memories; the display screen can be coupled to the one or more memories and the one or more processors, the display screen can be used to display a picture, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in the third aspect or any one of the implementations of the third aspect.
[0084] In a seventh aspect, the present application provides a computer storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect.
[0085] In an eighth aspect, the present application provides a computer storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the second aspect or any one of the implementations of the second aspect.
[0086] In a ninth aspect, the present application provides a computer storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the third aspect or any one of the implementations of the third aspect.
[0087] In the tenth aspect, an embodiment of the present application provides a chip, which can be applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute the method described in the first aspect or any implementation method of the first aspect.
[0088] In the eleventh aspect, an embodiment of the present application provides a chip, which can be applied to an electronic device. The chip includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the second aspect or any one of the implementations of the second aspect.
[0089] In the twelfth aspect, an embodiment of the present application provides a chip, which can be applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute the method described in the third aspect or any implementation method of the third aspect.
[0090] In some embodiments of the present application, the chip system may be an application processor (AP) or a system on chip (SoC) including an AP. The method described in the first aspect or any one of the implementations of the first aspect may be implemented by an AP, and the method described in the second aspect or any one of the implementations of the second aspect may be implemented by an AP.
[0091] In some other embodiments of the present application, the chip system may include an AP and other modules, wherein the other modules may be a modem processor (also referred to as a baseband processor).
[0092] In a thirteenth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any one of the implementations of the first aspect.
[0093] In a fourteenth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the second aspect or any one of the implementations of the second aspect.
[0094] In the fifteenth aspect, an embodiment of the present application provides a computer program product containing instructions. When the computer program product is run on an electronic device, the electronic device executes the method described in the third aspect or any one of the implementations of the third aspect.
[0095] It is understood that the electronic device provided in the fourth aspect, the computer storage medium provided in the seventh aspect, the chip provided in the tenth aspect, and the computer program product provided in the thirteenth aspect are all configured to perform the method described in the first aspect or any one of its implementations. Therefore, the beneficial effects achieved by them can refer to the beneficial effects of any possible implementation of the first aspect, and are not further described here. The electronic device provided in the fifth aspect, the computer storage medium provided in the eighth aspect, the chip provided in the eleventh aspect, and the computer program product provided in the fourteenth aspect are all configured to perform the method described in the second aspect or any one of its implementations. Therefore, the beneficial effects achieved by them can refer to the beneficial effects of any possible implementation of the second aspect, and are not further described here. The electronic device provided in the sixth aspect, the computer storage medium provided in the ninth aspect, the chip provided in the twelfth aspect, and the computer program product provided in the fifteenth aspect are all configured to perform the method described in the third aspect or any one of its implementations. Therefore, the beneficial effects achieved by them can refer to the beneficial effects of any possible implementation of the third aspect, and are not further described here. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] FIG1 is an exemplary schematic diagram of a set of user interfaces provided in an embodiment of the present application;
[0097] FIG2A and FIG2B are schematic diagrams of a set of animation effects provided in an embodiment of the present application;
[0098] 3A-3C are exemplary schematic diagrams of another set of user interfaces provided in an embodiment of the present application;
[0099] 4A-4C are schematic diagrams of animation effects of a group of icons provided in an embodiment of the present application;
[0100] FIG5 is a flow chart of a display method provided in an embodiment of the present application;
[0101] 6A-6B are exemplary schematic diagrams of another set of user interfaces provided in an embodiment of the present application;
[0102] 7A and 7B are another set of animation effect diagrams provided in an embodiment of the present application;
[0103] FIG8 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0104] FIG9 is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0105] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0106] It should be understood that the terms "first," "second," and the like in the specification, claims, and drawings of this application are used to distinguish between different objects, rather than to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to such process, method, product, or apparatus.
[0107] It should be understood that the term "user interface" in the specification, claims, and drawings of this application refers to the media interface for interaction and information exchange between an application or operating system and a user. A common form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed graphically. It can be an interface element such as an icon, window, or control displayed on the display screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0108] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0109] Electronic devices often use animation to provide users with a better visual experience. For example, when the elements displayed by the electronic device change (for example, deletion or addition), the electronic device will provide a corresponding animation. However, the animation display is not continuous. The following is an example of updating the notification icon:
[0110] As shown in (a) of Figure 1, the lock screen interface displayed by the electronic device on the display screen may include a display area L1 and a display area L2. Display area L1 may include a control 101. Display area L2 may include a control 102, a control 103, and a control 104. Control 101 is used to prompt flight information, control 102 is used to prompt schedule information, control 103 is used to prompt high-speed rail / train information, and control 104 is used to prompt text messages. In some embodiments of the present application, controls 101 and 103 are controls generated by the user's ticket purchase operation in a travel application, control 102 is a control generated by the user creating a schedule in a calendar application, or a control generated by the electronic device due to other applications triggering the creation of a schedule, and control 104 is a control generated by the SMS application receiving a new text message.
[0111] The electronic device can detect a user operation of sliding leftward on control 101. In response to the user operation, as shown in (b) of Figure 1, the electronic device can move control 101, control 102, control 103 and control 104 to the left until control 101 disappears, control 102 moves to the original position of control 101, control 103 moves to the original position of control 102, and control 104 moves to the original position of control 103. At this time, the electronic device can display the user interface shown in (c) of Figure 1. Further, as shown in (d) of Figure 1, the electronic device can gradually display control 105 and move control 105 to the left from the right boundary of display area L2. Until the electronic device moves control 105 to the original position of control 104 (as shown in (a) of Figure 1), control 105 is no longer moved. At this time, the electronic device can display the user interface shown in (e) of Figure 1. That is to say, the electronic device can first display the animation of control 101 moving to the left and disappearing, as well as the animation of controls 102, 103 and 104 moving to the left. After the animation of controls 101, 102, 103 and 104 are displayed, the electronic device will display the animation of control 105 appearing and moving to the left. The above-mentioned disappearance and appearance animations are not displayed at the same time, which makes the entire animation process discontinuous and not smooth.
[0112] It is understandable that each of the controls 101, 102, 103, 104, and 105 can be considered an element. The display area L1 and the display area L2 can be understood as containers for layout elements.
[0113] The following details the reasons for the above animation discontinuity.
[0114] First, some terminology in the animation field is introduced.
[0115] 1. View and ViewGroup
[0116] View and ViewGroup are the most basic user interface (UI) components. They are the basis for building visible elements on the screen (i.e., display). In the Android operating system (also referred to as the Android system), user interface elements are composed of View objects and ViewGroup objects.
[0117] A View (also called a View object) represents an independent visible element on the screen. It can be simply understood as an object drawn on the screen with which the user can interact. A View can be a text view (TextView), an image view (ImageView), a button (Button), and so on. It can be understood that each of controls 101, 102, 103, 104, and 105 shown in Figure 1 can be considered a View (i.e., an element).
[0118] A ViewGroup (also called a ViewGroup object) is a subclass of View. It is a layout container for storing other Views and ViewGroups and can be used to define the layout of the interface. Direct subclasses of ViewGroup include RelativeLayout, FrameLayout, GridLayout, and LinearLayout. It can be understood that the display areas L1 and L2 shown in Figure 1 (a) can be considered ViewGroups (i.e., containers for layout elements).
[0119] 2. Layout animation (LayoutTransition)
[0120] LayoutTransition is a helper class for animating the layout of a ViewGroup. Specifically, LayoutTransition can be used to animate all child Views in a ViewGroup when a child View is added, deleted, or moved.
[0121] It can be understood that the animation effect involved in this application refers to animation, that is, the continuous display of pictures within a period of time.
[0122] LayoutTransition can provide five types of animation changes (animation effect types, which can be referred to as animation effects or animation types for short) for View in ViewGroup:
[0123] (1) APPEARING: The animation effect when a View is added to a container (i.e., ViewGroup).
[0124] (2) Animation caused by appearance (CHANGE_APPEARING): Since a new View is to be added to the container, the animation effects of other Views in the container.
[0125] (3) Disappearing animation (DISAPPEARING): The animation effect when the View is removed from the container.
[0126] (4) Animation caused by disappearance (CHANGE_DISAPPEARING): Because a View is to be removed from the container, the animation effects of other Views in the container.
[0127] (5) Animation caused by other layout changes (CHANGING): When the position of the View in the container changes, the animation effect of other Views in the container.
[0128] Due to the limitations of the LayoutTransition setting mechanism, when electronic devices use LayoutTransition to set layout change animation effects within a container, they cannot simultaneously execute appearance-related animation effects (including APPEARING and CHANGE_APPEARING) and disappearance-related animation effects (including DISAPPEARING and CHANGE_DISAPPEARING). This means that if a View needs to be removed from a container and a View needs to be added at the same time, the electronic device can only display the disappearance-related animation effects first, and then display the appearance-related animation effects after the disappearance-related animation effects are displayed. This will cause the entire animation to be incoherent and not smooth.
[0129] For example, as shown in FIG2A , an electronic device may display ViewA and ViewB on a display screen. ViewA and ViewB are two sub-Views in ViewGroup1. If the electronic device needs to remove ViewA from ViewGroup1 and add ViewC to ViewGroup1, the electronic device may first display a disappearance-related animation effect, and then display an appearance-related animation effect after the disappearance-related animation is displayed. In other words, the electronic device will only start displaying the animation effect of adding ViewC when only ViewB in ViewGroup1 is displayed.
[0130] Specifically, as shown in Figure 2B, if the electronic device needs to remove ViewA in ViewGroup1 and add ViewC in ViewGroup1, the electronic device can first set the animation type of ViewA to DISAPPEARING, set the animation type of ViewB to CHANGE_DISAPPEARING, and set the animation type of ViewC to APPEARING. The electronic device can first execute the disappearance-related animation effects, that is, display the above-mentioned animation effects set for ViewA and ViewB at the same time. As shown in Figure 2B, ViewA and ViewB can move to the left until ViewA moves to the left boundary of ViewGroup1 and disappears completely, and ViewB moves to the original position of ViewA. It can be understood that after the above-mentioned animation effects set for ViewA and ViewB are displayed, the electronic device only displays ViewB in ViewGroup1.
[0131] Furthermore, after the disappearance-related animation effect is displayed, the electronic device can execute the appearance-related animation effect, that is, display the animation effect set for ViewC. As shown in Figure 2B, ViewC moves from the right edge of ViewGroup1 to the left until it fully appears and moves to the original position of ViewB. It can be understood that after the animation effect set for ViewC is displayed, the electronic device can display ViewB and ViewC in ViewGroup1.
[0132] In some embodiments of the present application, the electronic device may set the animation type of ViewC to APPEARING and execute the appearing animation after the disappearance-related animation effects are displayed.
[0133] In the above manner, the electronic device cannot display the animation effect set for ViewA and ViewB at the same time as the animation effect set for ViewC, resulting in an unsmooth animation effect throughout the process.
[0134] Based on the above content, the present application provides a display method and related equipment. According to the method, the electronic device can cache the newly added View object to the user interface in advance and set it to an invisible state. If the electronic device detects a removal operation for the View object in the container, the electronic device sets the animation type of the View object to be removed to DISAPPEARING, sets the animation types of other View objects in the container and the newly added View object to CHANGE_DISAPPEARING, and sets the newly added View object to a visible state. The electronic device can simultaneously execute the above animations for each View object and display the corresponding animation effects on the display screen. Through this method, the electronic device can simultaneously display the animation effects of removing and adding View objects, without having to display the animation effect of removing the View object and then displaying the animation effect of adding the View object, so that the entire animation effect is coherent and smooth.
[0135] The following is an exemplary introduction to a display scenario provided by this application.
[0136] 3A-3C are exemplary schematic diagrams of a set of user interfaces provided in an embodiment of the present application.
[0137] As shown in (a) of FIG3A , the electronic device can display controls 101, 102, 103, and 104 on the display screen. Control 101 is located in display area L1, and controls 102, 103, and 104 are located in display area L2. It is understood that the description of controls 101, 102, 103, and 104 can be found above, and this application will not elaborate on this.
[0138] The electronic device may remove any one or more elements from the control 101, the control 102, the control 103, and the control 104. Accordingly, the electronic device may simultaneously display the animation effects of the removed elements and the animation effects of other elements.
[0139] For example, the electronic device may detect a leftward swipe action on control 101. In response to the leftward swipe action, the electronic device may simultaneously move control 101, as well as controls 102, 103, and 104 in display area L2, to the left. At a certain point during the process of the electronic device moving controls 101, 102, 103, and 104 to the left, the electronic device may display a user interface as shown in FIG3A(b). As shown in FIG3A(b), during the process of the electronic device moving controls 101, 102, 103, and 104 to the left, control 101 gradually disappears, control 102 gradually moves to its original position and displays its corresponding notification content (such as "Next Schedule Starts at 8:00 AM" as shown in FIG3A(c)). Control 103 gradually moves to its original position, control 104 gradually moves to its original position, and control 105 gradually appears on the display screen and gradually moves to its original position.
[0140] It is understandable that the electronic device will not stop moving controls 101, 102, 103, and 104 until control 101 disappears, control 102 moves to the original position of control 101, control 103 moves to the original position of control 102, control 104 moves to the original position of control 103, and control 105 moves to the original position of control 104. In this case, the electronic device can display the user interface shown in (c) of Figure 3A.
[0141] Comparing FIG1 and FIG3A , the animation shown in FIG3A is more continuous and smoother than the animation shown in FIG1 .
[0142] It will be understood that the present application also provides other methods of triggering an electronic device to remove one or more elements in controls 101, 102, 103, and 104 (for example, the user long presses or double-clicks the element, the user deletes the corresponding information in a specific application, the matter corresponding to the element has been completed / canceled / viewed). The present application does not limit the specific method of triggering an electronic device to remove elements.
[0143] For example, a user can cancel flights and high-speed rail travel items in a travel application, and cancel the schedule item (i.e., schedule) at 8:00 a.m. in a calendar application. Accordingly, the electronic device can detect the user operation on the travel application and the calendar application. In this case, the electronic device can determine that the items corresponding to controls 101, 102, and 103 have been canceled, thereby triggering the removal of the corresponding controls in the user interface shown in (a) of Figure 3B. After the electronic device determines that the items corresponding to controls 101, 102, and 103 have been canceled, it can remove controls 101, 102, and 103. Specifically, the electronic device can move controls 101, 102, 103, and 104 to the left, and in the process of the electronic device moving controls 101, 102, 103, and 104 to the left, as shown in (b) in FIG3B , controls 101, 102, and 103 gradually disappear, control 104 gradually moves to the original position of control 101, and displays its corresponding notification content ("There is a message to be read" as shown in (c) in FIG3B ), controls 105 and 106 gradually appear on the display screen, and move as control 104 moves to the left, as shown in (c) in FIG3B , control 105 finally moves to the original position of control 102, and control 106 finally moves to the original position of control 103.
[0144] In some embodiments of the present application, as shown in Figure 3C, the electronic device may only display display area L2 on the display screen, but not display display area L1, that is, the electronic device only displays controls 102, controls 103 and controls 104 on the display screen, but not control 101 on the display screen.
[0145] The following specifically describes the changes in the controls in the display area L1 and the display area L2 by taking FIG. 4A to FIG. 4C as examples.
[0146] 1. Remove a View from the container
[0147] As shown in FIG4A , the electronic device can detect the operation of adding a new View. In response to this operation, the electronic device can measure, layout, and draw the newly added View, i.e., control 105, add it to the buffer area of the container, and set it to an invisible state. In other words, although the electronic device draws control 105 and displays it, the user cannot see control 105 on the display screen.
[0148] The electronic device can detect the removal of a View (e.g., control 101) in a container. In response to this removal, the electronic device can set animation effects for the Views in the container (i.e., controls 101, 102, 103, 104, and 105) and set the newly added View (i.e., control 105) to a visible state. As shown in FIG4A , the electronic device can simultaneously perform animation effects on controls 101, 102, 103, 104, and 105.
[0149] In some embodiments of the present application, the presence of cached elements in a container does not affect the display of visible elements in the container. For example, as shown in FIG4A , before and after the electronic device adds control 105 to the container cache, the visible elements in the container displayed by the electronic device (i.e., controls 101, 102, 103, and 104) do not change. Specifically, the content displayed by the visible elements of the container does not change.
[0150] In some embodiments of the present application, the presence of cached elements in a container may affect the display of visible elements in the container. In one possible implementation, if a cached element exists in the container, that is, the total number of Views in the container is greater than the total number of visible Views therein, the electronic device may change the display content of the last visible element added to the container.
[0151] For example, as shown in FIG4B , after the electronic device adds the newly added View to the cache area of the container, the total number of Views in the container is 5, but it only displays 4 visible Views (control 101, control 102, control 103, and control 104). In this case, the electronic device can change the display content of the last visible View added to the container (i.e., control 104). Specifically, as shown in FIG4B , the display content of control 104 is changed from an icon with a message box to an icon with an ellipsis. The electronic device can detect a removal operation on a View in a container (e.g., control 101). In response to the operation, the electronic device can set animation effects for the Views in the container (i.e., control 101, control 102, control 103, control 104, and control 105), and set the newly added View (i.e., control 105) to a visible state. As shown in Figure 4B, the electronic device can simultaneously execute animation effects for control 101, control 102, control 103, control 104 and control 105, and since the total number of Views in the container is equal to the number of visible Views after the electronic device removes the View in the container, the electronic device can restore its display content to its original display content during the process of executing the animation effect of control 104, that is, restore the display content of control 104 from an icon with an ellipsis to an icon with a message box.
[0152] 2. Remove multiple Views from the container
[0153] After the electronic device adds control 105 to the container's cache area and sets it to an invisible state, it can continue to add views. As shown in Figure 4C, the electronic device can continue to add views. Similar to the operation for control 105, the electronic device can specifically measure, layout, and draw the further added view, namely control 106, add it to the container's cache area, and set it to an invisible state. Similar to control 105, although the electronic device draws control 106 and displays it, the user cannot see control 106 on the display screen.
[0154] The electronic device can detect a removal operation for multiple Views (e.g., control 101, control 102, and control 103) in a container. In response to this operation, the electronic device can set animation effects for the Views in the container (i.e., control 101, control 102, control 103, control 104, control 105, and control 106) and set the newly added Views (i.e., control 105 and control 106) to a visible state. As shown in Figure 4C, the electronic device can simultaneously execute animation effects for control 101, control 102, control 103, control 104, control 105, and control 106.
[0155] It is understood that the specific content and form of the animation effect can be set according to actual needs, and this application does not impose any restrictions on this. For example, the animation effect for the removed View can be collapsed and then disappeared as shown in Figures 4A and 4B, or it can be reduced and then disappeared as shown in Figure 4C. For another example, the animation effect for the other Views in the container except the removed View can be moved to the left.
[0156] A display method provided by an embodiment of the present application is introduced below.
[0157] Please refer to FIG5 , which shows a display method provided by an embodiment of the present application. The method can be applied to electronic devices. The method may specifically include but is not limited to the following steps:
[0158] S101: An operation of adding a new element to container 1 is detected.
[0159] It is understood that container 1 can refer to a display area on a user interface for layout elements. In some embodiments of the present application, container 1 can be a ViewGroup (e.g., ViewGroup1), and the elements can be Views. The elements in container 1 can be understood as child Views in container 1, and container 1 can be understood as the parent container of the elements in container 1.
[0160] It is understandable that the layout rules of container 1 can be set according to actual needs, and this application does not impose any restrictions on this. Layout rules may include layout form and layout spacing, etc. Layout forms may include relative layout, linear layout, frame layout and grid layout, etc. Layout spacing may include the spacing between elements. For example, a relative layout can be adopted in container 1, and the distance between the elements in container 1 and the surrounding elements can be 10pd. PD refers to density-independent loudness, which is an abstract unit that is independent of screen density and is typically used to define view dimensions (for example, width, height, spacing, etc.).
[0161] It should be noted that this application does not impose any specific restrictions on the content displayed by container 1. In some embodiments of this application, container 1 is used to display notification icons and corresponding notification items. For example, container 1 may include display area L2 as shown in Figure 3A. For example, container 1 may include display area L1 and display area L2 as shown in Figure 3A.
[0162] In some embodiments of the present application, the electronic device can detect a user operation on a specific application. In response to the user operation, the electronic device can add a new element to the container 1. That is, the electronic device can remind the user of specific matters of the specific application by displaying relevant content of the specific application on the display screen (for example, pending matters, travel arrangements, weather reminders, health reminders, etc.). It is understood that specific applications may actually require settings, and this application does not impose any restrictions on this.
[0163] For example, the electronic device may detect a new schedule item operation on a calendar application. In response to this operation, the electronic device may create a new schedule item. Accordingly, after the schedule item is created, the electronic device may add a new element corresponding to the schedule, such as a notification icon corresponding to the new schedule item, to container 1. For another example, the electronic device may detect a ticket purchase operation on a travel application. In response to this operation, the electronic device may add a new element corresponding to the travel item, such as a notification icon corresponding to the travel item, to container 1.
[0164] In some embodiments of the present application, the user can add new elements to container 1. In one possible implementation, the electronic device detects a user operation on container 1 (for example, long pressing a visible element in container 1 and clicking a new element option). In response to the user operation, the electronic device can add a new element to container 1. In another possible implementation, the electronic device can detect a user operation on a corresponding setting option in a setting interface corresponding to container 1 (for example, clicking a new notification option in a setting interface corresponding to container 1). In response to the user operation, the electronic device can add a new element to container 1.
[0165] S102: In response to the operation of adding a new element to container 1, when the number of elements included in area 1 in container 1 reaches threshold 1 and the number of elements included in area 2 in container 1 does not reach threshold 2, the new element is added to area 2 in container 1 and the new element is set to an invisible state.
[0166] It can be understood that after the electronic device automatically triggers the addition of a new element to container 1, or the user triggers the electronic device to add a new element to container 1, the electronic device can determine whether the number of elements included in area 1 in container 1 reaches threshold 1, and determine whether the number of elements included in area 2 in container 1 reaches threshold 2. If the number of elements included in area 1 has reached threshold 1 and the number of elements included in area 2 has not reached threshold 2, the electronic device can add the new element to area 2 in container 1 and set the new element to an invisible state.
[0167] It is understood that container 1 can include area 1 and area 2. Area 1 can be used to layout visible elements, and area 2 can be used to cache newly added elements (only new elements added to container 1). The elements cached in area 2 are all in an invisible state. In other words, elements placed in area 1 are visible, while elements placed in area 2 are invisible. It is understood that area 2 in container 1 can be the cache area in the container mentioned above.
[0168] For example, area 1 in container 1 may include display area L2. In this case, controls 102, 103, and 104 may be understood as elements in area 1. For example, area 1 in container 1 may include display area L1 and display area L2. In this case, controls 101, 102, 103, and 104 may be understood as elements in area 1.
[0169] It is understandable that the size and position of the container 1, as well as the size and position of the area 1 and the area 2 can be set according to actual needs, and this application does not impose any restrictions on this.
[0170] It is understood that the number of elements that can be laid out in Area 1 is limited. Threshold 1 can be understood as the maximum number of elements that can be laid out in Area 1 of Container 1, or the maximum number of elements that can be displayed in Container 1. Threshold 1 is a positive integer, and its specific value can be set according to actual needs, and this application does not impose any restrictions on this. For example, Threshold 1 can be 2. In other words, the maximum number of elements that can be laid out in Area 1 can be 2. For another example, Threshold 1 can be 3.
[0171] Similarly, the number of elements that can be laid out in area 2 is limited. In this case, after the electronic device detects the operation of adding a new element to container 1, it is necessary not only to determine whether the number of elements included in area 1 has reached threshold 1, but also to determine whether the number of elements included in area 2 has reached threshold 2. Threshold 2 can be understood as the maximum number of elements that can be laid out in area 2, or it can be understood as the maximum number of elements that can be cached by container 1. It can be understood that threshold 2 is a positive integer, and its specific value can be set according to actual needs, and this application does not impose any restrictions on this. For example, threshold 2 can be 2. That is to say, the maximum number of elements that can be laid out in area 2 can be 2. For another example, threshold 2 can be 3.
[0172] Exemplarily, the maximum number of elements that can be laid out in area 1 of container 1 can be 2 (i.e., threshold 1 is 2), and the maximum number of elements that can be laid out in area 2 of container 1 can also be 2 (i.e., threshold 2 is 2). As shown in (1) in FIG6A , area 1 can include ViewA and ViewB, and has reached the maximum number of elements that can be laid out, while no elements are laid out in area 2. In this case, since the number of elements included in area 1 has reached threshold 1, and area 2 has not yet cached any elements, if the electronic device detects an operation to add ViewC to container 1, in response to the operation, the electronic device can add ViewC to area 2 of container 1 and set it to an invisible state. As shown in (2) in FIG6A , area 1 includes ViewA and ViewB, and area 2 includes ViewC. However, for the user, ViewA and ViewB in area 1 displayed by the electronic device are visible, while ViewC in area 2 displayed by the electronic device is invisible. It can be understood that in this case, since the cached elements in area 2 have not reached threshold 2, if the electronic device continues to detect the operation of adding ViewD to container 1, in response to the operation, the electronic device can continue to add ViewD to area 2 in container 1 and set it to an invisible state.
[0173] It can be understood that the electronic device can realize the display of the View on the display screen based on the drawing mechanism of the View. The entire drawing mechanism can include a measurement phase, a layout phase, and a drawing phase. In the measurement phase, the electronic device can calculate the size of each View in the view hierarchy. In the layout phase, the electronic device can determine the layout position of the View based on the size of the View obtained in the measurement phase and the layout rules of the parent container, thereby determining the exact position and size of each View on the display screen. In the drawing phase, the electronic device can perform a drawing operation and display the drawing results on the display screen. It should be noted that the user interface is composed of various Views. Therefore, the electronic device can use the above-mentioned drawing mechanism to draw the entire user interface and display it on the display screen.
[0174] In some embodiments of the present application, the electronic device adds a new element to area 2 in container 1, which may specifically include: the electronic device may set the new element as a sub-View of container 1, then measure the size of the new element, and determine the layout position of the new element based on the layout rule of container 1. Specifically, since the elements included in area 1 in container 1 have reached threshold 1, and the elements included in area 2 in container 1 have not reached threshold 2, the electronic device may determine the specific layout position of the new element in area 2 based on the number of laid out elements (i.e., cached elements) in area 2, and then draw the new element and display the drawing result on the display screen.
[0175] In some embodiments of the present application, an electronic device can make a new element invisible by setting its transparency. For example, the electronic device can set the alpha corresponding to the new element to 0, i.e., set the transparency of the new element to 100%. This means that after the electronic device sets the alpha corresponding to the new element to 0, during the drawing phase, the electronic device draws transparent pixels when drawing the new element. Even if the drawing result is subsequently displayed, the user will not be able to see the new element on the display.
[0176] In some embodiments of the present application, the electronic device can specifically set the visibility of the new element through the setvisibility method. Specifically, the electronic device can set the new element to an invisible state by calling the setvisibility method and setting its parameter to View.INVISIBLE (the constant 4 can also be used instead of the parameter when used). It can be understood that the setvisibility method has 3 parameters - View.VISIBLE (the corresponding constant is 0), View.INVISIBLE (the corresponding constant is 4) and View.GONE (the corresponding constant is 8). Among them, View.VISIBLE can be used to set the View to be visible, and the View will occupy the allocated layout space; View.INVISIBLE can be used to set the View to be invisible, and the View will occupy the allocated layout space; View.GONE can be used to set the View to be invisible, and the View will not occupy the allocated layout space.
[0177] In some embodiments of the present application, if the elements included in area 2 in container 1 have reached threshold 2, the electronic device can record relevant information of the new element (for example, size, position, transparency and other properties) after detecting the operation of adding a new element to container 1, so that after the element in container 1 is subsequently removed, the new element can be cached based on the relevant information of the new element. Once the element in container 1 is removed, the electronic device can determine the size of the new element based on the relevant information of the new element it records, and determine the layout position of the new element according to its size and the layout rules of its parent container (i.e., container 1), thereby determining the exact position and size of each View on the display screen. Then, the electronic device can perform drawing operations on it based on its properties such as transparency, and display the drawing results on the display screen.
[0178] S103: A removal operation on the N elements included in region 1 is detected.
[0179] In some embodiments of the present application, the electronic device can automatically remove elements from container 1 (including elements in area 1 and elements in area 2). In one possible implementation, the electronic device can automatically remove the element after the corresponding event has been processed (completed). For example, if the electronic device detects that the current time is later than the arrival time of the user's travel event (such as the arrival time of a high-speed train or a plane), the electronic device can remove the element corresponding to the travel event from container 1. For another example, if the electronic device detects that the current time is later than the processing time of a schedule event, the electronic device can remove the element corresponding to the schedule event from container 1. As shown in Figure 3A, after the schedule that starts at 8:00 ends, the electronic device can remove control 102. In one possible implementation, the electronic device can automatically remove the element after the corresponding event is canceled. For example, if the electronic device detects that the user cancels the travel event (such as a ticket refund operation), the electronic device can remove the element corresponding to the travel event from container 1. For another example, if the electronic device detects that the user cancels the schedule event, the electronic device can remove the element corresponding to the schedule event from container 1. In one possible implementation, the electronic device can automatically remove the element after the corresponding event has been viewed. For example, once the electronic device detects that the user views the to-be-read text message, the electronic device may remove the element corresponding to the to-be-read text message in the container 1 .
[0180] In some embodiments of the present application, an electronic device can detect a user operation on a specific application and, in response to the user operation, remove an element from container 1. For example, a user can cancel a schedule item in a calendar application (e.g., an 8:00 AM schedule). Accordingly, the electronic device can detect the user operation of canceling the schedule item in the calendar application. In response to the user operation, the electronic device can delete the schedule item and remove the element corresponding to the schedule item in container 1 (e.g., control 102). For another example, a user can refund a previously purchased plane ticket through a travel application. Accordingly, the electronic device can detect the refund operation on the travel application. In response to the operation, the electronic device can refund the ticket and remove the element corresponding to the travel item in container 1 (e.g., control 101).
[0181] In some embodiments of the present application, a user can remove an element included in area 1 of container 1. For example, a user can remove an element included in area 1 of container 1 by sliding the element. Specifically, in one possible implementation, the electronic device can detect a leftward sliding operation on an element included in area 1 of container 1, and in response to the operation, the electronic device can remove the element from container 1. For example, as shown in FIG3A , the electronic device can detect a leftward sliding operation on control 101, and in response to the operation, the electronic device can remove control 101.
[0182] S104: In response to the removal operation on the N elements included in region 1, if the number of elements included in region 1 reaches threshold 1 and region 2 includes at least one element, set the animation effect of the N elements to be removed in region 1 to DISAPPEARING, set the animation effect of the elements other than the N elements to be removed in region 1 to CHANGE_DISAPPEARING, set the animation effect of the M elements in region 2 to CHANGE_DISAPPEARING, and set the M elements in region 2 to a visible state. N and M are positive integers. N is not greater than the total number of elements included in region 1.
[0183] In some embodiments of the present application, after the electronic device detects a removal operation on N elements included in area 1 in container 1, it can determine whether the number of elements included in area 1 reaches threshold 1, and determine whether area 2 includes at least one element.
[0184] When the number of elements included in area 1 reaches threshold 1 and area 2 includes at least one element, in response to the above-mentioned removal operation on the N elements in area 1, the electronic device can set corresponding animations for each element in area 1 (including the N elements to be removed in area 1) and the M elements in area 2. Specifically, the electronic device can set the animation effect of the N elements to be removed in area 1 to DISAPPEARING, set the animation effect of other elements in area 1 except the N elements to be removed to CHANGE_DISAPPEARING, set the animation effect of the M elements in area 2 to CHANGE_DISAPPEARING, and set the M elements in area 2 from an invisible state to a visible state.
[0185] It should be noted that, when the number of elements included in area 2 is 0, regardless of whether the number of elements included in area 1 reaches threshold 1, the electronic device can set the animation effect of the N elements in area 1 that are about to be removed to DISAPPEARING, and set the animation effect of other elements in area 1 except the N elements that are about to be removed to CHANGE_DISAPPEARING.
[0186] Specifically, when the number of elements included in area 1 reaches threshold 1 and the number of elements included in area 2 is 0, the electronic device sets the animation effect of the N elements in area 1 that are about to be removed to DISAPPEARING, and sets the animation effect of other elements in area 1 except the N elements that are about to be removed to CHANGE_DISAPPEARING.
[0187] It can be understood that M is the minimum of the total number of elements included in area 2 and N, that is, M=min{the total number of elements included in area 2, N}. Specifically, when the total number of elements included in area 2 is greater than or equal to N, M is equal to N, and when the total number of elements included in area 2 is less than N, M is the total number of elements included in area 2. Exemplarily, as shown in Figure 4C, the elements in area 1 may include control 101, control 102, control 103 and control 104, and the elements in area 2 may include control 105 and control 106. If N=1, and the element to be removed in the electronic device is control 101, then the total number of elements included in area 2 (the total number of elements included in area 2 is 2) is greater than N, then the electronic device can set one element in area 2 from an invisible state to a visible state, and set a corresponding animation effect (i.e., CHANGE_DISAPPEARING) for it. If N=3, and the elements to be removed in the electronic device are control 101, control 102, and control 103, then the total number of elements included in area 2 is less than N, and the electronic device can set all elements in area 2 (i.e., control 105 and control 106) from an invisible state to a visible state, and set a corresponding animation effect (i.e., CHANGE_DISAPPEARING) for them.
[0188] It can be understood that the N elements to be removed from the above-mentioned region 1 can be any N elements included in the region 1, and this application does not limit their specific positions and order in region 1.
[0189] It is understandable that the present application does not impose any specific restrictions on the selection rules of the M elements in the above-mentioned area 2. In some embodiments of the present application, the M elements in the above-mentioned area 2 are the M elements added earliest in area 2. Exemplarily, as shown in Figure 4C, area 2 may include control 105 and control 106, and the moment when the electronic device adds control 105 to area 2 is earlier than the moment when it adds control 106 to area 2. If the N elements in area 1 that are about to be removed are control 101, then the M elements in area 2 are control 105. If the N elements in area 1 that are about to be removed are control 101, control 102 and control 103, then the M elements in area 2 are control 105 and control 106. In some other embodiments of the present application, the selection of the M elements in the above-mentioned area 2 depends on other elements. Once other elements change, the M elements in the above-mentioned area 2 selected by the electronic device will also change accordingly. In some other embodiments of the present application, the M elements in the above-mentioned area 2 can be the M elements with the highest priority in area 2. It is understandable that this application does not limit the priority setting rules of each element in container 1.
[0190] It is understood that the specific animations corresponding to DISAPPEARING and CHANGE_DISAPPEARING can be set according to actual needs and are not limited in this application. The specific animations may include translation animation, scaling animation, transparency animation, and rotation animation. The specific animations may specifically involve changes in View properties (e.g., size, position, transparency, etc.).
[0191] In some embodiments of the present application, the electronic device may make the M elements in the aforementioned area 2 visible from invisible by setting the transparency of the M elements. For example, the electronic device may set the alpha corresponding to the M elements in the aforementioned area 2 to 1, that is, set the transparency of the M elements to 0%.
[0192] In some embodiments of the present application, the electronic device may specifically set the visibility of the M elements in the above-mentioned area 2 through the setvisibility method. Specifically, the electronic device may set the M elements in area 2 to a visible state by calling the setvisibility method and setting its parameter to View.VISIBLE (the constant 0 may also be used to replace the parameter when used).
[0193] S105: Simultaneously update the elements included in region 1 and the elements included in region 2.
[0194] After the electronic device sets corresponding animation effects for each element in area 1 and the M elements in area 2 respectively, the electronic device can display the animation effect. According to the animation effect, the electronic device can simultaneously update the elements included in area 1 and the elements included in area 2. Specifically, the electronic device can remove N elements from area 1 and move the M elements in area 2 from area 2 to area 1 for display. It should be noted that in some embodiments of the present application, in the process of the electronic device displaying the animation effect set for the M elements in the above-mentioned area 2 (that is, moving the M elements in area 2 from area 2 to area 1), the M elements can gradually change from invisible to visible, that is, the transparency of the M elements can gradually change from 100% to 0%.
[0195] In some embodiments of the present application, the electronic device can simultaneously update the elements included in area 1 and the elements included in area 2, which may specifically include: the interval between the moment when the electronic device starts updating the elements included in area 1 and the moment when it starts updating the elements included in area 2 is no more than T1.
[0196] In some embodiments of the present application, the electronic device may simultaneously update the elements included in area 1 and the elements included in area 2, which may specifically include: the electronic device completes the update of the elements included in area 1 and the elements included in area 2 within T2.
[0197] It is understandable that T1 and T2 can be set according to actual needs, and this application does not impose any restrictions on this.
[0198] It is understood that before the electronic device draws each frame of the user interface, the electronic device can change the properties of the elements included in Area 1 and Area 2 (including the N elements in Area 1 that will be removed and the M elements in Area 2). After the properties of these elements are changed, they are drawn on the display screen for display based on the changed properties of these elements. In other words, the electronic device can achieve its corresponding animation effect by changing the properties (for example, size, position, transparency, etc.) of the elements included in Area 1 and Area 2 frame by frame.
[0199] Specifically, in the process of the electronic device performing corresponding animation effects on the N elements in area 1 that are about to be removed, other elements in area 1, and M elements in area 2, based on the movement rules and speed corresponding to the animation effect (for example, moving 30dp to the left and completing the movement within 3 seconds), and the display frame rate of the user interface, the electronic device can determine the positions of the N elements in area 1 that are about to be removed, other elements in area 1, and M elements in area 2 in the next frame of the user interface, as well as the size of the area where these elements are located in area 1.
[0200] In some embodiments of the present application, the electronic device can make the portion of the element located in area 1 visible, while the portion located in other areas is invisible by setting transparency. Specifically, the electronic device can change the positions of the N elements in area 1 that are about to be removed, the positions of other elements in area 1, and the M elements in area 2 based on its determination of the positions of these elements in the next frame of the user interface, and change the transparency of these elements based on its determination of the size of the portion of these elements located in area 1 in the next frame of the user interface. Specifically, the electronic device can set the alpha corresponding to the portion of these elements located in area 1 to 1, and set the alpha corresponding to the portion of these elements located outside area 1 to 0.
[0201] In some embodiments of the present application, the electronic device can directly change the size and position of the element to make the portion of the element located in area 1 visible and the portion located in other areas invisible. Specifically, the electronic device can directly change the position and size of these elements based on its determination of the positions of the N elements to be removed from area 1, other elements in area 1, and M elements in area 2 in the next frame of the user interface, as well as the sizes of the portions of these elements located in area 1.
[0202] For example, the N elements to be removed in area 1 may be ViewA, area 1 may also include ViewB, and the M elements in area 2 may be ViewC, and ViewA, ViewB, and ViewC originally have the same size. In the process of the electronic device executing DISAPPEARING for ViewA, CHANGE_DISAPPEARING for ViewB, and CHANGE_DISAPPEARING for ViewC, the electronic device may change the properties of ViewA, ViewB, and ViewC frame by frame. Specifically, in the process of the electronic device executing the animation effects corresponding to ViewA, ViewB, and ViewC, according to the movement rules and speed corresponding to the animation effect, if ViewA, ViewB, and ViewC are moved to the boundary of area 1 according to their original size, at a certain moment, only a part of ViewA is located in area 1, all of ViewB is located in area 1, a part of ViewC is located in area 1, and the other part is located in area 2. In this case, the electronic device can determine the size and position of the portion of ViewA located in area 1, adjust the size and position of ViewA to the size and position of the portion of ViewA located in area 1, determine the size and position of the portion of ViewC located in area 1, and then adjust the size and position of ViewC to the size and position of the portion of ViewC located in area 1. The electronic device can also determine that the size of ViewB remains unchanged, determine the position of ViewB, and adjust the position of ViewB accordingly. The electronic device can draw the next frame of the user interface based on the adjusted sizes and positions of ViewA, ViewB, and ViewC, and display it on the display screen. As shown in (3) in Figure 6A, compared with the positions of ViewA, ViewB, and ViewC shown in (2) in Figure 6A, the positions of ViewA, ViewB, and ViewC shown in (3) in Figure 6A have all changed, and ViewA and ViewB in (2) in Figure 6A are all visible, ViewC in (2) in Figure 6A is not visible, while ViewA in (3) in Figure 6A is only partially visible, ViewB in (3) in Figure 6A is still fully visible, and ViewC in (3) in Figure 6A is partially visible. It can be understood that after the animation effects for ViewA, ViewB and ViewC are executed and displayed, the electronic device can display the user interface shown in (4) in Figure 6A, that is, only ViewB and ViewC are displayed.
[0203] It can be understood that the animation effects corresponding to the other elements in area 1 and the M elements in area 2 are all CHANGE_DISAPPEARING. In some embodiments of the present application, the electronic device can add other effects to the M elements on the basis of CHANGE_DISAPPEARING. For example, the electronic device can set the transparency of the M elements to gradually change from 0 to 1. Specifically, the electronic device can set the transparency of the part of the M elements outside area 1 to 0 and remain unchanged, and set the transparency of the part of the M elements inside area 1 to gradually change from 0 to 1 (for example, the transparency of the user interface changes by 0.1 each time a frame is refreshed).
[0204] In some embodiments of the present application, region 2 may include elements other than the aforementioned M elements. In this case, as the elements in region 1 and the M elements in region 2 move, the other elements in region 2 may also move accordingly. However, the elements other than the aforementioned M elements in region 2 are invisible to the user, and their movement process is also invisible. For example, as shown in (1) and (2) in FIG6B , as ViewA, ViewB, and ViewC move, ViewD in region 2 may also move accordingly until it moves to the original position of ViewC and then stops moving. However, the user cannot see the movement process of ViewD on the display screen.
[0205] According to the above, if the elements included in area 2 of container 1 have reached threshold 2, the electronic device can record the relevant information of the new element (for example, size, position, transparency and other properties) after detecting the operation of adding a new element to container 1. After the subsequent electronic device detects the removal operation of N elements in area 1, it can not only set an animation effect for the elements in container 1 and execute the animation effect, but also determine the size of the new element based on the relevant information of the new element recorded, and determine the layout position of the new element based on its size and the layout rules of its parent container (i.e., container 1), thereby determining the exact position and size of each View on the display screen. Then, the electronic device can draw it based on its transparency and other properties and display the drawing results on the display screen. For example, when the elements included in area 2 of container 1 have reached threshold 2, the electronic device can detect the operation of adding ViewE to container 1. In response to the operation, the electronic device can record the relevant information of ViewE, as shown in (3) in Figure 6B. After the electronic device removes ViewA, the electronic device can cache ViewE in area 2.
[0206] It can be understood that through the above method, the electronic device can cache elements to a specific area in the container and set it to an invisible state. When an element needs to be removed from the container, the electronic device can set CHANGE_DISAPPEARING to the pre-cached element. In this way, the removed element and the pre-cached element can execute animation effects at the same time, that is, the electronic device can display the animation of the removed element and the animation of the added element at the same time, and the entire animation process is more streamlined.
[0207] Exemplarily, as shown in FIG7A , the electronic device can display ViewA and ViewB on the display screen. ViewA and ViewB are two sub-Views in ViewGroup1. ViewA and ViewB are located in Area 1 of ViewGroup1. Since the number of elements included in Area 1 has reached the maximum number of elements that can be laid out, if the electronic device needs to add ViewC to ViewGroup1, the electronic device can cache ViewC in advance to other areas (for example, Area 2) in ViewGroup1 other than Area 1, and set it to an invisible state. Since ViewC has been cached in ViewGroup1, once the electronic device needs to remove ViewA in ViewGroup1, the electronic device can only display disappearance-related animation effects, that is, when the electronic device removes ViewA in Area 1, the electronic device can move ViewC to Area 1 and set it to a visible state, thereby simultaneously realizing the removal of ViewA and the addition of ViewC.
[0208] Specifically, as shown in Figure 7B, if the electronic device needs to remove ViewA in ViewGroup1 and add ViewC in ViewGroup1, the electronic device can cache ViewC in advance and set it to an invisible state, and then set the animation type of ViewA to DISAPPEARING, and set the animation types of ViewB and ViewC to CHANGE_DISAPPEARING. The electronic device can execute disappearance-related animation effects at the same time, that is, display the animation effects set for ViewA, ViewB and ViewC at the same time. As shown in Figure 7B, ViewA, ViewB and ViewC can move to the left until ViewA moves to the left boundary of Area 1 and disappears completely, ViewB moves to the original position of ViewA, and ViewC moves to the original position of ViewB. It can be understood that after the animation effects set for ViewA, ViewB and ViewC are displayed, the electronic device can display ViewB and ViewC in ViewGroup1. In this way, the electronic device can display the animation effects set for ViewC while displaying the animation effects set for ViewA and ViewB, resulting in a smoother animation effect for the entire process.
[0209] The hardware structure of the electronic device involved in the embodiments of the present application is introduced below.
[0210] Please refer to FIG8 , which is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0211] As shown in FIG8 , the electronic device may include: a processor, an external memory interface, an internal memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, antenna 1, antenna 2, a mobile communication module, a wireless communication module, a sensor module, buttons, a motor, an indicator, a camera, a display, and a Subscriber Identity Module (SIM) card slot, etc. The audio module may include a speaker, a receiver, a microphone, an earphone jack, etc., and the sensor module may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0212] It is understandable that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. It is understandable that the illustrated components can be implemented in hardware, software, or a combination of software and hardware. In some embodiments of the present application, the electronic device may include more components than illustrated. For example, the electronic device may include other types of sensors. In some other embodiments of the present application, the electronic device may include fewer components than illustrated, or combine certain components, or split certain components, or arrange the components differently. The interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device.
[0213] A processor may include one or more processing units, such as an application processor (AP), a modem (also known as a baseband processor), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). The AP is responsible for running the operating system and applications, while the modem is responsible for processing various communication protocols.
[0214] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, a mobile communication module, a wireless communication module, and a modem. The modem can interact with the base station through antennas (e.g., antenna 1, antenna 2, etc.). In some embodiments, antenna 1 of the electronic device is coupled to the mobile communication module, and antenna 2 is coupled to the wireless communication module, allowing the electronic device to communicate with the network and other devices using wireless communication technologies.
[0215] Electronic devices can achieve display functions through GPU, display, and application processor.
[0216] A GPU is a microprocessor for image processing that connects the display screen to the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information. A display screen is used to display images, videos, and the like. In some embodiments, an electronic device may include one or more display screens.
[0217] A camera is used to capture still images or video. An ISP processes the data from the camera. Light passes through the lens and is transmitted to the camera's photosensitive element, where it is converted into an electrical signal. The camera's photosensitive element then transmits this electrical signal to the ISP for processing, transforming it into a visible image. An electronic device may include one or more cameras.
[0218] Internal memory can include one or more RAMs and one or more non-volatile memories (NVMs). RAM can be directly read and written by the processor and can be used to store executable programs (e.g., machine instructions) for the operating system or other running programs, as well as user and application data. NVM can also store executable programs and user and application data, and can be pre-loaded into RAM for direct reading and writing by the processor.
[0219] In the embodiment of the present application, the code for implementing the method described in the embodiment of the present application may be stored in a non-volatile memory. When running the camera application, the electronic device may load the executable code stored in the non-volatile memory into the random access memory.
[0220] The external memory interface can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device.
[0221] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.
[0222] The operating system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device. It should be noted that although the embodiment of the present application is described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.
[0223] FIG9 is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0224] The software structure of an electronic device adopts a layered architecture, which divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. Taking the Android system running on an AP as an example, in some embodiments of the present application, the software structure of the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer (Framework), the Android runtime (Android runtime) and system library, the hardware abstraction layer (HAL), and the system kernel layer (Kernel).
[0225] The application layer includes a series of application packages. These packages may include applications such as camera, gallery, calendar, call, map, WLAN, Bluetooth, music, video, and short message. The application layer may also include note-taking applications. The application layer may also include the System User Interface (SystemUI). The SystemUI is used to display the interface of the electronic device, such as the lock screen, the signal icon corresponding to the SIM card, and the call interface.
[0226] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer may include some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. Among them, the view system may include visual controls. For example, controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures. The view system can execute the method provided in the present application. Specifically, the view system can configure animation effects through the corresponding interface, and can also draw each frame of the user interface in the process of the electronic device displaying animation effects. In the process of drawing the user interface, the view system can call the three-dimensional graphics processing library and the two-dimensional graphics engine in the system library.
[0227] The runtime is responsible for system scheduling and management. It consists of core libraries and a virtual machine. The core libraries consist of two parts: one containing the functions called by programming languages (e.g., Java) and the other containing the system's core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the application layer and application framework layer programming files (e.g., Java files) as binary files. The virtual machine manages object lifecycles, stacks, threads, security, exceptions, and garbage collection.
[0228] The system library can include multiple functional modules, such as the Surface Manager, Media Libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The specific meanings and functions of these functional modules can be found in the relevant technical documentation and will not be explained in detail here.
[0229] The Hardware Abstraction Layer (HAL) is an interface layer between the operating system kernel and upper-level software. Its purpose is to abstract the hardware. The HAL is an abstract interface driven by the device kernel, providing application programming interfaces (APIs) that access the underlying device to higher-level Java API frameworks. The HAL provides a standard interface that exposes device hardware capabilities to higher-level Java API frameworks. The HAL consists of multiple library modules (for example, the camera HAL, audio HAL, etc.). When the system framework API requests access to the portable device's hardware, the operating system loads the library module for that hardware component.
[0230] The kernel layer is the foundation of the Android system. It is responsible for hardware drivers, networking, power, system security, and memory management. The kernel layer acts as an intermediate layer between hardware and software, relaying application requests to the hardware. The kernel layer may include audio drivers, display drivers, camera drivers, and sensor drivers.
[0231] It should be noted that the software structure diagram of the electronic device shown in FIG9 provided in this application is merely an example and does not limit the specific module divisions within the different layers of the Android system. For details, please refer to the introduction of the Android system software structure in conventional technology. In addition, the method provided in this application can also be implemented based on other operating systems, and this application will not cite examples one by one.
[0232] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A display method, characterized in that: The method is applied to an electronic device, wherein the electronic device includes a display screen; the method includes: Displaying X elements in a first area of the display screen; If a preset condition is met, N elements of the X elements are removed from the first area, and M newly added elements are moved to the first area for display; Among them, the animation type information of the N elements is the first type information, and the animation type information of the M elements is the second type information. The first type information is used to indicate the disappearance of the animation, and the second type information is used to indicate the animation that changes based on the disappearance of the animation; X, N and M are all positive integers, N is less than or equal to X, and M is less than or equal to N.
2. The method according to claim 1, wherein The removing N elements of the X elements from the first region when a preset condition is satisfied includes: When a first operation of the user is detected, N elements among the X elements are removed from the first area.
3. The method according to claim 2, wherein The first operation is a sliding operation on the first area.
4. The method according to claim 1, wherein The removing N elements of the X elements from the first region when a preset condition is satisfied includes: When the matters corresponding to the N elements are in a target state, N elements among the X elements are removed from the first region.
5. The method according to claim 4, wherein The matters corresponding to the N elements are in the target state, including: The item corresponding to each of the N elements is in a completed state, a viewed state, or a canceled state.
6. The method according to any one of claims 1 to 5, wherein The element displayed in the first area is a notification icon, and the notification icon includes at least one of a travel icon, a message icon, a schedule icon, and a weather icon.
7. The method according to any one of claims 1 to 6, wherein X is greater than N; the method further comprising: When the preset condition is met, other elements among the X elements except the N elements are moved in the first area; wherein the animation type information of the other elements among the X elements except the N elements is the second type information.
8. The method according to any one of claims 1 to 7, wherein The first type of information is a disappearing animation DISAPPEARING, and the second type of information is an animation CHANGE_DISAPPEARING generated due to disappearance.
9. The method according to any one of claims 1 to 8, wherein The electronic device is provided with a first container, the first container including a first area and a second area, the first area being a visible area, the second area being used to cache newly added elements for the first container, and the elements in the second area being all invisible; removing N of the X elements from the first area and moving the newly added M elements before display in the first area, the second area including the M elements; The moving the newly added M elements to the first area for display includes: setting the M elements from an invisible state to a visible state, and moving the M elements from the second area to the first area for display.
10. The method according to claim 9, wherein The satisfying of the preset condition further includes: X is equal to a first threshold, and the second area includes at least one element.
11. The method according to claim 9 or 10, wherein: The M elements are the earliest added M elements among the elements included in the second region.
12. The method according to any one of claims 9 to 11, wherein When N is less than or equal to the total number of elements included in the second region, M is equal to N; when N is greater than the total number of elements included in the second region, M is equal to the total number of elements included in the second region.
13. An electronic device, characterized in that: The electronic device includes a display screen, one or more memories, and one or more processors; the display screen is coupled to the one or more memories and the one or more processors, the display screen is used to display images, the memory is used to store computer program code, the computer program code includes computer instructions, and the processor calls the computer instructions to execute the method described in any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that Used to store computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 12.