Application display method and electronic equipment
By enlarging the target display area of the outer screen and loading the default configuration resources of the inner screen, the problem of poor display effect of the outer screen of foldable screen devices was solved, and the user experience was improved.
Patent Information
- Application Number
- CN202410757883.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-12-19
AI Technical Summary
In existing technologies, the external screen display of foldable screen devices has poor performance, which affects the user experience. In particular, applications that do not provide special configuration resources specifically adapted to the external screen have poor display performance on the external screen.
The display effect is optimized by enlarging the first display information of the target display area on the outer screen to make it comparable to the display area of the inner screen, loading the default configuration resources for the inner screen size, creating and scaling the layer to display on the outer screen.
Even when the application is not adapted for external screens, it improves the display effect and user experience on external screens and resolves application compatibility issues.
Smart Images

Figure CN121165992A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic device technology, and in particular to an application display method and electronic device. Background Technology
[0002] With the development of flexible screen technology, flexible foldable touch screens have been applied to electronic devices (such as mobile phones), enabling the production of a series of foldable screen devices. These foldable screen devices can be unfolded or folded. When unfolded, the application interface can be displayed through the inner screen, and when folded, the application interface can be displayed through the outer screen, in order to meet users' needs for different screen sizes.
[0003] Typically, because the inner screen of a foldable device is larger than the outer screen, the inner screen offers a better display, and users are more accustomed to using apps on it. However, users who want to operate apps instantly or while on the go often prefer to use apps on the outer screen without unfolding the screen, which is more convenient.
[0004] Therefore, improving the display effect of application interfaces on the outer screen of foldable screen devices is an issue that needs to be considered. Summary of the Invention
[0005] This application provides an application display method and an electronic device that can improve the display effect of application interfaces on the outer screen of a foldable screen device.
[0006] In a first aspect, embodiments of this application provide an application display method applied to an electronic device including a foldable screen. The electronic device includes an outer screen and an inner screen. The outer screen includes a first application display area. The application display method includes: during the process of the electronic device being in a folded state and the first application being started, or during the process of the electronic device switching from an unfolded state to a folded state and the first application being running, according to preset display information on the inner screen, enlarging the first display information corresponding to a target display area on the outer screen to obtain second display information, wherein the target display area is all display areas of the outer screen or the first application display area; loading preset configuration resources according to the second display information, wherein the preset configuration resources are configuration resources for the first application to be displayed on the inner screen; creating a layer for the first application to be displayed based on the second display information according to the preset configuration resources; scaling the layer so that the display information of the scaled layer corresponds to the display information of the first application display area, and displaying the image of the scaled layer in the first application display area.
[0007] Among the various electronic devices running the Android operating system, Android provides a dynamic application framework to improve application compatibility across different devices. Android application developers can provide default configuration resources in the static files of their applications, or they can provide alternative configuration resources specific to a particular electronic device. The Android system will then load the appropriate configuration resources based on the screen type of the electronic device. However, for foldable screen devices, Android application developers typically do not provide specially adapted configuration resources for the outer screen of foldable devices. Therefore, the display effect of applications on the outer screen is poor, severely impacting the user experience.
[0008] It should be noted that the first application refers to applications that do not provide special configuration resources specifically adapted for the external screen (such as third-party applications). Conversely, this application does not apply to applications that have already provided special configuration resources specifically adapted for the external screen (such as system applications).
[0009] Therefore, in this technical solution, the first display information of the target display area on the outer screen is enlarged, making the enlarged first application display area roughly the same size as the display area of the inner screen. This causes the application to perceive a normal display on the inner screen and loads default configuration resources (an example of preset configuration resources) for the inner screen size. Finally, a layer is created and scaled, and displayed on the first application display area of the outer screen. Thus, even without adapting the application to the outer screen, the display effect of the application on the outer screen is optimized, improving the user's outer screen experience.
[0010] Optionally, in one possible implementation of the first aspect, the first display information is the first display area information (bounds) contained in the configuration information (Configuration) under the task (Task) of the first application. The above-mentioned method of enlarging the first display information corresponding to the target display area on the outer screen according to the display information preset on the inner screen to obtain the second display information includes: enlarging the value of the first bounds according to the display information preset on the inner screen to obtain the second display information.
[0011] In the Android system, a Task is a logical concept representing a series of activities (Activities) through which the user interacts with the application. A Task can be viewed as a stack structure, with the user interacting with the application by launching and destroying Activities. An application may have one Task or multiple Tasks (for example, when a user uses multiple applications simultaneously in multi-window or split-screen mode). The Configuration stores various parameters that affect the display, such as Bounds, scaling factor, display ratio, color mode, density, and orientation. Bounds can contain the height and width values of the corresponding display area.
[0012] It should be noted that, in addition to the first application display area (hereinafter referred to as Area B for ease of explanation), the outer screen also includes the first application avoidance area (hereinafter referred to as Area C), which includes the camera area.
[0013] In the technical solution of this application, the magnification of the first display information includes two cases. The first case is when the target display area is the entire display area of the outer screen; magnifying the value of the first bounds means magnifying the display information in areas B and C simultaneously according to a fixed ratio across the entire display area of the outer screen. The second case is when the target display area is area B; magnifying the value of the first bounds means magnifying the display information only in area B according to a fixed ratio within area B.
[0014] The advantage of the first scenario is that when the first application is displayed on the outer screen, the color and layout of area C can be associated with area B. Furthermore, when the first application responds to the user's swipe gesture to go to the background, the content of the entire display area on the outer screen is simultaneously pushed to the background, rather than just the content of area B. This improves the aesthetics of the application display on the outer screen and thus enhances the user experience.
[0015] Optionally, in another possible implementation of the first aspect, when the target display area is all display areas of the outer screen, the above-mentioned loading of preset configuration resources according to the second display information includes: determining the display information of the enlarged first application display area according to the second display information and the preset display information of the inner screen; updating the second bounds according to the display information of the enlarged first application display area, wherein the second bounds are the bounds contained in the Configuration under the ActivityRecord of the first application Task; and loading the preset configuration resources according to the updated second bounds.
[0016] ActivityRecord is a data structure used internally by the system to track the state of Activities. Each Activity has a corresponding ActivityRecord, which records various information about the Activity, such as its state and history. ActivityRecords are attached to Tasks and are constrained by parameters such as bounds within those Tasks.
[0017] It should be noted that by calculating the enlarged display information of area B and completing the first application's avoidance of area C at the ActivityRecord level (excluding area C from all display areas of the inner screen), the first application can directly obtain the enlarged display information of area B when it obtains the bounds of ActivityRecord, and then perform subsequent configuration resource loading.
[0018] Optionally, in another possible implementation of the first aspect, loading the preset configuration resources according to the updated second bounds includes: updating the display information of WindowState according to the second bounds; and loading the preset configuration resources according to the updated display information of WindowState.
[0019] WindowState represents an actual window on the screen, which is the interface that the user ultimately sees. Each Activity's interface is displayed through a WindowState.
[0020] It should be noted that while the aforementioned avoidance of the C area has been implemented at the ActivityRecord level, the relationship between ActivityRecord and WindowState is not as constrained as that between Task and ActivityRecord. Therefore, the avoidance of the C area still needs to be implemented in WindowState.
[0021] Optionally, in another possible implementation of the first aspect, when the target display area is the entire display area of the outer screen, the above-mentioned loading of preset configuration resources according to the second display information includes: updating the second bounds according to the second display information, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord under the first application Task; determining the display information of the enlarged first application display area according to the second display information and the preset display information of the inner screen; modifying the interface for the first application to obtain the updated second bounds so that the first application obtains the display information of the enlarged first application display area when obtaining the second bounds; updating the display information of WindowState according to the display information of the enlarged first application display area; and loading the preset configuration resources according to the updated display information of WindowState.
[0022] One approach is to incorporate the avoidance of area C into the window's frame calculation. In the Android system, window frame calculation refers to the process of determining the specific position and size of a window on the screen. Specifically, this can be achieved by modifying the interface or method by which the application obtains the second bounds from ActivityRecord, and then storing the modified value in the relevant interface. This way, the data obtained by the application from ActivityRecord becomes the enlarged display information of area B, thus enabling area C avoidance in WindowState.
[0023] Optionally, in another possible implementation of the first aspect, the interface for the first application to obtain the updated second bounds is WindowMetrics or DisplayMetrics.
[0024] Optionally, in another possible implementation of the first aspect, the above application display method further includes: obtaining the value of a target attribute in the metadata of the target application, wherein the target attribute is a pre-configured attribute for detecting whether the target application is the first application; and determining that the target application is the first application if the value of the target attribute is not configured to a preset value.
[0025] Specifically, the value of the target attribute can be obtained by determining whether the target application declares the target attribute in the meta-data. If the value of the target attribute is not configured to a preset value, the target application is determined to be the first application; if the value of the target attribute is configured to a preset value, the target application is determined not to be the first application.
[0026] Optionally, in another possible implementation of the first aspect, the display information of the first application display area includes the width value of the first application display area, and the preset display information of the inner screen includes the width value of the inner screen. The step of enlarging the first display information corresponding to the target display area on the outer screen according to the preset display information of the inner screen to obtain the second display information includes: obtaining the display ratio of the target display area; enlarging the first display information corresponding to the target display area according to the display ratio of the target display area, so that the width value of the enlarged first application display area is equal to the width value of the inner screen; determining the height and width values of the enlarged target display area; and determining the height and width values of the enlarged target display area as the second display information.
[0027] Generally speaking, the aspect ratio of area B is greater than that of the inner screen. As long as the display ratio of the target display area remains unchanged, the width of area B can be enlarged to the width of the inner screen, and the height of area B after enlargement can also meet the requirements for resource loading.
[0028] Optionally, in another possible implementation of the first aspect, the display information of the first application display area includes the width value of the first application display area, and the scaling of the layer to make the display information of the scaled layer correspond to the display information of the first application display area includes: obtaining the display ratio of the layer; keeping the display ratio of the layer unchanged, scaling the layer to make the width value of the scaled layer equal to the width value corresponding to the first application display area.
[0029] The process of scaling the layer corresponds to the aforementioned zoom-in process. That is, while keeping the display ratio of the layer unchanged, the layer is scaled, and the width of the scaled layer is equal to the width of area B.
[0030] Optionally, in another possible implementation of the first aspect, when the target display area is the first application display area, the second display information is the display information of the enlarged first application display area. The above-mentioned loading of preset configuration resources according to the second display information includes: updating the second bounds according to the display information of the enlarged first application display area, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord under the first application Task; and loading the preset configuration resources according to the updated second bounds.
[0031] In the aforementioned embodiment, both areas B and C are magnified simultaneously within the Task layer. In one embodiment, when the target display area is area B, that is, only area B is magnified within the Task layer, thereby achieving area C avoidance, the ActivityRecord and WindowState under the Task automatically update the display information based on the bounds under the Task layer, without needing to perform area C avoidance under ActivityRecord or WindowState.
[0032] Secondly, embodiments of this application provide an application display device, which includes a unit composed of software and / or hardware for performing the application display method of the first aspect.
[0033] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device can implement any of the methods described in the first or second aspect above.
[0034] Fourthly, embodiments of this application provide a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to enable the electronic device to execute any of the methods described in the first aspect.
[0035] Optionally, the chip system also includes a memory that is electrically connected to the processor.
[0036] Optionally, the chip system may also include a communication interface.
[0037] Fifthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an electronic device, enable the electronic device to perform any of the methods described in the first aspect.
[0038] In a sixth aspect, embodiments of this application provide a computer program product, which includes a computer program. When the computer program is executed by an electronic device, the electronic device is able to implement any of the methods described in the first aspect above. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1This is a schematic diagram of a folding scenario for an electronic device provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of a page display on the external screen of an electronic device provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of the area division of the outer screen of an electronic device provided in an embodiment of this application;
[0043] Figure 4 This is a flowchart illustrating an application display method according to an embodiment of this application;
[0044] Figure 5 This is a schematic diagram of a scenario for an application display method provided in an embodiment of this application;
[0045] Figure 6 This is a block diagram of a software system for an electronic device provided in an embodiment of this application.
[0046] Figure 7 This is a timing interaction diagram of an application display method provided in an embodiment of this application;
[0047] Figure 8 This is a schematic diagram of the structure of an application display device provided in an embodiment of this application;
[0048] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0050] To facilitate understanding of the embodiments of this application, the relevant concepts involved in the embodiments of this application will be briefly explained first:
[0051] 1. A device with a foldable screen (hereinafter also referred to as "foldable screen device" or "electronic device", etc.), specifically referring to an electronic device with a foldable display screen. The foldable display screen in the electronic device can be a single flexible display screen, or a splicing display screen composed of multiple flexible display screens and a hinge between each two flexible display screens, or a splicing display screen composed of multiple rigid screens and a flexible screen between each two rigid screens, or a splicing display screen composed of multiple rigid screens and a hinge between each two rigid screens, etc. The embodiments of this application do not limit this.
[0052] 2. Display section: In Android applications, Display is a class that represents the physical screen of the device. Display provides various information about the screen, such as resolution, size, and display characteristics.
[0053] 3. A Task is a logical concept. Under Display, a Task represents a series of Activities that the user interacts with the application. A Task can be viewed as a stack structure, where the user interacts with the application by launching and destroying Activities. An application may have one Task or multiple Tasks (for example, when a user uses multiple applications simultaneously in multi-window or split-screen mode).
[0054] 4. Activity-related information (ActivityRecord) is a data structure used internally by the system to track the state of Activities. Each Activity has a corresponding ActivityRecord in the system. The ActivityRecord records various information about the Activity, such as its state and history. In most cases, each UI element will have a corresponding ActivityRecord. The ActivityRecord is attached to a Task and is constrained by parameters such as bounds in the Task.
[0055] 5. Window State: Represents an actual window on the screen, which is the final interface seen by the user. Each Activity's interface is displayed through a WindowState.
[0056] 6. Configuration information: Configuration exists at each level of Task and ActivityRecord. Configuration stores various parameters that affect the display, such as Bounds, scaling factor, display ratio, color mode, density, orientation, etc.
[0057] 7. Display area information (Bounds): A parameter in the configuration information, which can include the height and width values of the corresponding display area.
[0058] 8. Metadata: Metadata is a powerful tool in Android application development. It allows Android application developers to provide application configuration and behavior information in a declarative way without modifying the code. This helps improve application maintainability and flexibility.
[0059] Reference Figure 1 This is a schematic diagram of a folded electronic device provided in an embodiment of this application. Figure 1 As shown, in its unfolded state, the electronic device displays the page on its inner screen. Users can fold the electronic device inwards from the center of the inner screen, thus switching it from an unfolded to a folded state. In the folded state, the electronic device displays the page on its outer screen.
[0060] Figure 1 Taking a vertically foldable screen mobile phone as an example, it should be understood that the embodiments of this application can be applied to any electronic device with a foldable screen. The electronic device in the embodiments of this application can be a portable electronic device, such as a mobile phone or tablet computer. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running the Android operating system. The aforementioned portable device can also be other portable devices, as long as it has a foldable screen and algorithm computing capabilities (capable of running the display program corresponding to the application display method provided in the embodiments of this application). It should also be understood that in some other embodiments of this application, the aforementioned electronic device may not be a portable device, but rather a desktop computer with a foldable screen and algorithm computing capabilities (capable of running the display program corresponding to the application display method provided in the embodiments of this application).
[0061] In related technologies, there are various electronic devices running the Android operating system. To improve the compatibility of applications on different electronic devices, Android itself provides a dynamic application framework. Android application developers can provide default configuration resources in the static files of their applications, or they can provide alternative configuration resources specific to a particular electronic device (such as a separate set of resources for the size of the inner screen of a large foldable screen). The Android system will load the appropriate configuration resources according to the screen type of the electronic device. However, for foldable screen devices, Android application developers usually do not provide special adaptation configuration resources for the outer screen of the foldable screen device. Therefore, the display effect of the application on the outer screen is poor, which seriously affects the user experience.
[0062] For ease of explanation, the following description uses a vertically foldable screen phone as an example to illustrate the application display method provided in this application embodiment.
[0063] Reference Figure 2 This is a schematic diagram of a page display on the external screen of an electronic device provided in an embodiment of this application. Based on Figure 2 The layout of the page can be divided into regions for the outer screen. The outer screen regions can be divided as follows: Figure 3As shown, area B is the first application display area (which is also the actual functional area in this application embodiment), area C is the first application avoidance area, and area C includes a decoration (Deco) area. The Deco area is an area on the outer screen specifically reserved for cameras or other sensors, and the Deco area cannot display content.
[0064] In this embodiment, the first application is an application that does not provide special configuration resources adapted specifically for the external screen (such as a third-party application). Conversely, this embodiment does not apply to applications that have already provided special configuration resources adapted specifically for the external screen (such as system applications, calendar, health, information, etc.).
[0065] It should be noted that Android application developers typically do not specifically target... Figure 3 The Deco area is adapted, so the first application can only be displayed on area B. Taking an inner screen aspect ratio of 9:20 and area B aspect ratio of 9:15.7 as an example, the Android system may choose the default configuration resource (i.e., the configuration resource corresponding to the 9:20 aspect ratio), but this default configuration resource does not match the aspect ratio of area B, which can easily lead to display truncation and control overlap problems.
[0066] In view of this, this application provides an application display method, which mainly involves enlarging the first display information of the target display area on the outer screen, so that the enlarged first application display area is roughly the same size as the display area of the inner screen. This causes the application to perceive a normal display on the inner screen and load default configuration resources for the inner screen size. Finally, a layer is created and scaled, and displayed on the first application display area of the outer screen. This improves application compatibility display issues, optimizes the application's display effect on the outer screen even when the application has not been adapted for the outer screen, and enhances the user's outer screen experience.
[0067] Reference Figure 4 This document illustrates a flowchart of an application display method provided in an embodiment of this application. This application display method is executed by an electronic device. The following section details... Figure 4 The steps shown will be explained.
[0068] Step 401: When the electronic device is in a folded state and the first application is running, or when the electronic device switches from an unfolded state to a folded state and the first application is running, the first display information corresponding to the target display area on the outer screen is magnified according to the preset display information on the inner screen to obtain the second display information.
[0069] The target display area is either the entire display area of the outer screen or the display area of the first application.
[0070] It should be understood that in scenarios where an electronic device switches from an unfolded state to a folded state while the first application is running, i.e. when the first application is displayed on the inner screen, in response to the user's folding operation on the electronic device, it is necessary to switch the first application to the outer screen for display. In such scenarios, the solution of the embodiments of this application can also be used.
[0071] It should be noted that the display ratio of the target display area can be obtained from the Configuration under Task; alternatively, it can be calculated based on the height and width values of the target display area contained in the first display information. Furthermore, during the zooming in of the first display information, the zooming should be based on the display ratio of the target display area.
[0072] In one embodiment, when the target display area is area B, the display information of area B is magnified separately. Therefore, there is no need to avoid area C in subsequent ActivityRecords or WindowStates. However, this method of magnifying the display information of area B only at the Task level results in the color and / or layout of area C not being associated with area B when the first application is displayed on the outer screen. Furthermore, when the first application responds to the user's swipe gesture to go to the background, only the content of area B is pushed to the background on the outer screen, rather than the entire display area, leading to insufficient aesthetics in the outer screen application display.
[0073] In another embodiment, when the target display area is the entire display area of the outer screen, the display information of both areas B and C is magnified simultaneously. Subsequently, area C is avoided in ActivityRecord or WindowState. This ensures that when the first application is displayed on the outer screen, the color and layout of area C can be associated with area B. Furthermore, when the first application responds to the user's swipe gesture to go to the background, the content of the entire display area on the outer screen is simultaneously moved to the background, rather than just the content of area B. This improves the aesthetics of the application display on the outer screen, thereby enhancing the user experience.
[0074] In one embodiment, the first display information is the first bounds contained in the Configuration under the Task of the first application, and the magnification of the first display information is implemented in the process of updating the Configuration of the Task. Specifically, step 401 above may include: magnifying the value of the first bounds according to the preset display information of the inner screen to obtain the second display information.
[0075] Specifically, when the target display area is the entire display area of the outer screen, amplifying the value of the first bounds means amplifying the display information of areas B and C simultaneously according to a fixed ratio of the entire display area of the outer screen. When the target display area is area B, amplifying the value of the first bounds means amplifying the display information of only area B according to a fixed ratio of area B.
[0076] It should be noted that the magnification of the first displayed information is done at the Task level. The rule for magnification is to enlarge the width of area B to match the width of the inner screen while maintaining the display ratio of the target display area. Generally speaking, the aspect ratio of area B is greater than that of the inner screen. As long as the display ratio of the target display area remains unchanged, and the width of area B is enlarged to match the width of the inner screen, the height of the enlarged area B will also meet the resource loading requirements.
[0077] Furthermore, according to the magnification rule: under the display ratio of the target display area, the width value of area B is magnified to the width value of the inner screen. Therefore, the display information of the first application display area includes the width value of the first application display area, and the preset display information of the inner screen includes the width value of the inner screen. The above step 401 may include obtaining the display ratio of the target display area; magnifying the first display information corresponding to the target display area according to the display ratio of the target display area so that the width value corresponding to the magnified first application display area is equal to the width value of the inner screen, determining the height and width values of the magnified target display area; and determining the height and width values of the magnified target display area as the second display information.
[0078] In one embodiment, the value of a target attribute in the metadata of the target application is obtained, wherein the target attribute is a pre-configured attribute used to detect whether the target application is the first application; if the value of the target attribute is not configured to a preset value, the target application is determined to be the first application.
[0079] It should be noted that the target application can be any application, and whether the target application provides special configuration resources adapted for the outer screen of the foldable screen device is unknown. For applications that have already been adapted separately for the outer screen, there is no need to execute the solution of this application embodiment. This application embodiment only applies to applications that have not been adapted separately for the outer screen, i.e., the first application. Therefore, by determining whether the target application declares a target attribute in the meta-data and obtaining the value of the target attribute, if the value of the target attribute is not configured to a preset value, the target application is determined to be the first application; if the value of the target attribute is configured to a preset value, the target application is determined not to be the first application.
[0080] Step 402: Load the preset configuration resources according to the second displayed information.
[0081] Among them, the preset configuration resources are the configuration resources for the first application to be displayed on the inner screen.
[0082] In this embodiment, after the first display information is magnified in step 401, the size of area B is roughly equivalent to the display area of the inner screen. This causes the first application to perceive a normal display on the inner screen and load default configuration resources tailored to the inner screen size, thereby improving application compatibility and display issues.
[0083] In one embodiment, when the target display area is area B, that is, only area B is magnified in the Task layer to achieve area C avoidance. The ActivityRecord and WindowState under the Task layer automatically update the display information based on the bounds under the Task layer, without needing to perform area C avoidance under ActivityRecord or WindowState. Therefore, the second display information is the display information of the magnified first application display area. Step 402 above may include: updating the second bounds based on the display information of the magnified first application display area, wherein the second bounds are the bounds contained in the Configuration of the ActivityRecord under the first application Task; and loading preset configuration resources based on the updated second bounds. However, this embodiment has aesthetic issues, which are described in detail in the above embodiments and will not be repeated here.
[0084] In another embodiment, when the target display area is the entire display area of the outer screen, the avoidance of area C can be placed in the window's frame calculation. In the Android system, the window's frame calculation refers to the process of determining the specific position and size of a window on the screen. Specifically, this can be achieved by modifying the interface or method by which the application obtains the second bounds from ActivityRecord, and then storing the modified value in the relevant interface. In this way, the data obtained by the application from ActivityRecord becomes the enlarged display information of area B, thereby achieving area C avoidance in WindowState. Therefore, step 402 above may include: updating the second bounds according to the second display information, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord under the first application Task; determining the display information of the enlarged first application display area according to the second display information and the preset display information of the inner screen; modifying the interface for the first application to obtain the updated second bounds so that the first application obtains the display information of the enlarged first application display area when obtaining the second bounds; updating the display information of WindowState according to the display information of the enlarged first application display area; and loading the preset configuration resources according to the updated display information of WindowState.
[0085] In this context, the interface through which the first application obtains the updated second bounds is either WindowMetrics or DisplayMetrics. WindowMetrics and DisplayMetrics are two classes used to obtain device screen-related information.
[0086] However, in the above embodiments, the specific interface or method by which the first application obtains the updated second bounds is not fixed. Even if most of the interfaces or methods are modified, there will still be a few other methods that are not modified. If the application obtains data through other unmodified methods, it will cause the C area to fail to avoid. The application may obtain the display information of the enlarged B area plus the C area, instead of the display information of the enlarged B area.
[0087] In another embodiment, when the target display area is all display areas of the outer screen, step 402 above may include: determining the display information of the magnified first application display area based on the second display information and the preset display information of the inner screen; updating the second bounds based on the display information of the magnified first application display area, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord; and loading the preset configuration resources based on the updated second bounds.
[0088] It's important to note that by calculating the enlarged display information of area B and performing the first application's avoidance of area C at the ActivityRecord level, the mechanism utilizes the native Android application startup and display process—which dispatches corresponding preset configuration resources to the first application based on the bounds contained in the Configuration under ActivityRecord—to avoid area C at the source, rather than at the interface. Therefore, regardless of the interface or method the first application uses to obtain display information, it will always receive the updated bounds under ActivityRecord. This ensures that when the first application subsequently obtains the bounds of ActivityRecord, it can directly obtain the enlarged display information of area B and load the corresponding preset configuration resources.
[0089] Furthermore, while the avoidance of the C-area was completed at the ActivityRecord level, the constraint between ActivityRecord and WindowState is not as strong as that between Task and ActivityRecord. Therefore, it is still necessary to perform C-area avoidance at the WindowState level based on the updated bounds under ActivityRecord. In other words, the above-mentioned loading of preset configuration resources based on the updated second bounds includes: updating the display information of WindowState based on the second bounds; and loading preset configuration resources based on the updated display information of WindowState.
[0090] Step 403: Based on the preset configuration resources, create a layer for the first application to display based on the second display information.
[0091] It's important to note that the preset configuration resources include layout files and resource files. The layout file defines the structure of the application interface and the arrangement of components. Within the layout file, Android application developers can use various predefined view components, such as text boxes, image views, and buttons, as well as layout managers, such as Linear Layout, Relative Layout, and Frame Layout, to organize these components. The layout file determines the appearance of the user interface and the relative positions of the components. Resource files include images, colors, and strings, providing the necessary visual elements for the view components in the layout file. Layers can be created based on the layout file and resource files; specifically, these layers are surface layers.
[0092] In one embodiment, the magnified display information of area B can be obtained through the second display information, and the display information of the newly created layer corresponds to the magnified display information of area B. Specifically, the width and height values of the layer are the same as the width and height values of the magnified area B, respectively.
[0093] Step 404: Scale the layer so that the display information of the scaled layer corresponds to the display information of the first application display area, and display the image of the scaled layer in the first application display area.
[0094] In this embodiment, the displayed information of the scaled layer can be the same as or slightly smaller than the displayed information of area B. It should be understood that the displayed information of the scaled layer should not be too small compared to the displayed information of area B, to avoid affecting the user's viewing experience.
[0095] In one embodiment, corresponding to the step of enlarging the first display information in step 401, for example, the display ratio of the layer can be obtained first; then, while keeping the display ratio of the layer unchanged, the layer can be scaled so that the width value of the scaled layer is equal to the width value corresponding to the first application display area.
[0096] In another embodiment, since the display ratio of the layer is the same as that of the B area, the display ratio of the layer can be kept unchanged, and the layer can be scaled so that the height value of the scaled layer is equal to the height value of the corresponding B area.
[0097] Furthermore, the display information of the scaled layer can also include its display position, which can be determined based on the layout of the outer screen. Figure 3 For example, the scaled layer can be placed on the far right of the outer screen. If the outer screen is switched to landscape mode and the camera is at the bottom, the scaled layer can be placed at the top of the outer screen.
[0098] The application display method provided in the above embodiments of this application firstly, during the process of the electronic device being in a folded state and the first application being launched, or during the process of the electronic device switching from an unfolded state to a folded state and the first application being running, the first display information corresponding to the target display area on the outer screen is magnified according to the preset display information of the inner screen to obtain second display information; then, preset configuration resources are loaded according to the second display information; next, a layer for the first application to display based on the second display information is created according to the preset configuration resources; finally, the layer is scaled so that the display information of the scaled layer corresponds to the display information of the first application display area, and the scaled layer is displayed in the first application display area. Thus, by magnifying the first display information of the target display area on the outer screen, the magnified first application display area is roughly the same size as the display area of the inner screen. The application will then perceive this as a normal display on the inner screen and load the default configuration resources for the inner screen size. Finally, the layer is created and scaled, and displayed on the first application display area of the inner screen. These steps improve application compatibility display issues, optimize the display effect of the application on the outer screen when the application has not been adapted to the outer screen, and improve the user's outer screen experience.
[0099] Reference Figure 5 The diagram illustrates a scenario of an application display method provided in an embodiment of this application. Figure 5 As shown, firstly, the bounds in the Configuration of Task and window are enlarged. For example, at the Task level, the display information of areas B and C is enlarged simultaneously until the width value of area B is enlarged to the width value corresponding to the inner screen. WindowState is below Task, and the display information of WindowState is also enlarged along with the bounds of Task. The difference is that WindowState will avoid area C. In this way, the window size data received by the application is the enlarged window size, such as the enlarged display information of area B. The application loads resources and layouts based on the default configuration resources of the inner screen. Next, the window layer is drawn, and the drawn window layer is scaled, for example, the display information of the layer is scaled to the initial display information of area B. Finally, the scaled window layer is loaded onto the Display for application display. Through the above steps, application compatibility display issues can be improved. When the application has not been adapted to the outer screen, the display effect of the application on the outer screen is optimized, improving the user's outer screen experience.
[0100] In some embodiments, the above application display method can be applied to include Figure 6 On the electronic device of the software system shown, see Figure 6The layered architecture of electronic devices divides software into several layers, each with a clear role and function. 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, the system layer, and the kernel layer.
[0101] The application layer can include a series of application packages. For example... Figure 6 As shown, the application package may include third-party applications, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS and other applications, and the third-party applications may be the first application mentioned above.
[0102] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. It includes predefined functions. In the Android system, the application startup process involves several system services and components within the application framework layer, including ActivityTaskManagerService (ATMS), ActivityStarter, TaskDisplayArea, TaskBuilder, Task, ConfigurationContainer, WindowContainer, WindowContainer, and ActivityRecord.
[0103] Among them, ActivityTaskManagerService is a key service in the Android system, responsible for managing the lifecycle of all Activities and the task stack. ActivityStarter is a component in ATMS, responsible for handling the specific logic of Activity startup. TaskDisplayArea manages the display of multiple Tasks; in a multi-window or multi-tasking environment, TaskDisplayArea helps the system decide how to lay out and display different tasks. Task.Builder is a builder for creating new Tasks. When starting a new Activity, if a new task stack needs to be created, the system uses Task.Builder to configure task attributes, such as the task identifier and the initial state of the stack. ConfigurationContainer is a container used to store and manage window-related configuration information, such as screen orientation, language settings, and keyboard layout. During application startup, the system configures the newly launched Activity based on the information in ConfigurationContainer. WindowConfiguration stores window configuration information, such as window size, position, and visibility. During application startup, the window of a newly created Activity will be laid out according to the information in WindowConfiguration. WindowContainer is an abstract class representing a window container on the screen, which can contain other WindowContainers or specific windows. During application startup, the window of the newly created Activity will be added to a WindowContainer.
[0104] In addition, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc. Figure 6(Not shown in the image). The window manager manages window programs. It can obtain screen size, determine the presence of a status bar, lock the screen, capture screenshots, etc. The content provider stores and retrieves data, making it accessible to applications. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functions for electronic devices, such as managing call status (including connection, hang-up, etc.). The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, video files, etc. The notification manager allows applications to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify of download completion, message alerts, etc. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. The notification manager can also display notifications as dialog boxes on the screen, such as text messages in the status bar, sound alerts, vibrations of electronic devices, and flashing indicator lights.
[0105] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0106] The system library can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and a 2D graphics engine (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries are used for 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0107] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0108] In the above Figure 6 Based on the software architecture shown, Figure 7 This paper illustrates a timing interaction diagram of an application display method provided in an embodiment of this application. The following section discusses... Figure 7 The steps shown will be explained.
[0109] Step 701: During the application startup process, ActivityTaskManagerService receives the request and begins executing the startup Activity.
[0110] Step 702: ActivityTaskManagerService sends an instruction to ActivityStarter to start the Activity.
[0111] Step 703: ActivityStarter actually launches the Activity.
[0112] Step 704: ActivityStarter obtains a Task from TaskDisplayArea.
[0113] Step 705: TaskDisplayArea creates a new Task in Task.Builder.
[0114] Step 706, Task.Builder sets the properties of Task.
[0115] Step 707: The Task triggers a change to the Configuration in the ConfigurationContainer.
[0116] Step 708: ConfigurationContainer returns the configuration changes to Task.
[0117] Step 709: The system determines whether the application needs scaling. If scaling is required, proceed with the next steps.
[0118] It should be noted that it is unknown whether the application provides special configuration resources adapted for the outer screen of the foldable device. For applications that have already been adapted separately for the outer screen, no further steps are required. This embodiment only applies to applications that have not been adapted separately for the outer screen, i.e., the first application. Therefore, PMS parsing can be used to determine whether the target application declares target attributes in the metadata, and obtain the values of the target attributes. If the value of the target attribute is not configured to a preset value, the target application is determined to be the first application; if the value of the target attribute is configured to a preset value, the target application is determined not to be the first application.
[0119] Step 710: Modify the bounds of the Task.
[0120] Step 711: The Task sets the bounds for the ConfigurationContainer.
[0121] Step 712: After the bounds of the Task are enlarged and modified, the ConfigurationContainer applies the bounds to the WindowContainer.
[0122] It should be noted that the bounds of the Task at this time can be the display information of area B and area C after magnification.
[0123] Step 713: ActivityStarter adds the launched Activity to the Task.
[0124] Step 714: ActivityStarter adds child nodes to Task.
[0125] Step 715: The Task sets the Activity parent node for the WindowContainer.
[0126] Step 716: WindowContainer sends the information about the changes in the parent node to ActivityRecord.
[0127] Step 717, ActivityRecord Configuration changes.
[0128] Step 718: ActivityRecord sends information about changes to the parent configuration class to ConfigurationContainer.
[0129] Step 719: ConfigurationContainer triggers a special Configuration change to ActivityRecord.
[0130] Step 720: ActivityRecord calculates the bounds of ActivityRecord according to the ratio and avoids area C.
[0131] In related technologies, when an application obtains the bounds of an ActivityRecord, it can directly obtain the display information of the magnified B area and load the corresponding preset configuration resources.
[0132] Therefore, by enlarging the first display information of the target display area on the outer screen, the enlarged first application display area becomes roughly the same size as the inner screen's display area. This causes the application to perceive it as a normal display on the inner screen and loads default configuration resources tailored to the inner screen size. Finally, a layer is created and scaled, and displayed on the first application display area of the inner screen. These steps improve application compatibility and display issues, optimizing the application's display on the outer screen even when it hasn't been adapted for it, thus enhancing the user experience on the outer screen.
[0133] The methods of the embodiments of this application have been described above with reference to the accompanying drawings. It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially, these steps are not necessarily executed in the order shown in the figures. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps. The apparatus of the embodiments of this application will now be described with reference to the accompanying drawings.
[0134] Reference Figure 8 This is a schematic diagram of the structure of an application display device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown. Figure 8As shown, the application display device 800 includes a processing unit 801 and a display unit 802. The application display device 800 can be integrated into any electronic device with a foldable screen. For example, the application display device 800 can also be used to perform... Figure 7 The process is shown.
[0135] The application display device 800 can be used to execute any of the application display methods described above. For example, the processing unit 801 can be used to execute steps 401-403, and the display unit 802 can be used to execute step 402.
[0136] The application display device provided in this application embodiment firstly, during the process of the electronic device being in a folded state and the first application being launched, or during the process of the electronic device switching from an unfolded state to a folded state and the first application being running, enlarges the first display information corresponding to the target display area on the outer screen according to the preset display information of the inner screen to obtain second display information; then, according to the second display information, loads preset configuration resources; next, according to the preset configuration resources, creates a layer for the first application to display based on the second display information; finally, the layer is scaled so that the display information of the scaled layer corresponds to the display information of the first application display area, and the scaled layer is displayed in the first application display area. Thus, by enlarging the first display information of the target display area on the outer screen, the enlarged first application display area is roughly the same size as the display area of the inner screen. The application will then perceive this as a normal display on the inner screen and load the default configuration resources for the inner screen size. Finally, the layer is created and scaled, and displayed on the first application display area of the inner screen. This application display device can improve application compatibility display issues, optimize the display effect of the application on the outer screen when the application has not been adapted to the outer screen, and improve the user's outer screen experience.
[0137] It should be noted that the foregoing explanation of the application display method embodiment also applies to the application display device 800 of this embodiment, and will not be repeated here.
[0138] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0139] Figure 8 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Figure 9 As shown, the electronic device 900 may include a central processing unit (CPU) 910, an external memory interface 920, an internal memory 921, a universal serial bus (USB) interface 930, a charging management module 940, a power management module 941, a battery 942, antenna 1, antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, a headphone jack 970D, a sensor module 980, buttons 990, a motor 991, an indicator 992, a camera 993, a display screen 994, and a subscriber identification module (SIM) card interface 995, etc. The sensor module 980 may include a pressure sensor 980A, a gyroscope sensor 980B, a barometric pressure sensor 980C, a magnetic sensor 980D, an accelerometer sensor 980E, a distance sensor 980F, a proximity sensor 980G, a fingerprint sensor 980H, a temperature sensor 980J, a touch sensor 980K, an ambient light sensor 980L, and a bone conduction sensor 980M, etc. It should be understood that the steps in the foregoing method embodiments are executed by the processor 910 of the electronic device.
[0140] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 900. In other embodiments of this application, the electronic device 900 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0141] For example, Figure 9 The processor 910 shown may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0142] The controller can be the nerve center and command center of the electronic device 900. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0143] The processor 910 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 910 is a cache memory. This memory can store instructions or data that the processor 910 has just used or that are used repeatedly. If the processor 910 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 910, and thus improves the efficiency of the system.
[0144] In some embodiments, the MIPI interface can be used to connect the processor 910 to peripheral devices such as the display screen 994 and the camera 993. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). The processor 910 and the display screen 994 communicate via the DSI interface to realize the display function of the electronic device 900.
[0145] In some embodiments, the GPIO interface can be configured via software. The GPIO interface can be configured as a control signal or a data signal. The GPIO interface can be used to connect the processor 910 to a camera 993, a display screen 994, a wireless communication module 960, an audio module 970, a sensor module 980, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0146] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 900. In other embodiments of this application, the electronic device 900 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0147] Electronic device 900 implements display functions through a GPU, a display screen 994, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 994 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 910 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0148] The display screen 994 is used to display images, videos, etc. The display screen 994 includes a display panel. In some embodiments, the electronic device 900 may include one or N display screens 994, where N is a positive integer greater than 1.
[0149] Internal memory 921 can be used to store computer executable program code, which includes instructions. Processor 910 executes various functional applications and data processing of electronic device 900 by running the instructions stored in internal memory 921. Internal memory 921 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 900 (such as audio data, phonebook, etc.). Furthermore, internal memory 921 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0150] Pressure sensor 980A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 980A can be disposed on display screen 994. There are many types of pressure sensors 980A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 980A, the capacitance between the electrodes changes. Electronic device 900 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 994, electronic device 900 detects the intensity of the touch operation based on pressure sensor 980A. Electronic device 900 can also calculate the touch position based on the detection signal from pressure sensor 980A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0151] Touch sensor 980K, also known as a "touch panel," can be located on display screen 994. The touch sensor 980K and display screen 994 together form a touchscreen, also known as a "touchscreen." Touch sensor 980K detects touch operations applied to or near it. The touch sensor can transmit 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 display screen 994. In some embodiments, touch sensor 980K may also be located on the surface of electronic device 900, in a different position than display screen 994.
[0152] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0153] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0154] This application also provides an electronic device comprising: one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors. When the one or more processors execute the computer program, the electronic device can perform the steps in any of the methods described above. This application also provides a computer-readable storage medium storing a computer program, which, when executed by an electronic device, can perform the steps in the various method embodiments described above.
[0155] The computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographic / electronic device, recording media, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical discs. In some jurisdictions, according to legislation and patent practice, computer-readable media may not be electrical carrier signals or telecommunication signals.
[0156] This application provides a computer program product, which includes a computer program that, when executed by an electronic device, can implement the steps described in the various method embodiments above. The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form.
[0157] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0158] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0159] In the embodiments provided in this application, it should be understood that the disclosed apparatus / devices and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0160] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0161] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0162] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0163] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0164] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0165] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An application display method, characterized in that, An application is made to an electronic device including a foldable screen, the electronic device including an outer screen and an inner screen, the outer screen including a first application display area, the application display method including: During the process of the electronic device being in a folded state and the first application being launched, or during the process of the electronic device switching from an unfolded state to a folded state and the first application being running, the first display information corresponding to the target display area on the outer screen is magnified according to the preset display information of the inner screen to obtain the second display information, wherein the target display area is the entire display area of the outer screen or the display area of the first application; According to the second display information, a preset configuration resource is loaded, wherein the preset configuration resource is the configuration resource for the first application to be displayed on the inner screen; Based on the preset configuration resources, create a layer for the first application to display based on the second display information; The layer is scaled so that the display information of the scaled layer corresponds to the display information of the first application display area, and the scaled layer is displayed in the first application display area.
2. The application display method according to claim 1, characterized in that, The first display information is the first display area information (bounds) contained in the configuration information (Configuration) under the task of the first application. The step of enlarging the first display information corresponding to the target display area on the outer screen according to the preset display information on the inner screen to obtain the second display information includes: Based on the preset display information of the inner screen, the value of the first bounds is amplified to obtain the second display information.
3. The application display method according to claim 1 or 2, characterized in that, When the target display area is the entire display area of the outer screen, the step of loading preset configuration resources according to the second display information includes: Based on the second display information and the preset display information of the inner screen, determine the display information of the magnified first application display area; Based on the display information of the magnified first application display area, the second bounds are updated, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord, which is related to the activity under the first application Task; Based on the updated second bounds, load the preset configuration resources.
4. The application display method according to claim 3, characterized in that, The step of loading the preset configuration resources according to the updated second bounds includes: Update the display information of WindowState based on the second bounds; Based on the updated WindowState display information, load the preset configuration resources.
5. The application display method according to claim 1 or 2, characterized in that, When the target display area is the entire display area of the outer screen, the step of loading preset configuration resources according to the second display information includes: Based on the second display information, the second bounds are updated, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord under the first application Task; Based on the second display information and the preset display information of the inner screen, determine the display information of the magnified first application display area; By modifying the interface for the first application to obtain the updated second bounds, the first application can obtain the display information of the enlarged display area of the first application when obtaining the second bounds. The display information of WindowState is updated based on the display information of the magnified first application display area; Based on the updated WindowState display information, load the preset configuration resources.
6. The application display method according to claim 5, characterized in that, The interface for the first application to obtain the updated second bounds is WindowMetrics or DisplayMetrics.
7. The application display method according to any one of claims 1-6, characterized in that, The application display method further includes: Obtain the value of the target attribute in the metadata of the target application, wherein the target attribute is a pre-configured attribute used to detect whether the target application is the first application; If the value of the target attribute is not configured to a preset value, the target application is determined to be the first application.
8. The application display method according to any one of claims 1-7, characterized in that, The display information of the first application display area includes the width value of the first application display area, and the preset display information of the inner screen includes the width value of the inner screen. The step of enlarging the first display information corresponding to the target display area on the outer screen according to the preset display information of the inner screen to obtain the second display information includes: Obtain the display ratio of the target display area; Based on the display ratio of the target display area, the first display information corresponding to the target display area is enlarged so that the width value of the enlarged first application display area is equal to the width value of the inner screen, and the height and width values of the enlarged target display area are determined. The height and width values of the magnified target display area are determined as the second display information.
9. The application display method according to any one of claims 1-8, characterized in that, The display information of the first application display area includes the width value of the first application display area. Scaling the layer so that the display information of the scaled layer corresponds to the display information of the first application display area includes: Obtain the display ratio of the layer; While keeping the display ratio of the layer unchanged, the layer is scaled so that the width of the scaled layer is equal to the width of the first application display area.
10. The application display method according to claim 1, characterized in that, When the target display area is the first application display area, the second display information is the enlarged display information of the first application display area. The step of loading preset configuration resources based on the second display information includes: Based on the display information of the magnified first application display area, the second bounds are updated, wherein the second bounds are the bounds contained in the Configuration of ActivityRecord under the first application Task; Based on the updated second bounds, load the preset configuration resources.
11. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 10.
12. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 10.