Method and related device for displaying floating window
By setting rounded corner parameters and inner margins, the rounded corner cropping and hard synthesis of floating windows is solved, and the problems of unsightly and high power consumption in the existing technology are solved, and efficient and beautiful floating window display is achieved.
Patent Information
- Application Number
- CN202311849299.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2043-12-28
AI Technical Summary
The prior art is difficult to display suspended windows efficiently and aesthetically, especially when the floating windows contain SurfaceViews, the rounded corner cutting method has problems such as high power consumption and the top and bottom bars blocking content.
By setting rounded corner parameters and inner margins, the rounded corner cropping of the floating window is achieved, ensuring that rounded corner cropping is achieved through hard synthesis, reducing power consumption and minimizing the occlusion of the application content by the top bar and the bottom bar as much as possible.
It realizes a floating window with rounded square corners when included in the SurfaceView, which reduces the power consumption of electronic devices, improves the aesthetics of the floating window, and reduces the obstruction of content by the top and bottom bars.
Smart Images

Figure CN118444805B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to electronic display technology, and more particularly to a method for displaying a floating window and related devices. Background Art
[0002] Electronic devices support displaying a floating window of another application while displaying a user interface of one application, so that a user can observe the user interfaces of two applications at the same time. How to display a floating window efficiently and beautifully is an urgent problem to be solved in the art. Summary of the invention
[0003] The present application provides a method and related device for displaying a floating window, which can not only realize rounded corner cutting of the floating window, but also ensure that whether the floating window contains a SurfaceView or not, the electronic device performs rounded corner cutting of the floating window through hard synthesis, thereby reducing the power consumption of the electronic device. In addition, the method for displaying a floating window provided in the latter embodiment of the present application minimizes the obstruction of the top bar and bottom bar of the floating window to the content in the application, making it more beautiful.
[0004] In a first aspect, the present application provides a method for displaying a floating window, receiving a first operation, the first operation is used to generate a first floating window, the first floating window includes a first user interface of a first application, the first user interface includes a surface view, and the surface view of the first user interface is used to display dynamically changing content;
[0005] Setting the rounded corner parameters of the first floating window, the rounded corner parameters including the rounded corner parameters of the first layer, the first layer including the root node view of the first user interface;
[0006] Setting a padding of the first floating window, where the padding indicates a position of the first user interface in the first floating window;
[0007] Draw the first floating window according to the rounded corner parameter and the inner margin;
[0008] The first floating window is displayed, and the first floating window is in a rounded square shape.
[0009] By implementing the above method, not only can the rounded square display be realized, but also the top bar and bottom bar in the floating window will not block the user interface, and the indicators of the top bar and bottom bar in the floating window will not block the content in the user interface. In addition, the rounded square display can still be realized when the position and size of the floating window are changed in response to user operations.
[0010] In combination with the method described in the first aspect, the rounded corner parameter includes a rounded corner radius, and the inner margin is greater than or equal to the rounded corner radius. This ensures that the floating window displays rounded corners, and the right angles of SurfaceView will not be seen.
[0011] In a possible implementation, the electronic device can set the four fillet radii of the floating window separately. Preferably, the electronic device can set the same fillet radius for the upper left and upper right fillets of the floating window, and set the same fillet radius for the lower left and lower right fillets of the floating window.
[0012] In combination with the method described in the first aspect, the first floating window also includes a top bar and a bottom bar, and the rounded corner parameters also include rounded corner parameters of a second layer, and the second layer is used to display the top bar and the bottom bar of the first floating window.
[0013] In combination with the method described in the first aspect, the top bar and the bottom bar in the first floating window are transparent.
[0014] In combination with the method described in the first aspect, the method also includes: receiving an operation acting on the top bar of the first floating window to adjust the position of the first floating window; or receiving an operation acting on the bottom bar of the first floating window to adjust the size of the first floating window.
[0015] In combination with the method described in the first aspect, the rounded corner parameter is obtained based on the height of the top bar and the bottom bar in the first floating window, and the rounded corner radius of the rounded corner parameter is less than or equal to the height of the top bar and the bottom bar in the first floating window. In this way, not only can the floating window be rounded in any style, but also the top bar and the bottom bar in the floating window can be smoothly transitioned to the two sides of the floating window.
[0016] In combination with the method described in the first aspect, the rounded corner parameter is a fixed value.
[0017] In combination with the method described in the first aspect, the inner margin includes: a top margin and a bottom margin, the top margin indicates the position where the root node view and the surface view of the first user interface start to be drawn in the first floating window, and the bottom margin indicates the position where the root node view and the surface view of the first user interface end to be drawn in the first floating window.
[0018] In combination with the method described in the first aspect, the first layer is smaller than the second layer, and the inner margin includes: a top margin or a bottom margin, the top margin indicates the position where the root node view and the surface view of the first user interface start to be drawn in the first floating window, and the bottom margin indicates the position where the root node view and the surface view of the first user interface end to be drawn in the first floating window.
[0019] In combination with the method described in the first aspect, after displaying the floating window, the method further includes:
[0020] Receive a second operation, the second operation being used to switch the first user interface displayed in the first floating window to a second user interface, the second user interface including a surface view; draw the second user interface in the first floating window according to the inner margin; and switch the first user interface displayed in the first floating window to the second user interface.
[0021] In combination with the method described in the first aspect, after displaying the first floating window including the first user interface, the method further includes:
[0022] A third operation is received, where the third operation is used to generate a second floating window, where the second floating window includes a user interface of a second application; and the second floating window is displayed while the first floating window is displayed, where the second floating window is in a rounded square shape.
[0023] In this way, the electronic device can display floating windows of multiple applications.
[0024] In combination with the method described in the first aspect, the method includes:
[0025] A third operation is received, where the third operation is used to generate a third floating window, where the third floating window includes a third user interface of a third application, where the third user interface does not include a surface view; corner fillet parameters of the third floating window are set, where the corner fillet parameters of the third floating window include corner fillet parameters of a third layer, where the third layer includes a root node view of the third user interface; the third floating window is drawn according to the corner fillet parameters of the third floating window; and the third floating window is displayed, where the third floating window is a rounded square.
[0026] In this way, the electronic device can also display in a rounded square when the floating window does not include SurfaceView.
[0027] In a second aspect, the present application provides an electronic device, comprising a folding screen, one or more memories, and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method as described in any one of the first aspects.
[0028] In a third aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute a method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1A-Figure 1D The floating window architecture provided in the embodiment of the present application is exemplified.
[0030] Figure 2A-2GAn example of a user interface related to a floating window displayed by an electronic device in an embodiment of the present application is provided.
[0031] Figure 2H-2J An example of a user interface related to a floating window displayed by an electronic device in an embodiment of the present application is provided.
[0032] Figure 3 A flowchart of a method for displaying a floating window provided in an embodiment of the present application.
[0033] Figure 4 An OS interaction diagram corresponding to a method for displaying a suspended window provided in an embodiment of the present application.
[0034] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0035] Figure 6 A software structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0037] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0038] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0039] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0040] As a system function of an electronic device, a floating window can be used to display the user interface of a certain application. The floating window can be displayed superimposed on the user interface of another application.
[0041] The floating window may include: a user interface, a top bar, and a bottom bar. The user interface may be provided by the application, and the top bar and the bottom bar may be generated by the system. In a possible implementation, the top bar and the bottom bar may also be generated by the application after the application receives the top bar and the bottom bar sent by the system.
[0042] This way, users can interact with two or more applications at the same time.
[0043] First, the architectures of two floating windows provided in the embodiments of the present application are introduced.
[0044] Figure 1A A first floating window architecture is shown. Figure 1A (a) in FIG. 1 may represent a floating window of the first architecture displayed by an electronic device. Figure 1A As shown in (b) in FIG, the user interface provided by the application in the floating window, the top bar and the bottom bar are all drawn in the same layer, such as the Surface Layer. In the first architecture, the top bar, the bottom bar and the user interface provided by the application in the floating window can all be generated by the application. Figure 1A As shown, using the first floating window architecture, the top bar and the bottom bar may block the user interface in part of the application. In this way, not only the floating window is not beautiful, but also the user cannot interact with the blocked area.
[0045] Figure 1B A second floating window architecture is shown. Figure 1B (a) in FIG. 1 may represent a floating window of the second architecture displayed by an electronic device. Figure 1B As shown in (b), the user interface provided by the application in the floating window is drawn in one layer, and the top bar and bottom bar in the floating window are drawn in another layer. In the second architecture, the top bar and bottom bar in the floating window can be provided by the system, and the user interface of the application is provided by the application. Figure 1B As shown, using the second floating window architecture, the top bar and the bottom bar can be set to be transparent so as not to block too much content in the application.
[0046] Exemplarily, there are two layers in the second floating window architecture, where the layer for displaying the user interface of the application may refer to Decorview, and the layer for displaying the top bar and bottom bar of the floating window may refer to WindowDecoration (also known as DecorCaptionView). Window Decoration may refer to a layer for carrying window decoration elements (such as top bar, bottom bar), etc., which affects the appearance of the window.
[0047] In the above two floating window architectures, the user interface displayed in the floating window may include a surface view SurfaceView. SurfaceView is used to display dynamically changing content. It is generally used in applications that need to update drawing synthesis in real time (such as game applications, video applications), and it is drawn independently of Decorview. For example, when there is content in the application that needs to be drawn for each frame, such as videos and games, SurfaceView will be used to implement it.
[0048] Furthermore, in order to make the floating window more beautiful, the electronic device can set the floating window to have rounded corners.
[0049] For example, taking the application set as the floating window of the electronic device as a social application as an example, after the floating window is set to have rounded corners, the floating window of the first architecture can be as follows: Figure 1C As shown. Figure 1C In the example, the top bar and bottom bar of the floating window A block some content (such as the chat box title, input box, etc.) in the social application. Figure 1D As shown. Figure 1D In the example, the top bar and the bottom bar of the floating window B are set to be transparent, so that the content in the social application is not blocked too much.
[0050] The following introduces relevant application scenarios involved in the embodiments of the present application.
[0051] Figure 2A-2G The following user interface is shown in which the electronic device displays a floating window in an embodiment of the present application. The following user interface is introduced by taking the displayed floating window including SurfaceView as an example.
[0052] like Figure 2A As shown, the user interface 200 is a user interface provided by a video application of an electronic device. For example, the user interface 200 may be a user interface for watching live broadcasts. The user interface 200 may include, but is not limited to: a live broadcast title, a live broadcast screen, a comment area, a comment input box, and the like.
[0053] Exemplarily, the electronic device may respond to an upward sliding operation in the user interface 200 and display the user interface 210. The upward sliding operation includes: an operation of sliding upward from the bottom of the user interface 200. Figure 2B As shown, the user interface 210 electronic device displays the user interfaces of multiple ongoing tasks (or applications). The user interface 210 may include, but is not limited to, task 211. Among them, task 211 is used to indicate the above-mentioned video application. The electronic device can respond to a click operation on task 211 and redisplay the user interface 200.
[0054] The electronic device may display the user interface 220 in response to the long press operation on the task 211. Figure 2C As shown, the user interface 220 may include: a task 211, a lock control 221, a split screen control 222, a floating window control 223, and a setting control 224. The electronic device may lock the video application to run in the background in response to a click operation on the lock control 221. The electronic device may select another application to be set to be displayed in split screen with the video application in response to a click operation on the split screen control 222.
[0055] Exemplarily, the electronic device may respond to a click operation on the floating window control 223 to set the video application as a floating window.
[0056] As another example, the electronic device may respond to a downward sliding operation in the user interface 200 and display the user interface 230. Figure 2D As shown, the user interface 230 is a status bar user interface provided by the electronic device. The user interface 230 may include, but is not limited to, a floating window control 231. The electronic device may respond to a click operation on the floating window control 231 and set the above video application as a floating window.
[0057] In the embodiments of the present application, the above two ways of setting as floating windows are only exemplary, and more ways of setting a certain application as a floating window may be included. For example, when the electronic device displays the user interface of a certain application, a notification message of another application is displayed. The electronic device may respond to a sliding operation on the above notification message and display a floating window of another application. This is not limited.
[0058] The following describes several methods of setting the floating window to rounded corners provided by the embodiments of the present application in combination with the user interface:
[0059] Method 1: Directly perform rounded corner cutting on the Task Surface of the floating window.
[0060] In some implementations, a task is a set of activities. A task can span multiple activities and allow users to switch between different activities. For example, when an electronic device displays a floating window, the current task may contain activities for indicating two applications. At this time, there are two Task Surfaces, one for representing the application in the floating window. The Task Surface of the floating window can be understood as a layer synthesized by the electronic device before displaying the floating window.
[0061] In an embodiment of the present application, since the electronic device will generate a Task Surface in the process of generating a floating window using the above two floating window architectures, method one can be applied to the above two floating window structures. When using method one, it is necessary to perform rounded corner cropping on the Task Surface of each floating window frame. The method of performing rounded corner cropping on each frame when the application is running needs to be implemented by the GPU, so this method can also be called soft synthesis. In view of this, soft synthesis consumes high power. Soft synthesis can be applied to, for example, game applications and video applications.
[0062] When the first method is applied to the first floating window frame, the electronic device can display the user interface 250 in response to a click operation on the floating window control 223 or the floating window control 231. Figure 2F As shown, the user interface 250 may include but is not limited to: a desktop 251 and a floating window 252. The floating window 252 may be presented in the form of a rounded square. However, the top bar and the bottom bar in the floating window 252 block the content in the floating window 252.
[0063] When the first method is applied to the second floating window frame, the electronic device can display the user interface 260 in response to a click operation on the floating window control 223 or the floating window control 231. Figure 2GAs shown, the user interface 260 may include but is not limited to: a desktop 261 and a floating window 262. The floating window 262 may be presented in the form of a rounded square. The top bar and the bottom bar in the floating window 262 may be transparent. However, the indicators contained in the top bar and the bottom bar may still block part of the content of the user interface.
[0064] Method 2: Set the rounded corner properties for Decorview and DecorCaptionView of the floating window.
[0065] In an embodiment of the present application, method 2 can be applicable to the second floating window structure mentioned above. Specifically, method 2 may refer to: it is only necessary to perform rounded corner cropping once during the first generation of the floating window, during the drawing process of the Decorview and DecorCaptionView of the floating window. There is no need to perform rounded corner cropping when synthesizing the Surface of the floating window in each subsequent frame. The method of performing rounded corner cropping only when the floating window is generated for the first time needs to be implemented by the CPU, so this method can also be called hard synthesis. In view of this, hard synthesis has lower power consumption.
[0066] However, if the floating window contains a SurfaceView, the second method cannot be used to round the corners of the floating window. This is because the rounded corner properties set for the Decorview of the floating window are not effective for the SurfaceView.
[0067] For example, when the electronic device sets the rounded corner attribute of the floating window using the second method, the electronic device can display the user interface 240 in response to the click operation on the floating window control 223 or the floating window control 231. Figure 2E As shown, the user interface 240 may include but is not limited to: a desktop 241 and a floating window 242. The floating window 242 is presented in the form of a rectangular square. For example, the four corners of the floating window 242 are black because the electronic device draws and generates a SurfaceView. The electronic device fails to successfully set the four corners of the floating window 242 to rounded corners.
[0068] Method 3: Set the rounded corner properties for the Surface Layer in the floating window, and perform rounded corner cutting for the SurfaceView in the floating window.
[0069] In the embodiment of the present application, method three can be applied to the first floating window structure mentioned above. If the floating window does not contain SurfaceView, the rounded corner properties can be set directly for the Surface Layer; if the floating window contains SurfaceView, in addition to setting the rounded corner properties for the Surface Layer, the SurfaceView will also be rounded when the Surface is synthesized for the floating window in each frame. In this way, the process of rounding the corners of SurfaceView will still use soft synthesis, which consumes high power.
[0070] Exemplarily, when the electronic device sets the rounded corners of the floating window using the third method described above, the electronic device may display the user interface 250 in response to a click operation on the floating window control 223 or the floating window control 231 .
[0071] In general, when the floating window includes SurfaceView, the above three ways of setting the floating window to rounded corners have some problems, including:
[0072] Method 1 consumes a lot of power, and when the first floating window architecture is applied in method 1, the top bar and the bottom bar block part of the content of the user interface. When the second floating window architecture is applied in method 1, the indicators in the top bar and the bottom bar also block part of the content of the user interface.
[0073] The above method 2 cannot achieve the rounded corner setting of the floating window;
[0074] The above method 3 also has the problem of high power consumption and the indicators of the top bar and the bottom bar partially covering the content of the user interface.
[0075] In order to solve the problems arising from the above-mentioned situations, an embodiment of the present application provides a method for displaying a floating window, which is implemented based on the above-mentioned second floating window frame.
[0076] In this method, when the user interface displayed by the floating window includes SurfaceView, the inner margin (i.e., padding value) is set to change the distance between the user interface in the floating window and the upper and lower borders of the floating window, so that the right angle of SurfaceView can be displayed in an area separated from the upper and lower borders of the floating window by a certain distance, and will not be displayed in the area outside the rounded corners of the floating window. In this way, the right angle of SurfaceView will not be exposed, and the user can see the floating window with rounded corners.
[0077] In this way, the electronic device can display a floating window in a rounded square shape when the user interface displayed by the floating window includes SurfaceView. In addition, the electronic device can implement the rounded corner setting for the floating window when the floating window is first generated, without the need to perform the rounded corner setting for the floating window when updating the user interface in each subsequent frame, which consumes less power. The method provided in the embodiment of the present application uses the second floating window architecture, which can also make the top bar and bottom bar of the floating window not block the content in the application, making it more beautiful.
[0078] The following describes a user interface for displaying a floating window provided in an embodiment of the present application.
[0079] Figure 2H-2J It is exemplified that an embodiment of the present application provides another user interface for displaying a floating window on an electronic device.
[0080] Exemplarily, the electronic device may display the user interface 270 in response to a click operation on the floating window control 223 or the floating window control 231 .
[0081] like Figure 2H As shown, the user interface 270 may include but is not limited to: a desktop 271, a floating window 272. The floating window 272 may be presented in the form of a rounded square. The top bar 272A and the bottom bar 272B in the floating window 272 may be white, and they will not block the content in the floating window 272. In addition, the electronic device rounds the floating window 272 through hard synthesis. For details, please refer to the following process, which will not be described in detail here.
[0082] Exemplarily, the electronic device may respond to a double-click operation on the floating window 272 , exit the floating window, and enter a full-screen display of a video application, that is, display the user interface 200 .
[0083] For example, the electronic device may respond to a long press and slide operation on the top bar 272A, change the position of the floating window in the user interface 270, and then display the user interface 280. Fig.2I As shown, the user interface 280 may include but is not limited to a desktop 281 and a floating window 282. The floating window 272 may also be presented in the form of a rounded square. The top bar 282A and the bottom bar 282B in the floating window 282 may be white, and they will not block the content in the floating window 282. The above-mentioned floating window 272 and the floating window 282 are not in the same position.
[0084] For example, the electronic device may respond to the long press and slide operation on the bottom bar 282B, change the size of the floating window, and then display the user interface 290. Figure 2JAs shown, the user interface 290 may include but is not limited to a desktop 291 and a floating window 292. The floating window 292 may also be presented in the form of a rounded square. The top bar 292A and the bottom bar 292B in the floating window 292 may be white, and they will not block the content in the floating window 292. The sizes of the above-mentioned floating window 282 and the floating window 292 are inconsistent.
[0085] The floating window provided in the embodiment of the present application can not only be displayed in a rounded square shape, so that not only the top bar and the bottom bar in the floating window will not block the user interface, but also the indicators in the top bar and the bottom bar in the floating window will not block the content in the user interface. It can also be displayed in a rounded square shape when the position and size of the floating window are changed in response to user operations.
[0086] The following describes a method flow for displaying a floating window provided in an embodiment of the present application.
[0087] Figure 3 The flowchart of the method for displaying a floating window provided by the embodiment of the present application is exemplarily shown. By way of example, the following method is introduced by taking the second floating window frame as an example, and the method flow includes:
[0088] S301: An electronic device receives a first operation, where the first operation is used to instruct to set a first application as a floating window.
[0089] In some implementations, the electronic device setting the first application as a floating window may mean: displaying the user interface provided by the first application in the form of a floating window superimposed on the user interface provided by other applications on the screen. For example, the first application is a video application, such as Figure 2H As shown, the user interface provided by the video application is displayed on the screen in the form of a floating window 272 and superimposed on the desktop 271 provided by the system application.
[0090] The first operation may include, but is not limited to, a click operation and a slide operation. Figure 2C The click operation of the floating window control 223 shown in the figure may be directed to Figure 2D The first operation may also be a sliding operation of the pointer on the notification that pops up when the application A is displayed, and the other application may be the application A.
[0091] In the embodiment of the present application, the type of the first operation and the types of other application programs are merely illustrative and are not limiting.
[0092] The first application may include: a system application in the electronic device, or may refer to a third-party application. Optionally, the first application does not include a system application for displaying a desktop.
[0093] S302: The electronic device obtains corner fillet parameters set for the floating window.
[0094] The above-mentioned rounded corner parameters are set by the electronic device, and the rounded corner parameters include: the radii of the four rounded corners of the floating window.
[0095] In a possible implementation, the electronic device may set the rounded corner parameters based on the top bar height and the bottom bar height of the floating window. In a possible implementation, the electronic device may set the top bar height and the bottom bar height of the floating window based on the rounded corner parameters. In the embodiment of the present application, this is not limited.
[0096] Specifically, the electronic device can set any value less than the height of the top bar and the bottom bar of the floating window as the radius of the rounded corner of the floating window. In this way, not only can the floating window be rounded in any style, but also the top bar and the bottom bar in the floating window can be smoothly transitioned from the two sides of the floating window.
[0097] Preferably, the electronic device can set the height of the top bar and the bottom bar of the floating window to the radius of the rounded corners of the floating window. In this way, the rounded corners of the floating window are fullest and present the best visual effect. In the embodiment of the present application, the above rounded corner parameters are not limited.
[0098] In a possible implementation, the electronic device can set the four fillet radii of the floating window separately. Preferably, the electronic device can set the same fillet radius for the upper left and upper right fillets of the floating window, and set the same fillet radius for the lower left and lower right fillets of the floating window.
[0099] In some implementations, the electronic device may obtain the rounded corner parameters set for the two layers in the floating window. Figure 3 In the flowchart shown, the method for displaying a floating window provided in an embodiment of the present application is introduced by taking the case where the sizes of two layers are the same as an example.
[0100] The two layers may include: a root node view (Decorview) of the first user interface of the first application and a layer (Window Decoration) for displaying a top bar and a bottom bar of a floating window.
[0101] In some implementations, the electronic device may set the rounded corner parameters for the above two layers in different ways, but the rounded corners presented by the two layers are generally consistent. Exemplarily, the electronic device can obtain the rounded corner parameters set for Decorview through getOutlineProvider, and can also apply the rounded corner parameters set for Decorview in the process of drawing the floating window through setOutlineProviderNeeded. The electronic device can obtain the top rounded corner set for Window Decoration through caption_decor_title.xml, and the electronic device can obtain the bottom rounded corner set for WindowDecoration through caption_decor_tail.xml. In some implementations, the rounded corner parameters set by the electronic device for the floating window are fixed. In other words, the rounded corner effects presented by floating windows of different sizes may be different.
[0102] Optionally, the rounded corner parameters set by the electronic device for the floating window may be variable. The rounded corner parameters of the floating window may change as the size of the floating window changes. In other words, the rounded corner effects presented by floating windows of different sizes may also be the same.
[0103] S303: The electronic device determines whether the user interface of the current first application includes SurfaceView.
[0104] In some implementations, the electronic device may generate a floating window based on a user interface displayed by the first application when receiving the first operation.
[0105] Specifically, the electronic device can obtain various view types included in the user interface of the current first application. The electronic device can determine whether the user interface of the current first application includes SurfaceView.
[0106] Exemplarily, the user interface in the current first application may refer to user interface 200. In another exemplary embodiment, if the first operation is a sliding operation of the pointer on the notification, the user interface in the current first application may refer to the user interface of the first application displayed by the electronic device in response to the click operation on the notification. For example, if the notification is a notification of a new message of a social application, the user interface of the first application is a chat user interface of the new message.
[0107] If the user interface in the current first application does not include SurfaceView, execute S304; if the user interface in the current first application includes SurfaceView, execute S306.
[0108] Optionally, S302 may also be performed after S303. That is, the electronic device may first determine whether the user interface of the current first application includes SurfaceView, and then obtain the rounded corner parameters set for the floating window.
[0109] S304: If not included, the electronic device directly draws a synthetic floating window based on the rounded corner parameters.
[0110] In some implementations, if the user interface in the current first application does not include SurfaceView, it means that the user interface displayed in the floating window set for the first application does not include SurfaceView either.
[0111] In order not to block the content of the application, the top bar and the bottom bar of the floating window can be set to a transparent state. The electronic device can draw a composite floating window according to the rounded corner parameters set for the two layers (ie, Decorview and DecorCaptionView) in the floating window obtained in S302.
[0112] After executing S304, the electronic device synthesizes a floating window that does not include SurfaceView.
[0113] S305. The electronic device displays a floating window that does not include SurfaceView.
[0114] In some implementations, the electronic device can display a floating window that does not include a SurfaceView. At this time, the user interface displayed in the floating window is consistent with the content included in the user interface displayed by the first application when receiving the first operation. However, since the electronic device uses the entire screen to display the user interface of the first application and uses a floating window to display the user interface of the first application, the electronic device needs to adaptively adjust the content of the user interface of the first application displayed in the floating window. Therefore, the sizes of various controls, texts, and pictures in the user interface in the floating window may be inconsistent with those of the user interface of the first application displayed on the entire screen.
[0115] In some implementations, after the electronic device changes the position and size of the floating window, the floating window can still be displayed on the screen in the form of a rounded square. For example, the electronic device can change the position of the floating window in response to a long press and slide operation on the top bar of the floating window. The electronic device can also change the size of the floating window in response to a long press and slide operation on the bottom bar of the floating window.
[0116] For example, the first application may be a social application, and the floating window not including SurfaceView may be as follows: Figure 1Dshown.
[0117] S306: If included, the electronic device obtains the inner margin (ie, padding value) set for the floating window.
[0118] In some implementations, if the user interface in the current first application includes SurfaceView, it means that the user interface displayed in the floating window set for the first application also includes SurfaceView. If the electronic device directly draws the composite floating window according to the rounded corner parameters set for the two layers in the floating window obtained in S302, since SurfaceView does not set the rounded corners, the composite floating window is a rectangular square.
[0119] Therefore, when SurfaceView is included, the electronic device can obtain the padding value set for the floating window.
[0120] Here, setting the padding value refers to setting the distance between each border of the layer (eg, the top, bottom, left, and right sides) and the elements in the layer (eg, for representing the content of the application).
[0121] There are two ways to set padding values in electronic devices: setting a length value or setting a percentage value. The set length value can refer to a non-negative fixed length, such as 120px. The set percentage value can refer to a percentage of the layer length or width, such as 3%.
[0122] The electronic device may set one or two or three or four padding values. For example, when the number of padding values set is one, the padding value may be used to specify the distance between the content of the layer and the four sides of the layer. When the number of padding values set is two, the first padding value may be used to specify the distance between the content of the layer and the upper and lower sides of the layer, and the second padding value may be used to specify the distance between the content of the layer and the left and right sides of the layer. When the number of padding values set is three, the first padding value may be used to specify the distance between the content of the layer and the upper boundary of the layer, the second padding value may be used to specify the distance between the content of the layer and the left and right sides of the layer, and the third padding value may be used to specify the distance between the content of the layer and the lower boundary of the layer. When the number of padding values set is four, the first padding value may be used to specify the distance between the content of the layer and the upper boundary of the layer, the second padding value may be used to specify the distance between the content of the layer and the right boundary of the layer, the third padding value may be used to specify the distance between the content of the layer and the lower boundary of the layer, and the fourth padding value may be used to specify the distance between the content of the layer and the left boundary of the layer.
[0123] Specifically, the electronic device may obtain padding values set for the upper and lower sides of the root node view (ie, Decorview) of the first user interface in the floating window. Exemplarily, the electronic device may obtain padding values as follows: For example, padding: 120px 0px 20px; or padding: 120px 0px 20px 0px.
[0124] In some implementations, the electronic device can set the padding value according to the rounded corner parameters set for the floating window. In this way, the right angle of SurfaceView will not exceed the rounded corner range of the floating window. Specifically, the electronic device can set the rounded corner radius set for the floating window as the padding value. Preferably, the electronic device can set the height of the top bar and the bottom bar to the padding value.
[0125] For example, the padding value set by the electronic device for the upper border of Decorview in the floating window is consistent with the top bar width of the floating window, and the padding value set by the electronic device for the lower border of Decorview in the floating window is consistent with the bottom bar width of the floating window.
[0126] Optionally, when the sizes of the two layers of the floating window set by the electronic device are inconsistent, the electronic device may only obtain the padding value set for the upper border of the floating window or the padding value set for the lower border of the floating window. For example, the upper border, left border, and right border of Decorview coincide with those of DecorCaptionView, but the lower border of DecorCaptionView does not coincide with the lower border of Decorview. DecorCaptionView is larger than Decorview. For another example, the lower border, left border, and right border of Decorview coincide with those of DecorCaptionView, but the upper border of DecorCaptionView does not coincide with the upper border of Decorview. DecorCaptionView is larger than Decorview.
[0127] S307: The electronic device draws a synthetic floating window based on the rounded corner parameter and the padding value.
[0128] In some implementations, the electronic device may draw a composite floating window according to the rounded corner parameters set for the two layers in the floating window obtained in S302 and the padding value for the floating window obtained in S306.
[0129] Specifically, in the process of drawing the floating window, since the electronic device sets a padding value for Decorview, when drawing the view contained in Decorview, the electronic device needs to start drawing at a position with a certain distance from the upper boundary of Decorview, and stop drawing at a position with a certain distance from the lower boundary of Decorview. In other words, there are two areas in Decorview where no content in any application is drawn. The two undrawn areas are generally black.
[0130] In some implementations, although SurfaceView is independent of Decorview, the drawing area of SurfaceView is consistent with the drawing area set by Decorview. That is, when the electronic device draws the SurfaceView in the floating window, SurfaceView needs to start drawing at a position that is a certain distance away from the upper boundary of Decorview (i.e., the upper boundary of SurfaceView), and stop drawing at a position that is a certain distance away from the lower boundary of Decorview (i.e., the lower boundary of SurfaceView). In other words, the SurfaceView area where the electronic device draws the floating window is within the range excluding the above two areas in Decorview that are not drawn.
[0131] In some implementations, since the padding value is set based on the width of the top bar and the bottom bar, the two areas are exactly the areas in DecorCaptionView used to display the top bar and the bottom bar. In this case, no matter what color the top bar and the bottom bar of the floating window are set to, they will not block the content provided by the application in the floating window. Exemplarily, the top bar and the bottom bar of the floating window can be set to a transparent state or to any color, such as white. In the embodiments of the present application, this is not limited.
[0132] S308. The electronic device displays a floating window including SurfaceView.
[0133] In some implementations, the electronic device can display a floating window that includes a SurfaceView. At this time, the user interface displayed in the floating window is consistent with the content included in the user interface displayed by the first application when receiving the first operation. However, since the electronic device uses the entire screen to display the user interface of the first application and uses a floating window to display the user interface of the first application, the electronic device needs to adaptively adjust the content of the user interface of the first application displayed in the floating window. Therefore, the sizes of various controls, texts, and pictures in the user interface in the floating window may be inconsistent with those of the user interface of the first application displayed on the entire screen.
[0134] In some implementations, after the electronic device changes the position and size of the floating window, the floating window is still displayed on the screen in the form of a rounded square. For example, the electronic device can change the position of the floating window in response to a long press and slide operation on the top bar of the floating window. The electronic device can also change the size of the floating window in response to a long press and slide operation on the bottom bar of the floating window.
[0135] For example, the first application may be a video application, and the floating window including SurfaceView may be as follows: Figure 2H shown.
[0136] The implementation of the above method can not only realize the rounded corner cropping of the floating window, but also ensure that no matter whether the floating window contains SurfaceView, the electronic device performs the rounded corner cropping of the floating window through hard synthesis, thereby reducing the power consumption of the electronic device. In addition, the method for displaying the floating window provided in the later embodiment of the present application minimizes the obstruction of the top bar and bottom bar of the floating window to the content in the application, making it more beautiful.
[0137] In a possible implementation, after the floating window of the first application is opened, the electronic device can respond to operations on various controls in the floating window and change the user interface displayed in the floating window. The electronic device can change the user interface displayed in the floating window in the following cases:
[0138] Case 1: The user interface displayed in the floating window is changed from a user interface including SurfaceView to a user interface not including SurfaceView.
[0139] Case 2: The user interface displayed in the floating window is changed from a user interface that does not include SurfaceView to a user interface that includes SurfaceView.
[0140] In some implementations, the electronic device can implement situation 1 or situation 2 by itself according to the relevant settings of the application, or can respond to user operations to implement situation 1 or situation 2. In the embodiments of the present application, the method for implementing situation 1 or situation 2 is not limited.
[0141] Furthermore, since situation 1 or situation 2 may occur, the electronic device can determine whether the user interface of the currently drawn floating window includes SurfaceView each time the user interface of the application displayed in the floating window is updated after the floating window for the first application is generated for the first time.
[0142] Specifically, if the newly drawn user interface does not include SurfaceView, the electronic device directly draws the user interface according to the updated content, and displays the updated user interface in the floating window. It is worth noting that the electronic device here no longer needs to synthesize the floating window based on the rounded corner parameters. This is because after the floating window is generated for the first time, if relevant operations are performed on the floating window (such as changing the size and position of the floating window or canceling the display of the floating window), Decorview and DecorCaptionView are fixed, and the electronic device only updates the relevant content of Decorview and does not change the overall structure of Decorview. Therefore, the electronic device only needs to perform rounded corner cropping when the floating window is synthesized for the first time. When the updated user interface that does not contain SurfaceView is displayed in the floating window, there is no need to perform rounded corner cropping on the floating window, which has low power consumption and high efficiency.
[0143] If the newly drawn user interface includes SurfaceView, the electronic device can execute S306, that is, obtain the padding value set for the floating window. Then, the electronic device draws and synthesizes the current user interface according to the padding value. It is worth noting that the electronic device does not need to synthesize the floating window based on the rounded corner parameters here. This is because after the floating window is generated for the first time, if relevant operations are performed on the floating window (such as changing the size and position of the floating window or canceling the display of the floating window), Decorview and DecorCaptionView are fixed, and the electronic device only updates the relevant content of Decorview and does not change the overall structure of Decorview. For example, the electronic device can start drawing SurfaceView at a position with a certain distance from the upper boundary of Decorview according to the padding value, and stop drawing SurfaceView at a position with a certain distance from the lower boundary of Decorview. Therefore, the electronic device only needs to perform rounded corner cropping when synthesizing the floating window for the first time. When the updated user interface containing SurfaceView is displayed in the floating window, there is no need to perform rounded corner cropping for the floating window, which has low power consumption and high efficiency.
[0144] In another possible implementation, the electronic device may display multiple floating windows simultaneously. For example, after displaying the floating window set for the first application, the electronic device may respond to a user operation and display a floating window set for the second application.
[0145] In a possible implementation, if the floating window does not include a top bar and a bottom bar, the method for displaying a floating window provided in an embodiment of the present application may be applicable to the above two floating window architectures. Specifically, if the floating window set by the electronic device does not include a top bar and a bottom bar, the floating window only includes one layer, namely Decorview. In the case where the floating window includes a SurfaceView, the electronic device may draw the floating window according to the rounded corner parameters set for the floating window, for example, the rounded corner parameters and the inner margins set for Decorview. In the case where the floating window does not include a SurfaceView, the electronic device may draw the floating window according to the rounded corner parameters set for the floating window, for example, the rounded corner parameters and the inner margins set for Decorview.
[0146] In this way, the electronic device can not only realize the rounded corner cropping of the floating window, but also ensure that no matter whether the floating window contains SurfaceView, the electronic device can realize the rounded corner cropping of the floating window through hard synthesis, thereby reducing the power consumption of the electronic device. In addition, the method for displaying the floating window provided in the later embodiment of the present application minimizes the obstruction of the top bar and the bottom bar of the floating window to the content in the application, which is more beautiful.
[0147] Combine the following Figure 4 Introduction Figure 3 An operating system (OS) interaction diagram of an electronic device corresponding to the method flow in FIG.
[0148] Figure 4 The user operation module, judgment module, parameter acquisition module and view module shown are modules included in the electronic device for managing the synthesis of floating windows. For the definitions of these modules, please refer to the detailed description of the electronic device software architecture later. The specific functions of these modules have been recorded in detail in the following process and will not be repeated here.
[0149] like Figure 4 As shown, the OS interaction diagram of the method for displaying a floating window provided in the embodiment of the present application includes the following steps:
[0150] S401: A user operation module detects an operation of setting a floating window for a first application.
[0151] In some implementations, the user operation module can obtain the view type of the user interface of the current first application after detecting the operation of setting a floating window for the first application. Exemplarily, the user operation module can detect a click operation for setting a floating window. For the relevant introduction of S401, please refer to the detailed description in the above S301, which will not be repeated here.
[0152] S402: The user operation module sends the type of view included in the user interface of the current first application to the judgment module.
[0153] In some implementations, after obtaining the view type of the user interface of the current first application, the user operation module may send the view type to the determination module.
[0154] S403, the judgment module judges whether the view type includes the SurfaceView type.
[0155] In some implementations, if the judgment module determines that the type of view obtained in S401 includes the SurfaceView type, S404 is executed. Specifically, the judgment module notifies the view system to redraw and notifies the callback parameter in the parameter acquisition module to obtain the padding value; if the judgment module determines that the type of view obtained in S401 includes the SurfaceView type, S405 is executed. For the relevant introduction of S402, please refer to the detailed description in the above S303, which will not be repeated here.
[0156] S404: The judgment module sends a first message to the view module, where the first message is used to instruct the view module to obtain the rounded corner parameters for the floating window stored in the parameter acquisition module.
[0157] In some implementations, the rounded corner parameters for the floating window may specifically be rounded corner parameters set for two layers in the floating window. The two layers may include: Decorview and Window Decoration.
[0158] Specifically, the parameter acquisition module can obtain the padding value through a callback function, such as the HnSurfaceViewEx function. For the relevant introduction of the rounded corner parameter, please refer to the detailed description in the above S302, which will not be repeated here.
[0159] After executing S404, execute S405.
[0160] S405: The view module reads the rounded corner parameters for the floating window sent by the parameter acquisition module, and draws and renders the floating window for the first application.
[0161] In some implementations, the view module can draw and render the floating window including Decorview and Window Decoration according to the rounded corner parameters for the floating window. For the relevant introduction of S405, please refer to the detailed description of S304 above, which will not be repeated here.
[0162] After executing S405, the electronic device can send the floating window after drawing and rendering to SurfaceFlinger for synthesis, and then SurfaceFlinger sends the synthesized floating window to the display driver. Finally, the electronic device can display the floating window without Surface View through the display driver.
[0163] S406: The view module sends a second message to the parameter acquisition module, where the second message is used to instruct the view module to acquire the corner fillet parameters and padding value for the floating window stored in the parameter acquisition module.
[0164] In some implementations, the padding value for the floating window may refer to the padding values set on the upper and lower sides of the root node view (i.e., Decorview) of the first user interface. The electronic device may generate the padding value by callback, and the related description of the electronic device can refer to the detailed description in S306 above, which will not be repeated here.
[0165] After executing S406, execute S407.
[0166] S407: The view module reads the corner fillet parameter and padding value for the floating window sent by the acquisition module, and draws and synthesizes the floating window for the first application.
[0167] In some implementations, the view module may draw and render the floating window including Decorview and Window Decoration according to the rounded corner parameters and padding for the floating window.
[0168] Specifically, the view module can obtain the padding value set for Decorview through the getFramePaddingExcall function. For the relevant introduction of S405, please refer to the detailed description in the above S307, which will not be repeated here.
[0169] After executing S407, the electronic device can send the floating window after drawing and rendering to SurfaceFlinger for synthesis, and then SurfaceFlinger sends the synthesized floating window to the display driver. Finally, the electronic device can display the floating window including SurfaceView through the display driver.
[0170] Based on the above introduction to the process method, the structural diagram of the electronic device provided in the embodiment of the present application is introduced below.
[0171] Figure 5 A schematic structural diagram of an electronic device 100 is shown.
[0172] The electronic device 100 may be equipped with Or a portable terminal device of other operating systems, the electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle, a vehicle-mounted device, a smart home device and / or a smart city device, but not limited thereto, the electronic device 100 can also include a laptop computer with a touch-sensitive surface or a touch panel, a desktop computer with a touch-sensitive surface or a touch panel, and other non-portable terminal devices, etc. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.
[0173] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0174] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0175] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0176] In some implementations, the processor 110 may be used to set the rounded corner parameters of the floating window, may be used to set the inner margin of the floating window, and may be used to draw the floating window according to the rounded corner parameters and the inner margin. The processor 110 may also be used to determine whether the user interface in the set floating window includes SurfaceView.
[0177] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0178] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0179] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0180] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0181] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0182] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0183] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0184] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0185] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0186] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0187] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0188] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0189] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0190] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0191] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0192] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0193] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0194] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0195] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0196] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0197] In some implementations, the display screen 194 may display a floating window in a rounded square shape.
[0198] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0199] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0200] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0201] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0202] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0203] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0204] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0205] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.
[0206] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0207] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0208] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0209] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0210] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0211] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0212] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0213] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0214] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0215] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0216] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0217] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0218] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0219] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0220] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0221] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0222] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0223] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0224] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0225] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0226] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0227] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0228] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0229] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0230] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0231] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0232] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.
[0233] Figure 6 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0234] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0235] The application layer can include a series of application packages.
[0236] like Figure 6 As shown, the application package may include a first application. For example, the first application may include but is not limited to: camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0237] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0238] The application framework layer can include window managers, content providers, view systems, telephony managers, resource managers, notification managers, etc. Figure 6 The above content is not shown in FIG.
[0239] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0240] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0241] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0242] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0243] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0244] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0245] like Figure 6 As shown, the application framework layer may include: a judgment module, a parameter acquisition module, and a view module.
[0246] The judgment module is used to judge whether the user interface in the floating window includes SurfaceView. The parameter acquisition module is used to obtain the padding value and rounded corner parameter set for the floating window, and the view module is used to draw and synthesize the floating window according to the padding value and rounded corner parameter set for the floating window.
[0247] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0248] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0249] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0250] The system library may include multiple functional modules, such as surface manager (surfaceFlinger), media library (Media Libraries), 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0251] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0252] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0253] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0254] A 2D graphics engine is a drawing engine for 2D drawings.
[0255] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver and touch driver.
[0256] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.
[0257] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.
[0258] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0259] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0260] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0261] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for displaying a floating window, characterized in that: The method comprises: Receive a first operation, where the first operation is used to generate a first floating window, where the first floating window includes a first user interface of a first application, a top bar, and a bottom bar, where the first user interface includes a surface view, and where the surface view of the first user interface is used to display dynamically changing content; Setting the rounded corner parameters of the first floating window, the rounded corner parameters including the rounded corner radius, the rounded corner radius being less than or equal to the height of the top bar and the bottom bar of the first floating window, the rounded corner parameters including the rounded corner parameters of the first layer and the rounded corner parameters of the second layer, the first layer including the root node view of the first user interface, and the second layer being used to display the top bar and the bottom bar of the first floating window; Setting a padding of the first layer, wherein the padding is greater than or equal to the fillet radius, and the padding indicates a position of the first user interface in the first floating window; Draw the first floating window according to the rounded corner parameter and the inner margin; The first floating window is displayed, and the first floating window is in a rounded square shape.
2. The method according to claim 1, characterized in that The top bar and the bottom bar in the first floating window are transparent.
3. The method according to claim 1, characterized in that The method further comprises: receiving an operation on the top bar of the first floating window, and adjusting the position of the first floating window; or An operation on the bottom bar of the first floating window is received, and a size of the first floating window is adjusted.
4. The method according to claim 1, characterized in that The rounded corner parameter is a fixed value.
5. The method according to claim 1, characterized in that The inner margin includes: a top margin and a bottom margin, the top margin indicates the position where the root node view and the surface view of the first user interface start to be drawn in the first floating window, and the bottom margin indicates the position where the root node view and the surface view of the first user interface end to be drawn in the first floating window.
6. The method according to claim 1, characterized in that The first layer is smaller than the second layer, and the inner margin includes: a top margin or a bottom margin, the top margin indicates the position where the root node view and the surface view of the first user interface start to be drawn in the first floating window, and the bottom margin indicates the position where the root node view and the surface view of the first user interface end to be drawn in the first floating window.
7. The method according to claim 1, characterized in that After displaying the first floating window, the method further includes: receiving a second operation, where the second operation is used to switch the first user interface displayed in the first floating window to a second user interface, where the second user interface includes a surface view; Drawing the second user interface in the first floating window according to the inner margin; Switch the first user interface displayed in the first floating window to the second user interface.
8. The method according to claim 1, characterized in that After displaying the first floating window including the first user interface, the method further includes: receiving a third operation, wherein the third operation is used to generate a second floating window, wherein the second floating window includes a user interface of a second application; While displaying the first floating window, the second floating window is displayed, and the second floating window is in a rounded square shape.
9. The method according to any one of claims 1 to 8, characterized in that The method comprises: receiving a third operation, wherein the third operation is used to generate a third floating window, wherein the third floating window includes a third user interface of a third application, and the third user interface does not include a surface view; Setting the rounded corner parameters of the third floating window, wherein the rounded corner parameters of the third floating window include the rounded corner parameters of the third layer, and the third layer includes the root node view of the third user interface; Drawing the third floating window according to the rounded corner parameters of the third floating window; The third floating window is displayed, and the third floating window is in a rounded square shape.
10. An electronic device, characterized in that: The electronic device includes a folding screen, one or more memories, and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method as described in any one of claims 1-9.
11. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Layer processing method and electronic device
WO2023174322A1