Screen locking image display method, electronic device, and readable storage medium
By responding to the bright screen and rotating operations in the lock screen interface, adjusting the display position of the depth of field image, the problem of poor display of the depth of field image after the screen is rotated, and a more beautiful lock screen interface display is achieved.
Patent Information
- Application Number
- PCT/CN2024/079319
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-03
- Filing Date
- 2024-02-29
- Publication Date
- 2025-02-06
AI Technical Summary
After the screen rotates, the depth of field image display is not effective.
A method for displaying a lock screen image is provided. By responsive to the bright screen and rotation operations, different lock screen interfaces are displayed to ensure that the position of the main image relative to the system time indicator is consistent, so as to maintain the display effect of the depth of field image after rotation.
After the screen rotates, by adjusting the image of the lock screen interface, the relative position between the subject image and the system time indicator remains unchanged, which improves the display aesthetics of the depth of field image.
Smart Images

Figure CN2024079319_06022025_PF_FP_ABST
Abstract
Description
Lock screen image display method, electronic device and readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 3, 2023, with application number 202310972715.2 and application name “Display method of lock screen image, electronic device and readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a method for displaying a lock screen image, an electronic device, and a readable storage medium. Background Art
[0003] The lock screen image is the image displayed on the lock screen interface. For example, when an electronic device is set with a lock screen password, the lock screen image is displayed on the lock screen interface when the electronic device turns on the screen after turning it off. With the rapid development of terminal technology, the display methods of lock screen images on electronic devices are becoming more and more diverse, including but not limited to static lock screen images, dynamic lock screen images, magazine lock screen images, etc.
[0004] Summary of the Invention
[0005] This application provides a lock screen image display method, electronic device, and readable storage medium, which can solve the problem of poor depth of field image display after the screen rotates in the related art. The technical solution is as follows:
[0006] In a first aspect, a method for displaying a lock screen image is provided, which is applied to an electronic device, and the method includes:
[0007] In response to the screen-lighting operation, the electronic device displays a first lock screen interface, where the first lock screen interface includes: a first image, a system time indicator displayed above the first image, and a main image that partially obscures the system time indicator;
[0008] In response to a rotation operation on the electronic device, the electronic device displays a second lock screen interface, where the second lock screen interface includes: a second image, the system time indicator displayed above the second image, and the main image that partially obscures the system time indicator;
[0009] Among them, the first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface.
[0010] In this way, after the electronic device is rotated, since the first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface, the display effect of the lock screen image is guaranteed and the aesthetics of the lock screen image display is improved.
[0011] As an example of the present application, in response to the screen-lighting operation, before the electronic device displays the first lock screen interface, the further step includes:
[0012] In response to a first setting operation, setting the original image selected in the first setting operation as a lock screen image;
[0013] Determining the first image and the second image based on the size of the electronic device display screen and the original image;
[0014] The first image is stored as a lock screen image corresponding to a first screen display state, and the second image is stored as a lock screen image corresponding to a second screen display state, wherein the first screen display state and the second screen display state are respectively the display states corresponding to the display screen before and after rotation.
[0015] In this way, by storing the first image and the second image, when the first image or the second image is needed later, the required depth of field image can be quickly acquired, thereby improving image display efficiency.
[0016] As an example of the present application, the horizontal length of the display screen is smaller than the vertical width of the display screen, the original image is an image in a depth-of-field image theme, the original image is square in shape, and the side length of the original image is the same as the longest side of the display screen, and the depth-of-field image theme is an image theme in the electronic device;
[0017] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0018] When the display screen is in the first screen display state, performing center cropping on the original image to obtain the first image;
[0019] determining coordinate information of a first cropping area of the original image according to the size of the display screen, wherein the first cropping area is aligned with a top of the original image and a size of the first cropping area is the same as a size of the display screen when the display screen is in the second screen display state;
[0020] The original image is cropped according to the coordinate information of the first cropping area to obtain the second image.
[0021] In this way, by aligning the first cropping area with the top of the original image and making the size of the first cropping area the same as the size of the display screen when it is in the second screen display state, it is ensured that the relative position between the highest point of the main image and the system time indicator does not change when the display screen is in different display states, thereby improving the display effect of the depth of field image.
[0022] As an example of the present application, the horizontal length of the display screen is greater than the vertical width of the display screen, the original image is an image in a depth of field image theme, the original image is square in shape, and the side length of the original image is the same as the longest side of the display screen, and the depth of field image theme is an image theme in the electronic device;
[0023] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0024] When the display screen is in the first screen display state, determining coordinate information of a second cropping area of the original image according to a size of the display screen, wherein the second cropping area is aligned with a top of the original image and a size of the second cropping area is the same as a size of the display screen when the display screen is in the first screen display state;
[0025] cropping the original image according to the coordinate information of the second cropping area to obtain the first image;
[0026] According to the size of the display screen, the original image is cropped in a center-cropping manner to obtain the second image, and the size of the second image is the same as the size of the display screen when it is in the second screen display state.
[0027] In this way, different cropping methods are used when the display screen has different sizes, which improves the flexibility of cropping images and makes cropping more targeted. At the same time, the relative position between the highest point of the main image and the system time indicator does not change when the display screen is in different display states, thereby improving the display effect of the depth of field image.
[0028] As an example of the present application, the shape of the display screen is not a square, and the original image is an image in a gallery of the electronic device;
[0029] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0030] determining, according to the size of the display screen, a first image corresponding to the original image, wherein the size of the first image is the same as the size of the display screen when in the first screen display state;
[0031] Dividing the long side of the display screen by the short side of the display screen to obtain a magnification factor of the first image;
[0032] Multiplying the magnification factor by the first distance to obtain a second distance between the highest point of the main image in the enlarged first image and the top edge of the enlarged first image in the vertical direction, where the first distance is the distance between the highest point of the main image in the first image and the top edge of the first image in the vertical direction;
[0033] The enlarged first image is cropped according to the first distance, the size of the display screen, and the second distance to obtain the second image, where the size of the second image is the same as the size of the display screen when it is in the second screen display state.
[0034] In this way, by cropping the enlarged first image through the first distance and the second distance, it can be ensured that when the cropped second image is displayed on the display screen in the second screen display state, the relative position between the highest point of the main image in the second image and the system time indicator does not change, thereby improving the display effect of the depth of field image.
[0035] As an example of the present application, the step of cropping the enlarged first image according to the first distance, the size of the display screen, and the second distance to obtain the second image includes:
[0036] subtracting the second distance from the first distance to obtain a first difference;
[0037] determining coordinate information of a third cropping area in the enlarged first image according to the first difference and the size of the display screen, wherein the size of the third cropping area is the same as the size of the display screen when the display screen is in the second screen display state;
[0038] The enlarged first image is cropped according to the coordinate information of the third cropping area to obtain the second image.
[0039] In this way, the coordinate information of the third cropping area is determined by the first difference, so that the electronic device can crop the enlarged first image more accurately, that is, the size of the obtained second image is more accurate, ensuring that the relative position between the highest point of the main image in the second image and the system time indicator does not change, thereby improving the display effect of the depth of field image.
[0040] As an example of the present application, the shape of the display screen is not a square, and the original image is an image in a gallery of the electronic device;
[0041] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0042] determining, according to the size of the display screen, a first image corresponding to the original image, wherein the size of the first image is the same as the size of the display screen when in the first screen display state;
[0043] Dividing the short side of the display screen by the long side of the display screen to obtain a reduction factor of the first image;
[0044] Multiplying the reduction factor by the first distance to obtain a third distance between the highest point of the main image in the reduced first image and the top edge of the reduced first image in the vertical direction, where the first distance is the distance between the highest point of the main image in the first image and the top edge of the first image in the vertical direction;
[0045] The first image is cropped according to the reduction factor, the third distance, the size of the display screen and the first distance to obtain the second image, and the size of the second image when enlarged when displayed is the same as the size of the display screen when it is in the second screen display state.
[0046] In this way, the first image is cropped according to the reduction factor of the first image, and the first image does not need to be enlarged during the cropping process, which reduces the operation steps and improves the cropping efficiency.
[0047] As an example of the present application, the display screen is in a square shape, and the original image is an image in a gallery of the electronic device;
[0048] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0049] determining, according to the size of the display screen, a first image corresponding to the original image;
[0050] The first image is determined as the second image.
[0051] In this way, when the display screen is in a square shape, the first image is directly determined as the second image without the need for further cropping, thereby improving the efficiency of determining the depth of field image.
[0052] As an example of the present application, in response to a rotation operation on the electronic device, the electronic device displays a second lock screen interface, including:
[0053] In response to a rotation operation on the electronic device, replacing the first image with the second image;
[0054] The second image is rotated.
[0055] In this way, by replacing the first image with the second image, the lock screen image is displayed more specifically, thereby improving the aesthetics of the lock screen image display in the lock screen interface.
[0056] As an example of the present application, the first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface, which means that: the fourth distance from the highest point of the main image to the top edge of the system time indicator in the first lock screen interface is the same as the fifth distance from the highest point of the main image to the top edge of the system time indicator in the second lock screen interface.
[0057] In this way, by making the fourth distance from the highest point of the main image to the top edge of the system time indicator in the first lock screen interface the same as the fifth distance from the highest point of the main image to the top edge of the system time indicator in the second lock screen interface, the display effect of the lock screen interface can still be guaranteed after the display screen is rotated, thereby improving the display aesthetics of the lock screen interface.
[0058] As an example of the present application, the method further includes:
[0059] In response to the second setting operation, setting the third image as the lock screen image;
[0060] In response to the screen-lighting operation, a third lock screen interface is displayed, where the third lock screen interface includes the third image and the system time indicator displayed on top of the third image.
[0061] In this way, by setting different images as lock screen images, the personalization of the lock screen interface is improved.
[0062] In a second aspect, an electronic device is provided, wherein the structure of the electronic device includes a processor and a memory, wherein the memory is used to store a program that supports the electronic device to execute the lock screen image display method provided by the first aspect, and to store data involved in implementing the lock screen image display method described in the first aspect. The processor is configured to execute the program stored in the memory. The electronic device may also include a communication bus, which is used to establish a connection between the processor and the memory.
[0063] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer executes the method for displaying a lock screen image described in the first aspect.
[0064] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method for displaying a lock screen image as described in the first aspect.
[0065] The technical effects obtained by the above-mentioned second, third and fourth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] FIG1 is a schematic diagram showing a depth-of-field lock screen image according to an exemplary embodiment;
[0067] FIG2 is a schematic diagram showing an application scenario according to an exemplary embodiment;
[0068] FIG3 is a schematic diagram showing another application scenario according to an exemplary embodiment;
[0069] FIG4 is a schematic diagram showing another application scenario according to an exemplary embodiment;
[0070] FIG5 is a schematic diagram showing another application scenario according to an exemplary embodiment;
[0071] FIG6 is a schematic diagram showing another application scenario according to an exemplary embodiment;
[0072] FIG7 is a schematic diagram showing a software architecture of an electronic device according to an exemplary embodiment;
[0073] FIG8 is a schematic diagram showing a framework for displaying a lock screen image according to an exemplary embodiment;
[0074] FIG9 is a schematic diagram showing a process flow of initializing the display of a lock screen image according to an exemplary embodiment;
[0075] FIG10 is a schematic diagram showing a process of adding a customized depth-of-field lock screen image to a magazine lock screen list according to an exemplary embodiment;
[0076] FIG11 is a schematic diagram showing a process of adding a theme depth of field lock screen image to a magazine lock screen list according to an exemplary embodiment;
[0077] FIG12 is a schematic diagram of a background image update process according to an exemplary embodiment;
[0078] FIG13 is a schematic diagram of a process of updating a foreground image according to an exemplary embodiment;
[0079] FIG14 is a schematic flow chart of a method for displaying a lock screen image according to an exemplary embodiment;
[0080] FIG15 is a schematic diagram showing a process of cropping to obtain a second image according to an exemplary embodiment;
[0081] FIG16 is a schematic diagram showing another process of cropping to obtain a second image according to an exemplary embodiment;
[0082] FIG17 is a schematic diagram showing another process of cropping to obtain a second image according to an exemplary embodiment;
[0083] FIG18 is a schematic flow chart of another method for displaying a lock screen image according to an exemplary embodiment;
[0084] Fig. 19 is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0085] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0086] It should be understood that the “multiple” mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, words such as “first” and “second” are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit them to be different.
[0087] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in 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 "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0088] Before giving a detailed introduction to the lock screen image display method provided in the embodiment of the present application, a brief introduction to the custom vocabulary and terminology involved in the embodiment of the present application is first given.
[0089] Lock screen interface: refers to the user interface that is first displayed when the electronic device is locked with a password after the system is restarted or the screen is turned on again after being turned off.
[0090] Lock screen image: This is the image applied to the lock screen interface. Users can usually set the lock screen image from the theme, or they can customize the lock screen image from the gallery.
[0091] Depth of field lock screen image: refers to an image with depth of field capability (referred to as depth of field image) used as the lock screen image. The depth of field image includes a foreground image and a background image. When the depth of field image is displayed on the lock screen interface, the foreground image is displayed above the level of the system time indicator and partially obscures the system time indicator. For example, please refer to Figure 1, which is a schematic diagram of a depth of field lock screen image according to an exemplary embodiment, in which part of the time information is partially obscured by the foreground image (i.e., main image A).
[0092] Theme: refers to the interface style presented by an electronic device, including but not limited to: desktop images, lock screen images and other content. Users can set their favorite themes in electronic devices. When different themes are applied to electronic devices, the interface styles presented by the electronic devices are different. Theme-related lock screen images usually include dynamic lock screen images, depth of field lock screen images, etc. Dynamic lock screen images refer to lock screen images with dynamic effects. As an example, the depth of field lock screen image applied from the theme can be simply referred to as the theme depth of field lock screen image.
[0093] Customized lock screen image: This typically refers to an image from the gallery app that is used as the lock screen image. Customized lock screen images typically include custom normal lock screen images and custom depth-of-field lock screen images. A custom depth-of-field lock screen image refers to an image with depth-of-field capabilities selected by the user from the gallery app as the lock screen image; a custom normal lock screen image typically refers to an image without depth-of-field capabilities, meaning a custom normal lock screen image refers to an ordinary image selected by the user from the gallery app as the lock screen image.
[0094] Magazine lock screen: refers to providing multiple different magazine lock screen images for electronic devices. When the magazine lock screen function is turned on, when the electronic device is in the lock screen state and the screen is on, one of the multiple magazine lock screen images is displayed on the lock screen interface. When the user swipes left or right on the lock screen interface, the electronic device can display the next or previous magazine lock screen image in the lock screen interface in response to the user's swiping operation. These magazine lock screen images can come from one or more of the local pre-set resources, cloud resources, or resources manually added by the user.
[0095] In one application scenario, when a user is using an electronic device, if the electronic device supports a horizontal or vertical screen switching function, that is, the screen of the electronic device can be displayed in portrait or landscape mode, in this case, the user may turn on the screen when the electronic device is in portrait mode, or may turn on the screen when the electronic device is in landscape mode. If the lock screen image of the electronic device is a depth of field image, then when the electronic device switches between landscape and portrait modes, the relative position between the highest point of the main image in the depth of field image and the system time indicator changes, resulting in a poor display effect of the depth of field image, affecting the depth of field effect. For example, when the electronic device is in portrait mode, the depth of field image corresponding to the portrait mode is image B, and the display effect of image B in the lock screen interface is shown in Figure 2 (a). A small part of the main image A in image B covers the upper layer of the system time indicator, and the highest point of the main image A is close to the middle position of the system time indicator in the vertical direction. Since the size of the original image does not necessarily match the size of the electronic device's display screen when setting the lock screen image, image B may be obtained by centering the original image, that is, the center of the original image is used as the center of image B, and the original image is cropped according to the size of the display screen to obtain image B. The size of image B is the same as the size of the display screen. The original image is the image selected in the setting operation when setting the lock screen image. However, the horizontal length and vertical width of the display screen of an electronic device are usually different. Therefore, when the electronic device is in the bright screen state, after the user rotates the electronic device, in order to adapt to the size of the display screen, the electronic device needs to re-center image B to obtain image C, that is, image C is the lock screen image corresponding to the case where the electronic device is in the horizontal screen display state. The display effect of image C in the lock screen interface is shown in Figure (b) in Figure 2. Since image C is obtained by re-centering image B, most of the main image A in image C is covered on the upper layer of the system time indicator, and the highest point position of the main image A exceeds the highest point position of the system time indicator in the vertical direction, that is, the relative position between the highest point position of the main image A and the system time indicator changes, resulting in poor display effect of the depth of field image, affecting the depth of field effect.
[0096] To enhance the depth-of-field image display effect, an embodiment of the present application provides a method for displaying a lock screen image. In this method, in response to a screen-lighting operation, a first image is displayed in a first lock screen interface. After the electronic device is rotated, the electronic device displays a second image in a second, rotated lock screen interface. The main image in both the first and second images obscures the system time indicator, and the position of the main image relative to the system time indicator in the second lock screen interface is the same as the position of the main image relative to the system time indicator in the first lock screen interface. Since the relative position between the main image and the system clock indicator does not change before and after the display screen of the electronic device is rotated, the depth-of-field image display effect is ensured, and the aesthetics of the depth-of-field image display are enhanced.
[0097] To facilitate understanding, the following describes an application scenario involving an embodiment of the present application by taking an electronic device that is a mobile phone with a foldable screen as an example.
[0098] Please refer to Figure 3, which is a schematic diagram of an application scenario according to an exemplary embodiment. In one possible scenario, when a user needs to use a mobile phone, if the user performs a screen-lighting operation on the mobile phone while the mobile phone is in portrait mode, the mobile phone, in response to the screen-lighting operation, displays a lock screen interface as shown in Figure 3 (a). The lock screen interface displays a depth-of-field image B, which includes a foreground image, namely, a subject image A. Subject image A is located above and partially covers the system time indicator. The highest point of subject image A is close to the middle position of the system time indicator in the vertical direction. The length and width of the mobile phone display are different. In this case, the user may rotate the mobile phone. In response to the rotation operation, as shown in Figure 3 (b), the display screen switches from portrait mode to landscape mode, and the lock screen image in the lock screen interface is updated from depth-of-field image B to depth-of-field image D. Depth-of-field image D includes subject image A, and the size of depth image D is different from that of depth image B. The highest point of subject image A in the depth image is close to the middle position of the system time indicator in the vertical direction. That is, when the display state of the display screen changes, the mobile phone can switch the lock screen image from depth of field image B to depth of field image C, and after the image is switched, the highest point position of the main image A in the depth of field image is the same as the relative position between the system time indicator, thereby ensuring the depth of field image display effect and improving the aesthetics of the depth of field image display.
[0099] Next, we will introduce the scenario of setting a depth of field image as the lock screen image. Please refer to Figure 4, which is a schematic diagram of an application scenario according to an exemplary embodiment. In another application scenario, if the user wants the lock screen image of the mobile phone to present a depth of field effect, the user can set the depth of field image as the lock screen image through a theme application. Referring to Figure 4 (a), the user can click the application identifier of the setting application; in response to the click operation on the application identifier of the setting application, the mobile phone displays the setting interface C1 shown in Figure 4 (b), and the user can click the "Wallpaper" option in the setting interface; in response to the click operation on the "Wallpaper" option, the mobile phone can display the wallpaper setting interface C2 shown in Figure 4 (c), which displays lock screen image type options, such as the "Wallpaper" option (this option is usually an option for a static lock screen image), the "Theme" option, the "Magazine Lock Screen" option, etc. The user can click the "Theme" option. In response to the click operation on the "Theme" option, the mobile phone displays a theme selection interface C3 as shown in Figure 4 (d), in which lock screen images corresponding to different themes are displayed. For example, dynamic images named "Wandering (Dynamic)", "Forest (Dynamic)" and "Stars (Dynamic)" corresponding to the dynamic image theme are displayed, and depth of field images named "People (Depth of Field)" corresponding to the depth of field image theme are displayed. The user can select the depth of field image named "People (Depth of Field)" as the lock screen image; in response to the selection operation of the depth of field image named "People (Depth of Field)", the mobile phone displays a preset theme interface C4 as shown in Figure 4 (e), if the user decides to use the depth of field image as the lock screen image, the user clicks the "Apply" option in the preset theme interface; in response to the click operation on the "Apply" option, the mobile phone can store the depth of field image as the lock screen image; thereafter, when the mobile phone displays the lock screen interface, the lock screen interface of the mobile phone can be as shown in Figure 4 (f). In Figure (f) of Figure 4, after the mobile phone screen is turned on, the set theme depth of field lock screen image is displayed in the lock screen interface. The theme depth of field lock screen image includes a foreground image, that is, the main image A. The main image A is on the upper layer of the system time indicator and partially covers the system time indicator.
[0100] In another possible scenario, in response to a click operation on the "Apply" option, the mobile phone may display a first prompt message, where the first prompt message is used to prompt the user that the selected depth of field image has been set as the lock screen image.
[0101] Please refer to Figure 5, which is a schematic diagram illustrating another application scenario according to an exemplary embodiment. In yet another application scenario, the depth of field image in the lock screen image can also be a user-defined image. Referring to Figure 5 (a), the user can click the application logo of the gallery application. In response to the click on the application logo of the gallery application, the mobile phone displays a gallery preview interface C5 as shown in Figure 5 (b). This gallery preview interface C5 can display thumbnails of multiple stored images. The user can select one of the thumbnails and set the image corresponding to the selected thumbnail as the lock screen image. For example, the user can long-press the thumbnail of the selected image H. In response to the long-press operation on the thumbnail of image H, an editing window C6 as shown in Figure 5 (c) is displayed, which displays a "Set as Wallpaper" option. The user can click the "Set as Wallpaper" option. In response to the click on the "Set as Wallpaper" option, the mobile phone saves the selected image H as the lock screen image. Afterwards, when the phone displays the lock screen, if the image H is an image with depth of field capability, the lock screen of the phone may be as shown in Figure 5 (d). In Figure 5 (d), after the phone turns on the screen, the lock screen displays the customized depth of field lock screen image. The customized depth of field lock screen image includes a foreground image, namely, the main image A. The main image A is located above the system time indicator and partially covers the system time indicator.
[0102] In another possible scenario, the mobile phone can automatically display image H on the lock screen with a depth-of-field effect, as shown in FIG5 . Of course, the user can also select the display effect for image H during the lock screen image setting process. For example, when the mobile phone displays the editing window C6 shown in FIG6(a), the user clicks the "Set as Wallpaper" option. In response to clicking the "Set as Wallpaper" option, if image H is an image with depth-of-field capability, the mobile phone displays the display effect selection window C7 shown in FIG6(b), from which the user can select the display effect for image H as the lock screen image. If the user clicks the "Display with Depth-of-Field Effect" option, the mobile phone can store the selected image H as the lock screen image in response to the click. Subsequently, when the mobile phone displays the lock screen, the lock screen may be as shown in FIG6(c).
[0103] In another possible scenario, referring to FIG6(d), if the user clicks the "Static Effect Display" option, then in response to the click on the "Depth of Field Effect Display" option, the phone can store the selected image H as the lock screen image. Subsequently, when the phone displays the lock screen interface, the phone's lock screen interface may be as shown in FIG6(e), in which image H is displayed below the system time indicator, meaning that image H does not obstruct the system time indicator.
[0104] In another possible scenario, when the mobile phone is storing the image H as the lock screen image, the mobile phone may display a second prompt message, where the second prompt message is used to prompt the user that the selected image has been set as the lock screen image.
[0105] It should be noted that the embodiments of the present application are only described using the application scenarios shown in Figures 3 to 6 above as examples, and do not constitute a limitation on the embodiments of the present application.
[0106] Next, the software system architecture of the electronic device is explained.
[0107] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to exemplify the software system of the electronic device.
[0108] Figure 7 is a block diagram of a software system for an electronic device provided in an embodiment of the present application. Referring to Figure 7 , the layered architecture divides the software into several layers, each with clear roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime layer, the system layer, and the kernel layer, from top to bottom.
[0109] The application layer can include a series of application packages. As shown in Figure 7, the application layer can include system applications (System UI), theme applications, gallery applications, and other applications.
[0110] System UI is the first user-visible application during the system startup process of an electronic device, such as the lock screen interface displayed after the electronic device is turned on, the desktop and status bar displayed after unlocking, etc. System UI is a set of UI components that provide users with system-level information display and interaction, and can be used to control the display of lock screen images and desktop images. In an embodiment of the present application, System UI can be used to interact with a theme application or a gallery application to display the set depth of field lock screen image in the lock screen interface after the screen is turned on when a depth of field lock screen image is applied in the electronic device. In an example, please refer to Figure 7, the System UI includes multiple functional modules, which include but are not limited to a broadcast message processing module (Statusbar), a lock screen image processing module (KeyguardWallpaper), a lock screen image drawing module (KeyguardWallpaperMediator), a view auxiliary module (ViewRoottimpl), a background view adapter (WallpaperPagerAdapterNoAnimation), a foreground view adapter (WallpaperPagerAdapterForeground), a foreground view page component, a background view page component and a tool class integration module (WallpaperUtils).
[0111] The broadcast message processing module is used to listen for wallpaper change broadcast messages and mark the type of the currently set lock screen image; the lock screen image processing module is used to control the display of the lock screen image; the view auxiliary module is used to monitor the display status of the display screen; the lock screen image drawing module is used to notify the view to render the view; the foreground view page component includes multiple views, each view can be used to render the foreground image of the depth of field image, and the foreground view adapter is used to fill the view in the foreground view page component; the background view page component includes multiple views, each view can be used to render the background image of the depth of field image, and the background view adapter is used to fill the view in the background view page component. In one example, the foreground view adapter is coupled to the foreground view page component, and the background view adapter is coupled to the background view page component. In another example, the foreground view adapter is decoupled from the foreground view page component, and the background view adapter is decoupled from the background view page component; the tool class integration module is used to crop the set lock screen image.
[0112] The theme application provides a variety of theme images for users to set as the desktop image or lock screen image of the electronic device. The theme application can be a system-provided setting application or an installed third-party application.
[0113] The Gallery application is used to store images, for example, images that can be taken or from the cloud. As an example of this application, the Gallery application includes ordinary images and images with depth of field capabilities. Ordinary images do not have a depth of field effect when applied to the lock screen interface, while images with depth of field capabilities have a depth of field effect when applied to the lock screen interface. Users can select any image from the Gallery application and set it as the lock screen image of the electronic device.
[0114] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0115] As an example of this application, the application framework layer includes a wallpaper management service module. Upon receiving a wallpaper change event notification from a theme application or gallery application, the wallpaper management service module sends a wallpaper change broadcast message to the System UI, allowing the System UI to process the wallpaper change. In one example, the wallpaper management service module is named WallpaperManagerService.
[0116] Please refer to Figure 7. The application framework layer also includes a power management service module and a window management service module. The power management service module is used to control the screen to turn off or on when there is a screen off event or screen on event in the electronic device, and send a screen off notification or screen on notification to the relevant modules. The window management service module is responsible for the management of the lock screen interface, such as displaying the lock screen image in the lock screen interface. In one example, the power management service module is named PowerManagerService and the window management service module is named WindowManagerService.
[0117] The Android Runtime consists of core libraries and a virtual machine (VM). The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for Java-based functions and the other for the Android core library. The application layer and application framework layer run in the VM. The VM executes Java files from the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0118] The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0119] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0120] Next, the display method of the lock screen image provided in the embodiment of the present application is introduced.
[0121] Please refer to Figure 8, which is a schematic diagram of a framework for displaying a lock screen image according to an exemplary embodiment. In implementation, as shown in Figure 4, the user can set the lock screen image from the theme application, or as shown in Figure 5, the user can also set the lock screen image from the gallery application. As an example of this application, regardless of which method the user uses to set the lock screen image, if the lock screen image set by the user is a depth of field lock screen image, the foreground image (i.e., the main image) and background image of the set depth of field lock screen image will be stored in the lock screen directory and renamed respectively. The lock screen directory stores at most one background image and one foreground image, that is, during the process of updating the background image and foreground image in the lock screen directory, the names of the updated foreground image and the updated background image in the lock screen directory remain unchanged. For example, the lock screen directory is data / themes / 0 / wallpaper, the foreground image is named unlock_depth_effect_wallpaper_0.jpg in the lock screen directory, and the background image is named unlock_wallpaper_0.jpg in the lock screen directory.
[0122] In one example, when a user sets a lock screen image from a theme application, after the user selects the theme depth of field lock screen image E and applies it, that is, after triggering the lock screen wallpaper setting operation, the theme application obtains a compressed package of the theme depth of field lock screen image E, which includes the foreground image and background image of the theme depth of field lock screen image E. The compressed package can be preset locally on the electronic device or preset in the cloud and obtained by the electronic device. Afterwards, the theme application decompresses the compressed package and stores the decompressed foreground image and background image in the lock screen directory. At the same time, the theme application can send a theme change message to the System UI to enable the System UI to change the layout of the lock screen interface.
[0123] In another example, when the user sets the lock screen image from the gallery application, after the user selects a custom depth of field lock screen image F in a gallery application and applies it, that is, triggers the lock screen wallpaper setting operation, the gallery application obtains the foreground image and background image of the pre-stored custom depth of field lock screen image F, and then saves the foreground image and background image of the custom depth of field lock screen image F to the lock screen directory.
[0124] It should be noted that the foreground image and background image of the custom depth of field lock screen image F pre-stored in the image application can be generated by the electronic device when it is idle, or can be generated by the electronic device when it is charging. For example, in the charging state, the electronic device can traverse the depth of field images in the gallery application. Every time a depth of field image is traversed, if the depth of field image has not been traversed before, the background image and foreground image of the depth of field image currently traversed can be separated by an artificial intelligence (AI) subject recognition method, and then the separated foreground image and background image are stored correspondingly to the depth of field image currently traversed. In this way, when the user sets any depth of field image in the gallery application as the lock screen image, the gallery application can save the foreground image and background image of any pre-stored depth of field image directly to the lock screen directory.
[0125] It should also be noted that the above description uses the example of a user-set lock screen image being a depth-of-field image. In another example, if the user-set lock screen image is not a depth-of-field image, the images stored in the lock screen directory will only include a background image, which is the set lock screen image itself. In this case, there will be no foreground image in the lock screen directory.
[0126] Continuing with Figure 8, after receiving the user's lock screen wallpaper setting operation, the Theme App or Gallery App notifies the Wallpaper Management Service Module of a wallpaper change event. Upon receiving this notification, the Wallpaper Management Service Module sends a wallpaper change broadcast message to the System UI, allowing the System UI to perform some initialization processing on the lock screen image display. Specifically, referring to Figure 9, the System UI's initialization processing operations may include the following:
[0127] Step 901: Receive a wallpaper change broadcast message.
[0128] In one possible scenario, the wallpaper change broadcast message is sent to the System UI by the wallpaper management service module after it receives a notification of a wallpaper change event from a theme application. For example, as shown in Figure 4, after a user sets a depth-of-field lock screen image in a theme application, the theme application notifies the wallpaper management service module of the wallpaper change event. The wallpaper management service module then sends a wallpaper change broadcast message to the System UI.
[0129] In another possible scenario, the wallpaper change broadcast message is sent to the System UI by the Wallpaper Management Service Module after it monitors the wallpaper change event notification sent by the Gallery application. For example, as shown in Figure 5, after the user sets a custom depth-of-field lock screen image in the Gallery application, the Gallery application notifies the Wallpaper Management Service Module of the wallpaper change event. The Wallpaper Management Service Module then sends the Wallpaper Change Broadcast Message to the System UI.
[0130] In one example, a wallpaper change broadcast message may carry first indication information, and the first indication information is used to indicate whether the currently set lock screen image is a theme lock screen image or a custom lock screen image. Specifically, since the wallpaper management service module can know whether the wallpaper change event is notified by the theme application or the gallery application, the wallpaper management service module can determine whether the currently set lock screen image is from the theme application or the gallery application. Based on this, when sending a wallpaper change broadcast message to the System UI, the first indication information may be carried in the wallpaper change broadcast message, so that the System UI can determine whether the currently set lock screen image is a theme lock screen image or a custom lock screen image based on the wallpaper change broadcast message. Exemplarily, when the first indication information is a preset identifier, the first indication information is used to indicate that the currently set lock screen image is a custom lock screen image. Otherwise, when the first indication information is not a preset identifier, the first indication information is used to indicate that the currently set lock screen image is a theme lock screen image.
[0131] Optionally, the wallpaper change broadcast message may also carry event description information. The event description information is used to indicate the application object of the wallpaper change. The application object includes the user interface or the lock screen interface. That is, the event description information is used to indicate whether the desktop image or the lock screen image has changed. This embodiment of the application is described using the example of the lock screen interface as the application object of the event description information indicating the wallpaper change.
[0132] Step 902: After receiving the wallpaper change broadcast message, determine whether the current system is restarting.
[0133] As shown in Figure 8 and the preceding text, after the user sets the lock screen image, the System UI will receive a wallpaper change broadcast message. Alternatively, the System UI may also receive a wallpaper change broadcast message after the electronic device is powered on and restarted. For example, the wallpaper management service module may send a wallpaper change broadcast message to the System UI when the electronic device is powered on and restarted. The System UI handles these two situations differently. Therefore, after receiving the wallpaper change message, the System UI may first determine whether the system is currently restarting.
[0134] In one example, the System UI can query whether the electronic device is currently displaying the desktop. If the electronic device is currently displaying the desktop, it is determined that the system has not been restarted. Otherwise, if the electronic device is not currently displaying the desktop, it is determined that the system has been restarted. Further, the System UI can determine whether the electronic device is currently displaying the desktop by querying the restart identifier. For example, if the restart identifier is true, it is determined that the electronic device is currently displaying the desktop, and thus it can be determined that the system has not been restarted; if the restart identifier is false, it is determined that the electronic device is not currently displaying the desktop, and thus it can be determined that the system has been restarted.
[0135] If it is determined that the current system is not restarting, the process proceeds to step 903. Otherwise, if it is determined that the current system is restarting, the process proceeds to step 908.
[0136] Step 903: Determine whether the currently set lock screen image is a custom lock screen image.
[0137] As an example of the present application, the System UI can determine whether the currently set lock screen image is a custom lock screen image based on the first indication information carried in the wallpaper change broadcast message. For example, if the first indication information is a preset identifier, it is determined that the currently set lock screen image is a custom lock screen image; otherwise, if the first indication information is not a preset identifier, it is determined that the currently set lock screen image is not a custom lock screen image.
[0138] If the currently set lock screen image is a custom lock screen image, proceed to step 904. Otherwise, if the currently set lock screen image is not a custom lock screen image, it means that the currently set lock screen image is a theme lock screen image. In this case, proceed to step 908.
[0139] Step 904: Determine whether the currently set custom lock screen image has depth of field capability.
[0140] As an example of the present application, since the lock screen directory is only used to store lock screen images, and when the set lock screen image is a depth of field image, the lock screen directory includes two images, unlock_depth_effect_wallpaper_0.jpg (foreground image) and unlock_wallpaper_0.jpg (background image), and when the set lock screen image is not a depth of field image, the lock screen directory only includes one image, unlock_wallpaper_0.jpg (background image), so the System UI can query whether there are both foreground images and background images in the lock screen directory, thereby determining whether the currently set custom lock screen image has depth of field capability. Specifically, when both foreground images and background images exist in the lock screen directory, it can be determined that the custom lock screen image currently set by the user has depth of field capability. Otherwise, when only the background image exists in the lock screen directory, it is determined that the custom lock screen image currently set by the user does not have depth of field capability.
[0141] If the currently set custom lock screen image has depth of field capability (hereinafter referred to as custom depth of field lock screen image), the following steps 905 to 906 are performed. Otherwise, if the currently set custom lock screen image does not have depth of field capability, the following step 907 is performed.
[0142] Step 905: Mark the lock screen image type as 0.
[0143] In one example, the System UI may mark the type of the currently set lock screen image in the lightweight database. That is, if the currently set lock screen image is a custom depth-of-field lock screen image, the System UI writes the type of the currently set lock screen image to 0 in the lightweight database. Exemplarily, the System UI may indicate the type of the currently set lock screen image through the first indication information.
[0144] It should be noted that the type of the currently set lock screen image recorded in the lightweight database is unique. The lightweight database may be SharedPreferences.
[0145] Step 906: Add detailed information of the customized depth of field lock screen image to the magazine lock screen data list.
[0146] As an example of the present application, the detailed information of the custom depth of field lock screen image includes the background thumbnail, index information, image description information, etc. of the custom depth of field lock screen image. The background thumbnail is an image that is compressed according to a certain ratio of the background image of the custom depth of field lock screen image, where the background image can be obtained from the lock screen directory. The index information is used to query the detailed information of the custom depth of field lock screen image from the magazine lock screen data list. The image description information includes application widgets, text information, etc. The text information can be used to describe what the custom depth of field lock screen image represents. For example, as shown in Figure (d) in Figure 5, the text information is "Leisure time is a rainbow."
[0147] The magazine lock screen data list includes detailed information about each magazine lock screen image in multiple magazine lock screen images. As an example of this application, regardless of whether the magazine lock screen function is turned on or off, the detailed information of the custom lock screen image can be added to the magazine lock screen data list. When the magazine lock screen function is turned off, the currently set lock screen image can be displayed when the lock screen interface is subsequently displayed. When the lock screen interface is swiped, the magazine lock screen image in the magazine lock screen resource is not displayed.
[0148] As an example of the present application, referring to FIG. 10 , the specific implementation of step 906 , that is, adding the detailed information of the customized depth of field lock screen image to the magazine lock screen data list, may include the following steps:
[0149] A1: Modify the index information of the currently set custom depth of field lock screen image according to the principle that division by four leaves a remainder of zero.
[0150] Typically, the original index information for each lock screen image is a numeric value. Since a lock screen image type of 0 indicates a custom depth-of-field lock screen image, to facilitate subsequent identification of the currently set lock screen image as a custom depth-of-field lock screen image, the original index information can be modified based on the principle of division by four with a remainder of zero.
[0151] As an example, the original index information of the custom depth of field lock screen image can be used to determine a corresponding value that is zero when divided by four using the following first formula (1), and the index information of the currently set custom depth of field lock screen image can be modified to the determined value that is zero when divided by four. (4-X1%4)+X1=Y1 (1)
[0152] It should be noted that in the first formula (1) above, X1 is the original index information of the custom depth of field lock screen image, Y1 is the modified value of the remainder after division by four, and % is the remainder symbol. For example, assuming that the original index information of the currently set custom depth of field lock screen image is 7, the corresponding value of the remainder after division by four, such as 8, can be determined by the first formula (1) above, and then the index information of the currently set custom depth of field lock screen image is changed from 7 to 8.
[0153] A2: Record the modified index information as cacheid and write it to the lightweight database.
[0154] A3: Encapsulates the detailed information of the currently set custom depth of field lock screen image, and the detailed information at least includes the modified cacheID.
[0155] As an example of this application, the System UI can encapsulate detailed information into a data structure, such as BigPictureInfo. As an example and not a limitation, the System UI can also set some restrictions in BigPictureInfo, such as the restrictions that the custom depth of field lock screen image cannot be deleted and the lock screen automatic switching function is disabled.
[0156] A4: Add the detailed information of the currently set custom depth of field lock screen image to the magazine lock screen data list, where the magazine lock screen data list includes the detailed information of each of the multiple magazine lock screen images.
[0157] The detailed information of the magazine lock screen image may include the index information, background thumbnail, image description information, etc. The background thumbnail of the magazine lock screen image is obtained by compressing the magazine lock screen image according to a certain ratio. As an example of this application, the detailed information of each magazine lock screen image corresponds to BigPictureInfo.
[0158] As an example of the present application, the detailed information of the currently set custom depth of field lock screen image can be randomly inserted into any position in the magazine lock screen data list.
[0159] In one example, the System UI may also prepare a background blur map of the currently set depth of field image. The background blur map may be displayed when the user swipes up the lock screen interface, that is, when the user swipes up the lock screen interface, the electronic device will have a blur effect. The background blur map may be generated based on the background image. For example, if the currently set lock screen image is a depth of field image, the background image may be obtained from the lock screen directory, and Gaussian blur may be performed on the background image to obtain the background blur map, which may then be stored.
[0160] As an example and not a limitation, the System UI adds detailed information of the custom depth of field lock screen image to the magazine lock screen data list through the lock screen image processing module.
[0161] It should be noted that the embodiment of the present application is described by taking the case where the currently set lock screen image is a depth of field lock screen image (including a custom depth of field lock screen image or a theme depth of field lock screen image) as an example, where the detailed information added to the magazine lock screen data list includes the background image of the depth of field lock screen image. In another example, when the set lock screen image is a depth of field lock screen image, the detailed information of the depth of field lock screen image added to the magazine lock screen data list includes a background thumbnail, but not a background image. That is, the background thumbnail of the depth of field lock screen image can be encapsulated in the detailed information instead of encapsulating the background image in the detailed information, which can save the storage space where the magazine lock screen data list is located.
[0162] After adding the details of the customized depth of field lock screen image to the magazine lock screen data list, the System UI enters the following step 913.
[0163] Step 907: Mark the lock screen image type as -1 and end the depth of field processing flow.
[0164] That is, if the currently set lock screen image is a custom ordinary lock screen image, the system UI writes the type of the currently set lock screen image to the lightweight database as -1, indicating that the currently set lock screen image is a custom lock screen image but not a depth of field image. The system UI then ends the depth of field processing process.
[0165] Step 908: Determine whether the currently set lock screen image is a static image.
[0166] As an example, and not a limitation, the System UI can determine whether the currently set lock screen image is a static image based on a wallpaper change broadcast message. For example, when a theme application notifies the wallpaper management service module of a wallpaper change event, it can indicate to the wallpaper management service module whether the user-set lock screen image is a static image. Accordingly, when the wallpaper management service module sends a wallpaper change broadcast message to the System UI, it can include an indication in the wallpaper change broadcast message, allowing the System UI to determine whether the currently set lock screen image is a static image.
[0167] If the currently set lock screen image is a static image, the process proceeds to step 909. Otherwise, if the currently set lock screen image is not a static image, such as a dynamic image, the System UI ends the depth of field processing flow, as an example and not a limitation, and then proceeds to the dynamic image processing flow, etc., which is not limited in the present embodiment.
[0168] Step 909: Determine whether the currently set lock screen image has depth of field capability.
[0169] That is, it determines whether the currently set lock screen image is a depth-of-field image. In implementation, the System UI can query the lock screen directory to determine whether both a foreground image and a background image exist, thereby determining whether the currently set lock screen image has depth-of-field capabilities. Specifically, if both a foreground image and a background image exist in the lock screen directory, it can be determined that the lock screen image currently set by the user has depth-of-field capabilities. Otherwise, if only a background image exists in the lock screen directory, it is determined that the currently set lock screen image does not have depth-of-field capabilities.
[0170] If the currently set lock screen image does not have depth of field capability, the System UI performs the operation of step 907. Otherwise, if the currently set lock screen image has depth of field capability, the System UI proceeds to the operation of the following step 910.
[0171] Step 910: Determine whether the currently set lock screen image is a custom depth-of-field lock screen image.
[0172] According to the above description and in conjunction with Figure 8, in one possible case, the process will proceed to step 910 after the system is restarted. In another possible case, the process will proceed to step 910 after the user sets a lock screen image. In the first possible case, the user may have already set a custom depth-of-field lock screen image as the lock screen image before the electronic device system is restarted. In this case, there is no need to perform subsequent operations such as initializing the theme depth-of-field image. Therefore, it is necessary to determine whether the currently set lock screen image is a custom depth-of-field lock screen image.
[0173] If the currently set lock screen image is a custom depth of field lock screen image, perform the above steps 905-906. If the electronic device does not currently apply a custom depth of field lock screen image, it can be determined that the currently set lock screen image is a theme depth of field lock screen image. In this case, proceed to the following step 911.
[0174] Step 911: Mark the currently set lock screen image type as 3.
[0175] That is, when the currently set lock screen image is a theme depth of field lock screen image, System UI writes the type of the currently set lock screen image as 3 in the lightweight database, indicating that the currently set lock screen image is a theme lock screen image and has depth of field capability.
[0176] Of course, it should be noted that the implementation step of marking the type of the currently set lock screen image after receiving the wallpaper change broadcast message is optional. In another example, other steps may be included to meet the requirements of exception handling, or other methods may be used for marking. The main marking principle is: in the case of non-system restart, if the currently set lock screen image is a custom depth of field lock screen image, the type of the currently set lock screen image recorded in the lightweight database is 0; if the currently set lock screen image is a custom ordinary lock screen image, the type of the currently set lock screen image recorded in the lightweight database is -1; if the currently set lock screen image is a theme depth of field lock screen image, the type of the currently set lock screen image recorded in the lightweight database is 3. When the system restarts, if the lock screen image set before startup is a static image and does not have depth of field capability, the type of the currently set lock screen image recorded in the lightweight database is -1; if the lock screen image set before startup is a theme depth of field lock screen image, the type of the currently set lock screen image recorded in the lightweight database is 3; if the lock screen image set before startup is a custom depth of field lock screen image, the type of the currently set lock screen image recorded in the lightweight database is 0.
[0177] Step 912: Add detailed information of the theme depth of field lock screen image to the magazine lock screen data list.
[0178] When it is determined that the currently set lock screen image is the theme depth of field lock screen image, System UI performs depth of field initialization based on the theme depth of field lock screen image. The main purpose is to add the detailed information of the currently set theme depth of field lock screen image to the magazine lock screen data list.
[0179] As an example of the present application, please refer to FIG11 . The specific implementation of step 912 , that is, adding the detailed information of the theme depth of field lock screen image to the magazine lock screen data list, may include the following steps:
[0180] B1: Copy the background image in the lock screen directory to another preset directory.
[0181] To prevent the background image of the theme depth of field lock screen image from being replaced by a custom lock screen image later, System UI can copy the background image of the currently set theme depth of field lock screen image from the lock screen directory to a preset directory. For example, the preset directory can be data / user_de / 0 / com.android.systemui / files.
[0182] In one possible implementation, the replaced scenario is, assuming that the user currently sets the theme depth of field lock screen image P1, the background image stored in the lock screen directory is the background image of the set theme depth of field lock screen image P1, and the System UI adds the detailed information of the theme depth of field lock screen image P1 to the magazine lock screen data list. Later, if the user resets the custom depth of field lock screen image P2, in this case, the background image stored in the lock screen directory will be replaced by the background image of the custom depth of field lock screen image P2, and the System UI adds the detailed information of the custom depth of field lock screen image P2 to the magazine lock screen data list, resulting in the magazine lock screen data list no longer including the detailed information of the theme depth of field lock screen image P1. However, in practice, after setting the theme depth of field lock screen image P1, and then setting the custom depth of field lock screen image P2, the previously set theme depth of field lock screen image P1 can be retained in the magazine lock screen resource as a normal lock screen image, so that in response to the user's left or right swipe operation on the lock screen interface, when the lock screen interface of the electronic device turns the page and turns the page to the theme depth of field lock screen image P1, the theme depth of field lock screen image P1 does not have a depth of field effect, and when the page is turned to the custom depth of field lock screen image P2, the custom depth of field lock screen image P2 has a depth of field effect. Therefore, in order to achieve this effect, it is necessary to retain the background image of the theme depth of field lock screen image P1. Therefore, in order to avoid the background image of the custom depth of field lock screen image P2 replacing the background image of the theme depth of field lock screen image P1, the background image of the theme depth of field lock screen image P1 can be copied from the lock screen directory to another preset directory for storage during the depth of field initialization process based on the theme depth of field lock screen image P1.
[0183] It should be noted that, as an example of the present application, in the process of setting the depth of field image as the lock screen image, the foreground image under the lock screen directory is unique, that is, the embodiment of the present application can only support setting one depth of field image (custom depth of field lock screen image or theme depth of field lock screen image) as the lock screen image.
[0184] B2: Modify the index information of the currently set theme depth of field lock screen image according to the principle of dividing by four and having a remainder of three.
[0185] Since the lock screen image type is 3, it indicates a theme depth of field lock screen image. Therefore, in order to facilitate the subsequent identification that the currently set lock screen image is a theme depth of field lock screen image, the index information can be modified based on the original index information of the theme depth of field lock screen image according to the principle of dividing by four and leaving a remainder of three.
[0186] As an example, the original index information of the theme depth lock screen image can be used to determine a corresponding value that is divided by four and has a remainder of three using the following second formula (2), and the index information of the currently set theme depth lock screen image can be modified to the determined value that is divided by four and has a remainder of three. (3-X2%4)+X2=Y2 (2)
[0187] It should be noted that in the above second formula (2), X2 is the original index information of the theme depth of field lock screen image, Y2 is the modified value of the remainder of three after division by four, and % is the remainder symbol. For example, assuming that the original index information of the currently set theme depth of field lock screen image is 10, the corresponding value of the remainder of three after division by four can be determined as 11 according to the above second formula (2), and then the index information of the currently set theme depth of field lock screen image is changed from 10 to 11.
[0188] B3: Record the modified index information as cacheid and write it into the lightweight database.
[0189] As an example, this operation can refer to the operation of step A3 above, and this embodiment of the application will not describe it one by one.
[0190] B4: Encapsulates the detailed information of the currently set theme depth of field lock screen image, and the detailed information at least includes the modified cacheid.
[0191] In one example, the detailed information of the themed depth-of-field lock screen image may also include its image description information, background image, etc. The image description information includes application widgets, text information, etc. If the current lock screen image is set to the themed depth-of-field lock screen image, the background image of the themed depth-of-field lock screen image can be obtained from the preset directory data / user_de / 0 / com.android.systemui / files.
[0192] As an example of the present application, the System UI can also encapsulate the detailed information of the theme depth of field lock screen image into a data structure, which will not be described one by one in the embodiments of the present application.
[0193] B5: Add the details of the currently set theme depth of field lock screen image to the magazine lock screen data list.
[0194] As an example of the present application, the specific implementation of adding the detailed information of the currently set theme depth of field lock screen image to the magazine lock screen data list can be: when the magazine lock screen data list includes the detailed information of the custom depth of field lock screen image, the detailed information of the custom depth of field lock screen image is deleted from the magazine lock screen data list, and the detailed information of the currently set theme depth of field lock screen image is added to the location of the detailed information of the custom depth of field lock screen image before deletion. When the magazine lock screen data list does not include the detailed information of the custom depth of field lock screen image, the detailed information of the currently set theme depth of field lock screen image is inserted into the magazine lock screen data list. For example, a random position can be selected for insertion.
[0195] As an example and not a limitation, the System UI adds detailed information of the theme depth of field lock screen image to the magazine lock screen data list through the lock screen image processing module.
[0196] Optionally, there may be multiple user accounts that can log in to the electronic device, for example, multiple user accounts include a main user account and a sub-user account. The main user account can generally be the owner of the electronic device, and the sub-user account is generally not the owner of the electronic device. For example, it may only have partial usage permissions. In this case, before adding the detailed information of the theme depth of field lock screen image to the magazine lock screen data list, it can also be determined whether the currently logged in user account is a sub-user account. If the currently logged in user account is not a sub-user account and the current electronic device has not been initialized, the System UI adds the detailed information of the theme depth of field lock screen image to the magazine lock screen data list. Otherwise, if the currently logged in user account is a sub-user account, and / or the electronic device has been initialized, the subsequent process is terminated. This can improve the security of the electronic device.
[0197] Step 913: Update the view page component, wherein the view page component is used to render image data to be displayed.
[0198] The Viewpager component is a view paging tool that provides a multi-page switching effect. It can be populated with multiple views through a view adapter. A single view can be used to render the image data of a lock screen image, thereby supporting the user to switch between different views when swiping left or right.
[0199] Since the lock screen image includes a foreground image and a background image when the lock screen image is a depth of field lock screen image (such as a theme depth of field lock screen image or a custom depth of field lock screen image), as an example of the present application, the view page component includes a foreground view page component and a background view page component, wherein the foreground view page component is used to render the foreground image of the lock screen image to be displayed, and the background view page component is used to render the background image of the lock screen image to be displayed. Therefore, when the view page component is updated, it includes updating the background view page component and the foreground view page component.
[0200] As an example of the present application, since the magazine lock screen function is turned on, when the currently set lock screen image is displayed in the lock screen interface, the user may slide the lock screen interface to the left (or right). In this case, it is necessary to display the next (or previous) lock screen image of the currently set lock screen image in the magazine lock screen resource. Therefore, in order to quickly respond to the user's sliding operation, the foreground image of each of the three lock screen images can be rendered in the foreground view page component during the update, and the background image of each of the three lock screen images can be rendered in the background view page component, that is, the image data of each lock screen image in the currently set lock screen image, the previous lock screen image of the currently set lock screen image in the magazine lock screen resource, and the next lock screen image are cached respectively.
[0201] As an example of the present application, referring to FIG. 12 , in step 913 , the update process for the view in the background view page component may include the following operations (Bg11) to (Bg15):
[0202] (Bg11) Check whether the magazine lock screen function is enabled.
[0203] In implementation, the System UI can query the status of the magazine lock screen switch to determine whether the magazine lock screen function is enabled. If the magazine lock screen switch is on, the magazine lock screen function is determined to be enabled. Otherwise, if the magazine lock screen switch is off, the magazine lock screen function is determined to be disabled.
[0204] It should be noted that the status of the magazine lock screen switch can be represented by a switch identifier. When the switch identifier is a preset first identifier, it is determined that the magazine lock screen function is turned on. When the switch identifier is a preset second identifier, it is determined that the magazine lock screen function is turned off.
[0205] If the magazine lock screen function is enabled, the System UI proceeds to the following operation (Bg12). If the magazine lock screen function is not enabled, the process ends, i.e., the following operation Bg12 is not continued.
[0206] (Bg12) Clear the background view page component.
[0207] This means that all previously rendered lock screen images in the background view page component are cleared. Furthermore, System UI clears the cached information in the background view adapter to facilitate reloading the background images for each of the three lock screen images to be displayed. The background view adapter is used to provide loading data for the background view page component.
[0208] Optionally, before clearing the background view page component, you can also determine whether it is the first time to start up with a password, and whether the lock screen interface is invisible. If there is a password for the first time to start up, then after the lock screen interface is displayed, the lock screen interface will not display the magazine lock screen image when it receives a left or right sliding operation. Therefore, when there is a password for the first time to start up, there is no need to execute the subsequent process. If there is no password for the first time to start up, after the lock screen interface is displayed, the lock screen interface needs to display the magazine lock screen image when it receives a left or right sliding operation. Therefore, the operation of clearing the background view page component can be executed. In addition, when the lock screen interface is invisible, for example, when the welcome interface is displayed at startup but the lock screen interface is not displayed, the operation of clearing the background view page component can be temporarily not executed. Instead, the operation of clearing the background view page component can be executed after entering the lock screen interface (that is, the lock screen interface is visible).
[0209] (Bg13) Get the views corresponding to the currently set lock screen image and the adjacent magazine lock screen image from the background view page component.
[0210] Each view is a view that displays the background image of a corresponding lock screen image. The number of views included in the background view page component can be set as needed. For example, the background view page component includes view 1, view 2, view 3, view 4, and view 5. View 1, view 2, and view 3 can be obtained during the update process.
[0211] (Bg14) Obtain detailed information of the currently set lock screen image and adjacent magazine lock screen images from the magazine lock screen data list.
[0212] As mentioned above, the currently set lock screen image may be a custom depth-of-field lock screen image or a themed depth-of-field lock screen image, and its detailed information has been added to the magazine lock screen data list. Therefore, the detailed information of the currently set lock screen image, the detailed information of the previous lock screen image, and the detailed information of the next lock screen image can be obtained from the magazine lock screen data list. In one example, the system UI can obtain the detailed information of the currently set lock screen image and the adjacent magazine lock screen images from the magazine lock screen data list through the background view adapter.
[0213] In implementation, the currently set lock screen image can be used to locate its detailed information from the magazine lock screen data list. The System UI then uses the background view adapter to retrieve its detailed information from the magazine lock screen data list based on the located location. The system also retrieves the previous and next detailed information from the magazine lock screen data list to obtain the detailed information of the adjacent magazine lock screen image.
[0214] (Bg15) Based on the obtained detailed information, the background view adapter renders the background images of the currently set lock screen image and its adjacent magazine lock screen image into the obtained view respectively, and records the correspondence between the background images of each lock screen image and the view in which it is located.
[0215] For example, the background image carried in the details information of the currently set lock screen image is set in view 2 through the background view adapter, and the correspondence between the view identifier of view 2 and the index information of the currently set lock screen image is recorded; the background thumbnail carried in the details information of the previous magazine lock screen image of the currently set lock screen image is set in view 1 through the background view adapter, and the correspondence between the view identifier of view 1 and the index information of the previous magazine lock screen image is recorded; and the background thumbnail carried in the details information of the next magazine lock screen image of the currently set lock screen image is set in view 3 through the background view adapter, and the correspondence between the view identifier of view 3 and the index information of the next magazine lock screen image is recorded.
[0216] This completes the update of the background view page component.
[0217] As an example of the present application, when the background view page component is updated, the System UI can also notify all interface elements of the lock screen interface so that the interface elements in the lock screen interface are blurred based on the lock screen image in the updated background view page component.
[0218] As an example of the present application, please refer to FIG13 . In step 913 , the update process of the view in the foreground view page component may include the following operations ( Fg21 ) to ( Fg210 ):
[0219] (Fg21) Check whether the magazine lock screen function is enabled.
[0220] When the magazine lock screen function is turned on, the System UI performs the following operation (Fg22). Otherwise, when the magazine lock screen function is not turned on, the process ends, that is, the System UI does not perform subsequent operations.
[0221] (Fg22) Gets the type of the currently set lock screen image.
[0222] In one possible case, since both the theme depth of field lock screen image and the custom depth of field lock screen image may exist in the magazine lock screen resources, for example, the user first sets the theme depth of field lock screen image, and then sets the custom depth of field lock screen image, in this case, in order to facilitate the subsequent accurate judgment of whether the currently set lock screen image is the theme depth of field lock screen image or the custom depth of field lock screen image, the System UI obtains the type of the currently set lock screen image.
[0223] As previously mentioned, the lightweight database records the type of the currently set lock screen image, so System UI can query the type of the currently set lock screen image from the lightweight database. If the lock screen image is a custom depth-of-field lock screen image, the type of the obtained lock screen image is 0. If the lock screen image is a themed depth-of-field lock screen image, the type of the obtained lock screen image is 3.
[0224] Optionally, before executing operation (Fg22), it can also be determined whether this is the first time the computer is turned on with a password, and whether the lock screen interface is invisible. If the computer is turned on for the first time with a password, or the lock screen interface is invisible, the subsequent process may not be executed; otherwise, if the computer is turned on for the first time without a password, and the lock screen interface is invisible, an operation is executed to obtain the type of the currently set lock screen image.
[0225] (Fg23) According to the type of the currently set lock screen image, determine whether the current lock screen image is a depth of field image.
[0226] In one possible scenario, the type of the currently set lock screen image is 0, indicating that the currently set lock screen image is a custom depth-of-field lock screen image, that is, it is determined to be a depth-of-field image. In another possible scenario, the type of the currently set lock screen image is 3, indicating that the currently set lock screen image is a theme depth-of-field lock screen image, that is, it is determined to be a depth-of-field image. In yet another possible scenario, the type of the currently set lock screen image is neither 0 nor 3, in which case it is determined that the currently set lock screen image is not a depth-of-field image.
[0227] If the currently set lock screen image is not a depth-of-field image, proceed to the following operation (Fg24). Otherwise, if the currently set lock screen image is a depth-of-field image, proceed to the following operation (Fg25).
[0228] (Fg24) Set the foreground image of the current lock screen image to empty.
[0229] That is, when the currently set lock screen image is not a depth of field image, it means that the currently set lock screen image does not have a foreground image. In this case, the foreground image of the current lock screen image can be set to empty through the foreground view adapter.
[0230] As an example of this application, three views to be rendered can be obtained from the foreground view page component. When the foreground image of the currently set lock screen image is empty, the correspondence between the view identifier of a blank view and the index information of the currently set lock screen image can be recorded in the foreground view adapter.
[0231] In one example, if the currently set lock screen image includes image description information, the image description information can be added to the view corresponding to the currently set lock screen image.
[0232] As an example but not limitation, the foreground view adapter may obtain index information of the currently set lock screen image from the background view adapter.
[0233] (Fg25) Obtain the foreground image through the foreground view adapter, which is used to provide loading data for the foreground view page component.
[0234] Since the foreground image in the lock screen directory is unique, when the currently set lock screen image is a depth of field image, the image can be directly obtained from the lock screen directory, that is, the image named unlock_depth_effect_wallpaper_0.jpg can be obtained.
[0235] (Fg26) Rendering the acquired foreground image to the corresponding view in the foreground view page component through the foreground view adapter.
[0236] In one example, when the detailed information of the currently set lock screen image also includes image description information, the image description information can also be rendered to an upper layer of the hierarchy where the foreground image is located through the foreground view adapter.
[0237] As an example, after rendering the foreground of the currently set lock screen image to the corresponding view in the foreground view page component, the foreground view adapter can record the correspondence between the view identifier of the rendered view and the index information of the currently set lock screen image.
[0238] (Fg27) According to the index information of the currently set lock screen image, obtain the index information of the previous magazine lock screen image of the current lock screen image.
[0239] As an example but not limitation, the index information of the previous magazine lock screen image of the currently set lock screen image can be obtained from the background view adapter through the foreground view adapter.
[0240] (Fg28) When it is determined according to the index information of the previous magazine lock screen image that it is not a depth of field image, the foreground image of the previous magazine lock screen image is set to empty.
[0241] As an example of the present application, the previous view adjacent to the view where the foreground image of the currently set lock screen image is located can be obtained from the foreground view page component, and then the correspondence between the obtained view and the index information of the previous magazine lock screen image can be recorded, that is, the foreground image of the previous magazine lock screen image is recorded as empty, that is, it does not exist.
[0242] (Fg29) According to the index information of the currently set lock screen image, the index information of the next magazine lock screen image of the current lock screen image is obtained.
[0243] As an example but not limitation, the index information of the next magazine lock screen image of the currently set lock screen image can be obtained from the background view adapter through the foreground view adapter.
[0244] (Fg210) When it is determined according to the index information of the next magazine lock screen image that it is not a depth of field image, the foreground image of the next magazine lock screen image is set to be empty.
[0245] As an example of the present application, the next view adjacent to the view where the foreground image of the currently set lock screen image is located can be obtained from the foreground view page component, and then the correspondence between the obtained view and the index information of the next magazine lock screen image can be recorded, that is, the foreground image of the next magazine lock screen image is recorded as empty, that is, it does not exist.
[0246] In this way, the update of the foreground view page component is completed.
[0247] It should be noted that the operations of steps (Bg11) to (Bg15) and steps (Fg21) to (Fg210) are all optional. In another example, to meet the exception handling requirements, the specific implementation of the update view page component may not be limited to including these steps, and this embodiment of the application does not limit this.
[0248] It should be noted that the embodiment of the present application is described by taking the case where the set lock screen image is a depth of field lock screen image, and rendering the background image of the depth of field lock screen image into the background view page component as an example. In another example, the detailed information of the depth of field lock screen image includes a background thumbnail. In this case, after the background view adapter obtains the detailed information of the depth of field lock screen image, it renders the background thumbnail included in the detailed information of the depth of field lock screen image into the background view page component. Afterwards, during the bright screen display process, the background thumbnail can be displayed first, and then the corresponding background image can be obtained according to the index information of the depth of field lock screen image, and the displayed background thumbnail can be replaced with the background image. In this way, the cache space of the background view page component can be saved while ensuring the real-time display.
[0249] It should be noted that the embodiment of the present application is described by caching the image data of three lock screen images in the view page component at the same time. In another example, the image data of more lock screen images can be cached at the same time. For example, the image data of five lock screen images can be cached at the same time, and the embodiment of the present application is not limited to this.
[0250] Based on the application scenarios and initialization operations provided in the above embodiments, the following describes the method for displaying a lock screen image provided in an embodiment of the present application. Please refer to Figure 14, which is a flow chart of a method for displaying a lock screen image according to an exemplary embodiment. As an example and not a limitation, Figure 14 illustrates the method as applied to an electronic device. The method may include some or all of the following:
[0251] Step 1401: In response to a first setting operation, the original image selected in the first setting operation is set as a lock screen image.
[0252] It should be noted that the first setting operation refers to setting an image such as the lock screen image or desktop image to a depth-of-field image. This depth-of-field image is an image with depth-of-field capabilities. The depth-of-field image includes a main image and a background image. When the depth-of-field image is displayed on the lock screen interface, the background image of the depth-of-field image is displayed below the layer where the system time indicator is located, and part of the system time indicator is located below the main image. That is, the main image partially covers the content of the system time indicator. For example, this scenario is shown in Figure 4 or Figure 5 above.
[0253] In order to make the display effect of the lock screen interface present a sense of layering, users can usually set the lock screen image to a depth of field image. As can be seen from the above, users can set the selected original image as the lock screen image through the theme application or gallery application, and the original image is an image with depth of field capability.
[0254] As an example, depending on how the depth of field image is set as the lock screen image, the size of the original image is also different. Among them, when the user sets it through the theme application, the original image belongs to a depth of field image in the depth of field image theme, and the shape of the original image is square, and the side length of the original image is the same as the longest side of the display screen. The depth of field image theme is an image theme in an electronic device. For example, when the size of the display screen is 2156*2344, or when the size of the display screen is 2344*2156, the side length of the original image is 2344, that is, referring to Figure (a) in Figure 15, the size of the original image E can be 2344*2344.
[0255] As an example, if the user sets the image through the gallery application, the original image is an image in the electronic device's gallery (e.g., an image with depth of field capability). In this case, the size of the original image may be the same as or different from the size of the display. For example, if the display size is 2156*2344, the size of the original image is also 2156*2344. Alternatively, if the display size is 2156*2344, the size of the original image is 2156*2048, 2018*2344, 2506*2456, or 2018*2048, etc.
[0256] Step 1402: Determine a first image and a second image based on the size of the display screen and the original image.
[0257] Typically, the length of the display screen of an electronic device in the horizontal direction is different from the width of the display screen in the vertical direction. Therefore, when the display state of the electronic device changes, the size of the lock screen image will change. Therefore, the electronic device needs to determine the lock screen image displayed when it is in the portrait display state and the lock screen image displayed when it is in the landscape display state. In an embodiment of the present application, the lock screen image displayed when the electronic device is in the portrait display state can be referred to as the first image, and the lock screen image displayed when the electronic device is in the landscape display state can be referred to as the second image. Alternatively, the lock screen image displayed when the electronic device is in the portrait display state is referred to as the first image, and the lock screen image displayed when the electronic device is in the landscape display state is referred to as the second image. In an embodiment of the present application, the lock screen image displayed when the electronic device is in the portrait display state is referred to as the first image, and the lock screen image displayed when the electronic device is in the landscape display state is referred to as the second image. In addition, the first image and the second image are both determined based on the same image. When the original image is an image with depth of field capability, the first image and the second image are both images with depth of field capability. The horizontal length of the second image may be different from the horizontal length of the first image, and the vertical width of the second image may also be different from the vertical width of the first image.
[0258] It can be seen from Figures 4 and 5 above that the depth of field image can be set as the lock screen image in different ways. When the setting method is different, the size of the original image is also different. When the size of the original image is different, the electronic device determines the operations of the first image and the second image based on the size of the display screen and the original image.
[0259] Next, taking an original image belonging to a depth of field image theme as an example, the operation of the electronic device determining the first image and the second image based on the size of the display screen and the original image is described.
[0260] In some embodiments, the horizontal length of the display screen of the electronic device is smaller than the vertical width of the display screen. In this case, when the display screen is in the first screen display state, the original image is centered and obtained to obtain a first image; according to the size of the display screen, the coordinate information of the first cropping area of the original image is determined, the first cropping area is aligned with the top of the original image, and the size of the first cropping area is the same as the size of the display screen when it is in the second screen display state; the original image is cropped according to the coordinate information of the first cropping area to obtain a second image.
[0261] It should be noted that the first screen display state and the second screen display state are the corresponding display states of the display screen before and after rotation, respectively, and the first screen display state may refer to the display screen of the electronic device being in a portrait display state, and the second screen display state may refer to the display screen of the electronic device being in a landscape display state, or, the first screen display state may refer to the display screen of the electronic device being in a landscape display state, and the second screen display state may refer to the display screen of the electronic device being in a portrait display state. The embodiment of the present application does not impose specific restrictions on this, and in the embodiment of the present application, the first screen display state is a portrait display state, and the second screen display state is a landscape display state as an example for explanation.
[0262] Since the original image is an image in the depth of field image theme (depth of field image), the original image is square and its side length is the same as the longest side of the display screen. Therefore, to adapt to the size of the display screen, the electronic device can perform a centered crop on the original image. Furthermore, since the horizontal length of the display screen is less than the vertical width of the display screen, the electronic device can perform a centered crop on the original image in the horizontal direction based on the horizontal length of the display screen.
[0263] For example, referring to Figure 15 (a), the size of the display screen S is 2156*2344, that is, the length of the display screen S in the horizontal direction is 2156, and the width of the display screen S in the vertical direction is 2344. Then, referring to Figure 15 (a), the size of the original image E can be 2344*2344. The electronic device crops the original image E in the center, that is, referring to Figure 15 (b), retains a length of 2156 in the center of the original image E in the horizontal direction, and removes redundant images on the left and right sides to obtain the first image M shown in Figure 15 (c).
[0264] Regardless of whether the display screen is in the first screen display state or the second screen display state, the distance between the system clock indicator and the top edge of the display screen in the vertical direction will not change. Therefore, in order to avoid changes in the relative position between the highest point of the main image and the system clock indicator, the electronic device needs to use other cropping methods to crop the original image to obtain the second image.
[0265] Since the original image is a square image, and the first image is obtained by centered cropping in the horizontal direction of the original image, the distance between the main image in the first image and the top edge of the first image has not changed relative to the original image. Therefore, the electronic device needs to ensure that the distance between the main image of the second image and the top edge of the second image in the vertical direction has not changed relative to the first image. That is, the electronic device needs to ensure that the distance between the main image of the second image and the top edge of the second image in the vertical direction has not changed relative to the original image. In order to achieve this purpose, the electronic device can determine the coordinate information of the first cropping area of the original image according to the size of the display screen. The first cropping area is aligned with the top of the original image, and the size of the first cropping area is the same as the size of the display screen when it is in the second screen display state.
[0266] As an example, the operation of an electronic device determining the coordinate information of the first cropping area of the original image based on the size of the display screen includes: determining the upper left corner coordinate of the original image as the upper left corner coordinate of the first cropping area, and determining the upper right corner coordinate of the original image as the upper right corner coordinate of the first cropping area; determining the lower left corner coordinate of the first cropping area based on the upper left corner coordinate of the original image and the vertical width of the display screen when it is in the second screen display state; determining the lower right corner coordinate of the first cropping area based on the upper right corner coordinate of the original image and the vertical width of the display screen when it is in the second screen display state.
[0267] For example, when the display screen S is in the second screen display state, that is, when the display screen S is in the horizontal screen display state, the size of the display screen S is: the width of the display screen S in the vertical direction is 2156, and the length in the horizontal direction is 2344; when the size of the original image E is 2344*2344, referring to Figure (d) in Figure 15, a rectangular coordinate system is established with the upper left corner of the original image E as the origin O of the rectangular coordinate system, the straight line where the upper border of the original image E is located as the x-axis, and the horizontal right direction is the positive direction of the x-axis, the straight line where the left border of the original image E is located as the y-axis, and the vertical downward direction is the positive direction of the y-axis. Then, the first cropping area can be the area with bold lines in the accompanying figure, and the coordinates of the four corners of the first cropping area are (0, 0), (2344, 0), (0, 2156), and (2344, 2156), respectively. The original image is cropped according to the coordinates of the four corners of the first cropping area to obtain the second image N shown in Figure (e) in Figure 15.
[0268] It is worth noting that by aligning the first cropped area with the top of the original image and making the size of the first cropped area the same as the size of the display screen when it is in the second screen display state, it is ensured that the relative position between the highest point of the main image in the lock screen interface and the system time indicator in the lock screen interface does not change when the display screen is in different display states, thereby improving the display effect of the depth of field image.
[0269] In some embodiments, when the display screen is in the first screen display state, if the length of the display screen in the horizontal direction is greater than the width of the display screen in the vertical direction, the coordinate information of the second cropping area of the original image is determined according to the size of the display screen, and the second cropping area is aligned with the top of the original image, and the size of the second cropping area is the same as the size of the display screen when it is in the first screen display state; the original image is cropped according to the coordinate information of the second cropping area to obtain a first image; according to the size of the display screen, the original image is cropped in a centered cropping manner to obtain a second image, and the size of the second image is the same as the size of the display screen when it is in the second screen display state.
[0270] Because when the display screen is in the first screen display state, if the length of the display screen in the horizontal direction is greater than the width of the display screen in the vertical direction, then continuing to determine the first image and the second image in the above manner will cause the relative position between the highest point of the main image in the lock screen interface and the system time indicator in the lock screen interface to change when the display state of the display screen changes. Therefore, when the display screen is in the first screen display state and the length of the display screen in the horizontal direction is greater than the width of the display screen in the vertical direction, the electronic device needs to use other methods to determine the first image and the second image respectively.
[0271] For example, referring to Figure 16 (a), the size of the display screen S1 is 2344*2156, that is, when the display screen S1 is in the first screen display state, the length of the display screen S1 in the horizontal direction is 2344, and the width of the display screen S1 in the vertical direction is 2156. The size of the original image E1 can be 2344*2344; referring to Figure 16 (b), when cropping the original image E1, the electronic device uses the upper left corner of the original image E1 as the origin O of the rectangular coordinate system, the straight line where the upper border of the original image E1 is located as the x-axis, and the horizontal right direction is the positive direction of the x-axis, the straight line where the left border of the original image E1 is located as the y-axis, and the vertical downward direction is the positive direction of the y-axis to establish a rectangular coordinate system. Then the second cropping area can be the area with bold lines in the accompanying figure, and the coordinates of the four corners of the second cropping area are (0, 0), (2344, 0), (0, 2156) and (2344, 2156) respectively. The original image is cropped according to the coordinates of the four corners of the first cropping region, resulting in the first image M1 shown in Figure 16(c). Next, the original image E1 is cropped in the center, as shown in Figure 16(d). A length of 2156 is retained in the horizontal center of the original image E1, and the redundant images on the left and right sides are removed, resulting in the second image N1 shown in Figure 16(e).
[0272] It should be noted that the way in which the electronic device determines the coordinate information of the second cropping area of the original image based on the size of the display screen can refer to the way in which the electronic device determines the coordinate information of the first cropping area of the original image based on the size of the display screen, and the embodiments of the present application will not go into details about this.
[0273] It is worth noting that different cropping methods are used when the display screen has different sizes, which improves the flexibility of cropping images and makes cropping more targeted. At the same time, the relative position between the highest point of the main image in the lock screen interface and the system time indicator in the lock screen interface does not change when the display screen is in different display states, thereby improving the display effect of the depth of field image.
[0274] Since the display screen is square, if the original image belongs to a depth of field image in the depth of field image theme, then the size of the original image is the size of the display screen, and in this case, no matter how the display state of the display screen is switched, the relative position between the highest point of the main image in the lock screen image and the system time indicator in the lock screen interface will not change. Therefore, the electronic device can directly determine the original image as the first image and the second image.
[0275] Next, taking an original image as an image with depth of field capability in a gallery of an electronic device as an example, a method for the electronic device to determine the first image and the second image based on the size of the display screen and the original image is described.
[0276] In one possible embodiment, when the shape of the display screen is not square, a first image corresponding to the original image is determined based on the size of the display screen, and the size of the first image is the same as the size of the display screen when it is in the first screen display state; the long side of the display screen is divided by the short side of the display screen to obtain a magnification factor of the first image; the magnification factor is multiplied by the first distance to obtain a second distance between the highest point of the main image in the enlarged first image and the top edge of the enlarged first image in the vertical direction, and the first distance is the distance between the highest point of the main image in the first image and the top edge of the first image in the vertical direction; the enlarged first image is cropped based on the first distance, the size of the display screen, and the second distance to obtain a second image, and the size of the second image is the same as the size of the display screen when it is in the second screen display state.
[0277] When the display screen is not in a square shape, the first screen display state and the second screen display state of the display screen are different. Therefore, the electronic device needs to determine the first image and the second image in different ways.
[0278] From the above, it can be seen that the original image is an image with depth of field capability in the gallery of the electronic device, and the size of the original image may be the same as the size of the display screen, or may be different from the size of the display screen. Among them, when the size of the original image is the same as the size of the display screen when it is in the first screen display state, the original image can be determined as the first image. When the size of the original image is different from the size of the display screen when it is in the first screen display state, the first image corresponding to the original image can be determined according to the size of the display screen in accordance with the method of displaying the lock screen image in the related art. Exemplarily, when the length of the original image in the horizontal direction is greater than the length of the display screen in the horizontal direction when it is in the first screen display state, and the width of the original image in the vertical direction is greater than the width of the display screen in the vertical direction when it is in the first screen display state, the electronic device can center-crop the original image according to the size of the display screen when it is in the first screen display state to obtain the first image. Alternatively, when the horizontal length of the original image is smaller than the horizontal length when the display screen is in the first screen display state, and / or when the vertical width of the original image is smaller than the vertical width when the display screen is in the first screen display state, the electronic device may enlarge the original image and then perform a center crop on the enlarged original image to obtain the first image. In this case, the size of the enlarged original image is larger than the size when the display screen is in the first screen display state.
[0279] In order to ensure that the relative position between the highest point of the main image in the lock screen interface and the system time indicator in the lock screen interface does not change when the display state of the display screen changes, the electronic device can determine the second image based on the first image. Since the display screen is not square, after the display state of the display screen changes, the size of the first image does not match the size of the display screen after the display state changes. Therefore, the electronic device can enlarge the first image and then crop the enlarged first image. The magnification factor of the first image is the ratio between the long side of the display screen and the short side of the display screen. That is, the electronic device can divide the long side of the display screen by the short side of the display screen to obtain the magnification factor of the first image.
[0280] For example, referring to FIG. 17 (a), when the display screen S is in the first screen display state, the size of the display screen S is 2156*2344, the size of the first image G is also 2156*2344, and the magnification factor of the first image G is 2344 / 2156. According to this magnification factor, the electronic device magnifies the first image G to obtain the magnified first image I shown in FIG. 16 (b).
[0281] After the first image G is enlarged, the distance between the highest point of the target in the enlarged first image I and the top edge of the enlarged first image I in the vertical direction changes compared to before the enlargement. Therefore, in order to ensure that the relative position between the highest point of the main image in the second image and the system time indicator in the lock screen interface does not change, the electronic device can crop the enlarged first image I according to the first distance H1, the size of the display screen, and the second distance H2.
[0282] It is worth noting that by cropping the enlarged first image by the first distance and the second distance, it can be ensured that when the cropped second image is displayed on the display screen in the second screen display state, the relative position between the highest point of the main image in the second image and the system time indicator in the lock screen interface does not change, thereby improving the display effect of the depth of field image.
[0283] In some embodiments, the electronic device crops the enlarged first image according to the first distance, the size of the display screen, and the second distance to obtain the second image, and the operation includes: subtracting the second distance from the first distance to obtain a first difference; determining the coordinate information of a third cropping area in the enlarged first image according to the first difference and the size of the display screen, the size of the third cropping area being the same as the size of the display screen when it is in the second screen display state; and cropping the enlarged first image according to the coordinate information of the third cropping area to obtain the second image.
[0284] Since the second distance is the magnified distance, the first distance can be subtracted from the second distance to obtain a first difference. For example, referring to FIG17(a) and FIG17(b), H1 is the first distance, H2 is the second distance, and the first difference is H2-H1.
[0285] As an example, the operation of the electronic device determining the coordinate information of the third cropping area in the enlarged first image based on the first difference and the size of the display screen includes: subtracting the first difference from the vertical coordinate of the upper left corner of the enlarged first image to obtain the vertical coordinate of the upper left corner of the third cropping area, and the horizontal coordinate of the upper left corner of the third cropping area is the horizontal coordinate of the upper left corner of the enlarged first image; subtracting the first difference from the vertical coordinate of the upper right corner of the enlarged first image to obtain the vertical coordinate of the upper right corner of the third cropping area, and the horizontal coordinate of the upper right corner of the third cropping area is the horizontal coordinate of the upper right corner of the enlarged first image; determining the lower left corner coordinate of the third cropping area based on the upper left corner coordinate of the third cropping area and the vertical width of the display screen when it is in the second screen display state; determining the lower right corner coordinate of the third cropping area based on the upper right corner coordinate of the third cropping area and the vertical width of the display screen when it is in the second screen display state.
[0286] Exemplarily, when cropping the enlarged first image I, it is necessary to use the size of the display screen S when it is in the second screen display state, that is, it is necessary to use the size of the display screen S when it is in the horizontal screen display state. When the display screen is in the horizontal screen display state, the size of the display screen S is: the vertical width of the display screen is 2156, and the horizontal length is 2344, referring to Figure (b) in Figure 17. The upper left corner of the enlarged first image I is the origin O of the rectangular coordinate system, the straight line where the upper border of the enlarged first image I is located is the x-axis, and the horizontal right direction is the positive direction of the x-axis, the straight line where the left border of the enlarged depth of field image I is located is the y-axis, and the vertical downward direction is the positive direction of the y-axis. A rectangular coordinate system is established, then the third cropping area can be the area with bold lines in the accompanying figure, and the coordinates of the four corners of the third cropping area are (0, H2-H1), (2344, H2-H1), (0, H2-H1+2156) and (2344, H2-H1+2156) respectively. The enlarged first image I is cropped according to the coordinates of the four corners of the third cropping area to obtain a second image N2 as shown in FIG. 17 ( c ).
[0287] In some embodiments, the electronic device may not only image the enlarged first image in accordance with the first distance, the size of the display screen, and the second distance in the manner described above, but may also include other manners. For example, the first difference may be the width of the area to be cropped in the enlarged first image. In order to ensure that the distance between the highest point of the main image in the second image and the top edge of the second image in the vertical direction is the first distance, the electronic device may start from the top edge of the enlarged first image in the vertical direction and crop the image area of the first difference width from top to bottom. Then, the image area of the cropped first image with a vertical width of the target width is retained, and the remaining image area is cropped to obtain the second image, where the target width is the vertical width of the display screen when the second screen display state is in.
[0288] It is worth noting that by determining the coordinate information of the third cropping area through the first difference, the electronic device can crop the enlarged first image more accurately, that is, the size of the obtained second image is more accurate, ensuring that the relative position between the highest point of the main image in the second image and the system time indicator in the lock screen interface does not change, thereby improving the display effect of the depth of field image.
[0289] In another possible implementation, when the shape of the display screen is not square, a first image corresponding to the original image is determined based on the size of the display screen, and the size of the first image is the same as the size of the display screen when it is in the first screen display state; the short side of the display screen is divided by the long side of the display screen to obtain a reduction factor of the first image; the reduction factor is multiplied by the first distance to obtain a third distance between the highest point of the main image in the reduced first image and the top edge of the reduced first image in the vertical direction, and the first distance is the distance between the highest point of the main image in the first image and the top edge of the first image in the vertical direction; the first image is cropped based on the reduction factor, the third distance, the size of the display screen, and the first distance to obtain a second image, and the size of the second image when enlarged when displayed is the same as the size of the display screen when it is in the second screen display state.
[0290] It should be noted that the operation of the electronic device to determine the first image corresponding to the original image according to the size of the display screen can refer to the method described above, and the embodiments of the present application will not elaborate on this one by one.
[0291] Since the size of the image does not match the size of the display screen, in order to avoid incomplete display of the display screen, when displaying the image, the image can be enlarged and displayed. Based on this principle, when the size of the first image does not match the size of the display screen when it is in the second screen display state, the first image can be cropped to obtain a second image. When the second image is displayed on the display screen (the display screen is in the second screen display state), the second image will be enlarged and displayed, and the size of the enlarged second image is exactly the same as the size of the display screen when it is in the second screen display state.
[0292] Because the second image needs to be magnified when displayed, the electronic device can crop the first image based on the reduction factor. As an example, the electronic device crops the first image based on the reduction factor, the third distance, the size of the display screen, and the first distance to obtain the second image, including: subtracting the third distance from the first distance to obtain a second difference; multiplying the vertical width of the display screen when in the second screen display state by the reduction factor to obtain a reduced width; determining the coordinate information of a fourth cropping area in the first image based on the second difference and the reduced width, where the size of the fourth cropping area after magnification is the same as the size of the display screen when in the second screen display state; and cropping the first image based on the coordinate information of the fourth cropping area to obtain the second image.
[0293] It should be noted that the operation of the electronic device determining the coordinate information of the fourth cropping area based on the second difference and the reduced width can refer to the operation of the above-mentioned electronic device determining the coordinate information of the third cropping area in the enlarged first image based on the first difference and the size of the display screen. The embodiments of the present application will not go into details about this.
[0294] It is worth noting that the first image is cropped according to the reduction ratio of the first image. There is no need to enlarge the first image during the cropping process, which reduces the running steps and improves the cropping efficiency.
[0295] In yet another possible implementation, when the display screen is square, a first image corresponding to the original image is determined according to the size of the display screen; and the first image is determined as the second image.
[0296] Since the shape of the display screen is square, no matter how the display state of the display screen is switched, the lock screen image displayed by the display screen is the same, that is, the relative position between the highest point of the main image in the lock screen image and the system time indicator in the lock screen interface will not change. Therefore, the electronic device can directly determine the first image as the second image.
[0297] It should be noted that the operation of the electronic device to determine the first image corresponding to the original image according to the size of the display screen can refer to the method described above, and the embodiments of the present application will not elaborate on this one by one.
[0298] Step 1403: Store the first image as a lock screen image corresponding to the first screen display state, and store the second image as a lock screen image corresponding to the second screen display state.
[0299] It is worth noting that by storing the first image and the second image, when the first image or the second image is needed later, the required depth of field image can be quickly acquired, thereby improving image display efficiency.
[0300] In some embodiments, the operations of steps 1402 and 1403 above may be performed while the System UI is performing some initialization processing on the display of the lock screen image, as shown in FIG18 below. Of course, after the electronic device enters the desktop from the lock screen interface, in order to save storage space, the electronic device may delete the stored first image and second image. In order to be able to display the corresponding depth of field image according to the display state of the display screen when the lock screen interface is displayed next time, the electronic device may also perform the operations of steps 1402-1403 above when the screen is off.
[0301] As an example of the present application, an electronic device can set not only the depth of field image as the lock screen image, but also other static images as the lock screen image. For example, in response to the second setting operation, the electronic device sets the third image as the lock screen image; in response to the screen light operation, the electronic device displays a third lock screen interface, which includes the third image and the system time indicator displayed on top of the third image. That is, when the third image is displayed on the lock screen interface, there is no image that would obscure the system time indicator.
[0302] Step 1404: In response to the screen-lighting operation, the electronic device displays the first lock screen interface.
[0303] It should be noted that the first lock screen interface includes: a first image, a system time indicator displayed above the first image, and a main image that partially obscures the system time indicator; that is, when the first image is a depth-of-field image, the first lock screen interface includes a background image of the first image, a system time indicator displayed above the background image, and a main image that partially obscures the system time indicator. For example, this scenario is shown in Figure 3 (a) above.
[0304] From the above, it can be seen that the first image is the lock screen image corresponding to the first screen display state. Therefore, when the lock screen image of the electronic device is set to a depth of field image and the display screen is in the first screen display state, in response to the screen light operation, the electronic device can obtain the first image and display the first image and the main image in the first lock screen interface.
[0305] As an example, the main image may be the foreground image in the first image. Of course, in some examples, the main image may also be other images. The embodiment of the present application is described by taking the main image as the foreground image of the first image as an example.
[0306] It should be noted that the operation of the electronic device displaying the first lock screen interface in response to the screen light operation can refer to the operations of steps 1814 to 1821 below.
[0307] Step 1405: In response to the rotation operation of the electronic device, the electronic device displays a second lock screen interface.
[0308] It should be noted that the second lock screen interface includes: a second image, a system time indicator displayed on the second image, and a main image that partially obscures the system time indicator; wherein, the first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface.
[0309] Since a user may change the display state of the display screen during use of an electronic device, for example, rotating the display screen from a portrait display state to a landscape display state, in this case, the electronic device may receive a rotation operation, that is, the rotation operation is an operation to switch the display state of the display screen. In response to the rotation operation, the electronic device may switch the display screen from a first screen display state to a second screen display state, that is, rotate from a first lock screen interface to a second lock screen interface, or in other words, rotate from a portrait screen interface to a landscape screen interface, and display the second image in the landscape screen interface.
[0310] As an example, the first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface, which means that the fourth distance from the highest point of the main image to the top edge of the system time indicator in the first lock screen interface is the same as the fifth distance from the highest point of the main image to the top edge of the system time indicator in the second lock screen interface.
[0311] As an example, in response to a rotation operation on the electronic device, the operation of the electronic device displaying the second lock screen interface may include: replacing the first image with the second image; and rotating the second image.
[0312] It should also be noted that the process of the electronic device displaying the second image can refer to the operations of the following steps 1822 to 1825, and this embodiment of the application will not be described in detail.
[0313] In an embodiment of the present application, after the electronic device is rotated, the electronic device can switch from the first screen display state to the second screen display state, and the lock screen image in the lock screen interface is updated from the first image to the second image, and the relative position between the highest point of the main image in the updated lock screen interface and the system time indicator in the lock screen interface does not change. Because the relative position between the highest point of the main image in the lock screen interface and the system clock indicator in the lock screen interface does not change before and after the electronic device's display screen is rotated, the depth of field image display effect is guaranteed and the aesthetics of the depth of field image display is improved.
[0314] Based on the above embodiments, the method for displaying a lock screen image provided by an embodiment of the present application is introduced below. Here, the lock screen image currently used by the electronic device is a depth of field lock screen image as an example for explanation. Referring to Figure 18, Figure 18 is a flow chart of a method for displaying a lock screen image according to an exemplary embodiment. As an example and not a limitation, the method can be executed by an electronic device, and Figure 18 is illustrated by taking the interaction of multiple modules in an electronic device as an example. The method may include some or all of the following contents:
[0315] Step 1801: After receiving the user's lock screen wallpaper setting operation, the target application notifies the wallpaper management service module of the wallpaper change event.
[0316] Step 1802: After monitoring the notification of the wallpaper change event, the wallpaper management service module sends a wallpaper change broadcast message to the broadcast message processing module.
[0317] As an example of the present application, the wallpaper change broadcast message carries first indication information, and the first indication information is used to indicate whether the currently set lock screen image is a theme lock screen image or a custom lock screen image.
[0318] It should be noted that the operation of the wallpaper management service module sending the wallpaper change broadcast message to the broadcast message processing module can refer to the operation of Figure 8 or step 901 above, and this embodiment of the application will not be described in detail.
[0319] Step 1803: When the broadcast message processing module monitors the wallpaper change broadcast message, it records the type of the currently set lock screen image in the lightweight database.
[0320] It should be noted that the operation of the broadcast message processing module monitoring the wallpaper change broadcast message can refer to the operation of the above step 901, and the operation of the broadcast message processing module recording the type of the currently set lock screen image in the lightweight database can refer to the operations of the above steps 902-905 and 907-911. The embodiment of the present application will not go into details about this.
[0321] Step 1804: When the currently set lock screen image is a depth of field lock screen image, the broadcast message processing module sends a data addition message to the lock screen image processing module.
[0322] It should be noted that the data adding message is used to instruct the lock screen image processing module to add the detailed information of the currently set lock screen image to the magazine lock screen data list.
[0323] Step 1805: The lock screen image processing module adds the detailed information of the currently set lock screen image to the magazine lock screen data list in response to the data adding message.
[0324] It should be noted that, when the currently set lock screen image is a custom depth of field lock screen image, the operation of the lock screen image processing module adding the detailed information of the currently set lock screen image to the magazine lock screen data list can refer to the operation of the above step 906. When the currently set scene lock screen image is a theme depth of field lock screen image, the operation of the lock screen image processing module adding the currently set lock screen image to the magazine lock screen data list can refer to the operation of the above step 912, and this embodiment of the application will not be described in detail one by one.
[0325] Step 1806: The lock screen image processing module sends a first cropping notification to the tool class integration module through the background view adapter, and sends a second cropping notification to the tool class integration module through the foreground view adapter.
[0326] Step 1807: The tool integration module crops the currently set lock screen image to obtain a first image corresponding to the portrait display state and a second image corresponding to the landscape display state.
[0327] It should be noted that the tool integration module can crop the currently set lock screen image original image when receiving the first crop notification and the second crop notification. The tool integration module can also crop the background image of the original image to obtain the background image of the first image and the background image of the second image when receiving the first crop notification but not receiving the second crop notification. Alternatively, when receiving the second crop notification but not receiving the first crop notification, the tool integration module can crop the foreground image of the original image to obtain the foreground image of the first image and the foreground image of the second image.
[0328] As an example, the tool integration module may obtain the background image and the foreground image of the original image from a preset directory, and crop the background image and the foreground image of the original image respectively.
[0329] As an example of the present application, the specific implementation of the tool class integration module obtaining the background image of the original image based on the index information may include: determining the type of the original image based on the index information, the type of the original image including the theme depth of field lock screen image or the custom depth of field lock screen image, such as determining whether the index information is a value that is three when divided by four, or whether it is a value that is zero when divided by four. If the original image is a theme depth of field lock screen image, that is, the index information is a value that is three when divided by four, then the background image is obtained from the copied directory (i.e., data / user_de / 0 / com.android.systemui / files). If the original image is a custom depth of field image, that is, the index information is a value that is zero when divided by four, then the background image is obtained from the lock screen directory (i.e., data / themes / 0 / wallpaper).
[0330] In one example, when the target depth-of-field lock screen image is a custom depth-of-field lock screen image, since its background image is stored in the custom wallpaper frame, the lock screen image drawing module can also obtain the background image from the custom wallpaper frame.
[0331] It should be noted that the operation of cropping the original image by the tool integration module, that is, determining the corresponding lock screen image when the display screen is in the portrait display state, and the corresponding lock screen image when the display screen is in the landscape display state can refer to the operations of the above steps 1402 and 1403, and the embodiments of the present application will not go into details about this.
[0332] In some embodiments, when the tool integration module receives the first cropping notification and / or the second cropping notification, if the magazine lock screen function is turned on, the tool integration module can not only crop the original image of the currently set lock screen image, but also crop the previous magazine lock screen image and the next magazine lock screen image.
[0333] Step 1808: The tool integration module caches the first image and the second image, and sends the background image of the first image to the background view adapter, and sends the foreground image of the first image to the foreground view adapter.
[0334] It should be noted that the background image and the foreground image of the first image carry a vertical screen indicator, and the background image and the foreground image of the second image carry a horizontal screen indicator.
[0335] As an example, when the tool integration module crops the previous magazine lock screen image and the next magazine lock screen image, it can also cache the cropped magazine lock screen images and send the cropped images corresponding to the vertical screen state to the background view adapter.
[0336] Step 1809: The background view adapter updates the background image of the first image and the detailed information of the background image to the view in the background view page component.
[0337] When the background view adapter also receives the previous magazine lock screen image and the cropped image of the next magazine lock screen image corresponding to the first image, not only can the background image of the first image and the detailed information of the background image be updated to the view in the background view page component, but also the foreground images of its previous magazine lock screen image and its next magazine lock screen image can be updated to the background view page component.
[0338] Step 1810: The foreground view adapter updates the foreground image of the first image to the view in the foreground view page component.
[0339] It should be noted that the operation of the background view adapter updating the background image of the first image and the detailed information of the background image to the view in the background view page component can refer to the operation of updating the view in the background view page component in the above step 913, and the operation of the foreground view adapter updating the foreground image of the first image to the view in the foreground view page component can refer to the operation of updating the view in the background view page component recorded in the operation of the above step 913. The embodiment of the present application will not go into details on this.
[0340] Step 1811: The screen on / off driver receives the screen off operation.
[0341] In one example, when the electronic device is in a screen-on state, when the screen-on / off driver detects a user triggering operation on a switch button of the electronic device, it is determined that a screen-off operation is received.
[0342] Step 1812: The screen on / off driver sends a screen off notification to the power management service module.
[0343] That is, after the screen-on / off driver detects the screen-off operation, it notifies the power management service module to perform screen-off control.
[0344] Step 1813: The power management service module controls the screen to enter the off state.
[0345] Step 1814: The screen light-on / off driver receives the screen light-off operation.
[0346] After the electronic device enters the screen-off state, when the user triggers the electronic device to turn on the screen, the screen-on / off driver receives the screen-on operation. For example, when the screen-on / off driver detects the user triggering the switch button of the electronic device, it determines that the screen-on operation is received.
[0347] Step 1815: The screen on / off driver sends a screen on notification to the power management service module.
[0348] That is, after the screen-on / off driver detects the screen-off operation, it notifies the power management service module to perform screen-on control.
[0349] Step 1816: The power management service module sends a screen light notification to the lock screen image drawing module through the window management service module.
[0350] In one example, as shown in FIG18 , the power management service module sends a screen-lighting notification to the window management service module, and then the window management service module sends a screen-lighting notification to the lock screen image drawing module.
[0351] Step 1817: The lock screen image drawing module sends an image rendering instruction to the background view adapter and sends an image rendering instruction to the foreground view adapter. The image rendering instruction is used to instruct to render the image data of the first image into the corresponding view page component.
[0352] Step 1818: After rendering the background image of the first image into the background view page component, the background view adapter sends a rendering completion notification to the lock screen image drawing module.
[0353] In one possible scenario, the background view adapter has completed rendering when it receives the image rendering instruction. In this case, the background view adapter sends a rendering completion notification to the lock screen image drawing module to notify the lock screen image drawing module of the completion of the rendering operation. In another possible scenario, the background view adapter has not completed rendering when it receives the image rendering instruction. In this case, the background view adapter continues to perform the rendering operation and sends a rendering completion notification to the lock screen image drawing module after the rendering is completed.
[0354] Step 1819: After rendering the foreground image of the first image into the foreground view page component, the foreground view adapter sends a rendering completion notification to the lock screen image drawing module.
[0355] Similarly, in one possible scenario, the foreground view adapter has completed rendering when it receives the image rendering instruction. In this case, the foreground view adapter sends a rendering completion notification to the lock screen image drawing module to notify the lock screen image drawing module of the completion of the rendering operation. In another possible scenario, the foreground view adapter has not completed rendering when it receives the image rendering instruction. In this case, the foreground view adapter continues to perform the rendering operation and sends a rendering completion notification to the lock screen image drawing module after the rendering is completed.
[0356] Step 1820: After receiving the rendering completion notifications respectively sent by the foreground view adapter and the background view adapter, the lock screen image drawing module sends a screen light instruction to the power management service module through the window management service module.
[0357] The lock screen image drawing module sends a screen light instruction to the window management service module, and the window management service module forwards the screen light instruction to the power management service module. The screen light instruction is used to indicate that the drawing of the lock screen image to be displayed has been completed.
[0358] Step 1821: The power management service module controls the screen to light up, and displays the background image of the first image in the lock screen interface through the background view page component, and displays the foreground image of the first image in the lock screen interface through the foreground view page component.
[0359] Since the background image of the first image has been rendered into the background view page component and the foreground image of the first image has been rendered into the foreground view page component, the background image and foreground image of the first image can be displayed in the lock screen interface after the power management service module turns on the screen.
[0360] Step 1822: When the display screen is in the bright screen state and the view auxiliary module detects that the display screen switches from the portrait display state to the landscape display state, the view auxiliary module changes the configuration information of the display screen from the portrait configuration information to the landscape configuration information.
[0361] As an example, the screen configuration change processing performed by the view auxiliary module includes executing the screen configuration change and loading the updated screen configuration. The view auxiliary module can perform the screen configuration change by executing the change function and load the updated screen configuration by loading the function. For example, the execution change function can be performConfigurationChange and the loading function can be UpdateConfiguration.
[0362] Step 1823: The view auxiliary module sends a configuration change notification to the background view adapter and the foreground view adapter, and the configuration change notification carries a horizontal screen identifier.
[0363] As an example, the view auxiliary module may send a configuration change message via a delivery function, which may be dispatchConfigurationChanged.
[0364] As an example, the view auxiliary module can send the configuration change notification to the view container (ViewGroup) through the transfer function, and then the view container continues to send the configuration change notification to the first magazine switching module (MagazineSwitchViewPagerNoAnimation) and the second magazine switching module (MagazineSwitchViewPagerForeground) respectively through the transfer function; the first magazine switching module can send the configuration change notification to the background view adapter, and the second magazine switching module can send the configuration change notification to the foreground view adapter.
[0365] Step 1824: Upon receiving the configuration change message, the background view adapter replaces the background image of the first image in the background view component with the background image of the second image.
[0366] Step 1825: Upon receiving the configuration change message, the foreground view adapter replaces the foreground image of the first image in the foreground view component with the foreground image of the second image.
[0367] It should be noted that the operation of the background view adapter updating the currently displayed background image and the operation of the foreground view adapter updating the currently displayed foreground image can also refer to the operation of displaying the first image recorded in step 1404, and the embodiment of the present application will not go into details about this.
[0368] In some embodiments, when the magazine lock screen function is turned on, the background view adapter may also update the previous magazine lock screen image and the next magazine lock screen image adjacent to the first image upon receiving a configuration change message.
[0369] In an embodiment of the present application, after the electronic device is rotated, the electronic device can switch from the first screen display state to the second screen display state, and the lock screen image in the lock screen interface is updated from the first image to the second image, and the relative position between the highest point of the main image in the updated lock screen interface and the system time indicator in the lock screen interface does not change. Because the relative position between the highest point of the main image in the lock screen interface and the system clock indicator in the lock screen interface does not change before and after the electronic device's display screen is rotated, the depth of field image display effect is guaranteed and the aesthetics of the depth of field image display is improved.
[0370] Next, the electronic device involved in the embodiments of the present application is described.
[0371] The method provided in the embodiments of the present application can be performed by an electronic device that supports a screen rotation function. By way of example and not limitation, the electronic device may include, but is not limited to, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a netbook computer, an augmented reality (AR) or virtual reality (VR) device, a foldable phone, etc., and the embodiments of the present application are not limited thereto.
[0372] FIG19 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Referring to FIG19 , the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna T1, an antenna T2, 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 jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 can 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.
[0373] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0374] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0375] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0376] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0377] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0378] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0379] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0380] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0381] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. Accelerometer 180E can also be used to identify the posture of electronic device 100, enabling applications such as switching between landscape and portrait modes and pedometers.
[0382] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor 180K can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.
[0383] 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 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 can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0384] The above are optional embodiments provided for this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope disclosed in this application should be included in the scope of protection of this application.
Claims
1. A method for displaying a lock screen image, characterized in that: Applied to electronic equipment, the method comprises: In response to the screen-lighting operation, the electronic device displays a first lock screen interface, where the first lock screen interface includes: a first image, a system time indicator displayed on the first image, and a main image that partially blocks the system time indicator; In response to the rotation operation of the electronic device, the electronic device displays a second lock screen interface, where the second lock screen interface includes: a second image, the system time indicator displayed on the second image, and the main image that partially blocks the system time indicator; Among them, the first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface.
2. The method according to claim 1, characterized in that In response to the screen lighting operation, before the electronic device displays the first lock screen interface, the method further includes: In response to a first setting operation, setting the original image selected by the first setting operation as a lock screen image; Determining the first image and the second image based on the size of the electronic device display screen and the original image; The first image is stored as a lock screen image corresponding to a first screen display state, and the second image is stored as a lock screen image corresponding to a second screen display state, wherein the first screen display state and the second screen display state are respectively corresponding display states of the display screen before and after rotation.
3. The method according to claim 2, characterized in that The length of the display screen in the horizontal direction is smaller than the width of the display screen in the vertical direction, the original image is an image in a depth of field image theme, the shape of the original image is a square, and the side length of the original image is the same as the longest side of the display screen, and the depth of field image theme is an image theme in the electronic device; The determining the first image and the second image based on the size of the electronic device display screen and the original image includes: When the display screen is in the first screen display state, center-cropping the original image to obtain the first image; Determine coordinate information of a first cropping area of the original image according to the size of the display screen, wherein the first cropping area is aligned with a top of the original image, and a size of the first cropping area is the same as a size of the display screen when the display screen is in the second screen display state; The original image is cropped according to the coordinate information of the first cropping area to obtain the second image.
4. The method according to claim 2, characterized in that The length of the display screen in the horizontal direction is greater than the width of the display screen in the vertical direction, the original image is an image in a depth of field image theme, the shape of the original image is a square, and the side length of the original image is the same as the longest side of the display screen, and the depth of field image theme is an image theme in the electronic device; The determining the first image and the second image based on the size of the electronic device display screen and the original image includes: When the display screen is in the first screen display state, the coordinate information of the second cropping area of the original image is determined according to the size of the display screen, and the second cropping area is aligned with the top of the original image. The second cropping area is aligned, and the size of the second cropping area is the same as the size of the display screen when it is in the first screen display state; Cropping the original image according to the coordinate information of the second cropping area to obtain the first image; According to the size of the display screen, the original image is cropped in a center cropping manner to obtain the second image, and the size of the second image is the same as the size of the display screen when it is in the second screen display state.
5. The method according to claim 2, characterized in that The shape of the display screen is not a square, and the original image is an image in a gallery of the electronic device; The determining the first image and the second image based on the size of the electronic device display screen and the original image includes: Determining, according to the size of the display screen, a first image corresponding to the original image, wherein the size of the first image is the same as the size of the display screen when the display screen is in the first screen display state; Dividing the long side of the display screen by the short side of the display screen to obtain a magnification factor of the first image; Multiplying the magnification by the first distance to obtain a second distance between the highest point of the main image in the enlarged first image and the top edge of the enlarged first image in the vertical direction, wherein the first distance is the distance between the highest point of the main image in the first image and the top edge of the first image in the vertical direction; The enlarged first image is cropped according to the first distance, the size of the display screen and the second distance to obtain the second image, wherein the size of the second image is the same as the size of the display screen when it is in the second screen display state.
6. The method according to claim 5, characterized in that The step of cropping the enlarged first image according to the first distance, the size of the display screen, and the second distance to obtain the second image includes: subtracting the second distance from the first distance to obtain a first difference; determining coordinate information of a third cropping area in the enlarged first image according to the first difference and the size of the display screen, wherein the size of the third cropping area is the same as the size of the display screen when the display screen is in the second screen display state; The enlarged first image is cropped according to the coordinate information of the third cropping area to obtain the second image.
7. The method according to claim 2, characterized in that The shape of the display screen is not a square, and the original image is an image in a gallery of the electronic device; The determining the first image and the second image based on the size of the electronic device display screen and the original image includes: Determining, according to the size of the display screen, a first image corresponding to the original image, wherein the size of the first image is the same as the size of the display screen when the display screen is in the first screen display state; Dividing the short side of the display screen by the long side of the display screen to obtain a reduction factor of the first image; Multiplying the reduction factor by the first distance to obtain a third distance between the highest point of the main image in the reduced first image and the top edge of the reduced first image in the vertical direction, wherein the first distance is the distance between the highest point of the main image in the first image and the top edge of the first image in the vertical direction; The first image is cropped according to the reduction factor, the third distance, the size of the display screen, and the first distance to obtain the second image, and the size of the second image when displayed is enlarged to the same size as the display screen. The size of the screen is the same as when it is in the second screen display state.
8. The method according to claim 2, characterized in that The display screen is in a square shape, and the original image is an image in a gallery of the electronic device; The determining the first image and the second image based on the size of the electronic device display screen and the original image includes: Determining a first image corresponding to the original image according to the size of the display screen; The first image is determined as the second image.
9. The method according to claim 1, characterized in that In response to the rotation operation on the electronic device, the electronic device displays a second lock screen interface, including: In response to a rotation operation on the electronic device, replacing the first image with the second image; The second image is rotated.
10. The method according to claim 1, characterized in that The first position of the main image relative to the system time indicator in the first lock screen interface is the same as the second position of the main image relative to the system time indicator in the second lock screen interface, which means that the fourth distance from the highest point of the main image to the top edge of the system time indicator in the first lock screen interface is the same as the fifth distance from the highest point of the main image to the top edge of the system time indicator in the second lock screen interface.
11. The method according to claim 1, characterized in that The method further comprises: In response to the second setting operation, setting the third image as the lock screen image; In response to the screen light operation, a third lock screen interface is displayed, wherein the third lock screen interface includes the third image and the system time indicator displayed on an upper layer of the third image.
12. An electronic device, characterized in that: The structure of the electronic device includes a processor and a memory; The memory is used to store a program that supports the electronic device to execute the method according to any one of claims 1-11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method for realizing 3D display effect by 2D wallpaper and system thereof
CN108932145A
Image processing method and device and mobile terminal
CN109151206A
Generating user interfaces combining foreground and background of an image with user interface elements
US20180246635A1