Screen locking image display method, electronic equipment and readable storage medium
通过在锁屏界面中保持主体图像相对于系统时间指示器的位置一致,解决了屏幕旋转后景深图像显示效果不佳的问题,实现了锁屏图像的美观性提升。
Patent Information
- Application Number
- CN202310972715.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
After the screen rotates, the depth of field image display is not effective.
Provide a method for displaying a lock screen image, by keeping the position of the main image in the first lock screen interface and the second lock screen interface consistent with the system time indicator, ensuring that the display effect of the lock screen image remains unchanged after the screen rotates. .
By keeping the relative position of the subject image consistent with the system time indicator, the problem of poor display of depth of field image after screen rotation is solved, and the display aesthetics of lock screen images are improved.
Smart Images

Figure CN119440356A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] The lock screen image is an image displayed in the lock screen interface. For example, when the electronic device is set with a lock screen password, the lock screen image is displayed in the lock screen interface when the electronic device turns off the screen and then turns on the screen again. With the rapid development of terminal technology, the display methods of the lock screen images of electronic devices are becoming more and more diverse, for example, including but not limited to static lock screen images, dynamic lock screen images, magazine lock screen images, etc. Summary of the invention
[0003] The present 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 effect after the screen rotates in the related art. The technical solution is as follows:
[0004] 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:
[0005] 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;
[0006] 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;
[0007] 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.
[0008] 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.
[0009] 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 comprises:
[0010] In response to a first setting operation, setting the original image selected by the first setting operation as a lock screen image;
[0011] Determining the first image and the second image based on the size of the electronic device display screen and the original image;
[0012] 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.
[0013] 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.
[0014] As an example of the present application, 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;
[0015] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0016] When the display screen is in the first screen display state, center-cropping the original image to obtain the first image;
[0017] 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;
[0018] The original image is cropped according to the coordinate information of the first cropping area to obtain the second image.
[0019] 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.
[0020] As an example of the present application, 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;
[0021] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0022] 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 the size of the display screen, the second cropping area is aligned with a top of the original image, and the size of the second cropping area is the same as the size of the display screen when the display screen is in the first screen display state;
[0023] Cropping the original image according to the coordinate information of the second cropping area to obtain the first image;
[0024] 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.
[0025] 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.
[0026] 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;
[0027] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0028] 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;
[0029] 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;
[0030] 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;
[0031] 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.
[0032] 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.
[0033] 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:
[0034] subtracting the second distance from the first distance to obtain a first difference;
[0035] 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;
[0036] The enlarged first image is cropped according to the coordinate information of the third cropping area to obtain the second image.
[0037] 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.
[0038] 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;
[0039] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0040] 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;
[0041] 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;
[0042] 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;
[0043] 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 enlarged size of the second image when displayed is the same as the size of the display screen when it is in the second screen display state.
[0044] In this way, the first image is cropped according to the reduction factor of the first image, and there is no need to enlarge the first image during the cropping process, which reduces the running steps and improves the cropping efficiency.
[0045] 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;
[0046] The determining the first image and the second image based on the size of the electronic device display screen and the original image includes:
[0047] Determining a first image corresponding to the original image according to the size of the display screen;
[0048] The first image is determined as the second image.
[0049] In this way, when the shape of the display screen is a square, the first image is directly determined as the second image without the need for cropping again, thereby improving the efficiency of determining the depth of field image.
[0050] As an example of the present application, in response to the rotation operation of the electronic device, the electronic device displays a second lock screen interface, including:
[0051] In response to a rotation operation on the electronic device, replacing the first image with the second image;
[0052] The second image is rotated.
[0053] 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.
[0054] 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.
[0055] 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 be guaranteed after the display screen rotates, thereby improving the display aesthetics of the lock screen interface.
[0056] As an example of the present application, the method further includes:
[0057] In response to the second setting operation, setting the third image as the lock screen image;
[0058] 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.
[0059] In this way, by setting different images as lock screen images, the personalization of the lock screen interface is improved.
[0060] 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 method for displaying a lock screen image provided in the first aspect, and to store data involved in implementing the method for displaying a lock screen image 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.
[0061] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes the method for displaying a lock screen image described in the first aspect.
[0062] 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.
[0063] The technical effects obtained by the above-mentioned second aspect, third aspect and fourth aspect 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
[0064] Figure 1 is a schematic diagram of a depth of field lock screen image according to an exemplary embodiment;
[0065] Figure 2 is a schematic diagram showing an application scenario according to an exemplary embodiment;
[0066] Figure 3 is a schematic diagram of another application scenario according to an exemplary embodiment;
[0067] Figure 4 is a schematic diagram of another application scenario according to an exemplary embodiment;
[0068] Figure 5 is a schematic diagram of another application scenario according to an exemplary embodiment;
[0069] Figure 6 is a schematic diagram of another application scenario according to an exemplary embodiment;
[0070] Figure 7 is a schematic diagram of a software architecture of an electronic device according to an exemplary embodiment;
[0071] Figure 8 is a schematic diagram of a framework for displaying a lock screen image according to an exemplary embodiment;
[0072] Fig. 9 is a schematic diagram of a display initialization process for a lock screen image according to an exemplary embodiment;
[0073] Fig.10 is a schematic diagram of a process of adding a customized depth of field lock screen image to a magazine lock screen list according to an exemplary embodiment;
[0074] Fig.11 is a schematic diagram of a process of adding a theme depth of field lock screen image to a magazine lock screen list according to an exemplary embodiment;
[0075] Fig.12 is a schematic diagram of a background image update process according to an exemplary embodiment;
[0076] Fig.13 is a schematic diagram of a foreground image update process according to an exemplary embodiment;
[0077] Fig.14 is a schematic flow chart of a method for displaying a lock screen image according to an exemplary embodiment;
[0078] Fig.15 is a schematic diagram showing a process of cropping to obtain a second image according to an exemplary embodiment;
[0079] Fig.16 is a schematic diagram showing another process of cropping to obtain a second image according to an exemplary embodiment;
[0080] Fig.17 is a schematic diagram showing another process of cropping to obtain a second image according to an exemplary embodiment;
[0081] Fig.18 is a schematic flow chart of another method for displaying a lock screen image according to an exemplary embodiment;
[0082] Fig.19 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0083] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0084] 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 only 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, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.
[0085] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0086] Before introducing in detail the method for displaying a lock screen image provided in an embodiment of the present application, a brief introduction to the custom vocabulary and terms involved in the embodiment of the present application is first given.
[0087] 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.
[0088] Lock screen image: 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.
[0089] Depth of field lock screen image: refers to an image with depth of field capability (referred to as depth of field image) 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 in the lock screen interface, the foreground image is displayed above the level of the system time indicator and partially blocks the system time indicator. For example, see Figure 1 , Figure 1 is a schematic diagram of a depth-of-field lock screen image according to an exemplary embodiment, wherein part of the time information is partially blocked by a foreground image (ie, main image A).
[0090] Theme: refers to the interface style presented by the 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 referred to as the theme depth of field lock screen image.
[0091] Customized lock screen image: usually refers to an image in the gallery application that is used as the lock screen image. Customized lock screen images usually include customized normal lock screen images and customized depth of field lock screen images. Among them, the customized depth of field lock screen image refers to an image with depth of field capability selected by the user from the gallery application as the lock screen image; the customized normal lock screen image usually refers to an image without depth of field capability, that is, the customized normal lock screen image refers to an ordinary image selected by the user from the gallery application as the lock screen image.
[0092] 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 in the lock screen interface, and when the user slides left or right in the lock screen interface, in response to the user's sliding operation, the electronic device can display the next or previous magazine lock screen image in the lock screen interface. These magazine lock screen images can come from one or more of the local preset resources, cloud resources, or resources manually added by the user.
[0093] In one application scenario, when a user is using an electronic device, if the electronic device supports the horizontal and 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 display mode, or may turn on the screen when the electronic device is in landscape display mode. If the lock screen image of the electronic device is a depth of field image, then when the electronic device switches between horizontal and vertical screens, the relative position between the highest point position of the main image in the depth of field image and the system time indicator changes, resulting in poor display effect of the depth of field image and affecting the depth of field effect. Exemplarily, when the electronic device is in portrait display mode, the depth of field image corresponding to the portrait display mode is image B, and the display effect of image B in the lock screen interface is as follows: Figure 2As shown in Figure (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 display screen when the electronic device sets the lock screen image, image B may be obtained by centering the original image, that is, the center of the original image is taken 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 the lock screen image is set. However, the horizontal length and vertical width of the display screen of the 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 corresponding lock screen image when the electronic device is in the horizontal screen display state. The display effect of image C in the lock screen interface is as shown in FIG. Figure 2 As shown in Figure (b), 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.
[0094] In order to improve the depth of field image display effect, an embodiment of the present application provides a lock screen image display method, in which a first image is displayed in a first lock screen interface in response to a screen light operation, and after the electronic device is rotated, the electronic device displays a second image in a second lock screen interface after rotation, and the main image in both the first image and the second image blocks 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 guaranteed and the aesthetics of the depth of field image display is improved.
[0095] To facilitate understanding, the following uses an example in which the electronic device is a mobile phone with a foldable screen to introduce the application scenarios involved in the embodiments of the present application.
[0096] Please refer to Figure 3 , Figure 3is a schematic diagram of an application scenario according to an exemplary embodiment. In a possible scenario, when a user needs to use a mobile phone, if the user performs a screen-lighting operation on the mobile phone when the mobile phone is in a vertical display state, the mobile phone responds to the screen-lighting operation and displays the following Figure 3 The lock screen interface shown in Figure (a) in FIG. 1 shows a depth image B, which includes a foreground image, namely, a main image A. The main image A is located on the upper layer of the system time indicator and partially covers the system time indicator. The highest point of the main 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 not the same. In this case, the user may rotate the mobile phone. In response to the operation of rotating the mobile phone, see Figure 3 In Figure (b), the display screen switches from the vertical screen display state to the horizontal screen display state, and the lock screen image in the lock screen interface is updated from the depth image B to the depth image D. The depth image D includes the main image A, and the size of the depth image D is different from the size of the depth image B. The highest point of the main 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 the depth image B to the depth image C, and after the image is switched, the relative position between the highest point of the main image A in the depth image and the system time indicator is the same, thereby ensuring the depth image display effect and improving the aesthetics of the depth image display.
[0097] Next, we will introduce the scenario of setting the depth of field image as the lock screen image. Please refer to Figure 4 , Figure 4 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 the theme application. Figure 4 In Figure (a), the user can click on the application identifier of the setting application; the mobile phone responds to the click operation on the application identifier of the setting application by displaying the following Figure 4 In the setting interface C1 shown in FIG. (b), 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 following Figure 4 In the wallpaper setting interface C2 shown in FIG. (c) of FIG. 1 , the wallpaper setting interface C2 displays the type of lock screen image options, for example, the "wallpaper" option (this option is usually an option for a static lock screen image), the "theme" option, the "magazine lock screen" option, etc., and the user can click the "theme" option. In response to the click operation on the "theme" option, the mobile phone displays the following Figure 4The theme selection interface C3 shown in FIG. (d) in FIG. 1 displays lock screen images corresponding to different themes. For example, dynamic images named “Wandering (dynamic)”, “Forest (dynamic)” and “Stars (dynamic)” corresponding to the dynamic image theme, 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 the following: Figure 4 In the preset theme interface C4 shown in FIG. (e) of FIG. 1 , 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 FIG. Figure 4 As shown in Figure (f). Figure 4 In Figure (f), after the phone turns on the screen, 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, namely, a main image A. The main image A is on the upper layer of the system time indicator and partially covers the system time indicator.
[0098] 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 a lock screen image.
[0099] Please refer to Figure 5 , Figure 5 is a schematic diagram of another application scenario according to an exemplary embodiment. In another application scenario, the depth of field image in the lock screen image may also be a user-defined image, see Figure 5 In Figure (a), the user can click on the application logo of the gallery application; the mobile phone responds to the click operation on the application logo of the gallery application by displaying the following Figure 5 The gallery preview interface C5 shown in FIG. (b) in FIG. 1 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, the following is displayed: Figure 5 In the editing window C6 shown in FIG. (c), the editing window C6 displays a "Set as wallpaper" option; the user can click the "Set as wallpaper" option, and in response to the click operation on the "Set as wallpaper" option, the mobile phone can store the selected image H as a lock screen image. Later, when the mobile phone displays the lock screen interface, if the image H is an image with depth of field capability, the lock screen interface of the mobile phone can be as follows: Figure 5 As shown in Figure (d). Figure 5 In Figure (d), after the phone screen is turned on, the lock screen interface displays the custom depth of field lock screen image that is set. The custom depth of field lock screen image includes a foreground image, namely, a 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 case, the mobile phone can follow the above Figure 5 In the manner shown, when image H is an image with depth of field capability, it is automatically displayed in the lock screen interface in the form of depth of field effect. Of course, the user can also select the display effect of image H during the process of setting the lock screen image. Figure 6 In the case of the editing window C6 shown in FIG. (a), the user clicks the "Set as wallpaper" option; in response to the click operation on the "Set as wallpaper" option, when the image H is an image with depth of field capability, the mobile phone displays the following Figure 6 The display effect selection window C7 shown in FIG. (b) of FIG. 10 can be used to select an image H from the display effect selection window C7 as the display effect when the lock screen image is displayed. If the user clicks the "depth of field effect display" option, then in response to the click operation on the "depth of field effect display" option, the mobile phone can store the selected image H as the lock screen image. Afterwards, when the mobile phone displays the lock screen interface, the lock screen interface of the mobile phone can be as follows: Figure 6 As shown in Figure (c).
[0101] In another possible scenario, see Figure 6 In (d) of FIG. 1 , if the user clicks the "static effect display" option, then in response to the click operation on the "depth of field effect display" option, the mobile phone can store the selected image H as the lock screen image. Afterwards, when the mobile phone displays the lock screen interface, the lock screen interface of the mobile phone can be as follows: Figure 6 As shown in Figure (e), in the lock screen interface, image H is displayed below the system time indicator, that is, image H does not block the system time indicator.
[0102] In another possible scenario, when the mobile phone is storing the image H as the lock screen image, the second prompt information may be displayed, where the second prompt information is used to prompt the user that the selected image has been set as the lock screen image.
[0103] It should be noted that, in the embodiments of the present application, only the above Figure 3-Figure 6 The application scenario shown is used as an example for illustration and does not constitute a limitation on the embodiments of the present application.
[0104] Next, the software system architecture of the electronic device is explained.
[0105] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device.
[0106] Figure 7 is a block diagram of a software system of an electronic device provided in an embodiment of the present application. Figure 7 The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system layer, and the kernel layer.
[0107] The application layer can include a series of application packages. Figure 7 As shown, the application layer may include system applications (System UI), theme applications, gallery applications, and other applications.
[0108] 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, and the desktop and status bar displayed after unlocking. 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 one example, please refer to Figure 7 The System UI includes multiple functional modules, including but 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).
[0109] The broadcast message processing module is used to listen to the wallpaper change broadcast message 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.
[0110] 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 setting application that comes with the system or an installed third-party application.
[0111] The gallery application is used to store images, for example, images can be taken or from the cloud. As an example of the present 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, and 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.
[0112] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0113] As an example of the present application, the application framework layer includes a wallpaper management service module, which is used to send a wallpaper change broadcast message to the System UI when it monitors the notification of the wallpaper change event of the theme application or the gallery application, so that the System UI performs wallpaper change processing. In one example, the wallpaper management service module is named WallpaperManagerService.
[0114] Please refer to Figure 7The 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 related modules. The window management service module is responsible for the management of the lock screen interface, such as displaying a lock screen image in the lock screen interface. In an example, the power management service module is named PowerManagerService, and the window management service module is named WindowManagerService.
[0115] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0116] 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 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, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0117] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0118] Next, the display method of the lock screen image provided in the embodiment of the present application is introduced.
[0119] Please refer to Figure 8 , Figure 8 is a schematic diagram of a framework for displaying a lock screen image according to an exemplary embodiment. In implementation, Figure 4 As shown, users can set a lock screen image from the Themes app, or as Figure 5As shown, the user can also set the lock screen image from the gallery application. As an example of the present application, no matter which method the user uses to set the lock screen image, when 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 separately. At most one background image and one foreground image are stored in the lock screen directory, that is, in 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.
[0120] 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, triggers 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, wherein the compressed package may 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.
[0121] In another example, when the user sets the lock screen image from a 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.
[0122] 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 may be generated by the electronic device when it is idle, or may be generated by the electronic device when it is charging. Exemplarily, in the charging state, the electronic device can traverse the depth of field images in the gallery application, and each 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 directly save the foreground image and background image of any pre-stored depth of field image to the lock screen directory.
[0123] It should also be noted that the above description is based on the example that the lock screen image set by the user is a depth of field image. In another example, if the lock screen image set by the user is not a depth of field image, the images stored in the lock screen directory only include a background image, which is the set lock screen image itself, that is, in this case, there is no foreground image in the lock screen directory.
[0124] Please continue to refer to Figure 8 After receiving the user's lock screen wallpaper setting operation, the theme application or gallery application notifies the wallpaper management service module of the wallpaper change event. After the wallpaper management service module listens to the notification, it sends a wallpaper change broadcast message to the System UI so that the System UI can perform some initialization processing on the display of the lock screen image. For details, please refer to Fig. 9 The initialization processing operations of System UI can include the following:
[0125] Step 901: Receive a wallpaper change broadcast message.
[0126] In one possible case, the wallpaper change broadcast message is sent to the System UI after the wallpaper management service module monitors the wallpaper change event notification sent by the theme application. For example, see Figure 4 After the user sets a theme depth of field lock screen image in the theme application, the theme application notifies the wallpaper management service module of a wallpaper change event, after which the wallpaper management service module sends a wallpaper change broadcast message to the System UI.
[0127] In another possible case, the wallpaper change broadcast message is sent to the System UI after the wallpaper management service module monitors the wallpaper change event notification sent by the gallery application. 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 a wallpaper change event. After that, the wallpaper management service module sends a wallpaper change broadcast message to the System UI.
[0128] 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.
[0129] Optionally, the wallpaper change broadcast message may also carry event description information, and the event description information is used to indicate the application object of the wallpaper change, and the application object includes a user interface or a lock screen interface, that is, the event description information is used to indicate whether the desktop image is changed or the lock screen image is changed. The embodiment of the present application is described by taking the example that the event description information is used to indicate that the application object of the wallpaper change is the lock screen interface.
[0130] Step 902: After receiving the wallpaper change broadcast message, determine whether the current system is restarting.
[0131] according to Figure 8 As can be seen from the previous records, after the user sets the lock screen image, the System UI will receive a wallpaper change broadcast message. In another possible case, after the electronic device is turned on and restarted, the System UI will also receive a wallpaper change broadcast message. For example, the wallpaper management service module can send a wallpaper change broadcast message to the System UI when the electronic device is turned on and restarted. For the above two situations, the System UI handles them differently. Therefore, after receiving the wallpaper change message, the System UI can first determine whether the current system is restarting.
[0132] 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, when the restart identifier is true, it is determined that the electronic device is currently displaying the desktop, so that it can be determined that the system has not been restarted; when the restart identifier is false, it is determined that the electronic device is not currently displaying the desktop, so that it can be determined that the system has been restarted.
[0133] 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.
[0134] Step 903: Determine whether the currently set lock screen image is a custom lock screen image.
[0135] 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.
[0136] If the currently set lock screen image is a custom lock screen image, proceed to the operation of 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 the operation of step 908.
[0137] Step 904: Determine whether the currently set custom lock screen image has depth of field capability.
[0138] 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, so as to determine 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.
[0139] 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 operations of step 905 to step 906 are performed. Otherwise, if the currently set custom lock screen image does not have depth of field capability, the following operation of step 907 is performed.
[0140] Step 905: Mark the lock screen image type as 0.
[0141] In one example, the System UI may mark the type of the currently set lock screen image in the lightweight database. That is, when 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 in the lightweight database as 0. Exemplarily, the System UI may indicate the type of the currently set lock screen image through the first indication information.
[0142] 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.
[0143] Step 906: Add detailed information of the customized depth of field lock screen image to the magazine lock screen data list.
[0144] 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 Figure 5 As shown in Figure (d), the text message is "Leisure time is a rainbow."
[0145] The magazine lock screen data list includes detailed information of each magazine lock screen image in multiple magazine lock screen images. As an example of the present application, regardless of whether the magazine lock screen function is turned on or not, 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, and the magazine lock screen image in the magazine lock screen resource is not displayed when the lock screen interface is slid.
[0146] As an example of this application, see 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:
[0147] A1: According to the principle of division by four with remainder zero, modify the index information of the currently set custom depth of field lock screen image.
[0148] Usually, the original index information of each lock screen image is a numerical value. Since the lock screen image type of 0 indicates a custom depth of field lock screen image, in order to facilitate subsequent identification that the currently set lock screen image is a custom depth of field lock screen image, it can be modified based on the original index information according to the principle of division by four with remainder zero.
[0149] As an example, based on the original index information of the custom depth of field lock screen image, a corresponding value that is equal to zero when divided by four can be determined by 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 equal to zero when divided by four.
[0150] (4-X1%4)+X1=Y1 (1)
[0151] It should be noted that, in the above first formula (1), X1 is the original index information of the custom depth of field lock screen image, and Y1 is the modified value of zero after division by four, which 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 zero after division by four can be determined by the above first formula (1), such as 8, and then the index information of the currently set custom depth of field lock screen image is changed from 7 to 8.
[0152] A2: The modified index information is recorded as cacheid and written into the lightweight database.
[0153] 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.
[0154] As an example of the present application, the System UI may encapsulate the detailed information into a data structure, such as BigPictureInfo. As an example and not a limitation, the System UI may also set some restrictions in BigPictureInfo, such as the restrictions may include that the custom depth of field lock screen image cannot be deleted and the lock screen automatic switching function is turned off.
[0155] A4: Add the detailed information of the currently set custom depth of field lock screen image to the magazine lock screen data list, wherein the magazine lock screen data list includes the detailed information of each of the plurality of magazine lock screen images.
[0156] The detailed information of the magazine lock screen image may include the index information, background thumbnail, image description information, etc. of the magazine lock screen image. 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 the present application, the detailed information of each magazine lock screen image corresponds to BigPictureInfo.
[0157] 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.
[0158] In one example, the System UI can also prepare a background blur map of the currently set depth of field image. The background blur map can be displayed when the user slides up the lock screen interface, that is, when the user slides up the lock screen interface, the electronic device will have a blur effect. Among them, the background blur map can be generated based on the background image. For example, when the currently set lock screen image is a depth of field image, the background image can be obtained from the lock screen directory, and the background image can be Gaussian blurred to obtain the background blur map, which can then be stored.
[0159] As an example and not limitation, 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.
[0160] 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, and the detailed information added in 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 in 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, so that the storage space where the magazine lock screen data list is located can be saved.
[0161] After adding the detailed information of the customized depth of field lock screen image to the magazine lock screen data list, the System UI enters the following step 913.
[0162] Step 907: Mark the lock screen image type as -1 and end the depth of field processing flow.
[0163] 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 in 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. After that, the System UI ends the depth of field processing flow.
[0164] Step 908: Determine whether the currently set lock screen image is a static image.
[0165] As an example but not limitation, the System UI can determine whether the currently set lock screen image is a static image based on the wallpaper change broadcast message. For example, when the theme application notifies the wallpaper management service module of a wallpaper change event, it can indicate to the wallpaper management service module whether the lock screen image set by the user is a static image. Accordingly, when the wallpaper management service module sends a wallpaper change broadcast message to the System UI, it can indicate in the wallpaper change broadcast message so that the System UI determines whether the currently set lock screen image is a static image.
[0166] If the currently set lock screen image is a static image, proceed to the operation of the following step 909. Otherwise, if the currently set lock screen image is not a static image, such as the set lock screen image is a dynamic image, the System UI ends the depth of field processing flow, as an example but not a limitation, and then can enter the dynamic image processing flow, etc., which is not limited in the embodiment of the present application.
[0167] Step 909: Determine whether the currently set lock screen image has depth of field capability.
[0168] That is, it is determined whether the currently set lock screen image is a depth of field image. In implementation, System UI can query whether there are both foreground images and background images in the lock screen directory, so as to determine whether the currently set 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 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 lock screen image currently set by the user does not have depth of field capability.
[0169] If the currently set lock screen image does not have the depth of field capability, the System UI performs the operation of step 907. Otherwise, if the currently set lock screen image has the depth of field capability, the System UI enters the operation of the following step 910.
[0170] Step 910: Determine whether the currently set lock screen image is a custom depth-of-field lock screen image.
[0171] According to the above records and combined Figure 8 It can be seen that in one possible case, the system will be executed to step 910 after restarting, and in another possible case, the system will be executed to step 910 after the user sets the lock screen image. In the first possible case, the user may have set the custom depth of field lock screen image as the lock screen image before the system of the electronic device is restarted, so in this case, there is no need to perform subsequent operations such as initialization of 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.
[0172] 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.
[0173] Step 911: Mark the currently set lock screen image type as 3.
[0174] 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.
[0175] 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 exception handling requirements, 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 power-on 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 power-on 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 power-on 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.
[0176] Step 912: Add detailed information of the theme depth of field lock screen image to the magazine lock screen data list.
[0177] 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 list.
[0178] As an example of this application, please refer to Fig.11 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:
[0179] B1: Copy the background image in the lock screen directory to another preset directory.
[0180] To prevent the background image of the theme depth of field lock screen image from being replaced by a custom lock screen image later, SystemUI may 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 may be data / user_de / 0 / com.android.systemui / files.
[0181] In a possible implementation, the replaced scene means that, 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. Afterwards, 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, which will cause the magazine lock screen data list to no longer include the detailed information of the theme depth of field lock screen image P1. However, in implementation, after setting the theme depth of field lock screen image P1, in the case of 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 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, so 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.
[0182] 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.
[0183] B2: According to the principle of dividing by four and having a remainder of three, modify the index information of the currently set theme depth of field lock screen image.
[0184] 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 the 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 division by four and remainder by three.
[0185] As an example, based on the original index information of the theme depth of field lock screen image, a corresponding value that is divisible by four and remains three can be determined by the following second formula (2), and the index information of the currently set theme depth of field lock screen image can be modified to the determined value that is divisible by four and remains three.
[0186] (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 may refer to the operation of step A3 above, and the embodiments of the present application will not describe them 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 theme 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. When the current lock screen image is set to the theme depth of field lock screen image, the background image of the theme 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 detailed information 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 where the detailed information of the custom depth of field lock screen image was located 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, and illustratively, a position can be randomly selected for insertion.
[0195] As an example but not limitation, 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 may 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 is also possible to determine 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 ends. This can improve the security of electronic devices.
[0197] Step 913: Update the view page component, where 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 filled 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 users 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 updating 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, during the update, the foreground image of each of the three lock screen images can be rendered in the foreground view page component, 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 this application, please refer to Fig.12 In step 913, the update process of the view in the background view page component may include the following operations (Bg11)-(Bg15):
[0202] (Bg11) Check whether the magazine lock screen function is enabled.
[0203] In implementation, the System UI may query the state of the magazine lock screen switch to determine whether the magazine lock screen function is enabled. When the magazine lock screen switch is enabled, it is determined that the magazine lock screen function is enabled. Otherwise, when the magazine lock screen switch is disabled, it is determined that the magazine lock screen function is disabled.
[0204] It should be noted that the state 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] When the magazine lock screen function is turned on, the System UI enters the following operation (Bg12). When the magazine lock screen function is not turned on, the process ends, that is, the following operation Bg12 is not continued.
[0206] (Bg12) Clear the background view page component.
[0207] That is, the image data of all previously rendered lock screen images in the background view page component is cleared. In addition, System UI also clears the cached information in the background view adapter to facilitate reloading the background image of 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, it can also be determined 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, after the lock screen interface is displayed, the lock screen interface will not display the magazine lock screen image when receiving a left or right sliding operation. Therefore, if 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 receiving a left or right sliding operation. Therefore, the operation of clearing the background view page component can be executed. In addition, if the lock screen interface is invisible, for example, when the welcome interface is displayed at startup and the lock screen interface is not displayed, the operation of clearing the background view page component can be temporarily not executed, but 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 is used to display the background image of a corresponding lock screen image. The number of views included in the background view page component can be set according to requirements. For example, the background view page component includes views Figure 1 ,See Figure 2 ,See Figure 3 ,See Figure 4 And Vision Figure 5 , you can get the video during the update process Figure 1 ,See Figure 2 And Vision Figure 3 .
[0211] (Bg14) Obtain detailed information of the currently set lock screen image and the adjacent magazine lock screen images from the magazine lock screen data list.
[0212] According to the previous records, the currently set lock screen image may be a custom depth of field lock screen image or a theme 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 its previous lock screen image, and the detailed information of its 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 image from the magazine lock screen data list through the background view adapter.
[0213] In implementation, the location of the detailed information of the currently set lock screen image can be located from the magazine lock screen data list, and the System UI obtains the detailed information of the image from the magazine lock screen data list through the background view adapter according to the located location. The previous detailed information and the next detailed information are obtained from the magazine lock screen data list to obtain the detailed information of the adjacent magazine lock screen image.
[0214] (Bg15) Based on the acquired 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 acquired 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 of the currently set lock screen image is set to the view through the background view adapter. Figure 2 and record the video Figure 2 The corresponding relationship between the view identifier and the index information of the currently set lock screen image; the background thumbnail carried in the detailed information of the previous magazine lock screen image of the currently set lock screen image is set to the view through the background view adapter Figure 1 and record the video Figure 1 The corresponding relationship between the view identifier and the index information of the previous magazine lock screen image; and setting the background thumbnail carried in the details information of the next magazine lock screen image of the currently set lock screen image to the view through the background view adapter Figure 3 and record the video Figure 3 The correspondence between the view identifier and the index information of the next magazine lock screen image.
[0216] In this way, the update of the background view page component is completed.
[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 this application, please refer to Fig.13 In step 913, the update process of the view in the foreground view page component may include the following operations (Fg21)-(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 (Fg22) operation. 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] According to the previous records, the type of the currently set lock screen image is recorded in the lightweight database, so System UI can query the type of the currently set lock screen image from the lightweight database. When the lock screen image is a custom depth of field lock screen image, the type of the obtained lock screen image is 0, and when the lock screen image is a theme 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 it is the first time the computer is turned on with a password, or the lock screen interface is not visible, the subsequent process may not be executed; otherwise, if it is the first time the computer is turned on without a password, and the lock screen interface is not visible, an operation is performed 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 case, the type of the currently set lock screen image is 0, which indicates 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 case, the type of the currently set lock screen image is 3, which indicates 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 another possible case, the type of the currently set lock screen image is neither 0 nor 3. In this 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, the process proceeds to the following operation (Fg24). Otherwise, if the currently set lock screen image is a depth of field image, the process proceeds to the following operation (Fg25).
[0228] (Fg24) Sets 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 the present 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 may 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 the 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 be 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, obtain the index information of the next magazine lock screen image of the current lock screen image.
[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 the above steps (Bg11) to (Bg15) and the operations of steps (Fg21) to (Fg210) are all optional. In another example, in order to meet the exception handling requirements, the specific implementation of the update view page component may not be limited to including these steps, and the embodiment of the present 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 detail information of the depth of field lock screen image includes a background thumbnail. In this case, after the background view adapter obtains the detail information of the depth of field lock screen image, it renders the background thumbnail included in the detail 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 also be cached at the same time. For example, the image data of five lock screen images can also be cached at the same time, which is not limited in the embodiment of the present application.
[0250] Based on the application scenarios and initialization operations provided in the above embodiments, the following describes the display method of the lock screen image provided in the embodiments of the present application. Fig.14 , Fig.14 FIG. 1 is a flowchart of a method for displaying a lock screen image according to an exemplary embodiment. As an example and not a limitation, Fig.14 Taking the method applied in an electronic device as an example for explanation, the method may include part or all of the following contents:
[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 the operation of setting the lock screen image, desktop image and other images as depth of field images. The depth of field image is an image with depth of field capability. The depth of field image includes a main image and a background image. When the depth of field image is displayed in 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 covers part of the content of the system time indicator. For example, the scene is as shown above Figure 4 or Figure 5 shown.
[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 the way of setting the depth of field image 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 the electronic device. Exemplarily, 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, see Fig.15 As shown in Figure (a), the size of the original image E can be 2344*2344.
[0255] As an example, when the user sets it through the gallery application, the original image is an image in the gallery of the electronic device (such as an image with depth of field capability). In this case, the size of the original image may be the same as the size of the display screen, or it may be different from the size of the display screen. For example, if the size of the display screen is 2156*2344, the size of the original image is also 2156*2344. Alternatively, if the size of the display screen 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] Generally, 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. Then, 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 vertical screen display state and the lock screen image displayed when it is in the horizontal screen display state. In the embodiment of the present application, the lock screen image displayed when the electronic device is in the vertical screen display state can be called the first image, and the lock screen image displayed when the electronic device is in the horizontal screen display state can be called the second image. Alternatively, the lock screen image displayed when the electronic device is in the vertical screen display state is called the first image, and the lock screen image displayed when the electronic device is in the horizontal screen display state is called the second image. In the embodiment of the present application, the lock screen image displayed when the electronic device is in the vertical screen display state is called the first image, and the lock screen image displayed when the electronic device is in the horizontal screen display state is called the second image. In addition, the first image and the second image are both determined based on the same image. In the case where 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 length of the second image in the horizontal direction may be different from the length of the first image in the horizontal direction, and the width of the second image in the vertical direction may also be different from the width of the first image in the vertical direction.
[0258] By the above Figure 4 and Figure 5 It can be seen that the depth of field image can be set as the lock screen image in different ways. When the setting methods are different, the size of the original image is also different. When the size of the original image is different, the electronic device determines the operation 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 in 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 length of the display screen of the electronic device in the horizontal direction is smaller than the width of the display screen in the vertical direction. 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 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 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 make 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. For example, description is given.
[0262] Since the original image is an image in the depth of field image theme (depth of field image), the original image is a square, and the side length is the same as the longest side of the display screen, the electronic device can perform center cropping on the original image to adapt to the size of the display screen. Since the length of the display screen in the horizontal direction is less than the width of the display screen in the vertical direction, the electronic device can perform center cropping on the original image in the horizontal direction according to the length of the display screen in the horizontal direction.
[0263] For example, see Fig.15 In Figure (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, see Fig.15 In Figure (a), the size of the original image E can be 2344*2344, and the electronic device crops the original image E in the center, that is, see Fig.15 In the figure (b), the length of 2156 is kept in the center of the original image E in the horizontal direction, and the redundant images on the left and right sides are removed to obtain the following Fig.15 The first image M is shown in Figure (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 according to 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 corner coordinate of the first cropping area according to 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 according to 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, see Fig.15 In Figure (d), 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 attached 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 following Fig.15 The second image N is shown in Figure (e).
[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, 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 when the display screen 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 center cropping manner to obtain a second image, and the size of the second image is the same as the size when the display screen 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 respectively determine the first image and the second image.
[0271] For example, see Fig.16 In the figure (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, the width of the display screen S1 in the vertical direction is 2156, and the size of the original image E1 can be 2344*2344; see Fig.16 In Figure (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 attached 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 area to obtain the following: Fig.16 The first image M1 is shown in Figure (c) of FIG. Next, the original image E1 is cropped in the center. Fig.16 In Figure (d), the 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 to obtain the following Fig.16 The second image N1 is shown in Figure (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 elaborate on this one by one.
[0273] It is worth noting that different cropping methods are used when the display screen is of 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 in the case where the display screen is square, if the original image is 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 manner, when the shape of the display screen is not a square, a first image corresponding to the original image is determined according to 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 the magnification factor of the first image; the magnification factor is multiplied by the first distance to obtain the 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 according to the first distance, the size of the display screen, and the second distance 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.
[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, and 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 it 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 the display screen 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 the display screen 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. And because the display screen is not a 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 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 of the first image.
[0280] For example, see Fig.17In (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 of the first image G is 2344 / 2156. According to the magnification, the electronic device magnifies the first image G to obtain the following Fig.16 The enlarged first image I is shown in Figure (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 relative 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 enlarged distance, the second distance can be subtracted from the first distance to obtain the first difference. Fig.17 Figure (a) and Fig.17 In Figure (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 an electronic device determining coordinate information of a third cropping area in an amplified first image based on a first difference and the size of a display screen includes: subtracting the first difference from the vertical coordinate of the upper left corner of the amplified 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 amplified first image; subtracting the first difference from the vertical coordinate of the upper right corner of the amplified 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 amplified 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 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 the second screen display state.
[0286] For example, when cropping the enlarged first image I, the size of the display screen S in the second screen display state needs to be used, that is, the size of the display screen S in the horizontal screen display state needs to be used. When the display screen is in the horizontal screen display state, the size of the display screen S is: the width of the display screen in the vertical direction is 2156, and the length in the horizontal direction is 2344. Fig.17 In Figure (b), a rectangular coordinate system is established with the upper left corner of the enlarged first image I as the origin O of the rectangular coordinate system, the straight line where the upper border of the enlarged first image I 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 enlarged depth of field image I is located as the y-axis, and the vertical downward direction is the positive direction of the y-axis. Then the third cropping area can be the area with bold lines in the attached 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). The enlarged first image I is cropped according to the coordinates of the four corners of the third cropping area to obtain the following: Fig.17 The second image N2 is shown in Figure (c).
[0287] In some embodiments, the electronic device may not only include the above-mentioned methods but also other methods according to the first distance, the size of the display screen and the second distance for the enlarged first image. 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 with the first difference width from top to bottom. Then, the image area with a width of the target width in the vertical direction of the cropped first image is retained, and the remaining image area is cropped to obtain the second image, where the target width is the width in the vertical direction when the display screen is in the second screen display state.
[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 a square, a first image corresponding to the original image is determined according to 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 according to 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 above-described method, and the embodiments of the present application will not be described in detail.
[0291] When the size of the image does not match the size of the display screen, in order to avoid incomplete display of the display screen, the image can be displayed after being enlarged. 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 the 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 in the second screen display state.
[0292] Since the second image needs to be enlarged when displayed, the electronic device can crop the first image according to the reduction factor. As an example, the electronic device crops the first image according to 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 it is in the second screen display state by the reduction factor to obtain a reduced width; determining the coordinate information of the fourth cropping area in the first image according to the second difference and the reduced width, the size of the fourth cropping area after enlargement is the same as the size of the display screen when it is in the second screen display state; and cropping the first image according to 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, and the embodiments of the present application will not elaborate on this one by one.
[0294] It is worth noting that the first image is cropped by reducing the first image by a certain factor, and there is no need to enlarge the first image during the cropping process, which reduces the number of operation steps and improves the cropping efficiency.
[0295] In yet another possible implementation, when the shape of the display screen is a 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 when 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 above-described method, and the embodiments of the present application will not be described in detail.
[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 the image display efficiency.
[0300] In some embodiments, the operations of step 1402 and step 1403 may be performed during the process of initializing the display of the lock screen image by the System UI, as shown in the following Fig.18 Of course, after the electronic device enters the desktop from the lock screen interface, in order to save storage space, the electronic device can delete the stored first image and the 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 can also perform the above steps 1402-1403 when the screen is off.
[0301] As an example of the present application, the electronic device can not only set the depth of field image as the lock screen image, but also set other static images as the lock screen image. Exemplarily, 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 third lock screen interface is displayed, and the third lock screen interface includes the third image and the system time indicator displayed on the upper layer of the third image. That is, when the third image is displayed in the lock screen interface, there is no image that will block the system time indicator.
[0302] Step 1404: In response to the screen light operation, the electronic device displays a first lock screen interface.
[0303] It should be noted that 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; 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 on the background image, and a main image that partially blocks the system time indicator. For example, the scene is as shown above. Figure 3 As shown in Figure (a).
[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 a 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 lighting operation can refer to the operations of steps 1814 to 1821 described below.
[0307] Step 1405: In response to a rotation operation on 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 the user may change the display state of the display screen when using the 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 of switching 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 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 present application will not be described in detail.
[0313] In the 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 display screen of the electronic device 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 the embodiments of the present application is described below. Here, the lock screen image currently used by the electronic device is a depth of field lock screen image as an example for description. Fig.18 , Fig.18 FIG. 1 is a flow chart of a method for displaying a lock screen image according to an exemplary embodiment. As an example but not a limitation, the method can be executed by an electronic device, and Fig.18 The interaction of multiple modules in an electronic device is used as an example to illustrate that 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 wallpaper management service module sends the wallpaper change broadcast message to the broadcast message processing module. Figure 8 Or the operation of step 901, which will not be described in detail in the embodiment of the present application.
[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, and 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 adding 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 repeated 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 vertical screen display state and a second image corresponding to the horizontal screen display state.
[0327] It should be noted that the tool integration module can crop the original image of the currently set lock screen 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 when receiving the first crop notification but not receiving the second crop notification to obtain the background image of the first image and the background image of the second image. Alternatively, when receiving the second crop notification but not receiving the first crop notification, the foreground image of the original image is cropped 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 according to the index information may include: determining the type of the original image according to the index information, the type of the original image includes a theme depth of field lock screen image or a custom depth of field lock screen image, for example, 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-mentioned steps 1402 and 1403, and the embodiments of the present application will not elaborate on this one by one.
[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 class 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 the background image of the first image and the detailed information of the background image can be updated to the view in the background view page component, but also the foreground images of the previous magazine lock screen image and the 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, and the embodiment of the present application will not describe them one by one.
[0340] Step 1811: The screen on / off driver receives the screen off operation.
[0341] In one example, when the electronic device is in the 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 and off driver receives the screen light 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 and screen-off driver receives the screen-on operation. For example, when the screen-on and screen-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 on operation, it notifies the power management service module to control the screen on.
[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, if Fig.18 As shown, the power management service module sends a screen light notification to the window management service module, and then the window management service module sends a screen light 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, where 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 case, the background view adapter has completed rendering when receiving 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 to complete the rendering operation. In another possible case, the background view adapter has not completed rendering when receiving 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: When 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 case, the foreground view adapter has completed rendering when receiving 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 to complete the rendering operation. In another possible case, the foreground view adapter has not completed rendering when receiving 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, after the power management service module turns on the screen, the background image and foreground image of the first image can be displayed in the lock screen interface.
[0360] Step 1822: When the display screen is in the on-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 the execution of the screen configuration change and the loading of 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. The configuration change notification carries a horizontal screen flag.
[0363] As an example, the view auxiliary module can send a configuration change message through a transfer function, which can 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 elaborate on this one by one.
[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 the 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 display screen of the electronic device 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 embodiment of the present application is described.
[0371] The method provided in the embodiment of the present application can be executed by an electronic device, and the electronic device supports a screen rotation function. As an example and not a limitation, the electronic device can be, but is not limited to, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a netbook, an augmented reality (AR) / virtual reality (VR) device, a foldable mobile phone, etc., and the embodiment of the present application does not limit this.
[0372] Fig.19 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.19 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 interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0373] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[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 processor (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), etc. 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] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[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] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[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 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in 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 may 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 may 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] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 180E can also be used to identify the posture of the electronic device 100, and is applied to applications such as horizontal and vertical screen switching, pedometers, etc.
[0382] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and 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 acting on or near it. The touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[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 may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).
[0384] The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present 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, determining coordinate information of a second cropping area of the original image according to the size of the display screen, 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 the display screen 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 enlarged size of the second image when displayed is the same as the size of the display screen 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
Cited By
Screen locking image display method, electronic device, and readable storage medium
EP4657227A1