A display method, an electronic device, and a storage medium

By adjusting the display position of controls on curved screen devices, the problem of control jitter in landscape display mode was solved, thus improving the user experience.

CN120891965BActive Publication Date: 2026-06-09HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-04-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

When curved screen devices are displayed in landscape mode, the jitter of controls affects the user experience, and existing display solutions are not perfect.

Method used

In both landscape and portrait display modes, the display position of controls is adjusted, taking into account the safety margin and preset distance difference of curved screens, to reduce control jitter.

Benefits of technology

It effectively reduces the jitter of controls during interface switching, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120891965B_ABST
    Figure CN120891965B_ABST
Patent Text Reader

Abstract

The application provides a display method, an electronic device and a storage medium, and relates to the technical field of terminals. The method comprises the following steps: in the case that the electronic device is in a portrait display state, in response to a first operation on a first control in a first display position, displaying the first control in a second display position, the first display position being a first distance away from a straight side of a curved screen, and the distance between the first display position and the second display position being equal to the difference between a preset distance and the first distance; in the case that the electronic device is in a landscape display state, in response to a first operation on the first control in a third display position, displaying the first control in a fourth display position, the third display position being a second distance away from a curved side of the curved screen, and the distance between the third display position and the fourth display position being equal to the difference between a preset distance and the second distance. In this way, the probability of control shaking of a picture displayed by the curved screen device can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a display method, electronic device and storage medium. Background Technology

[0002] With the development of display technology, display screen styles are becoming increasingly diverse. Curved screens, as a new type of display screen, are widely used in electronic devices. Curved screens have a certain degree of curvature. For example, curved screens exhibit a certain curvature at both edges. Compared to flat screen devices (electronic devices with flat screens), curved screen devices (electronic devices with curved screens) can display images not only on the flat area of ​​the curved screen but also on the curved area, thus providing a wider viewing area.

[0003] The display solutions for curved screens differ slightly from those for flat screens. Currently, the display solutions for curved screen devices are not yet perfect. In some cases, the screen displayed on curved screen devices may exhibit control flickering, affecting the user experience. Summary of the Invention

[0004] This application provides a display method, electronic device, and storage medium to reduce the phenomenon of control jitter in the display of curved screen devices and improve the user experience.

[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, a display method is provided, comprising: when the electronic device is in portrait display mode, in response to a first operation on a first control at a first display position, displaying the first control at a second display position; the first operation is used to trigger a switch of the display position of the first control, the first display position being a first distance from the straight edge of the curved screen, and the distance between the first display position and the second display position being equal to the difference between a preset distance and the first distance; when the electronic device is in landscape display mode, in response to a first operation on a first control at a third display position, displaying the first control at a fourth display position; the third display position being a second distance from the curved edge of the curved screen, the second distance being different from the first distance; and the distance between the third display position and the fourth display position being equal to the difference between the preset distance and the second distance.

[0007] In this method, when the electronic device moves the first control from its initial display position to its final display position in response to a first operation, the distance between the initial and final display positions is equal to the difference between a preset distance and the distance from the initial display position to the top or bottom edge of the curved screen. Thus, when the display position of the control changes, the influence of the curved screen's safety margin on the control's display position in landscape mode can be considered, reducing control jitter in landscape mode and minimizing its impact on the user experience. Furthermore, this method is applicable to both landscape and portrait display modes, making it a universal approach.

[0008] In one possible implementation of the first aspect, when the electronic device is in portrait mode, a first interface is displayed, the first interface including a first control at a first display position. In response to a first operation on the first control at the first display position, a second interface is displayed, the second interface including the first control at a second display position. In this implementation, the display position of the first control changes during the switching of application interfaces in portrait mode. Thus, when switching application interfaces, the phenomenon of control jitter in portrait mode can be reduced, minimizing the impact of control jitter on the user experience.

[0009] In another possible implementation of the first aspect, when the electronic device is in landscape mode, a third interface is displayed, the third interface including a first control at a second display position. In response to a first operation on the first control at the second display position, a fourth interface is displayed, the fourth interface including a first control at a fourth display position. The third interface and the first interface belong to the same application interface in different display states, and the fourth interface and the second interface belong to the same application interface in different display states. The display states include portrait and landscape display states. In this implementation, during the switching of application interfaces in landscape mode, the phenomenon of control jitter can be reduced, thus mitigating the impact of control jitter on the user experience.

[0010] In another possible implementation of the first aspect, a safety margin is set within the curved area of ​​the curved screen, within which the curved screen is invisible. Before displaying the third interface, the distance between the first control and the curved edge of the curved screen can be adjusted from a first distance to a second distance based on the safety margin. The first distance is less than the safety margin, for example, the first distance is equal to 0. The second distance is equal to the safety margin. In this implementation, to ensure that the content in the displayed interface is outside the safety margin, before displaying the third interface, the distance between the first control and the curved edge is adjusted if the first distance of the first control is less than the safety margin. Thus, the first control avoids the safe area within the safety margin, thereby displaying normally on the curved screen and becoming visible to the user.

[0011] In another possible implementation of the first aspect, in portrait mode, the electronic device, in response to a first operation on a first control at a first display position, calls the motion effects module to obtain a first distance between the first control at the first display position and the straight edge of the curved screen, and obtains a first end position at a preset distance from the first display position. It further calculates the difference between the first end position and the first distance to obtain a second display position, and then moves the first control from the first display position to the second display position, displaying the first control at the second display position. In landscape mode, the electronic device, in response to a first operation on a first control at a third display position, calls the motion effects module to obtain a second distance between the first control at the third display position and the curved edge of the curved screen, and obtains a second end position at a preset distance from the third display position. It calculates the difference between the distance between the second end position and the curved edge and the second distance to obtain a fourth display position, moves the first control from the third display position to the fourth display position, and displays the first control at the fourth display position.

[0012] In this implementation, the electronic device can use an animation module to change the display position of the first control dynamically (such as with a translation effect). This allows the first control to transition naturally from one display position to another during interface switching, reducing the impact of instantaneous changes in the first control's display position on the user experience.

[0013] In another possible implementation of the first aspect, the motion effects module of the electronic device obtains the distance between the first control and the top or bottom edge of the curved screen through a preset application programming interface, for example, by obtaining the first distance and / or the second distance through getLocationOnScreen(). This allows for the rapid acquisition of the distance between the first control and the top or bottom edge of the curved screen.

[0014] In another possible implementation of the first aspect, in portrait mode, after displaying the first control at the second display position, if the distance from the second display position to the straight edge is equal to the target distance, the first control remains at the second display position; if the distance from the second display position to the straight edge is inconsistent with the target distance, the first control is moved to the target display position (which may be referred to as the first target display position) at a target distance from the straight edge. In landscape mode, after displaying the first control at the fourth display position, if the distance from the fourth display position to the curved edge is equal to the target distance, the first control remains at the fourth display position; if the distance from the fourth display position to the curved edge is inconsistent with the target distance, the first control is moved to the target display position at a target distance from the curved edge.

[0015] In this implementation, to ensure the control moves to the preset target display position after the application interface switches, the electronic device further verifies the control's display position. For example, the electronic device verifies the distance from the control to the top of the screen. This allows the first control to be moved to the preset target display position.

[0016] In another possible implementation of the first aspect, the first control is a search box control. This reduces the jittering of the search box control and lessens its impact on the user experience.

[0017] Secondly, this application provides an electronic device including a curved screen, a memory, a processor, and a computer program stored in the memory. The curved screen is used to display images. When the processor runs the computer program, the electronic device performs the method described in the first aspect and any possible implementation thereof.

[0018] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by an electronic device, causes the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0019] Fourthly, this application provides a computer program product containing program instructions, including a computer program that, when run by an electronic device, enables the computer to perform the methods described in the first aspect and any possible implementation thereof. For example, the computer may be the aforementioned electronic device.

[0020] Fifthly, this application provides a chip system applied to an electronic device. The chip system includes an interface circuit and a processor. The interface circuit and the processor are interconnected via a line. The interface circuit is used to receive signals from a memory and send signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device performs the method described in the first aspect above and any possible implementation thereof. Attached Figure Description

[0021] Figure 1 A schematic diagram of an electronic device with a curved screen provided in an embodiment of this application;

[0022] Figure 2 A schematic diagram of an application interface in landscape display mode provided in an embodiment of this application;

[0023] Figure 3 A schematic diagram of an interface where a search box control jitters, provided as an embodiment of this application;

[0024] Figure 4A schematic diagram illustrating the layout of a search box control view provided in an embodiment of this application;

[0025] Figure 5 A schematic diagram illustrating the change in the display position of a search box control provided in an embodiment of this application;

[0026] Figure 6 A hardware structure block diagram of a curved screen mobile phone 100, an example of an electronic device, provided in this application embodiment;

[0027] Figure 7 A hardware and software structure block diagram of an example curved screen mobile phone 100 provided in this application embodiment;

[0028] Figure 8 A schematic diagram illustrating the display position of a control provided in an embodiment of this application;

[0029] Figure 9 A schematic diagram of vertex coordinates of a control provided in an embodiment of this application;

[0030] Figure 10 A flowchart illustrating a display method provided in an embodiment of this application;

[0031] Figure 11 This is a schematic diagram of an application interface in portrait mode, provided as an embodiment of this application. Detailed Implementation

[0032] With the development of electronic devices, the styles of electronic device displays have become increasingly diverse, with various styles such as waterdrop screens, notch screens, foldable screens, curved screens, and under-display punch-hole screens emerging. Among these, a curved screen refers to a display screen with a bend or curvature on at least one side. The edge with the bend or curvature can be called a curved edge, while the flat edge can be called a flat edge. A curved screen on an electronic device can include both curved and flat areas. The display area with the bend or curvature on a curved screen can be called a curved area. The flat display area on a curved screen can be called a flat area. Electronic devices can display images not only on the flat area of ​​a curved screen but also on the curved area, thus providing a larger display range.

[0033] For example, consider a curved screen on an electronic device where two opposite edges have a bend. Figure 1 As shown, the curved screen of the electronic device includes four edges. These four edges are labeled as edge 1, edge 2, edge 3, and edge 4 in clockwise order. The curved screen bends at edges 1 and 3. Edges 1 and 3 are curved edges, while edges 2 and 4 are flat edges. The areas of the curved screen where edges 1 and 3 bend are called curved areas. The other display areas of the curved screen besides the curved areas are flat areas.

[0034] The closer the curved area of ​​a curved screen is to its edge, the larger the angle between it and the flat area of ​​the curved screen. This results in a poor visual experience for the user. Furthermore, the curved edges of a curved screen are prone to accidental touches, which also affects the user experience. Given the negative experience of curved screens, electronic devices typically include a safety margin within the curved area. The display area within this margin is called the safety zone. The safety zone is smaller than or equal to the curved area. Within the safety zone, the electronic device does not display content or provide a touch area for functions. The safety zone is black and does not respond to user actions. The safety zone is an invisible display area. The display area outside the safety zone on a curved screen is the visible display area. The visible display area can display images. For example, such as... Figure 1 As shown, in the curved screen of the electronic device, the curved area of ​​edge 1 includes safe area 1, and the curved area of ​​edge 3 includes safe area 2. Safe area 1 and safe area 2 are located at the outermost edges of the curved areas on both sides of the curved screen.

[0035] Currently, curved screen display solutions for electronic devices are not yet perfect. In landscape mode, the controls on a curved screen can appear jittery. For example, consider a curved-screen mobile phone. Figure 2 As shown in (1), the curved-screen phone displays the search interface of the gallery application in landscape mode. A search box control and a back control are set at the top of the search interface. The search box control is used to obtain the text data entered by the user. The curved-screen phone can search for photos that match the text data entered by the user in the search box. The back control is used to trigger the curved-screen phone to return to the previous level of the search interface. The curved-screen phone receives the user's action of clicking the back control. In response to this user action, the curved-screen phone returns to the previous level of the search interface. Figure 2 As shown in (2), the parent interface of the search interface is the main interface of the gallery application. The main interface of the gallery application also includes a search box control. As the search box control moves from its display position on the search interface to its display position on the main interface, the search box control will jitter.

[0036] In the example, slow motion of the search box control jittering is as follows: Figure 3 As shown. After the application interface of the curved screen phone changed from the search interface of the gallery app to the main interface of the gallery app, the search box control in the main interface changed from... Figure 3 Position 1 shown in (1) is moved to Figure 3 At position 2 as shown in (2), then from Figure 3 Position 2 shown in (2) is moved to Figure 3Position 3 is shown in (3). Taking positions 1, 2, and 3 as the upper edge of the search box control as an example. Among them, position 2 is below positions 1 and 3. It can be seen that the search box control in the main interface first moves down from position 1 to position 2, and then moves up from position 2 to position 3. It can be seen that the search box control will appear to jitter visually, affecting the user experience.

[0037] To address the issue of some controls flickering when switching application interfaces in landscape mode, the causes of this flickering are analyzed below. We compared the application interface switching process on flat-screen and curved-screen electronic devices in the same scenario. For example, taking a mobile phone as an example, in the application interface switching scenario from the search interface of the Gallery app to the main interface of the Gallery app in landscape mode, the search box control in the main interface of the Gallery app does not flicker on a flat-screen phone. Therefore, the flickering phenomenon of the search box control only occurs on curved-screen phones.

[0038] To determine the differences in application interface switching between flat-screen and curved-screen phones, the following comparison examines the layout of the search box control in the Gallery app's search interface before its display position changes. For example, in landscape mode, the layout of the search box control in the search interface is as follows: Figure 4 As shown. The layout of the search box control provided by a flat-screen phone in the search interface is as follows. Figure 4 As shown in (1). It can be seen that in the layout of the search box control provided by the flat-screen phone, the vertical coordinate of the vertex of the search box control (such as the vertical coordinate of the top left vertex) is 0. The layout of the search box control provided by the curved-screen phone in the search interface is as follows: Figure 4 As shown in (2), it can be seen that in the layout of the search box control provided by the curved screen mobile phone, the vertical coordinate of the vertex of the search box control (such as the vertical coordinate of the top left vertex) is 24.

[0039] The y-coordinate of the search box control represents the minimum distance between the search box control and the top edge of the display screen. Comparing the layout of the search box control on flat-screen phones and curved-screen phones, on flat-screen phones, there is no distance between the search box control and the top edge of the display screen, and the y-coordinate of the search box control is 0. On curved-screen phones, there is a certain distance between the search box control and the top edge of the display screen, and the y-coordinate of the search box control is not 0. For curved-screen phones, this distance is reserved to avoid the curved screen's safe zone. Since curved-screen phones have safe zones on both sides of the curved surface where no content is displayed, if a control's display position is within a safe zone, the curved-screen phone will adjust the control's display position to move it outside the safe zone, thus avoiding the preset safe zone. Therefore, when the search box control is within the safe zone of a curved-screen phone, the curved-screen phone will adjust its display position. The vertical coordinate of the search box control changes from 0 to 24.

[0040] Please continue reading Figure 5 , Figure 5 This diagram illustrates the changes in the display position of the search box controls provided by flat-screen and curved-screen phones during application interface switching. The change in the display position of the search box control provided by the flat-screen phone is shown by the dashed box. Before the application interface switch, there is no distance between the search box control and the top edge of the flat-screen phone's display; the top edge of the search box control (the dashed box at initial position 1) coincides with the top edge of the display. During the application interface switch, the search box control moves a certain distance from initial position 1 to end position 1. The change in the display position of the search box control provided by the curved-screen phone is shown by the solid box. Before the application interface switch, there is a distance between the search box control and the top edge of the curved-screen phone's display, such as a distance of 24 pixels (px). This distance is consistent with the safety margin (i.e., the maximum distance from the safety area to the curved edge). During the application interface switch, the search box control moves a certain distance from initial position 2 to end position 2. End position 2 is shifted downwards by one safety margin compared to end position 1.

[0041] Understandably, during application interface switching, the distance the search box control moves from its initial position to its final position is preset. The distance the search box control moves from initial position 1 to final position 1 is equal to the distance it moves from initial position 2 to final position 2, both being preset distances.

[0042] To ensure that controls move to the preset target display position after a change in the application interface, the electronic device further verifies the display position of the controls after the interface change. For example, the electronic device verifies the distance of the controls from the top of the screen.

[0043] Continuing the example above, after moving the search box control from its initial position 1 to its end position 1, the flat-screen phone further moves the search box control to the target display position. The distance from the target display position to the top of the screen is equal to the target distance. Since the end position 1 of the search box control coincides with the target display position, the flat-screen phone keeps the search box control at its end position 1. Visually, during the process of switching the application interface from the gallery app's search interface to the gallery app's main interface, the display position of the search box control remains unchanged after moving from its initial position 1 to its end position 1. The search box control does not exhibit any jitter.

[0044] Correspondingly, due to the safety margin, the end position 2 of the search box control moves downwards by a safety margin distance compared to the target display position of the search box control. Therefore, the distance from the end position 2 of the search box control to the top of the screen is inconsistent with the target distance. The end position 2 of the search box control on the curved screen phone is inconsistent with the target display position. After moving the search box control from the initial position 2 to the end position 2, the curved screen phone further moves the search box control to the target display position at the target distance from the top of the screen. Visually, during the process of switching the application interface from the gallery application's search interface to the gallery application's main interface, the display position of the search box control moves from the initial position 2 to the end position 2, and then moves from the end position 2 to the target display position (consistent with the end position 1). Thus, the search box control on the curved screen phone will exhibit a jittering phenomenon in the displayed main interface.

[0045] To address the issue of control jittering during application interface switching, and considering the reasons for this jittering described above, this application provides a method. In this method, while an electronic device with a curved screen is displaying an interface (such as a third interface) in landscape mode, the electronic device receives a first operation from the user. The third interface includes a first control, and the distance between the display position of the first control on the third interface and the curved edge of the screen is equal to a safety margin. In response to the user's first operation, the electronic device switches the third interface to another interface (such as a fourth interface). During the switching from the third interface to the fourth interface, the display position of the first control moves from its position on the third interface to its position on the fourth interface. The distance between the display positions of the first control on the third interface and the first control on the fourth interface is equal to the difference between a preset distance and the distance from the display position of the first control on the third interface to the curved edge.

[0046] In the method provided in this application embodiment, when the electronic device is in landscape display mode, the safe area of ​​the curved screen is located at the top and / or bottom of the display. Without considering the safe area, the initial position of the first control on the third interface is preset. Under the influence of the safe area, the actual display position of the first control on the third interface differs from its initial position to avoid the safe area. Correspondingly, the initial movement distance of the first control during interface switching is also preset, and this movement distance is equal to a preset distance. If the electronic device moves the first control from its display position on the third interface by a preset distance, the display position of the first control on the fourth interface will also be changed, resulting in the display position of the first control on the fourth interface being inconsistent with the target display position set for the first control on the fourth interface. This will cause the first control to jitter on the fourth interface. Therefore, during the process of switching from the third interface to the fourth interface, the electronic device moves the first control from its display position on the third interface to a display position a certain distance away from that display position. This distance is equal to the difference between the preset distance and the distance from the display position on the third interface to the edge of the curved screen, so that the display position of the first control on the fourth interface is consistent with the target display position. This reduces control jitter on curved screen electronic devices in landscape mode when switching from application interfaces, thus minimizing the impact of control jitter on the user experience.

[0047] It is understood that the method provided in this application is applicable not only to electronic devices with curved screens in landscape mode, but also to electronic devices with curved screens in portrait mode and electronic devices with flat screens. This application does not impose any limitations on this.

[0048] For example, the electronic devices described in this application embodiment may be mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) / virtual reality (VR) devices, media players, wearable devices, etc. This application embodiment does not impose any special limitations on the specific form of the electronic devices.

[0049] This application embodiment uses a curved screen mobile phone 100 as an example to illustrate the hardware structure of the electronic device. For example... Figure 6As shown, the curved screen mobile phone 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 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0050] The processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU), a driver processor, etc. Different processing units may be independent devices or integrated into one or more processors. The processor 110 can serve as the central nervous system and command center of the curved-screen mobile phone 100. The processor 110 can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0051] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the curved screen phone 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, the curved screen phone 100 can store music, videos, images, and other files on the external memory card.

[0052] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of the curved screen mobile phone 100 by running the instructions stored in internal memory 121. For example, in this embodiment, processor 110 can execute instructions stored in internal memory 121, which may include a program storage area and a data storage area. Internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0053] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. In some embodiments, the power management module 141 and the charging management module 140 may also be housed in the same device.

[0054] The wireless communication function of the curved screen mobile phone 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. In some embodiments, antenna 1 of the curved screen mobile phone 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling the curved screen mobile phone 100 to communicate with networks and other devices through wireless communication technology.

[0055] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the curved screen mobile phone 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation.

[0056] The wireless communication module 160 can provide solutions for wireless communication applications on the curved screen mobile phone 100, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR).

[0057] In some implementations, the curved-screen phone 100 communicates with other electronic devices via a mobile communication module 150 or a wireless communication module 160. For example, the curved-screen phone 100 transmits files such as images to other electronic devices via the mobile communication module 150 or the wireless communication module 160.

[0058] The sensor module 180 may include sensors such as pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, Hall effect sensors, touch sensors, ambient light sensors, and bone conduction sensors. The curved screen phone 100 can collect various data through the sensor module 180.

[0059] The curved-screen phone 100 implements its display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0060] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. Display screen 194 is a curved screen with a bend at at least one edge. For example, display screen 194 is a single-curved screen with a bend along one longer edge (such as edge 1 mentioned above). Another example is a double-curved screen with bends along two longer edges (such as edge 1 and edge 3 mentioned above). In some implementations, depending on the degree of curvature of the curved screen edges, the curved screen can also be classified as a super-curved screen or a micro-curved screen. For example, if the curvature of the curved screen edge is greater than or equal to a preset curvature (such as 75 degrees), the curved screen is a super-curved screen. If the curvature of the curved screen edge is less than the preset curvature, the curved screen is a micro-curved screen.

[0061] In some implementations, the aforementioned touch sensor can be located in the display screen 194, forming a touchscreen, also known as a "touch panel," composed of the touch sensor and the display panel. The touch sensor, also called a "touch panel," is used to detect touch operations applied to or near it, such as clicks and swipes. The touch sensor can then transmit the detected touch operations to the application processor to determine the type of touch event. The curved screen phone 100 can provide visual output related to touch operations through the display screen 194. For example, in response to a user's touch operation on the display screen 194, the curved screen phone 100 displays the interface of a gallery application on the display screen 194.

[0062] The curved-screen phone 100 can achieve its shooting function through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture still images or videos. In some embodiments, the curved-screen phone 100 may include one or more cameras 193. For example, the curved-screen phone 100 includes one front-facing camera and multiple rear-facing cameras. Images or videos captured by the curved-screen phone 100 through the camera 193 can be saved in files corresponding to the gallery application.

[0063] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments, the electronic device may include more or fewer modules than those provided in the above embodiments, and the modules may employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments. The hardware structure of the electronic device provided in this application embodiment can also refer to the hardware structure of the curved screen mobile phone 100. The methods in the following embodiments can all be implemented in an electronic device with the above hardware structure.

[0064] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the aforementioned curved-screen mobile phone 100 as an example, and the software system of the electronic device adopts the layered architecture of the Android system, to illustrate the software structure of the electronic device.

[0065] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system may include an application layer, an application framework layer, the Android runtime and system libraries, and a kernel layer.

[0066] The application layer may include a series of application packages. For example, application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS, etc., and this application embodiment does not impose any limitations on this.

[0067] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer. The application framework layer includes predefined functions. For example, it may include a window manager, content provider, view system, phone manager, resource manager, and notification manager, etc., but this embodiment does not impose any limitations on these.

[0068] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java needs to call, and the other part consists of the Android core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0069] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0070] The kernel layer is the layer between hardware and software. It includes drivers and system service programs. Drivers at a minimum include display drivers, camera drivers, audio drivers, sensor drivers, etc.

[0071] The following is combined Figure 7 The software structure shown illustrates the workflow of the software and hardware of the curved screen mobile phone 100.

[0072] In the example, when the curved-screen phone 100 displays the third interface of the Gallery application in landscape mode, when the touch sensor of the curved-screen phone 100 receives a user operation on the third interface, the user operation is sent to the kernel layer of the curved-screen phone 100 via a hardware interrupt. This user operation is used to indicate switching application interfaces. The kernel layer of the curved-screen phone 100 uploads the input event of the user operation to the application layer. In response to the input event corresponding to the user operation, the Gallery application in the application layer calls the window manager to draw and lay out the fourth interface, and renders and displays the fourth interface on the display screen 194 through a graphics processing library (such as OpenGL) and a display driver. In this way, the curved-screen phone 100 switches the application interface from the third interface of the Gallery application to the fourth interface of the Gallery application.

[0073] To facilitate understanding of the solutions provided in the embodiments of this application, some terms will be explained first.

[0074] A control is an interactive element in a display (or user interface). Controls can be used to receive user input (such as text, images, etc.), provide visual information, or perform user actions. Controls can take many forms, such as buttons, text boxes, selection keys, sliders, and drop-down lists. Controls enable interaction between the user interface and the user.

[0075] Electronic devices can use a rectangular struct (RECT) to represent the display position and size of a control's view on the screen. The rectangular struct is the basic class used for drawing graphics, representing a rectangle. When a control is rectangular, its display position can be represented by four integers: left; top; right; and bottom. The rectangular struct can be used to represent the display position and size of a rectangular control. The graphic drawing area of ​​a rectangular control on the screen can be determined using a rectangular struct.

[0076] For example, such as Figure 8As shown, `left` represents the distance between the leftmost edge of the rectangle control and the left edge of the display screen (simply referred to as the left side distance). `top` represents the distance between the top edge of the rectangle control and the top edge of the display screen (simply referred to as the top edge distance). `right` represents the distance between the rightmost edge of the rectangle control and the right edge of the display screen (simply referred to as the right edge distance). `bottom` represents the distance between the bottom edge of the rectangle control and the bottom edge of the display screen (simply referred to as the bottom edge distance). The vertical length of the rectangle control is equal to the difference between `bottom` and `top`. The horizontal length of the rectangle control is equal to the difference between `right` and `left`.

[0077] To simplify the display position of controls, the position of a control on the screen can also be represented by vertex coordinates. For example, such as... Figure 9 As shown, the vertex coordinates of a rectangular control are the coordinates of its top-left corner point C. The coordinates of the top-left corner point C can be represented as: loc[0]; loc[1]. Wherein, loc[0] represents the x-axis coordinate of the top-left corner point C in the display coordinate system; loc[1] represents the y-axis coordinate of the top-left corner point C in the display coordinate system. The x-axis coordinate can also be called the horizontal coordinate, representing the distance between the top-left corner point C of the rectangular control and the left side of the display screen. The y-axis coordinate can also be called the vertical coordinate, representing the distance between the top-left corner point C of the rectangular control and the top edge of the display screen. In the example, the display coordinate system can be with the top-left corner point A of the display area as the origin, the direction upward from the origin as the x-axis direction, and the direction to the left from the origin as the y-axis direction. Correspondingly, the display position of the window can also be represented by vertex coordinates. For example, the coordinates of the top-left corner point B can represent the display position of the window.

[0078] The following uses a curved screen mobile phone 100 as an example, where the display screen of the curved screen mobile phone 100 is a dual-curved screen, to introduce the method provided in the embodiments of this application. Figure 10 As shown, the embodiments of this application include the following steps:

[0079] S1001, in landscape mode, the curved screen phone 100 displays a third interface, which includes a first control. The first control is located in the third display position of the third interface and is adjacent to the safe area.

[0080] The curved-screen phone 100 can display a third interface of a primary application in landscape mode upon user interaction. The primary application is one of several applications available on the curved-screen phone 100. For example, if the primary application is the Gallery app, and the third interface is the search interface for the Gallery app, in landscape mode, the curved-screen phone 100 responds to the user's tap on the search box control in the Gallery app's main interface by displaying the Gallery app's search interface.

[0081] The first control is a common control on both the third and fourth interfaces of the curved screen phone 100. For example, the first control could be a search box control, a selection key control, etc. In the third interface, the display position of the first control can be called the third display position. The distance between the third display position and the curved edge of the screen (i.e., the top or bottom edge) (can be called the second distance) is equal to the screen's safety margin. The second distance can be the closest distance between the first control and the curved edge. The first control is adjacent to but does not intersect with the safety area. For example, as shown... Figure 2 As shown in (1), taking the third interface as the search interface of the gallery application and the first control as the search box control as an example, the search box control is at the top of the search interface and is adjacent to the safe area at the top of the curved screen. The distance between the search box control and the top edge (i.e., the curved edge) of the curved screen is equal to the safe margin.

[0082] In this embodiment, landscape display refers to the display state where the curved screen phone 100's display direction is parallel to the short side of the display screen. The curved screen phone 100's display screen is rectangular, comprising four sides. The two relatively longer sides are referred to as the long sides, and the two relatively shorter sides are referred to as the short sides. The display direction of the curved screen phone 100 refers to the orientation of the application interface on the display screen. This orientation is consistent with the user's reading direction. Typically, the display direction of the curved screen phone 100 is consistent with the orientation of text and images in the application interface. In addition to landscape display, the curved screen phone 100 also includes portrait display. Portrait display refers to the display state where the display direction is parallel to the long side of the display screen.

[0083] In some implementations, the curved-screen phone 100 can switch between landscape and portrait display modes. For example, when the search interface of the gallery app is displayed in portrait mode, the curved-screen phone 100 responds to the user's hand gesture of holding the curved-screen phone 100 horizontally and switches the display mode from portrait to landscape, displaying the search interface of the gallery app in landscape mode.

[0084] In this embodiment, the safe area within the safety margin refers to the area where no display content is set. For example, the area where the physical buttons of the curved screen phone 100 are located and the area where the camera is located can both have safety margins set. To provide users with a better display effect, the curved screen phone 100 also sets safety margins in the screen areas where two curved edges (i.e., edges with a curvature) are adjacent. In landscape display mode, safety margins are set at the top and bottom of the curved screen phone 100. Since the safe area within the safety margin is invisible, in order to make the content in the application interface displayed on the curved screen avoid the safe area, in some implementations, before the curved screen phone 100 displays an application interface, the curved screen phone 100 can also adjust the distance between the content in the application interface and the curved edge based on the safety margin, so that the content in the application interface avoids the safe area. For example, before displaying the third interface in landscape mode, if the curved-screen phone 100 detects that the distance between the initial position (which can be called the second initial position) of the first control in the third interface and the edge of the curved surface (such as the first distance) is less than the safety margin, then the distance between the first control and the edge of the curved surface in the third interface is adjusted according to the safety margin of the curved screen, such as adjusting the distance between the first control and the edge of the curved surface to the safety margin. The distance between the third display position of the first control and the edge of the curved surface is the second distance, which is equal to the safety margin.

[0085] For example, the curved screen phone 100 can set a window margin listener function (e.g., OnApplyWindowInsetsListener). When OnApplyWindowInsetsListener detects that the edge of the application interface window collides with the safe area, the curved screen phone 100 can set the window's margins according to the safe margin, so that the window avoids the safe area. In this way, the controls contained in the application interface window will not be placed within the safe area of ​​the curved screen. Here, the window is the container for the controls. After the window's margins are set, the display position of the controls in the window (such as the first control) will also change according to the window's display position.

[0086] For example, the execution code for setting a safe margin on a curved screen phone 100 is as follows:

[0087] public class MainActivity extends AppCompatActivity {

[0088] @Override

[0089] protected void onCreate(Bundle savedInstanceState) {

[0090] super.onCreate(savedInstanceState);

[0091] setContentView(R.layout.activity_main);

[0092] View rootView = findViewById(android.R.id.content);

[0093] ViewCompat.setOnApplyWindowInsetsListener(rootView, newOnApplyWindowInsetsListener() {

[0094] @Override

[0095] public WindowInsetsCompat onApplyWindowInsets(View v,WindowInsetsCompat insets) {

[0096] if (Build.VERSION.SDK_INT>= Build.VERSION_CODES.Q) {

[0097] / / Use the API for Android 10 (corresponding to API level 29) and above

[0098] v.setPadding(

[0099] insets.getSystemWindowInsetLeft(), / / Left safety margin

[0100] insets.getSystemWindowInsetTop(), / / Top safety margin

[0101] insets.getSystemWindowInsetRight(), / / Right safety margin

[0102] insets.getSystemWindowInsetBottom() / / Bottom safety margin );

[0104] }

[0105] return insets;

[0106] }

[0107] });

[0108] }

[0109] }

[0110] In the example, safety margins include left safety margin, right safety margin, top safety margin, and bottom safety margin. The left safety margin represents the safety margin set at the far left of the display. The right safety margin represents the safety margin set at the far right of the display. The top margin represents the safety margin set at the top of the display. The bottom margin represents the safety margin set at the bottom of the display. In the executed code above, `insets.getSystemWindowInsetLeft()` sets the left safety margin of the display. The left safety margin is equal to the width of the left safety area of ​​the display. `insets.getSystemWindowInsetTop()` sets the top safety margin of the display. The top safety margin of the display is equal to the width of the top safety area of ​​the display. `insets.getSystemWindowInsetRight()` sets the right safety margin of the display. The right safety margin of the display is equal to the width of the right safety area of ​​the display. `insets.getSystemWindowInsetBottom()` sets the bottom safety margin of the display. The bottom safety margin of the window is equal to the width of the bottom safety area of ​​the display.

[0111] In this embodiment, the curved screen phone 100 can adjust the distance between the first control and the curved edge on the third interface according to the above-described execution code. For example, in landscape mode, the top safety margin of the curved screen is 24 pixels. The first distance between the second initial position of the first control and the top edge of the display screen is 0. If the second initial position of the first control is not adjusted, the first control will overlap with the safety area. Therefore, the curved screen phone 100 adjusts the display position of the first control, such as adjusting the distance between the first control and the top edge of the display screen from 0 to 24 pixels, to obtain the third display position of the first control. The third display position indicates that the closest distance between the first control and the top edge of the display screen is 24 pixels. After adjustment, the first control will not overlap with the safety area.

[0112] The S1002, a curved screen phone 100, receives the user's first operation while displaying the third interface in landscape mode.

[0113] The first operation is used to instruct the curved-screen phone 100 to switch display interfaces. The display position of the first control varies in different display interfaces. The first operation triggers a switch in the display position of the first control. For example, in addition to the first control, the third interface also includes a second control (such as a back control). The second control is used to trigger the curved-screen phone 100 to switch display interfaces. The first operation can be a user action of clicking the second control in the third interface. As another example, the curved-screen phone 100 has a gesture navigation area at the edge of the display screen. This gesture navigation area is used to trigger the curved-screen phone 100 to return to the application interface previously displayed on the third interface. Taking the fourth interface as an example of the application interface previously displayed on the third interface, the first operation can be a swipe operation by the user in the gesture navigation area.

[0114] S1003, the curved screen phone 100 responds to the first operation and calculates the fourth display position of the first control on the fourth interface based on the second distance between the third display position of the first control and the curved edge, and the second end position at a preset distance from the third display position.

[0115] The second end position of the first control is its initial display position set in the fourth interface. The distance between the second end position and the third display position is fixed and equal to a preset distance. In some implementations, the curved screen phone 100 can determine the second end position of the first control based on its third display position. For example, taking the second end position as directly below the third display position, the second end position can be represented as: left1; top1; right1; bottom1. The third display position can be represented as: left0; top0; right0; bottom0. The top1 of the second end position is equal to the sum of top0 and the preset distance. The bottom1 of the second end position is equal to the sum of bottom0 and the preset distance. The left1 of the second end position is equal to left0. The right1 of the second end position is equal to right0.

[0116] Because the display position of the first control changes due to the safety margin of the display screen, the second end position of the first control is inconsistent with the target display position of the first control in the fourth interface. The target display position is the preset display position of the first control in the fourth interface. The distance between the target display position and the edge of the curved surface is a preset target distance. In order to make the display position of the first control in the fourth interface consistent with the target display position, the curved screen phone 100 calculates the fourth display position of the first control in the fourth interface based on the second distance between the third display position of the first control and the edge of the curved surface, and the second end position at a preset distance from the third display position. The fourth display position is the actual display position of the first control in the fourth interface.

[0117] Taking the distance from the first control to the edge of the curved surface as an example, where the ordinate of the vertex of the first control represents that distance. For instance, the third interface is as follows: Figure 2 The search interface of the gallery application shown in (1) is as follows: The fourth interface is as follows Figure 2 The main interface of the gallery application shown in (2) has a search box control as the first control. The vertical coordinate of the vertex of the search box control on the third interface is the vertical coordinate of the upper left corner of the search box control. In response to the first operation, the curved screen phone 100 obtains the vertical coordinate of the upper left corner of the search box control on the third interface (as mentioned above, loc[1]) and the distance between the second end position of the search box control and the edge of the curved surface (as mentioned above, top1 and bottom1). Further, the curved screen phone 100 calculates the difference between the distance between the second end position of the search box control and the edge of the curved surface and the coordinate of the upper left corner of the search box control, and obtains the fourth display position of the search box control on the fourth interface. For example, the fourth display position can be represented as: left2; top2; right2; bottom2. Where, left2 equals left1. right2 equals right1. top2 equals the difference between top1 and loc[1]. bottom2 equals the difference between bottom1 and loc[1].

[0118] It is understandable that each display position, including the second end position, the third display position, and the fourth display position, includes four integers, which can be found in [reference needed]. Figure 8 The description of the display position mentioned above will not be repeated here. Given that in the above example, the display position of the search box control only changes in the y-axis direction and does not change in the x-axis direction. In the example, the curved screen phone 100 can calculate the difference between the top distance top1 and the bottom distance bottom1 in the second end position of the search box control and the ordinate loc[1] of the top left corner point of the search box control in the third interface, and obtain the top distance top2 and the bottom distance bottom2 in the fourth display position of the search box control.

[0119] S1004, the curved screen phone 100, displays a fourth interface based on the fourth display position of the first control.

[0120] After calculating the fourth display position of the first control in the fourth interface, the curved-screen phone 100 can move the first control from the third display position to the fourth display position and display the fourth interface of the first application. In the fourth interface displayed by the curved-screen phone 100, the first control is far from the safe area.

[0121] To enhance the visual experience during application interface transitions, some implementations allow the first application on the curved-screen phone 100 to utilize a motion effects module to dynamically move the first control from the third display position to the fourth display position using effects such as translation. This way, during the transition from the third to the fourth interface, the first control can smoothly transition from its third to fourth display position, minimizing the impact of sudden changes in its display position on the user experience.

[0122] The aforementioned animation module is used to provide animation effects for the application interface. The animation module can also be called an animation function (e.g., represented as Animator()). In some examples, during the switching of application interfaces on the curved-screen phone 100, the first application calls the animation module to obtain the second distance of the first control from the edge of the curved surface on the third interface and the second end position of the first control. Further, the animation module of the curved-screen phone 100 calculates the fourth display position of the first control on the fourth interface based on the second distance and the second end position of the first control. Then, the animation module of the curved-screen phone 100 moves the first control from the third display position to the fourth display position using a translation effect.

[0123] In the example, the animation module of the curved screen phone 100 can obtain the second distance between the first control and the edge of the curved surface through a preset application programming interface (API). For example, the preset API is getLocationOnScreen(). The animation module of the curved screen phone 100 can determine the fourth display position of the first control by referring to the following part of the execution code:

[0124] public Animator createAnimator(ViewGroup sceneRoot){

[0125] View view = createBackgroudView();

[0126] sceneRoot.getOverLay().add(view);

[0127] View snapShotView = mAnimateView;

[0128] sceneRoot.getOverLay.add(snapShotView);

[0129] if (null != mActivity&&null != mActivity.getWindow()&&null!= mActivity.getWindow.getDecorView()){

[0130] if(loc == null){

[0131] loc = new int[2];

[0132] }

[0133] mActivity.getWindow().getDecorView().getLocationOnScreen(loc);

[0134] if (null != mEndRect) {

[0135] mEndRect.top = mEndRect.top - loc[1];

[0136] mEndRect.bottom = mEndRect.bottom - loc[1];

[0137] }

[0138] }

[0139] In the example, mEndRect.top can represent the top distance of the first control. mEndRect.bottom can represent the bottom distance of the first control. loc[1] represents the ordinate of the top left corner of the first control in the third interface. Taking the first control as the above search box control as an example, under the action of the above execution code, the curved screen mobile phone 100 calculates the difference between the top distance top1 in the second end position of the search box control and the ordinate loc[1] of the top left corner of the search box control in the third interface, and obtains the top distance top2 of the fourth display position of the search box control. It also calculates the difference between the bottom distance bottom1 in the second end position of the search box control and the ordinate loc[1] of the top left corner of the search box control in the third interface, and obtains the bottom distance bottom2 of the fourth display position of the search box control.

[0140] To ensure that the display position of the first control in the fourth interface matches the target display position, in some implementations, after the curved screen phone 100 moves the first control from the third display position to the fourth display position, the curved screen phone 100 can also correct the display position of the first control in the fourth interface. For example, after moving the first control from the third display position to the fourth display position, the curved screen phone 100 can use an animation module to compare the distance from the fourth display position of the first control to the edge of the curved surface with the target distance from the target display position to the edge of the curved surface. If the distance from the fourth display position of the first control to the edge of the curved surface matches the target distance, the first control remains in the fourth display position. If the distance from the fourth display position of the first control to the edge of the curved surface does not match the target distance, the first control is moved to the target display position.

[0141] In this embodiment, before moving the first control from the third display position to the fourth display position, the curved screen phone 100 has already corrected the second end position of the first control using a second distance. The fourth display position obtained after correction is consistent with the target display position. Therefore, after the curved screen phone 100 moves the first control from the third display position to the fourth display position, the display position of the first control will not change. For example, in Figure 2 In the application scenario shown, the search box control does not exhibit any shaking in the fourth interface, thereby improving the user experience.

[0142] In the above embodiments, taking a curved-screen mobile phone 100 as an example, the process of switching application interfaces in landscape mode of the curved-screen mobile phone 100 is exemplarily described. Below, again taking a curved-screen mobile phone 100 as an example, the process of switching application interfaces in portrait mode of the curved-screen mobile phone 100 is exemplarily described. The embodiments of this application include the following steps:

[0143] S1101, in portrait mode, the curved screen phone 100 displays a first interface, which includes a first control. The first control is not adjacent to the safe area in its first display position on the first interface.

[0144] The first and third interfaces represent the same application interface in different display states. For example, as shown below... Figure 11 As shown in (1), the first interface is the search interface of the gallery application, and the first control is the search box control in the search interface of the gallery application. The search box control is at the top of the search interface.

[0145] In portrait mode, the two long sides (curved edges) of the curved screen phone 100 can be on the left and right sides of the display screen, and the two short sides can be on the top and bottom sides (or top and bottom). The display orientation of the curved screen phone 100 is parallel to the long sides of the display screen. The safe area of ​​the curved screen phone 100 is adjacent to the long sides of the left and right sides of the display screen. There are no safe areas at the top and bottom of the curved screen phone 100.

[0146] The display position of the first control in the first interface can be referred to as the first display position. The first display position is located at the top of the display screen, and the distance (referred to as the first distance) between it and the straight edge (i.e., the top or bottom edge) of the display screen is less than the safety margin of the curved screen, such as being equal to 0. Since the top and bottom edges of the curved screen phone 100 do not have safety areas, the top of the first control is not adjacent to the safety area. The first display position of the first control is consistent with the initial display position (which can be represented as the first initial position) set by the first control in the first interface, and the first display position is equal to the first initial position.

[0147] S1102, the curved screen phone 100 receives the user's first operation while displaying the first interface in portrait mode.

[0148] The first operation is used to instruct the curved screen phone 100 to switch display interfaces. For example, switching the display interface from the first interface to the second interface. The display position of the first control is different in different display interfaces. The first operation will trigger the switching of the display position of the first control. For example, the first operation is a user operation of clicking the second control in the first interface. Or, the first operation is a user swipe operation in the gesture navigation area of ​​the display screen.

[0149] The second interface and the fourth interface described above belong to the same application interface in different display states. The second interface includes a first control. The display position of the first control in the second interface (which can be represented as the second display position) is different from its display position in the first interface. For example, such as... Figure 11 As shown in (2), the second interface is the main interface of the gallery application, which includes a search box control (an example of the first control). The search box control is located away from the top of the screen in the main interface of the gallery application.

[0150] S1103, the curved screen phone 100 responds to the first operation and calculates the second display position of the first control on the second interface based on the vertex coordinates of the first control on the first interface and the first end position of the first control.

[0151] The first end position of the first control is the initial display position set for the first control in the second interface. The distance between the first end position and the first display position is fixed and equal to a preset distance. In some implementations, the curved screen phone 100 can determine the first end position of the first control based on the first display position of the first control. The upper distance of the first end position is equal to the sum of the upper distance of the first display position and the preset distance; the lower distance of the first end position is equal to the sum of the lower distance of the first display position and the preset distance; the left distance of the first end position is equal to the left distance of the first display position; and the right distance of the first end position is equal to the right distance of the first display position.

[0152] For example, the first interface is as follows Figure 11 The search interface of the gallery application shown in (1) is as follows: The second interface is as follows Figure 11 In the main interface of the gallery application shown in (2), the first control is the search box control. The distance of the search box control from the edge of the straight surface in the third interface is represented by the vertical coordinate of the vertex (such as the vertical coordinate of the upper left corner). The upper distance in the second display position of the search box control is equal to the difference between the upper distance in the first end position of the search box control and the vertical coordinate of the upper left corner of the search box control in the first interface; the lower distance in the second display position of the search box control is equal to the difference between the lower distance in the first end position of the search box control and the vertical coordinate of the upper left corner of the search box control in the first interface. In the portrait display state, since there is no safe area, the vertical coordinate of the upper left corner of the search box control in the first interface is 0. The second display position calculated by the curved screen mobile phone 100 is consistent with the first end position.

[0153] In some implementations, the curved-screen phone 100 can call the animation module to determine the second display position of the first control. The method by which the animation module of the curved-screen phone 100 determines the second display position of the first control can be found in the execution code related to the animation module mentioned above, and will not be repeated here.

[0154] S1104, the curved screen phone 100 displays a second interface based on the second display position of the first control.

[0155] After calculating the second display position of the first control in the second interface, the curved-screen phone 100 can move the first control from the first display position to the second display position and display the second interface of the first application. In some implementations, the first application of the curved-screen phone 100 can call the animation module to move the first control from the first display position to the second display position with dynamic effects (such as translation effects).

[0156] As can be seen, the process of switching application interfaces on the curved-screen phone 100 in portrait mode is the same as the process of switching application interfaces on the curved-screen phone 100 in landscape mode. Other similar processes will not be described here; please refer to the process of switching application interfaces in landscape mode above. The method provided in this application embodiment is applicable to electronic devices with curved screens, and also applicable to electronic devices with flat screens. The following describes the general process of interface switching provided in this application embodiment, taking the application scenario of switching from the search interface of the gallery application to the main interface of the electronic device as an example.

[0157] For example, an electronic device displays the search interface of a gallery application. While displaying the search interface, the electronic device receives a user action (example of the first action) where the user clicks the back control in the search interface. The parent interface of the search interface is the main interface of the gallery application. In response to this user action, the electronic device obtains the ordinate of the top-left corner of the search box control in the search interface, and the preset end position of the search box control in the main search interface, through an animation module. This preset end position includes a preset top distance (representing the distance from the top edge of the search box control to the top of the display screen) and a preset bottom distance (representing the distance from the bottom edge of the search box control to the bottom edge of the display screen). If a safe area is set at the top of the electronic device's display screen, the ordinate of the top-left corner of the search box control in the search interface is equal to the width of the safe area, such as 24px. If no safe area is set at the top of the electronic device's display screen, the ordinate of the top-left corner of the search box control in the search interface is equal to 0. The animation module of the electronic device calculates the differences between the preset bottom distance and the preset top distance and the ordinate of the top-left corner vertex, respectively, to obtain the bottom distance and bottom position of the search box control in the main interface. Further, the animation module moves the search box control from the top of the search interface to the display position corresponding to the bottom distance and bottom position of the search box control in the main interface, and displays the main interface of the gallery application. This achieves the switching from the search interface of the gallery application to the main interface of the gallery application.

[0158] In other embodiments of this application, an electronic device is also provided, including: a curved screen, a memory, a processor, and a computer program stored in the memory. The curved screen and the memory are coupled to the processor. The curved screen is used to display images, such as an application interface. When the computer program is executed by the processor, the electronic device can perform various functions or steps in the above method embodiments. Of course, the electronic device may also include other hardware structures. For example, the electronic device may also include hardware structures such as sensors and communication modules.

[0159] This application also provides a chip system applied to an electronic device. The chip system includes at least one processor and at least one interface circuit. The processor and the interface circuit are interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (e.g., memory). Or, for example, the interface circuit can be used to send signals to other devices (e.g., the processor). Exemplarily, the interface circuit can read a computer program stored in memory and send the computer program to the processor. When the computer program is executed by the processor, it can cause the electronic device to perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application does not specifically limit this.

[0160] This application also provides a computer-readable storage medium including a computer program that, when run on the electronic device, causes the electronic device to perform the various functions or steps in the above method embodiments.

[0161] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the functions or steps described in the method embodiments above. For example, the computer may be the aforementioned electronic device.

[0162] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0163] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0164] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0165] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0166] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] The above content is only a specific implementation of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the protection scope of this application.

Claims

1. A display method, characterized in that, Applied to an electronic device, the electronic device including a curved screen; the method includes: When the electronic device is in portrait display mode, in response to a first operation on a first control at a first display position, the first control is displayed at a second display position; the first operation is used to trigger a switch of the display position of the first control, and the first display position is a first distance from the straight edge of the curved screen; the distance between the first display position and the second display position is equal to the difference between a preset distance and the first distance; When the electronic device is in landscape display mode, in response to the first operation on the first control at the third display position, the first control is moved from the third display position to the fourth display position, and the first control is displayed at the fourth display position; the third display position is a second distance from the curved edge of the curved screen, and the second distance is different from the first distance; the distance between the third display position and the fourth display position is equal to the difference between the preset distance and the second distance.

2. The method according to claim 1, characterized in that, When the electronic device is in portrait mode, in response to a first operation on a first control at a first display position, displaying the first control at a second display position includes: When the electronic device is in portrait mode, a first interface is displayed, and the first interface includes a first control at the first display position; In response to a first operation on a first control at a first display location, a second interface is displayed, the second interface including the first control at the second display location.

3. The method according to claim 2, characterized in that, When the electronic device is in landscape mode, in response to a first operation on a first control at a third display position, displaying the first control at a fourth display position includes: When the electronic device is in landscape mode, a third interface is displayed, the third interface including a first control at the second display position; In response to a first operation on a first control at a second display position, a fourth interface is displayed. The fourth interface includes the first control at the fourth display position. The third interface and the first interface belong to the same application interface in different display states. The fourth interface and the second interface belong to the same application interface in different display states. The display states include portrait display state and landscape display state.

4. The method according to claim 3, characterized in that, The curved screen has a safety margin within its curved area, within which the curved screen is invisible; before displaying the third interface, the method further includes: Based on the safety margin, the distance between the first control and the curved edge of the curved screen is adjusted from the first distance to the second distance; wherein the first distance is less than the safety margin, and the second distance is equal to the safety margin.

5. The method according to any one of claims 1-4, characterized in that, Before displaying the first control at the fourth display position, the method further includes: In response to a first operation on a first control at a third display position, the motion effect module is invoked to obtain a second distance between the first control at the third display position and the curved edge of the curved screen, and to obtain a second end position at a preset distance from the third display position; The difference between the distance between the second ending position and the edge of the curved surface and the second distance is calculated to obtain the fourth display position.

6. The method according to claim 5, characterized in that, The step of calling the animation module to obtain the second distance between the first control at the third display position and the curved edge of the curved screen includes: The motion effects module is invoked to obtain the second distance through a preset application programming interface.

7. The method according to any one of claims 1-4 or 6, characterized in that, After displaying the first control at the fourth display position, the method further includes: If the distance from the fourth display position to the edge of the curved surface is equal to the target distance, then the first control remains at the fourth display position; If the distance from the fourth display position to the edge of the curved surface is inconsistent with the target distance, then the first control is moved to the target display position at the target distance from the edge of the curved surface.

8. The method according to any one of claims 1-4 or 6, characterized in that, The first control is a search box control.

9. An electronic device, characterized in that, The device includes a curved screen, a memory, a processor, and a computer program stored in the memory. The curved screen is used to display images. When the processor runs the computer program, the electronic device performs the method of any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The device stores a computer program that, when executed by the electronic device, causes the electronic device to perform the method of any one of claims 1-8.

11. A computer program product, characterized in that, It includes a computer program, which, when run by an electronic device, causes the electronic device to perform the method of any one of claims 1-8.