View hierarchy changing method and device

By detecting and processing the status and level information of the view to be transformed, and jumping it from the current level to the changed level, the problem of being unable to move the transformed view is solved and the user experience is improved.

CN118535264APending Publication Date: 2024-08-23HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410585770.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing technology cannot move the transformed view to the next level, resulting in visual discontinuity and affecting the user experience.

Method used

By obtaining the motion link of the view to be transformed, its status and level information are detected. If the conditions are met, the view is jumped from the current level to the changed level, and the current position is assigned to the view after the jump to ensure the continuity of the action.

Benefits of technology

It achieves visually continuous actions and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535264A
    Figure CN118535264A
Patent Text Reader

Abstract

The invention discloses a view hierarchy changing method and device. The method comprises the steps of obtaining a to-be-changed view; detecting whether the current state of the to-be-transformed view is a preset change state or not; if yes, extracting a motion node corresponding to the view to be transformed from the motion link; according to the motion state corresponding to the to-be-transformed view, judging whether the execution of the motion animation of the to-be-transformed view is finished or not; if the execution is finished, detecting whether a change level identifier of the view to be changed exists in the level information or not; if yes, obtaining a current position of the to-be-transformed view and a change level object corresponding to the change level identifier; and the view to be transformed is transited from the current hierarchy object to the hierarchy change object, and the current position is assigned to the view to be transformed after hierarchy transition. Therefore, the current position of the to-be-transformed view is assigned to the to-be-transformed view after hierarchical transition, it is ensured that the to-be-transformed view forms a continuous action visually, and then the visual experience feeling of a user is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of list content display, and in particular to a method and device for changing the hierarchy of a view. Background Art

[0002] Due to the increasing demand for multi-level structure lists in Android projects, and the need to interact with data and display effect changes between different levels, it is necessary to upgrade the original list structure in the Android project to achieve flexible data interaction and display effect changes.

[0003] In the existing technology, a multi-level display layer that can be superimposed and displayed is mainly added to the original list structure in the Android project, so that the original content view on the list structure can be transformed from the list level to the multi-level display layer for transformation and display.

[0004] Since the prior art can transform the content view from the list level to the multi-level display layer for transformation display according to the position of the content view in the list level, but it is impossible to determine the specific position of the transformed view in the list level, resulting in the inability of the transformed view to move to the next level and form a continuous action visually, thereby affecting the user's visual experience. Summary of the invention

[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a method and device for changing the level of a view to solve the problem that the prior art cannot move the transformed view to the next level and form a continuous action visually.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] In a first aspect, the present application provides a method for changing the hierarchy of a view, the method comprising:

[0008] Get the view to be transformed;

[0009] Detecting whether the current state of the view to be changed is a preset change state;

[0010] If the current state of the view to be transformed is the preset change state, extracting a motion node corresponding to the view to be transformed from a motion link; wherein the motion node at least includes a motion state and hierarchical information corresponding to the view to be transformed; and the motion link refers to a JSON file of the view to be transformed after conversion;

[0011] According to the motion state corresponding to the view to be transformed, determining whether the motion animation of the view to be transformed has been completed;

[0012] If the motion animation of the view to be transformed has been completed, detecting whether there is a changed level identifier of the view to be transformed in the level information;

[0013] If the level information contains a level change identifier of the view to be changed, obtaining the current position of the view to be changed and a level change object corresponding to the level change identifier;

[0014] The view to be transformed is transitioned from the current level object to the changed level object, and the current position of the view is assigned to the view to be transformed after the transition level.

[0015] Optionally, in the above-mentioned view level change method, after judging whether the motion animation of the view to be changed has been executed according to the motion state corresponding to the view to be changed, the method further comprises:

[0016] If the motion animation of the view to be transformed has not been completed, detecting whether the motion animation of the view to be transformed has started to be executed;

[0017] If the motion animation of the view to be transformed has not started to be executed, reading the motion animation of the view to be transformed from the motion node;

[0018] Execute the motion animation of the view to be transformed, and update the motion state corresponding to the view to be changed to the ongoing state;

[0019] If the motion animation of the view to be transformed has started to be executed, calling the motion callback information of the view to be transformed from the motion node;

[0020] The current motion stage of the view to be changed is read from the motion callback information, and the current motion stage of the view to be changed is fed back to the front end.

[0021] Optionally, in the above-mentioned view level change method, executing the motion animation of the view to be changed includes:

[0022] Extracting the animation type of the view to be transformed from the motion animation of the view to be transformed;

[0023] According to the animation type, determining whether the execution animation of the view to be transformed is a basic animation;

[0024] If the execution animation of the view to be transformed is a basic animation, acquiring the trajectory parameters of the view to be transformed from the motion animation of the view to be transformed;

[0025] Generate a plurality of animation trajectory objects according to the trajectory parameters, and perform motion animation on the view to be transformed according to each of the animation trajectory objects;

[0026] If the execution animation of the view to be transformed is a non-basic animation, in response to a user's customized operation, a motion animation is executed on the view to be transformed according to the user-defined animation.

[0027] Optionally, in the above-mentioned view level change method, performing motion animation on the view to be transformed according to each of the animation track objects includes:

[0028] Obtaining the execution priority corresponding to each of the animation trajectory objects;

[0029] Determine whether the execution priorities corresponding to each of the animation trajectory objects are consistent;

[0030] If the execution priorities corresponding to each of the animation track objects are consistent, each of the animation track objects is integrated to obtain an animation set, and the animation set is used to execute motion animation on the view to be transformed;

[0031] If the execution priorities corresponding to each of the animation track objects are inconsistent, each of the animation track objects is used to execute motion animation on the view to be transformed in descending order of the execution priorities corresponding to each of the animation track objects.

[0032] Optionally, in the above-mentioned view level change method, after obtaining the view to be changed, the method further includes:

[0033] Obtain the JSON file corresponding to the view to be transformed from the local computer, and convert the JSON file into a data stream through the InputStream instruction;

[0034] Use the StringBuffer instruction to concatenate the JSON file with the data stream to obtain a string corresponding to the JSON file;

[0035] The string is converted into a motion link using the Gson instruction.

[0036] Optionally, in the above-mentioned view level change method, it also includes:

[0037] When it is detected that the placeholder of the view to be transformed is preloaded for the first time, obtaining the view to be transformed corresponding to the placeholder from the transformation view builder through the list placeholder mapper, and adding the view to be transformed to the list;

[0038] When it is detected that the list is moved out of the screen and the current state of the view to be changed is the preset change state, removing the view to be changed from the list and calculating the movement time of the view to be changed;

[0039] Comparing whether the motion time of the view to be transformed is consistent with the target time; wherein the target time refers to the sum of the time for executing all motion nodes of the view to be transformed;

[0040] If the motion time of the view to be transformed is consistent with the target time, the view to be transformed is displayed on the final level in a gradual display mode; wherein the final level refers to the change level included in the last motion node of the view to be transformed in the motion link.

[0041] Optionally, in the above-mentioned view level change method, after assigning the current position of the view to the view to be changed after the transition level, the method further includes:

[0042] Initialize the hierarchy manager;

[0043] Detecting whether the view to be transformed successfully transitions to a higher level;

[0044] If the view to be transformed fails to successfully transition to a higher level, a view layer of the view to be transformed is created, and in the view layer, a current level state of the view to be transformed is created to obtain a target view layer;

[0045] Add the target view layer to the layer manager, and return to execute the detection of whether the view to be transformed successfully switches layers;

[0046] If the view to be transformed successfully transitions to a new level, a callback method is used to remove the motion node corresponding to the view to be transformed from the motion link, and the next motion node of the view to be transformed is executed.

[0047] A second aspect of the present application provides a view level change device, the device comprising:

[0048] A view acquisition unit, used to acquire a view to be transformed;

[0049] A state detection unit, used to detect whether the current state of the view to be changed is a preset change state;

[0050] a node extraction unit, configured to extract a motion node corresponding to the view to be transformed from a motion link if the current state of the view to be transformed is the preset change state; wherein the motion node at least includes a motion state and hierarchical information corresponding to the view to be transformed; and the motion link refers to a JSON file of the view to be transformed after conversion;

[0051] a motion judgment unit, configured to judge whether the motion animation of the view to be transformed has been completed according to the motion state corresponding to the view to be transformed;

[0052] an identification detection unit, configured to detect whether there is a changed level identification of the view to be transformed in the level information if the motion animation of the view to be transformed has been completed;

[0053] a position acquisition unit, configured to acquire the current view position of the view to be transformed and a change level object corresponding to the change level identifier if the change level identifier of the view to be transformed exists in the level information;

[0054] The transition unit is used to transition the view to be transformed from the current level object to the changed level object, and assign the current position of the view to the view to be transformed after the transition level.

[0055] Optionally, the above-mentioned view level changing device further includes:

[0056] A first detection unit, configured to detect whether the motion animation of the view to be transformed has started to be executed if the motion animation of the view to be transformed has not been completed;

[0057] If the motion animation of the view to be transformed has not started to be executed, reading the motion animation of the view to be transformed from the motion node;

[0058] A first execution unit, configured to execute the motion animation of the view to be changed, and update the motion state corresponding to the view to be changed to a progress state;

[0059] a calling unit, configured to call the motion callback information of the view to be transformed from the motion node if the motion animation of the view to be transformed has started to be executed;

[0060] The reading unit is used to read the current motion stage of the view to be changed from the motion callback information, and feed back the current motion stage of the view to be changed to the front end.

[0061] Optionally, in the above-mentioned view level changing device, the first execution unit includes:

[0062] an extraction unit, configured to extract the animation type of the view to be transformed from the motion animation of the view to be transformed;

[0063] A first judging unit, configured to judge whether the execution animation of the view to be transformed is a basic animation according to the animation type;

[0064] a parameter acquisition unit, configured to acquire a trajectory parameter of the view to be transformed from the motion animation of the view to be transformed if the execution animation of the view to be transformed is a basic animation;

[0065] A second execution unit, configured to generate a plurality of animation trajectory objects according to the trajectory parameters, and execute motion animation on the view to be transformed according to each of the animation trajectory objects;

[0066] The third execution unit is configured to execute a motion animation on the view to be transformed according to the user-defined animation in response to a user-defined operation if the execution animation of the view to be transformed is a non-basic animation.

[0067] Optionally, in the above-mentioned view level changing device, the second execution unit includes:

[0068] An acquisition unit, used for acquiring the execution priority corresponding to each of the animation trajectory objects;

[0069] A second judging unit, used to judge whether the execution priorities corresponding to each of the animation trajectory objects are consistent;

[0070] an integration unit, configured to integrate each of the animation trajectory objects to obtain an animation set if the execution priorities corresponding to each of the animation trajectory objects are consistent, and execute motion animation on the view to be transformed by using the animation set;

[0071] The fourth execution unit is configured to execute motion animation on the view to be transformed using each animation trajectory object in descending order of the execution priority corresponding to each animation trajectory object if the execution priorities corresponding to each animation trajectory object are inconsistent.

[0072] Optionally, the above-mentioned view level changing device further includes:

[0073] A file acquisition unit, used to acquire the JSON file corresponding to the view to be transformed from the local, and convert the JSON file into a data stream through an InputStream instruction;

[0074] A concatenation unit, used to concatenate the JSON file with the data stream using a StringBuffer instruction to obtain a string corresponding to the JSON file;

[0075] The conversion unit is used to convert the character string into a motion link by using a Gson instruction.

[0076] Optionally, the above-mentioned view level changing device further includes:

[0077] A first adding unit is configured to, when detecting that the placeholder of the view to be transformed is preloaded for the first time, obtain the view to be transformed corresponding to the placeholder from the transformed view builder through a list placeholder mapper, and add the view to be transformed to a list;

[0078] a calculation unit, configured to, when it is detected that the list is moved out of the screen and the current state of the view to be changed is the preset change state, remove the view to be changed from the list and calculate the movement time of the view to be changed;

[0079] A comparing unit, configured to compare whether the motion time of the view to be transformed is consistent with a target time; wherein the target time refers to the sum of the time for executing all motion nodes of the view to be transformed;

[0080] A display unit is used to display the view to be transformed on the final level in a gradual display mode if the motion time of the view to be transformed is consistent with the target time; wherein the final level refers to the change level included in the last motion node of the view to be transformed in the motion link.

[0081] Optionally, the above-mentioned view level changing device further includes:

[0082] Initialization unit, used to initialize the hierarchy manager;

[0083] A second detection unit, used to detect whether the to-be-changed view successfully transitions to a higher level;

[0084] a creating unit, configured to create a view layer of the view to be transformed if the view to be transformed fails to transition to a higher level, and to create a current level state of the view to be transformed in the view layer to obtain a target view layer;

[0085] A second adding unit, configured to add the target view layer to the layer manager, and return to execute the step of detecting whether the layer of the view to be transformed is successfully switched;

[0086] The removing unit is configured to remove the motion node corresponding to the view to be transformed from the motion link by using a callback method if the view to be transformed successfully transitions to a new level, and execute the next motion node of the view to be transformed.

[0087] The present application provides a method for changing the hierarchy of a view, which obtains the view to be transformed, and then detects whether the current state of the view to be transformed is a preset change state. If the current state of the view to be transformed is the preset change state, the motion node corresponding to the view to be transformed is extracted from the motion link, wherein the motion node at least includes the motion state and hierarchy information corresponding to the view to be transformed, and the motion link refers to the JSON file of the converted view to be transformed. Then, according to the motion state corresponding to the view to be transformed, it is determined whether the motion animation of the view to be transformed has been executed. If the motion animation of the view to be transformed has been executed, it is detected whether there is a change hierarchy identifier of the view to be transformed in the hierarchy information. If there is a change hierarchy identifier of the view to be transformed in the hierarchy information, the current view position of the view to be transformed and the change hierarchy object corresponding to the change hierarchy identifier are obtained. Finally, the view to be transformed is transitioned from the current hierarchy object to the change hierarchy object, and the current view position is assigned to the view to be transformed after the transition hierarchy. Therefore, by assigning the current position of the view to be transformed to the view to be transformed after the level transition, the visual continuity of the view to be transformed is ensured to form a continuous action, thereby improving the visual experience of the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0089] Figure 1 A flowchart of a method for changing the level of a view provided in an embodiment of the present application;

[0090] Figure 2 A schematic diagram of a flow chart of a method for acquiring a motion link provided in an embodiment of the present application;

[0091] Figure 3 A schematic diagram of a flow chart of an animation processing method for a view to be transformed provided in an embodiment of the present application;

[0092] Figure 4 A schematic diagram of a flow chart of a method for executing a motion animation provided in an embodiment of the present application;

[0093] Figure 5 A flowchart of a method for executing an animation sequence provided in an embodiment of the present application;

[0094] Figure 6 A schematic flow chart of a method for processing a view to be transformed provided in another embodiment of the present application;

[0095] Figure 7 A schematic diagram of a flow chart of a method for acquiring a view to be transformed provided in another embodiment of the present application;

[0096] Figure 8 A schematic diagram of a first scenario of a method for changing the level of a view provided in an embodiment of the present application;

[0097] Fig. 9 A schematic diagram of a second scenario of a method for changing the level of a view provided in an embodiment of the present application;

[0098] Fig.10 A schematic diagram of a third scenario of a method for changing the level of a view provided in an embodiment of the present application;

[0099] Fig.11 A schematic diagram of a fourth scenario of a method for changing the level of a view provided in an embodiment of the present application;

[0100] Fig.12 A fifth scenario schematic diagram of a method for changing the level of a view provided in an embodiment of the present application;

[0101] Fig.13 A sixth scenario schematic diagram of a method for changing the level of a view provided in an embodiment of the present application;

[0102] Fig.14 A schematic diagram of the structure of a view level changing device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0103] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0104] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0105] The present application embodiment provides a method for changing the level of a view, which is applied to a multi-level list, such as Figure 1 As shown, the specific steps include:

[0106] S101: Obtain a view to be transformed.

[0107] It should be noted that a view refers to an independent unit in the interface, which is used to display specific content or functions. A view can be a screen, a control (such as a button, text box, etc.) or a combination of controls. A view to be transformed refers to a view that is in a waiting state during interface transitions or animation effects or between different levels. For example, suppose a user triggers a level transition operation, transitioning from one level to another. During the transition process, the current page is the view to be transformed because it is waiting to be transitioned to a new page or to be animated.

[0108] Specifically, the view to be transformed is obtained in order to perform specific operations or processing on it in interface conversion or animation effects, thereby realizing transformation between different levels.

[0109] That is, when the interface switches or the state changes, the view to be transformed needs to be animated to improve the user experience or highlight certain interactive effects. Also, during the interface switching or animation process, it may be necessary to update or adjust the state of the view to be transformed accordingly, so the view to be transformed needs to be acquired in advance.

[0110] Optionally, after acquiring the view to be transformed, it is also necessary to acquire the motion link of the view to be transformed, so that the view to be transformed can be subsequently transformed based on the motion nodes in the motion link, that is, the level transition. Therefore, in another embodiment of the present application, a method for acquiring the motion link is also provided, such as Figure 2 As shown, after executing step S101, the following steps are further included:

[0111] S201. Obtain the JSON file corresponding to the view to be transformed from the local computer, and convert the JSON file into a data stream through the InputStream instruction.

[0112] It should be noted that after obtaining the view to be transformed, it is necessary to obtain the JSON file corresponding to the view to be transformed from the local computer, where the JSON file includes multiple motion nodes of the view to be transformed, and convert the JSON file into a data stream through the InputStream instruction, so that the JSON data can be processed flexibly. Then, by converting the JSON file into a data stream, large JSON data can be processed more efficiently, and data transmission and processing are also easier.

[0113] Specifically, a file reading operation may be used to read a JSON file corresponding to the view to be transformed from a local file, for example, FileReader or other file reading classes in Java may be used to implement this, and then the read JSON file may be converted into a data stream through an InputStream instruction.

[0114] S202. Use the StringBuffer instruction to concatenate the JSON file with the data stream to obtain a string corresponding to the JSON file.

[0115] Specifically, the StringBuffer instruction is used in JAVA to concatenate the JSON file with the data stream, and the code to obtain the string corresponding to the JSON file is as follows:

[0116] The code is only an example, and other code writing methods are also possible.

[0117]

[0118]

[0119] In this example, the system uses the BufferedReader class to read the JSON file line by line, and uses the StringBuffer class to concatenate the file contents. Finally, the system converts the StringBuffer into a string to obtain the string corresponding to the JSON file.

[0120] S203, using the Gson instruction to convert the character string into a motion link.

[0121] Specifically, since the JSON file includes multiple motion nodes of the views to be transformed, after the string is converted into a motion link, the motion link (MotionLink) is a collection of multiple MotionNodes (motion nodes), and each MotionNode contains Level (level), MotionState (motion state), MotionAnim (motion animation), MotionAnimCallback (motion callback), and LevelTransition (level transition).

[0122] S102: Detect whether the current state of the view to be changed is a preset change state.

[0123] It should be emphasized that, since the view to be transformed needs to undergo a view transformation in computer graphics or computer vision, that is, a hierarchical transition, before image transformation or view transformation, the current state of the view to be transformed needs to meet certain preset change states (transformation conditions) before the transformation can be performed, and the transformation conditions are determined by the upper-level business party. For example, the transformation conditions of some views to be transformed are to be slid onto the screen, and some views to be transformed start to transform after being displayed for a few seconds. Therefore, it is necessary to detect the current state of the view to be transformed, that is, to detect whether the current state of the view to be transformed is a preset change state. If the current state of the view to be transformed is a preset change state, it means that the view to be transformed can undergo image transformation and / or view transformation, so step S103 is executed.

[0124] Optionally, if the current state of the view to be transformed is not a preset change state, it means that the view to be transformed cannot be transformed, so the transformation process ends and prompt information can be fed back to the front end to prompt that the view to be transformed does not meet the transformation conditions.

[0125] S103: Extract the motion node corresponding to the view to be transformed from the motion link.

[0126] The motion node may include the motion state and level information corresponding to the view to be transformed. The motion link refers to the JSON file of the converted view to be transformed.

[0127] It should be noted that when the current state of the view to be transformed is the preset change state, it means that the view to be transformed meets the view transformation conditions and can perform view transformation (hierarchical transition). However, in order to achieve accurate hierarchical transition of the view to be transformed, it is necessary to obtain the motion node of the view to be transformed, because the motion node can more accurately describe the current motion state and motion constraints of the view to be transformed, so as to know whether the view to be transformed has completed the current motion transformation, and then the view transformation can be truly performed. Therefore, it is necessary to obtain the motion node of the view to be transformed, and the motion link is a set of multiple motion nodes of the view to be transformed, so it is necessary to extract the first motion node corresponding to the view to be transformed from the motion link.

[0128] S104: Determine whether the motion animation of the view to be transformed has been completed according to the motion state corresponding to the view to be transformed.

[0129] It should be noted that in order to ensure that the view to be transformed has completed the previous motion transformation before executing the hierarchical transition, so as to avoid unnecessary errors or inconsistencies, it is necessary to judge whether the motion animation of the view to be transformed has been executed according to the motion state corresponding to the view to be transformed, that is, whether the view to be transformed has completed the previous motion transformation.

[0130] It should also be noted that the motion states corresponding to the view to be transformed are divided into Waiting, Running, and End. Therefore, when the motion state corresponding to the view to be transformed is End, it means that the motion animation of the view to be transformed has been completed, that is, the view to be transformed has completed the previous motion transformation, so the view transformation can be truly executed, so step S105 is executed at this time.

[0131] Optionally, since the motion states corresponding to the view to be transformed are divided into Waiting, Running, and End, it means that the motion animation of the view to be transformed can be divided into the state where the motion animation has not started and the state where the motion animation is being executed, in addition to the end of execution. Therefore, in order to know the current state of the motion animation of the view to be transformed when the motion animation of the view to be transformed has not ended, so as to perform corresponding correct operations on the view to be transformed, an animation processing method for the view to be transformed is also provided in another embodiment of the present application, such as Figure 3 As shown, after executing step S104, the following steps are further included:

[0132] S301 : If the motion animation of the view to be transformed has not been completed, detecting whether the motion animation of the view to be transformed has started to be executed.

[0133] It should be noted that, since the motion states corresponding to the view to be transformed include waiting state, ongoing state and end state, when the motion animation of the view to be transformed has not been completed, it means that the motion state corresponding to the view to be transformed may be waiting state or ongoing state, and the motion animation corresponding to the view to be transformed may not have started or the motion animation is in progress. It should also be noted that each motion state corresponds to different operations of the view to be transformed, so it is necessary to detect whether the motion animation of the view to be transformed has started to be executed, so as to know what operation needs to be performed on the view to be transformed at this time. Therefore, if the motion animation of the view to be transformed has not started to be executed, it means that the motion state corresponding to the view to be transformed is waiting state, so step S302 is executed at this time. If the motion animation of the view to be transformed has started to be executed, it means that the motion state corresponding to the view to be transformed is ongoing state, so step S304 is executed at this time.

[0134] S302: Read the motion animation of the view to be transformed from the motion node.

[0135] Specifically, when the motion animation of the view to be transformed has not started to execute, it is necessary to read the properties and parameters of the motion animation (such as motion path, speed, acceleration, rotation, etc.) from the motion node of the view to be transformed, so that the motion animation effect of the view to be transformed can be customized to obtain the motion animation of the view to be transformed. Thus, through the motion animation, the state change of the view to be transformed can be displayed, such as moving from one position to another, showing from a hidden state, etc.

[0136] S303: Execute the motion animation of the view to be changed, and update the motion state corresponding to the view to be changed to the ongoing state.

[0137] It is understandable that, after the motion animation of the view to be changed is read successfully, step S303 is immediately executed, and the waiting state of the view to be changed is updated to the progress state, so that the user can know the motion state of the view to be changed at this time.

[0138] Optionally, in another embodiment of the present application, a specific implementation of executing the motion animation of the view to be transformed in step S303 is as follows: Figure 4 As shown, the following steps are included:

[0139] S401: Extracting the animation type of the view to be transformed from the motion animation of the view to be transformed.

[0140] It should be noted that different animation types correspond to different execution effects of motion animations. Therefore, in an embodiment of the present application, it is necessary to obtain the animation type of the view to be transformed in advance, so that the execution animation of the view to be transformed can be known based on the animation type of the view to be transformed, and then the animation effect can be known.

[0141] It should also be noted that the motion animation of the view to be transformed includes AnimType (animation type), BasicAnim (basic animation) or ExpandAnim (expanded animation), and AnimData (trajectory parameters), but not all information can be used to obtain the execution animation of the view to be transformed. Therefore, it is necessary to extract the animation type of the view to be transformed from the motion animation of the view to be transformed, which can be used to obtain the execution animation of the view to be transformed.

[0142] S402: Determine, according to the animation type, whether the execution animation of the view to be transformed is a basic animation.

[0143] It can be understood that the animation types include BasicAnim and ExpandAnim. Therefore, it is necessary to determine whether the execution animation of the view to be transformed uses the basic animation or the expanded animation according to the animation type of the motion animation of the view to be transformed. If the execution animation of the view to be transformed is the basic animation, then step S403 is executed. If the execution animation of the view to be transformed is not the basic animation, it means that the execution animation of the view to be transformed is the expanded animation, so step S405 is executed.

[0144] S403: Acquire trajectory parameters of the view to be transformed from the motion animation of the view to be transformed.

[0145] It should be noted that since the basic animation encapsulates several basic animations, including translation, rotation, gradient, scaling, etc., when the execution animation of the view to be transformed is the basic animation, in order to know which basic animations the view to be transformed can execute, it is necessary to obtain the trajectory parameters of the view to be transformed from the motion animation of the view to be transformed, so as to subsequently debug the animation effect of the view to be transformed based on the trajectory parameters.

[0146] S404: Generate multiple animation trajectory objects according to the trajectory parameters, and execute motion animation on the view to be transformed according to each animation trajectory object.

[0147] It is understandable that if the trajectory parameters contain the position information of the starting point and the end point, linear interpolation can be used to generate a linear trajectory. And if the trajectory parameters contain the control point information of the Bezier curve, this information can be used to generate a Bezier curve trajectory. The Bezier curve can realize the smooth curve motion of the view to be transformed, so that curve paths of different shapes can be achieved by adjusting the control points. It is also possible that the trajectory parameters contain information about key frames or path points, and a curve trajectory can be generated based on this information. For example, spline interpolation or other interpolation methods can be used to generate a smooth curve path so that the view to be transformed can be animated along the curve path. Also, if the trajectory parameters contain description information of the path, such as the nodes of the path, the curve type, etc., a path animation object can be generated based on this information. Path animation can realize complex path motion.

[0148] Since the track parameter is a track parameter list, each track contains Priority (execution priority), Duration (execution duration), StartState (transformation start state), TargetState (transformation target state), and TrackType (track type). The basic animation will read each track parameter internally and generate the corresponding animation object according to the track type. Therefore, if the track parameter contains linear track type, Bezier curve type, curve track type, and path animation type, multiple animation track objects will be generated at will, so that the system can perform motion animation on the transformed view according to different animation tracks.

[0149] Optionally, in another embodiment of the present application, in step S404, a specific implementation method of performing motion animation on the transformed view according to each animation track object is as follows: Figure 5 As shown, the following steps are included:

[0150] S501: Obtain the execution priority corresponding to each animation track object.

[0151] It should be noted that when there are multiple animation track objects, the system will determine the execution sequence of the animation track objects based on the execution priority, so it is necessary to obtain the execution priority corresponding to each animation track object from the track parameters in advance.

[0152] S502: Determine whether the execution priorities corresponding to each animation trajectory object are consistent.

[0153] It should be noted that in the embodiment of the present application, if the execution priority of each animation object is the same, it means that each animation object is an animation executed simultaneously, and then it will be necessary to wait for the user's call instruction to execute later. If the execution priority of each animation object is different, it means that each animation object is not an animation executed simultaneously, then it is necessary to treat the transformation view execution animation according to the execution priority. Therefore, it is necessary to pre-determine whether the execution priority corresponding to each animation track object is consistent. If the execution priority corresponding to each animation track object is consistent, it means that each animation object is an animation executed simultaneously, so step S503 is executed at this time. If the execution priority corresponding to each animation track object is inconsistent, it means that each animation object is not an animation executed simultaneously, then step S504 is executed.

[0154] S503: Integrate each animation track object to obtain an animation set, and use the animation set to execute motion animation on the view to be transformed.

[0155] Specifically, when the execution priority corresponding to each animation track object is consistent, the basic animation will put the animations executed simultaneously into the same animation set and wait for external calls. When an external call instruction is received, each animation track object in the animation set will be used to execute motion animations on the transformed view at the same time.

[0156] S504 : Execute motion animation on the view to be transformed using each animation track object in descending order of execution priority corresponding to each animation track object.

[0157] Optionally, when the execution priorities corresponding to each animation track object are inconsistent, each animation track object may be used to execute motion animation on the view to be transformed in a descending order of the execution priorities corresponding to each animation track object, or in a descending order of the execution priorities corresponding to each animation track object.

[0158] S405 : In response to the user's customized operation, execute motion animation on the view to be transformed according to the user's customized animation.

[0159] Specifically, when the execution animation of the view to be transformed is a non-basic animation, that is, when the execution animation of the view to be transformed is an extended animation, the user can customize the animation, and then the system performs corresponding animation operations on the view according to the customized animation.

[0160] S304: Call the motion callback information of the view to be transformed from the motion node.

[0161] Specifically, when the motion animation of the view to be transformed has started to execute, there may be specific states that need to be processed, that is, the user's business needs, such as start, pause, resume, etc. When these states change, it is necessary to call the motion callback information of the view to be transformed from the motion node to meet the user's business needs through the motion callback information, thereby enhancing the interactivity of the animation effect and user experience.

[0162] S305 : Read the current motion phase of the view to be changed from the motion callback information, and feed back the current motion phase of the view to be changed to the front end.

[0163] It is understandable that the motion callback information will indicate whether the motion animation of the view to be changed is in AnimStart (animation start), AnimRepeat (animation loop execution), or AnimEnd (animation end), so that subsequent relevant business layer personnel can meet different business needs according to the current stage of motion.

[0164] S105: Detect whether there is a changed level identifier of the view to be changed in the level information.

[0165] It should be emphasized that when the motion animation of the view to be transformed has been executed, it is necessary to determine whether the view to be transformed needs to perform a level transition. Therefore, it is possible to determine whether the view to be transformed needs to perform a level transition by detecting whether there is a level change mark of the view to be transformed in the level information. Therefore, if there is a level change mark of the view to be transformed in the level information, it means that the view to be transformed needs to perform a level transition, so step S106 needs to be executed at this time.

[0166] Optionally, if the level change identifier of the view to be changed does not exist in the level information, it means that the view to be changed does not need to perform level transition, and thus the process ends.

[0167] S106: Acquire the current view position of the view to be transformed and the change level object corresponding to the change level identifier.

[0168] It should be noted that when there is a change level identifier of the view to be transformed in the level information, the getLocationInWindow method can be used to obtain the current position of the view to be transformed in the window in order to determine the starting position of the transformation. It is also necessary to obtain the change level object corresponding to the change level identifier through the multi-level level management class (LevelManager), that is, to obtain the next level to which the view to be transformed needs to jump, so that the view to be transformed can be correctly jumped from the current position of the view to the next level.

[0169] S107 , transitioning the view to be transformed from the current level object to the changed level object, and assigning the current position of the view to the view to be transformed after the transition level.

[0170] It should be emphasized that in order to ensure visual continuity when the view to be transformed moves to the next level and avoid lag for users, the view to be transformed needs to be assigned the current position of the view to be transformed after the transition level while jumping from the current level object to the changed level object.

[0171] Optionally, after the current position of the view is assigned to the view to be transformed after the transition level, that is, after the view to be transformed is transitioned from the current level object to the changed level object, there may be a situation where the view to be transformed fails to transition. In order to promptly handle the situation where the view to be transformed fails to transition, so that the view to be transformed transitions successfully, after executing step S107, another embodiment of the present application further provides a method for processing the view to be transformed, such as Figure 6 As shown, the specific steps include:

[0172] S601: Initialize the hierarchy manager.

[0173] It can be understood that the embodiment of the present application is based on Android's multi-level list to display the view to be transformed, so the ViewGroup class and its subclasses provided by Android can be used to initialize the hierarchy manager, so that when the view to be transformed fails to transition, the transition failure can be solved based on the hierarchy manager. Therefore, the sample code for using ViewGroup to initialize the hierarchy manager in Android is:

[0174] java

[0175] / / Create a LinearLayout manager instance

[0176] LinearLayoutManager layoutManager=new LinearLayoutManager(context);

[0177] / / Configure LinearLayoutManager and set the direction to vertical

[0178] layoutManager.setOrientation(LinearLayoutManager.VERTICAL;

[0179] / / Set RecyclerView to use LinearLayoutManager

[0180] recyclerView.setLayoutManager(layoutManager)

[0181] Based on the above example code, it shows how to use LinearLayoutManager in Android to initialize the hierarchy manager, so that you can effectively manage the view hierarchy, achieve the desired layout effect, and improve the performance and maintainability of the application.

[0182] S602: Detect whether the view to be transformed successfully transitions to a higher level.

[0183] It should be noted that when the view to be transformed is transitioned from the current level object to the changed level object, there may be a situation where the transition fails. Therefore, in order to promptly know whether the view to be transformed fails to transition, and to promptly process the view to be transformed that fails to transition, to ensure that the view to be transformed can successfully transition, after executing step S601, it is necessary to detect whether the view to be transformed successfully transitions to a level. If the view to be transformed fails to transition to a level, it means that the level manager in step S601 is needed to help the view to be transformed complete the level transition, so step S603 is executed. If the view to be transformed successfully transitions to a level, it means that the level manager is not needed, so step S605 is executed.

[0184] S603: Create a view layer of the view to be transformed, and in the view layer, create the current level state of the view to be transformed to obtain a target view layer.

[0185] Specifically, when the view to be transformed fails to successfully transition to a higher level, a view layer of the view to be transformed needs to be created, so that the view to be transformed can be placed in the view layer to be isolated from other views, ensuring that any operation on the view to be transformed will not affect other views, thereby avoiding potential conflicts and errors. Then, the current level state of the view to be transformed is created in the view layer, which helps to ensure that the appearance and position of the view to be transformed are accurately reproduced in the view layer, thereby achieving effective level transition and management.

[0186] S604: Add the target view layer to the hierarchy manager.

[0187] Specifically, adding the target view layer to the hierarchy manager helps to improve the maintainability, operability and performance optimization of the application. Thus, in the hierarchy manager, based on the current hierarchy status of the view to be transformed, the view to be transformed is transitioned from the current hierarchy object to the changed hierarchy object. At this time, it is also necessary to return to step S602 to detect whether the view to be transformed has successfully transitioned to a higher level, until the view to be transformed has successfully transitioned to a higher level.

[0188] S605 : Using a callback method, remove the motion node corresponding to the view to be transformed from the motion link, and execute the next motion node of the view to be transformed.

[0189] It should be noted that when the view to be transformed successfully jumps the level, it means that the first motion node of the view to be transformed and the processing are completed, and there are other motion nodes of the view to be transformed in the motion chain that need to be executed. Therefore, in order to avoid repeated execution of the first motion node, the motion node corresponding to the view to be transformed can be removed from the motion chain through the callback method, and then the next motion node of the first motion node in the motion chain is executed.

[0190] Optionally, due to the particularity of the list being slidable and the list caching mechanism, for the view to be transformed in the sliding out screen, there may be a problem that the view to be transformed cannot be obtained and displayed. Therefore, in order to solve the problem of obtaining the view to be transformed in the sliding out screen, in another embodiment of the present application, a method for obtaining the view to be transformed is also provided, such as Figure 7 As shown, the specific steps include:

[0191] S701 . When it is detected that the placeholder of the view to be transformed is preloaded for the first time, the view to be transformed corresponding to the placeholder is obtained from the transformed view builder through the list placeholder mapper, and the view to be transformed is added to the list.

[0192] It should be noted that due to the particularity of the list cache mechanism, the view that slides out of the screen is at risk of being recycled, which will cause the view to be transformed to be unable to be obtained, and then cause problems in the display of the view to be transformed. In response to this abnormal phenomenon, the embodiment of the present application designs a TransformViewManager (transformation view manager). Among them, the TransformViewManager (transformation view manager) internally contains TransformViewBuilder (transformation view builder) and ListPlaceHolderMap (list placeholder mapper). The working principle is: for the transformed view in the list, the original list construction is modified to the external TransformViewBuilder (transformation view builder) construction, and the view to be transformed of the abnormal phenomenon is held, and a PlaceHolder (placeholder) will be constructed for the view to be transformed of the abnormal phenomenon in the corresponding list, and the view to be transformed of the abnormal phenomenon will be mapped and stored with the PlaceHolderr (placeholder) in the list in the ListPlaceHolderMap (list placeholder mapper).

[0193] Therefore, when it is detected that the placeholder of the view to be transformed is preloaded for the first time, it means that the list sliding has occurred at this time. Therefore, in order to avoid the risk of the view to be transformed being recycled when the list slides out of the screen, and the view to be transformed cannot be obtained, the view to be transformed corresponding to the placeholder is obtained from the transformation view builder through the pre-established list placeholder mapper, and the view to be transformed is added to the list. Therefore, at this time the list has not been moved out of the screen, and the view to be transformed still needs to use the list to display content, so it is necessary to add the view to be transformed to the list.

[0194] S702: When it is detected that the list is moved out of the screen and the current state of the view to be changed is a preset change state, remove the view to be changed from the list and calculate the movement time of the view to be changed.

[0195] It is understandable that after the view to be changed is added to the list, the system will always detect whether the list is moved out of the screen. If it is detected that the list is moved out of the screen and the current state of the view to be changed is the preset change state, it means that the view to be changed has also been moved out of the screen and the view to be changed meets the transformation requirements. At this time, the view to be changed needs to be removed from the list to avoid the risk of the view to be changed being recycled. In addition, the movement time of the view to be changed needs to be calculated, because when the view to be changed is also moved out of the screen and the view to be changed meets the transformation requirements, the movement animation of the view to be changed will also be executed, but the movement trajectory will not be changed. Therefore, in order to subsequently know whether the movement time of the view to be changed that is removed from the screen is consistent with the movement time when it is not moved out of the screen, it is possible to know whether the view to be changed that is removed from the screen can achieve the expected display effect.

[0196] Therefore, a timing task is started during the motion animation of the view to be transformed, so that the motion time of the view to be transformed can be calculated.

[0197] S703: Compare whether the motion time of the view to be transformed is consistent with the target time.

[0198] The target time refers to the sum of the time to execute all motion nodes of the view to be transformed.

[0199] It can be understood that in order to find out whether the view to be transformed that is moved out of the screen can achieve the expected display effect, it is necessary to compare whether the movement time of the view to be transformed is consistent with the target time. If the movement time of the view to be transformed is consistent with the target time, it means that the view to be transformed that is moved out of the screen can achieve the expected display effect, so step S704 is executed.

[0200] Optionally, if the movement time of the view to be transformed is inconsistent with the target time, it means that the view to be transformed that is moved out of the screen cannot achieve the expected display effect, and the process ends at this time.

[0201] S704: Use a gradual display mode to display the view to be transformed on the final level.

[0202] The final level refers to the change level included in the last motion node of the view to be transformed in the motion link.

[0203] Specifically, when the motion time of the view to be transformed is consistent with the target time and the motion animation of the view to be transformed is completed, the view to be transformed will be displayed on the final level in a gradual display mode to ensure the correctness of the final display effect.

[0204] For ease of understanding, the following describes the hierarchical change process of the view of this application using a specific application scenario. Figures 8 to 13 , Figures 8 to 13are all scene schematic diagrams of the method for changing the hierarchy of views in the embodiments of the present application, and Figures 8 to 13 They represent the movement of the transformed view in the multi-level list. It should be noted that Figure 8 The view in the middle frame is the view to be transformed, and it is in the initial state. When it is detected that the initial state of the view to be transformed is the preset state, that is, when the view to be transformed meets the transformation conditions, it will undergo Figures 9 to 11 The level transition in Fig.11 The bitmap status is displayed at the level of . Fig.12 The response state of the view to be transformed after clicking the badge. When the bottom list is detected to slide, that is, when the view to be transformed is about to slide out of the screen, the badge state of the view to be transformed will shrink to Fig.13 The status shown in the middle frame.

[0205] The present application provides a method for changing the hierarchy of a view, which obtains the view to be transformed, and then detects whether the current state of the view to be transformed is a preset change state. If the current state of the view to be transformed is the preset change state, the motion node corresponding to the view to be transformed is extracted from the motion link, wherein the motion node at least includes the motion state and hierarchy information corresponding to the view to be transformed, and the motion link refers to the JSON file of the converted view to be transformed. Then, according to the motion state corresponding to the view to be transformed, it is determined whether the motion animation of the view to be transformed has been executed. If the motion animation of the view to be transformed has been executed, it is detected whether there is a change hierarchy identifier of the view to be transformed in the hierarchy information. If there is a change hierarchy identifier of the view to be transformed in the hierarchy information, the current view position of the view to be transformed and the change hierarchy object corresponding to the change hierarchy identifier are obtained. Finally, the view to be transformed is transitioned from the current hierarchy object to the change hierarchy object, and the current view position is assigned to the view to be transformed after the transition hierarchy. Therefore, by assigning the current position of the view to be transformed to the view to be transformed after the level transition, the visual continuity of the view to be transformed is ensured to form a continuous action, thereby improving the visual experience of the user.

[0206] Another embodiment of the present application provides a view level change device, such as Fig.14 As shown, it includes the following units:

[0207] The view acquisition unit 1401 is configured to acquire a view to be transformed.

[0208] The state detection unit 1402 is used to detect whether the current state of the view to be changed is a preset change state.

[0209] The node extraction unit 1403 is used to extract the motion node corresponding to the view to be transformed from the motion link if the current state of the view to be transformed is a preset change state. The motion node at least includes the motion state and level information corresponding to the view to be transformed. The motion link refers to the JSON file of the converted view to be transformed.

[0210] The motion determination unit 1404 is configured to determine whether the motion animation of the view to be transformed has been completed according to the motion state corresponding to the view to be transformed.

[0211] The identifier detection unit 1405 is configured to detect whether there is a changed level identifier of the view to be transformed in the level information if the motion animation of the view to be transformed has been completed.

[0212] The position acquisition unit 1406 is configured to acquire the current view position of the view to be transformed and the change level object corresponding to the change level identifier if the change level identifier of the view to be transformed exists in the level information.

[0213] The transition unit 1407 is used to transition the view to be transformed from the current level object to the changed level object, and assign the current position of the view to the view to be transformed after the transition level.

[0214] It should be noted that the specific working process of the above-mentioned units in the embodiment of the present application can refer to steps S101 to S107 in the above-mentioned method embodiment, and will not be repeated here.

[0215] Optionally, in another embodiment of the present application, a view level change device further includes:

[0216] The first detection unit is configured to detect whether the motion animation of the view to be transformed has started to be executed if the motion animation of the view to be transformed has not been completed.

[0217] If the motion animation of the view to be transformed has not started to be executed, the motion animation of the view to be transformed is read from the motion node.

[0218] The first execution unit is used to execute the motion animation of the view to be changed, and update the motion state corresponding to the view to be changed to a progress state.

[0219] The calling unit is used to call the motion callback information of the view to be transformed from the motion node if the motion animation of the view to be transformed has started to be executed.

[0220] The reading unit is used to read the current motion stage of the view to be changed from the motion callback information, and feed back the current motion stage of the view to be changed to the front end.

[0221] Optionally, in a view level change device provided by another embodiment of the present application, the first execution unit includes:

[0222] The extraction unit is used to extract the animation type of the view to be transformed from the motion animation of the view to be transformed.

[0223] The first judging unit is used to judge whether the execution animation of the view to be transformed is a basic animation according to the animation type.

[0224] The parameter acquisition unit is used to acquire the trajectory parameters of the view to be transformed from the motion animation of the view to be transformed if the execution animation of the view to be transformed is the basic animation.

[0225] The second execution unit is used to generate a plurality of animation track objects according to the track parameters, and execute motion animation on the view to be transformed according to each animation track object.

[0226] The third execution unit is configured to execute a motion animation on the view to be transformed according to the user-defined animation in response to a user-defined operation if the execution animation of the view to be transformed is a non-basic animation.

[0227] Optionally, in a view level change device provided by another embodiment of the present application, the second execution unit includes:

[0228] The acquisition unit is used to obtain the execution priority corresponding to each animation track object.

[0229] The second judgment unit is used to judge whether the execution priorities corresponding to each animation track object are consistent.

[0230] The integration unit is used to integrate each animation track object if the execution priority corresponding to each animation track object is consistent, obtain an animation set, and use the animation set to execute motion animation on the view to be transformed.

[0231] The fourth execution unit is configured to execute motion animation on the view to be transformed using each animation track object in descending order of the execution priority corresponding to each animation track object if the execution priorities corresponding to each animation track object are inconsistent.

[0232] Optionally, in another embodiment of the present application, a view level change device further includes:

[0233] The file acquisition unit is used to obtain the JSON file corresponding to the view to be transformed from the local, and convert the JSON file into a data stream through the InputStream instruction.

[0234] The concatenation unit is used to concatenate the JSON file with the data stream using the StringBuffer instruction to obtain the string corresponding to the JSON file.

[0235] The conversion unit is used to convert a string into a motion link using the Gson instruction.

[0236] Optionally, in another embodiment of the present application, a view level change device further includes:

[0237] The first adding unit is configured to, when detecting that the placeholder of the view to be transformed is preloaded for the first time, obtain the view to be transformed corresponding to the placeholder from the transformed view builder through the list placeholder mapper, and add the view to be transformed to the list.

[0238] The calculation unit is used to remove the view to be changed from the list and calculate the movement time of the view to be changed when it is detected that the list is moved out of the screen and the current state of the view to be changed is a preset change state.

[0239] The comparison unit is used to compare whether the motion time of the view to be transformed is consistent with the target time, wherein the target time refers to the sum of the time of executing all motion nodes of the view to be transformed.

[0240] The display unit is used to display the view to be transformed on the final level in a gradual display mode if the motion time of the view to be transformed is consistent with the target time. The final level refers to the change level included in the last motion node of the view to be transformed in the motion link.

[0241] Optionally, in another embodiment of the present application, a view level change device further includes:

[0242] Initialization unit, used to initialize the hierarchy manager.

[0243] The second detection unit is used to detect whether the view to be transformed successfully transitions to a higher level.

[0244] The creating unit is used to create a view layer of the view to be transformed if the view to be transformed fails to transition to a higher level, and to create a current level state of the view to be transformed in the view layer to obtain a target view layer.

[0245] The second adding unit is used to add the target view layer to the hierarchy manager, and return to execute the detection of whether the view to be transformed switches the hierarchy successfully.

[0246] The removing unit is used to remove the motion node corresponding to the view to be transformed from the motion link by using a callback method if the view to be transformed successfully transitions to a new level, and execute the next motion node of the view to be transformed.

[0247] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, and will not be repeated here.

[0248] In summary, the embodiment of the present application provides a view level change device, which assigns the current position of the view to the view to be changed after the jump level through the application of a multi-level list, thereby giving the user a visual sense of continuous action, thereby improving the user experience.

[0249] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0250] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for changing the hierarchy of a view, characterized in that: The method comprises: Get the view to be transformed; Detecting whether the current state of the view to be changed is a preset change state; If the current state of the view to be transformed is the preset change state, extracting a motion node corresponding to the view to be transformed from a motion link; wherein the motion node at least includes a motion state and hierarchical information corresponding to the view to be transformed; and the motion link refers to a JSON file of the view to be transformed after conversion; According to the motion state corresponding to the view to be transformed, determining whether the motion animation of the view to be transformed has been completed; If the motion animation of the view to be transformed has been completed, detecting whether there is a changed level identifier of the view to be transformed in the level information; If the level information contains a level change identifier of the view to be changed, obtaining the current position of the view to be changed and a level change object corresponding to the level change identifier; The view to be transformed is transitioned from the current level object to the changed level object, and the current position of the view is assigned to the view to be transformed after the transition level.

2. The method according to claim 1, characterized in that After judging whether the motion animation of the view to be transformed has been executed according to the motion state corresponding to the view to be transformed, the method further includes: If the motion animation of the view to be transformed has not been completed, detecting whether the motion animation of the view to be transformed has started to be executed; If the motion animation of the view to be transformed has not started to be executed, reading the motion animation of the view to be transformed from the motion node; Execute the motion animation of the view to be transformed, and update the motion state corresponding to the view to be changed to the ongoing state; If the motion animation of the view to be transformed has started to be executed, calling the motion callback information of the view to be transformed from the motion node; The current motion stage of the view to be changed is read from the motion callback information, and the current motion stage of the view to be changed is fed back to the front end.

3. The method according to claim 2, characterized in that The executing the motion animation of the view to be transformed comprises: Extracting the animation type of the view to be transformed from the motion animation of the view to be transformed; According to the animation type, determining whether the execution animation of the view to be transformed is a basic animation; If the execution animation of the view to be transformed is a basic animation, acquiring the trajectory parameters of the view to be transformed from the motion animation of the view to be transformed; Generate a plurality of animation trajectory objects according to the trajectory parameters, and perform motion animation on the view to be transformed according to each of the animation trajectory objects; If the execution animation of the view to be transformed is a non-basic animation, in response to a user's customized operation, a motion animation is executed on the view to be transformed according to the user-defined animation.

4. The method according to claim 3, characterized in that The step of performing motion animation on the view to be transformed according to each of the animation track objects comprises: Obtaining the execution priority corresponding to each of the animation trajectory objects; Determine whether the execution priorities corresponding to each of the animation trajectory objects are consistent; If the execution priorities corresponding to each of the animation track objects are consistent, each of the animation track objects is integrated to obtain an animation set, and the animation set is used to execute motion animation on the view to be transformed; If the execution priorities corresponding to each of the animation track objects are inconsistent, each of the animation track objects is used to execute motion animation on the view to be transformed in descending order of the execution priorities corresponding to each of the animation track objects.

5. The method according to claim 1, characterized in that After obtaining the view to be transformed, the method further includes: Obtain the JSON file corresponding to the view to be transformed from the local computer, and convert the JSON file into a data stream through the InputStream instruction; Use the StringBuffer instruction to concatenate the JSON file with the data stream to obtain a string corresponding to the JSON file; The string is converted into a motion link using the Gson instruction.

6. The method according to claim 1, characterized in that Also includes: When it is detected that the placeholder of the view to be transformed is preloaded for the first time, obtaining the view to be transformed corresponding to the placeholder from the transformation view builder through the list placeholder mapper, and adding the view to be transformed to the list; When it is detected that the list is moved out of the screen and the current state of the view to be changed is the preset change state, removing the view to be changed from the list and calculating the movement time of the view to be changed; Comparing whether the motion time of the view to be transformed is consistent with the target time; wherein the target time refers to the sum of the time for executing all motion nodes of the view to be transformed; If the motion time of the view to be transformed is consistent with the target time, the view to be transformed is displayed on the final level in a gradual display mode; wherein the final level refers to the change level included in the last motion node of the view to be transformed in the motion link.

7. The method according to claim 1, characterized in that After assigning the current position of the view to be transformed after the transition level, the method further includes: Initialize the hierarchy manager; Detecting whether the view to be transformed successfully transitions to a higher level; If the view to be transformed fails to successfully transition to a higher level, a view layer of the view to be transformed is created, and in the view layer, a current level state of the view to be transformed is created to obtain a target view layer; Add the target view layer to the layer manager, and return to execute the detection of whether the view to be transformed successfully switches layers; If the view to be transformed successfully transitions to a new level, a callback method is used to remove the motion node corresponding to the view to be transformed from the motion link, and the next motion node of the view to be transformed is executed.

8. A view level changing device, characterized in that: The device comprises: A view acquisition unit, used to acquire a view to be transformed; A state detection unit, used to detect whether the current state of the view to be changed is a preset change state; a node extraction unit, configured to extract a motion node corresponding to the view to be transformed from a motion link if the current state of the view to be transformed is the preset change state; wherein the motion node at least includes a motion state and hierarchical information corresponding to the view to be transformed; and the motion link refers to a JSON file of the view to be transformed after conversion; a motion judgment unit, configured to judge whether the motion animation of the view to be transformed has been completed according to the motion state corresponding to the view to be transformed; an identification detection unit, configured to detect whether there is a changed level identification of the view to be transformed in the level information if the motion animation of the view to be transformed has been executed; a position acquisition unit, configured to acquire the current view position of the view to be transformed and a change level object corresponding to the change level identifier if the change level identifier of the view to be transformed exists in the level information; The transition unit is used to transition the view to be transformed from the current level object to the changed level object, and assign the current position of the view to the view to be transformed after the transition level.

9. The device according to claim 8, characterized in that Also includes: A first detection unit, configured to detect whether the motion animation of the view to be transformed has started to be executed if the motion animation of the view to be transformed has not been completed; If the motion animation of the view to be transformed has not started to be executed, reading the motion animation of the view to be transformed from the motion node; A first execution unit, configured to execute the motion animation of the view to be changed, and update the motion state corresponding to the view to be changed to a progress state; a calling unit, configured to call the motion callback information of the view to be transformed from the motion node if the motion animation of the view to be transformed has started to be executed; The reading unit is used to read the current motion stage of the view to be changed from the motion callback information, and feed back the current motion stage of the view to be changed to the front end.

10. The device according to claim 9, characterized in that The first execution unit includes: an extraction unit, configured to extract the animation type of the view to be transformed from the motion animation of the view to be transformed; A first judging unit, configured to judge whether the execution animation of the view to be transformed is a basic animation according to the animation type; a parameter acquisition unit, configured to acquire a trajectory parameter of the view to be transformed from the motion animation of the view to be transformed if the execution animation of the view to be transformed is a basic animation; A second execution unit, configured to generate a plurality of animation trajectory objects according to the trajectory parameters, and execute motion animation on the view to be transformed according to each of the animation trajectory objects; The third execution unit is configured to execute a motion animation on the view to be transformed according to the user-defined animation in response to a user-defined operation if the execution animation of the view to be transformed is a non-basic animation.