EP-4421629-B1 - FOLDABLE ELECTRONIC DEVICE, AND DISPLAY METHOD FOR FOLDABLE SCREEN
Inventors
- LIU, Mengdi
- ZHANG, JING
Dates
- Publication Date
- 20260506
- Application Date
- 20230714
Claims (15)
- A display method for a foldable screen, wherein the method comprises: obtaining, by an electronic device (100), a first height and a first width that are of an interface element on a first interface and that are set in an unfolded state, wherein the first height and the first width are determined based on a height and a width of the interface element in a folded state of the electronic device (100); characterized in that said method comprises the following steps: determining, by the electronic device, whether a ratio of the first height to a screen height is greater than a first threshold; if the ratio is greater than the first threshold, adjusting the height of the interface element to a second height, wherein a ratio of the second height to the screen height is not greater than the first threshold; obtaining, by the electronic device (100), a second width based on the second height; and displaying, by the electronic device (100), the first interface in the unfolded state, wherein the displayed first interface comprises the interface element having the second height and the second width.
- The method according to claim 1, wherein a ratio of the first width to the first height is equal to a ratio of the second width to the second height, or a difference between a ratio of the first width to the first height and a ratio of the second width to the second height is less than a first difference.
- The method according to claim 2, wherein a control layout type of the first interface is a content grid type, a quantity of images accommodated in one row of the displayed first interface is greater than or equal to a quantity of images accommodated in one row of the set first interface, and a quantity of images accommodated in one column of the displayed first interface is greater than or equal to a quantity of images accommodated in one column of the displayed first interface.
- The method according to claim 3, wherein the interface element on the first interface comprises a picture or a card, and an arrangement manner of the picture or the card is a grid type.
- The method according to claim 4, wherein a width of the picture or the card on the set first interface is greater than a width of the picture or the card displayed when the electronic device is in the folded state.
- The method according to claim 2, wherein a control layout type of the first interface is a large image type, and the large image type means that the set first interface comprises one photo, and a width of the photo is equal to a screen width, or a difference between a width of the photo and a screen width is less than the first difference; and the width of the photo on the set first interface is less than a width of the photo on the displayed first interface, and content of the photo that is accommodated by the displayed first interface in vertical space is greater than content of the photo that is accommodated by the set first interface in the vertical space.
- The method according to claim 2, wherein a width of a photo on the set first interface is greater than a width of the photo displayed when the electronic device is in the folded state.
- The method according to claim 2, wherein a control layout type of the first interface is a social list type, and the social list type means that at least one social feed is displayed on the set first interface.
- The method according to claim 8, wherein a structure of the social feed is that an upper part of the social feed is a text, and a lower part is a photo; or an upper part of the social feed is a photo, and a lower part is a text.
- The method according to claim 9, wherein when the social feed comprises only one photo, a width of the photo on the displayed first interface is less than a width of the photo on the set first interface, and content of the photo that is accommodated by the displayed first interface in vertical space is greater than content of the photo that is accommodated by the set first interface in the vertical space.
- The method according to claim 9, wherein when the social feed comprises a plurality of photos, a quantity of photos accommodated in one row of the displayed first interface is greater than a quantity of photos accommodated in one row of the set first interface, and a quantity of photos accommodated in one column of the displayed first interface is greater than a quantity of photos accommodated in one column of the set first interface.
- The method according to claim 9, wherein a width of the photo on the set first interface is greater than a width of the photo displayed when the electronic device is in the folded state.
- The method according to claim 2, wherein a control layout type of the first interface is a text list type, and the text list type means that a text is displayed on the set first interface, and a text font of the displayed first interface is smaller than a text font of the set first interface.
- An electronic device (100), wherein the electronic device (100) comprises a memory (121) and one or more processors (110), the memory is configured to store a computer program, and the processor is configured to invoke the computer program, so that the electronic device (100) performs the method according to any one of claims 1 to 13.
- A computer-readable storage medium, comprising instructions, wherein when the instructions are run on an electronic device (100), the electronic device is enabled to perform the method according to any one of claims 1 to 13.
Description
This application claims priority to Chinese Patent Application No. 202210886321.0, filed with the China National Intellectual Property Administration on July 26, 2022 and entitled "FOLDABLE ELECTRONIC DEVICE AND DISPLAY METHOD FOR FOLDABLE SCREEN". TECHNICAL FIELD Embodiments of this application relate to the field of terminal technologies, and in particular, to a foldable electronic device and a display method for a foldable screen. BACKGROUND A foldable screen of an electronic device can meet a large screen requirement of a user in an unfolded state, and can also reduce a size in a folded state to meet a portable requirement. Therefore, the foldable screen is widely used. However, when a form of the foldable screen of the electronic device changes (for example, switching from the unfolded state to the folded state or switching from the folded state to the unfolded state), how to better implement adaptive display of screen content of the electronic device is a problem that a person skilled in the art has been studying. EP 3 958 117 A1 discloses a method for user interface layout in foldable or varying screen states. It describes detecting the device posture (landscape/portrait or single/large screen) and adjusting the user interface dimensions accordingly, and covers the concept of adapting interface elements to avoid blank areas upon transitions. SUMMARY This application provides a foldable electronic device and a display method for a foldable screen, to avoid a phenomenon of a large font and a large image, and effectively reduce a phenomenon that a page information amount in an unfolded state of the electronic device is less than that in a folded state. This provides good user experience. According to a first aspect, this application provides a display method for a foldable screen. The method includes: An electronic device may obtain a first height and a first width that are of an interface element on a first interface and that are set in an unfolded state, where the first height and the first width are determined based on a height and a width of the interface element in a folded state of the electronic device. The electronic device determines whether a ratio of the first height to a screen height is greater than a first threshold. If the ratio is greater than the first threshold, the height of the interface element is adjusted to a second height, where a ratio of the second height to the screen height is not greater than the first threshold. The electronic device obtains a second width based on the second height. The electronic device displays the first interface in the unfolded state, where the displayed first interface includes the interface element having the second height and the second width. It can be learned from the foregoing method that the electronic device may obtain, through calculation based on user experience, a threshold of a ratio of a height to the screen height, and design that the ratio of the second height of the interface element to the screen height is less than the threshold. In this way, a phenomenon that a large image and a large font size appear on the electronic device in the unfolded state can be effectively reduced, a use habit of the user can be complied with, and user experience is improved. In addition, a phenomenon that a content information amount in the unfolded state of the electronic device is less can be further reduced, to further improve user experience. In the foregoing method, the second height of the interface element may alternatively be designed adaptively, and a developer does not need to manually design a size and a layout of the interface element in the unfolded state in an application development stage, and this reduces workload of the developer. With reference to the first aspect, in some implementations, a ratio of the first width to the first height is equal to a ratio of the second width to the second height, or a difference between a ratio of the first width to the first height and a ratio of the second width to the second height is less than a first difference. In this way, the electronic device can ensure that an aspect ratio of the displayed interface element remains unchanged, and is more aesthetic. With reference to the first aspect, in some implementations, a control layout type of the first interface is a content grid type, a quantity of images accommodated in one row of the displayed first interface is greater than or equal to a quantity of images accommodated in one row of the set first interface, and a quantity of images accommodated in one column of the displayed first interface is greater than or equal to a quantity of images accommodated in one column of the displayed first interface. With reference to the first aspect, in some implementations, the interface element on the first interface includes a picture or a card, and an arrangement manner of the picture or the card is a grid type. With reference to the first aspect, in some implemen