Layer processing method and electronic device
By adjusting the boundaries of the dimmer layer to the boundaries of the window or touch area, the offset problem when the parallel visibility order window is centered, the centered display and brightness of the dimmer layer are realized, and the user operation experience and content are improved. Highlight the effect.
Patent Information
- Application Number
- CN202411189455.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-08-28
AI Technical Summary
In electronic devices, when the dimmer layer is displayed in the parallel vision order window, it is prone to offset problems, resulting in the inability to display in the center, affecting the user's operation experience.
By adjusting the boundaries of the dimmer layer to align with the boundaries of the window or touch area, make sure the dimmer layer is positioned in the screen as the window or touch area, avoiding offsets and expanding the touch area if necessary to cover more areas to highlight important content.
The dimmer layer is displayed in the center of the parallel vision order window, which improves the user's operation experience and highlights important content by reducing brightness through the coverage area, prompting the user to fail to touch the area.
Smart Images

Figure CN118689583B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a layer processing method and an electronic device. Background Art
[0002] In electronic devices, the function of the dimmer layer at least includes: reducing the brightness of the content covered by the dimmer layer to highlight the content not covered by the dimmer layer (important content), helping users focus on the important content to enhance the reading experience. Among them, the important content can be a pop-up box, prompt information or notification message. Summary of the invention
[0003] The present application provides a layer processing method and an electronic device for optimizing the display of a dimmer layer.
[0004] In a first aspect, the present application provides a layer processing method, which is applied to an electronic device, the method comprising: at a first moment, a first window is displayed in the center of the screen of the electronic device, and the first window is smaller than the screen; the touch area corresponding to the first window includes the area of the screen where the first window is located and part or all of the area outside the area; after detecting the first operation, at a second moment, the first content is displayed in the screen, and a dimming layer is displayed in the center of the screen, and the brightness of the area covered by the dimming layer at the second moment is lower than the brightness of the covered area at the first moment; the covered area at least includes: at the second moment, the non-overlapping area of the area where the first window is located and the first content.
[0005] In the above embodiment, the first moment can be understood as the moment 1 involved in the following implementation, and the second moment can be understood as the moment 2 involved in the following embodiment. The first window can be window 1 involved in the following embodiment. The first operation can be the operation that requires displaying the dimmer layer involved in the following embodiment. The dimming layer is the dimmer layer involved in the following embodiment. The touch area corresponding to the first window includes the area of the screen where the first window is located and part or all of the area outside the area, indicating that the electronic device has expanded the touch area corresponding to the first window, so that the touch area corresponding to the first window is expanded from the area where the first window is located to a larger area. In this scenario, the electronic device can still display the dimming layer in the center, and the dimming layer is not offset with the touch area, thereby optimizing the display of the dimming layer.
[0006] In combination with the first aspect, in some embodiments, the method also includes: determining that the initial touch area corresponding to the first window is the area where the first window is located; modifying the left border of the initial touch area from the first left border to the second left border, and modifying the right border of the initial touch area from the first right border to the second right border, to obtain the touch area corresponding to the first window; the second left border is closer to the left border of the screen than the first left border, and the second right border is closer to the right border of the screen than the first right border, or the second left border is equal to the left border of the screen, and the second right border is equal to the right border of the screen.
[0007] In the above embodiment, when the touch area of the first window is expanded, it is expanded to the left and right at the same time, which is beneficial for the user to operate the electronic device.
[0008] In combination with the first aspect, in some embodiments, before the dimming layer is displayed in the center of the screen, the method also includes: when a preset condition is met, setting the position of the dimming layer in the screen to be the same as the position of the first window in the screen.
[0009] In the above embodiment, it means that the dimming layer is set to be the same size as the first window, and the dimming layer is used to cover the first window to highlight the first content.
[0010] In combination with the first aspect, in some embodiments, before the dimming layer is displayed in the center of the screen, the method further includes: setting the position of the dimming layer to be the same as the position of the touch area when a preset condition is met.
[0011] In the above embodiment, it means that the dimming layer is set to be the same size as the touch area, and the dimming layer is used to cover the touch area to highlight the first content. At the same time, if the area covered by the dimming layer no longer receives touch, the dimming layer covering the touch area can also prompt the user that the touch area is invalid.
[0012] In combination with the first aspect, in some embodiments, before the setting, when the initial size of the dimming layer when it is created is the same as the size of the first window, the position of the dimming layer in the screen is set to be the same as the position of the first window in the screen, specifically including: adjusting the left border of the dimming layer to be the same as the left border of the first window.
[0013] In the above embodiment, when the dimming layer and the first window have the same size, setting a border alignment between the two can make their positions the same, and there is no need to set more border alignments.
[0014] In combination with the first aspect, in some embodiments, before the setting, when the initial size of the dimming layer when it is created is the same as the size of the first window, the position of the dimming layer is set to be the same as the position of the touch area, specifically including: adjusting the left border of the dimming layer to be the same as the left border of the touch area, and adjusting the right border of the dimming layer to be the same as the right border of the touch area.
[0015] In combination with the first aspect, in some embodiments, the preset condition includes: providing the window mode of the first window as a parallel view mode, the first window is displayed in the center, and the touch area of the first window is larger than the area where the first window is located.
[0016] In the above embodiment, the touch area of the first window is larger than the area where the first window is located, which means that the touch area of the first window has been expanded. If the position of the dimming layer is not adjusted, the dimming layer will be offset. The window is displayed in the center under the parallel view, which means that the electronic device is in the horizontal screen state.
[0017] In combination with the first aspect, in some embodiments, the first window is displayed in the center, specifically including: the left border of the first window and the right border of the first window are on both sides of the center line of the screen; wherein, the distance between the center line of the screen and the left border of the screen is equal to the distance between the center line of the screen and the right border of the screen.
[0018] In combination with the first aspect, in some embodiments, after detecting the first operation, the method also includes: adding a second window, the second window being used to carry a dimming layer; filling the second window with the dimming layer after the setting; synthesizing based on the layer where the first window is located, the layer where the second window is located, and the layer where the first content is located, and the synthesized content is used to be displayed on the screen; during the synthesis, the layer where the first window is located is below the layer where the second window is located, and the layer where the second window is located is below the layer where the first content is located.
[0019] In combination with the first aspect, in some embodiments, the first content includes a pop-up window.
[0020] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; 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 implemented in the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method implemented in the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method implemented in the first aspect.
[0023] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method implemented in the first aspect.
[0024] It is understandable that the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip system provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, other beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram showing a single window centered display in an electronic device under parallel horizons is shown;
[0026] Figure 2 A schematic diagram showing when the dimmer layer is offset;
[0027] Figure 3 A schematic diagram is shown in which an electronic device adjusts the boundary of a dimmer layer;
[0028] Figure 4 A schematic diagram of the boundary is shown;
[0029] Figure 5 A schematic diagram showing the dimmer layer being displayed in the center;
[0030] Figure 6 An exemplary flow chart of the layer processing method in the embodiment of the present application is shown;
[0031] Figure 7 A schematic diagram of a system structure for implementing the layer processing method in the embodiment of the present application is shown;
[0032] Figure 8 An exemplary module interaction diagram for implementing the layer processing method in the embodiment of the present application is shown;
[0033] Fig. 9 Another exemplary module interaction diagram for implementing the layer processing method in the embodiment of the present application is shown;
[0034] Fig.10 An exemplary flow chart for determining whether a window is displayed in the center is shown;
[0035] Fig.11 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] For applications in electronic devices that support parallel horizons, such as Figure 1 As shown, when the application provides only one window and the electronic device is in landscape mode, the electronic device can display the window in the center of the screen to enhance the display effect. The electronic device here is a device with a parallel view function, usually a device with a larger screen, such as a tablet.
[0037] It should be noted that, in the embodiment of the present application, the window provided by the application refers to a window created by the application request, which is used to display content that can be provided by the application.
[0038] Based on the scenario where a single window is displayed in the center under parallel vision, the electronic device can expand the touch area corresponding to the window from the area where the window is located in the screen to the area where the window is located in the screen and part or all of the area outside the area, for example, to the entire screen.
[0039] For the sake of convenience in the following description, unless otherwise specified, the default description is given as an example in which the touch area of the window is expanded to the full screen.
[0040] The aforementioned touch area expansion solution allows the user to interact with the electronic device not only through the area where the window is located, thereby updating the content displayed in the window, but also through the area outside the window, thereby updating the content displayed in the window, thereby achieving a better interactive experience. For example, when holding the electronic device with both hands, the electronic device can be better operated.
[0041] However, in the scenario where a single window is displayed in the center under the aforementioned parallel view and the touch area of the window is expanded, for some operations that require the display of the dimming layer, the electronic device will have display problems when responding to such operations. The display problem is that the position of the dimmer layer on the screen is offset and not displayed in the center. Such operations may include operations for triggering the display of a pop-up window.
[0042] For example, refer to Figure 1 As shown, an operation on more controls 101 is detected, and in response to the operation, as shown in FIG. Figure 2 As shown, the electronic device can display the pop-up box 201 and the dimmer layer 202, but the dimmer layer 202 is not displayed in the center and is offset to the left. Here, the reason why the dimmer layer is not displayed in the center can be referred to as follows Figure 3 Description.
[0043] like Figure 3As shown in (1), window 1 is a window provided by an application that supports parallel vision and is displayed in the center of the electronic device. In response to an operation that requires displaying a dimmer layer, the electronic device can create a dimmer layer. The initial size of the dimmer layer when it is created can be the same as the size of window 1. Then, the electronic device will align the left border of the dimmer layer with the left border of the touch area corresponding to window 1, in order to make the dimmer layer, window 1, and the touch area corresponding to window 1 in the same position on the screen. If the touch area corresponding to window 1 is not expanded and is the area where window 1 is located on the screen, then the aforementioned solution for adjusting the left border of the dimmer layer can indeed make the dimmer layer, window 1, and the touch area corresponding to window 1 in the same position on the screen. However, now that the touch area corresponding to window 1 is larger than the area where window 1 is located on the screen, the aforementioned solution for adjusting the left border of the dimmer layer will cause the dimmer layer to be biased to the left of the screen.
[0044] It should be noted here that the aforementioned purpose of making the dimmer layer, window 1, and the touch area corresponding to window 1 in the same position on the screen by adjusting the left border of the dimmer layer to align with the left border of the touch area corresponding to window 1 is for illustration. In actual situations, whether the adjusted border is the left border should not constitute a limitation on the embodiments of the present application. As long as the border between window 1 and the touch area (after expansion) is not aligned, it can be the border that causes the dimmer layer to shift. For example, when the size of the dimmer layer is the same as window 1 and the touch area corresponding to window 1, adjusting the right border can also achieve the same effect. Similarly, if the touch area corresponding to window 1 is larger than the area where window 1 is located on the screen, adjusting the right border will also cause the dimmer layer to shift, but the shift will be changed from left to right. Based on this, the left border can also be understood as the misaligned border between window 1 and the touch area (after expansion).
[0045] It should also be noted that the bounds of a rectangle (such as the dimmer layer, window 1, and touch area) are used to determine the position of the rectangle on the screen and can also be used to determine the size of the rectangle. The bounds of a rectangle include the top bound, bottom bound, left bound, and right bound. Figure 4 As shown, in some possible cases, the left border of the rectangle can be expressed as the distance between the left border and the left border of the screen (see left), the right border of the rectangle can be expressed as the distance between the right border and the left border of the screen (see right), the upper border of the rectangle can be expressed as the distance between the upper border and the upper border of the screen (see top), and the lower border of the rectangle can be expressed as the distance between the lower border and the upper border of the screen (see bottom).
[0046] The left boundary mentioned above is parallel to the right boundary, and the upper boundary is parallel to the lower boundary. Moreover, the upper, lower, left, and right mentioned above do not specifically refer to a fixed direction, but are relative directions.
[0047] The aforementioned dimmer layer has at least the following functions: to reduce the brightness of the area covered by the dimmer layer to highlight the content (such as a pop-up window) not covered by the dimmer layer. Furthermore, it may also include: to prompt the user that the area covered by the dimmer layer is no longer touch-controllable. For example, the controls in the area covered by the dimmer layer can no longer be touched to respond to the function corresponding to the control.
[0048] In order to solve the problem of dimmer layer offset involved in the above solution, a layer processing method is proposed. In this method, for the scenario where a single window is displayed in the center under the above parallel horizon and the touch area of the window provided by the application (i.e., window 1) is expanded, in response to the operation of triggering the display of the pop-up box, the electronic device will perform relevant operations after the dimmer layer is created, so that the dimmer layer is displayed in the center.
[0049] In some possible cases, the related operation includes: no longer aligning the left border of the dimmer layer with the left border of the touch area corresponding to window 1. Instead, the position of the dimmer layer is set to the position of window 1, so that the dimmer layer is in the same position as window 1 and is displayed centered with window 1. For example, the left border of the dimmer layer is aligned with the left border of window 1 to make the dimmer layer in the same position as window 1.
[0050] In some other possible cases, the related operation includes: when the touch area (after expansion) corresponding to window 1 is centered, setting the position of the dimmer layer to be the same as the position of the touch area, so that the dimmer layer is displayed in the center. The touch area is not limited to being full screen, and the center line of the touch area can be the same as the center line of window 1.
[0051] An example scenario where the dimmer layer is centered can be found in Figure 1 as well as Figure 5 ,refer to Figure 1 As shown, at time 1, the electronic device in landscape mode displays the aforementioned window 1 (smaller than the screen) in the center of the screen. The touch area corresponding to the window 1 includes: the area where the window 1 is located in the screen and part or all of the area outside the area. After detecting the operation for triggering the display of the pop-up window, refer to Figure 5As shown, at time 2, the electronic device displays a pop-up box (e.g., pop-up box 201) on the screen, and displays the dimmer layer in the center of the screen. The brightness of the area covered by the dimmer layer at time 2 is less than the brightness of the covered area at time 1. The covered area at least includes: at time 2, the non-overlapping area of the area where window 1 is located and the pop-up box. Figure 5 As shown in (1), the dimmer layer (e.g., dimmer layer 501) is displayed in the center and has the same position as window 1. Figure 5 As shown in (2), the dimmer layer (eg, dimmer layer 502) is displayed in the center and has the same position as the touch area (full screen).
[0052] The exemplary process of achieving the same position of the dimmer layer and window 1 can be referred to Figure 3 As shown in (2), the initial size of the dimmer layer when it is created can be the same as the size of window 1. Then, the electronic device aligns the left border of the dimmer layer with the left border of window 1, so that the dimmer layer and window 1 are in the same position on the screen. At this time, the position of the dimmer layer on the screen does not refer to the touch area corresponding to window 1.
[0053] The exemplary process of achieving the same position of the dimmer layer and the touch area (corresponding to window 1) can be referred to Figure 3 As shown in (3), the initial size of the dimmer layer when it is created can be the same as the size of window 1. Then, the electronic device will align the left border of the dimmer layer with the left border of the touch area corresponding to window 1, and the electronic device will also align the right border of the dimmer layer with the right border of the touch area corresponding to window 1, so that the dimmer layer and the touch area corresponding to window 1 are in the same position on the screen.
[0054] It should be noted here that the centering of the dimmer layer, the centering of the touch area, and the centering of window 1 involved in the embodiment of the present application are centered to the same degree, that is, the center lines of the dimmer layer, the touch area, and the window 1 on the screen are the same. The center line of a rectangle (such as the dimmer layer, the window 1, and the touch area, etc.) can be equal to half of the difference between the right boundary and the left boundary of the rectangle.
[0055] Figure 6 An exemplary flow chart of the layer processing method in the embodiment of the present application is shown. For an exemplary description of realizing the centering display of the dimmer layer, reference may be made to the following description of steps S11 to S21.
[0056] S11. Open the application.
[0057] In response to an operation of starting an application (eg, a click operation on an application icon), the electronic device initializes the application to start the application, such as creating a window of the application to prepare for displaying the window provided by the application on the screen.
[0058] S12. Determine whether the application supports parallel horizons.
[0059] The electronic device determines whether the application is included in the whitelist applications supporting parallel horizons. If included, it is determined that the application supports parallel horizons. If not included, it is determined that the application does not support parallel horizons.
[0060] If the application does not support parallel horizons, the application window is displayed in a non-parallel horizon mode.
[0061] In case the application supports parallel vision, the electronic device executes the following step S13.
[0062] S13. Adjust the window border of the application window.
[0063] The electronic device adjusts the border of the window (window border) so that the window adapts to the single-window centered display mode under the parallel field of view.
[0064] It should be noted that the aforementioned window 1 can be regarded as a window with an adjusted window border.
[0065] S14. Determine whether the window is a single window centered under a parallel field of view.
[0066] When the application requests to create more than one window (for example, a dual window), the electronic device determines that the application is not displayed as a single window centered under a parallel field of view, and then the electronic device displays the dual window requested to be created by the application in a dual window mode of a parallel field of view.
[0067] In the case that the application only requests to create a window, the electronic device determines that the window is a single window in a parallel field of view and is displayed in the center. Then, the electronic device can perform the following step S15 to adjust the touch area corresponding to the window.
[0068] S15. The touch area corresponding to the adjustment window 1 (the window after the border adjustment) is the full screen.
[0069] The initial touch area corresponding to window 1 is the area of the screen where window 1 is located, and the electronic device modifies the left boundary of the initial touch area from left boundary 1 to left boundary 2, and modifies the right boundary of the initial touch area from right boundary 1 to right boundary 2, so as to obtain an extended touch area (referred to as touch area for short). The left boundary 2 of the touch area is equal to the left boundary of the screen, and the right boundary 2 of the touch area is equal to the right boundary of the screen.
[0070] It should be noted that the expansion of the touch area to the full screen in step S15 is an example. In actual situations, the touch area corresponding to the extended window 1 can be larger than the area where the window 1 is located in the screen, and should not constitute a limitation on the embodiments of the present application. When the touch area is larger than the area where the window 1 is located in the screen but smaller than the screen, the left boundary 2 of the touch area is closer to the left boundary of the screen than the left boundary 1, and the right boundary 2 is closer to the right boundary of the screen than the right boundary 1. Generally speaking, the distance between the left boundary 2 and the left boundary of the screen should be equal to the distance between the right boundary 2 and the right boundary of the screen.
[0071] S16. An operation that triggers display of a pop-up window is detected.
[0072] An example of the operation of triggering the display of the pop-up window may be the aforementioned Figure 1 For more operations on controls 101.
[0073] For this operation, the electronic device creates a pop-up window, and when creating the pop-up window, a dimmer layer bound to the pop-up window is correspondingly created. For related content, please refer to the following step S17.
[0074] S17. Create a dimmer layer bound to the pop-up box.
[0075] Binding the pop-up box to the dimmer layer means that the electronic device will set the level of the dimmer layer below the level of the pop-up box so that the dimmer layer will not cover the pop-up box.
[0076] S18. Set the size of the dimmer layer.
[0077] Refer to the above Figure 3 Description, the initial size of the dimmer layer when it is created can be the same as the size of window 1.
[0078] S19. Determine whether the application is displayed in a single window centered under a parallel field of view, and whether the size of the touch area is expanded.
[0079] When it is determined that the touch area corresponding to window 1 is larger than the area where window 1 is located on the screen, it means that the size of the touch area is determined to be expanded. When the touch area corresponding to window 1 is full screen, it can be understood that the touch area corresponding to window 1 is determined to be full screen.
[0080] If it is determined that the application is a single window centered under a parallel field of view, and the size of the touch area corresponding to window 1 is expanded, the following step S20 is performed. Otherwise, step S20 is not performed.
[0081] S20. Adjust the border of the dimmer layer to be consistent with the border of window 1.
[0082] For the related contents of adjusting the boundary of the dimmer layer to be consistent with the boundary of window 1, please refer to the aforementioned description of setting the position of the dimmer layer to be the same as the position of window 1, which will not be repeated here.
[0083] It should be noted that step S20 is optional. In actual situations, the position of the dimmer layer can be adjusted to be centered. For example, when the touch area corresponding to window 1 is centered, the boundary of the dimmer layer can also be adjusted to be consistent with the boundary of the touch area. For this process, please refer to the aforementioned description of setting the position of the dimmer layer to be the same as the position of the touch area, which will not be repeated here.
[0084] S21. Display the pop-up window and dimmer layer.
[0085] A schematic diagram of the electronic device displaying the pop-up box and dimmer layer can be referred to above Figure 5 The content shown in (1) in the figure. The brightness of the area covered by the dimmer layer is reduced, and the bullet box is not included in the covered area.
[0086] Figure 7 A schematic diagram of a system structure for implementing the layer processing method in an embodiment of the present application is shown.
[0087] like Figure 7 As shown, the system structure is divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system structure is divided into 6 layers, from top to bottom, they are application layer, application framework layer, local framework layer, hardware abstraction layer (HAL), kernel layer (also called Linux layer) and hardware layer.
[0088] Among them, the application layer can include a series of application packages.
[0089] The application framework layer provides application programming interface (API) and programming framework for applications in the application layer.
[0090] The application framework layer may include an activity manager service (AMS) and a window manager service (WMS).
[0091] The activity management service is a component in the electronic device system that manages activities. The activity management service is responsible for the life cycle management, task stack management, and process management of application programs (referred to as applications) to ensure that applications are correctly started, paused, resumed, and destroyed under user operations.
[0092] The window management service is a component responsible for window management in the electronic device system. It is responsible for processing tasks such as the creation and position adjustment of application windows. The aforementioned operations of extending the touch area of the window 1 and adjusting the position of the dimmer layer can be performed in the window management service.
[0093] After launching the application, the activity management service can also participate in the surface preparation of window 1 so that the electronic device can successfully display window 1. In some possible cases, the activity management service can call the activity record (activityRecord) class to participate in the surface preparation of window 1. The window management service can also call the window container (windowContainer) class, the task (task) class, and the window state (windowState) class to participate in the surface preparation of window 1. In the process of participating in the surface preparation of window 1, the window management service calls the windowState class to expand the touch area of window 1.
[0094] After detecting the operation that triggers the display of the pop-up window, the window management service can call the windowContainer class, windowState class, and dimming class to work together to complete the creation and position adjustment of the dimmer layer so that the dimmer layer is displayed in the center.
[0095] The local framework layer is located between the application framework layer and the kernel layer, and mainly includes the native implementation of hardware access and system services. The local framework layer can be used by the surface compositor (SF).
[0096] The surface compositor is used to composit the content to be displayed so as to display the synthesized content on the screen. For example, the surface compositor can be used to composit the layer where window 1 is located, the layer where the window carrying the dimmer layer (window 2) is located, and the layer where the pop-up box is located.
[0097] In some possible cases, the surface compositor can complete operations related to compositing the content to be displayed through the hardware compositor (HWC), which is located in the hardware abstraction layer.
[0098] The display driver (located at the kernel layer) is used to receive the synthesized content and transmit it to the display screen (also called the screen, located at the hardware layer) for display.
[0099] Figure 8 An exemplary module interaction diagram for implementing the layer processing method in an embodiment of the present application is shown.
[0100] The modules involved here mainly include activity management service and window management service. Taking the expansion of the touch area of Window 1 to full screen as an example, the relevant processes involved in the center display of the dimmer layer in the scenario where the touch area of the window provided by the application is expanded and the single window is displayed in the center under the parallel view are explained. The details involved in this process can be referred to the following steps S101-S111.
[0101] S101. The desktop sends a request to start an activity to the activity manager, so as to start an activity of an application.
[0102] The execution timing of step S101 includes: detecting an operation of opening an application on a desktop (launcher).
[0103] The request for starting an activity carries application information (such as the package name of the application and the name of the activity, etc.). After receiving the request for starting an activity, the activity manager launches the corresponding application.
[0104] In some possible cases, the activity manager can launch the application through the startActivity() function.
[0105] S102. The application sends display resources for creating an application window to the activity management service.
[0106] The display resource of the application window may be used to prepare display content (also referred to as surface content) in the application window (eg, window 1 ).
[0107] In some possible cases, the application can send display resources for creating the application window to the activity management service through the onCreate() function.
[0108] S103. The activity management service sends a request for adding a window to the window management service. The request carries application information (eg, application package name) of the application and window information of the window requested to be added.
[0109] The window information may include the size of the window and the properties of the window, wherein the properties of the window include whether the window is a special window (such as a surface window) or a normal window.
[0110] In some possible cases, the activity management service can request the window management service to add the application's window through the addwindow() function.
[0111] After receiving the request to add a window, the window management service adds window 1 and executes the following steps S104a and S104b.
[0112] S104a. The window management service prepares surface content for window 1 (the added window).
[0113] S104b. The window management service determines whether the application supports parallel horizons based on the application information. If it does, the window mode and window border of window 1 are modified, and the touch area corresponding to window 1 is modified to be full screen.
[0114] When it is determined that the application package name of the application is included in the whitelist applications supporting parallel view, the window management service determines that the application supports parallel view. Otherwise, it is determined that the application does not support parallel view.
[0115] If the application supports parallel horizons, the window management service modifies the window mode of window 1 to parallel horizon mode. Since only one window is opened at this time, the window management service will also modify the border of window 1 so that window 1 can be displayed in the center of the screen, and it is also necessary to modify (expand) the touch area corresponding to window 1 to full screen. For the relevant content involved in this process, please refer to the above description of steps S12 to S15, which will not be repeated here.
[0116] It should be noted here that there is no particular order in which step S104a and step S104b are executed, and they can be executed simultaneously.
[0117] In some possible cases, such as Fig. 9 As shown in (1), for window 1, the window management service can execute the aforementioned steps S104a and S104b through the preareSurface() function.
[0118] like Fig. 9 As shown in (1), the window management service calls the window container (windowContainer) class and the task class through the preareSurface() function, and cooperates with the activity record (activityRecord) class in the activity management service to prepare the surface content (the surface content of window 1), and calls the window state (windowState) class to determine whether the application supports parallel worlds based on the application information. If it does, the window mode and window border of window 1 are modified, and the touch area corresponding to window 1 is modified.
[0119] After the surface content of the window 1 is prepared, the window management service may execute the following steps S105 and S106 to display the window 1 on the screen.
[0120] S105. The window management service fills the surface content of window 1 into window 1.
[0121] S106. The window management service transmits the filled window 1 to the surface compositor for synthesis and display.
[0122] After window 1 is displayed, user operations can be detected through the touch area corresponding to window 1. When an operation that triggers the display of a pop-up window is detected, the following steps S107-S111 can be executed to display a pop-up window on the screen and display the dimmer layer in the center.
[0123] S107. Add a pop-up window to the application.
[0124] The application sends the pop-up information to the window management service.
[0125] S108. Check the properties of the pop-up window, and if it is confirmed to be a pop-up window, add window 2.
[0126] When the window management service determines that it is a pop-up window, the addwindow() function can be used to add window 2, which is used to carry the dimmer layer bound to the pop-up window.
[0127] S109. The window management service creates a dimmer layer. If the window mode of window 1 is parallel view mode, window 1 is centered and the touch area of window 1 is full screen, the layer position is set and the window boundary position of window 1 is used as the layer position of the dimmer layer.
[0128] The initial size of the dimmer layer when it is created is the same as the size of window 1. Then, when the window mode of window 1 is parallel horizon mode, window 1 is centered, and the touch area of window 1 is full screen, the window management service can set the layer position and use the window boundary position of window 1 as the layer position of the dimmer layer, so that the position of the dimmer layer is the same as that of window 1.
[0129] In some possible cases, the window management service can use the setPosition(mDimLayer, bound.left, bound.top) function to set the window boundary position of window 1 as the layer position of the dimmer layer. Among them, bound.left means that the left boundary of window 1 is used as the left boundary of the dimmer layer. Bound.top means that the top boundary of window 1 is used as the top boundary of the dimmer layer. In actual situations, the left boundary of window 1 is used as the left boundary of the dimmer layer to align the position of window 1 with the dimmer layer. The top boundary is also adjusted here to further ensure that the position of window 1 is aligned with the dimmer layer.
[0130] In some possible cases, such as Fig. 9 As shown in (2), for window 2, the window management service can execute the aforementioned step S109 through the preareSurface() function.
[0131] like Fig. 9 As shown in (2), the window management service calls the window container (windowContainer) class and the window state (windowState) class through the preareSurface() function to perform related operations (such as preparation operations) to create a dimmer layer, and the window management service calls the task (task) class and the dimming (dimmer) class through the preareSurface() function to adjust the dimmer layer. The window management service calls the dimming (dimmer) class through the preareSurface() function to perform the following operations to obtain a dimmer layer with the same position as window 1. The process includes: creating a dimmer layer, if the window mode of window 1 is parallel world mode, window 1 is centered display, and the touch area of window 1 is full screen, then setting the layer position, and using the window boundary position of window 1 as the layer position of the dimmer layer.
[0132] In step S109, the process of determining that window 1 is displayed in the center can refer to the following Fig.10 Description of steps S31-S33 in .
[0133] S31. Get the window border of window 1 and get the screen border.
[0134] It should be noted here that if the acquisition in step S31 fails, it is determined that window 1 is not displayed in the center.
[0135] S32. Execute left1=left border in window border, right1=right border in window border and middle=right border in screen border / 2.
[0136] S33. Determine whether left1<=middle and right1>=middle.
[0137] That is, it is determined whether the left border and the right border of window 1 are on both sides of the center line of the screen, and if so, it is determined that the window is displayed in the center. Otherwise, it is determined that the window is not displayed in the center.
[0138] Not limited to the aforementioned steps S31 to S33, other methods may be used to determine whether the window is displayed in the center. For example, determine whether the center line of window 1 is equal to the center line of the screen, that is, determine whether (right1-left1) / 2 is equal to the right border of the screen border / 2. If so, the window is displayed in the center. Otherwise, the window is not displayed in the center.
[0139] After the position adjustment of the dimmer layer is completed, the following step S110 and step S111 are performed for the dimmer layer whose position is adjusted, so as to display a pop-up box on the screen and to display the dimmer layer in the center.
[0140] S110. The window management service fills the dimmer layer into window 2.
[0141] S111. The window management service transfers the filled window 2 to the surface compositor for synthesis and display.
[0142] The window management service synthesizes the layer where window 2 is located with other layers (including the layer where window 1 is located and the layer where the pop-up box is located) through the surface synthesizer to obtain the synthesized content, and transmits the synthesized content to the screen for display.
[0143] It should be noted that in the aforementioned step S109, setting the window boundary position of window 1 as the layer position of the dimmer layer is optional. In practice, the boundary position of the touch area can also be used as the layer position of the dimmer layer so that the position of the dimmer layer is the same as the position of the touch area.
[0144] Furthermore, in a solution where the position of the dimmer layer is aligned with the position of the touch area, it can also be set that the area covered by the dimmer layer no longer detects the user's touch operation.
[0145] It should be noted here that in the aforementioned embodiment, the operation that needs to display the dimmer layer is used to trigger the display of the pop-up window. It is not limited to the pop-up window, and can actually be used to trigger the display of other important content. For example, prompt information or notification messages, etc. This should not constitute a limitation on the embodiments of the present application.
[0146] The following introduces an exemplary electronic device provided by an embodiment of the present application.
[0147] Fig.11 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0148] The following is a detailed description of the embodiment using an electronic device as an example. It should be understood that the electronic device may have more than Fig.11 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Fig.11 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0149] The electronic device 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.
[0150] In the embodiment of the present application, the processor 110 can call the computer instructions stored in the internal memory 121 to enable the electronic device to execute the method in the embodiment of the present application.
[0151] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the electronic device in any of the above embodiments.
[0152] In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0153] The chip system may be composed of the chip, or may include the chip and other discrete devices.
[0154] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0155] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be separated from the processor, which is not limited in the embodiment of the present application.
[0156] Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be set separately on different chips. The embodiments of the present application do not specifically limit the type of memory and the setting method of the memory and the processor.
[0157] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables a computer to execute the method executed by the electronic device in any of the above embodiments when the computer program is executed.
[0158] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.
[0159] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0160] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0161] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0162] The terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0163] 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 embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may 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 may 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.) means. The computer-readable storage medium may 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 may 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 hard disk), etc.
[0164] 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.
Claims
1. A layer processing method, characterized in that: Applied to electronic equipment, the method comprises: The electronic device displays a first window of a first application, wherein a display area of the first window is smaller than a display area of a screen; In a case where the first window is displayed centered on the screen of the electronic device, and the touch area corresponding to the first window includes the display area of the first window and an area outside the display area of the first window, in response to a first operation, a second window of the first application is displayed, the display area of the second window includes a first pop-up box, the second window is generated based on a first dimming layer, the size of the first dimming layer is consistent with the size of the display area of the first window, and the left border of the first dimming layer is set to be consistent with the left border of the first window, and the size and position of the first dimming layer are different from the touch area corresponding to the first window; When the first window is not centered on the screen of the electronic device and the touch area corresponding to the first window is consistent with the display area of the first window, in response to a second operation, a third window of the first application is displayed, and the third window is generated based on a second dimming layer, and the size and position of the second dimming layer are consistent with the touch area corresponding to the first window.
2. The method according to claim 1, characterized in that: In the case where the first window is displayed in the center of the screen of the electronic device, the method further includes: Determining an initial touch area corresponding to the first window as a display area of the first window; The left border of the initial touch area is modified from the first left border to the second left border, and the right border of the initial touch area is modified from the first right border to the second right border, to obtain the touch area corresponding to the first window; the second left border is closer to the left border of the screen than the first left border, and the second right border is closer to the right border of the screen than the first right border, or the second left border is equal to the left border of the screen, and the second right border is equal to the right border of the screen.
3. The method according to claim 2, characterized in that The method further comprises: Based on the fact that the touch area of the first window includes an area outside the display area of the first window, and that the first window is a single window centered display, and the window mode is a parallel vision mode, the left boundary of the first dimming layer is set to be consistent with the left boundary of the first window.
4. The method according to claim 2, characterized in that: The method further comprises: Based on the fact that the touch area of the first window does not include an area outside the display area of the first window, the size and position of the second dimming layer are set to be consistent with the touch area corresponding to the third window.
5. The method according to any one of claims 1 to 4, characterized in that The first window is displayed centered on the screen of the electronic device, specifically including: the left border of the first window and the right border of the first window are on both sides of the center line of the screen; wherein the distance between the center line of the screen and the left border of the screen is equal to the distance between the center line of the screen and the right border of the screen.
6. The method according to any one of claims 1 to 4, characterized in that After detecting the first operation, the method further includes: Add a fifth window, where the fifth window is used to carry the dimming layer; Filling the dimming layer after the left border is set into the fifth window; A synthesis is performed based on the layer where the first window is located, the layer where the fifth window is located, and the layer where the first pop-up box is located, and the synthesized content is used to be displayed on the screen; during the synthesis, the layer where the first window is located is below the layer where the second window is located, and the layer where the second window is located is below the layer where the first pop-up box is located; the content displayed in the second window is included in the synthesized content.
7. An electronic device, characterized in that: include: One or more processors and a memory; 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 perform the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium comprising computer instructions, characterized in that: When the computer 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 6.
9. A chip system, which is applied to electronic equipment, characterized in that: The chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 6.
10. A computer program product comprising instructions, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Display method and electronic equipment
CN114690893A
Interface display method and electronic equipment
CN115729346A