User interface processing method and device, equipment, storage medium and program product
By obtaining text change information in the user interface, filtering and applying suitable component display modes, the problem of poor display effect for text over long periods due to language switching is solved, achieving more efficient text display and reducing development costs.
Patent Information
- Application Number
- CN202411954532.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The prior art is ineffective when displaying text that has become too long due to language switching and other reasons. It is usually displayed through abbreviation or ellipsis, which makes the user unable to see the complete content, affecting the efficiency of information acquisition.
By obtaining interface change information related to text changes in the user interface, determining the components to be adjusted, and according to their text display attributes, the matching target component display mode is filtered out from the preset rule base, and processing the components to be adjusted to automatically be compatible with the new display mode.
Improve the display effect of changing text, allowing users to fully see the super long text content, while reducing development costs and improving processing efficiency.
Smart Images

Figure CN119759478A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a user interface processing method, device, equipment, storage medium and program product. Background Art
[0002] With the development of computer technology, various applications have emerged, and the user interface of applications has become an important source of information for users. However, due to language switching and other reasons, the text that needs to be displayed in the user interface sometimes changes, such as when the text is too long. At present, in response to this problem, various applications only abbreviate or display the overlong text content in the form of ellipsis, resulting in users being unable to see the complete content, affecting the efficiency of users obtaining information.
[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 a first aspect, an embodiment of the present application provides a user interface processing method, comprising: 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, the component to be adjusted being used to display the changed text; based on the text display attribute 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 based on the target component display mode.
[0006] In a second aspect, an embodiment of the present application provides a user interface processing device, the device comprising: an acquisition module, used to acquire interface change information related to text changes according to text changes in the user interface; a determination module, used to determine a component to be adjusted in the user interface according to the interface change information, the component to be adjusted being used to display the changed text; a matching module, 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 comprising multiple component display modes, and different component display modes correspond to different matching conditions; a processing module, used to process 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, the user interface processing method described in the first aspect is implemented.
[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 according to text changes in the user interface, and determines a component to be adjusted in the user interface for displaying changed text according to the interface change information. Since the preset rule library includes multiple component display modes, different component display modes correspond to different matching conditions. Therefore, the method provided in the embodiment of the present application can be automatically compatible with different types of components. According to the text display attributes of the component to be adjusted, a target component display mode matching 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. 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 problem of a single component, which effectively reduces the development cost and improves the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solution 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 It is one of the flow charts of the user interface processing method provided by 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 the first embodiment of the first aspect of the present application;
[0016] Figure 5a This is the fourth flowchart of the user interface processing method provided by an embodiment of the first aspect of the present application;
[0017] Figure 5b It 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 by the first embodiment of the first aspect of the present application;
[0021] Fig. 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] Fig.10 This is the seventh flowchart of the user interface processing method provided by the first embodiment of the first aspect of the present application;
[0023] Fig.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] Fig.12 This is the eighth flowchart of the user interface processing method provided by the first embodiment of the first aspect of the present application;
[0025] Fig.13 This is the fourth schematic diagram of the adjustment effect provided by an embodiment of the first aspect of the present application;
[0026] Fig.14 It is a structural diagram of an intelligent display SDK kit provided in an embodiment of the first aspect of the present application;
[0027] Fig.15 is a structural diagram of a user interface processing device provided in an embodiment of the second aspect of the present application;
[0028] Fig.16 It is a structural diagram of a user interface processing device provided in an embodiment of the third aspect of the present 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 intended only 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 only to provide a better understanding of the present application by showing examples of the present application. It should be noted that the acquisition, storage, use, and processing of information and data in the embodiments of the present application are authorized by users or relevant agencies, in compliance with the relevant provisions of national laws and regulations.
[0030] At present, due to reasons such as switching of the user interface language, the text displayed in the user interface sometimes changes, such as when the text is too long. To address this problem, various applications only display the overlong text content in the form of abbreviations or ellipsis, which prevents users from seeing the complete content and affects the efficiency of users in obtaining information. Based on this, there is currently a problem of poor display effect when displaying changing text.
[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 according to text changes in the user interface, and determines the component to be adjusted of the changed text in the user interface according to the interface change information. Since the preset rule library includes multiple component display modes, different component display modes correspond to different matching conditions. Therefore, the method provided in the embodiment of the present application filters out a target component display mode that matches the component to be adjusted from the preset rule library according to the text display attribute 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 extra long 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 an 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 (Software Development Kit, SDK). 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 according to text changes in the user interface, and determine the component to be adjusted 108 in the user interface according to the interface change information. The component to be adjusted 108 is used to display text. According to the text display attribute of the component to be adjusted 108, a target component display mode that matches the component to be adjusted 108 is screened out from a 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, filter out the target component display mode that matches the component to be adjusted 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 is 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, displaying the text through bubbles allows 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 a 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 subject 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 by 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 a collection of interface elements for the application to interact with the user. The user's interactive operations on the user interface include but are not limited to: click, slide, drag and other operations.
[0044] Interface elements include but are not limited to various forms of components such as input, output, navigation, and containers, including components for displaying text. Components for displaying text may include but are not limited to: labels, text boxes, titles, drop-down menus, cards, and other components.
[0045] Exemplarily, when the method provided in the embodiment of the present application is applied to SDK and the SDK is connected to the target application, the plug-in 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 collects interface change information related to text changes by inserting additional monitoring or diagnostic code into the code. For example, monitoring code can be inserted into key locations in the code of the target application to obtain interface change information related to text changes. The key locations can be related to the components of the text to be monitored.
[0047] Text changes may include changes in language switching, changes in different text contents in the same language, and any other forms of text changes. As long as the text changes cause problems in the display of text by the component used to display text, the method provided in the embodiment of the present application can be used 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 obtained.
[0050] Component layout change information is the change information of the components on the user interface layout caused by text changes. For example, when the text changes and the text cannot be fully displayed in the component, the component position may move. Based on this, the component that needs to adjust the text display effect can be determined by obtaining the component layout change information. Optionally, the component layout change information includes but is not limited to component size change information, component position movement change information, etc.
[0051] Text change information is information about changes in the text itself caused by text changes. Optionally, the text change information includes, but is not limited to, changes in the number of words in the text, changes in the text format, etc. Exemplarily, the required component width of the changed text can be calculated based on the font size of the changed text, and the ratio of the required component width to the current actual width of the component displaying the text can 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 complete content, they may use manual input operations such as zooming and dragging to see the complete content. In this case, the user input will change significantly compared to when the text can be fully displayed. Based on this, the component that needs 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 component layout change information, text change information, and input event change information related to text changes, it is possible to accurately determine the components in the user interface that need to adjust the text display effect with the help of this information, and then process them accordingly.
[0054] Step 220: Determine the 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] The components to be adjusted are components that need to improve the text display effect, as determined from the user interface based on interface change information. The components to be adjusted are components used to display changed text, and can be represented as labels, text boxes, titles, drop-down menus, cards, and other components.
[0056] For example, based on the component layout change information, text change information, and input event change information, the required component width can be reversely calculated by the font size of the changed text, and by comparing it with the current component size width and height, the components to be adjusted that need to be processed and have excessively long text display can be screened out. Optionally, the components to be adjusted can be put into a processing queue so that all components to be adjusted 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 matching the component to be adjusted is screened out 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] The component display mode is a process of controlling the display of the component according to the display effect agreed upon by the mode. Different component display modes contain different processing processes. For example, the processing process of the component display mode may include: a font processing process, a bubble processing process, a sliding gesture processing process, a scrolling playback processing process, etc., which are set to achieve the display effect.
[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] The bubble display mode is a display mode that represents the display of text through bubbles. In the bubble display mode, the process of creating, displaying, and hiding bubbles can be included. Bubbles are used to display text.
[0062] The sliding display mode is a display mode that represents the corresponding sliding text operation through the sliding gesture. In the sliding display mode, the processing process of sliding display text according to the sliding direction and sliding amplitude value of the sliding gesture may be included.
[0063] The scrolling display mode is a display mode that represents displaying 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 multi-language texts, you can select any matching component display mode from the above four component display modes to process the component, so that users can see the ultra-long text content in full.
[0065] The text display attribute is an attribute related to the text display effect of the component to be adjusted. In some embodiments of the present application, the text display attribute may include, but is not limited to: at least one of the following: the text exceeding the 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. Among them, the text exceeding 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 corresponding to the reduced font display mode may include: matching conditions corresponding to text exceeding the proportion. The matching conditions corresponding to the bubble display mode, the sliding display mode or the scrolling display mode include: matching conditions corresponding to text exceeding the proportion, matching conditions corresponding to the component height, and matching conditions corresponding to the input event.
[0067] The matching conditions for text exceeding the proportion, component height, and input events may have different corresponding condition contents in different component display modes. The condition contents can be set according to the needs of text display effects and component compatibility in actual applications.
[0068] For example, a variety of different proportion ranges can be set for text exceeding the proportion, and the proportion ranges that the text exceeding the proportion falls into 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 the component height, and the matching conditions of different component display modes may require that the component height be the same or different in size compared to the component height threshold.
[0070] For another example, a preset input event may be set for an input event, and the preset input events required to be included in the components in the matching conditions of different component display modes may be the same or different.
[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 display mode with better compatibility with the component to be screened out based on the text exceeding the proportion, the component height, and the input event, so as to process the component and improve 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 illustrated embodiment, 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 satisfies a preset component layout adjustment condition.
[0076] The preset component layout adjustment condition can be understood as a condition set for the component layout change degree. For example, the component layout change degree can be calculated based on the component layout change information, and when the component layout change degree reaches the change degree required by the preset component layout adjustment condition, the condition is considered to be satisfied.
[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, it is considered that the condition is 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 satisfies a preset input event adjustment condition.
[0082] The preset input event adjustment conditions can be the conditions set by Li Jiwei for the input events. For example, when the input event required by the condition occurs, the condition is considered to be satisfied. The input events can include but are not limited to: mouse input events, 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 foregoing embodiments, component layout change information, text change information, and gesture event change information can be obtained by plugging in. 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 text display effects. For example: for the changed text content, the required component width is reversely calculated through 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 illustrated embodiment is applied to SDK. The SDK selects the components to be adjusted through the plug-in automatic identification and screening module, 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 goes to step 404 .
[0089] When the component layout change information indicates that the component layout mode has changed, the process goes 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 aborted.
[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 according to 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, the components to be adjusted that are marked as unprocessed can be put into a processing queue in step 422. The processing queue is used to manage these components to be adjusted so as to filter the target component display mode for these components to be adjusted in order, and then in step 424, the target component display mode is called to process the components to be adjusted. After the processing is completed, the components to be adjusted are modified and marked as processed through a callback so as to update the queue to be processed.
[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 SDK. The SDK uses the text display attributes (such as component objects and text content information) as input parameters through the intelligent display processing module, and selects the target component display mode that matches the component to be adjusted from the preset rule library based on the input parameters. The processing process 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, and 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 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 matching 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 the 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 the 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 expressed as a range 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 expressed as 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 requirements.
[0117] Exemplarily, the matching conditions of the four component display modes can be understood by referring to the contents shown in the following Table 1.
[0118]
[0119] Table 1
[0120] In some embodiments, a 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 the matching efficiency.
[0121] Through the matching 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 above four display modes, the target component display mode matching the component to be adjusted is screened out from a preset rule library according to the text display attribute of the component to be adjusted, including:
[0123] Determine 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 obtain a first determination result;
[0124] When the first judgment result is that the text exceeds the proportion and conforms to 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] When the first judgment result is that the text exceeds the proportion within the second preset proportion range or the third preset proportion range, judging whether the component height of the component to be adjusted exceeds the preset component height threshold, and obtaining 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 the 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] In a case where 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] Exemplarily, 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 this. 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 exceeding ratio is compared 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 exceeding ratio ( Figure 5b X indicates that the text exceeds the proportion) is less than the first preset proportion threshold ( Figure 5b In the example, 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 judged whether the component to be adjusted or the parent component contains a click input event to obtain a third judgment result. The third judgment result may include: containing a click gesture, or not containing 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 a preset direction to obtain a fourth judgment result. The fourth judgment result may include: containing a sliding input event in a preset direction, or not containing a sliding input event in a preset direction.
[0137] The preset direction may be any direction, such as horizontal or vertical.
[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 one, the bubble display mode is represented by mode two, the sliding display mode is represented by mode three, and the scrolling display mode is represented by mode four.
[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 schematic illustrations 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 screened according to the matching conditions, the target component display mode that is compatible with the component to be adjusted can be screened 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 a 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 influence of the text content and font size of the component, the calculated reduction ratio may have decimal points. In order to facilitate font setting, the calculated reduction ratio needs to be rounded to an integer. When rounding, in order to avoid rounding up and causing the font to become larger and display abbreviations, the calculated reduction ratio is rounded down. In this way, an integer 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 added in advance for the component to be adjusted. The first input event may come from a user's input action on various input devices (such as a mouse, keyboard, touch screen, etc.), such as 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 the bubble.
[0155] Exemplarily, in the case where the first input event is a gesture event, in response to receiving the gesture event, 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 preset 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, Fig. 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, so that the user can see more complete text content, thereby improving the text display effect.
[0159] Fig.10 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application.
[0160] Fig.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 may be added to the component to be adjusted in advance. The sliding input event may originate from a user's sliding input action on various input devices (such as a mouse, a touch screen, etc.). For example: a sliding input event inputted using a mouse or a sliding gesture event inputted by 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 sliding input event of the user.
[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, the sliding gesture event callback may be monitored, and when the sliding gesture event callback is monitored, the sliding amplitude value is calculated.
[0166] The slide amplitude value can be calculated by continuously capturing the coordinates of the touch position.
[0167] Step 1043: According to the sliding amplitude value, slide and display the text displayed by the component to be adjusted accordingly.
[0168] For example, the direction of text sliding can be the same as or opposite to the direction of gesture sliding, which can be set according to the user's usage habits, and this application does not limit this. Optionally, the text can be displayed by sliding accordingly according to the sliding direction and the sliding amplitude value.
[0169] For example, Fig.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 content accordingly by sliding the text, so as to see a more complete text content.
[0170] Fig.12 A flowchart of a user interface processing method provided in an embodiment of the first aspect of the present application.
[0171] Fig.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, which 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 the text in the component to be adjusted. The timer can be expressed as a method or a function. For example, if the text scrolling speed is 16 milliseconds per word, a timer can be created and added, and the time interval of the timer can be set to 16 milliseconds.
[0176] Step 1243: Control the scrolling of the text displayed by the component to be adjusted through a timer.
[0177] Following the previous example, after setting the time interval of the timer 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, Fig.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 play mode is more compatible with various components, when the component to be adjusted displays super-long text content, the scrolling play 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 SDK. The SDK can be implemented by 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. Among them:
[0182] When the target component display mode is the reduced font display mode, the processing result may include: the first status code corresponding to the processing completion, the reduced font display mode identifier and the font size. For example, as shown in Table 2 below, the first status code may be "0", indicating that the processing is completed; the reduced font display mode identifier 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 the processing completion, or a third status code corresponding to the bubble display, or a fourth status code corresponding to the bubble hiding. For example: as shown in Table 2 below, the second status code may take the value of "0", indicating that the processing is completed, the third status code may take the value of "1", indicating that the bubble is displayed, and the fourth status code may take the value of "2", indicating that the bubble is hidden; the bubble display mode identifier may take the value of "2"; the first input event information may be expressed as gesture event callback information.
[0184] When the target component display mode is the sliding display mode, the processing result may include: the fifth status code corresponding to the processing completion, the sliding display mode identifier, and the sliding input event information. For example, as shown in Table 2 below, the fifth status code may be "0", indicating that the processing is completed; the sliding display mode identifier may be "3"; and the sliding input event information may be expressed as sliding event callback information.
[0185] When the target component display mode is the 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 completed; the scrolling mode identifier may be "4"; and the scrolling completion event information may be expressed as scrolling completion.
[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 the actual application needs, as long as the value of the status code can express the corresponding processing state. 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 indicate 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 display 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 information.
[0190] The processing results of the component to be adjusted are called back to the target application through the SDK, so that the target application can perform relevant processing according to 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] Fig.14 The structure diagram of the intelligent display SDK kit provided by the first embodiment of the first aspect of the present application is shown. Fig.14 As shown, the intelligent display SDK suite 1400 accessing 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 process of the plug-in automatic identification and screening module 1402 can refer to Figure 4 The implementation of the illustrated embodiment will not be described in detail here.
[0194] The processing process of the intelligent display processing module 1404 can refer to Figure 5a The implementation of the illustrated embodiment will not be described in detail here.
[0195] The processing process of the display mode processing application module 1406 can refer to Figure 6-Figure 13 The implementation of the illustrated embodiment will not be described in detail here.
[0196] The SDK suite 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 components through the plug-in automatic identification and screening module 1402, automatically determine the components to be adjusted, and pass the components to be adjusted that need 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 components 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, so that the target application can perform other related processing.
[0198] A second aspect of the present application provides a user interface processing device. Fig.15 This is a schematic diagram of the structure of a user interface processing device provided in an embodiment of the second aspect of the present application. Fig.15 As shown, the user interface processing device 1500 may include:
[0199] The acquisition module 1510 is used to acquire interface change information related to the text change according to the text change of the user interface.
[0200] The determination module 1520 is used to determine the component to be adjusted in the user interface according to the interface change information, and 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 used 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 according to 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 of the user interface.
[0207] Optionally, the determining module 1520 further includes:
[0208] A layout judgment submodule is used to judge whether the component layout change information satisfies a preset component layout adjustment condition when the component layout change information is obtained, and if so, determine 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 is used to determine the ratio of the component size required for the changed text to the component size of the component currently displaying the text when the text change information is obtained, and to determine whether the ratio meets a preset ratio adjustment condition. If so, determine 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, determine 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 exceeding ratio of the component to be adjusted, a component height of the component to be adjusted, an input event included in the component to be adjusted, and an input event included in a parent component of the component to be adjusted, wherein the text exceeding 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 condition corresponding to the reduced font display mode includes: the matching condition 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 the 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 the 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, used to determine whether the text exceeding the ratio is within 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 used 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 judgment submodule, configured to judge whether the component height of the component to be adjusted exceeds a preset component height threshold when the first judgment result is that the text exceeds the proportion within the second preset proportion range or the third preset proportion range, to obtain a second judgment 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, used to judge whether the component to be adjusted or the parent component contains 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 a bubble display mode when 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;
[0226] A sliding display submodule, configured to determine that a 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 and the fourth judgment result meet 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 reduced font processing submodule, used to calculate the reduction ratio of the changed text when the target component display mode is the reduced font 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, used for capturing a first input event when the target component display mode is a bubble display mode, 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, wherein the bubble is used to display text;
[0231] A sliding display processing submodule is used to capture a sliding input event when the display mode of the target component 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 display mode of the target component 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, used for calling back the processing result of the component to be adjusted to the target application;
[0235] Wherein, in the case where the target component display mode is a 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] In the case where 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, or 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 a 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, according to the text change of the user interface, the interface change information related to the text change is obtained, and according to the interface change information, the component to be adjusted in the user interface for displaying the changed text is determined. 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 be automatically 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 according to the target component display mode, the component to be adjusted is processed, 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 extra long due to language switching.
[0240] The third aspect of the present application also provides a user interface processing device. Fig.16 This is a schematic diagram of the structure of a user interface processing device provided in one embodiment of the present application. Fig.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 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 in the embodiment of the present application.
[0244] The processor 1602 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 1601 , so as to implement the user interface processing method in the above embodiment.
[0245] In some examples, the user interface processing device 1600 may also include a communication interface 1603 and a bus 1604. Fig.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 the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 1603 can also be used to access input devices and / or output devices.
[0247] The bus 1604 includes hardware, software, or both, and 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 Hyper Transport (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 of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0248] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program instruction is stored. When the computer program instruction is executed by a processor, the user interface processing method in the above embodiment can be implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a 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 clear that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the 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 refer to the description part of the method embodiment. The present 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 the present application. In addition, for the sake of brevity, a detailed description of known method technologies is omitted here.
[0251] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized 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 by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a 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 can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0252] Those skilled in the art should understand that the above embodiments are exemplary rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on the 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 multiple; the terms "first" and "second" are used to indicate 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 single hardware or software module. The appearance of certain technical features 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 attribute of the component to be adjusted, a target component display mode matching the component to be adjusted is screened out 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; The component to be adjusted is processed according to the target component display mode.
2. The method according to claim 1, characterized in that The acquiring 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 obtained.
3. The method according to claim 2, characterized in that The determining, according to the interface change information, a component to be adjusted in the user interface includes: In the case of obtaining the component layout change information, 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; In the case of obtaining the text change information, determining the ratio of the component size required for the changed text to the component size of the component currently displaying the text, judging whether the ratio meets a preset ratio adjustment condition, and 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 satisfies a preset input event adjustment condition. If yes, 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 display attribute includes: at least one of: the text exceeding ratio of the component to be adjusted, the component height of the component to be adjusted, the input event included in the component to be adjusted, and the input event included in the parent component of the component to be adjusted, wherein the text exceeding 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 condition corresponding to the reduced font display mode includes: the matching condition 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 exceeds the ratio within a first preset ratio range; The matching conditions corresponding to the bubble display mode include: the text exceeding ratio is within the 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 the 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 matching the component to be adjusted from a preset rule library according to the text display attribute of the component to be adjusted includes: Determine 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 obtain a first determination result; When the first judgment result is that the text exceeds the proportion and conforms to 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; When the first judgment result is that the text exceeds the proportion within the second preset proportion range or the third preset proportion range, judging whether the component height of the component to be adjusted exceeds the preset component height threshold, and obtaining 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 the 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; In the case where the first judgment result, the second judgment result and the fourth judgment result meet 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 matching 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 the reduction ratio of the changed text, and setting the 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, a first input event is captured, and when the first input event is captured, a bubble is displayed; when the first input event is not captured or the first input event ends, the bubble is hidden, and the bubble is used to display text; When the display mode of the target component is a sliding display mode, a sliding input event is captured, and when the sliding input event is captured, a sliding amplitude value is calculated, and according to the sliding amplitude value, the text displayed by the component to be adjusted is displayed by sliding accordingly; When the display mode of the target component is the scrolling 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, the scrolling playback of the text displayed by the component to be adjusted is controlled by the timer, and 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, in the case where the target component display mode is a 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; In the case where 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, or 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 a 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: An acquisition module, used to acquire interface change information related to text changes according to text changes in the user interface; A determination module, used 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, 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, wherein the preset rule library includes multiple component display modes, and different component display modes correspond to different matching conditions; 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 It comprises a computer program, which, when executed by a processor, implements the user interface processing method according to any one of claims 1 to 9.
Citation Information
Patent Citations
A component display method and device
CN109725821A
User interface display method and device, electronic equipment and storage medium
CN112286614A
Multi-language interface display adjusting method and device, electronic equipment and storage medium
CN116775198A
WinForm control dynamic loading method and device, equipment and medium
CN117435271A
Data processing method and device, storage medium and electronic equipment
CN118567772A