Toolbar display method, device, computer equipment and storage medium in page
Through the collaborative work of the web page rendering component and the native rendering component, the display trigger event of the virtual input tool is monitored and the toolbar status information is output, which solves the problem of positioning flicker and jitter of the toolbar in the multi-input box scenario in traditional technology, and realizes the tool Stable display of columns and improvement of user interaction experience.
Patent Information
- Application Number
- CN202410653332.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-24
AI Technical Summary
In traditional mobile applications with multiple input boxes, the lifting and lowering movements of the virtual keyboard and the movement of the system WebView cause the toolbar positioning to flicker and jitter abnormally, making it impossible to display stably.
The web page rendering component and the native rendering component work together to bind the toolbar display event and the display trigger event of the virtual input tool, monitor the display trigger event, and output the toolbar status information when the input area is focused, triggering the toolbar display command, so that The native rendering component renders the toolbar according to the state information.
It achieves stable display of toolbars, avoids positioning drift and jitter, and improves user interaction experience.
Smart Images

Figure CN118227250B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, storage medium and computer program product for displaying a toolbar in a page. Background Art
[0002] With the development of computer technology, more and more applications have emerged, and many businesses can be conveniently conducted online through applications. Therefore, the interactive experience between users and applications has become increasingly important.
[0003] In traditional technology, the main rendering area of a mobile application usually uses Web technology (web page technology) to achieve overall rendering and interaction. When an input box is displayed on the page of a mobile application, the mobile virtual keyboard will be evoked when the input area is focused for input interaction. In order to improve user input efficiency and experience, a web page rendering component will be used to draw an auxiliary input toolbar that is fixed above the virtual keyboard through absolute positioning. Users can achieve specific interaction effects by clicking buttons on the toolbar.
[0004] However, with traditional methods, mobile applications are usually multi-input box applications, and there will be multiple input elements in the application page. When the input box obtains and switches focus, the virtual keyboard's own lifting and lowering actions plus the system's native overall WebView (web page view) movement actions will cause the toolbar to flicker and jitter abnormally when in use, resulting in the toolbar being unable to display stably. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for displaying a toolbar in a page that can stably display a toolbar in order to solve the above technical problems.
[0006] In a first aspect, the present application provides a method for displaying a toolbar in a page. The method comprises:
[0007] When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and monitoring of the display trigger event is added;
[0008] In response to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display triggering event to the webpage rendering component;
[0009] By the webpage rendering component, upon receiving the generation prompt of the display triggering event and in the case that the input area is configured with a toolbar, first toolbar state information is obtained, the first toolbar state information is output to the native rendering component, and the toolbar display event is triggered, and a toolbar display instruction is output to the native rendering component;
[0010] The native rendering component responds to the toolbar display instruction and renders and displays the toolbar of the input area according to the first toolbar state information.
[0011] In a second aspect, the present application also provides a device for displaying a toolbar in a page. The device comprises:
[0012] An event adding module, which is used to bind the toolbar display event with the display trigger event of the virtual input tool through the web page rendering component when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, and add monitoring of the display trigger event;
[0013] A focus response module, for responding to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display trigger event to the web page rendering component;
[0014] A toolbar display control module, configured to obtain, through the web page rendering component, first toolbar state information when receiving a prompt for the display trigger event and the input area is configured with a toolbar, output the first toolbar state information to the native rendering component, trigger the toolbar display event, and output a toolbar display instruction to the native rendering component;
[0015] The toolbar display module is used to render and display the toolbar of the input area according to the first toolbar state information in response to the toolbar display instruction through the native rendering component.
[0016] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0017] When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and monitoring of the display trigger event is added;
[0018] In response to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display triggering event to the webpage rendering component;
[0019] By the webpage rendering component, upon receiving the generation prompt of the display triggering event and in the case that the input area is configured with a toolbar, first toolbar state information is obtained, the first toolbar state information is output to the native rendering component, and the toolbar display event is triggered, and a toolbar display instruction is output to the native rendering component;
[0020] The native rendering component responds to the toolbar display instruction and renders and displays the toolbar of the input area according to the first toolbar state information.
[0021] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0022] When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and monitoring of the display trigger event is added;
[0023] In response to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display triggering event to the webpage rendering component;
[0024] By the webpage rendering component, upon receiving the generation prompt of the display triggering event and in the case that the input area is configured with a toolbar, first toolbar state information is obtained, the first toolbar state information is output to the native rendering component, and the toolbar display event is triggered, and a toolbar display instruction is output to the native rendering component;
[0025] The native rendering component responds to the toolbar display instruction and renders and displays the toolbar of the input area according to the first toolbar state information.
[0026] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0027] When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and monitoring of the display trigger event is added;
[0028] In response to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display triggering event to the webpage rendering component;
[0029] By the webpage rendering component, upon receiving the generation prompt of the display triggering event and in the case that the input area is configured with a toolbar, first toolbar state information is obtained, the first toolbar state information is output to the native rendering component, and the toolbar display event is triggered, and a toolbar display instruction is output to the native rendering component;
[0030] The native rendering component responds to the toolbar display instruction and renders and displays the toolbar of the input area according to the first toolbar state information.
[0031] The toolbar display method, apparatus, computer device, storage medium and computer program product in the above-mentioned page, when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and the monitoring of the display trigger event is added, and the toolbar display event can be triggered by monitoring the display trigger event of the virtual input tool. When a focus event is generated for the input area, the interaction is achieved by displaying the virtual input tool, and the web page rendering component is informed that the display trigger event has occurred, so that the web page rendering component can know that the display trigger event has occurred, and then, when the input area is configured with a toolbar, the first toolbar status information is obtained, the first toolbar status information is output to the native rendering component, and the toolbar display event is triggered, and the toolbar display instruction is output to the native rendering component, so that the native rendering component can render and display the toolbar of the input area according to the first toolbar status information in response to the toolbar display instruction. During the entire process, the logic of displaying the toolbar is controlled by the web rendering component, and the toolbar is rendered by the native rendering component. The display and rendering logic of the toolbar can be separated, so that the web rendering component controls the logic of displaying the toolbar, and controls the native rendering component to render and display the toolbar in the process of rendering and displaying the virtual input tool, thereby achieving stable display of the toolbar. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] FIG1 is a diagram showing an application environment of a method for displaying a toolbar in a page according to an embodiment;
[0033] FIG2 is a schematic diagram of a flowchart of a method for displaying a toolbar in a page in one embodiment;
[0034] FIG3 is a schematic diagram of a virtual input tool in one embodiment;
[0035] FIG4 is a schematic diagram of an input area in one embodiment;
[0036] FIG5 is a schematic diagram of a visual indicator in one embodiment;
[0037] FIG6 is a schematic diagram of the layout of a virtual input tool and a toolbar in one embodiment;
[0038] FIG7 is a schematic diagram of a toolbar in an input area in one embodiment;
[0039] FIG8 is a schematic diagram of a toolbar in an input area in another embodiment;
[0040] FIG9 is a schematic diagram of a design of an interface for setting buttons in a toolbar in one embodiment;
[0041] FIG10 is a schematic diagram of a design of a first toolbar status update interface in an implementation;
[0042] FIG11 is a schematic diagram of a design of a toolbar display control interface in one embodiment;
[0043] FIG12 is a schematic diagram of detecting the operating environment of a native rendering component in an implementation;
[0044] FIG13 is a schematic diagram of a design of a toolbar button click interface in one embodiment;
[0045] FIG14 is a schematic diagram of a component uninstallation event in response to a page in one embodiment;
[0046] FIG15 is a logic diagram of implementing toolbar rendering through a web page rendering component in one embodiment;
[0047] FIG16 is a schematic diagram of toolbar positioning drift in one embodiment;
[0048] FIG17 is a schematic diagram of cursor drift in one embodiment;
[0049] FIG18 is a diagram of a toolbar component architecture in one embodiment;
[0050] FIG19 is a schematic diagram of a processing flow of a toolbar display method in one embodiment;
[0051] FIG20 is a structural block diagram of a toolbar display device in a page in one embodiment;
[0052] FIG. 21 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] The toolbar display method in the page provided by the embodiment of the present application can be applied to the application environment shown in Figure 1. As shown in Figure 1, the terminal 102 includes a native rendering component 104 and a web page rendering component 106, wherein the native rendering component 104 can also be referred to as a rendering component based on client native technology, where the client refers to a client based on a mobile operating system, and the mobile operating system can specifically be an IOS system or an Android system. The web page rendering component 106 refers to a component that uses web page technology (such as HTML, CSS, and JavaScript) to render content. These components are embedded in native applications through controls such as WebView (core view class). When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component 106, and monitoring of the display trigger event is added. In response to the focus event on the input area triggered on the page, the virtual input tool is rendered and displayed through the native rendering component 104, and the display trigger event generation prompt is pushed to the web page rendering component 106. Through the web page rendering component 106, when the display trigger event generation prompt is received and the input area is configured with a toolbar, the first toolbar status information is obtained, the first toolbar status information is output to the native rendering component 104, and the toolbar display event is triggered, and the toolbar display instruction is output to the native rendering component 104. Through the native rendering component 104, in response to the toolbar display instruction, the toolbar of the input area is rendered and displayed according to the first toolbar status information.
[0055] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc.
[0056] In one embodiment, as shown in FIG2 , a method for displaying a toolbar in a page is provided, which can be executed by a terminal or a server alone, or by a terminal and a server in collaboration. In the embodiment of the present application, the method is applied to a terminal as an example for explanation, and includes the following steps:
[0057] Step 202, when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and monitoring of the display trigger event is added.
[0058] In an application, a page refers to a specific screen or view through which a user interacts with the application. It usually contains user interface elements, data, and functions, allowing a user to perform a specific task or access specific information. For example, the page in this embodiment may specifically be an online document editing page displayed in the application. For example, the online document may specifically be a collection table, and the page in this embodiment may be a collection table editing page displayed in the application.
[0059] Among them, the mounted component of the page means that the component of the page has been successfully added to the DOM (Document Object Model) and can interact with the user. In this embodiment, the component of the page refers to a component based on web page technology, that is, a web page rendering component. For example, the component of the page can specifically refer to a React component, then the mounted component of the page means that the React component has been successfully added to the DOM and can interact with the user. React components are reusable code blocks for building user interfaces. In this embodiment, they are reusable code blocks for building pages.
[0060] Among them, the native rendering component can also be called a rendering component based on client native technology. The client here refers to a client based on a mobile operating system, and the mobile operating system can be specifically an IOS system or an Android system. The toolbar rendering condition refers to the condition for rendering the toolbar using the native rendering component. It can be understood that the toolbar rendered by the native rendering component is a native rendering toolbar, and correspondingly, the toolbar rendered by the web page rendering component is a browser rendering toolbar. The toolbar rendering condition can be configured according to the actual application scenario, and is not specifically limited here in this embodiment.
[0061] Among them, web rendering components refer to components that use web technologies (such as HTML, CSS, and JavaScript) to render content. These components are embedded in native applications through controls such as WebView (core view class). Toolbar refers to an input toolbar used to assist user interaction. The toolbar includes multiple buttons for assisting users to implement quick operations. For example, the buttons of the toolbar can specifically be buttons that assist users to switch input areas up and down. For another example, the buttons of the toolbar can specifically be buttons that assist users to configure the content of the input area. For example, the input area content configuration here can specifically be setting the title of the collection table, adding pictures, adding links, etc. For another example, the buttons of the toolbar can specifically be buttons that assist users to fold the virtual input tool. Toolbar display event refers to an event that indicates that the toolbar is displayed on the page.
[0062] Among them, the virtual input tool refers to an input method that can be created on the terminal through an application, which allows the user to input text and data without a physical keyboard or other input device. For example, the virtual input tool can be specifically a virtual keyboard, a voice recognition tool, a handwriting input tool, etc. Among them, the virtual keyboard refers to a keyboard displayed on the screen of the terminal, and the user can use a finger or a stylus for input. The voice recognition tool refers to a tool that converts speech into text, allowing the user to input text by speaking. The handwriting input tool refers to a tool that allows the user to write or draw on the screen to input text or symbols. For example, the virtual input tool can be specifically a virtual keyboard as shown in Figure 3. The display trigger event of the virtual input tool refers to an event in which the display of the virtual input tool is triggered, indicating that the virtual input tool will start to display. For example, the display trigger event of the virtual input tool can be specifically a virtual input tool rising event, that is, an event in which the virtual input tool is displayed from hidden.
[0063] Specifically, the components of the page have been mounted, indicating that the components of the page have been successfully added to the DOM, and the page will be displayed in the terminal application. When the components of the page have been mounted, the web page rendering component of the terminal will detect whether the native rendering component meets the toolbar rendering conditions. When the native rendering component meets the toolbar rendering conditions, it means that the native rendering component can be used to render the toolbar. The web page rendering component will bind the toolbar display event with the display trigger event of the virtual input tool, and add monitoring of the display trigger event, so that when the display trigger event of the virtual input tool is detected, the toolbar display event is triggered to instruct the native rendering component to render and display the toolbar.
[0064] Step 204 , in response to a focus event on the input area triggered on the page, a virtual input tool is rendered and displayed by a native rendering component, and a prompt of the generation of the display triggering event is pushed to the web page rendering component.
[0065] The input area refers to an area on the page where text, data or other information can be input. For example, the input area can specifically refer to an input box on the page where text, data or other information can be input. For example, when the page is a collection form editing page, the input area can specifically refer to an area on the collection form editing page where a title description can be input.
[0066] Among them, the focus event for the input area refers to an event triggered when the input area gets the focus. When the user clicks or moves the focus to the input area in other ways, the focus event is triggered, which usually means that the user can now start to enter data. For example, as shown in Figure 4, when the page is a collection form editing page, the input area can specifically refer to the area in the collection form editing page where the description of the question can be entered (i.e., the area for entering the question) (as shown in Figure 4, it includes 01 Please enter the question area, 02 Please enter the question area, 03 Please enter the question area, and 04 Please enter the question area), or it can be the area for entering the description in the collection form editing page (as shown in Figure 4, please enter the description, where you can add pictures and links). In addition, as shown in Figure 4, the collection form editing page also includes question setting areas such as whether it is a required question. When the user moves the focus to any input area, the focus event is triggered. The input area that gets the focus usually has a visible visual indicator (as shown in Figure 5, it is a cursor, that is, a vertical line in the input area indicating the user input position). When the input area gets the focus, the focus event for the input area is triggered.
[0067] Specifically, when a focus event on an input area triggered on a page is detected, the terminal will respond to the focus event by rendering and displaying a virtual input tool through a native rendering component, so that the user can interact through the virtual input tool, input text and data, etc., and push a prompt of the generation of the display trigger event to the web page rendering component to inform the web page rendering component that the display trigger event has been triggered.
[0068] Step 206, through the web page rendering component, when a prompt for the generation of a display trigger event is received and the input area is configured with a toolbar, the first toolbar status information is obtained, the first toolbar status information is output to the native rendering component, and the toolbar display event is triggered, and the toolbar display instruction is output to the native rendering component.
[0069] The first toolbar state information refers to data used to define and configure the appearance and behavior of the toolbar, and generally includes layout and design information, function and behavior information, etc. The layout and design information includes the position and size of the toolbar, the arrangement of buttons in the toolbar, and the color scheme and style of the toolbar. The function and behavior information includes the function and purpose of each button, the arrangement order of buttons, etc. The toolbar display instruction refers to an instruction that instructs the native rendering component to render and display the native rendering toolbar.
[0070] Specifically, when the toolbar display event is bound to the display trigger event of the virtual input tool and the monitoring of the display trigger event is added, the web page rendering component triggers the toolbar display event by monitoring the display trigger event of the virtual input tool. Receiving the prompt for the generation of the display trigger event is equivalent to monitoring the display trigger event of the virtual input tool. Therefore, after receiving the prompt for the generation of the display trigger event, the web page rendering component will first determine whether the input area is configured with a toolbar. If the input area is configured with a toolbar, it will obtain the first toolbar status information, output the first toolbar status information to the native rendering component, trigger the toolbar display event, and output the toolbar display instruction to the native rendering component to instruct the native rendering component to render and display the native rendering toolbar.
[0071] It should be noted that since the virtual input tool is rendered and displayed through the native rendering component, as long as the native rendering component starts to render and display the virtual input tool, the native rendering component pushes the display trigger event prompt to the web rendering component, and the web rendering component can monitor the display trigger event of the virtual input tool.
[0072] Step 208: Render and display the toolbar of the input area according to the first toolbar state information in response to the toolbar display instruction through the native rendering component.
[0073] Specifically, when receiving a toolbar display instruction, the native rendering component responds to the toolbar display instruction, and renders and displays the toolbar of the input area according to the first toolbar status information. It should be noted that since the prompt for the display trigger event is pushed to the web page rendering component when the native rendering component starts to render and display the virtual input tool, when the input area is configured with a toolbar, the native rendering component will receive the toolbar display instruction output by the web page rendering component before the virtual input tool is fully displayed. Therefore, during actual display, the effect of synchronous display of the virtual input tool and the toolbar of the input area can be achieved. In a specific application, the page can be as shown in Figure 6, and the virtual input tool (specifically a virtual keyboard as shown in Figure 6) can be displayed at the bottom of the page, and the toolbar of the input area is displayed above the virtual input tool.
[0074] The toolbar display method in the above page, when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, binds the toolbar display event to the display trigger event of the virtual input tool through the web page rendering component, and adds monitoring of the display trigger event. It can use the display trigger event of the virtual input tool to monitor the trigger event to trigger the toolbar display event. When a focus event is generated for the input area, the interaction is achieved by displaying the virtual input tool, and the web page rendering component is informed that the display trigger event has occurred, so that the web page rendering component can know that the display trigger event has occurred, and then, when the input area is configured with a toolbar, obtain the first toolbar status information, output the first toolbar status information to the native rendering component, trigger the toolbar display event, and output the toolbar display instruction to the native rendering component, so that the native rendering component can render and display the toolbar of the input area according to the first toolbar status information in response to the toolbar display instruction. During the entire process, the logic of displaying the toolbar is controlled by the web rendering component, and the toolbar is rendered by the native rendering component. The display and rendering logic of the toolbar can be separated, so that the web rendering component controls the logic of displaying the toolbar, and controls the native rendering component to render and display the toolbar in the process of rendering and displaying the virtual input tool, thereby achieving stable display of the toolbar.
[0075] In one embodiment, the method for displaying a toolbar in a page further includes:
[0076] After receiving a prompt indicating that a display trigger event has been generated, the web page rendering component obtains an area identifier of the input area;
[0077] When the region identifier is present in the list of preconfigured focus region identifiers, it is determined that the input region is configured with a toolbar.
[0078] The area identifier of the input area refers to an identifier for identifying the input area. For example, the area identifier of the input area may be an identifier for identifying the input area. For example, the area identifier of the input area may be a character string for identifying the input area. The pre-configured focus area identifier list refers to a list of pre-configured area identifiers of input areas configured with toolbars, that is, only the input areas indicated by the area identifiers in the focus area identifier list are configured with toolbars.
[0079] Specifically, after receiving the prompt of the display trigger event, the web page rendering component will obtain the area identifier of the input area, and query the preconfigured focus area identifier list based on the area identifier of the input area to determine whether the area identifier exists in the focus area identifier list. When the area identifier exists in the focus area identifier list, it is determined that the input area indicated by the area identifier is configured with a toolbar. If the input area is configured with a toolbar, the first toolbar status information is obtained to output the first tool status information to the native rendering component, instructing the native rendering component to display the toolbar.
[0080] In a specific application, for each input area in a page in the application, if the input area is configured with a toolbar, the corresponding toolbar status information of the input area is pre-configured. Therefore, when it is determined that the input area is configured with a toolbar, the web page rendering component can directly obtain the toolbar status information pre-configured for the input area based on the area identifier of the input area, that is, the first toolbar status information.
[0081] In a specific application, the application status has an area identifier-status information table. The correspondence between the area identifier and the toolbar status information can be stored in the area identifier-status information table. The data in the area identifier-status information table can be in the form of area identifier 1-toolbar status information 1, area identifier 2-toolbar status information 2, area identifier 3-toolbar status information 3,...area identifier n-toolbar status information n.
[0082] It is understandable that the toolbar status information of different input areas may not be exactly the same. If the toolbar status information is different, the form of the displayed toolbar will be different. For example, if the input area is a title description input area, the form of the toolbar of the input area can be as shown in Figure 7, including buttons for switching input areas up and down (the button for switching the input area up is ∧, and the button for switching the input area down is ∨ as shown in Figure 7) and a button for retracting the virtual input tool (as shown in Figure 7, a virtual keyboard). Among them, the button for switching the input area up and down is used to realize the upward switching of the input area (as shown in Figure 7, the area where the title name is located) and the downward switching of the input area (as shown in Figure 7, the area where 01 is located), and the button for retracting the virtual input tool is used to realize the retracting of the virtual input tool. For another example, if the input area is a question description input area (as shown in Figure 8, the area where the cursor is located), the form of the toolbar of the input area can be as shown in Figure 8, including buttons for switching the input area up and down, buttons for configuring the question, and buttons for retracting the virtual input tool. Among them, the button for configuring the question is used to quickly configure the question description (i.e., the question).
[0083] In this embodiment, by obtaining the area identifier of the input area, the area identifier and the pre-configured focus area identifier list can be used to accurately determine whether the input area is configured with a toolbar, and then the first toolbar state information can be obtained for the next step of processing only when the input area is configured with a toolbar. The whole process can realize the controllable display of the toolbar of the input area.
[0084] In one embodiment, when a prompt for generating a display trigger event is received through a web page rendering component and a toolbar is configured in the input area, first toolbar state information is obtained, the first toolbar state information is output to a native rendering component, and a toolbar display event is triggered. Outputting a toolbar display instruction to the native rendering component includes:
[0085] When receiving a prompt indicating the generation of a display trigger event and the input area is configured with a toolbar, the web page rendering component obtains first toolbar state information, calls a first toolbar state update interface provided by the native rendering component, and outputs the first toolbar state information to the native rendering component;
[0086] Through the web rendering component, the toolbar display event is triggered, the toolbar display control interface provided by the native rendering component is called, and the toolbar display instruction is output to the native rendering component.
[0087] Among them, the first toolbar state update interface refers to the interface provided by the native rendering component for updating the toolbar state information, that is, the interface for updating the button state in the toolbar. By calling the first toolbar state update interface, the first toolbar state information can be output to the native rendering component. The toolbar display control interface refers to the interface provided by the native rendering component for controlling the display of the toolbar. By calling the toolbar display control interface, the toolbar display instructions can be output to the native rendering component. In addition, the native rendering component also provides an interface for setting the buttons in the toolbar. By calling the interface for setting the buttons in the toolbar, the buttons in the toolbar that can be rendered by the native rendering component can be configured.
[0088] Specifically, after receiving the prompt for the generation of a display trigger event, the web page rendering component will first determine whether the input area is configured with a toolbar. If the input area is configured with a toolbar, it will obtain the first toolbar status information, call the first toolbar status update interface provided by the native rendering component, and output the first toolbar status information to the native rendering component so that the native rendering component can update the button status in the toolbar. When the first toolbar status information is output to the native rendering component, the web page rendering component will trigger a toolbar display event, call the toolbar display control interface provided by the native rendering component, and output a toolbar display instruction to the native rendering component to indicate that the native rendering component can respond to the toolbar display instruction and render and display the toolbar according to the button status in the toolbar indicated by the first toolbar status information.
[0089] In a specific application, the native rendering component provides an interface for setting buttons in the toolbar, a first toolbar status update interface, and a toolbar display control interface. Among them, by calling the interface for setting buttons in the toolbar, the native rendering component can be instructed to set the buttons in the toolbar, by calling the first toolbar status update interface, the first toolbar status information can be output to the native rendering component to instruct the native rendering component to update the status of the buttons in the toolbar, and by calling the toolbar display control interface, the native rendering component can be instructed to display or hide the toolbar.
[0090] Among them, the status of the buttons in the toolbar includes an enabled state and a disabled state. The buttons in the toolbar in the enabled state can be displayed in the toolbar, and the buttons in the toolbar in the disabled state are not displayed in the toolbar. Further, the design of the interface for setting the buttons in the toolbar can be shown in Figure 9. By calling the interface, the function for setting the toolbar buttons can be used to set the left button, the middle button, and the right button (the xxx in [xxx] next to the left button, the middle button, and the right button in Figure 9 represent specific setting parameters respectively). The design of the first toolbar status update interface can be shown in Figure 10. By calling the interface, the function for setting the status of the buttons in the toolbar can be used to update the status of the left button, the middle button, and the right button (the xxx in [xxx] next to the left button, the middle button, and the right button in Figure 10 represent specific status parameters respectively).
[0091] Among them, the design of the toolbar display control interface can be shown in Figure 11. By calling this interface, the function of displaying or hiding the toolbar can be used to implement toolbar display control, that is, output toolbar display instructions or toolbar hiding instructions to the native rendering component. It can be understood that the difference between toolbar display instructions and toolbar hiding instructions lies in the different field values representing the display control field. For example, as shown in Figure 11, the output toolbar display instruction can be in the form of display control field (show in Figure 11): field value representing display of toolbar (true in Figure 11), then correspondingly, the output toolbar hiding instruction can be in the form of display control field (show in Figure 11): field value representing not displaying toolbar (false corresponding to true in Figure 11).
[0092] In this embodiment, by calling the first toolbar state update interface provided by the native rendering component, the first toolbar state information can be output to the native rendering component, and by calling the trigger toolbar display event and calling the toolbar display control interface provided by the native rendering component, the toolbar display instruction can be output to the native rendering component to instruct the native rendering component to render and display the toolbar. During the whole process, data can be transferred with the original rendering component through the interface provided by the native rendering component.
[0093] In one embodiment, the method for displaying a toolbar in a page further includes:
[0094] When the component of the page has been mounted, the component is rendered through the web page and the component mounted method is called;
[0095] Through the component mounted method, the toolbar creation interface is called to detect the operating environment of the native rendering component for toolbar rendering, and the operating environment detection result is obtained;
[0096] When the runtime environment detection result is that the runtime environment is ready, it is determined that the native rendering component meets the toolbar rendering conditions.
[0097] Among them, the component mounted method (also known as componentDidMount) is a lifecycle method in React, which is called immediately after the component is rendered into the DOM for the first time, that is, immediately after the component has been mounted into the DOM. The toolbar creation interface refers to the interface for creating a toolbar. The operating environment for toolbar rendering refers to the operating environment that the native rendering component needs to meet when the toolbar rendering is implemented using the native rendering component. It can be understood that the operating environment that the native rendering component needs to meet here specifically refers to the component version of the native rendering component meeting the toolbar rendering version requirements, the toolbar rendering function of the native rendering component is enabled, etc. The operating environment is ready means that the native rendering component can be used to implement toolbar rendering.
[0098] Specifically, when the component of the page has been mounted, the web page rendering component will immediately call the component mounted method, and through the component mounted method, call the toolbar creation interface, and through the toolbar creation interface, detect the operating environment of the native rendering component used for toolbar rendering to obtain the operating environment detection result. When the operating environment detection result is that the operating environment is ready, it is determined that the native rendering component can be used to implement toolbar rendering, that is, the native rendering component meets the toolbar rendering conditions.
[0099] In a specific application, the toolbar creation interface can detect the operating environment of the native rendering component for toolbar rendering by calling the detect existence method to obtain the operating environment detection result. As shown in Figure 12, during the page life cycle, when the component of the page has been mounted, the web page rendering component will immediately call the component mounted method, and call the toolbar creation interface through the component mounted method. The detect existence method is called through the toolbar creation interface, and the detect existence method is used to detect the operating environment of the native rendering component for toolbar rendering, and the operating environment detection result is returned. When the operating environment detection result is that the operating environment is ready, it can be determined that the native rendering component meets the toolbar rendering conditions.
[0100] Furthermore, as shown in Figure 12, when the native rendering component meets the toolbar rendering conditions, it will trigger the call of the event adding method, bind the toolbar display event with the display trigger event of the virtual input tool, and add monitoring of the display trigger event, and bind the toolbar hide event with the hide trigger event of the virtual input tool, and add monitoring of the hide trigger event, so as to determine whether the toolbar appears by monitoring the display trigger event and hide trigger event of the virtual input tool.
[0101] In this embodiment, when the component of the page has been mounted, the component mounted method is called through the web page rendering component, and the component mounted method can be used to call the toolbar creation interface, thereby realizing the detection of the operating environment of the native rendering component for toolbar rendering, and obtaining the operating environment detection result, so as to use the operating environment detection result to accurately judge whether the native rendering component meets the toolbar rendering conditions. When the operating environment detection result shows that the operating environment is ready, it is determined that the native rendering component meets the toolbar rendering conditions.
[0102] In one embodiment, the toolbar creation interface is called to detect the operating environment of the native rendering component for toolbar rendering, and the operating environment detection result obtained includes:
[0103] Call the toolbar creation interface, and if a native rendering component exists, obtain the component configuration information of the native rendering component; the component configuration information includes component version information and toolbar rendering configuration information;
[0104] When the component version information meets the toolbar rendering version requirement and the toolbar rendering configuration information indicates that the toolbar rendering function is enabled, it is determined that the operating environment detection result is that the operating environment is ready.
[0105] Among them, component configuration information refers to information used to describe the configuration of the native rendering component, including component version information and toolbar rendering configuration information, wherein the component version information is used to describe the version of the native rendering component, and the toolbar rendering configuration information is used to describe whether the toolbar rendering function of the native rendering component is enabled. The toolbar rendering version requirement refers to the requirements that the component version of the native rendering component needs to meet when the toolbar rendering is implemented using the native rendering component. For example, the toolbar rendering version requirement may specifically be that the component version of the native rendering component must be the target component version, or not lower than the target component version, and the target component version can be configured according to the actual application scenario.
[0106] Specifically, the toolbar creation interface is called. If a native rendering component exists, the component configuration information of the native rendering component can be obtained. The component configuration information includes component version information and toolbar rendering configuration information. When the component version information and toolbar rendering configuration information are obtained, it is necessary to determine whether the component version information meets the toolbar rendering version requirements, and determine whether the toolbar rendering function is enabled based on the toolbar rendering configuration information. When the component version information meets the toolbar rendering version requirements and the toolbar rendering configuration information indicates that the toolbar rendering function is enabled, it is determined that the operating environment detection result is that the operating environment is ready.
[0107] In a specific application, if the function of toolbar rendering implemented by the native rendering component is a grayscale function that is launched, it is necessary to further detect whether the user who logs into the application is a grayscale user. If the user is a grayscale user, the operating environment detection result is determined to be ready. In a specific application, the account of the user who logs into the application can be used to determine whether the user is a grayscale user, that is, when the user's account belongs to a pre-configured grayscale user account, the user is determined to be a grayscale user.
[0108] In this embodiment, by acquiring the component configuration information of the native rendering component, the component version information and the toolbar rendering configuration information in the component configuration information can be used to accurately detect the operating environment of the native rendering component for toolbar rendering.
[0109] In one embodiment, the method for displaying a toolbar in a page further includes:
[0110] In response to a trigger operation on a button in a toolbar of the input area, outputting a button identifier indicated by the trigger operation to a web page rendering component through a native rendering component;
[0111] The web page rendering component is used to render and display the page according to the page update method indicated by the button logo.
[0112] The button identifier refers to the identifier of the button in the toolbar used to identify the input area. For example, the button identifier can be an identifier of the button in the toolbar used to identify the input area. For example, the button identifier can be a string of characters used to identify the button in the toolbar of the input area. The page update method refers to the method of updating the page. For example, the page update method can be updating the focused input area, displaying the input content configuration page, etc.
[0113] Specifically, when a toolbar of an input area is displayed, the user can interact with the page by triggering a trigger operation on a button in the toolbar of the input area. When the user triggers a trigger operation on a button in the toolbar of the input area, in response to the trigger operation on the button in the toolbar of the input area, the native rendering component outputs the button identifier indicated by the trigger operation to the web page rendering component to instruct the web page rendering component to render and display the page according to the page update method indicated by the button identifier.
[0114] In a specific application, when a toolbar with an input area is displayed, the native rendering component monitors the triggering operation of the buttons in the toolbar of the input area. When a triggering operation of the buttons in the toolbar of the input area is detected, the button identifier indicated by the triggering operation is obtained, the toolbar button click interface is called, and the button identifier indicated by the triggering operation is output to the web page rendering component.
[0115] In a specific application, the design of the toolbar button click interface can be shown in FIG13. When the button identifier indicated by the trigger operation is obtained, the native rendering component can call the toolbar button click interface to execute the toolbar button click function therein to output the button identifier indicated by the trigger operation to the web page rendering component, so as to instruct the web page rendering component to execute the callback event based on the button identifier, that is, to render and display the page according to the page update method indicated by the button identifier. As shown in FIG13, in this embodiment, the callback is performed through execEventCallback (a solution for communication between the native rendering component and the web page rendering component in the application, which can be understood as a communication protocol).
[0116] In this embodiment, by responding to the trigger operation of the button in the toolbar of the input area, the button identifier indicated by the trigger operation can be output to the web page rendering component through the native rendering component, and then the web page rendering component can render and display the page according to the page update method indicated by the button identifier, thereby realizing interaction with the page.
[0117] In one embodiment, by means of a web page rendering component, according to the page update mode indicated by the button identifier, rendering and displaying the page includes:
[0118] When the page update mode indicated by the button identifier is to update the focused input area, the web page rendering component determines the area position of the updated focused input area based on the toolbar size information obtained from the native rendering component;
[0119] Based on the updated area position of the focused input area, the page is rendered and displayed.
[0120] Among them, updating the focused input area refers to transferring the focus from the currently focused input area to another input area. For example, updating the focused input area may specifically be transferring the focus from the currently focused input area to the previous input area. For another example, updating the focused input area may specifically be transferring the focus from the currently focused input area to the next input area. The toolbar size information is used to describe the size of the toolbar of the input area. For example, the toolbar size information may specifically be the height information of the toolbar of the input area.
[0121] Specifically, the buttons in the toolbar include buttons for switching input areas up and down. When the user triggers the trigger operation for the button for switching input areas up and down, it means that the page update method indicated by the button identifier is to update the focused input area, and the focused input area needs to be updated. The web page rendering component determines the area position of the updated focused input area based on the toolbar size information obtained from the native rendering component, and renders the page and displays it based on the updated area position of the focused input area. It can be understood that the rendering and displaying of the page here mainly updates the cursor indicating the focused input area.
[0122] In this embodiment, when the focused input area needs to be updated, the area position of the updated focused input area is first determined based on the toolbar size information, and then the page is rendered and displayed. This can avoid the situation where the toolbar of the input area affects the display of the page because the size of the toolbar is unknown when the focused input area is updated.
[0123] For example, when updating the focused input area to transfer from the currently focused input area to the input area below, if the size of the toolbar is unknown, the cursor indicating the focused input area may be covered by the toolbar of the input area.
[0124] In one embodiment, by means of a web page rendering component, according to the page update mode indicated by the button identifier, rendering and displaying the page includes:
[0125] When the page update method indicated by the button logo is to display the input content configuration page, the page configuration information of the input content configuration page to be displayed is obtained through the web page rendering component, the focused input area is defocused, and the input content configuration page is rendered and displayed.
[0126] The input content configuration page refers to a page for configuring the content of the input area. For example, the input area content configuration here can specifically be setting the title of the collection form, adding pictures, adding links, etc. The input content configuration page can be used to quickly configure the content of the input area.
[0127] Specifically, the buttons in the toolbar include buttons for input area content configuration. When the user triggers the trigger operation of the button for input area content configuration, it means that the page update method indicated by the button logo is to display the input content configuration page. The web page rendering component will obtain the page configuration information of the input content configuration page to be displayed, defocus the focused input area, render the input content configuration page and display it.
[0128] It is understandable that since the native rendering component and the web page rendering component are independent of each other, when the user triggers the trigger operation on the button in the toolbar, if the trigger operation is not for the button that switches the input area up and down, the web page rendering component will not be able to automatically lose focus. Therefore, the web page rendering component is required to defocus the focused input area when it determines that the page update method indicated by the button identifier is to display the input content configuration page, so as to avoid the problem of being unable to automatically lose focus.
[0129] In one embodiment, the method for displaying a toolbar in a page further includes:
[0130] When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar hiding event is bound to the hiding trigger event of the virtual input tool through the web page rendering component, and monitoring of the hiding trigger event is added;
[0131] In response to a focus loss event for an input area triggered on a page, the virtual input tool is canceled from being displayed through a native rendering component, and a prompt indicating the generation of a hidden triggering event is pushed to a web page rendering component;
[0132] Through the web rendering component, after receiving the prompt of the hidden trigger event, the toolbar hiding event is triggered, and the toolbar hiding instruction is output to the native rendering component;
[0133] By using the native rendering component, in response to the toolbar hiding instruction, the toolbar of the input area is undisplayed.
[0134] Among them, the toolbar hiding event refers to the event that indicates hiding the toolbar on the page. The hiding trigger event of the virtual input tool refers to the event that the hiding of the virtual input tool is triggered, indicating that the virtual input tool will begin to hide. For example, the hiding trigger event of the virtual input tool can specifically be a virtual input tool down event, that is, an event in which the virtual input tool changes from display to hiding. The out-of-focus event for the input area refers to an event triggered when the input area loses focus. When the user clicks or moves the focus to an area outside the input area in other ways, a loss-of-focus event is triggered.
[0135] Specifically, when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the web page rendering component will bind the toolbar hiding event to the hiding trigger event of the virtual input tool, and add monitoring of the hiding trigger event, so that when the hiding trigger event of the virtual input tool is detected, the toolbar hiding event is triggered to instruct the native rendering component to cancel the display of the toolbar. When a focus loss event for the input area triggered on the page is detected, the terminal will cancel the display of the virtual input tool through the native rendering component in response to the focus loss event, and push the generation prompt of the hiding trigger event to the web page rendering component to inform the web page rendering component that the hiding trigger event has been triggered.
[0136] In a specific application, when the toolbar hide event is bound to the hide trigger event of the virtual input tool and the monitoring of the hide trigger event is added, the web page rendering component triggers the toolbar hide event by monitoring the hide trigger event of the virtual input tool. Receiving the prompt of the generation of the hide trigger event is equivalent to monitoring the hide trigger event of the virtual input tool. Therefore, after receiving the prompt of the generation of the hide trigger event, the web page rendering component will trigger the toolbar hide event, call the toolbar display control interface provided by the native rendering component, and output the toolbar hide instruction to the native rendering component to instruct the native rendering component to cancel the display of the toolbar in the input area in response to the toolbar hide instruction.
[0137] It should be noted that since the virtual input tool is rendered and displayed through the native rendering component, as long as the native rendering component starts to cancel the display of the virtual input tool, the native rendering component pushes the generation prompt of the hide trigger event to the web rendering component, and the web rendering component can monitor the hide trigger event of the virtual input tool.
[0138] In this embodiment, the hiding trigger event of the monitoring virtual input tool can be used to trigger the toolbar hiding event. When a focus loss event is generated for the input area, the interaction is realized by hiding the virtual input tool, and the web page rendering component is informed that the hiding trigger event has been generated, so that the web page rendering component knows that the hiding trigger event has been generated and triggers the toolbar hiding event, and then can respond to the toolbar hiding event and output the toolbar hiding instruction to the native rendering component, so that the native rendering component can cancel the display of the toolbar by responding to the toolbar hiding instruction. In the whole process, the logic of hiding the toolbar is controlled by the web page rendering component, and the display of the toolbar is canceled by the native rendering component. The display and rendering logic of the toolbar can be separated, so that the web page rendering component controls the display logic of the toolbar and controls the native rendering component to cancel the display of the toolbar, which can achieve stable cancellation of the toolbar display.
[0139] In one embodiment, the method for displaying a toolbar in a page further includes:
[0140] In response to the component being uninstalled event of the page, the component is rendered through the web page, and the component uninstall method is called;
[0141] Through the component uninstallation method, call the toolbar uninstallation interface. When the native rendering component meets the toolbar rendering conditions, unbind the toolbar display event and the display trigger event, and release the monitoring of the display trigger event.
[0142] The component uninstall event refers to an event triggered when a component is removed from the DOM. The component in this embodiment refers to a component based on web technology, that is, a web rendering component. The component uninstall method (also called componentWillUnmount) is a lifecycle method in React, which is called when a component is removed from the DOM.
[0143] Specifically, when the component of the page is removed from the DOM, the component uninstall event of the page will be triggered. In response to the component uninstall event of the page, the web page rendering component will call the component uninstall method, and through the component uninstall method, call the toolbar uninstall interface. Through the toolbar uninstall interface, when the native rendering component meets the toolbar rendering conditions, the toolbar display event and the display trigger event are unbound, and the monitoring of the display trigger event is released.
[0144] In a specific application, as shown in Figure 14, when the component of the page is removed from the DOM, the component uninstall event of the page will be triggered. In response to the component uninstall event of the page, the web page rendering component will call the component uninstall method, and through the component uninstall method, call the toolbar uninstall interface, and call the detection existence method through the toolbar uninstall interface. When the detection existence method is used to determine that the native rendering component meets the toolbar rendering conditions, the event removal method is called to unbind the toolbar display event and the display trigger event. When the toolbar display event and the display trigger event are unbinded, the event monitoring removal interface is called to release the monitoring of the display trigger event.
[0145] In this embodiment, in response to the event that a component of a page is uninstalled, a component uninstall method is called through the web page rendering component, and the toolbar uninstall interface can be called through the component uninstall method to achieve the unbinding of the toolbar display event and the display trigger event and the unbinding of the display trigger event to ensure that the component is completely uninstalled.
[0146] In one embodiment, the method for displaying a toolbar in a page further includes:
[0147] When the components of the page are mounted and the native rendering component does not meet the toolbar rendering conditions, create a toolbar instance through the web rendering component;
[0148] In response to a focus event on an input area triggered on a page, rendering and displaying a virtual input tool through a native rendering component;
[0149] When the input area is configured with a toolbar, the second toolbar state update interface is called through the web page rendering component to obtain the second toolbar state information, and the toolbar display interface is called to render and display the toolbar of the input area based on the second toolbar state information and the toolbar instance.
[0150] Among them, the toolbar instance refers to a specific toolbar instance created by the web page rendering component. The created toolbar instance can be used to assist input operations performed on the page and has its own state, method and event. The second toolbar state information refers to information used to describe the state of the buttons in the toolbar. For example, the second toolbar state information can specifically be information used to describe whether the buttons in the toolbar are enabled. It is understandable that the state of the buttons in the toolbar instance can be updated by updating the second toolbar state information.
[0151] Specifically, when the component of the page has been mounted, the web page rendering component will immediately call the component mounted method, and through the component mounted method, call the toolbar creation interface, and detect the operating environment of the native rendering component for toolbar rendering through the toolbar creation interface to obtain the operating environment detection result. When the operating environment detection result is that the operating environment is not ready, it means that the native rendering component does not meet the toolbar rendering conditions and needs to perform toolbar rendering through the web page rendering component. At this time, the web page rendering component will call the toolbar creation event, create a toolbar instance, and add monitoring for focus events on the input area. When the focus event on the input area is triggered on the page, in response to the focus event on the input area triggered on the page, the native rendering component will render and display the virtual input tool. When the input area is configured with a toolbar, the web page rendering component will call the second toolbar status update interface to obtain the second toolbar status information, and call the toolbar display interface to render and display the toolbar of the input area based on the second toolbar status information and the toolbar instance.
[0152] In a specific application, while adding monitoring of focus events for the input area, the web page rendering component will add monitoring of out-of-focus events for the input area. When an out-of-focus event for the input area is triggered on the page, in response to the out-of-focus event for the input area triggered on the page, the native rendering component will cancel the display of the virtual input tool. If a toolbar is configured for the input area, the web page rendering component will cancel the display of the toolbar for the input area. At the same time, the web page rendering component will also add monitoring of scrolling events of the page. When a scrolling event of the page is triggered on the page, in response to the scrolling event of the page triggered on the page, the native rendering component will cancel the display of the virtual input tool. If a toolbar is configured for the input area, the web page rendering component will cancel the display of the toolbar for the input area. When the component of the page is uninstalled, in response to the event that the component of the page is uninstalled, the web page rendering component will call the component uninstall method, and call the monitoring removal interface through the component uninstall method to release the monitoring of the focus event of the input area, the out-of-focus event of the input area, and the scrolling event of the page.
[0153] In a specific application, the logic diagram of toolbar rendering implemented by the web page rendering component can be shown in FIG15. In the life cycle of a page, when the component of the page has been mounted, the web page rendering component will immediately call the component mounted method, and through the component mounted method, call the toolbar creation interface, and detect the operating environment of the native rendering component for toolbar rendering through the toolbar creation interface to obtain the operating environment detection result. When the operating environment detection result is that the operating environment is not ready, it means that the native rendering component does not meet the toolbar rendering conditions, and the toolbar rendering needs to be performed through the web page rendering component. At this time, the web page rendering component will call the toolbar creation event (not shown in the figure), create a toolbar instance, and add monitoring for the focus event for the input area, the loss of focus event for the input area, and the scrolling event of the page. When the focus event for the input area is triggered on the page, in response to the focus event for the input area triggered on the page, if the input area is configured with a toolbar, the web page rendering component will call the second toolbar state update interface to obtain the second toolbar state information, and call the toolbar display interface, based on the second toolbar state information and the toolbar instance, render and display the toolbar of the input area. When a focus loss event for the input area is triggered on the page, in response to the focus loss event for the input area triggered on the page, the web page rendering component will cancel the display of the toolbar of the input area. When a scrolling event of the page is triggered on the page, in response to the scrolling event of the page triggered on the page, the web page rendering component will cancel the display of the toolbar of the input area. When the component of the page is uninstalled, in response to the component uninstallation event of the page, the web page rendering component will call the component uninstallation method, call the monitoring removal interface through the component uninstallation method, and cancel the monitoring of the focus event of the input area, the focus loss event of the input area, and the scrolling event of the page.
[0154] In this embodiment, when the components of the page have been mounted and the native rendering component does not meet the toolbar rendering conditions, the toolbar can be rendered through the web page rendering component, thereby providing a guarantee for stable display of the toolbar.
[0155] It is understandable that, with the traditional method, mobile applications are usually applications with multiple input boxes. There will be multiple input elements in the application page (such as input (used to create a single input control), textarea tag (used to create a multi-line text input control), contenteditable element (HTML (Hyper Text Markup Language) element with contenteditable attribute that allows users to directly edit its content)). When the input box obtains and switches focus, the lifting and lowering action of the virtual keyboard itself plus the movement action of the system's native overall WebView (web page view) will cause the toolbar to flicker and jitter abnormally when used, and there is a problem that the toolbar cannot be displayed stably, which greatly affects the user interaction experience.
[0156] Specifically, the traditional method has the following interactive shortcomings: First, when focusing on different focal points, the toolbar position drifts and shakes back and forth, and the cursor drifts when the page slides; second, the toolbar needs to be hidden when scrolling the page; third, the problem of the toolbar blocking the cursor often occurs (it should be noted that in order to avoid being blocked, web technology has performed a lot of scrolling operations on textarea and contenteditable elements, such as scrollintoview or scrollBy to implement, which will also cause the flickering and jumping problems to be magnified); fourth, for the Android system, the virtual keyboard will be lowered immediately when the focus is lost, and the virtual keyboard will be raised immediately when the focus is focused, resulting in the change of the page height, and the toolbar will naturally flicker.
[0157] In one embodiment, the interactive shortcomings are illustrated by taking the page of the present application as a collection table editing page. As shown in FIG16 , the toolbar position drifts when focusing on different focal points and is not completely fixed above the virtual keyboard. As shown in FIG17 , the cursor drifts when the page slides and is not displayed in the input area, wherein the cursor is represented by a bold vertical line in FIG17 .
[0158] Based on this, the present application proposes a method for displaying a toolbar in a page that stably displays a toolbar, which can enable the toolbar to assist users in completing input interactions and optimizing operation interactions for input areas when there is an input area on the terminal page. For example, through the toolbar display method in the page in the present application, it can be achieved that the toolbar assists users in completing document input interaction effects and optimizing operation interactions in the terminal, ensuring the stability, usability, and ease of use of the document. For example, the document here can specifically be a collection table, and the page in the present application is a collection table editing page.
[0159] It should be noted that the traditional call chain of the method of using Web technology (web page technology) to achieve overall rendering and interaction is to strongly bind the process of input area focus / defocus-component display / hide-component rendering. This process is relatively long and will cause a certain amount of time overhead. In addition, since the toolbar is rendered by the web page rendering component, there will be height, hierarchy, and position problems between web page elements, which may eventually lead to the toolbar component drifting and jittering, the cursor indicating the input area drifting, and the disadvantages of being above the toolbar. The toolbar display method in the page of this application can well avoid the occurrence of these problems.
[0160] In one embodiment, the toolbar component architecture diagram involved in the toolbar display method in the page of the present application can be shown in Figure 18. It can be seen from Figure 18 that the toolbar part is drawn by the native rendering component, and the display and update logic is completed by the web page rendering component, wherein the native rendering component and the web page rendering component are completed through the JS (JavaScript, a programming language) interface and execEventCallBack (a solution within the application for solving the communication between the native rendering component and the web page rendering component, which can be understood as a communication protocol). In this way, the rendering and display logic can be separated. For the web page rendering component, there is no need to worry about the rendering logic, only the display and data update. The toolbar drawn by the native rendering component has more stable performance and usability, which greatly improves the user's interactive experience.
[0161] In one embodiment, as shown in FIG. 19, it is a processing flow diagram of the toolbar display method in the page of the present application. As shown in FIG. 19, in the toolbar display method in the page of the present application, the native rendering toolbar is displayed using the native rendering component, which is based on web page technology, and the method of using the web page rendering component to display the web page rendering toolbar will be retained, so that when the native rendering component does not meet the toolbar rendering conditions, the web page rendering component is used for bottom-up processing to ensure user interaction. That is, after calling the toolbar creation interface, the operating environment detection result obtained by performing the operating environment detection on the native rendering component will be used to select whether to use the native rendering component to display the native rendering toolbar or to use the web page rendering component to display the web page rendering toolbar. As shown in FIG. 19, when the native rendering component is used to display the native rendering toolbar, the component is loaded and unloaded in componentDidMounted and componentWillUnmount of the page life cycle, and there is a detection method to detect the operating environment of the native rendering component for toolbar rendering, that is, to determine whether the operating environment of the native rendering component for toolbar rendering is ready. As shown in Figure 19, in the processing logic of the native rendering component, the focus event (calling the toolbar display interface in Figure 19) / defocus event (calling the toolbar hiding interface in Figure 19) of the input area will be unbound, and the event adding method will be called to add monitoring of the display trigger event and hide trigger event of the virtual input tool, so as to determine whether the toolbar appears by monitoring the display trigger event and hide trigger event of the virtual input tool, and when the component uninstall event of the page is triggered, in response to the component uninstall event of the page being triggered, the toolbar uninstall interface is called to uninstall, that is, the detection existence method is first called to detect the operating environment of the native rendering component for toolbar rendering, and when it is determined that the operating environment of the native rendering component for toolbar rendering is ready, the event removal method is called to release the binding of the toolbar display event and the display trigger event, as well as the binding of the toolbar hide event and the hide trigger event, and the event monitoring removal interface is called to release the monitoring of the display trigger event and the hide trigger event.
[0162] It can be understood that the toolbar display method in the page of the present application can understand the toolbar as a native part rather than a part of the web page. By unbinding, the toolbar appearance logic and the toolbar button update logic are separated, and some computing performance consumption can also be reduced. After successful creation, relevant event binding will be performed, including display trigger events and hide trigger events for monitoring virtual input tools, trigger operations for buttons in the toolbar of the input area (specifically, it can be an event for detecting click buttons and calling back to the web page rendering component), etc.
[0163] In one embodiment, the toolbar display method in the page of the present application is specifically described below. The toolbar display method in the page of the present application loads components when the components of the page are already mounted, and uninstalls components in response to the event that the components of the page are uninstalled, involving several parts such as toolbar display, toolbar canceling display, and responding to trigger operations on buttons in the toolbar.
[0164] When the components of the page have been mounted, the web page rendering component will call the component mounted method, and through the component mounted method, call the toolbar creation interface. If a native rendering component exists, the component configuration information of the native rendering component including the component version information and the toolbar rendering configuration information is obtained. When the component version information meets the toolbar rendering version requirements and the toolbar rendering configuration information indicates that the toolbar rendering function is enabled, it is determined that the operating environment detection result is that the operating environment is ready. When the operating environment detection result is that the operating environment is ready, it is determined that the native rendering component meets the toolbar rendering conditions. The web page rendering component will bind the toolbar display event with the display trigger event of the virtual input tool, and bind the toolbar hide event with the hide trigger event of the virtual input tool, and add monitoring of the display trigger event and the hide trigger event.
[0165] When event binding and monitoring event addition are completed, if a focus event for the input area is generated on the page, in response to the focus event for the input area triggered on the page, the native rendering component will render and display the virtual input tool, and push the display trigger event generation prompt to the web page rendering component. The web page rendering component triggers a toolbar display event after receiving the display trigger event generation prompt. In response to the toolbar display event, the area identifier of the input area is obtained. When the area identifier exists in the preconfigured focus area identifier list, it is determined that the input area is configured with a toolbar. In the case that the input area is configured with a toolbar, the first toolbar status information is obtained, the first toolbar status update interface provided by the native rendering component is called, the first toolbar status information is output to the native rendering component, and the toolbar display event is triggered. The toolbar display control interface provided by the native rendering component is called to output the toolbar display instruction to the native rendering component to instruct the native rendering component to render and display the toolbar of the input area according to the first toolbar status information in response to the toolbar display instruction.
[0166] When event binding and monitoring event addition are completed, if a focus loss event for the input area is generated on the page, in response to the focus loss event for the input area triggered on the page, the native rendering component will cancel the display of the virtual input tool and push the generation prompt of the hidden trigger event to the web page rendering component. The web page rendering component triggers the toolbar hiding event after receiving the generation prompt of the hidden trigger event, calls the toolbar display control interface provided by the native rendering component, and outputs the toolbar hiding instruction to the native rendering component, so that the native rendering component, in response to the toolbar hiding instruction, cancels the display of the toolbar of the input area.
[0167] When a component uninstall event occurs on a page, in response to the component uninstall event on the page, the web page rendering component will call the component uninstall method, and through the component uninstall method, call the toolbar uninstall interface, and when the native rendering component meets the toolbar rendering conditions, release the binding of the toolbar display event and the display trigger event, as well as the binding of the toolbar hide event and the hide trigger event, and release the monitoring of the display trigger event and the hide trigger event.
[0168] When a page displays a toolbar with an input area, if a user triggers a trigger operation on a button in the toolbar of the input area, in response to the trigger operation on the button in the toolbar of the input area, the native rendering component outputs the button identifier indicated by the trigger operation to the web page rendering component, so that the page is rendered and displayed through the web page rendering component according to the page update method indicated by the button identifier.
[0169] Among them, when the page update method indicated by the button logo is to update the focused input area, the web page rendering component will determine the area position of the updated focused input area based on the toolbar size information obtained from the native rendering component, and render the page and display it based on the updated area position of the focused input area. When the page update method indicated by the button logo is to display the input content configuration page, the web page rendering component will obtain the page configuration information of the input content configuration page to be displayed, defocus the focused input area, render the input content configuration page and display it.
[0170] When the components of the page have been mounted and the native rendering component does not meet the toolbar rendering conditions, the toolbar can be displayed through the web page rendering component to provide a backup. Specifically, the web page rendering component will create a toolbar instance. In response to the focus event on the input area triggered on the page, the native rendering component will render and display the virtual input tool. When the input area is configured with a toolbar, the web page rendering component will call the second toolbar status update interface to obtain the toolbar status information, and call the toolbar display interface. Based on the toolbar status information and the toolbar instance, it will render and display the toolbar of the input area.
[0171] It can be understood that the toolbar display method in the page of this application solves the problems of toolbar jitter, drift, appearance and disappearance delay, solves the problem of cursor drift and toolbar covering the input area, solves the disadvantage of needing to hide the toolbar when scrolling, and improves the user interaction experience and toolbar stability.
[0172] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0173] Based on the same inventive concept, the embodiment of the present application also provides a toolbar display device in a page for implementing the toolbar display method in the page involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the toolbar display device in one or more pages provided below can refer to the limitations of the toolbar display method in the page above, and will not be repeated here.
[0174] In one embodiment, as shown in FIG. 20 , a toolbar display device in a page is provided, comprising: an event adding module 2002, a focus response module 2004, a toolbar display control module 2006 and a toolbar display module 2008, wherein:
[0175] The event adding module 2002 is used to bind the toolbar display event with the display trigger event of the virtual input tool through the web page rendering component when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, and add monitoring of the display trigger event;
[0176] A focus response module 2004 is used to respond to a focus event on an input area triggered on a page, render and display a virtual input tool through a native rendering component, and push a prompt of the generation of the display trigger event to a web page rendering component;
[0177] The toolbar display control module 2006 is used to obtain the first toolbar state information through the web page rendering component when receiving the prompt of the display trigger event and the input area is configured with a toolbar, output the first toolbar state information to the native rendering component, trigger the toolbar display event, and output the toolbar display instruction to the native rendering component;
[0178] The toolbar display module 2008 is used to render and display the toolbar of the input area according to the first toolbar state information in response to the toolbar display instruction through the native rendering component.
[0179] The toolbar display device in the above-mentioned page, when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, binds the toolbar display event to the display trigger event of the virtual input tool through the web page rendering component, and adds monitoring of the display trigger event. It can use the display trigger event of the virtual input tool to monitor the trigger event to trigger the toolbar display event. When a focus event is generated for the input area, the interaction is achieved by displaying the virtual input tool, and the web page rendering component is informed that the display trigger event has occurred, so that the web page rendering component can know that the display trigger event has occurred, and then, when the input area is configured with a toolbar, obtain the first toolbar status information, output the first toolbar status information to the native rendering component, trigger the toolbar display event, and output the toolbar display instruction to the native rendering component, so that the native rendering component can render and display the toolbar of the input area according to the first toolbar status information in response to the toolbar display instruction. During the entire process, the logic of displaying the toolbar is controlled by the web rendering component, and the toolbar is rendered by the native rendering component. The display and rendering logic of the toolbar can be separated, so that the web rendering component controls the logic of displaying the toolbar, and controls the native rendering component to render and display the toolbar in the process of rendering and displaying the virtual input tool, thereby achieving stable display of the toolbar.
[0180] In one embodiment, the toolbar display control module is also used to obtain the area identifier of the input area through the web page rendering component after receiving the prompt of the display trigger event, and when the area identifier exists in the preconfigured focus area identifier list, it is determined that the input area is configured with a toolbar.
[0181] In one embodiment, the toolbar display control module is also used to obtain the first toolbar status information through the web page rendering component when a prompt for the generation of a display trigger event is received and the input area is configured with a toolbar, call the first toolbar status update interface provided by the native rendering component, output the first toolbar status information to the native rendering component, trigger the toolbar display event through the web page rendering component, call the toolbar display control interface provided by the native rendering component, and output the toolbar display instruction to the native rendering component.
[0182] In one embodiment, the device also includes a creation module, which is used to call the component mounted method through the web page rendering component when the component of the page has been mounted, and call the toolbar creation interface through the component mounted method to detect the operating environment of the native rendering component for toolbar rendering, and obtain the operating environment detection result. When the operating environment detection result is that the operating environment is ready, it is determined that the native rendering component meets the toolbar rendering conditions.
[0183] In one embodiment, the creation module is also used to call the toolbar creation interface, and if a native rendering component exists, obtain the component configuration information of the native rendering component; the component configuration information includes component version information and toolbar rendering configuration information. When the component version information meets the toolbar rendering version requirements and the toolbar rendering configuration information indicates that the toolbar rendering function is enabled, it is determined that the operating environment detection result is that the operating environment is ready.
[0184] In one embodiment, the device also includes a page display module, which is used to respond to a trigger operation on a button in the toolbar of the input area, output a button identifier indicated by the trigger operation to a web page rendering component through a native rendering component, and render and display the page through the web page rendering component in accordance with the page update method indicated by the button identifier.
[0185] In one embodiment, the page display module is also used to determine the area position of the updated focused input area based on the toolbar size information obtained from the native rendering component through the web page rendering component when the page update method indicated by the button identifier is to update the focused input area, and render and display the page based on the updated area position of the focused input area.
[0186] In one embodiment, the page display module is also used to obtain the page configuration information of the input content configuration page to be displayed through the web page rendering component when the page update method indicated by the button identifier is to display the input content configuration page, defocus the focused input area, render the input content configuration page and display it.
[0187] In one embodiment, the device also includes a loss of focus response module, which is also used to bind the toolbar hiding event with the hiding trigger event of the virtual input tool through the web page rendering component when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, and add monitoring of the hiding trigger event. In response to the loss of focus event for the input area triggered on the page, the virtual input tool is canceled from display through the native rendering component, and the generation prompt of the hiding trigger event is pushed to the web page rendering component. After receiving the generation prompt of the hiding trigger event, the toolbar hiding event is triggered through the web page rendering component, and the toolbar hiding instruction is output to the native rendering component. Through the native rendering component, in response to the toolbar hiding instruction, the toolbar of the input area is canceled from display.
[0188] In one embodiment, the device also includes a component uninstallation module, which is used to respond to the component uninstallation event of the page, call the component uninstallation method through the web page rendering component, call the toolbar uninstallation interface through the component uninstallation method, and release the binding of the toolbar display event and the display trigger event when the native rendering component meets the toolbar rendering conditions, and release the monitoring of the display trigger event.
[0189] In one embodiment, the toolbar display module is also used to create a toolbar instance through the web page rendering component when the components of the page have been mounted and the native rendering component does not meet the toolbar rendering conditions, and in response to a focus event on the input area triggered on the page, render and display the virtual input tool through the native rendering component; when the input area is configured with a toolbar, call the second toolbar status update interface through the web page rendering component to obtain the second toolbar status information, and call the toolbar display interface to render and display the toolbar of the input area based on the second toolbar status information and the toolbar instance.
[0190] Each module in the toolbar display device in the above page can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0191] In one embodiment, a computer device is provided, which can be a terminal or a server. Taking the computer device as a terminal as an example, its internal structure diagram can be shown in Figure 21. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a toolbar display method in a page is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0192] Those skilled in the art will understand that the structure shown in FIG. 21 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0193] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0194] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0195] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0196] It should be noted that the user information (including but not limited to the accounts of users logging into the application, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0197] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0198] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0199] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for displaying a toolbar in a page, characterized in that: The method comprises: When the components of the page have been mounted and the native rendering component meets the toolbar rendering condition, the toolbar display event is bound to the display trigger event of the virtual input tool through the web page rendering component, and monitoring of the display trigger event is added; the toolbar rendering condition refers to that the operating environment of the native rendering component is ready; In response to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display triggering event to the webpage rendering component; By the webpage rendering component, upon receiving the generation prompt of the display triggering event and in the case that the input area is configured with a toolbar, first toolbar state information is obtained, the first toolbar state information is output to the native rendering component, and the toolbar display event is triggered, and a toolbar display instruction is output to the native rendering component; The native rendering component responds to the toolbar display instruction and renders and displays the toolbar of the input area according to the first toolbar state information.
2. The method according to claim 1, characterized in that: The method further comprises: After receiving the prompt of the generation of the display triggering event, the webpage rendering component obtains the area identifier of the input area; When the area identifier exists in the preconfigured focus area identifier list, it is determined that the input area is configured with a toolbar.
3. The method according to claim 1, characterized in that The web page rendering component, upon receiving the generation prompt of the display trigger event and the input area is configured with a toolbar, obtains first toolbar state information, outputs the first toolbar state information to the native rendering component, and triggers the toolbar display event, and outputs the toolbar display instruction to the native rendering component includes: When receiving the prompt of the display trigger event and the input area is configured with a toolbar, the web page rendering component obtains the first toolbar state information, calls the first toolbar state update interface provided by the native rendering component, and outputs the first toolbar state information to the native rendering component; The toolbar display event is triggered through the web page rendering component, the toolbar display control interface provided by the native rendering component is called, and the toolbar display instruction is output to the native rendering component.
4. The method according to claim 1, characterized in that: The method further comprises: In the case where the component of the page has been mounted, calling the component mounted method through the web page rendering component; the component mounted method is a lifecycle method in React, which is called immediately after the component has been mounted to the document object model; By using the component mounted method, the toolbar creation interface is called to detect the operating environment of the native rendering component for toolbar rendering, and the operating environment detection result is obtained; When the operating environment detection result is that the operating environment is ready, it is determined that the native rendering component meets the toolbar rendering condition.
5. The method according to claim 4, characterized in that The calling of the toolbar creation interface to detect the operating environment of the native rendering component for toolbar rendering, and obtaining the operating environment detection result includes: Calling the toolbar creation interface, and if the native rendering component exists, obtaining component configuration information of the native rendering component; the component configuration information includes component version information and toolbar rendering configuration information; When the component version information meets the toolbar rendering version requirement and the toolbar rendering configuration information indicates that the toolbar rendering function is in an enabled state, it is determined that the operating environment detection result is that the operating environment is ready.
6. The method according to claim 1, characterized in that The method further comprises: In response to a trigger operation on a button in a toolbar of the input area, outputting a button identifier indicated by the trigger operation to the webpage rendering component through the native rendering component; The web page is rendered and displayed through the web page rendering component according to the page update method indicated by the button identifier.
7. The method according to claim 6, characterized in that The rendering and displaying of the page by the webpage rendering component according to the page update mode indicated by the button identifier includes: When the page update mode indicated by the button identifier is to update the focused input area, the web page rendering component determines the area position of the updated focused input area based on the toolbar size information obtained from the native rendering component; Based on the updated area position of the focused input area, the page is rendered and displayed.
8. The method according to claim 6, characterized in that The rendering and displaying of the page by the webpage rendering component according to the page update mode indicated by the button identifier includes: When the page update method indicated by the button identifier is to display the input content configuration page, the page configuration information of the input content configuration page to be displayed is obtained through the web page rendering component, the focused input area is defocused, and the input content configuration page is rendered and displayed.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, the toolbar hiding event is bound to the hiding triggering event of the virtual input tool through the webpage rendering component, and monitoring of the hiding triggering event is added; In response to a focus loss event for an input area triggered on the page, canceling display of the virtual input tool through the native rendering component, and pushing a generation prompt of the hidden trigger event to the web page rendering component; After receiving the generation prompt of the hiding triggering event, the toolbar hiding event is triggered by the webpage rendering component, and a toolbar hiding instruction is output to the native rendering component; The toolbar of the input area is undisplayed via the native rendering component in response to the toolbar hiding instruction.
10. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: In response to the component uninstallation event of the page, calling a component uninstallation method through the webpage rendering component; the component uninstallation method is a lifecycle method in React, which is called when the component is removed from the document object model; The toolbar uninstallation interface is called through the component uninstallation method, and when the native rendering component satisfies the toolbar rendering condition, the toolbar display event and the display trigger event are unbound, and the monitoring of the display trigger event is released.
11. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the component of the page has been mounted and the native rendering component does not meet the toolbar rendering condition, creating a toolbar instance through the web page rendering component; In response to a focus event on the input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component; In the case where the input area is configured with a toolbar, the second toolbar state update interface is called through the web page rendering component to obtain the second toolbar state information, and the toolbar display interface is called to render and display the toolbar of the input area based on the second toolbar state information and the toolbar instance.
12. A toolbar display device in a page, characterized in that: The device comprises: An event adding module is used to bind the toolbar display event with the display trigger event of the virtual input tool through the web page rendering component when the components of the page have been mounted and the native rendering component meets the toolbar rendering condition, and add monitoring of the display trigger event; the toolbar rendering condition refers to the operating environment of the native rendering component being ready; A focus response module, for responding to a focus event on an input area triggered on the page, rendering and displaying a virtual input tool through the native rendering component, and pushing a prompt of the generation of the display trigger event to the web page rendering component; A toolbar display control module, configured to obtain, through the web page rendering component, first toolbar state information when receiving a prompt for the display trigger event and the input area is configured with a toolbar, output the first toolbar state information to the native rendering component, trigger the toolbar display event, and output a toolbar display instruction to the native rendering component; The toolbar display module is used to render and display the toolbar of the input area according to the first toolbar state information in response to the toolbar display instruction through the native rendering component.
13. The device according to claim 12, characterized in that The toolbar display control module is also used to obtain the area identifier of the input area through the web page rendering component after receiving the prompt of the display trigger event, and when the area identifier exists in the preconfigured focus area identifier list, determine that the input area is configured with a toolbar.
14. The device according to claim 12, characterized in that The toolbar display control module is also used to obtain the first toolbar status information through the web page rendering component, call the first toolbar status update interface provided by the native rendering component, output the first toolbar status information to the native rendering component, trigger the toolbar display event through the web page rendering component, call the toolbar display control interface provided by the native rendering component, and output the toolbar display instruction to the native rendering component when the prompt for the display trigger event is received and the input area is configured with a toolbar.
15. The device according to claim 12, characterized in that The device also includes a creation module, which is used to call a component mounted method through the web page rendering component when the component of the page has been mounted. The component mounted method is a lifecycle method in React, which is called immediately after the component has been mounted to the document object model. Through the component mounted method, a toolbar creation interface is called to detect the operating environment of the native rendering component for toolbar rendering to obtain an operating environment detection result. When the operating environment detection result is that the operating environment is ready, it is determined that the native rendering component meets the toolbar rendering condition.
16. The device according to claim 15, characterized in that The creation module is also used to call the toolbar creation interface, and when the native rendering component exists, obtain the component configuration information of the native rendering component; the component configuration information includes component version information and toolbar rendering configuration information. When the component version information meets the toolbar rendering version requirements and the toolbar rendering configuration information indicates that the toolbar rendering function is in an enabled state, it is determined that the operating environment detection result is that the operating environment is ready.
17. The device according to claim 12, characterized in that The device also includes a page display module, which responds to a trigger operation on a button in the toolbar of the input area, outputs a button identifier indicated by the trigger operation to the web page rendering component through the native rendering component, and renders and displays the page through the web page rendering component in accordance with the page update method indicated by the button identifier.
18. The device according to claim 17, characterized in that The page display module is also used to determine the area position of the updated focused input area through the web page rendering component based on the toolbar size information obtained from the native rendering component when the page update method indicated by the button identifier is to update the focused input area, and render and display the page based on the updated area position of the focused input area.
19. The device according to claim 17, characterized in that The page display module is also used to, when the page update method indicated by the button identifier is to display the input content configuration page, obtain the page configuration information of the input content configuration page to be displayed through the web page rendering component, defocus the focused input area, render the input content configuration page and display it.
20. The device according to any one of claims 12 to 19, characterized in that The device also includes a focus loss response module, which is used to bind the toolbar hiding event with the hiding trigger event of the virtual input tool through the web page rendering component when the components of the page have been mounted and the native rendering component meets the toolbar rendering conditions, and add monitoring of the hiding trigger event. In response to the focus loss event triggered on the input area of the page, the virtual input tool is canceled from display through the native rendering component, and the generation prompt of the hiding trigger event is pushed to the web page rendering component. After receiving the generation prompt of the hiding trigger event, the toolbar hiding event is triggered through the web page rendering component, and a toolbar hiding instruction is output to the native rendering component. In response to the toolbar hiding instruction, the toolbar of the input area is canceled from display through the native rendering component.
21. The device according to any one of claims 12 to 19, characterized in that The device also includes a component uninstallation module, which is used to respond to the component uninstallation event of the page, call a component uninstallation method through the web page rendering component, the component uninstallation method is a lifecycle method in React, and it will be called when the component is removed from the document object model. Through the component uninstallation method, the toolbar uninstallation interface is called, and when the native rendering component meets the toolbar rendering condition, the toolbar display event and the display trigger event are unbound, and the monitoring of the display trigger event is released.
22. The device according to any one of claims 12 to 19, characterized in that The toolbar display module is also used to create a toolbar instance through the web page rendering component when the component of the page has been mounted and the native rendering component does not meet the toolbar rendering conditions, and in response to a focus event on the input area triggered on the page, render and display the virtual input tool through the native rendering component, and when the input area is configured with a toolbar, call the second toolbar status update interface through the web page rendering component to obtain the second toolbar status information, and call the toolbar display interface, and render and display the toolbar of the input area based on the second toolbar status information and the toolbar instance.
23. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
24. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
25. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Webpage document editing method and device, terminal and storage medium
CN110728112A
Interface rendering method and device, electronic equipment and storage medium
CN113742014A
Adaptive virtual keyboard
US20150301740A1
