Page interaction method based on complex framework

By detecting the height of the Android soft keyboard and controlling the movement of the page content components, the adaptability problem of the page content components in Android devices when the soft keyboard appears or is hidden is solved, and the content is displayed and hidden smoothly is achieved, improving the user experience.

CN119025002AActive Publication Date: 2024-11-26ZEN-AI TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411058513.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-26
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

In the prior art, when an Android device using the compose framework displays an Android soft keyboard, the information list of the page content components cannot be adaptively matched, resulting in the content being blocked or a jerking feeling.

Method used

By detecting the keyboard's visible and hidden operation, determine the height of the Android soft keyboard, and control the movement distance and direction of the page content components according to the height, ensuring that the content components move appropriately when the soft keyboard is displayed or hidden to avoid occlusion and white space.

Benefits of technology

Improve the display adaptability of page content and Android soft keyboard, avoid the content occlusion and blank space when displayed on the soft keyboard, and improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025002A_ABST
    Figure CN119025002A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a page interaction method based on a complex framework. The method comprises the steps that keyboard display and hiding operation triggered through a target page is detected; under the condition that the keyboard display and hiding operation is detected, determining the keyboard height of the Android soft keyboard which is indicated to be displayed or hidden by the keyboard display and hiding operation; based on the keyboard height, the moving distance of a page content component displayed by the target page is determined, and the moving distance is larger than or equal to the keyboard height; a target direction matched with the keyboard display and hiding operation is determined, and the target direction represents the moving direction of the page content component; and displaying or hiding the Android soft keyboard according to an instruction of the keyboard displaying and hiding operation, and controlling the page content component to move along the target direction by the moving distance. Therefore, the adaptability of the message list in the page using the complex framework and the display mode of the Android soft keyboard can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a page interaction method based on a compose framework. Background Art

[0002] In the prior art, XML (Extensible Markup Language) framework is usually used to implement page interaction of applications on Android devices. However, due to the problems of XML, such as lengthy and complex codes, low development efficiency, poor code readability and maintainability, difficulty in implementing dynamic page changes and responses, separation from other programming language codes, and difficulty in real-time preview, some solutions use the compose framework to replace the XML framework for page interaction.

[0003] However, in the scenario where the application page of an Android device that currently uses the compose framework displays functional pages such as the Android soft keyboard, the display of the information list cannot adaptively match the appearance or hiding of the Android soft keyboard. For example, in some cases, after the Android soft keyboard is displayed on the page, the Android soft keyboard will obscure at least part of the content of the information list; or, after the Android soft keyboard is displayed on the page, the page will jump or jitter with obvious stuttering.

[0004] It can be seen that how to improve the compatibility of the information list in the page using the compose framework with the display of other functional pages is a technical issue worthy of attention. Summary of the invention

[0005] In view of this, in order to solve some or all of the above-mentioned technical problems, an embodiment of the present application provides a page interaction method based on the compose framework.

[0006] In a first aspect, an embodiment of the present application provides a page interaction method based on a compose framework, the method comprising:

[0007] Detecting a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page;

[0008] In the case where the keyboard display and hiding operation is detected, determining the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation;

[0009] Based on the keyboard height, determining a moving distance of the page content component displayed on the target page, wherein the moving distance is greater than or equal to the keyboard height;

[0010] Determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component;

[0011] Display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and control the page content component to move the moving distance along the target direction.

[0012] In a possible implementation, the method further includes:

[0013] Create an object that implements the global layout listener interface, call the initialization function of the page content component, and set the layout callback listener for the page content component;

[0014] When the keyboard display / hide operation is detected and the global drawing of the page content component is monitored to be completed, the initial height of the page content component and the instantaneous height of the page content component are compared;

[0015] In the case where the initial height and the instantaneous height are inconsistent, determining that the keyboard display and hiding operation indicates displaying the Android soft keyboard, and the target direction indicates upward;

[0016] When the initial height and the instantaneous height are consistent, it is determined that the keyboard display and hiding operation indicates hiding the Android soft keyboard, and the target direction indicates downward.

[0017] In a possible implementation, the method further includes:

[0018] In the case that the initial height and the instantaneous height are inconsistent, calling a function for obtaining a window visual display frame, and obtaining the size information and position information of the viewable area of ​​the page content component through the function for obtaining a window visual display frame;

[0019] Fill the size information and the position information into the rectangle attribute of the callback function;

[0020] Calling the callback function, obtaining a height parameter of the rectangle attribute from the callback function, and determining the height parameter as the instantaneous height;

[0021] Obtaining the initial height;

[0022] A pixel difference between the initial height and the instantaneous height is calculated, and the pixel difference is determined as the keyboard height of the Android soft keyboard.

[0023] In a possible implementation, the method further includes:

[0024] Determine the target duration between the triggering moment of the keyboard display and hiding operation and the current moment;

[0025] In the case where the keyboard display and hiding operation indicates that the Android soft keyboard is displayed, determining that the keyboard height of the Android soft keyboard displayed by the keyboard display and hiding operation indicates that the keyboard height is positively correlated with the target duration in a first time period, wherein the first time period indicates a time period from when the Android soft keyboard is completely hidden to when it is completely displayed;

[0026] In the case where the keyboard display and hiding operation indicates hiding the Android soft keyboard, determining that the keyboard height of the Android soft keyboard hidden by the keyboard display and hiding operation indicates is negatively correlated with the target duration in a second time period, wherein the second time period represents the time period from when the Android soft keyboard is fully displayed to when it is fully hidden.

[0027] In a possible implementation, the method further includes:

[0028] Setting a blank layer for the page content component, and setting the height of the blank layer to the pixel difference;

[0029] Setting the blank layer at the bottom of the page content component;

[0030] Setting the bottom padding value of the content padding attribute to the pixel difference value through the content padding attribute of the page content component;

[0031] Control the page content component to move upward by the pixel difference.

[0032] In a possible implementation, the method further includes:

[0033] Detecting an expression page display operation triggered by the target page;

[0034] The height of the expression page is set to the pixel difference, and the expression page is controlled to move by the pixel difference, wherein the expression page covers the Android soft keyboard.

[0035] In a possible implementation, the method further includes:

[0036] Detecting a function page display operation triggered by the target page;

[0037] The height of the function page is set to the pixel difference value, and the function page is controlled to move by the pixel difference value, wherein the function page covers the Android soft keyboard.

[0038] In a possible implementation, the method further includes:

[0039] Set the horizontal difference value to control the smooth display and smooth folding of the page.

[0040] In a possible implementation, before detecting the keyboard display / hide operation triggered by the target page, the method further includes:

[0041] Controls the closing of the response to the Android system's soft keyboard pop-up.

[0042] In a second aspect, an embodiment of the present application provides a page interaction device based on a compose framework, the device comprising:

[0043] A detection unit, used to detect a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page;

[0044] A first determining unit is used to determine the keyboard height of the Android soft keyboard indicated to be displayed or hidden by the keyboard display and hiding operation when the keyboard display and hiding operation is detected;

[0045] A second determining unit, configured to determine a moving distance of a page content component displayed on the target page based on the keyboard height, wherein the moving distance is greater than or equal to the keyboard height;

[0046] A third determining unit is used to determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component;

[0047] A control unit is used to display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and to control the page content component to move the moving distance along the target direction.

[0048] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0049] Memory for storing computer programs;

[0050] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method of any embodiment of the page interaction method based on the compose framework of the above-mentioned first aspect of the present application is implemented.

[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the page interaction method based on the compose framework of the first aspect described above is implemented.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code runs on a device, the processor in the device implements a method as in any embodiment of the page interaction method based on the compose framework of the first aspect mentioned above.

[0053] The page interaction method based on the compose framework provided in an embodiment of the present application can detect a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page. Afterwards, when the keyboard display and hiding operation is detected, the keyboard height of the Android soft keyboard indicated to be displayed or hidden by the keyboard display and hiding operation is determined. Then, based on the keyboard height, the moving distance of the page content component displayed on the target page is determined, wherein the moving distance is greater than or equal to the keyboard height. Subsequently, a target direction matching the keyboard display and hiding operation is determined, wherein the target direction indicates the moving direction of the page content component. Finally, the Android soft keyboard is displayed or hidden according to the instruction of the keyboard display and hiding operation, and the page content component is controlled to move the moving distance along the target direction. Therefore, when the Android soft keyboard is displayed or hidden, the page content component can be controlled to move a corresponding distance in a direction matching the keyboard display and hiding operation, so as to avoid obstruction of the information list content of the page content component when the Android soft keyboard is displayed, and the situation where there is a lot of blank space in the page content component when the Android soft keyboard is hidden, thereby improving the adaptability of the page content in the page using the compose framework and the display method of the Android soft keyboard. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0056] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0057] Figure 1 A flow chart of a page interaction method based on the compose framework provided in an embodiment of the present application;

[0058] Figure 2 A flowchart of another page interaction method based on the compose framework provided in an embodiment of the present application;

[0059] Figure 3A-3D A schematic diagram of an application scenario of another page interaction method based on the compose framework provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of the structure of a page interaction device based on the compose framework provided in an embodiment of the present application;

[0061] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values ​​described in these embodiments do not limit the scope of the present application.

[0063] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.

[0064] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0065] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0066] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0067] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0068] In addition, directional words such as up, upward, down, downward, left, right, top, and bottom in this application have the following definitions: when the screen is facing the observer, up refers to the top edge of the screen, and the closer to the top of the screen, the higher it is; down is opposite to up, and is the bottom edge of the screen, and the closer to the bottom of the screen, the lower it is; top is the edge of the screen close to the observer's eyes; bottom refers to the edge of the screen close to the observer's body; left refers to the edge on the left hand side of the observer when the screen is facing the observer; right refers to the edge on the right hand side of the observer when the screen is facing the observer; downward refers to moving in the direction closer to the bottom of the screen; upward refers to moving in the direction closer to the top of the screen.

[0069] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.

[0070] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered as part of the specification.

[0071] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0072] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0073] In order to solve the technical problem in the prior art of how to improve the adaptability of page content in a page using the compose framework and the display mode of the Android soft keyboard, the present application provides a page interaction method based on the compose framework, which can improve the adaptability of page content in a page using the compose framework and the display mode of the Android soft keyboard.

[0074] Figure 1A flow chart of a page interaction method based on the compose framework provided for an embodiment of the present application. This method can be applied to one or more electronic devices such as smart phones, laptops, desktop computers, portable computers, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0075] like Figure 1 As shown, the method specifically includes:

[0076] Step 101, detecting a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page.

[0077] In this embodiment, the target page may be any page on a device installed with an Android system that can display an Android soft keyboard.

[0078] The Android soft keyboard is a UI component on the Android system. It provides the function of text input on Android devices. It is a virtual input device that simulates the function of a traditional physical keyboard. Users can input text, numbers, symbols, etc. by touching the Android soft keyboard keys on the screen. The target page can be a page displayed on the display screen of a device installed with the Android system. The target page can display a page formed by a combination of a page content component and a displayed Android soft keyboard; it can also display a page formed by a combination of a page content component and a hidden Android soft keyboard. The page content component can be a popup window component (PopupWindow).

[0079] Generally, the target page can display the Android soft keyboard when the input box gets the focus, or the control for triggering the display of the Android soft keyboard is triggered, or the bottom of the device screen is swiped upward, etc. The target page can hide the Android soft keyboard when the input box loses the focus, or the control for triggering the hiding of the Android soft keyboard is triggered, or the "Hide" or "Done" or other similar buttons on the soft keyboard are clicked.

[0080] Therefore, the keyboard display and hiding operation can be any of the operations described above for triggering the display or hiding of the Android soft keyboard.

[0081] In the present application, by running self-developed instant messaging software on an Android device (such as an Android phone), it is possible to support multiple users to create a group chat, or two users to send messages to each other and chat.

[0082] Instant messaging software can be provided with a target page, a page content component, a soft keyboard, an expression page, and a function page. Among them, the target page is equivalent to a container of the page content component, the soft keyboard, the expression page, and the function page. The page content component is used to display messages sent by users, which can be displayed in the form of a list. The page content component belongs to a layer 1 of the target page. The soft keyboard (with an input box) is used for users and other objects to edit message content. The soft keyboard can be located in layer 2 of the target page. The expression page is used for users and other objects to select expressions to send to the chat object. The expression page can be located in layer 3 of the target page; the function page can be used to provide at least one of the following chat functions: select and send album images, take images or videos, send locations, voice input, select favorite content, select and send files, select and send music, etc. The function page can be located in layer 4 of the target page.

[0083] Among them, layer 1, layer 2, layer 3 and layer 4 are four independent layers, and when the soft keyboard is displayed, layer 2 is located above layer 1, layer 3 and layer 4. Here, "the above layer" refers to a layer closer to the user, that is, a layer that the user can directly see with the naked eye. It can be seen that if layer 2 changes (displayed or hidden) on the target page, it will directly affect the amount of content displayed in layer 1. For example, the content displayed in layer 2 may block the information displayed in layer 1, thereby causing the user to be unable to see at least part of the information content in the blocked layer 1.

[0084] In some optional implementations of this embodiment, the following methods may be used to detect the keyboard display and hiding operation triggered by the target page:

[0085] When it is detected that the target input box of the target page acquires the focus, it is determined that a keyboard display-hiding operation of an Android soft keyboard indicating display of the target page is detected.

[0086] The target input box may be an input box in the target page.

[0087] It can be understood that in the above optional implementation method, once the input box in the page acquires the focus, it can be determined that the keyboard display and hiding operation of the Android soft keyboard indicating the display of the target page has been detected at this time. Further, the Android soft keyboard can be displayed, and the page content can be controlled to move a corresponding distance in a direction matching the keyboard display and hiding operation (specifically, the keyboard display operation). This can avoid obstruction of the page content when the Android soft keyboard is displayed.

[0088] Step 102: when the keyboard display and hiding operation is detected, determine the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation.

[0089] In this embodiment, the keyboard height may represent the height of the currently displayed Android soft keyboard.

[0090] In some cases, the keyboard height can be a constant height.

[0091] In other cases, the keyboard height determined in step 102 may also vary with the target duration. In this case, the keyboard height is a variable height. The method for determining the keyboard height will be described below and will not be described here.

[0092] In some cases, you can use the following methods to determine whether the soft keyboard is displayed:

[0093] Create an object that implements the global layout listener interface (OnGlobalLayoutListener interface), call the initialization function (addOnGlobalLayoutListener) of the page content component, and set the layout callback listener for the page content component (PopupWindow); when the keyboard display and hide operation is detected and the global drawing of the page content component is listened to, compare the initial height of the page content component with the instantaneous height of the page content component; when the initial height and the instantaneous height are inconsistent, determine that the keyboard display and hide operation indicates that the Android soft keyboard is displayed. When the initial height and the instantaneous height are consistent, determine that the keyboard display and hide operation indicates that the Android soft keyboard is hidden.

[0094] Specifically, when the initial height and the instantaneous height are inconsistent and the instantaneous height gradually decreases, it is determined that the display state presented by the Android soft keyboard is from a completely hidden state to gradually displayed. When the initial height and the instantaneous height are always consistent, it is determined that the display state presented by the Android soft keyboard is completely hidden. When the initial height and the instantaneous height are inconsistent and the instantaneous height gradually increases, it is determined that the display state presented by the Android soft keyboard is from a fully displayed state to gradually retracted to a completely hidden state.

[0095] When it is detected that the input box has acquired the focus, and the global layout of the pop-up window component (i.e., the page content component (PopupWindow)) is completed (after being drawn by the Android UI system), the initial setting height value of the pop-up window component (same as "initial height") and the instantaneous height value of the pop-up window component (same as "instantaneous height") are obtained to determine whether the soft keyboard is displayed. For example, when the instantaneous height value of the pop-up window component is inconsistent with the initial setting height value, it is determined that the pop-up window component is squeezed by the soft keyboard and the soft keyboard is displayed; when the instantaneous height value of the pop-up window component is consistent with the initial setting height value, it is determined that the pop-up window component is not squeezed and the soft keyboard is not displayed.

[0096] In addition, under the premise of determining that the keyboard display and hide operation indicates that the Android soft keyboard is displayed, when the global layout of the pop-up window component is monitored to be completed, the getWindowVisibleDisplayFrame function is called, and the size information and position information (boundary coordinate values) of the viewable area of ​​the pop-up window component are obtained by obtaining the window visible display frame function, and the size information and position information of the viewable area are filled into the rectangle attribute (Rect) of the callback function, and the height value in the rectangle attribute is the remaining height value of the pop-up window component; when the global layout of the pop-up window component is monitored to be completed, the callback function (onGlobalLayout) is called, and the callback function is used to obtain the height value (i.e., the height parameter) in the rectangle attribute, and then the pixel difference between the original height value of the pop-up window component (the height value of the screen calculated by the Android screen) and the remaining height value of the pop-up window component (the pop-up window component after being squeezed by the soft keyboard) is calculated; when the above-mentioned pixel difference is greater than the screen height value, for example, one-fourth, it is determined that the soft keyboard is displayed, and the above-mentioned pixel difference is used as the height value of the soft keyboard.

[0097] Step 103: determining a moving distance of a page content component displayed on the target page based on the keyboard height, wherein the moving distance is greater than or equal to the keyboard height.

[0098] In this embodiment, the keyboard height can be determined as the moving distance of the page content component displayed on the target page, or the sum of the keyboard height and a preset length can be determined as the moving distance of the page content component displayed on the target page.

[0099] Step 104: determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component.

[0100] In this embodiment, the target direction may be a direction that matches the keyboard display and hiding operation.

[0101] In some optional implementations of the present embodiment, when the display position of the Android soft keyboard is the bottom of the target page and the keyboard display and hiding operation indicates displaying the Android soft keyboard, the target direction indicates upward.

[0102] It can be understood that in the above optional implementation, when the Android soft keyboard is displayed at the bottom of the page (which can be determined based on the position of the input box), once the Android soft keyboard needs to be displayed, the page content component of the target page will move upward with the Android soft keyboard to avoid the page content (i.e., the message list) being blocked by the Android soft keyboard.

[0103] In some optional implementations of the present embodiment, the display position of the Android soft keyboard is the lower middle part of the target page (which can be determined based on the position of the input box), and when the keyboard display and hiding operation indicates hiding the Android soft keyboard, the target direction indicates downward.

[0104] It can be understood that in the above optional implementation, when the Android soft keyboard is displayed in the lower middle part of the page, once the Android soft keyboard is hidden, the page content component of the target page will move downward with the Android soft keyboard to reduce the blank space in the display area of ​​the page content component, allowing the user to browse more page content (i.e., message list).

[0105] In some optional implementations of this embodiment, when the display position of the Android soft keyboard is the top of the target page and the keyboard display and hiding operation indicates hiding the Android soft keyboard, the target direction indicates upward.

[0106] It can be understood that in the above optional implementation, when the Android soft keyboard is displayed at the top of the page, once the Android soft keyboard is hidden, the page content component of the target page will move upward with the Android soft keyboard to reduce the blank space in the display area of ​​the page content component, allowing the user to browse more page content (i.e., message list).

[0107] In some optional implementations of the present embodiment, when the display position of the Android soft keyboard is the top of the target page and the keyboard display and hiding operation indicates displaying the Android soft keyboard, the target direction indicates downward.

[0108] It can be understood that in the above optional implementation, when the Android soft keyboard is displayed at the top of the page, once the Android soft keyboard needs to be displayed, the page content component of the target page will move downward with the Android soft keyboard to avoid the page content (i.e., the message list) being blocked by the Android soft keyboard.

[0109] Step 105: display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and control the page content component to move the moving distance along the target direction.

[0110] In this embodiment, if the keyboard display and hiding operation indicates displaying the Android soft keyboard, the Android soft keyboard can be displayed in the target page; if the keyboard display and hiding operation indicates hiding the Android soft keyboard, the Android soft keyboard displayed in the target page can be hidden.

[0111] While displaying or hiding the Android soft keyboard, the page content component can be controlled to move the moving distance along the target direction to avoid obstruction of the page content (i.e., message list) when the Android soft keyboard is displayed, and to avoid a large amount of blank space in the page content component when the Android soft keyboard is hidden.

[0112] In the compose framework, you can use Modifier.padding to set the inner margin of a component. By calling the padding method and passing in the corresponding margin value, you can add a certain amount of space inside the component.

[0113] The padding method has multiple overloaded forms, and can set the inner margin of one side, two sides or four sides. In this embodiment, by setting the bottom in padding to the above moving distance, the page content can be controlled to move the moving distance along the target direction.

[0114] In some optional implementations of this embodiment, the following methods may be used to detect the keyboard display and hiding operation triggered by the target page:

[0115] The keyboard display and hiding operation triggered by the target page is monitored through the page content component of the target page to detect the keyboard display and hiding operation.

[0116] Among them, the page content component is inherited (customized), the width of the page content component is set to 0 pixels, the height is set to Match_parent (the height value of the display screen of the Android device) to fill the entire screen, and the background color is transparent.

[0117] On this basis, the keyboard height of the Android soft keyboard displayed or hidden by the keyboard display and hiding operation indication can be determined in the following manner:

[0118] The keyboard height of the Android soft keyboard displayed or hidden by the keyboard display and hiding operation indication is determined through the page content component.

[0119] Specifically, the keyboard height can be determined in the following ways:

[0120] 1) Inherit the PopupWindow component to implement a custom popup window;

[0121] 2) The initial value of the width (width) of the pop-up component is set to 0 pixels, the initial value of the height (height) is set to the pixel value of the height (Match_parent) of the screen used to display the target page, and the background color of the pop-up component is set to a transparent color, where Match_parent represents the height that fills the entire screen, so as to determine the change in the height direction of the Android soft keyboard;

[0122] 3) Create an object that implements the global layout listener (OnGlobalLayoutListener) interface, and call the initialization function (addOnGlobalLayoutListener) of the pop-up component to set the layout callback listener for the pop-up component;

[0123] 4) When it is detected that the input box has acquired the focus and the global layout of the pop-up window component is completed (after being drawn by the Android UI system), the initial setting height value of the pop-up window component and the instantaneous height value of the pop-up window component are obtained to determine whether the soft keyboard is displayed (if the instantaneous height value of the pop-up window component is inconsistent with the initial setting height value, it is determined that the pop-up window component is squeezed by the soft keyboard and the soft keyboard is displayed; if the instantaneous height value of the pop-up window component is consistent with the initial setting height value, it is determined that the pop-up window component is not squeezed and the soft keyboard is not displayed);

[0124] 5) When the global layout (same as global drawing) of the pop-up component is completed, the getWindowVisibleDisplayFrame function is called to obtain the size information and position information (boundary coordinate values) of the viewable area of ​​the pop-up component, and the size and position information of the viewable area are filled into the rectangle attribute (Rect). The height value in the rectangle attribute is the remaining height value of the pop-up component.

[0125] 6) When the global layout of the pop-up component is completed, the callback function (onGlobalLayout) is triggered, and the height value in the rectangle attribute is obtained by using the callback function, and then the pixel difference between the original height value of the pop-up component (the height value of the screen calculated by the Android screen) and the remaining height value of the pop-up component (the pop-up component after being squeezed by the soft keyboard) is calculated;

[0126] 7) When the pixel difference is greater than one quarter of the screen height, the pixel difference is determined as a soft keyboard display, and the pixel difference is used as the height of the soft keyboard.

[0127] Furthermore, after obtaining the height value of the soft keyboard, when the expression page needs to be displayed, the height of the expression page (the default height when the page is opened is 0) is set to the above height value; when the function page needs to be displayed, the height of the function page (the default height when the page is opened is 0) is set to the above height value.

[0128] Furthermore, a blank layer is set for the page content component, and the height of the blank layer is set to the pixel difference. The blank layer is set at the bottom of the page content component. The bottom padding value of the content padding property is set to the pixel difference through the content padding property of the page content component. The page content component is controlled to move upward by the pixel difference.

[0129] In some cases, when it is determined that the soft keyboard is displayed, a blank area layer (same as blank layer) can be added to the layer of the page content component, the width of the blank area layer is consistent with the width of the layer of the page content component, and the height of the blank area layer is the same as the height of the soft keyboard. The blank area layer is located at the bottom of the layer of the page content component, and the blank area layer is not used to display any information content (referring to the chat information list).

[0130] Here, it should be noted that the blank area layer is to allow the layer of the page content component to scroll up. If the blank area layer is not set, the corresponding function or effect cannot be achieved. Specifically, if there is no blank area layer, the chat list will not be able to scroll up. The blank area layer is equivalent to supporting the page content. In addition, the blank area layer is added according to the pixel difference when the soft keyboard, or the expression page, or the function page appears. If there is no soft keyboard, or the expression page, or the function page, the height of the blank area layer is 0. Through the content padding attribute (contentPadding) of the page content, the bottom padding value (contentPaddingBottom) of the content padding attribute is set to the height value of the soft keyboard, and the blank area layer is scrolled in the target direction by the height value of the soft keyboard. Before setting the addition of the blank area layer, it also includes comparing whether the height of the information list displayed by the page content component is greater than the difference between the full screen height and the height of the soft keyboard. If it is greater than the difference, the blank area layer is set; if it is less than the difference, the blank area layer may not be set.

[0131] It can be understood that in the above optional implementation, the triggering of the keyboard display and hiding operation can be monitored through the page content component with a width of 0 pixels.

[0132] In some optional implementations of this embodiment, the target page displays a control for triggering display or hiding of the expression page, and the target page also displays a control for triggering display or hiding of the function page.

[0133] As an example, the expression page can be used to implement at least one of the following functions: expression input, expression collection, selfie expression, etc. The function page can be used to implement at least one of the following functions: album browsing, taking pictures, recording, voice calls, video calls, transfers, positioning, voice input, page content collection, etc.

[0134] On this basis, after determining the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation, the following steps may also be performed:

[0135] The first step is to, when detecting an expression page display operation triggered by the target page, determine the target height (i.e., pixel difference) of the Android soft keyboard at the target page as the display height of the expression page, and control the expression page to move by the pixel difference, wherein the expression page covers the Android soft keyboard.

[0136] The display height indicates the height of the currently displayed expression page.

[0137] The target height indicates the height of the Android soft keyboard when it is fully displayed in the target page.

[0138] In practice, the target height corresponding to the screen width of the device where the target page is located may be determined based on a preset correspondence table.

[0139] The above correspondence table represents the correspondence between the screen width and the target height.

[0140] The second step is to display or hide the expression page according to the display height.

[0141] In some cases, the emoticon page may be located in a lower layer of the display area of ​​the Android soft keyboard in the target page.

[0142] It can be understood that in the above optional implementation method, when the target page needs to switch from displaying the Android soft keyboard to displaying the emoticon page, the hierarchical relationship between the emoticon page and the Android soft keyboard will be adjusted to place the Android soft keyboard in the lower layer of the display area of ​​the emoticon page in the target page.

[0143] In addition, after determining the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation, the following steps may also be performed:

[0144] In the first step, when a function page display operation triggered by the target page is detected, the target height (i.e., pixel difference) of the Android soft keyboard at the target page is determined as the display height of the function page, and the function page is controlled to move by the pixel difference, wherein the function page covers the Android soft keyboard.

[0145] The display height indicates the height of the currently displayed function page.

[0146] The target height indicates the height of the Android soft keyboard when it is fully displayed in the target page.

[0147] In practice, the target height corresponding to the screen width of the device where the target page is located may be determined based on a preset correspondence table.

[0148] The above correspondence table represents the correspondence between the screen width and the target height.

[0149] The second step is to display or hide the function page according to the display height.

[0150] In some cases, the function page may be located in a lower layer of the display area of ​​the Android soft keyboard in the target page.

[0151] It can be understood that in the above optional implementation method, when the target page needs to switch from displaying the Android soft keyboard to displaying the function page, the hierarchical relationship between the function page and the Android soft keyboard will be adjusted to place the Android soft keyboard in the lower layer of the display area of ​​the function page in the target page.

[0152] In some optional implementations of this embodiment, the following method may be used to control the page content component to move the moving distance along the target direction:

[0153] When the blank height of the message list is smaller than the moving distance, the page content component is controlled to move the moving distance along the target direction.

[0154] Here, the blank height of the message list is less than the moving distance, which means that the content of the message list is large. Usually, when the Android soft keyboard is used to display at the bottom of the target page, each message in the above message list (such as text, image, etc.) can be arranged in the target page from the top of the Android device to the bottom of the Android device according to the order of sending time. At this time, the blank of the message list can be located at a relatively lower position of the target page. When the Android soft keyboard is used to display at the top of the target page, the above message list (such as text, image, etc.) can be arranged in the target page from the bottom of the Android device to the top of the Android device. At this time, the blank of the Android device can be located at a relatively upper position of the target page.

[0155] It can be understood that in the above optional implementation method, the message list can be controlled to move with the Android soft keyboard only when the content of the message list is large. When the message list is small, since the Android soft keyboard generally does not block the messages in the message list, there is no need to control the message list to move with the Android soft keyboard.

[0156] In some optional implementations of this embodiment, before detecting the keyboard display and hiding operation triggered by the target page, the response of monitoring the pop-up of the soft keyboard of the Android system may be controlled to be closed.

[0157] In one embodiment of the present application, the specific execution method of controlling the closing of the response of the Android system to monitor the pop-up of the soft keyboard can be: closing the configuration item "Android attributes for controlling the behavior of the soft keyboard and the window adjustment mode (android:windowSoftInputMode)" in the configuration file (AndroidManifest.xml) of the Android application. In the related art, the display effect of the configuration item "Android attributes for controlling the behavior of the soft keyboard and the window adjustment mode (android:windowSoftInputMode)" is that when the soft keyboard is displayed, the entire page content is pushed outside the top of the Android device, which may cause the information in the page content to be invisible to the user.

[0158] Here, in compose, you can use the docker-compose down command to shut down the system response. This command can stop and delete all services and related resources defined by the compose file, including containers, networks, etc. After executing the docker-compose down command, Compose can stop the containers in sequence according to the service dependencies and clean up related resources.

[0159] Turning off Keyboard Pushing in the registry can be achieved by modifying the key value in the registry.

[0160] As an example, you can turn off keyboard push by following these steps:

[0161] 1. Open the Registry Editor: In the Windows operating system, you can press Win+R, enter "regedit" and press Enter to open the Registry Editor.

[0162] 2. Navigate to the relevant key: In the Registry Editor, navigate to the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout.

[0163] 3. Create a new binary value: In the right pane, right-click in a blank space and select New -> Binary Value.

[0164] 4. Name the binary value: Name the newly created binary value "Scancode Map".

[0165] 5. Modify the binary value data: Double-click the "Scancode Map" binary value, and in the pop-up edit window, enter the following data: 00 00 00 00 00 00 00 00 02 00 00 00 00 00 52E0 00 00 00 00. The "52E0" in the above data is the scan code of the keyboard key to be disabled. In practice, you can find the corresponding scan code and replace it according to the key you need to disable.

[0166] 6. Save and close the Registry Editor: After completing the data entry, click the "OK" button to save the changes and close the Registry Editor.

[0167] 7. Reboot to make the changes take effect.

[0168] It can be understood that in the above optional implementation, by controlling the response of the control system to close and / or closing the keyboard push in the registry, it can be further ensured that the page content component follows the movement of the Android soft keyboard.

[0169] In practice, when a user uses an instant messaging or conference software on an Android phone, when clicking on an input box, a soft keyboard interface will be displayed, and the interface of the chat box (corresponding to the page content component) will be reduced. In this regard, the embodiment of the present application can use the compose framework to implement a soft keyboard interface and an input box that does not block the latest chat records; an expression page and an input box that do not block the latest chat records; and a function page and an input box that do not block the latest chat records.

[0170] As an example, see Figure 3A , Figure 3A The target page shown includes page content (i.e., chat history) and an input box. When the user clicks on the input box and the input box obtains focus, Figure 3B As shown, the Android soft keyboard will be displayed on the target page, and the chat content will move up. When the user clicks other locations on the target page (referring to non-input boxes), it is determined that the keyboard display and hide operation indicates hiding, and the Android soft keyboard will be hidden on the target page, and the chat content will move down (fall back). When the user performs a trigger operation on the emoticon page, the Android device can detect the above trigger operation, such as Figure 3C As shown, the emoticon page can be displayed on the target page. When the user performs a trigger operation on the function page, the Android device can detect the above trigger operation, such as Figure 3D As shown in the figure, the function page can be displayed on the target page. Figure 3C In the emoticon page, you can enter emoticons, etc. Figure 3D In the app, the function page is used to take photos, browse albums, make video calls, voice calls, etc.

[0171] In some cases, the implementation of the above steps in this embodiment may not rely on the XML architecture implementation, but can be completely replaced by the compose architecture.

[0172] In addition, regardless of whether the Android device (i.e., the execution subject of the above method) is placed horizontally and displays the page content horizontally, or placed vertically and displays the page content vertically, the display direction of the page content, soft keyboard, etc. can be smoothly switched.

[0173] The page interaction method based on the compose framework provided in an embodiment of the present application can detect a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page. Afterwards, when the keyboard display and hiding operation is detected, the keyboard height of the Android soft keyboard indicated to be displayed or hidden by the keyboard display and hiding operation is determined. Then, based on the keyboard height, the moving distance of the page content component displayed on the target page is determined, wherein the moving distance is greater than or equal to the keyboard height. Subsequently, a target direction matching the keyboard display and hiding operation is determined, wherein the target direction indicates the moving direction of the page content component. Finally, the Android soft keyboard is displayed or hidden according to the instruction of the keyboard display and hiding operation, and the page content component is controlled to move the moving distance along the target direction. Therefore, when the Android soft keyboard is displayed or hidden, the page content component can be controlled to move a corresponding distance in a direction matching the keyboard display and hiding operation, so as to avoid obstruction of the page content (i.e., the message list) when the Android soft keyboard is displayed, and the situation where there is a lot of blank space in the page content when the Android soft keyboard is hidden, thereby improving the adaptability of the page content component in the page using the compose framework and the display method of the Android soft keyboard.

[0174] Figure 2 A flow chart of another page interaction method based on the compose framework provided in an embodiment of the present application. Figure 2 As shown, the method specifically includes:

[0175] Step 201 , detecting a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page.

[0176] In this embodiment, step 201 and Figure 1 Step 101 in the corresponding embodiment is basically the same and will not be described again here.

[0177] Step 202: when the keyboard display and hiding operation is detected, determine the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation.

[0178] In this embodiment, step 202 and Figure 1 Step 102 in the corresponding embodiment is basically the same and will not be described again here.

[0179] Step 203, determining the target duration between the triggering moment of the keyboard display and hiding operation and the current moment.

[0180] In this embodiment, the target duration may represent the time period between the triggering moment of the keyboard display and hiding operation and the current moment.

[0181] Step 204: Based on the target duration and the keyboard display and hiding operation, determine the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation, wherein the moving distance is greater than or equal to the keyboard height.

[0182] In this embodiment, the real-time keyboard height can be determined based on different target durations and keyboard display and hiding operations, that is, the keyboard height changes accordingly with the value of the time period.

[0183] In some optional implementations of this embodiment, the following method may be used to determine the keyboard height of the Android soft keyboard displayed or hidden by the keyboard display and hide operation based on the target duration and the keyboard display and hide operation:

[0184] In a case where the keyboard display and hiding operation instruction displays the Android soft keyboard, it is determined that a keyboard height of the Android soft keyboard displayed by the keyboard display and hiding operation instruction is positively correlated with the target duration in a first time period.

[0185] The first time period represents the time period from when the Android soft keyboard is completely hidden to when it is completely displayed.

[0186] When the Android soft keyboard is completely hidden, the keyboard height of the Android soft keyboard can be determined to be 0% of the target height. When the Android soft keyboard is fully displayed, the keyboard height of the Android soft keyboard can be determined to be 100% of the target height.

[0187] As an example, the first time period from when the Android soft keyboard is completely hidden to when it is fully displayed may include multiple time points, and each time point may correspond to the 0th frame, the 1st frame, the 2nd frame, the 3rd frame, ... the nth frame in the process from when the Android soft keyboard is hidden to when it is displayed. Then, the keyboard heights in the first time period may be: 0% of the target height, 10% of the target height, 20% of the target height, 30% of the target height, ... 100% of the target height.

[0188] In the case where the keyboard display and hiding operation indicates hiding the Android soft keyboard, determining that the keyboard height of the Android soft keyboard hidden by the keyboard display and hiding operation indicates is negatively correlated with the target duration in a second time period, wherein the second time period represents the time period from when the Android soft keyboard is fully displayed to when it is fully hidden.

[0189] When the Android soft keyboard is completely hidden, the keyboard height of the Android soft keyboard can be determined to be 0% of the target height. When the Android soft keyboard is fully displayed, the keyboard height of the Android soft keyboard can be determined to be 100% of the target height.

[0190] As an example, the second time period when the Android soft keyboard is fully displayed to fully hidden may include multiple time points, and each time point may correspond to the 0th frame, 1st frame, 2nd frame, 3rd frame...nth frame in the process of the Android soft keyboard being displayed to being hidden. Then, the keyboard heights in the second time period may be: 100% of the target height, 90% of the target height, 80% of the target height, 70% of the target height...0% of the target height.

[0191] Here, animation (such as gradient animation) can be used to control the display or hiding of the Android soft keyboard, expression page, and function page. Set a horizontal differentiator to control the page to be displayed smoothly or folded smoothly. Among them, the page includes an Android soft keyboard, an expression page, and a function page. For example, when a user clicks on the expression page display control, the currently displayed soft keyboard or function page is folded or placed at the bottom layer, and the expression page is controlled to be displayed smoothly and silky. When a user clicks on the function page display control, the currently displayed soft keyboard or expression page is folded or placed at the bottom layer, and the function page is controlled to be displayed smoothly and silky. Here, smooth and silky is relative to jumping. The height is divided into multiple height value slices, so that a smooth and silky gradient effect can be achieved by moving frame by frame.

[0192] In addition, making the soft keyboard, expression page, and function page appear and retract smoothly means that when they appear smoothly, the page content of the target page can scroll up smoothly, with a kind of following display effect. After scrolling up, the latest information of the page content can be displayed above the soft keyboard, expression page, and function section without being blocked.

[0193] It can be understood that in the above optional implementation, since the keyboard height is positively correlated or negatively correlated with the target duration, the Android soft keyboard can be gradually displayed or hidden. For example, in the case where the keyboard display and hide operation indicates that the Android soft keyboard is displayed, since the keyboard height is positively correlated with the target duration, after the keyboard display and hide operation indicating the display of the Android soft keyboard is triggered, as time goes by, the target duration will gradually increase, and the keyboard height will increase accordingly (positive correlation), thereby achieving the effect of gradually displaying the Android soft keyboard; in the case where the keyboard display and hide operation indicates that the Android soft keyboard is hidden, since the keyboard height is negatively correlated with the target duration, therefore, after the keyboard display and hide operation indicating the hiding of the Android soft keyboard is triggered, as time goes by, the target duration will gradually increase, and the keyboard height will decrease accordingly (negative correlation), thereby achieving the effect of gradually hiding the Android soft keyboard.

[0194] Step 205: determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component.

[0195] In this embodiment, step 205 and Figure 1 Step 104 in the corresponding embodiment is basically the same and will not be described again here.

[0196] Step 206: display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and control the page content component to move the moving distance along the target direction.

[0197] In this embodiment, step 206 and Figure 1 Step 105 in the corresponding embodiment is basically the same and will not be described again here.

[0198] It should be noted that, in addition to the above contents, this embodiment may also include Figure 1 The corresponding technical features described in the corresponding embodiments are realized Figure 1 The technical effect of the page interaction method based on the compose framework is shown in the figure. For details, please refer to Figure 1 For the sake of brevity, the relevant description is not repeated here.

[0199] The page interaction method based on the compose framework provided in the embodiment of the present application can determine the keyboard height of the Android soft keyboard indicated to be displayed or hidden by the keyboard display and hiding operation based on the target duration between the triggering moment of the keyboard display and hiding operation and the current moment and the keyboard display and hiding operation. In this way, the gradual display or hiding of the Android soft keyboard can be achieved.

[0200] Figure 4 A schematic diagram of the structure of a page interaction device based on the compose framework provided in an embodiment of the present application. Specifically comprising:

[0201] A detection unit 401 is used to detect a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page;

[0202] A first determining unit 402 is configured to determine, when the keyboard display / hide operation is detected, a keyboard height of the Android soft keyboard indicated to be displayed or hidden by the keyboard display / hide operation;

[0203] A second determining unit 403 is used to determine a moving distance of the page content component displayed on the target page based on the keyboard height, wherein the moving distance is greater than or equal to the keyboard height;

[0204] A third determining unit 404 is used to determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component;

[0205] The control unit 405 is used to display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and control the page content component to move the moving distance along the target direction.

[0206] In one possible implementation,

[0207] When the display position of the Android soft keyboard is the bottom of the target page, and the keyboard display and hiding operation indicates that the Android soft keyboard is displayed, the target direction indicates upward;

[0208] When the display position of the Android soft keyboard is the lower middle part of the target page and the keyboard display and hiding operation indicates hiding the Android soft keyboard, the target direction indicates downward.

[0209] In a possible implementation, determining the keyboard height of the Android soft keyboard indicated by the keyboard display / hiding operation includes:

[0210] Determine the target duration between the triggering moment of the keyboard display and hiding operation and the current moment;

[0211] Based on the target duration and the keyboard display and hiding operation, determine the keyboard height of the Android soft keyboard that is displayed or hidden as indicated by the keyboard display and hiding operation.

[0212] In a possible implementation, the determining, based on the target duration and the keyboard display / hide operation, the keyboard height of the Android soft keyboard indicated by the keyboard display / hide operation to be displayed or hidden includes:

[0213] In the case where the keyboard display and hiding operation indicates that the Android soft keyboard is displayed, determining that a keyboard height of the Android soft keyboard displayed by the keyboard display and hiding operation indication in a first time period is positively correlated with the target duration, wherein the first time period indicates a time period from when the Android soft keyboard is completely hidden to when it is completely displayed;

[0214] In the case where the keyboard display and hiding operation indicates hiding the Android soft keyboard, determining that the keyboard height of the Android soft keyboard hidden by the keyboard display and hiding operation indicates in a second time period is negatively correlated with the target duration, wherein the second time period indicates the time period from when the Android soft keyboard is fully displayed to when it is fully hidden.

[0215] In a possible implementation, the detecting a keyboard display / hide operation triggered by a target page includes:

[0216] Monitoring the keyboard display and hiding operation triggered by the target page through the page content component of the target page to detect the keyboard display and hiding operation, wherein the width of the page content component is 0 pixels; and

[0217] The determining the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation includes:

[0218] The keyboard height of the Android soft keyboard displayed or hidden by the keyboard display and hiding operation indication is determined through the page content component.

[0219] In a possible implementation, the detecting a keyboard display / hide operation triggered by a target page includes:

[0220] When it is detected that the target input box of the target page acquires the focus, it is determined that a keyboard display-hiding operation of an Android soft keyboard indicating display of the target page is detected.

[0221] In a possible implementation, the target page displays a control for triggering display or hiding of the expression page, and the target page also displays a control for triggering display or hiding of the function page.

[0222] After determining the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation, the device further includes:

[0223] A fourth determining unit (not shown in the figure) is used to determine the target height of the Android soft keyboard on the target page as the display height of the expression page when a triggering operation on the expression page is detected;

[0224] The first display and hide unit (not shown in the figure) is used to display or hide the expression page according to the display height.

[0225] a fifth determining unit (not shown in the figure), configured to, when a triggering operation on the function page is detected, determine the target height of the Android soft keyboard on the target page as the display height of the function page;

[0226] The second display and hiding unit (not shown in the figure) is used to display or hide the function page according to the display height.

[0227] In a possible implementation, controlling the page content component to move the moving distance along the target direction includes:

[0228] When the blank height of the page content is smaller than the moving distance, the page content component is controlled to move the moving distance along the target direction.

[0229] In a possible implementation, before detecting the keyboard display / hide operation triggered by the target page, the device further includes:

[0230] Controls the closing of the response to the Android system's soft keyboard pop-up.

[0231] The page interaction device based on the compose framework provided in this embodiment can be as follows Figure 4 The page interaction device based on the compose framework shown in can execute all the steps of the above-mentioned page interaction methods based on the compose framework, and then achieve the technical effects of the above-mentioned page interaction methods based on the compose framework. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.

[0232] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 5 The electronic device 500 shown includes: at least one processor 501, a memory 502, at least one network interface 504 and other user interfaces 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 505 is not shown in FIG. Figure 5 Various buses are labeled as bus system 505 .

[0233] The user interface 503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0234] It can be understood that the memory 502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0235] In some implementations, the memory 502 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 5021 and an application program 5022 .

[0236] Among them, the operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 5022.

[0237] In this embodiment, by calling the program or instruction stored in the memory 502, specifically, the program or instruction stored in the application 5022, the processor 501 is used to execute the method steps provided by each method embodiment.

[0238] The method disclosed in the above embodiment of the present application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.

[0239] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.

[0240] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0241] The electronic device provided in this embodiment may be Figure 5 The electronic device shown in can execute all the steps of the above-mentioned page interaction methods based on the compose framework, and thus achieve the technical effects of the above-mentioned page interaction methods based on the compose framework. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.

[0242] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0243] When one or more programs in the storage medium can be executed by one or more processors, the page interaction method based on the compose framework executed on the electronic device side can be implemented.

[0244] The above-mentioned processor is used to execute the page interaction program based on the compose framework stored in the memory to implement the following steps of the page interaction method based on the compose framework executed on the electronic device side.

[0245] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0246] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0247] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0248] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A page interaction method based on the compose framework, characterized in that: The method comprises: Detecting a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page; In the case where the keyboard display and hiding operation is detected, determining the keyboard height of the Android soft keyboard indicated by the keyboard display and hiding operation; Based on the keyboard height, determining a moving distance of the page content component displayed on the target page, wherein the moving distance is greater than or equal to the keyboard height; Determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component; Display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and control the page content component to move the moving distance along the target direction.

2. The method according to claim 1, characterized in that: The method further comprises: Create an object that implements the global layout listener interface, call the initialization function of the page content component, and set the layout callback listener for the page content component; When the keyboard display / hide operation is detected and the global drawing of the page content component is monitored to be completed, the initial height of the page content component and the instantaneous height of the page content component are compared; In the case where the initial height and the instantaneous height are inconsistent, determining that the keyboard display and hiding operation indicates displaying the Android soft keyboard, and the target direction indicates upward; When the initial height and the instantaneous height are consistent, it is determined that the keyboard display and hiding operation indicates hiding the Android soft keyboard, and the target direction indicates downward.

3. The method according to claim 2, characterized in that The method further comprises: In the case that the initial height and the instantaneous height are inconsistent, calling a function for obtaining a window visual display frame, and obtaining the size information and position information of the viewable area of ​​the page content component through the function for obtaining a window visual display frame; Fill the size information and the position information into the rectangle attribute of the callback function; Calling the callback function, obtaining a height parameter of the rectangle attribute from the callback function, and determining the height parameter as the instantaneous height; Obtaining the initial height; A pixel difference between the initial height and the instantaneous height is calculated, and the pixel difference is determined as the keyboard height of the Android soft keyboard.

4. The method according to claim 2, characterized in that: The method further comprises: Determine the target duration between the triggering moment of the keyboard display and hiding operation and the current moment; In the case where the keyboard display and hiding operation indicates that the Android soft keyboard is displayed, determining that the keyboard height of the Android soft keyboard displayed by the keyboard display and hiding operation indicates that the keyboard height is positively correlated with the target duration in a first time period, wherein the first time period indicates a time period from when the Android soft keyboard is completely hidden to when it is completely displayed; In the case where the keyboard display and hiding operation indicates hiding the Android soft keyboard, determining that the keyboard height of the Android soft keyboard hidden by the keyboard display and hiding operation indicates is negatively correlated with the target duration in a second time period, wherein the second time period represents the time period from when the Android soft keyboard is fully displayed to when it is fully hidden.

5. The method according to claim 3, characterized in that: The method further comprises: Setting a blank layer for the page content component, and setting the height of the blank layer to the pixel difference; Setting the blank layer at the bottom of the page content component; Setting the bottom padding value of the content padding attribute to the pixel difference value through the content padding attribute of the page content component; Control the page content component to move upward by the pixel difference.

6. The method according to claim 3, characterized in that The method further comprises: Detecting an expression page display operation triggered by the target page; The height of the expression page is set to the pixel difference, and the expression page is controlled to move by the pixel difference, wherein the expression page covers the Android soft keyboard.

7. The method according to claim 3, characterized in that The method further comprises: Detecting a function page display operation triggered by the target page; The height of the function page is set to the pixel difference value, and the function page is controlled to move by the pixel difference value, wherein the function page covers the Android soft keyboard.

8. The method according to claim 6 or 7, characterized in that: The method further comprises: Set the horizontal difference device to control the smooth display and smooth folding of the page.

9. The method according to any one of claims 1 to 8, characterized in that: Before detecting the keyboard display and hiding operation triggered by the target page, the method further includes: Controls the closing of the response to the Android system's soft keyboard pop-up.

10. A page interaction device based on the compose framework, characterized in that: The device comprises: A detection unit, used to detect a keyboard display and hiding operation triggered by a target page, wherein the keyboard display and hiding operation indicates displaying or hiding an Android soft keyboard on the target page; A first determining unit is used to determine the keyboard height of the Android soft keyboard indicated to be displayed or hidden by the keyboard display and hiding operation when the keyboard display and hiding operation is detected; A second determining unit, configured to determine a moving distance of a page content component displayed on the target page based on the keyboard height, wherein the moving distance is greater than or equal to the keyboard height; A third determining unit is used to determine a target direction that matches the keyboard display and hide operation, wherein the target direction represents a moving direction of the page content component; A control unit is used to display or hide the Android soft keyboard according to the instruction of the keyboard display and hide operation, and to control the page content component to move the moving distance along the target direction.

11. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the page interaction method based on the compose framework of any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the page interaction method based on the compose framework of any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Method and apparatus for polymorphic serialization

    CN103119586A

  • Optimizing content layout on foldable devices

    CN115668118A

  • The method of inputtimg special character

    KR1020170075687A

  • The method of changing a part of character in the characters which is allocated on the button of keyboard

    KR1020180118096A