User interface processing method, apparatus, device, storage medium, and program product
By obtaining change information from the user interface, a suitable component display mode is selected to process the components to be adjusted, solving the problem of incomplete display of excessively long text in the user interface, and achieving better text display effects and higher processing efficiency.
Patent Information
- Application Number
- CN202411954532.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The user interface suffers from incomplete text display due to excessive length when switching languages, preventing users from seeing the full information and impacting retrieval efficiency.
By acquiring information about changes in the user interface, the components to be adjusted are identified, and a target component display mode that matches it is selected from a preset rule base. The target component display mode is then used to process the components to be adjusted, so that they can automatically and compatiblely display the changed text.
The display effect of changing text is improved, allowing users to fully view the content of extremely long text, reducing development costs and improving processing efficiency.
Smart Images

Figure CN119759478B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a user interface processing method, apparatus, device, storage medium, and program product. Background Art
[0002] With the development of computer technology, a wide variety of applications have emerged, and their user interfaces have become an important source of information for users. However, due to factors such as language switching, the text that needs to be displayed in the user interface sometimes changes, such as when the text is too long. Currently, various applications address this issue by simply abbreviating or displaying overly long text, preventing users from seeing the entire text and affecting their information acquisition efficiency.
[0003] Based on this, there is currently a problem of poor display effect when displaying changing text. Summary of the Invention
[0004] Embodiments of the present application provide a user interface processing method, apparatus, device, storage medium, and program product, which can improve the display effect of changing text.
[0005] In the first aspect, an embodiment of the present application provides a user interface processing method, including: obtaining interface change information related to text changes in the user interface; determining a component to be adjusted in the user interface based on the interface change information, and the component to be adjusted is used to display the changed text; based on the text display attributes of the component to be adjusted, filtering out a target component display mode that matches the component to be adjusted from a preset rule library, the preset rule library including multiple component display modes, and different component display modes correspond to different matching conditions; processing the component to be adjusted according to the target component display mode.
[0006] In the second aspect, an embodiment of the present application provides a user interface processing device, which includes: an acquisition module for acquiring interface change information related to text changes based on text changes in the user interface; a determination module for determining the component to be adjusted in the user interface based on the interface change information, and the component to be adjusted is used to display the changed text; a matching module for filtering out a target component display mode that matches the component to be adjusted from a preset rule library based on the text display attributes of the component to be adjusted, and the preset rule library includes multiple component display modes, and different component display modes correspond to different matching conditions; a processing module for processing the component to be adjusted according to the target component display mode.
[0007] In a third aspect, an embodiment of the present application provides a user interface processing device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the user interface processing method described in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the user interface processing method as described in the first aspect is implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the user interface processing method described in the first aspect.
[0010] An embodiment of the present application provides a user interface processing method. The method obtains interface change information related to text changes based on text changes in the user interface, and determines the component to be adjusted in the user interface for displaying the changed text based on the interface change information. Since the preset rule library includes multiple component display modes, the matching conditions corresponding to different component display modes are different. Therefore, the method provided by the embodiment of the present application can automatically be compatible with different types of components. According to the text display properties of the component to be adjusted, the target component display mode that matches the component to be adjusted is screened out from the preset rule library. The target component display mode can be automatically compatible based on the text display properties, so that the component to be adjusted is processed according to the target component display mode, so that the processed component to be adjusted can automatically and compatibly display the changed text through the new display mode. On the one hand, the display effect of the changed text is improved, for example, the user can fully see the text content that has become too long due to language switching. On the other hand, there is no need to develop different processing tools for the text display problems of a single component, which effectively reduces development costs and improves processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0012] Figure 1 is a schematic diagram of an application scenario of the user interface processing method provided in an embodiment of the present application;
[0013] Figure 2 This is one of the flow charts of the user interface processing method provided in an embodiment of the first aspect of the present application;
[0014] Figure 3This is the second flowchart of the user interface processing method provided by the first embodiment of the first aspect of the present application;
[0015] Figure 4 This is the third flowchart of the user interface processing method provided by an embodiment of the first aspect of the present application;
[0016] Figure 5a This is the fourth flowchart of the user interface processing method provided in an embodiment of the first aspect of the present application;
[0017] Figure 5b This is a schematic diagram of the decision-making process of the decision-making model provided in an embodiment of the first aspect of the present application;
[0018] Figure 6 This is the fifth flowchart of the user interface processing method provided by the first embodiment of the first aspect of the present application;
[0019] Figure 7 This is one of the adjustment effect diagrams provided in an embodiment of the first aspect of the present application;
[0020] Figure 8 This is the sixth flowchart of the user interface processing method provided in the first embodiment of the first aspect of the present application;
[0021] Figure 9 This is the second schematic diagram of the adjustment effect provided by the first embodiment of the first aspect of the present application;
[0022] Figure 10 This is the seventh flowchart of the user interface processing method provided in the first embodiment of the first aspect of the present application;
[0023] Figure 11 This is the third schematic diagram of the adjustment effect provided by the first embodiment of the first aspect of the present application;
[0024] Figure 12 This is the eighth flowchart of the user interface processing method provided by an embodiment of the first aspect of the present application;
[0025] Figure 13 This is the fourth schematic diagram of the adjustment effect provided by the first embodiment of the first aspect of the present application;
[0026] Figure 14 This is a structural diagram of the intelligent display SDK kit provided in an embodiment of the first aspect of the present application;
[0027] Figure 15 It is a structural diagram of a user interface processing device provided in an embodiment of the second aspect of the present application;
[0028] Figure 16 It is a structural diagram of the user interface processing device provided in an embodiment of the third aspect of this application. DETAILED DESCRIPTION
[0029] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating examples of the present application. It should be noted that the acquisition, storage, use, processing, etc. of information and data in the embodiments of the present application are authorized by the user or relevant agencies and comply with the relevant provisions of national laws and regulations.
[0030] Currently, due to factors such as user interface language switching, the text displayed in the user interface may sometimes change, such as when the text is too long. To address this issue, various applications simply abbreviate or display overly long text using ellipsis, preventing users from seeing the entire text and hindering their information acquisition efficiency. Consequently, current applications displaying changing text suffer from poor display quality.
[0031] In view of this, an embodiment of the present application provides a user interface processing method, which obtains interface change information related to text changes based on text changes in the user interface, and determines the component to be adjusted of the text changed in the user interface based on the interface change information. Since the preset rule library includes multiple component display modes, the matching conditions corresponding to different component display modes are different. Therefore, the method provided in the embodiment of the present application filters out the target component display mode that matches the component to be adjusted from the preset rule library based on the text display attributes of the component to be adjusted, so that the filtered target component display mode is automatically compatible with the component to be adjusted, and then processes the component to be adjusted according to the target component display mode, so that the processed component to be adjusted can display the changed text through the new display mode, thereby improving the display effect of the changed text, for example, allowing the user to fully see the text content that has become overlong due to language switching.
[0032] The user interface processing method provided in the embodiment of the present application can be used in scenarios where the user interfaces of various applications are processed. For example: in order to improve the payment convenience for foreigners coming to China, some payment applications have developed a large number of multilingual related requirements. While meeting the multilingual related requirements, it is found that when switching languages, there may be a problem of incomplete display of excessively long texts. The user interface processing method provided in the embodiment of the present application can be applied to multilingual payment applications to solve the problem of incomplete display of excessively long texts. The payment application can run on a user terminal. Below, the application scenario of the user interface processing method provided in the embodiment of the present application is exemplified.
[0033] Figure 1 Schematic diagram of the application scenario of the user interface processing method provided in the embodiment of the present application. Figure 1 As shown, the user interface processing method provided in the embodiment of the present application is applied to a software development kit (SDK) 102 . The SDK 102 can be connected to a payment application 106 of a user terminal 104 .
[0034] The user terminal 104 may be any terminal such as a mobile phone, a tablet computer, a smart watch, a smart bracelet, etc. The user terminal 104 displays the user interface of the payment application 106 .
[0035] The payment application 106 can be run on the user terminal 104 and can be manifested as a mobile client, a computer desktop client, a web client, a mini-program in a third-party payment platform, a mini-program in an instant messaging tool, etc.
[0036] SDK 102 is used to obtain interface change information related to text changes based on text changes in the user interface, and determine the component to be adjusted 108 in the user interface based on the interface change information. The component to be adjusted 108 is used to display text. According to the text display properties of the component to be adjusted 108, a target component display mode that matches the component to be adjusted 108 is screened out from the preset rule library. The preset rule library includes multiple component display modes. Different component display modes have different matching conditions. The component to be adjusted is processed according to the target component display mode.
[0037] Optionally, the SDK 102 may obtain interface change information related to text changes in the user interface of the payment application 106 by means of instrumentation.
[0038] It can be seen that in the above application scenario, SDK 102 can automatically be compatible with different types of components, and according to the text display attributes of the component to be adjusted 108, the target component display mode that matches the component to be adjusted is filtered out from the preset rule library. The target component display mode can be automatically compatible based on the text display attributes, so that the component to be adjusted 108 can be processed according to the target component display mode, so that the processed component to be adjusted 108 can automatically and compatibly display the changed text through the new display mode, thereby improving the display effect of the changed text. For example, the text is displayed through bubbles, allowing users to fully see the text content that has become extra long due to language switching.
[0039] It should be noted that the above application scenario is only one possible implementation of the user interface processing method provided in the embodiment of the present application, and can also be applied to other scenarios according to actual application needs. Based on different application scenarios, the execution entity of the user interface processing method provided in the embodiment of the present application can be different.
[0040] The user interface processing method, apparatus, device, computer storage medium, and program product in the embodiments of the present application are described below.
[0041] A first aspect of the present application provides a user interface processing method. Figure 2 This is a flow chart of a user interface processing method provided in an embodiment of the first aspect of the present application. Figure 2 As shown, the user interface processing method may include steps 210 to 240.
[0042] Step 210: According to the text change of the user interface, obtain interface change information related to the text change.
[0043] The user interface is the collection of interface elements that allow users to interact with the application. User interactions with the user interface include, but are not limited to, clicks, slides, and drags.
[0044] Interface elements include, but are not limited to, various components such as input, output, navigation, and containers, including components used to display text. Components used to display text include, but are not limited to, labels, text boxes, titles, drop-down menus, and cards.
[0045] For example, when the method provided in the embodiment of the present application is applied to an SDK and the SDK is connected to a target application, an instrumentation method can be used in the SDK to obtain interface change information related to text changes in the user interface of the target application, thereby effectively tracking and analyzing text changes, so as to process the user interface of the target application and improve the display effect of the changed text.
[0046] Instrumentation involves inserting additional monitoring or diagnostic code into the code to collect information about interface changes related to text changes. For example, monitoring code can be inserted into key locations in the target application's code to capture information about interface changes related to text changes. These key locations can be related to the components of the text being monitored.
[0047] Text changes can include any form of text changes, such as changes in language switching, changes in different text contents in the same language, etc. As long as the text changes cause problems in the display of the text by the component used to display the text, the method provided in the embodiments of this application can be applied to solve the problem.
[0048] Interface change information is related to text changes. In some embodiments, obtaining interface change information related to text changes based on text changes in the user interface includes:
[0049] According to the text change of the user interface, at least one of component layout change information, text change information, and input event change information related to the text change is acquired.
[0050] Component layout change information refers to changes in components within the user interface layout caused by text changes. For example, when text changes prevent the component from being fully displayed within the component, the component's position may shift. Based on this, component layout change information can be obtained to identify components requiring text display adjustments. Optionally, component layout change information includes, but is not limited to, component size change information and component position movement change information.
[0051] Text change information refers to changes in the text itself due to changes in the text. Optionally, text change information includes, but is not limited to, changes in the number of characters in the text, changes in the text format, and the like. For example, the required component width for the changed text can be calculated based on the font size of the changed text. The ratio of the required component width to the current actual width of the component displaying the text can then be calculated, and the calculated ratio can be used as the text change information.
[0052] Input event change information is information about changes in the way users interact with the user interface due to text changes. For example, when a user cannot see the entire content, they may use manual input operations such as zooming and dragging to see the entire content. In this case, the user input will be significantly different from when the text is fully displayed. Based on this, the components that need to adjust the text display effect can be determined by obtaining input event change information. Optionally, input event change information includes but is not limited to change information of gesture events such as clicks, slides, and drags.
[0053] By obtaining at least one of the component layout change information, text change information and input event change information related to text changes, it is possible to use this information to accurately determine the components in the user interface that need to adjust the text display effect, and then process them accordingly.
[0054] Step 220: Determine a component to be adjusted in the user interface according to the interface change information, where the component to be adjusted is used to display the changed text.
[0055] Components to be adjusted are those whose text display needs to be improved based on interface change information. Components to be adjusted are used to display changed text and can be represented by components such as labels, text boxes, titles, drop-down menus, and cards.
[0056] For example, based on component layout change information, text change information, and input event change information, the required component width can be reverse-calculated using the font size of the changed text. By comparing this with the current component width and height, components requiring adjustment and with excessively long text can be screened out. Optionally, the components to be adjusted can be placed in a processing queue so that all components in the processing queue can be processed later.
[0057] Step 230: According to the text display attribute of the component to be adjusted, a target component display mode that matches the component to be adjusted is screened from a preset rule library, wherein the preset rule library includes multiple component display modes, and different component display modes correspond to different matching conditions.
[0058] A component display mode is a process that controls the display of a component according to the display effects specified by the mode. Different component display modes contain different processing processes. For example, a component display mode's processing processes may include: font processing, bubble processing, sliding gesture processing, scrolling playback processing, and other processes set to achieve the desired display effects.
[0059] In some embodiments of the present application, the multiple component display modes include: at least one of: a reduced font display mode, a bubble display mode, a sliding display mode, and a scrolling display mode.
[0060] The reduced font display mode is a display mode in which the text font is reduced for display. The reduced font display mode may include a process of reducing the font of the text.
[0061] Bubble display mode displays text in bubbles. This mode includes the process of creating, displaying, and hiding bubbles. Bubbles are used to display text.
[0062] The sliding display mode is a display mode that represents the corresponding sliding text operation through a sliding gesture. In the sliding display mode, the processing process of sliding the displayed text can be included according to the sliding direction and sliding amplitude value of the sliding gesture.
[0063] The scrolling display mode is a display mode that displays text in a scrolling manner. The scrolling display mode may include a process of scrolling the text horizontally or vertically at a certain speed.
[0064] The above four component display modes can effectively meet the compatibility of components with different attributes when the text changes. For example, for different types of components for ultra-long multilingual text, you can filter out any matching component display mode from the above four component display modes and process the component, allowing users to fully view the ultra-long text content.
[0065] Text display properties are properties related to the text display effect of the component to be adjusted. In some embodiments of the present application, text display properties may include, but are not limited to, at least one of: the text over-proportion of the component to be adjusted, the component height of the component to be adjusted, the input events contained in the component to be adjusted, and the input events contained in the parent component of the component to be adjusted. The text over-proportion is the ratio of the component size required for the changed text to the current component size of the component to be adjusted.
[0066] Based on the above text display attributes, optionally, the matching conditions for the reduced font display mode may include: a matching condition for text exceeding the scale. The matching conditions for the bubble display mode, the sliding display mode, or the scrolling display mode may include: a matching condition for text exceeding the scale, a matching condition for component height, and a matching condition for input events.
[0067] The matching conditions for text out of proportion, component height, and input events can vary in different component display modes. The conditions can be set based on the actual application's needs for text display and component compatibility.
[0068] For example, multiple different proportion ranges can be set for text exceeding the proportion, and the proportion ranges within which the text exceeding the proportion falls in the matching conditions of different component display modes can be the same or different.
[0069] For another example, a preset component height threshold may be set for component height, and the matching conditions of different component display modes may require that the component height be the same or different from the component height threshold.
[0070] For another example, a preset input event may be set for an input event, and the matching conditions of different component display modes may require that the components contain the same or different preset input events.
[0071] In the above four component display modes, an agreement can be made on the matching conditions corresponding to at least one of the text display attributes, including the matching conditions corresponding to text exceeding the proportion, the matching conditions corresponding to the component height, and the matching conditions corresponding to the input event. This allows the component to be processed based on the component display mode with better compatibility with the text exceeding the proportion, the component height, and the input event, thereby improving the text display effect.
[0072] Step 240: Process the component to be adjusted according to the target component display mode.
[0073] Since the target component display mode includes a processing procedure for controlling the component to display according to the display effect agreed upon by the mode, the component to be adjusted after processing can display the changed text through the new display mode, thereby improving the display effect of the changed text.
[0074] Figure 3 This is a flowchart of a user interface processing method provided by another embodiment of the first aspect of the present application. Different from other embodiments, step 220 in other embodiments is Figure 3 In the embodiment shown, it is specifically manifested as steps 3201 to 3206. Among them:
[0075] Step 3201: When the component layout change information is obtained, determine whether the component layout change information meets a preset component layout adjustment condition.
[0076] The preset component layout adjustment condition can be understood as a condition set on the degree of component layout change. For example, the degree of component layout change can be calculated based on the component layout change information. When the degree of component layout change reaches the degree of change required by the preset component layout adjustment condition, the condition is considered to be met.
[0077] Step 3202: If yes, determine that the component corresponding to the component layout change information is a component to be adjusted whose display mode needs to be adjusted.
[0078] Step 3203: When the text change information is obtained, determine the ratio of the component size required for the changed text to the component size of the component currently displaying the text, and judge whether the ratio meets the preset ratio adjustment condition.
[0079] The preset ratio adjustment condition can be understood as a condition set for the above ratio. For example, when the ratio exceeds a preset ratio threshold, the condition is considered to be satisfied.
[0080] Step 3204: If yes, determine that the component is a component to be adjusted whose display mode needs to be adjusted.
[0081] Step 3205: When the input event change information is obtained, determine whether the input event change information meets a preset input event adjustment condition.
[0082] Preset input event adjustment conditions can be conditions set by Li Jiwei for input events. For example, when an input event that meets the conditions occurs, the condition is considered satisfied. Input events can include, but are not limited to, mouse input events and gesture input events.
[0083] Step 3206: If yes, determine that the component corresponding to the input event change information is a component to be adjusted whose display mode needs to be adjusted.
[0084] In combination with the above-mentioned embodiments, component layout change information, text change information, and gesture event change information can be obtained by plugging. This embodiment filters out components to be adjusted based on these change information and corresponding conditions, so that components to be adjusted with text display problems can be accurately processed to improve the text display effect. For example: for the changed text content, the required component width is reversely calculated by the font size, and then compared with the current component size width and height to filter out components with overlong text display that need to be processed.
[0085] Figure 4 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application. Figure 4 The method provided in the embodiment shown is applied to an SDK. The SDK uses an instrumented automatic identification and screening module to filter out components to be adjusted, which may specifically include:
[0086] Step 400: The SDK obtains component layout change information, text change information and / or input event change information through an instrumented acquisition function.
[0087] Step 402: Determine whether component layout change information, text change information, and / or input event change information is obtained.
[0088] When the component layout change information and the text change information indicate that the component size and text have changed, the process proceeds to step 404 .
[0089] When the component layout change information indicates that the component layout mode has changed, the process proceeds to step 410 .
[0090] When the input event change information indicates that the gesture event has changed, the process proceeds to step 416 .
[0091] Step 404: Calculate the component width required for the font size of the changed text according to the text change information, and calculate the ratio of the component width required for the changed text to the current width of the current component.
[0092] Step 406: Determine whether the ratio satisfies a preset ratio adjustment condition.
[0093] Step 408: If yes, mark the current component as unprocessed.
[0094] Components marked as unprocessed are components to be adjusted.
[0095] If not, the process is abandoned.
[0096] Step 410: Calculate the component layout change degree according to the component layout change information.
[0097] Step 412: Determine whether the degree of component layout change satisfies a preset component layout adjustment condition.
[0098] Step 414: If yes, mark the current component of the layout change as unprocessed.
[0099] Step 416: Compare gesture event changes based on the input event change information.
[0100] Step 418: Determine whether the gesture event change satisfies a preset input event adjustment condition.
[0101] Step 420: If yes, mark the current component of the gesture event change as unprocessed.
[0102] Optionally, components marked as unprocessed for adjustment can be placed in a processing queue in step 422. The processing queue is used to manage these components, allowing them to be sequentially screened for target component display modes. Then, in step 424, the target component display mode is invoked to process the components. After processing is complete, a callback is used to mark the components as processed, updating the processing queue.
[0103] Figure 5a A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application. Figure 5a The method provided in the illustrated embodiment is applied to an SDK. The SDK uses an intelligent display processing module to take text display attributes (such as component objects and text content) as input parameters. Based on the input parameters, the SDK selects a target component display mode that matches the component to be adjusted from a preset rule library. The processing of the intelligent display processing module may specifically include:
[0104] Step 502: Traverse the component properties of the parent component and the component to be adjusted, such as the component size.
[0105] It is understandable that when the component to be adjusted is called, the text displayed by the component to be adjusted may change. At this time, the component to be adjusted needs to be processed. Therefore, the intelligent display processing module can respond to the call of the component to be adjusted and enter step 502.
[0106] Step 504: Read the gesture manager of the component to be adjusted, such as reading gesture events and / or horizontal sliding gesture events.
[0107] Step 506: Calculate the text excess ratio of the component to be adjusted.
[0108] Step 508: At least one of the text exceeding the proportion, component size, click gesture event, and horizontal sliding gesture event is conditionally judged based on the matching conditions of the four component display modes in the preset rule library, and the target component display mode that matches the component to be adjusted is screened out.
[0109] In some embodiments of the present application, the matching conditions corresponding to the reduced font display mode include: the text exceeds the proportion within a first preset proportion range;
[0110] The matching conditions corresponding to the bubble display mode include: the text exceeding ratio is within a second preset ratio range, and the lower limit of the second preset ratio range is greater than the upper limit of the first preset ratio range, the component height exceeds the preset component height threshold, the component to be adjusted and the parent component of the component to be adjusted do not contain click events, and the component to be adjusted and the parent component contain sliding input events in a preset direction; and / or, the text exceeding ratio is within a third preset ratio range, and the lower limit of the third preset ratio range is greater than the upper limit of the second preset ratio range, the component height exceeds the preset component height threshold, and the component to be adjusted and the parent component do not contain click events;
[0111] The matching conditions corresponding to the sliding display mode include: the text exceeding ratio is within the second preset ratio range, the component height exceeds the preset component height threshold, and the component to be adjusted and the parent component do not contain a sliding input event in a preset direction;
[0112] The matching condition corresponding to the scrolling display mode includes: when the component to be adjusted does not meet the matching conditions corresponding to other component display modes, the component to be adjusted matches the scrolling display mode.
[0113] The first preset ratio range may be a range smaller than a first preset ratio threshold.
[0114] The second preset ratio range may be a range that is greater than the first preset ratio threshold and less than or equal to the second preset ratio threshold.
[0115] The third preset ratio range may be a range greater than the second preset ratio threshold.
[0116] The first preset ratio threshold, the second preset ratio threshold, and the preset component height threshold can be set according to actual application needs.
[0117] For example, the matching conditions of the four component display modes can be understood by referring to the contents shown in Table 1 below.
[0118]
[0119] Table 1
[0120] In some embodiments, the preset rule library can be deployed on a remote server. When it is necessary to filter the target component display mode, the remote server can return the relevant thresholds in the preset rule library so that the matching process can be completed on the user terminal, thereby improving matching efficiency.
[0121] By matching the respective conditions of the four display modes in the above embodiment, the best display mode can be screened out more accurately for the component to be adjusted.
[0122] In some embodiments of the present application, based on the matching conditions of the four display modes, selecting a target component display mode that matches the component to be adjusted from a preset rule library according to the text display attributes of the component to be adjusted includes:
[0123] Determining whether the text exceeds the proportion that meets the first preset proportion range, the second preset proportion range, or the third preset proportion range, and obtaining a first determination result;
[0124] If the first judgment result is that the text exceeds the proportion and is within the first preset proportion range, determining that the target component display mode matched by the component to be adjusted is a reduced font display mode;
[0125] If the first judgment result is that the text exceeds the proportion within the second preset proportion range or the third preset proportion range, determining whether the component height of the component to be adjusted exceeds a preset component height threshold to obtain a second judgment result;
[0126] Determine whether the component to be adjusted or the parent component includes a click input event, and obtain a third determination result;
[0127] Determine whether the component to be adjusted or the parent component includes a sliding input event in the preset direction, and obtain a fourth determination result;
[0128] In a case where the first judgment result, the second judgment result, the third judgment result, and the fourth judgment result meet the matching condition corresponding to the bubble display mode, determining that the target component display mode matched by the component to be adjusted is the bubble display mode;
[0129] If the first judgment result, the second judgment result, and the fourth judgment result satisfy the matching condition corresponding to the sliding display mode, determining that the target component display mode matched by the component to be adjusted is the sliding display mode;
[0130] When the first judgment result, the second judgment result, the third judgment result and the fourth judgment result do not meet the matching conditions corresponding to the bubble display mode and the sliding display mode, it is determined that the target component display mode matched by the component to be adjusted is the scrolling playback display mode.
[0131] For example, the above screening process of screening target component display mode can be performed as follows: Figure 5b The decision model shown in the figure is used to implement it. Figure 5b The decision-making process diagram of the decision-making model of the component display mode shown in the figure includes:
[0132] The text exceeds the ratio with the first preset ratio threshold and the second preset ratio threshold to obtain a first judgment result. The first judgment result may include: the text exceeds the ratio ( Figure 5b X indicates that the text exceeds the proportion) is less than the first preset proportion threshold ( Figure 5b Threshold 1 represents the first preset ratio threshold), or the text exceeds the ratio greater than the first preset ratio threshold and less than or equal to the second preset ratio threshold ( Figure 5b Threshold 2 represents the second preset ratio threshold), or the text exceeds the ratio greater than the second preset ratio threshold.
[0133] Based on the first judgment result, determine whether to filter out the reduced font display mode. Figure 5b As shown, if X < threshold 1, the reduced font display mode is filtered out.
[0134] The component height is compared with a preset component height threshold to obtain a second judgment result. The second judgment result may include: the component height is greater than or equal to the component height threshold, or the component height is less than the component height threshold.
[0135] Based on the second judgment result, it is determined whether the component to be adjusted or the parent component includes a click input event to obtain a third judgment result. The third judgment result may include: including a click gesture, or not including a click gesture.
[0136] Based on the third judgment result, it is determined whether the component to be adjusted or the parent component contains a sliding input event in the preset direction to obtain a fourth judgment result. The fourth judgment result may include: containing a sliding input event in the preset direction, or not containing a sliding input event in the preset direction.
[0137] The preset direction can be any direction, such as horizontal, vertical, etc.
[0138] like Figure 5b As shown, based on the different trends of the second judgment result, the third judgment result and the fourth judgment result, the final decision model determines the component display mode to be screened. Figure 5b In the example, the reduced font display mode is represented by mode 1, the bubble display mode is represented by mode 2, the sliding display mode is represented by mode 3, and the scrolling display mode is represented by mode 4.
[0139] In this embodiment, the target component display model is screened based on the four-level judgment of the decision model, and the screening is accurate and efficient.
[0140] It should be noted that the screening process of the above-mentioned decision model is only used to provide a schematic illustration of the embodiments of the present application. In actual applications, no matter which judgment order of the screening process is adopted, as long as the text display attributes are filtered according to the matching conditions, the target component display mode that is compatible with the component to be adjusted can be filtered out from the preset rule library.
[0141] Next, combine Figure 6-Figure 9 , an exemplary description is given of the process of processing the component to be adjusted according to the target component display mode in step 240.
[0142] Figure 6 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application.
[0143] Figure 6 In the illustrated embodiment, when the target component display mode is the reduced font display mode, processing the component to be adjusted according to the target component display mode includes:
[0144] Step 6401: Calculate the reduction ratio of the changed text.
[0145] In addition, due to the amount of text content and font size in the component, the calculated reduction ratio may contain decimals. To facilitate font setting, the calculated reduction ratio needs to be rounded to an integer. When rounding up, to avoid rounding up and causing the font to become larger and displaying a thumbnail, the calculated reduction ratio is rounded down. This way, a whole number reduction ratio is obtained.
[0146] For example, the font size S1 that should be used when the changed text is fully displayed can be determined, and S1 is divided by the original font size S2 of the changed text to obtain the ratio by which the changed text should be reduced.
[0147] Step 6402: Set the font size of the text of the component to be adjusted according to the reduction ratio.
[0148] For example, Figure 7 As shown in the schematic diagram of the adjustment effect, the component to be adjusted 702 can display the complete text content after the font is adjusted.
[0149] Figure 8 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application.
[0150] Figure 8 In the illustrated embodiment, when the target component display mode is the bubble display mode, processing the component to be adjusted according to the target component display mode includes:
[0151] Step 8401: Capture the first input event.
[0152] Optionally, a first input event may be pre-added to the component to be adjusted. The first input event may originate from a user's input action on various input devices (such as a mouse, keyboard, touch screen, etc.), for example, a specified mouse input event or a specified gesture event.
[0153] By adding the first input event to the component to be adjusted, the component to be adjusted can respond to and process the first input event of the user.
[0154] Step 8402: When the first input event is captured, display a bubble.
[0155] Exemplarily, in the case where the first input event is a gesture event, in response to receiving the gesture event, the gesture parameters corresponding to the gesture event can be calculated, including but not limited to gesture amplitude, gesture duration, etc., to determine whether the gesture parameters meet the conditions for displaying bubbles, such as determining whether the gesture touch exceeds a pre-set number of milliseconds. If so, it is determined that the first input event is captured, and then a bubble is created and displayed.
[0156] Step 8403: When the first input event is not captured or the first input event ends, hide the bubble, which is used to display text.
[0157] For example, Figure 9 As shown in the schematic diagram of the adjustment effect, after the component to be adjusted 902 is processed, bubbles can be displayed, and text content can be displayed in the bubbles.
[0158] By capturing the incoming first input event, creating and displaying a bubble based on the first input event, text can be displayed in the bubble, allowing the user to see more complete text content, thereby improving the text display effect.
[0159] Figure 10 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application.
[0160] Figure 10 In the illustrated embodiment, when the target component display mode is the sliding display mode, processing the component to be adjusted according to the target component display mode includes:
[0161] Step 1041: Capture a sliding input event.
[0162] Optionally, a sliding input event can be pre-added to the component to be adjusted. The sliding input event can originate from a user's sliding input action on various input devices (such as a mouse, touch screen, etc.). For example, a sliding input event inputted using a mouse or a sliding gesture event inputted via touch.
[0163] By adding a sliding input event to the component to be adjusted, the component to be adjusted can respond to and process the user's sliding input event.
[0164] Step 1042: When a sliding input event is captured, the sliding amplitude value is calculated.
[0165] Exemplarily, when the sliding input event is a sliding gesture event, a sliding gesture event callback may be monitored, and when a sliding gesture event callback is monitored, the sliding amplitude value is calculated.
[0166] The sliding amplitude value can be calculated by continuously capturing the coordinates of the touch position.
[0167] Step 1043: Slide and display the text displayed by the component to be adjusted accordingly according to the sliding amplitude value.
[0168] For example, the direction of the text sliding can be the same as or opposite to the direction of the gesture sliding, which can be set according to the user's usage habits and is not limited by this application. Optionally, the text can be displayed by sliding according to the sliding direction and the sliding amplitude value.
[0169] For example, Figure 11 As shown in the schematic diagram of the adjustment effect, after the component to be adjusted 1102 is processed, the user can slide the text to make the text content slide accordingly, so as to see a more complete text content.
[0170] Figure 12 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application.
[0171] Figure 12 In the illustrated embodiment, when the target component display mode is the scrolling playback mode, processing the component to be adjusted according to the target component display mode includes:
[0172] Step 1241: Determine the text scrolling speed according to the text exceeding the proportion.
[0173] In this step, the text excess ratio of the changed text of the component to be adjusted can be calculated. The calculation method of the text excess ratio can refer to the implementation method of other embodiments and will not be repeated here.
[0174] Step 1242: Set a timer for the component to be adjusted according to the text scrolling speed.
[0175] A timer is used to control the scrolling speed of text in the component to be adjusted. This timer can be implemented as a method or function. For example, if the text scrolls at a speed of 16 milliseconds per word, a timer can be created and added, with the timer interval set to 16 milliseconds.
[0176] Step 1243: Use a timer to control the scrolling of the text displayed by the component to be adjusted.
[0177] Continuing with the previous example, after setting the timer interval to 16 milliseconds, the timer can be used to control the text in the component to be adjusted to scroll and play at a speed of one word in 16 milliseconds.
[0178] Step 1244: When the scrolling playback of the text displayed by the component to be adjusted is completed, remove the timer.
[0179] For example, Figure 13 As shown in the schematic diagram of the adjustment effect, after the component to be adjusted 1302 is processed, the text displayed by the component to be adjusted scrolls and plays, so that the user can see more complete text content.
[0180] Optionally, since the scrolling playback mode is more compatible with various components, when the component to be adjusted displays ultra-long text content, the scrolling playback mode can be used as a fallback display mode.
[0181] In some embodiments of the present application, the user interface processing method can be applied to the SDK. The SDK can be implemented by the display mode processing application module. Figure 6-Figure 13 The processing process of the four component display modes shown in the figure returns the processing results to the target application through the SDK kit callback processing module.
[0182] When the target component display mode is the reduced font display mode, the processing result may include: a first status code corresponding to the completion of the processing, a reduced font display mode flag, and a font size. For example, as shown in Table 2 below, the first status code may be "0," indicating that the processing is complete; the reduced font display mode flag may be "1."
[0183] When the target component display mode is the bubble display mode, the processing result may include: a status code corresponding to the processing state, a bubble display mode identifier, and the first input event information, wherein the status code corresponding to the processing state includes: a second status code corresponding to processing completion, or a third status code corresponding to bubble display, or a fourth status code corresponding to bubble hiding. For example, as shown in Table 2 below, the second status code may take the value "0", indicating that processing is complete, the third status code may take the value "1", indicating that the bubble is displayed, and the fourth status code may take the value "2", indicating that the bubble is hidden; the bubble display mode identifier may take the value "2"; and the first input event information may be expressed as gesture event callback information.
[0184] If the target component display mode is sliding display mode, the processing result may include: a fifth status code corresponding to processing completion, a sliding display mode identifier, and sliding input event information. For example, as shown in Table 2 below, the fifth status code may be "0," indicating processing completion; the sliding display mode identifier may be "3"; and the sliding input event information may be represented as sliding event callback information.
[0185] When the target component display mode is scrolling mode, the processing result may include: the sixth status code corresponding to the processing completion, the scrolling mode identifier, and the scrolling completion event information. For example, as shown in Table 2 below, the sixth status code may be "0", indicating that the processing is complete; the scrolling mode identifier may be "4"; and the scrolling completion event information may indicate that the scrolling is complete.
[0186] Among them, the specific values of the first status code, the second status code, the third status code, the fourth status code, the fifth status code, and the sixth status code can be the same or different, and can be set according to actual application needs, as long as the value of the status code can express the corresponding processing status. The specific values of the reduced font display mode identifier, the bubble display mode identifier, the sliding display mode identifier, and the scrolling playback mode identifier are different, and are used to uniquely represent the corresponding component display mode, so that the target application can perform related processing more accurately according to the mode identifier.
[0187]
[0188] Table 2
[0189] In addition, the presentation mode processing application module may also return exception information when an error occurs during the processing, including an error status code such as "-1" and the content of the error message.
[0190] The SDK will call back the processing results of the component to be adjusted to the target application, so that the target application can perform relevant processing based on the processing results and improve the consistency of the target application data and functions.
[0191] Below, an exemplary description is given of the user interface processing method provided in the embodiment of the present application being applied to an intelligent display SDK kit implemented by SDK.
[0192] Figure 14 The figure shows the structure of the intelligent display SDK kit provided by the first embodiment of the present application. Figure 14 As shown, the intelligent display SDK suite 1400 connected to the target application includes: an instrumented automatic identification and screening module 1402, an intelligent display processing module 1404, a display mode processing application module 1406, a preset rule library 1408, and an SDK suite callback processing module 1410.
[0193] The processing of the instrumented automatic identification and screening module 1402 can refer to Figure 4 The implementation of the embodiment shown is omitted here for brevity.
[0194] The processing process of the intelligent display processing module 1404 can refer to Figure 5a The implementation of the embodiment shown is omitted here for brevity.
[0195] The processing of the display mode processing application module 1406 can refer to Figure 6-Figure 13 The implementation of the embodiment shown is not described in detail here.
[0196] The SDK callback processing module 1410 returns the processing result of the component to be adjusted to the target application.
[0197] In the case of language switching in a multilingual user interface, the intelligent display SDK suite 1400 can obtain component layout change information, text change information, input event change information, etc. of the component through the plug-in automatic identification and screening module 1402, automatically determine the component to be adjusted, and pass the component to be adjusted that needs to be processed to the intelligent display processing module 1404. The intelligent display processing module 1404 matches the best target component display mode according to the matching conditions of the preset rule library, and passes the mode parameters of the target component display mode to the display mode processing application module 1406. The display mode processing application module 1406 processes the component to be adjusted according to the passed-in mode parameters to enhance the visual effect of the text, and returns the processing results to the target application through the SDK suite callback processing module 1410 to facilitate the target application to perform other related processing.
[0198] A second aspect of the present application provides a user interface processing device. Figure 15 This is a structural diagram of a user interface processing device provided in an embodiment of the second aspect of the present application. Figure 15 As shown, the user interface processing device 1500 may include:
[0199] The acquisition module 1510 is configured to acquire interface change information related to text changes according to text changes in the user interface.
[0200] The determination module 1520 is configured to determine a component to be adjusted in the user interface according to the interface change information, where the component to be adjusted is used to display the changed text.
[0201] The matching module 1530 is used to filter out a target component display mode that matches the component to be adjusted from a preset rule library according to the text display attribute of the component to be adjusted. The preset rule library includes multiple component display modes, and different component display modes correspond to different matching conditions.
[0202] The processing module 1540 is configured to process the component to be adjusted according to the target component display mode.
[0203] Optionally, the acquisition module 1510 further includes:
[0204] The component change acquisition submodule is used to acquire component layout change information related to text changes based on text changes in the user interface.
[0205] The text change acquisition submodule is used to acquire text change information according to the text change of the user interface.
[0206] The event change acquisition submodule is used to acquire input event change information according to text changes in the user interface.
[0207] Optionally, the determining module 1520 further includes:
[0208] a layout judgment submodule for, upon obtaining the component layout change information, judging whether the component layout change information satisfies a preset component layout adjustment condition; and if so, determining that the component corresponding to the component layout change information is a component to be adjusted whose display mode needs to be adjusted;
[0209] a ratio determination submodule for determining, upon obtaining the text change information, a ratio between a component size required for the changed text and a component size of a component currently displaying the text, and determining whether the ratio satisfies a preset ratio adjustment condition; if so, determining that the component is a component to be adjusted whose display mode needs to be adjusted;
[0210] The condition judgment submodule is used to judge whether the input event change information meets the preset input event adjustment condition when the input event change information is obtained. If so, it is determined that the component corresponding to the input event change information is a component to be adjusted whose display mode needs to be adjusted.
[0211] Optionally, in the matching module 1530 , the multiple component display modes include at least one of a reduced font display mode, a bubble display mode, a sliding display mode, and a scrolling display mode.
[0212] Optionally, in the matching module 1530, the text display attribute includes: at least one of a text excess ratio of the component to be adjusted, a component height of the component to be adjusted, input events included in the component to be adjusted, and input events included in a parent component of the component to be adjusted, wherein the text excess ratio is a ratio of a component size required for the changed text to a current component size of the component to be adjusted;
[0213] The matching conditions corresponding to the reduced font display mode include: matching conditions corresponding to the text exceeding the proportion;
[0214] The matching conditions corresponding to the bubble display mode, the sliding display mode or the scrolling display mode include: the matching conditions corresponding to the text exceeding the proportion, the matching conditions corresponding to the component height, and the matching conditions corresponding to the input event.
[0215] Optionally, in the matching module 1530 , the matching condition corresponding to the reduced font display mode includes: the text exceeding the proportion is within a first preset proportion range;
[0216] The matching conditions corresponding to the bubble display mode include: the text exceeding ratio is within a second preset ratio range, and the lower limit of the second preset ratio range is greater than the upper limit of the first preset ratio range, the component height exceeds the preset component height threshold, the component to be adjusted and the parent component of the component to be adjusted do not contain click events, and the component to be adjusted and the parent component contain sliding input events in a preset direction; and / or, the text exceeding ratio is within a third preset ratio range, and the lower limit of the third preset ratio range is greater than the upper limit of the second preset ratio range, the component height exceeds the preset component height threshold, and the component to be adjusted and the parent component do not contain click events;
[0217] The matching conditions corresponding to the sliding display mode include: the text exceeding ratio is within the second preset ratio range, the component height exceeds the preset component height threshold, and the component to be adjusted and the parent component do not contain a sliding input event in a preset direction;
[0218] The matching condition corresponding to the scrolling display mode includes: when the component to be adjusted does not meet the matching conditions corresponding to other component display modes, the component to be adjusted matches the scrolling display mode.
[0219] Optionally, the matching module 1530 includes:
[0220] a text ratio determination submodule, configured to determine whether the text exceeding the ratio conforms to the first preset ratio range, the second preset ratio range, or the third preset ratio range, and obtain a first determination result;
[0221] A reduced font display submodule is configured to determine that the target component display mode matched by the component to be adjusted is a reduced font display mode when the first judgment result is that the text exceeds the proportion and conforms to the first preset proportion range;
[0222] a component height determination submodule, configured to, when the first determination result is that the text exceeds the proportion within the second preset proportion range or the third preset proportion range, determine whether the component height of the component to be adjusted exceeds a preset component height threshold, thereby obtaining a second determination result;
[0223] A click event judgment submodule is used to judge whether the component to be adjusted or the parent component contains a click input event, and obtain a third judgment result;
[0224] a sliding input judgment submodule, configured to judge whether the component to be adjusted or the parent component includes a sliding input event in the preset direction, and obtain a fourth judgment result;
[0225] a bubble display submodule, configured to determine that the target component display mode matched by the component to be adjusted is the bubble display mode if the first judgment result, the second judgment result, the third judgment result, and the fourth judgment result satisfy a matching condition corresponding to the bubble display mode;
[0226] a sliding display submodule, configured to determine that the target component display mode matched by the component to be adjusted is the sliding display mode if the first judgment result, the second judgment result, and the fourth judgment result satisfy a matching condition corresponding to the sliding display mode;
[0227] The scrolling playback submodule is used to determine that the target component display mode matched by the component to be adjusted is the scrolling playback display mode when the first judgment result, the second judgment result, the third judgment result and the fourth judgment result do not meet the matching conditions corresponding to the bubble display mode and the sliding display mode.
[0228] Optionally, the processing module 1540 includes:
[0229] A font reduction processing submodule is used to calculate the reduction ratio of the changed text when the target component display mode is the font reduction display mode, and set the font size of the text of the component to be adjusted according to the reduction ratio;
[0230] a bubble display processing submodule, configured to capture a first input event when the target component display mode is the bubble display mode, display a bubble when the first input event is captured, and hide the bubble when the first input event is not captured or the first input event ends, wherein the bubble is used to display text;
[0231] A sliding display processing submodule is used to capture a sliding input event when the target component display mode is the sliding display mode, calculate a sliding amplitude value when the sliding input event is captured, and slide and display the text displayed by the component to be adjusted accordingly according to the sliding amplitude value;
[0232] The scrolling playback processing submodule is used to determine the text scrolling speed according to the text exceeding the proportion when the target component display mode is the scrolling playback mode, set a timer for the component to be adjusted according to the text scrolling speed, control the scrolling playback of the text displayed by the component to be adjusted through the timer, and remove the timer when the scrolling playback of the text displayed by the component to be adjusted is completed.
[0233] Optionally, the device may further include:
[0234] A callback submodule, configured to call back the processing result of the component to be adjusted to the target application;
[0235] Wherein, when the target component display mode is the reduced font display mode, the processing result includes: a first status code corresponding to the completion of the processing, a reduced font display mode identifier, and the font size;
[0236] When the target component display mode is the bubble display mode, the processing result includes: a status code corresponding to the processing state, a bubble display mode identifier, and the first input event information, wherein the status code corresponding to the processing state includes: a second status code corresponding to processing completion, a third status code corresponding to bubble display, or a fourth status code corresponding to bubble hiding;
[0237] In the case where the target component display mode is a sliding display mode, the processing result includes: a fifth status code corresponding to the processing completion, a sliding display mode identifier, and sliding input event information;
[0238] In the case where the target component display mode is the scrolling play mode, the processing result includes: a sixth status code corresponding to the processing completion, a scrolling play mode identifier, and scrolling completion event information.
[0239] Through the device provided in the embodiment of the present application, interface change information related to the text change is obtained according to the text change of the user interface, and the component to be adjusted in the user interface for displaying the changed text is determined according to the interface change information. Since the preset rule library includes multiple component display modes, the matching conditions corresponding to different component display modes are different. Therefore, the device provided in the embodiment of the present application can automatically be compatible with different types of components, and according to the text display attributes of the component to be adjusted, the target component display mode that matches the component to be adjusted is screened out from the preset rule library. The target component display mode can be automatically compatible based on the text display attributes, so that the component to be adjusted is processed according to the target component display mode, so that the processed component to be adjusted can automatically and compatibly display the changed text through the new display mode, thereby improving the display effect of the changed text, for example, allowing the user to fully see the text content that has become too long due to language switching.
[0240] The third aspect of the present application also provides a user interface processing device. Figure 16 This is a structural diagram of a user interface processing device provided in one embodiment of the present application. Figure 16 As shown, the user interface processing device 1600 includes a memory 1601 , a processor 1602 , and a computer program stored in the memory 1601 and executable on the processor 1602 .
[0241] In some examples, the processor 1602 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0242] The memory 1601 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 1601 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these.
[0243] The memory 1601 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the user interface processing method according to the embodiments of the present application.
[0244] The processor 1602 reads the executable program code stored in the memory 1601 to run a computer program corresponding to the executable program code, so as to implement the user interface processing method in the above embodiment.
[0245] In some examples, the user interface processing device 1600 may further include a communication interface 1603 and a bus 1604. Figure 16 As shown, the memory 1601, the processor 1602, and the communication interface 1603 are connected via a bus 1604 and communicate with each other.
[0246] The communication interface 1603 is mainly used to implement communication between the modules, devices, units and / or devices in the embodiment of the present application. Input devices and / or output devices can also be connected through the communication interface 1603.
[0247] The bus 1604 includes hardware, software, or both that couples the components of the user interface processing device 1600 to each other. By way of example, and not limitation, the bus 1604 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of the above. Where appropriate, the bus 1604 may include one or more buses. Although embodiments herein describe and illustrate a particular bus, this application contemplates any suitable bus or interconnect.
[0248] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the user interface processing method in the above-mentioned embodiment can be implemented, and the same technical effect can be achieved. To avoid repetition, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which is not limited here.
[0249] The present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the user interface processing method in the above embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0250] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For device embodiments, equipment embodiments, and computer-readable storage medium embodiments, the relevant parts can be referred to the description part of the method embodiment. This application is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of this application. In addition, for the sake of brevity, a detailed description of known method technologies is omitted here.
[0251] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed via the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. This processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or the flowchart and the combination of the boxes in the block diagram and / or the flowchart can also be implemented by the dedicated hardware that performs the specified function or action, or can be implemented by the combination of dedicated hardware and computer instructions.
[0252] Those skilled in the art should understand that the above embodiments are illustrative rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on a study of the drawings, the specification and the claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other devices or steps; the quantifier "one" does not exclude a plurality; the terms "first" and "second" are used to identify names rather than to indicate any specific order. Any figure marks in the claims should not be understood as limiting the scope of protection. The functions of multiple parts appearing in the claims can be implemented by a separate hardware or software module. The fact that certain technical features appear in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.
Claims
1. A user interface processing method, characterized in that: include: According to the text changes of the user interface, obtain the interface change information related to the text changes; Determining, according to the interface change information, a component to be adjusted in the user interface, wherein the component to be adjusted is used to display the changed text; According to the text display properties of the component to be adjusted, a target component display mode that matches the component to be adjusted is screened from a preset rule library, the preset rule library including a plurality of component display modes, and different component display modes correspond to different matching conditions, the text display properties including at least one of the text exceeding the proportion of the component to be adjusted, the component height of the component to be adjusted, the input events included in the component to be adjusted, and the input events included in the parent component of the component to be adjusted; Process the component to be adjusted according to the target component display mode.
2. The method according to claim 1, characterized in that The acquiring of interface change information related to the text change according to the text change of the user interface includes: According to the text change of the user interface, at least one of component layout change information, text change information, and input event change information related to the text change is acquired.
3. The method according to claim 2, characterized in that The determining, according to the interface change information, components to be adjusted in the user interface includes: When the component layout change information is obtained, determining whether the component layout change information satisfies a preset component layout adjustment condition, and if so, determining that the component corresponding to the component layout change information is a component to be adjusted whose display mode needs to be adjusted; When the text change information is obtained, determining the ratio of the component size required for the changed text to the component size of the component currently displaying the text, and judging whether the ratio meets a preset ratio adjustment condition; if so, determining that the component is a component to be adjusted whose display mode needs to be adjusted; When the input event change information is obtained, it is determined whether the input event change information meets the preset input event adjustment condition. If so, it is determined that the component corresponding to the input event change information is a component to be adjusted whose display mode needs to be adjusted.
4. The method according to any one of claims 1 to 3, characterized in that The multiple component display modes include: at least one of: a reduced font display mode, a bubble display mode, a sliding display mode and a scrolling display mode.
5. The method according to claim 4, characterized in that The text excess ratio is the ratio of the component size required for the changed text to the current component size of the component to be adjusted; The matching conditions corresponding to the reduced font display mode include: matching conditions corresponding to the text exceeding the proportion; The matching conditions corresponding to the bubble display mode, the sliding display mode or the scrolling display mode include: the matching conditions corresponding to the text exceeding the proportion, the matching conditions corresponding to the component height, and the matching conditions corresponding to the input event.
6. The method according to claim 5, characterized in that The matching conditions corresponding to the reduced font display mode include: the text exceeding the ratio is within a first preset ratio range; The matching conditions corresponding to the bubble display mode include: the text exceeding ratio is within a second preset ratio range, and the lower limit of the second preset ratio range is greater than the upper limit of the first preset ratio range, the component height exceeds the preset component height threshold, the component to be adjusted and the parent component of the component to be adjusted do not contain click events, and the component to be adjusted and the parent component contain sliding input events in a preset direction; and / or, the text exceeding ratio is within a third preset ratio range, and the lower limit of the third preset ratio range is greater than the upper limit of the second preset ratio range, the component height exceeds the preset component height threshold, and the component to be adjusted and the parent component do not contain click events; The matching conditions corresponding to the sliding display mode include: the text exceeding ratio is within the second preset ratio range, the component height exceeds the preset component height threshold, and the component to be adjusted and the parent component do not contain a sliding input event in a preset direction; The matching condition corresponding to the scrolling display mode includes: when the component to be adjusted does not meet the matching conditions corresponding to other component display modes, the component to be adjusted matches the scrolling display mode.
7. The method according to claim 6, characterized in that The step of selecting a target component display mode that matches the component to be adjusted from a preset rule library according to the text display attribute of the component to be adjusted includes: Determining whether the text exceeds the proportion that meets the first preset proportion range, the second preset proportion range, or the third preset proportion range, and obtaining a first determination result; If the first judgment result is that the text exceeds the proportion and is within the first preset proportion range, determining that the target component display mode matched by the component to be adjusted is a reduced font display mode; If the first judgment result is that the text exceeds the proportion within the second preset proportion range or the third preset proportion range, determining whether the component height of the component to be adjusted exceeds a preset component height threshold to obtain a second judgment result; Determine whether the component to be adjusted or the parent component includes a click input event, and obtain a third determination result; Determine whether the component to be adjusted or the parent component includes a sliding input event in the preset direction, and obtain a fourth determination result; In a case where the first judgment result, the second judgment result, the third judgment result, and the fourth judgment result meet the matching condition corresponding to the bubble display mode, determining that the target component display mode matched by the component to be adjusted is the bubble display mode; If the first judgment result, the second judgment result, and the fourth judgment result satisfy the matching condition corresponding to the sliding display mode, determining that the target component display mode matched by the component to be adjusted is the sliding display mode; When the first judgment result, the second judgment result, the third judgment result and the fourth judgment result do not meet the matching conditions corresponding to the reduced font display mode, the bubble display mode and the sliding display mode, it is determined that the target component display mode matched by the component to be adjusted is the scrolling playback display mode.
8. The method according to claim 4, characterized in that The processing of the component to be adjusted according to the target component display mode includes: When the target component display mode is a reduced font display mode, calculating a reduction ratio of the changed text, and setting a font size of the text of the component to be adjusted according to the reduction ratio; When the target component display mode is a bubble display mode, capturing a first input event, displaying a bubble when the first input event is captured, and hiding the bubble when the first input event is not captured or the first input event ends, and the bubble is used to display text; When the target component display mode is a sliding display mode, capturing a sliding input event, calculating a sliding amplitude value when the sliding input event is captured, and slidingly displaying the text displayed by the component to be adjusted according to the sliding amplitude value; When the target component display mode is a scrolling playback mode, the text scrolling speed is determined according to the text exceeding the proportion, a timer is set for the component to be adjusted according to the text scrolling speed, and the scrolling playback of the text displayed by the component to be adjusted is controlled by the timer. When the scrolling playback of the text displayed by the component to be adjusted is completed, the timer is removed.
9. The method according to claim 8, characterized in that The method is applied to an SDK, and the SDK is connected to a target application; After processing the component to be adjusted, the method further includes: Calling back the processing result of the component to be adjusted to the target application; Wherein, when the target component display mode is the reduced font display mode, the processing result includes: a first status code corresponding to the completion of the processing, a reduced font display mode identifier, and the font size; When the target component display mode is the bubble display mode, the processing result includes: a status code corresponding to the processing state, a bubble display mode identifier, and first input event information, wherein the status code corresponding to the processing state includes: a second status code corresponding to processing completion, a third status code corresponding to bubble display, or a fourth status code corresponding to bubble hiding; In the case where the target component display mode is a sliding display mode, the processing result includes: a fifth status code corresponding to the processing completion, a sliding display mode identifier, and sliding input event information; In the case where the target component display mode is the scrolling play mode, the processing result includes: a sixth status code corresponding to the processing completion, a scrolling play mode identifier, and scrolling completion event information.
10. A user interface processing device, characterized in that: The device comprises: The acquisition module is used to obtain interface change information related to text changes based on text changes in the user interface; a determination module, configured to determine a component to be adjusted in the user interface according to the interface change information, wherein the component to be adjusted is used to display the changed text; a matching module, configured to filter out a target component display mode that matches the component to be adjusted from a preset rule library based on the text display properties of the component to be adjusted, the preset rule library including a plurality of component display modes, different component display modes corresponding to different matching conditions, the text display properties including at least one of a text out-of-proportion of the component to be adjusted, a component height of the component to be adjusted, input events included in the component to be adjusted, and input events included in a parent component of the component to be adjusted; A processing module is used to process the component to be adjusted according to the target component display mode.
11. A user interface processing device, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the user interface processing method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the user interface processing method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the user interface processing method according to any one of claims 1 to 9 when executed by a processor.
Citation Information
Patent Citations
Multi-language interface display adjusting method and device, electronic equipment and storage medium
CN116775198A