CN114489911A - Interface switching method and device and electronic equipment - Google Patents
Interface switching method and device and electronic equipment Download PDFInfo
- Publication number
- CN114489911A CN114489911A CN202210138457.3A CN202210138457A CN114489911A CN 114489911 A CN114489911 A CN 114489911A CN 202210138457 A CN202210138457 A CN 202210138457A CN 114489911 A CN114489911 A CN 114489911A
- Authority
- CN
- China
- Prior art keywords
- interface
- switching
- switched
- target
- set corresponding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000011084 recovery Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 description 4
- 230000006378 damage Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- General Engineering & Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention provides an interface switching method, an interface switching device and electronic equipment. When the target interface to be switched does not exist, the creation interface in the interface set corresponding to the target interface is called to create the target interface, and the entry interface in the interface set corresponding to the target interface is called to play the entry animation corresponding to the target interface on the current interface, so that the animation of the switched interface is played first and then the animation of the target interface is played when the target interface is switched, and therefore seamless connection of playing the animation is achieved. In the invention, the interface switching of different interfaces can be realized only by configuring the interface sets of different interfaces, the writing amount of repeated codes is reduced, and the code reuse rate is improved.
Description
Technical Field
The invention relates to the field of interface display, in particular to an interface switching method and device and electronic equipment.
Background
At present, when two full-screen interfaces are switched, seamless connection of animation playing during back-and-forth switching needs to be guaranteed.
In order to implement seamless switching to a target interface to be switched to when playing the switched interface, a code of the switched interface is generally added to a code corresponding to the target interface to be switched to, so that when switching to the target interface, an animation of the switched interface is played first, and then the animation of the target interface is played, thereby implementing seamless connection of playing the animation.
When the method is adopted, corresponding codes need to be added for each pair of target interfaces and switched interfaces, a large amount of repeated codes need to be written, and the code reuse rate is low.
Disclosure of Invention
In view of this, the present invention provides an interface switching method, an interface switching apparatus and an electronic device, so as to solve the problem of low code reuse rate.
In order to solve the technical problems, the invention adopts the following technical scheme:
an interface switching method is applied to an interface switching controller, wherein different interfaces are pre-configured in the interface switching controller and correspond to interface sets, and the different interfaces in the interface sets are used for realizing different interface states of the interfaces;
the interface switching method comprises the following steps:
judging whether an interface switching instruction is received or not in the process of playing the switched interface on the current interface;
if so, calling a switching interface in an interface set corresponding to the switched interface to play a switching animation corresponding to the switched interface on a current interface;
determining whether a target interface to be switched to exists;
if not, calling a creation interface in the interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface after determining that the target interface is successfully created, so as to play an entry animation corresponding to the target interface on the current interface.
Optionally, the invoking a switching interface in the interface set corresponding to the switched interface includes:
and controlling a first interface manager corresponding to the switched interface to call the switching interface in the interface set corresponding to the switched interface.
Optionally, after the switching interface in the interface set corresponding to the switched interface is called to play the switching animation corresponding to the switched interface on the current interface, the method further includes:
after the switching animation is determined to be played completely, controlling the first interface manager to call an exit interface in an interface set corresponding to the switched interface so as to stop displaying the switched interface on the current interface;
and sending a deleting instruction to the first interface manager so that the first interface manager deletes the switched interface and the first interface manager.
Optionally, invoking a creation interface in the interface set corresponding to the target interface to create the target interface, including:
and creating a second interface manager corresponding to the target interface, and controlling the second interface manager to call a created interface in the interface set corresponding to the target interface so as to create the target interface.
Optionally, in a case that it is determined that the target interface to be switched to exists, the method further includes:
and controlling the second interface manager to call a recovery interface in the interface set corresponding to the target interface so as to enter the target interface again.
Optionally, after invoking an entry interface in the interface set corresponding to the target interface to play the entry animation corresponding to the target interface on the current interface, the method further includes:
and controlling the second interface manager to call a normal display interface in the interface set corresponding to the target interface so as to continuously display the target interface on the current interface.
An interface switching device is applied to an interface switching controller, wherein different interfaces are pre-configured in the interface switching controller and correspond to interface sets, and the different interfaces in the interface sets are used for realizing different interface states of the interfaces;
the interface switching device includes:
the instruction judging module is used for judging whether an interface switching instruction is received or not in the process of playing the switched interface on the current interface;
the first interface calling module is used for calling a switching interface in an interface set corresponding to the switched interface if the switching interface is received so as to play a switching animation corresponding to the switched interface on a current interface;
the determining module is used for determining whether a target interface to be switched to exists or not;
and the second interface calling module is used for calling a creation interface in the interface set corresponding to the target interface to create the target interface if the target interface does not exist, and calling an entry interface in the interface set corresponding to the target interface after the successful creation of the target interface is determined, so as to play the entry animation corresponding to the target interface on the current interface.
Optionally, the first interface calling module is specifically configured to:
and controlling a first interface manager corresponding to the switched interface to call the switching interface in the interface set corresponding to the switched interface.
Optionally, the method further comprises:
the third interface calling module is used for controlling the first interface manager to call an exit interface in the interface set corresponding to the switched interface after the switching animation is determined to be played, so that the switched interface is stopped being displayed on the current interface;
and the instruction sending module is used for sending a deleting instruction to the first interface manager so that the first interface manager deletes the switched interface and the first interface manager.
An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used for executing the interface switching method.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides an interface switching method, an interface switching device and electronic equipment, wherein an interface set corresponding to different interfaces is pre-configured in an interface switching controller, and the different interfaces in the interface set are used for realizing different interface states of the interfaces, so that in the process of playing a switched interface on a current interface, if an interface switching instruction is received, a switching interface in the interface set corresponding to the switched interface is called first, and a switching animation corresponding to the switched interface is played on the current interface. When the target interface to be switched does not exist, calling a creation interface in an interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface to play the entry animation corresponding to the target interface on the current interface, so that when the target interface is switched, the animation of the switched interface is played first, and then the animation of the target interface is played, and therefore seamless connection of playing the animation is achieved. In addition, in the invention, interface switching of different interfaces can be realized only by configuring interface sets of different interfaces, and compared with a mode that corresponding codes need to be added for each pair of target interfaces and switched interfaces, the method reduces the writing amount of repeated codes and improves the code reuse rate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for switching an interface according to an embodiment of the present invention;
fig. 2 is a flowchart of another interface switching method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an interface switching device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to implement seamless switching to a target interface to be switched to when playing the switched interface, a code of the switched interface is generally added to a code corresponding to the target interface to be switched to, so that when switching to the target interface, an animation of the switched interface is played first, and then the animation of the target interface is played, thereby implementing seamless connection of playing the animation.
If the code of the interface 1 is written on the interface 2, and the animation of the interface 1 is played first and then the animation of the interface 2 is played after the interface 2 is entered, the code only supports the interface 1 to switch the interface 2, and the switching of other interfaces cannot be multiplexed.
When the method is adopted, corresponding codes need to be added for each pair of target interfaces and switched interfaces, a large amount of repeated codes need to be written, and the code reuse rate is low.
In order to solve the technical problem, the inventor designs a set of interfaces through research, and realizes the switching of the interfaces by calling different interfaces. The interface switching controller is pre-configured with interface sets corresponding to different interfaces, and the different interfaces in the interface sets are used for realizing different interface states of the interfaces, so that in the process of playing a switched interface on a current interface, if an interface switching instruction is received, a switching interface in the interface set corresponding to the switched interface is called first, and a switching animation corresponding to the switched interface is played on the current interface. When the target interface to be switched does not exist, calling a creation interface in an interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface to play the entry animation corresponding to the target interface on the current interface, so that when the target interface is switched, the animation of the switched interface is played first, and then the animation of the target interface is played, and therefore seamless connection of playing the animation is achieved. In addition, in the invention, interface switching of different interfaces can be realized only by configuring interface sets of different interfaces, and compared with a mode that corresponding codes need to be added for each pair of target interfaces and switched interfaces, the method reduces the writing amount of repeated codes and improves the code reuse rate.
On the basis of the above, an embodiment of the present invention provides an interface switching method, which is applied to an interface switching controller, where the interface switching controller may be a controller, a server, or the like.
Different interfaces are pre-configured in the interface switching controller and correspond to interface sets, and the different interfaces in the interface sets are used for realizing different interface states of the interfaces.
Specifically, the interface switching controller (mgrstarge change) is added to divide the interface into 6 states of "create", "enter", "normal display", "restore", "switch", "exit", and 6 states correspond to 6 interfaces and state end events, and actions to be executed in each stage can be placed in the corresponding interfaces to realize different interface states of the interface. The 6 interfaces constitute the interface set in the present invention.
The definition of each state in this embodiment is as follows:
"create": the state is an interface initialization stage;
"enter": after the state of 'creation', before the state of 'normal display', the interface creation is completed, and the method is mainly used for preparing formal entering interfaces, such as interface refreshing, entering animation playing and the like;
"recovery": switching to an existing interface, and directly entering a recovery state, wherein the recovery state and the entry state can be regarded as different states in the same stage and are mainly used for distinguishing normal creation and recovery interfaces;
"Normal display": when the interface 'enter/restore' is finished, the interface is in a normally displayed state;
"switching": when the interface 1 is switched to the interface 2, the interface 1 enters a switching state, and an exit animation of the interface can be played in the switching state or interface logic can be cleared;
"Exit": after the state is in the switching state, the interface is switched and finished, and the interface is mainly destroyed.
The "enter" and "restore" can be regarded as two states of the same phase, and the "enter" is the first entry without creating the interface before. The recovery means that the interface is created before, and this time, the interface is only recovered, and the two states are split into two states so as to be convenient for corresponding to different use scenes in the redevelopment process.
In another implementation manner of the present invention, the interface switching controller may further configure an interface manager (stage), and the interface switching controller (MgrStageChange) always exists to manage switching logic and states of a plurality of interface managers (stages).
Interface manager (stage): each full screen interface (view) has a corresponding interface manager (stage) for managing the creation and display of the interface (view) and various states.
When the interface is created, the interface manager (stage) enters the creating state and calls the creating interface to complete the logic processing in the interface and sends the creating state ending event to the interface switching controller.
And ending the 'creation' state, entering the 'recovery' state if the interface exists before, otherwise entering the 'entry' state and calling the corresponding interface to finish the logic processing in the interface, and sending a 'recovery'/'entry' state ending event.
And ending the 'recovery'/'entering' state, entering the 'normal display' state, calling the 'normal display' interface, finishing logic processing in the interface, and sending a 'normal display' state ending event.
When the interface is required to be quitted and other interfaces are displayed, the switching state is entered and the switching interface is called, the logic processing in the interface is completed, and the switching state ending event is sent.
The "switch" state ends, the "exit" state is entered, and the interface is destroyed.
It should be noted that the order of the above 6 states is fixed, and it is necessary to execute each state in turn according to the above state order, and it is not possible to cross over a certain order, and when the previous stage of the interface is not finished, it is not possible to enter the next order.
In addition, the 6 interfaces are arranged for each interface, and the interface switching controller can call different interfaces through an interface manager controlling the interface to realize different states of the interface.
The actions performed by the interfaces of different interfaces may be different, such as "create" interface, which may create different interface content, and "switch" interface, which may play different switching animations.
With the above interface setup, when interface 1 is switched to interface 2, the design creates interface 2 when entering the "switch" state of interface 1. The animation exiting from the interface 1 is played in the interface corresponding to the switching state of the interface 1, the entering animation is played in the interface corresponding to the entering state of the interface 2, and the interface 1 and the interface 2 exist at the same time before entering the exiting state, so that the two interfaces can better realize seamless switching.
Referring to fig. 1, the interface switching method may include:
s11, judging whether an interface switching instruction is received; if yes, go to step S12.
Specifically, in the process of playing the switched interface on the current interface, whether an interface switching instruction is received is judged. The interface switching instruction can be the condition that the interface jump is met or the user triggers.
The condition of meeting the interface jump is that the current interface is played completely and the next interface needs to be displayed.
The user trigger means that the user clicks a certain key, and the key needs to jump to other interfaces. If the user clicks the button for starting the game again in the game playing process, the user needs to jump to the interface of the new game.
If an interface switching instruction is received, interface skipping is required, in this embodiment, the currently displayed interface is referred to as a switched interface, and an interface to be switched is referred to as a target interface.
S12, calling a switching interface in the interface set corresponding to the switched interface to play a switching animation corresponding to the switched interface on the current interface.
Specifically, the interface switching controller may control the first interface manager corresponding to the switched interface to call the switching interface in the interface set corresponding to the switched interface.
The interface switching controller can issue a switching starting state instruction to the first interface manager corresponding to the switched interface. Then, the first interface manager calls a switching interface in the interface set corresponding to the switched interface, and the switching animation corresponding to the switched interface is played through the switching interface. The content of the played switching animation may be pre-configured.
It should be noted that the duration of playing the switching animation corresponding to the switched interface through the switching interface is generally longer than the creation time of the target interface, so that the target interface is successfully created after the switching animation is played, and the problem of unsmooth switching caused by the fact that the switching animation is played completely but the target interface is not created completely is solved.
After the switched interface finishes playing the switching animation, the first interface manager returns a switching state ending event to the interface switching controller, the interface switching controller determines that the switching animation is finished playing, and then the interface switching controller controls the first interface manager to call an exit interface in an interface set corresponding to the switched interface so as to stop displaying the switched interface on the current interface.
Specifically, the interface switching controller issues an exit starting state instruction to the first interface manager, and the first interface manager calls an exit interface in the interface set corresponding to the switched interface, so that the current interface stops displaying the switched interface, and then returns an exit state ending event to the interface switching controller.
After that, in order to avoid the memory occupied by the switched interface, the switched interface may be deleted, and the first interface manager corresponding to the switched interface is also deleted.
Then, the interface switching controller sends a delete instruction to the first interface manager, so that the first interface manager deletes the switched interface and the first interface manager.
Specifically, the sent deleting instruction may be an interface destruction management type instruction, and after receiving the instruction, the first interface manager destroys the switched interface and performs self destruction, and then returns destruction completion information to the interface switching controller.
That is to say, after invoking the switching interface in the interface set corresponding to the switched interface to play the switching animation corresponding to the switched interface on the current interface, the method further includes:
after the switching animation is determined to be played completely, controlling the first interface manager to call an exit interface in an interface set corresponding to the switched interface so as to stop displaying the switched interface on the current interface;
and sending a deleting instruction to the first interface manager so that the first interface manager deletes the switched interface and the first interface manager.
S13, determining whether a target interface to be switched to exists or not; if yes, go to step S14.
Specifically, the target interface to be switched to may not exist, that is, the target interface needs to be created. In addition, the target interface to be switched to can also exist, for example, the target interface exists in the background of the interface switching controller, and at this time, the target interface does not need to be created again, and only the target interface needs to be restored.
In this embodiment, when an interface manager of an interface exists, the interface manager creates the interface. And further, whether the target interface exists or not can be determined through whether a second interface manager corresponding to the target interface exists or not.
S14, calling a creation interface in the interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface after determining that the target interface is successfully created, so as to play an entry animation corresponding to the target interface on the current interface.
Specifically, since the target interface to be switched to does not exist, and the second interface manager corresponding to the target interface does not exist, at this time, the interface switching controller creates the second interface manager corresponding to the target interface first, and then controls the second interface manager to call the created interface in the interface set corresponding to the target interface, so as to create the target interface.
In detail, the interface switching controller issues a command to start creating the state to the second interface manager corresponding to the target interface, and the second interface manager creates the target interface and returns a creating state ending event to the interface switching controller. At this time, the interface switching controller determines that the creation of the target interface is completed successfully.
And then, the interface switching controller issues a starting entry state to a second interface manager, the second interface manager calls an entry interface in the interface set corresponding to the target interface to play an entry animation corresponding to the target interface on the current interface, and after the entry animation is played, an entry state ending event is returned to the interface switching controller.
And after that, the target interface enters the ' state end and needs to enter the ' normal display ' state, at this time, the interface switching controller controls the second interface manager to call the normal display interface in the interface set corresponding to the target interface so as to continuously display the target interface on the current interface.
Specifically, the interface switching controller issues a normal state starting instruction to the second interface manager, and the second interface manager calls a normal display interface in the interface set corresponding to the target interface to continuously display the target interface on the current interface.
For the specific interface calling process, refer to the above corresponding descriptions.
In another implementation manner of the present invention, in a case that it is determined that a target interface to be switched to exists, the method further includes: and controlling the second interface manager to call a recovery interface in the interface set corresponding to the target interface so as to enter the target interface again.
Specifically, if the target interface to be switched to exists, the interface does not need to be created again, and only needs to be restored, and at this time, the interface switching controller controls the second interface manager to call the restoration interface in the interface set corresponding to the target interface so as to enter the target interface again.
For the specific interface calling process, refer to the above corresponding descriptions.
In order that those skilled in the art will more clearly understand the present invention, reference will now be made in detail to fig. 2. Wherein, the interface 1 is a switched interface, and the interface 2 is a target interface.
When switching from interface 1 to interface 2, the interface switch controller notifies the first interface manager to start the "switch" state, the interface switch controller and creates the second interface manager, and notifies the second interface manager to start the "create" state, the second interface manager completes the "create" state, and starts the "enter" state.
The interface 1 plays the switching animation in the switching state, and the interface 2 plays the entering animation in the entering state.
After the interface 1 and interface 2 states are completed, the next state of the interface is entered.
After the first interface manager exits the "state, the interface switching controller destroys the first interface manager and the interface 1.
From the first interface manager starting the "switch" state to the "exit" state, interface 1 and interface 2 exist simultaneously all the time, thereby realizing seamless switching.
It should be noted that the interface managers corresponding to the interface 1 and the interface 2 are executed independently, and each state is executed continuously according to the state sequence of the interface.
In this embodiment, the interface switching controller is preconfigured with interface sets corresponding to different interfaces, and the different interfaces in the interface sets are used to implement different interface states of the interfaces, so that in the process of playing a switched interface on a current interface, if an interface switching instruction is received, a switching interface in the interface set corresponding to the switched interface is called first, so as to play a switching animation corresponding to the switched interface on the current interface. When the target interface to be switched does not exist, the creation interface in the interface set corresponding to the target interface is called to create the target interface, and the entry interface in the interface set corresponding to the target interface is called to play the entry animation corresponding to the target interface on the current interface, so that when the target interface is switched, the animation of the switched interface is played first, and then the animation of the target interface is played, and therefore seamless connection of playing the animation is achieved. In the invention, only interface sets of different interfaces are needed to be configured, and when different interfaces are switched, the interface switching of different interfaces can be realized only by calling corresponding interfaces, compared with a mode that corresponding codes (the codes of the interface 1 are written on the interface 2 and are only suitable for switching the interface 1 to the interface 2, and when the interface 1 is switched to the interface 3, the codes need to be repeatedly written again) need to be added for each pair of target interfaces and switched interfaces, the writing amount of repeated codes is reduced, and the code reuse rate is improved.
In addition, the invention realizes the simultaneous existence of two full-screen interfaces during switching by adding an interface switching controller (MgrStageChange) and an interface manager (stage), thereby realizing seamless switching.
On the basis of the embodiment of the interface switching method, another embodiment of the present invention provides an interface switching apparatus, which is applied to an interface switching controller, where the interface switching controller is preconfigured with interface sets corresponding to different interfaces, and the different interfaces in the interface sets are used to implement different interface states of the interfaces;
referring to fig. 3, the interface switching apparatus includes:
the instruction judging module 11 is configured to judge whether an interface switching instruction is received in the process of playing the switched interface on the current interface;
a first interface calling module 12, configured to, if the switching animation is received, call a switching interface in an interface set corresponding to the switched interface, so as to play the switching animation corresponding to the switched interface on a current interface;
a determining module 13, configured to determine whether a target interface to be switched to exists;
and the second interface calling module 14 is configured to, if the target interface does not exist, call a creation interface in the interface set corresponding to the target interface to create the target interface, and after it is determined that the creation of the target interface is completed successfully, call an entry interface in the interface set corresponding to the target interface, so as to play an entry animation corresponding to the target interface on the current interface.
Further, the first interface calling module is specifically configured to:
and controlling a first interface manager corresponding to the switched interface to call the switching interface in the interface set corresponding to the switched interface.
Further, still include:
the third interface calling module is used for controlling the first interface manager to call an exit interface in the interface set corresponding to the switched interface after the switching animation is determined to be played, so that the switched interface is stopped being displayed on the current interface;
and the instruction sending module is used for sending a deleting instruction to the first interface manager so that the first interface manager deletes the switched interface and the first interface manager.
Further, the second interface invoking module 14 is configured to, when invoking a creation interface in the interface set corresponding to the target interface to create the target interface, specifically:
and creating a second interface manager corresponding to the target interface, and controlling the second interface manager to call a created interface in the interface set corresponding to the target interface so as to create the target interface.
Further, still include:
and the fourth interface calling module is used for controlling the second interface manager to call a recovery interface in the interface set corresponding to the target interface so as to enter the target interface again under the condition that the target interface to be switched to exists.
Further, still include:
and the fifth interface calling module is used for controlling the second interface manager to call a normal display interface in the interface set corresponding to the target interface so as to continuously display the target interface on the current interface.
In this embodiment, the interface switching controller is preconfigured with interface sets corresponding to different interfaces, and the different interfaces in the interface sets are used to implement different interface states of the interfaces, so that in the process of playing a switched interface on a current interface, if an interface switching instruction is received, a switching interface in the interface set corresponding to the switched interface is called first, so as to play a switching animation corresponding to the switched interface on the current interface. When the target interface to be switched does not exist, calling a creation interface in an interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface to play the entry animation corresponding to the target interface on the current interface, so that when the target interface is switched, the animation of the switched interface is played first, and then the animation of the target interface is played, and therefore seamless connection of playing the animation is achieved. In the invention, only interface sets of different interfaces are needed to be configured, and when different interfaces are switched, the interface switching of different interfaces can be realized only by calling corresponding interfaces, compared with a mode that corresponding codes (the codes of the interface 1 are written on the interface 2 and are only suitable for switching the interface 1 to the interface 2, and when the interface 1 is switched to the interface 3, the codes need to be repeatedly written again) need to be added for each pair of target interfaces and switched interfaces, the writing amount of repeated codes is reduced, and the code reuse rate is improved.
It should be noted that, for the specific implementation process of each module in the embodiment of the present invention, please refer to the corresponding description in the foregoing embodiment, which is not described herein again.
On the basis of the embodiments of the interface switching method and apparatus, another embodiment of the present invention provides an electronic device, including: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used for executing the interface switching method.
The electronic device in this embodiment may be the interface switching controller described above. Please refer to the above corresponding description for a specific interface switching method.
In this embodiment, the interface switching controller is preconfigured with interface sets corresponding to different interfaces, and the different interfaces in the interface sets are used to implement different interface states of the interfaces, so that in the process of playing a switched interface on a current interface, if an interface switching instruction is received, a switching interface in the interface set corresponding to the switched interface is called first, so as to play a switching animation corresponding to the switched interface on the current interface. When the target interface to be switched does not exist, calling a creation interface in an interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface to play the entry animation corresponding to the target interface on the current interface, so that when the target interface is switched, the animation of the switched interface is played first, and then the animation of the target interface is played, and therefore seamless connection of playing the animation is achieved. In the invention, only interface sets of different interfaces are needed to be configured, and when different interfaces are switched, the interface switching of different interfaces can be realized only by calling corresponding interfaces, compared with a mode that corresponding codes (the codes of the interface 1 are written on the interface 2 and are only suitable for switching the interface 1 to the interface 2, and when the interface 1 is switched to the interface 3, the codes need to be repeatedly written again) need to be added for each pair of target interfaces and switched interfaces, the writing amount of repeated codes is reduced, and the code reuse rate is improved.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. An interface switching method is characterized in that the interface switching method is applied to an interface switching controller, different interfaces are pre-configured in the interface switching controller and correspond to interface sets, and different interfaces in the interface sets are used for realizing different interface states of the interfaces;
the interface switching method comprises the following steps:
judging whether an interface switching instruction is received or not in the process of playing the switched interface on the current interface;
if so, calling a switching interface in an interface set corresponding to the switched interface to play a switching animation corresponding to the switched interface on a current interface;
determining whether a target interface to be switched to exists;
if not, calling a creation interface in the interface set corresponding to the target interface to create the target interface, and calling an entry interface in the interface set corresponding to the target interface after determining that the target interface is successfully created, so as to play an entry animation corresponding to the target interface on the current interface.
2. The interface switching method according to claim 1, wherein invoking a switching interface in the interface set corresponding to the switched interface comprises:
and controlling a first interface manager corresponding to the switched interface to call the switching interface in the interface set corresponding to the switched interface.
3. The interface switching method according to claim 2, wherein after the switching interface in the interface set corresponding to the switched interface is called to play the switching animation corresponding to the switched interface on the current interface, the method further includes:
after the switching animation is determined to be played completely, controlling the first interface manager to call an exit interface in an interface set corresponding to the switched interface so as to stop displaying the switched interface on the current interface;
and sending a deleting instruction to the first interface manager so that the first interface manager deletes the switched interface and the first interface manager.
4. The interface switching method according to claim 1, wherein invoking a creation interface in the interface set corresponding to the target interface to create the target interface comprises:
and creating a second interface manager corresponding to the target interface, and controlling the second interface manager to call a created interface in the interface set corresponding to the target interface so as to create the target interface.
5. The interface switching method according to claim 4, wherein in a case where it is determined that the target interface to be switched to exists, further comprising:
and controlling the second interface manager to call a recovery interface in the interface set corresponding to the target interface so as to enter the target interface again.
6. The interface switching method according to claim 4, wherein after the invoking of the entry interface in the interface set corresponding to the target interface to play the entry animation corresponding to the target interface on the current interface, the method further comprises:
and controlling the second interface manager to call a normal display interface in the interface set corresponding to the target interface so as to continuously display the target interface on the current interface.
7. An interface switching device is characterized in that the interface switching device is applied to an interface switching controller, different interfaces are pre-configured in the interface switching controller and correspond to interface sets, and different interfaces in the interface sets are used for realizing different interface states of the interfaces;
the interface switching device includes:
the instruction judging module is used for judging whether an interface switching instruction is received or not in the process of playing the switched interface on the current interface;
the first interface calling module is used for calling a switching interface in an interface set corresponding to the switched interface if the switching interface is received so as to play a switching animation corresponding to the switched interface on a current interface;
the determining module is used for determining whether a target interface to be switched to exists or not;
and the second interface calling module is used for calling a creation interface in the interface set corresponding to the target interface to create the target interface if the target interface does not exist, and calling an entry interface in the interface set corresponding to the target interface after the successful creation of the target interface is determined, so as to play the entry animation corresponding to the target interface on the current interface.
8. The interface switching apparatus according to claim 7, wherein the first interface invoking module is specifically configured to:
and controlling a first interface manager corresponding to the switched interface to call the switching interface in the interface set corresponding to the switched interface.
9. The interface switching device of claim 8, further comprising:
the third interface calling module is used for controlling the first interface manager to call an exit interface in the interface set corresponding to the switched interface after the switching animation is determined to be played, so that the switched interface is stopped being displayed on the current interface;
and the instruction sending module is used for sending a deleting instruction to the first interface manager so that the first interface manager deletes the switched interface and the first interface manager.
10. An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
a processor calls a program and is arranged to perform the interface switching method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210138457.3A CN114489911A (en) | 2022-02-15 | 2022-02-15 | Interface switching method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210138457.3A CN114489911A (en) | 2022-02-15 | 2022-02-15 | Interface switching method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114489911A true CN114489911A (en) | 2022-05-13 |
Family
ID=81481097
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210138457.3A Pending CN114489911A (en) | 2022-02-15 | 2022-02-15 | Interface switching method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114489911A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160269795A1 (en) * | 2013-10-30 | 2016-09-15 | Le Shi Zhi Xin Electronic Technology (Tianjin) Limited | Instructing mode switching method and device based on smart television interface |
CN109669755A (en) * | 2018-12-25 | 2019-04-23 | 北京金山安全软件有限公司 | Page switching method and device, electronic equipment and storage medium |
CN110825484A (en) * | 2019-11-12 | 2020-02-21 | 北京华宇信息技术有限公司 | Method and device for switching interfaces of different input methods |
CN111580904A (en) * | 2020-04-20 | 2020-08-25 | 北京小米移动软件有限公司 | Display state switching method, display state switching device and storage medium |
-
2022
- 2022-02-15 CN CN202210138457.3A patent/CN114489911A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160269795A1 (en) * | 2013-10-30 | 2016-09-15 | Le Shi Zhi Xin Electronic Technology (Tianjin) Limited | Instructing mode switching method and device based on smart television interface |
CN109669755A (en) * | 2018-12-25 | 2019-04-23 | 北京金山安全软件有限公司 | Page switching method and device, electronic equipment and storage medium |
CN110825484A (en) * | 2019-11-12 | 2020-02-21 | 北京华宇信息技术有限公司 | Method and device for switching interfaces of different input methods |
CN111580904A (en) * | 2020-04-20 | 2020-08-25 | 北京小米移动软件有限公司 | Display state switching method, display state switching device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7114633B2 (en) | Screen mirroring method, device, terminal and storage medium | |
US11376509B2 (en) | Virtual object grouping method and device, storage medium, and electronic device | |
CN107050850A (en) | The recording and back method of virtual scene, device and playback system | |
CN113663325B (en) | Team creation method, joining method, device and storage medium in virtual scene | |
CN114185508B (en) | Method for left-right screen splitting on Linux compatible android system | |
US11341096B2 (en) | Presenting and editing recent content in a window during an execution of a content application | |
CN114095776A (en) | Screen recording method and electronic equipment | |
CN103379385B (en) | The control method of intelligent television and operating system | |
WO2016086663A1 (en) | Method and apparatus for switching applications, and intelligent set top box device | |
CN106940722A (en) | A kind of image display method and device | |
CN112631814B (en) | Game scenario dialogue playing method and device, storage medium and electronic equipment | |
CN114816692A (en) | Screen projection display method and device, mobile terminal and storage medium | |
CN114489911A (en) | Interface switching method and device and electronic equipment | |
CN111346386A (en) | Message processing method and device | |
CN113082705B (en) | Game scene switching method, game scene switching device, computer equipment and storage medium | |
CN113923469A (en) | Processing method, device, equipment and storage medium for continuous delivery of gifts in live broadcast | |
CN112650490B (en) | Page switching method, electronic device and storage medium | |
CN113304477A (en) | Game interface display method, device, equipment and medium | |
CN108235089B (en) | Line switching control method, storage medium, electronic device and system | |
CN108089859B (en) | Recording playback-based blending method between android applications | |
CN112365905A (en) | Player control method, device, equipment and readable storage medium | |
CN108089692A (en) | A kind of method, mobile terminal and storage device for reducing mobile terminal power consumption | |
CN112379804B (en) | Application control method and electronic equipment | |
CN115103218B (en) | Data stream recovery method and device, equipment and medium thereof | |
JP2008210398A (en) | Electronic apparatus and method of controlling the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |