Popup window jumping processing method, device and equipment, storage medium and vehicle
Through reference management and abstract base class definition pop-up window jump method, the problem of bloat and coupling during pop-up window jumping in the existing technology is solved, the code decoupling and neatness of interface display are realized, and the development is improved Efficiency and user experience.
Patent Information
- Application Number
- CN202411119146.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-10
AI Technical Summary
In the prior art, there are problems of code bloat and serious coupling during pop-up jumping, and it is impossible to effectively manage the interaction and life cycle between pop-ups, resulting in confusion in interface display and difficulty in development and maintenance.
By creating reference management of pop-up instances, using abstract base classes to define shared logic and behavior, the forward and backward of pop-up windows are realized. The control page is responsible for managing the display sequence and logic, and separating the interactive logic and interface display logic through interfaces and methods to form a bullet Window chains to avoid overlapping interfaces.
The code is modularized and decoupled, which improves the clarity and maintainability of the code, reduces potential errors and development complexity, and ensures a clean interface and user experience.
Smart Images

Figure CN119105831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle technology, and in particular to a pop-up window jump processing method, device, equipment, storage medium and vehicle. Background Art
[0002] With the development of automobile technology, the central control screens of vehicles are getting larger and larger, and the interaction method of the central control screens will affect the user experience.
[0003] In some cases, the content of the central control screen that interacts with the user is relatively small. When the full-screen page is used for display, the screen will be relatively empty, affecting the user experience. To solve the above problems, designers are more inclined to use Dialog / pop-up window / floating window (collectively referred to as "pop-up window") for interaction when doing interactive design. In actual situations, the displayed pop-up window may not only be one pop-up window, but may trigger three or four, or even more pop-up windows.
[0004] There may be actual needs for jumps and interactions between multiple pop-up windows. In some processing methods, the display and control of all pop-up windows, as well as network requests and interactions, are placed in a host page (class), but this will inevitably cause code bloat and serious coupling problems. In other processing methods, the life cycle management and jump of pop-up windows are implemented through the Android native system DialogFragment, but it cannot properly solve the problem of the previous pop-up window being destroyed when jumping to the next pop-up window. Summary of the invention
[0005] One of the purposes of the present invention is to provide a method for processing pop-up window jumps to solve the problems of bloated code and coupled verification in the pop-up window jump process in the prior art; the second purpose is to provide a processing device for pop-up window jumps; the third purpose is to provide a terminal device; the fourth purpose is to provide a storage medium; and the fifth purpose is to provide a vehicle.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a method for processing a pop-up window jump, the method comprising:
[0008] In response to a user clicking on a first pop-up window forward control on a control page, creating a second pop-up window and hiding the first pop-up window, wherein the second pop-up window holds an instance of the first pop-up window;
[0009] In response to a user clicking operation on a return control of the second pop-up window, the first pop-up window is displayed by calling an instance of the first pop-up window, and the second pop-up window is destroyed.
[0010] According to the above technical means, the second pop-up window holds the instance of the first pop-up window, and controls the hiding and display of the first pop-up window through the instance of the first pop-up window. In this way, modularization and decoupling can be achieved by managing pop-ups by referencing instances. Each pop-up window can be developed, tested and maintained separately as an independent instance without paying attention to other parts of the entire application. The control page is responsible for managing the display order and logic of the pop-up windows, and realizes the forward and backward movement of the pop-up windows through interfaces and methods, effectively separating the interaction logic between pop-ups and the interface display logic, which helps the clarity and maintainability of the code.
[0011] Furthermore, the first pop-up window and the second pop-up window are respectively inherited from an abstract base class, and the abstract base class predefines a method for displaying a previous pop-up window, a method for hiding a previous pop-up window, and a method for setting and holding an instance of a previous pop-up window.
[0012] Through the above technical means, using abstract base classes to define and implement shared pop-up window logic and behavior can help improve code reusability, maintainability, and scalability, while also helping to reduce potential errors and improve development efficiency. If multiple pop-ups require the same logic for showing and hiding the previous pop-up, putting this logic in an abstract base class can avoid repetitive implementation of the same code and simplify the implementation of each specific pop-up class.
[0013] Further, the creating the second pop-up window and hiding the first pop-up window includes:
[0014] Creating an instance of the second pop-up window;
[0015] Passing the instance of the first pop-up window to the instance of the second pop-up window by setting a method that holds the previous pop-up window instance;
[0016] The instance of the first pop-up window is called by hiding the previous pop-up window, and the visible property of the root view of the window where the instance of the first pop-up window is located is modified to be hidden.
[0017] Through the above technical means, by setting a method to hold the previous pop-up window instance, the second pop-up window can directly access and operate the instance of the first pop-up window and its data. This direct association ensures seamless transmission and sharing of data between pop-up windows.
[0018] Furthermore, calling the instance of the first pop-up window by hiding the previous pop-up window, and modifying the visible property of the root view of the window where the instance of the first pop-up window is located to be hidden, includes:
[0019] When the life cycle of the second pop-up window enters onResume, the instance of the first pop-up window is called in the onResume method by hiding the previous pop-up window, and the visible property of the root view of the window where the instance of the first pop-up window is located is modified to hidden.
[0020] Through the above technical means, hiding in the onResume lifecycle method can avoid the problem of overlapping and confusing pop-up windows caused by switching to the background and then switching back to the foreground.
[0021] Further, displaying the first pop-up window by calling the instance of the first pop-up window includes:
[0022] The instance of the first pop-up window is called by displaying the previous pop-up window, and the visible property of the root view of the window where the instance of the first pop-up window is located is modified to be visible.
[0023] Through the above technical means, by calling the root view of the window where the first pop-up window instance is located and changing its visible property to visible, the operation process of displaying the previous pop-up window is simplified. There is no need to directly operate the visibility of each pop-up window, but to manage the visibility of the entire window through a unified method, thereby reducing duplicate code and improving the clarity of the code. Encapsulating the display operation in the root view of the window separates the logic of interface display and the logic of pop-up window management. This encapsulation improves the modularity of the code, making the code easier to maintain and modify.
[0024] Furthermore, the method further comprises:
[0025] In response to a user clicking operation on the forward control of the second pop-up window, a third pop-up window is created, and the first pop-up window and the second pop-up window are hidden, wherein the third pop-up window inherits from the abstract base class and holds an instance of the second pop-up window.
[0026] Through the above technical means, a pop-up window chain can be formed, which ensures that only one pop-up window is displayed at the same time, effectively avoiding possible interface overlap or confusion. Each time a new pop-up window is displayed, the previous pop-up window will be hidden or closed, keeping the user interface neat and easy to understand.
[0027] Furthermore, the method further comprises:
[0028] Obtaining information input by the user in the second pop-up window;
[0029] The content of the first pop-up window is updated according to the information.
[0030] Through the above technical means, parameter interaction between pop-up windows can be achieved.
[0031] In a second aspect, the present invention provides a pop-up window jump processing device, the device comprising:
[0032] An advance module, configured to create a second pop-up window in response to a user clicking on a first pop-up window advance control on a control page, and hide the first pop-up window, wherein the second pop-up window holds an instance of the first pop-up window;
[0033] The return module is used to display the first pop-up window by calling the instance of the first pop-up window in response to the user clicking the return control of the second pop-up window, and destroy the second pop-up window.
[0034] In a third aspect, the present invention provides a terminal device, comprising: a memory, a processor and a display device;
[0035] The memory stores computer-executable instructions;
[0036] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0038] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method as described in any one of the first aspects.
[0039] In a sixth aspect, the present invention provides a vehicle, comprising a terminal device that executes a pop-up window jump processing method as described in any one of the first aspects.
[0040] Beneficial effects of the present invention:
[0041] (1) In the present invention, the second pop-up window holds an instance of the first pop-up window, and controls the hiding and display of the first pop-up window through the instance of the first pop-up window. In this way, modularization and decoupling can be achieved by managing pop-ups by referencing instances. Each pop-up window can be developed, tested and maintained separately as an independent instance without paying attention to other parts of the entire application. The control page is responsible for managing the display order and logic of the pop-up windows, and realizes the forward and backward movement of the pop-up windows through interfaces and methods, effectively separating the interaction logic between pop-ups and the interface display logic, achieving code decoupling, and improving the clarity and maintainability of the code.
[0042] (2) The present invention uses an abstract base class to define and implement shared pop-up window logic and behavior, which helps improve code reusability, maintainability, and scalability, while also helping to reduce potential errors and improve development efficiency. If multiple pop-up windows require the same logic for displaying and hiding the previous pop-up window, placing these logics in an abstract base class can avoid repeatedly implementing the same code, simplifying the implementation of each specific pop-up window class.
[0043] (3) The present invention calls the root view of the window where the first pop-up window instance is located and modifies its visible attribute to visible or hidden. In this way, the display operation is encapsulated in the root view of the window, so that the logic of interface display and the logic of pop-up window management are separated, which simplifies the operation process of displaying and hiding the previous pop-up window, and there is no need to directly operate the visibility of each pop-up window. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] Figure 1 This is a schematic diagram of the application scenario of this application;
[0046] Figure 2 A flowchart of a method for processing a pop-up window jump provided by an embodiment of the present invention;
[0047] Figure 3 A schematic diagram of a pop-up window interaction provided by an embodiment of the present invention;
[0048] Figure 4 A flowchart of a method for processing a pop-up window jump provided by an embodiment of the present invention;
[0049] Figure 5 A flowchart of a method for processing a pop-up window jump provided by an embodiment of the present invention;
[0050] Figure 6 A method class diagram provided for an embodiment of the present invention;
[0051] Figure 7 A schematic diagram of the structure of a pop-up window jump processing device provided by an embodiment of the present invention;
[0052] Figure 8 A schematic diagram of the structure of a terminal device provided in one embodiment of the present invention.
[0053] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0054] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0055] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0056] First, the proper nouns involved in the present invention are introduced:
[0057] View: refers to the view on Window.
[0058] Activity: usually represents a page, has a life cycle, and corresponds to a Window.
[0059] Fragment: It is actually a View, attached to an Activity. Because it is a View, it can represent a page or view that is seen and has a life cycle.
[0060] DialogFragment: It is a class provided by Android natively for presenting pop-up windows. It is a special Fragment used to display a dialog box (Dialog / pop-up window) on an Activity. The dialog box has a Window, and the View on the Window presents the view you see.
[0061] DecorView: The root View of Window.
[0062] BaseDialogFragment: It is an abstract class that encapsulates DialogFragment.
[0063] Controller: refers to the page that is currently displayed in full screen. Different pop-up windows can be opened inside or above it.
[0064] At present, in some scenarios, UE designers are more inclined to use Dialog / pop-up windows / floating windows (hereinafter referred to as "pop-up windows") for interaction when performing interaction design. This inevitably involves the design of jumps and returns between pop-up windows: for example, when opening the next pop-up window, the previous pop-up window must be hidden. Conversely, when clicking return on the next pop-up window, the current pop-up window disappears and the previous pop-up window appears. In addition, network requests or other interactions may be required in each pop-up window, which further increases the complexity of coding. Of course, the actual situation may not only have two pop-up windows, but may also be three or four, or even more. At present, there does not seem to be a fixed and good solution at the development level for such interaction scenarios.
[0065] Some developers may put the display and hiding controls of these pop-up windows, as well as network requests and interactions, into a host page (class), which is bound to cause code bloat and serious coupling problems. Other developers may also want to put the logic of network requests and interactions into their own pop-up windows through custom pop-up windows, but if they still want the pop-up windows to have lifecycle methods such as onCreate and onResume of Activity or Fragment, they may think of using DialogFragment to implement it, but they cannot properly solve the problem of the previous pop-up window being destroyed when jumping to the next pop-up window. And sometimes you may also need to pass parameters when jumping to the next pop-up window, or return some values from the next pop-up window to the previous pop-up window. These are difficult to achieve.
[0066] In view of the above technical problems, in order to solve the problem of difficulty in coding implementation in the scenario of jumping and returning between pop-up windows, the inventor has made the following design in the process of researching this field to decouple the code: each DialogFragment (pop-up window) instance will contain the previous DialogFragment (pop-up window) instance, and provide an interface and method for controlling the forward and backward movement of the pop-up window, so that the forward and backward movement of the pop-up window, that is, jumping and returning, can be conveniently performed in the Controller. Regarding parameter passing, the interface, method and method parameters can be defined as needed and passed to the next DialogFragment or the previous DialogFragment. Through such a design, jumping and returning between pop-up windows can be realized, decoupling can be achieved, the bloated code can be avoided, and subsequent development and maintenance are also convenient, and memory consumption can be reduced to a certain extent.
[0067] Figure 1 This is a schematic diagram of the application scenario of this application, such as Figure 1As shown, the user can click the first pop-up window to jump to the second pop-up window, or click return in the second pop-up window to jump to the first pop-up window. The method provided by the present invention can be used not only for the display screen of the vehicle machine, but also for mobile phones, tablets, virtual reality devices, etc.
[0068] The executor of this technical solution can be a vehicle terminal or a cloud server.
[0069] The technical solution of the present invention is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0070] Figure 2 The flowchart of the method for processing pop-up window jump provided by one embodiment of the present invention. Figure 2 As shown, the method of the embodiment of the present invention includes:
[0071] S101. In response to a user clicking on a first pop-up window forward control on a control page, create a second pop-up window and hide the first pop-up window, wherein the second pop-up window holds an instance of the first pop-up window.
[0072] In this step, when the user triggers the event of displaying the first pop-up window DialogFragment1 in the control page, the controller displays the first pop-up window DialogFragment1, which may include multiple components displayed, such as a forward control, a back control, and pop-up window content, where there may be multiple forward controls. The user clicks the forward control to create an instance of the second pop-up window DialogFragment2, which holds the instance of the first pop-up window DialogFragment1.
[0073] Specifically, first define an internal interface (such as OnDialogEventListener) containing two methods: one for forward (doForward) and the other for back (doBack). Each DialogFragment needs to implement this interface so that it can control the navigation behavior of the pop-up window when needed. That is, when the user clicks the "Next" button, the forward method is called to navigate to the next DialogFragment; when the user clicks the "Back" button, the back method is called to perform the back operation.
[0074] In one implementation, both the first pop-up window and the second pop-up window inherit from the abstract base class BaseDialogFragment, which defines the preFragment attribute, as well as the showPreFragment method for displaying the previous pop-up window, the hidePreFragment method for hiding the previous pop-up window, and the setPreFragment method for setting the previous pop-up window instance. Among them, preFragment is an attribute, that is, a member variable, which is used to store a reference to the previous pop-up window instance of the current pop-up window in the BaseDialogFragment class. The function of this attribute is to establish a chain relationship between pop-ups, so that each pop-up window instance can access the pop-up window instance of its direct predecessor. When creating the second pop-up window instance, the instance of the first pop-up window is passed to the second pop-up window by calling the setPreFragment method, that is, the instance of the first pop-up window is stored in the preFragment attribute of the second pop-up window. In this way, the second pop-up window holds the instance of the first pop-up window, thereby establishing an association between the pop-ups.
[0075] In another implementation, define an interface, implement the interface in the first pop-up window, and hold a reference to the interface type in the second pop-up window. This way, references can be passed more flexibly and can be used in multiple places.
[0076] After the second pop-up window instance holds the instance of the first pop-up window, the root view of the window where the instance of the first pop-up window is located is called by hiding the previous pop-up window method (hidePreFragment), and the visible property of the root view is modified to hidden.
[0077] S102: In response to a user clicking operation on a return control of the second pop-up window, the first pop-up window is displayed by calling an instance of the first pop-up window, and the second pop-up window is destroyed.
[0078] In this step, after the user operates the second pop-up window, he wants to return to the previous pop-up window and clicks the return control in the interface of the second pop-up window. After the user clicks the return control, the root view of the window where the first pop-up window instance is located is called in the second pop-up window instance through the showPreFragment method of displaying the previous pop-up window, and the visible property of the root view is changed to visible. Then the dismiss method is called to destroy the second pop-up window.
[0079] The pop-up window jump processing method provided by the embodiment of the present invention creates a second pop-up window and hides the first pop-up window in response to the user clicking the forward control of the first pop-up window on the control page, wherein the second pop-up window holds an instance of the first pop-up window; in response to the user clicking the return control of the second pop-up window, the first pop-up window is displayed by calling the instance of the first pop-up window, and the second pop-up window is destroyed. Through this method, when the next pop-up window is opened, the previous pop-up window is hidden and will not disappear, and the user can return to the previous pop-up window when needed, and by holding the previous pop-up window instance in the next pop-up window, each pop-up window manages its own display logic, achieving code decoupling, avoiding code bloat, facilitating subsequent development and maintenance, and reducing memory consumption to a certain extent.
[0080] In some embodiments, Figure 3 As shown, Figure 3 A pop-up window interaction diagram provided for an embodiment of the present invention, in which the user can click the forward control in the second pop-up window to create a third pop-up window in the same manner as the second pop-up window is created. The third pop-up window holds an instance of the second pop-up window, and when the third pop-up window is displayed, the second pop-up window and the first pop-up window are hidden. When the user clicks the return control of the third pop-up window, the second pop-up window is displayed and the third pop-up window is destroyed. In this way, more pop-ups can be opened, and each pop-up window holds an instance of the previous pop-up window, forming a pop-up window chain. When a new pop-up window function is needed, the instance of the previous pop-up window can be referenced by the response, thereby achieving code decoupling and facilitating the management, development and maintenance of multiple pop-ups.
[0081] According to the scheme of the above embodiment, if the user has opened two pop-up windows, and the user operates the application to return to the background to perform other operations, and then switches back to the foreground, the system will re-call the life cycle methods of the foreground activity and the pop-up window according to the application life cycle management mechanism, which may cause the first pop-up window and the second pop-up window to be displayed and overlapped. If there are more pop-up windows, the page will display more pop-up windows, which will cause trouble to the user.
[0082] The following is an example of how to solve the above situation.
[0083] Figure 4 The flowchart of the method for processing pop-up window jump provided by one embodiment of the present invention. Figure 4 As shown, the method of the embodiment of the present invention includes:
[0084] S201. Create a second pop-up window instance.
[0085] When the second pop-up window instance is created, the onCreate method is called to perform initialization operations, such as setting the layout, binding data, etc. The layout file of the pop-up window is loaded, and the view is initialized to create the pop-up window view. When the pop-up window is visible but not yet displayed to the user, the onStart method is called to perform some preparatory work, such as setting animation effects or starting data loading.
[0086] S202. When the life cycle of the second pop-up window enters onResume, in the onResume method, the root view of the window where the instance of the first pop-up window is located is called by hiding the previous pop-up window, and the visible property of the root view is modified to hidden.
[0087] In this step, the onResume method is called when the pop-up window is about to start interacting with the user. In the onResume method, the root view of the window where the previous pop-up window instance is located can be hidden by calling the hidePreFragment method.
[0088] After the onResume method is called, the second pop-up window can interact with the user. The subsequent life cycle is similar to the management method of the life cycle in the prior art, and will not be repeated here.
[0089] The pop-up window jump processing method provided in this embodiment can solve the problem of chaotic pop-up window display when returning to the background and then switching to the foreground by hiding the previous pop-up window in the onResume method when the second pop-up window enters the onResume life cycle, and can ensure that only one pop-up window is currently displayed. The life cycle of the application may cause the display state of the pop-up window to need to be dynamically adjusted. Processing the display or hiding of the pop-up window in onResume can better adapt to the situation where the application switches from the background to the foreground, maintaining the consistency of the interface and user experience.
[0090] Figure 5 Flow chart of a method for processing a pop-up window jump provided by an embodiment of the present invention. Figure 5 As shown, the method of the embodiment of the present invention includes:
[0091] S301. Obtain information input by the user in the second pop-up window.
[0092] In this step, in the second pop-up window, a method for obtaining information is pre-added to obtain information input by the user. When the user input needs to be obtained, for example, when the user clicks the OK button, the method for obtaining information is called to obtain the information input by the user.
[0093] S302: Update the content of the first pop-up window according to the information.
[0094] An interface is predefined in the first pop-up window to receive information from the second pop-up window and perform an update operation. The interface method in the first pop-up window instance is called in the second pop-up window to pass the information input by the user.
[0095] The method for processing pop-up window jump provided by the embodiment of the present invention utilizes the callback mechanism of the interface to ensure the validity and reliability of information transmission and update operations between pop-up windows.
[0096] The following example introduces the method of handling pop-up window jump.
[0097] Figure 6 This is a method class diagram provided by an embodiment of the present invention. Figure 6 As shown, the control page Controller refers to the page displayed in full screen in the current screen, that is, the main display area in the user interface. The Controller page can include various operable elements, such as pop-up windows, overlays, dialog boxes (a special pop-up window), etc. In the Controller page, multiple pop-up windows can be opened. Figure 6 It shows that three different pop-up windows can be opened on the page. Among them, DialogFragment is a class provided by Android natively for presenting pop-up windows. BaseDialogFragment is an encapsulation of DialogFragment and is an abstract class. Each DialogFragment is set with a preFragment property of the BaseDialogFragment type (representing the pop-up window instance before it) and a showPreFragment() method for displaying the previous pop-up window and a hidePreFragment() method for hiding the previous pop-up window in preFragment. It should be noted that the hidePreFragment() method must be called in onResume(), and the showPreFragment() method is called in the interface callback upon return.
[0098] The first pop-up window DialogFragment1: An example inherited from BaseDialogFragment. The first pop-up window DialogFragment1 has an OnDialogEventListener1 internal interface, which contains the doForward method representing the forward behavior of the pop-up window and the doBack method representing the backward behavior.
[0099] The second pop-up window DialogFragment2: Same as the first pop-up window DialogFragment1. The difference is that the parameters of the interface method are different, and there is also an additional method for processing the return parameters.
[0100] The third pop-up window DialogFragment3: is the same as the first pop-up window DialogFragment1. The difference is that the parameters of the interface method are different.
[0101] Initial state: The first pop-up window displays tabular data, which may be a list or table view, each item of which can be clicked by the user.
[0102] The specific operations are as follows:
[0103] User operation: The user clicks a table item on the first pop-up window on the control page, triggering a forward operation.
[0104] Create a second pop-up window: In response to the user click event, the program creates a second pop-up window instance and passes the first pop-up window instance to the second pop-up window through a pre-set method of holding the previous pop-up window instance. The second pop-up window can access and operate the data or methods in the first pop-up window through the first pop-up window instance.
[0105] Hide the first pop-up window: When creating the second pop-up window, when the life cycle of the second pop-up window enters onResume, the second pop-up window calls the method inherited by itself to hide the previous pop-up window to hide the first pop-up window.
[0106] The user enters data in the second pop-up window: the user enters the required information or data in the second pop-up window.
[0107] Transmit information to the first pop-up window: After the user completes input, the second pop-up window transmits the acquired information to the first pop-up window through a predefined interface method. After receiving the information, the first pop-up window updates the displayed table data or other view content as needed.
[0108] User closes the second pop-up window: The user clicks the return control or close button in the second pop-up window, triggering a close operation.
[0109] Display the first pop-up window: In the second pop-up window, by calling the instance of the first pop-up window, modify the properties of the root view to make the first pop-up window re-display, restore to the state the user was in before, and the data in it is also updated accordingly.
[0110] Destroy the second pop-up window: Call the dismiss method to destroy the second pop-up window and release related resources and memory.
[0111] In summary, we can see that each DialogFragment (pop-up window) instance will contain the previous DialogFragment (pop-up window) instance, and we provide interfaces and methods to control the pop-up window forward and backward. In the control page Controller, you can easily move the pop-up window forward and backward, that is, jump and return. Regarding parameter passing, because we can define interfaces, methods and method parameters as needed, after we receive the method parameters of the interface callback, we can pass them to the next DialogFragment or the previous DialogFragment.
[0112] Figure 7 A schematic diagram of a structure of a pop-up window jump processing device provided by an embodiment of the present invention, such as Figure 7 As shown, the pop-up window jump processing device 500 of the embodiment of the present invention includes:
[0113] The forward module 501 is used to create a second pop-up window and hide the first pop-up window in response to a user clicking the first pop-up window forward control on the control page, wherein the second pop-up window holds an instance of the first pop-up window;
[0114] The return module 502 is used to display the first pop-up window by calling the instance of the first pop-up window in response to the user clicking the return control of the second pop-up window, and destroy the second pop-up window.
[0115] In some embodiments, the first pop-up window and the second pop-up window are respectively inherited from an abstract base class, and the abstract base class predefines a method for displaying a previous pop-up window, a method for hiding a previous pop-up window, and a method for setting a method for holding a previous pop-up window instance.
[0116] In some embodiments, the forward module 501 is further configured to:
[0117] Creating an instance of the second pop-up window;
[0118] Passing the instance of the first pop-up window to the instance of the second pop-up window by setting a method that holds the previous pop-up window instance;
[0119] The root view of the window where the instance of the first pop-up window is located is called by hiding the previous pop-up window, and the visible property of the root view is modified to be hidden.
[0120] In some embodiments, the forward module 501 is further configured to:
[0121] When the life cycle of the second pop-up window enters onResume, the root view of the window where the instance of the first pop-up window is located is called in the onResume method by hiding the previous pop-up window, and the visible property of the root view is modified to hidden.
[0122] In some embodiments, the returning module 502 is further configured to display the first pop-up window by calling the instance of the first pop-up window, including:
[0123] The root view of the window where the instance of the first pop-up window is located is called by displaying the previous pop-up window, and the visible property of the root view is modified to visible.
[0124] In some embodiments, the forward module 501 is further configured to:
[0125] In response to a user clicking operation on the forward control of the second pop-up window, a third pop-up window is created, and the first pop-up window and the second pop-up window are hidden, wherein the third pop-up window inherits from the abstract base class and holds an instance of the second pop-up window.
[0126] In some embodiments, the pop-up window jump processing device 500 further includes an acquisition module 503:
[0127] The acquisition module 503 is used to acquire information input by the user in the second pop-up window;
[0128] The returning module 502 is further configured to update the content of the first pop-up window according to the information.
[0129] The pop-up window jump processing device of the embodiment of the present invention can be used to execute the technical solution of any of the above-mentioned pop-up window jump processing method embodiments, and its implementation principle and technical effect are similar, which will not be repeated here.
[0130] Figure 8 This is a schematic diagram of the structure of a terminal device provided by an embodiment of the present invention. Figure 8 As shown, the terminal device 600 may include: at least one processor 601 , a memory 602 and a display device 603 .
[0131] The memory 602 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer-executable instructions.
[0132] The memory 602 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0133] The display device 603 is used to display pages and interact with users.
[0134] The processor 601 is used to execute the computer-executable instructions stored in the memory 602 to implement the method described in the aforementioned method embodiment. Among them, the processor 601 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. Specifically, when implementing the pop-up window jump processing method described in the aforementioned method embodiment, the terminal device can be, for example, an electronic control unit on a vehicle, a server, or other electronic device with processing functions.
[0135] Optionally, the terminal device 600 may further include a communication interface 604. In a specific implementation, if the communication interface 604, the memory 602 and the processor 601 are implemented independently, the communication interface 604, the memory 602 and the processor 601 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0136] Optionally, in a specific implementation, if the communication interface 604, the memory 602 and the processor 601 are integrated on a chip, the communication interface 603, the memory 602 and the processor 601 can communicate through an internal interface.
[0137] The present invention also provides a computer-readable storage medium, in which computer program instructions are stored. When a processor executes the computer program instructions, the above pop-up window jump processing method is implemented.
[0138] The present invention also provides a computer program product, including a computer program, which implements the above pop-up window jump processing method when executed by a processor.
[0139] The present invention also provides a vehicle, including a terminal device that implements the above pop-up window jump processing method.
[0140] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0141] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0142] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0145] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0146] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0147] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for processing pop-up window jumps, It is characterized in that The method comprises: In response to a user clicking on a first pop-up window forward control on a control page, creating a second pop-up window and hiding the first pop-up window, wherein the second pop-up window holds an instance of the first pop-up window; In response to a user clicking operation on a return control of the second pop-up window, the first pop-up window is displayed by calling an instance of the first pop-up window, and the second pop-up window is destroyed.
2. The method according to claim 1, It is characterized in that The first pop-up window and the second pop-up window are respectively inherited from an abstract base class, and the abstract base class predefines a method for displaying a previous pop-up window, a method for hiding a previous pop-up window, and a method for setting and holding an instance of a previous pop-up window.
3. The method according to claim 2, It is characterized in that The step of creating the second pop-up window and hiding the first pop-up window includes: Creating an instance of the second pop-up window; Passing the instance of the first pop-up window to the instance of the second pop-up window by setting a method that holds the previous pop-up window instance; The instance of the first pop-up window is called by hiding the previous pop-up window, and the visible property of the root view of the window where the first pop-up window instance is located is modified to be hidden.
4. The method according to claim 3, It is characterized in that The method of calling the first pop-up window instance by hiding the previous pop-up window, and modifying the visible property of the root view of the window where the first pop-up window instance is located to be hidden, includes: When the life cycle of the second pop-up window enters onResume, the instance of the first pop-up window is called in the onResume method by hiding the previous pop-up window, and the visible property of the root view of the window where the first pop-up window instance is located is modified to hidden.
5. The method according to any one of claims 2 to 4, It is characterized in that The displaying the first pop-up window by calling the instance of the first pop-up window includes: The instance of the first pop-up window is called by displaying the previous pop-up window, and the visible property of the root view of the window where the instance of the first pop-up window is located is modified to be visible.
6. The method according to any one of claims 2 to 4, It is characterized in that The method further comprises: In response to a user clicking operation on the forward control of the second pop-up window, a third pop-up window is created, and the first pop-up window and the second pop-up window are hidden, wherein the third pop-up window inherits from the abstract base class and holds an instance of the second pop-up window.
7. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Obtaining information input by the user in the second pop-up window; The content of the first pop-up window is updated according to the information.
8. A pop-up window jump processing device, It is characterized in that The device comprises: An advance module, configured to create a second pop-up window in response to a user clicking on a first pop-up window advance control on a control page, and hide the first pop-up window, wherein the second pop-up window holds an instance of the first pop-up window; The return module is used to display the first pop-up window by calling the instance of the first pop-up window in response to the user clicking the return control of the second pop-up window, and destroy the second pop-up window.
9. A terminal device, It is characterized in that include: Memory, processor and display device; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, It is characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
12. A vehicle, It is characterized in that A terminal device comprising a method for processing a pop-up window jump as described in any one of claims 1-7.
