Display method and device of network application program, equipment, medium and product
By injecting a bridge object into the network view component and calling the native application's display state and switching functions, the problem of low accuracy in judging the full-screen display state of the network application is solved, enabling the network application to autonomously switch and jump between display states, thus improving the accuracy of the interface display.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the determination of the full-screen display status of web applications relies on manually written lists, resulting in low accuracy.
By injecting a bridge object into the network view component and calling the native application's display state and switching functions, the display state of the network view component can be set independently, enabling the network application to switch and jump automatically.
It improves the display accuracy of web applications, ensuring the accuracy and consistency of the interface display, especially when switching between full-screen and non-full-screen modes.
Smart Images

Figure CN121807290A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of application technology, and in particular to a method, apparatus, device, medium and product for displaying a web application. Background Technology
[0002] A hybrid application includes a native application and multiple web applications. The web view component within the native application can load and run the web applications to display their corresponding interfaces. The display state of the web view component when showcasing the application's interface is specified by the native application.
[0003] In related technologies, native applications can listen to the loading requests of network applications and determine the display state of the network view component when displaying the application's interface, and whether it is in full-screen display state, based on whether the network application's identifier is in the full-screen display list.
[0004] However, the methods in related technologies rely on manually compiled full-screen display lists, which leads to low accuracy. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for displaying web applications, which can improve the accuracy of web application display.
[0006] In a first aspect, embodiments of this application disclose a method for displaying a web application, applied to an electronic device, the method comprising:
[0007] Run the first network application, and through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component; wherein, the first network view component is the network view component that carries the first network application;
[0008] When the first network application is run, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component; wherein, the first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component.
[0009] In one possible implementation, a first network application is run. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component, including:
[0010] Run the first network application. If the display state is inconsistent with the first target display state corresponding to the first network application, determine the target function according to the first target display state. The target function is either the full-screen on function in the switching function or the full-screen off function in the switching function.
[0011] Run the first network application, and through the bridge object injected in the first network view component, call the target function of the native application to switch the display state corresponding to the first network view component.
[0012] In one possible implementation, a first network application is run. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, a target function is determined based on the first target display state, including:
[0013] Run the first network application. If the display state is inconsistent with the first target display state corresponding to the first network application, and the first target display state is full-screen display state, then determine the target function as the full-screen enable function.
[0014] or,
[0015] Run the first network application. If the display state is inconsistent with the first target display state corresponding to the first network application, and the first target display state is a non-full-screen display state, then determine the target function as the full-screen closing function.
[0016] In one possible implementation, the method includes:
[0017] Run the first network application, and if the first target is determined to be in full-screen display mode, call the status bar height function of the native application through the bridge object injected in the first network view component to obtain the status bar height of the electronic device.
[0018] Run the first network application and update the top inner margin information of the navigation bar of the first network application according to the status bar height; wherein the navigation bar of the first network application belongs to the display interface of the first network application.
[0019] In one possible implementation, the method also includes:
[0020] Run the first network application and obtain a redirect request; the redirect request includes the identifier of the second network application and the display status of the second target corresponding to the second network application;
[0021] Run the first network application and determine the jump type corresponding to the second network application; wherein, the jump type is either the first jump type or the second jump type; the first jump type is the type of jump within the same network view component, and the second jump type is the type of jump between different network view components;
[0022] Run the first network application, and jump from the first network application to the second network application based on the jump type, the identifier of the second network application, and the display status of the second target.
[0023] In one possible implementation, a first network application is run, and based on the jump type, the identifier of the second network application, and the display state of the second target, the user jumps from the first network application to the second network application, including:
[0024] Run the first network application, and when the jump type is the second jump type, determine the indication information according to the second target display state; wherein, the indication information is used to set the current display state of the second network view component; the second network view component is the network view component that carries the second network application;
[0025] Run the first network application, and based on the instructions and the identifier of the second network application, call the creation function of the native application through the bridge object injected in the first network view component to create the second network view component, and load the second network application in the second network view component.
[0026] In one possible implementation, a first network application is run, and based on the jump type, the identifier of the second network application, and the display state of the second target, the user jumps from the first network application to the second network application, including:
[0027] Run the first network application, and if the jump type is the first jump type, determine whether the display state of the second target is consistent with the display state of the first target corresponding to the first network application;
[0028] When the first network application is running, if the display state of the second target is inconsistent with the display state of the first target corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0029] Run the first network application, and based on the identifier of the second network application, call the program jump function of the native application through the bridge object injected in the first network view component to unload the first network application and load the second network application in the first network view component.
[0030] Secondly, embodiments of this application provide a display device for a web application, comprising:
[0031] The state acquisition module is used to obtain the display state corresponding to the first network view component by calling the display state function of the native application through the bridge object injected in the first network view component; wherein, the first network view component is the network view component that carries the first network application;
[0032] The state switching module is used to switch the display state of the first network view component by calling the switching function of the native application through the bridge object injected in the first network view component when it is determined that the display state is inconsistent with the first target display state corresponding to the first network application. The first network view component is used to display the display interface of the first network application based on the display state of the first network view component.
[0033] In one possible implementation, the state switching module is specifically used for:
[0034] If the display state is determined to be inconsistent with the first target display state corresponding to the first network application, a target function is determined based on the first target display state; wherein, the target function is the full-screen on function in the switching function, or the target function is the full-screen off function in the switching function;
[0035] By injecting a bridge object into the first network view component, the target function of the native application is called to switch the display state corresponding to the first network view component.
[0036] In one possible implementation, the state switching module is specifically used for:
[0037] If the display state is inconsistent with the first target display state corresponding to the first network application, and the first target display state is a full-screen display state, then the target function is determined to be a full-screen enable function.
[0038] or,
[0039] If the display state is inconsistent with the first target display state corresponding to the first network application, and the first target display state is a non-full-screen display state, then the target function is determined to be the full-screen closing function.
[0040] In one possible implementation, the navigation bar settings module is used for:
[0041] If the first target display state is determined to be full-screen display state, the status bar height of the electronic device is obtained by calling the status bar height function of the native application through the bridge object injected in the first network view component.
[0042] Update the top inner margin information of the navigation bar of the first network application based on the status bar height; the navigation bar of the first network application is part of the display interface of the first network application.
[0043] In one possible implementation, the jump module is used for:
[0044] Obtain the redirect request; the redirect request includes the identifier of the second network application and the display status of the second target corresponding to the second network application;
[0045] Determine the jump type corresponding to the second network application; wherein the jump type is either a first jump type or a second jump type; the first jump type is the type of jump within the same network view component, and the second jump type is the type of jump between different network view components;
[0046] Based on the jump type, the identifier of the second network application, and the display status of the second target, the user is redirected from the first network application to the second network application.
[0047] In one possible implementation, the jump module is specifically used for:
[0048] When the jump type is the second jump type, the indication information is determined according to the second target display state; wherein, the indication information is used to set the current display state of the second network view component; the second network view component is a network view component that carries the second network application;
[0049] Based on the instruction information and the identifier of the second network application, the creation function of the native application is called through the bridge object injected in the first network view component to create the second network view component, and the second network application is loaded in the second network view component.
[0050] In one possible implementation, the jump module is specifically used for:
[0051] If the jump type is the first jump type, determine whether the second target display state is consistent with the first target display state corresponding to the first network application;
[0052] If the second target display state is inconsistent with the first target display state corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0053] Based on the identifier of the second network application, the native application's program jump function is called through the bridge object injected in the first network view component to unload the first network application and load the second network application in the first network view component.
[0054] Thirdly, embodiments of this application provide an electronic device, including:
[0055] The processor, and the memory that is in communication with the processor;
[0056] Memory is used to store instructions that the computer executes;
[0057] The processor is used to execute computer execution instructions stored in memory to implement the method of the first aspect.
[0058] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method of the first aspect.
[0059] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, is used to implement the method of the first aspect.
[0060] This application provides a method, apparatus, device, medium, and product for displaying a web application. In this method, an electronic device can run a first web application and, through a bridging object injected into a first web view component, call the display state function of the native application to obtain the display state corresponding to the first web view component; wherein, the first web view component is a web view component carrying the first web application. The electronic device can run the first web application, and if it determines that the display state is inconsistent with a first target display state corresponding to the first web application, it can, through the bridging object injected into the first web view component, call the switching function of the native application to switch the display state corresponding to the first web view component; wherein, the first web view component is used to display the display interface of the first web application based on the display state corresponding to the first web view component. Through the above method, the first web application can autonomously set the display state of the first web view component carrying the first web application, thereby improving the display accuracy of the web application. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 This is a schematic diagram illustrating an application scenario applicable to an embodiment of this application;
[0063] Figure 2 A flowchart illustrating a method for demonstrating a network application provided in this application;
[0064] Figure 3 A flowchart illustrating a second embodiment of a method for demonstrating a network application provided in this application;
[0065] Figure 4 A flowchart illustrating a third embodiment of a method for demonstrating a network application provided in this application;
[0066] Figure 5 A schematic diagram of the structure of a display device for a web application provided in an embodiment of this application;
[0067] Figure 6 This is a structural diagram of an electronic device provided in this application. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments made by those skilled in the art under the guidance of these embodiments are within the scope of protection of this application.
[0069] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0070] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0071] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0072] First, let me explain the terms used in this application:
[0073] Hybrid applications combine native and web technologies. Essentially, they use a web view component as a container within a native application to host the web application, allowing it to be installed and run on electronic devices just like a native application. Hybrid applications offer advantages such as cross-platform compatibility, faster development speed, and ease of updates.
[0074] WebView is a control in native applications used to embed and render web applications within native applications.
[0075] Status bar: The top of the visible area of an electronic device, which usually displays system information such as battery level, signal strength, time, and notifications.
[0076] Navigation bar: The area below the status bar, which usually displays the back button, page title, close page button, etc.
[0077] A hybrid application includes a native application and multiple web applications. The web view component within the native application can load and run the web applications to display their corresponding interfaces. The display state of the web view component when showcasing the application's interface is specified by the native application.
[0078] In related technologies, native applications can listen to the loading requests of network applications and determine the display state of the network view component when displaying the application's interface, and whether it is in full-screen display state, based on whether the network application's identifier is in the full-screen display list.
[0079] However, the methods in related technologies rely on manually compiled full-screen display lists, which leads to low accuracy.
[0080] Based on the above-mentioned technical problems, this application provides a method for displaying a network application, which enables a first network application to independently set the display state of a first network view component carrying the first network application, thereby improving the display accuracy of the network application.
[0081] To facilitate understanding, the following will be combined with... Figure 1 The examples illustrate the application scenarios applicable to the embodiments of this application.
[0082] For example, Figure 1 This is a schematic diagram illustrating an application scenario to which this application's embodiments apply. For example... Figure 1 As shown, in this application scenario, the electronic device 10 includes a first network application. It should be noted that, in one implementation, the code for the first network application can be downloaded by the electronic device 10 from the server 20 in response to a user's loading request.
[0083] The electronic device 10 can run a first network application and, through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component; wherein, the first network view component is a network view component that carries the first network application.
[0084] The electronic device 10 can run a first network application. When it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the device calls the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component. The first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component.
[0085] The embodiments in this application do not... Figure 1 The document does not limit the actual form of the equipment included, nor does it specify the type of equipment. Figure 1 The interaction methods between devices are limited, and can be set according to actual needs when applying the solution.
[0086] The technical solution of this application will now be described in detail 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 again in some embodiments.
[0087] Figure 2 This is a flowchart illustrating a method for demonstrating a web application, as provided in an embodiment of this application. See also... Figure 2 The method specifically includes the following steps:
[0088] S201: Run the first network application, and through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component.
[0089] In this embodiment, the first network view component is a network view component that carries the first network application. That is, the first network application is loaded in the first network view component.
[0090] The first network view component is an instance of the network view component. Since the network view component contains a bridge object injected by the native application, the first network view component also contains a bridge object injected by the native application.
[0091] For example, the bridge object injected by the native application into the first network view component may include the following bridge objects:
[0092] The bridge object corresponding to the fullscreen opening function (openFullScreen); the fullscreen opening function is used to switch the display state of the first network view component to fullscreen display state;
[0093] The bridge object corresponding to the fullscreen close function (closeFullScreen); the fullscreen close function is used to switch the display state of the first network view component to a non-fullscreen display state;
[0094] The bridge object corresponding to the display status function (getFullScreenStatus); where the display status function is used to obtain the display status (current display status) of the first network view component.
[0095] The bridge object corresponding to the status bar height function (getStatusBarHeight); the status bar height function is used to obtain the status bar height of the electronic device.
[0096] Create the bridge object corresponding to the function (openWebView); the function is used to create a web view component.
[0097] In another implementation, the bridge object injected by the native application into the first network view component may also include a bridge object corresponding to the program jump function; wherein the program jump function is used to jump to the network application.
[0098] The electronic device can run a first network application, and through the bridge object injected in the first network view component (the bridge object corresponding to the display state function), call the display state function of the native application to obtain the display state corresponding to the first network view component.
[0099] It should be noted that, in one implementation, the electronic device can run a native application, and in response to a call from the first network application, if it determines that the display state corresponding to the first network view component is a full-screen display state, it can return 0 to the first network application; the electronic device can run a native application, and in response to a call from the first network application, if it determines that the display state corresponding to the first network view component is a non-full-screen display state, it can return 1 to the first network application; the electronic device can run a native application, and in response to a call from the first network application, if the display state function does not exist, it can return 2 to the first network application.
[0100] S202: Run the first network application. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, call the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0101] In this embodiment, the electronic device can run a first network application to determine whether the display state is consistent with the first target display state corresponding to the first network application.
[0102] The electronic device can run a first network application. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the device can call the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0103] It should be noted that the first network view component is used to display the interface of the first network application based on the display state corresponding to the first network view component.
[0104] Additionally, it should be noted that when the display state of the first network view component is consistent with the display state of the first target corresponding to the first network application, the first network view component can directly display the display interface of the first network application based on the display state of the first network view component.
[0105] The following describes the process by which an electronic device, running a first network application, calls the switching function of the native application through a bridge object injected in the first network view component to switch the display state corresponding to the first network view component when the display state is determined to be inconsistent with the first target display state corresponding to the first network application.
[0106] In one implementation:
[0107] The electronic device can run a first network application. If it determines that the displayed state is inconsistent with the first target displayed state corresponding to the first network application, it determines a target function based on the first target displayed state. The electronic device can also run the first network application and, through a bridge object injected into the first network view component, call the target function of the native application to switch the displayed state corresponding to the first network view component.
[0108] The objective function is either the full-screen on function in the switching function, or the full-screen off function in the switching function.
[0109] In one implementation, the electronic device can run a first network application. If the displayed state is inconsistent with the first target displayed state corresponding to the first network application, and the first target displayed state is a full-screen displayed state, then the target function is determined to be a full-screen activation function. The electronic device can run the first network application and, through a bridge object injected into the first network view component (the bridge object corresponding to the full-screen activation function), call the full-screen activation function of the native application to switch the displayed state corresponding to the first network view component, thereby switching the displayed state of the first network view component from a non-full-screen displayed state to a full-screen displayed state.
[0110] In one implementation, the electronic device can run a first network application. If the displayed state is inconsistent with the first target displayed state corresponding to the first network application, and the first target displayed state is a non-fullscreen displayed state, then the target function is determined to be a fullscreen shutdown function. The electronic device can run the first network application and, through a bridge object injected into the first network view component (the bridge object corresponding to the fullscreen shutdown function), call the fullscreen shutdown function of the native application to switch the displayed state corresponding to the first network view component, thereby switching the displayed state of the first network view component from a fullscreen displayed state to a non-fullscreen displayed state.
[0111] The beneficial effects of this embodiment are as follows: In this embodiment, the electronic device can run a first network application and, through a bridge object injected into the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component; wherein, the first network view component is a network view component carrying the first network application. The electronic device can run the first network application, and if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, it can, through the bridge object injected into the first network view component, call the switching function of the native application to switch the display state corresponding to the first network view component; wherein, the first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component. Through the above method, the first network application can autonomously set the display state of the first network view component carrying the first network application, thereby improving the display accuracy of the network application.
[0112] Figure 3 This is a flowchart illustrating a second embodiment of a method for demonstrating a web application provided in this application. See also... Figure 3 The method specifically includes the following steps:
[0113] S301: Run the first network application, and through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component.
[0114] In this embodiment, the electronic device can run a first network application and, through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component.
[0115] The first network view component is a network view component that carries the first network application.
[0116] The specific implementation process is the same as that of S201, and will not be described in detail here.
[0117] S302: Run the first network application. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, call the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0118] In this embodiment, the electronic device can run a first network application. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the device can call the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0119] The specific implementation process is the same as that of S202, and will not be described in detail here.
[0120] S303: Run the first network application. If the first target display state is determined to be full-screen display state, call the status bar height function of the native application through the bridge object injected in the first network view component to obtain the status bar height of the electronic device.
[0121] In this embodiment, the electronic device can run a first network application. When it is determined that the first target display state is a full-screen display state, the status bar height is obtained by calling the status bar height function of the native application through the bridge object injected in the first network view component (the bridge object corresponding to the status bar height function).
[0122] S304: Run the first web application and update the top inner margin information of the navigation bar of the first web application according to the status bar height.
[0123] In this embodiment, the electronic device can run a first network application and update the top inner margin information of the navigation bar of the first network application according to the status bar height.
[0124] The navigation bar of the first network application is part of the display interface of the first network application.
[0125] It should be noted that the electronic device may execute S301 and S302 first, and then execute S303 and S304; the electronic device may execute S303 and S304 first, and then execute S301 and S302; the electronic device may execute S303 and S304 simultaneously with S301 and S302. This application embodiment does not impose any limitations on these aspects.
[0126] Additionally, it should be noted that the first network view component is the network view component that carries the first network application. The first network view component is used to display the interface of the first network application based on its corresponding display state and top inner margin information.
[0127] The beneficial effects of this embodiment are as follows: In this embodiment, the electronic device can run a first network application and, through a bridge object injected into the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component; wherein, the first network view component is a network view component carrying the first network application. The electronic device can run the first network application, and if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, it can call the switching function of the native application through the bridge object injected into the first network view component to switch the display state corresponding to the first network view component. The electronic device can run the first network application, and if it is determined that the first target display state is a full-screen display state, it can call the status bar height function of the native application through the bridge object injected into the first network view component to obtain the status bar height corresponding to the electronic device. The electronic device can run the first network application and, based on the status bar height, update the top inner margin information corresponding to the navigation bar of the first network application; wherein, the navigation bar of the first network application belongs to the display interface of the first network application. The first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component. Through the above methods, on the one hand, the first network application can autonomously set the display state of the first network view component carrying the first network application, thereby improving the display accuracy of the network application. On the other hand, when the first target display state corresponding to the first network application is a full-screen display state, the navigation bar of the first network application can be accurately displayed, thereby improving the display accuracy of the network application's display interface.
[0128] Figure 4 This is a flowchart illustrating a third embodiment of a method for demonstrating a web application, as provided in this application. See also... Figure 4 The method specifically includes the following steps:
[0129] S401: Run the first network application, and through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component.
[0130] In this embodiment, the electronic device can run a first network application and, through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component.
[0131] The first network view component is a network view component that carries the first network application.
[0132] The specific implementation process is the same as that of S201, and will not be described in detail here.
[0133] S402: Run the first network application. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, call the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0134] In this embodiment, the electronic device can run a first network application. If it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the device can call the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0135] The first network view component is used to display the interface of the first network application based on the display state corresponding to the first network view component.
[0136] The specific implementation process is the same as that of S202, and will not be described in detail here.
[0137] S403: Run the first network application and obtain the redirect request.
[0138] In this embodiment, the electronic device can run a first network application to obtain a redirect request. The redirect request includes an identifier of a second network application and the display state of a second target corresponding to the second network application.
[0139] S404: Run the first network application and determine the jump type corresponding to the second network application.
[0140] In this embodiment, the electronic device runs a first network application and determines the jump type corresponding to the second network application.
[0141] The jump type can be either the first jump type or the second jump type.
[0142] It should be noted that the first type of jump is a jump within the same network view component; that is, the network view component carrying the first network application and the network view component carrying the second network application are the same network view component.
[0143] The second type of jump is the type of jump between different network view components; that is, the network view component carrying the first network application and the view component carrying the second network application are different network view components.
[0144] S405: Run the first network application, and jump from the first network application to the second network application according to the jump type, the identifier of the second network application, and the display status of the second target.
[0145] In this embodiment, the electronic device can run a first network application and jump from the first network application to the second network application according to the jump type, the identifier of the second network application, and the display status of the second target.
[0146] In one implementation:
[0147] The electronic device can run a first network application and, when the jump type is a second jump type, determine the indication information based on the second target display status.
[0148] The indication information is used to set the current display state of the second network view component. Understandably, the current display state of the second network view component is the same as the display state of the second target.
[0149] It should be noted that the second network view component is the network view component that carries the second network application.
[0150] The electronic device can run a first network application, and based on the instruction information and the identifier of the second network application, call the creation function of the native application through the bridge object (the bridge object corresponding to the creation function) injected in the first network view component to create a second network view component, and load the second network application in the second network view component.
[0151] In one implementation:
[0152] The electronic device can run a first web application. When the jump type is the first jump type, it determines whether the second target display state is consistent with the first target display state corresponding to the first web application. It should be noted that the first jump type refers to the jump type within the same web view component.
[0153] The electronic device can run a first network application. When the second target display state is inconsistent with the first target display state corresponding to the first network application, the device calls the switching function of the native application through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0154] The electronic device can run a first network application. Based on the identifier of the second network application, it calls the program jump function of the native application through the bridge object (the bridge object corresponding to the program jump function) injected in the first network view component, and unloads the first network application and loads the second network application in the first network view component.
[0155] In one implementation:
[0156] The electronic device can run a first network application. When the jump type is the first jump type, based on the identifier of the second network application, the program jump function of the native application is called through the bridge object (the bridge object corresponding to the program jump function) injected in the first network view component. The first network application is then unloaded and the second network application is loaded in the first network view component.
[0157] The electronic device can run a second network application. Through a bridge object injected into the first network view component, it can call the display state function of the native application to obtain the display state corresponding to the first network view component. The electronic device can also run the first network application. If it determines that the display state is inconsistent with the first target display state corresponding to the first network application, it can call the switching function of the native application through the bridge object injected into the first network view component to switch the display state corresponding to the first network view component.
[0158] The beneficial effects of this embodiment are as follows: In this embodiment, the electronic device can run a first network application and obtain a jump request; the jump request includes the identifier of a second network application and the second target display state corresponding to the second network application. The electronic device can run the first network application and determine the jump type corresponding to the second network application; wherein, the jump type is either a first jump type or a second jump type; the first jump type is a jump type within the same network view component, and the second jump type is a jump type between different network view components. The electronic device can run the first network application and jump from the first network application to the second network application according to the jump type, the identifier of the second network application, and the second target display state. Through the above method, accurate jumps of network applications can be achieved, enabling the network view component used to carry the second network application to correctly display the display interface of the second network application. In other words, through the above method, the display accuracy of network applications is improved.
[0159] Figure 5 This is a schematic diagram of the structure of a display device for a web application provided in an embodiment of this application. Figure 5 As shown, the display device 50 for the web application includes: a status acquisition module 51, a status switching module 52, a navigation bar setting module 53, and a jump module 54.
[0160] The state acquisition module 51 is used to obtain the display state corresponding to the first network view component by calling the display state function of the native application through the bridge object injected in the first network view component; wherein, the first network view component is the network view component that carries the first network application;
[0161] The state switching module 52 is used to switch the display state corresponding to the first network view component by calling the switching function of the native application through the bridge object injected in the first network view component when it is determined that the display state is inconsistent with the first target display state corresponding to the first network application; wherein, the first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component.
[0162] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0163] In one possible implementation, the state transition module 52 is specifically used for:
[0164] If the display state is determined to be inconsistent with the first target display state corresponding to the first network application, a target function is determined based on the first target display state; wherein, the target function is the full-screen on function in the switching function, or the target function is the full-screen off function in the switching function;
[0165] By injecting a bridge object into the first network view component, the target function of the native application is called to switch the display state corresponding to the first network view component.
[0166] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0167] In one possible implementation, the state transition module 52 is specifically used for:
[0168] If the display state is inconsistent with the first target display state corresponding to the first network application, and the first target display state is a full-screen display state, then the target function is determined to be a full-screen enable function.
[0169] or,
[0170] If the display state is inconsistent with the first target display state corresponding to the first network application, and the first target display state is a non-full-screen display state, then the target function is determined to be the full-screen closing function.
[0171] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0172] In one possible implementation, the navigation bar settings module 53 is used for:
[0173] If the first target display state is determined to be full-screen display state, the status bar height of the electronic device is obtained by calling the status bar height function of the native application through the bridge object injected in the first network view component.
[0174] Update the top inner margin information of the navigation bar of the first network application based on the status bar height; the navigation bar of the first network application is part of the display interface of the first network application.
[0175] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0176] In one possible implementation, the jump module 54 is used for:
[0177] Obtain the redirect request; the redirect request includes the identifier of the second network application and the display status of the second target corresponding to the second network application;
[0178] Determine the jump type corresponding to the second network application; wherein the jump type is either a first jump type or a second jump type; the first jump type is the type of jump within the same network view component, and the second jump type is the type of jump between different network view components;
[0179] Based on the jump type, the identifier of the second network application, and the display status of the second target, the user is redirected from the first network application to the second network application.
[0180] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0181] In one possible implementation, jump module 54 is specifically used for:
[0182] When the jump type is the second jump type, the indication information is determined according to the second target display state; wherein, the indication information is used to set the current display state of the second network view component; the second network view component is a network view component that carries the second network application;
[0183] Based on the instruction information and the identifier of the second network application, the creation function of the native application is called through the bridge object injected in the first network view component to create the second network view component, and the second network application is loaded in the second network view component.
[0184] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0185] In one possible implementation, jump module 54 is specifically used for:
[0186] If the jump type is the first jump type, determine whether the second target display state is consistent with the first target display state corresponding to the first network application;
[0187] If the second target display state is inconsistent with the first target display state corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component.
[0188] Based on the identifier of the second network application, the native application's program jump function is called through the bridge object injected in the first network view component to unload the first network application and load the second network application in the first network view component.
[0189] The network application display device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0190] Figure 6 This is a structural diagram of an electronic device provided in this application. Figure 6 As shown, the electronic device 60 includes a processor 61 and a memory 62. The processor 61 is communicatively connected to the memory 62, which stores computer execution instructions. The processor 61 is configured to execute the technical solutions in any of the foregoing method embodiments by executing the computer execution instructions stored in the memory 62.
[0191] Optionally, the memory 62 can be either standalone or integrated with the processor 61. Optionally, when the memory 62 is a device independent of the processor 61, the electronic device 60 may further include a bus 63 for connecting the aforementioned devices.
[0192] The electronic device is used to execute the technical solutions in any of the foregoing method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0193] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the technical solutions provided in any of the foregoing method embodiments.
[0194] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solutions provided in the foregoing method embodiments.
[0195] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0196] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for displaying a web application, characterized in that, Applied to electronic devices, the method includes: Run the first network application, and through the bridge object injected in the first network view component, call the display state function of the native application to obtain the display state corresponding to the first network view component; wherein, the first network view component is the network view component that carries the first network application; When the first network application is run, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component; wherein, the first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component.
2. The method according to claim 1, characterized in that, Running the first network application, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, the native application's switching function is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component, including: Running the first network application, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, a target function is determined according to the first target display state; wherein, the target function is the full-screen on function in the switching function, or the target function is the full-screen off function in the switching function; Run the first network application, and through the bridge object injected in the first network view component, call the target function of the native application to switch the display state corresponding to the first network view component.
3. The method according to claim 2, characterized in that, When running the first network application, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, a target function is determined based on the first target display state, including: Running the first network application, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, and if the first target display state is a full-screen display state, then the target function is determined to be the full-screen enabling function; or, When the first network application is run, if it is determined that the display state is inconsistent with the first target display state corresponding to the first network application, and if the first target display state is a non-full-screen display state, then the target function is determined to be the full-screen closing function.
4. The method according to any one of claims 1-3, characterized in that, The method includes: When the first network application is run and the first target display state is determined to be the full-screen display state, the status bar height of the electronic device is obtained by calling the status bar height function of the native application through the bridge object injected in the first network view component. Run the first web application and update the top inner margin information of the navigation bar of the first web application according to the status bar height; wherein the navigation bar of the first web application belongs to the display interface of the first web application.
5. The method according to claim 1, characterized in that, The method further includes: Run the first network application and obtain a redirect request; the redirect request includes the identifier of the second network application and the second target display status corresponding to the second network application; Run the first network application and determine the jump type corresponding to the second network application; wherein, the jump type is a first jump type or a second jump type; the first jump type is a jump type within the same network view component, and the second jump type is a jump type between different network view components; The first network application is run, and the user is redirected to the second network application based on the jump type, the identifier of the second network application, and the display status of the second target.
6. The method according to claim 5, characterized in that, The step of running the first network application and, based on the jump type, the identifier of the second network application, and the display status of the second target, jumping from the first network application to the second network application includes: When the first network application is run, and the jump type is the second jump type, the indication information is determined according to the second target display state; wherein, the indication information is used to set the current display state of the second network view component; the second network view component is a network view component that carries the second network application; Run the first network application, and based on the instruction information and the identifier of the second network application, call the creation function of the native application through the bridge object injected in the first network view component to create the second network view component, and load the second network application in the second network view component.
7. The method according to claim 5, characterized in that, The step of running the first network application and, based on the jump type, the identifier of the second network application, and the display status of the second target, jumping from the first network application to the second network application includes: Run the first network application, and if the jump type is the first jump type, determine whether the second target display state is consistent with the first target display state corresponding to the first network application; When the first network application is running, if the second target display state is inconsistent with the first target display state corresponding to the first network application, the switching function of the native application is called through the bridge object injected in the first network view component to switch the display state corresponding to the first network view component. Run the first network application, and based on the identifier of the second network application, call the program jump function of the native application through the bridge object injected in the first network view component to unload the first network application and load the second network application in the first network view component.
8. A display device for a web application, characterized in that, include: The state acquisition module is used to obtain the display state corresponding to the first network view component by calling the display state function of the native application through the bridge object injected in the first network view component; wherein, the first network view component is the network view component that carries the first network application; The state switching module is used to switch the display state corresponding to the first network view component by calling the switching function of the native application through the bridge object injected in the first network view component when it is determined that the display state is inconsistent with the first target display state corresponding to the first network application; wherein, the first network view component is used to display the display interface of the first network application based on the display state corresponding to the first network view component.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory is used to store computer-executed instructions; The processor is configured to execute computer execution instructions stored in the memory to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method of any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, is used to implement the method of any one of claims 1-7.