Floating Window Management Method and Related Apparatus

A floating window management method includes a first electronic device displaying a first user interface and a floating window on a display, where the floating window displays an image collected by a camera of a second electronic device of a video contact. The first electronic device receives a first user operation of dragging the floating window to a status bar in the first user interface. The first electronic device hides the floating window in response to the first user operation.

This application claims priority to Chinese Patent Application No. 201910704781.5, filed with the China National Intellectual Property Administration on Jul. 31, 2019 and entitled “FLOATING WINDOW MANAGEMENT METHOD AND RELATED APPARATUS”, which is incorporated herein by reference in its entirety.

TECHNICAL FIELD

This application relates to the field of electronic technologies, and in particular, to a floating window management method and a related apparatus.

BACKGROUND

As shown inFIG. 1A, when a user makes a video call, a display of an electronic device displays a video call interface. The user may exit the current video call interface without declining the video call. When the user switches the current video call interface to another user interface, the display of the electronic device displays both the another user interface and a floating window. The floating window is used to display an image collected by a camera of an electronic device of a video contact. For example, as shown inFIG. 1AandFIG. 1B, when the user switches the current video call interface to a home screen by touching a home screen button in the video call interface, the display of the electronic device displays both the home screen and the floating window. It can be learned fromFIG. 1Bthat the floating window blocks a part of the home screen. Therefore, the floating window may affect browsing interface information on the home screen by the user, or affect a user operation performed by the user on the home screen.

In conclusion, the floating window used for the video call affects the user operation, causing inconvenience of the user operation.

SUMMARY

Embodiments of this application provide a floating window management method and a related apparatus. According to this application, when a video call is kept, a floating window can be prevented from blocking a user interface, to improve convenience of a user operation.

According to a first aspect, this application provides a floating window management method, including: An electronic device displays a first user interface and a floating window on a display, where the floating window is used to display an image collected by a camera of an electronic device of a video contact. The electronic device receives a first user operation, where the first user operation is that a user drags the floating window to a status bar in the first user interface. The electronic device hides the floating window in response to the first user operation.

According to the method in the first aspect, when a video call is kept, the floating window can be prevented from blocking a user interface, to improve convenience of a user operation.

With reference to the first aspect, in some embodiments, after the electronic device hides the floating window in response to the first user operation, the method further includes: The electronic device receives a second user operation performed on a status bar in a second user interface. The electronic device displays the second user interface and the floating window on the display in response to the second user operation.

With reference to the first aspect, in some embodiments, after the electronic device hides the floating window in response to the first user operation, the method further includes: The electronic device receives a third user operation performed on the status bar in the second user interface. The electronic device displays, on the display in full screen mode in response to the third user operation, a video call interface corresponding to the floating window.

With reference to the first aspect, in some embodiments, the display includes a first area and a second area, and after the electronic device hides the floating window in response to the first user operation, the method further includes: The electronic device receives a fourth user operation performed on the status bar in the second user interface. In response to the fourth user operation, the electronic device displays the second user interface in the first area, and the electronic device displays the video call interface corresponding to the floating window in the second area.

With reference to the first aspect, in some embodiments, the floating window and the status bar cannot be displayed in an overlapping manner; and the first user operation is that a finger of the user slides on the display, to drag the floating window upward to the status bar in the first user interface, and a first preset condition is met.

With reference to the first aspect, in some embodiments, the first preset condition is: an upper edge of the floating window coincides with a lower edge of a status bar in the first user interface; when the upper edge of the floating window coincides with the lower edge of the status bar in the first user interface, the finger of the user stops sliding and stops touching an area in which the floating window is located on the display; after the upper edge of the floating window coincides with the lower edge of the status bar in the first user interface, a distance by which the finger of the user continues to slide upward on the display reaches a first distance threshold; after the upper edge of the floating window coincides with the lower edge of the status bar in the first user interface, when the distance by which the finger of the user continues to slide upward on the display is greater than or equal to the first distance threshold, the finger of the user stops sliding and stops touching the display; after the upper edge of the floating window coincides with the lower edge of the status bar in the first user interface, a time period for which the finger of the user continues to touch the area in which the floating window is located on the display reaches a first time threshold; after the upper edge of the floating window coincides with the lower edge of the status bar in the first user interface, when the distance by which the finger of the user continues to slide upward on the display is greater than or equal to the first distance threshold, the finger of the user stops sliding and stops touching the display; a distance between the upper edge of the floating window and an upper edge of the status bar in the first user interface is less than a first width value; or when the distance between the upper edge of the floating window and the upper edge of the status bar in the first user interface is less than the first width value, the finger of the user stops touching the area in which the floating window is located on the display.

With reference to the first aspect, in some embodiments, the floating window and the status bar may be displayed in an overlapping manner, and after an upper edge of the floating window coincides with an upper edge of the status bar in the first user interface, the floating window cannot continue to move upward; a width of a status bar on the electronic device is a first width value; and the first user operation is that a finger of the user slides on the display, to drag the floating window upward to the status bar in the first user interface, and a second preset condition is met.

With reference to the first aspect, in some embodiments, the second preset condition is: when a distance between the upper edge of the floating window and the upper edge of the status bar in the first user interface is less than the first width value, a time period for which the finger of the user stops sliding and continues to touch an area in which the floating window is located on the display reaches a second time threshold; after the distance between the upper edge of the floating window and the upper edge of the status bar in the first user interface is less than the first width value, when the time period for which the finger of the user stops sliding and continues to touch the area in which the floating window is located on the display is greater than or equal to the second time threshold, the finger of the user stops touching the area in which the floating window is located on the display; the upper edge of the floating window coincides with the upper edge of the status bar in the first user interface; when the upper edge of the floating window coincides with the upper edge of the status bar in the first user interface, the finger of the user stops sliding and stops touching the area in which the floating window is located on the display; after the upper edge of the floating window coincides with the upper edge of the status bar in the first user interface, a distance by which the finger of the user continues to slide upward on the display reaches a second distance threshold; after the upper edge of the floating window coincides with the upper edge of the status bar in the first user interface, when the distance by which the finger of the user continues to slide upward on the display is greater than or equal to the second distance threshold, the finger of the user stops sliding and stops touching the display; after the upper edge of the floating window coincides with the upper edge of the status bar in the first user interface, a time period for which the finger of the user continues to touch the area in which the floating window is located on the display reaches a third time threshold; or after the upper edge of the floating window coincides with the upper edge of the status bar in the first user interface, when the time period for which the finger of the user continues to touch the area in which the floating window is located on the display is greater than or equal to the third time threshold, the finger of the user stops touching the area in which the floating window is located on the display.

With reference to the first aspect, in some embodiments, the floating window and the status bar in the first user interface may be displayed in an overlapping manner, and after an upper edge of the floating window coincides with an upper edge of the status bar in the first user interface, the floating window may continue to move upward; a current height of the floating window is a first height value, and a third distance threshold is less than the first height value; and the first user operation is that a finger of the user slides on the display, to drag the floating window upward to the status bar in the first user interface, and a third preset condition is met.

With reference to the first aspect, in some embodiments, the third preset condition is: a distance between a lower edge of the floating window and the upper edge of the status bar in the first user interface is less than the first height value; when the distance between the lower edge of the floating window and the upper edge of the status bar in the first user interface is less than the first height value, the finger of the user stops touching an area in which the floating window is located on the display; the distance between the lower edge of the floating window and the upper edge of the status bar in the first user interface reaches the third distance threshold; or when the distance between the lower edge of the floating window and the upper edge of the status bar in the first user interface is less than the third distance threshold, the finger of the user stops sliding and stops touching the display.

With reference to the first aspect, in some embodiments, the second user operation is that the finger of the user single-taps or double-taps the status bar in the second user interface; the second user operation is that the finger of the user slides leftward or rightward on the status bar in the second user interface for a time period greater than or equal to a fourth time threshold; the second user operation is that the finger of the user slides leftward or rightward on the status bar in the second user interface by a distance greater than or equal to a fourth distance threshold; the second user operation is that the finger of the user touches and holds the status bar in the second user interface for a time period greater than or equal to a fifth time threshold; or the second user operation is that the finger of the user slides downward by using the status bar in the second user interface as a start point, and when a distance by which the finger of the user slides downward is greater than a fifth distance threshold, the finger of the user stops sliding and stops touching the display.

With reference to the first aspect, in some embodiments, the third user operation is that the finger of the user single-taps or double-taps the status bar in the second user interface; the third user operation is that the finger of the user slides leftward or rightward on the status bar in the second user interface for a time period greater than or equal to a fourth time threshold; the third user operation is that the finger of the user slides leftward or rightward on the status bar in the second user interface by a distance greater than or equal to a fourth distance threshold; the third user operation is that the finger of the user touches and holds the status bar in the second user interface for a time period greater than or equal to a fifth time threshold; or the third user operation is that the finger of the user slides downward by using the status bar in the second user interface as a start point, and when a distance by which the finger of the user slides downward is greater than a fifth distance threshold, the finger of the user stops sliding and stops touching the display.

With reference to the first aspect, in some embodiments, the fourth user operation is that the finger of the user single-taps or double-taps the status bar in the second user interface; the fourth user operation is that the finger of the user slides leftward or rightward on the status bar in the second user interface for a time period greater than or equal to a fourth time threshold; the fourth user operation is that the finger of the user slides leftward or rightward on the status bar in the second user interface by a distance greater than or equal to a fourth distance threshold; the fourth user operation is that the finger of the user touches and holds the status bar in the second user interface for a time period greater than or equal to a fifth time threshold; or the fourth user operation is that the finger of the user slides downward by using the status bar in the second user interface as a start point, and when a distance by which the finger of the user slides downward is greater than a fifth distance threshold, the finger of the user stops sliding and stops touching the display.

With reference to the first aspect, in some embodiments, a distance by which the finger of the user slides downward is a distance between a lower edge of the status bar in the second user interface and the finger of the user; a fifth user operation is that the finger of the user slides downward on the display by using the status bar in the second user interface as a start point, when a distance by which the finger of the user slides downward is less than a fifth distance threshold, the finger of the user stops sliding and stops touching the display, and the fifth user operation is used to trigger the electronic device to display a system notification bar interface in full screen mode; the second user operation is that the finger of the user slides downward on the display by using the status bar in the second user interface as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to the fifth distance threshold and less than a sixth distance threshold, the finger of the user stops sliding and stops touching the display; the third user operation is that the finger of the user slides downward on the display by using the status bar in the second user interface as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to the sixth distance threshold and less than a seventh distance threshold, the finger of the user stops sliding and stops touching the display; and the fourth user operation is that the finger of the user slides downward on the display by using the status bar in the second user interface as a start point, and a distance by which the finger of the user slides downward reaches the seventh distance threshold; or the fourth user operation is that the finger of the user slides downward on the display by using the status bar in the second user interface as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to the seventh distance threshold, the finger of the user stops sliding and stops touching the display.

With reference to the first aspect, in some embodiments, a distance by which the finger of the user slides downward is a distance between a lower edge of the status bar in the second user interface and the finger of the user; the status bar in the second user interface is divided into two parts: a first preset area and a second preset area, and widths of the status bar, the first preset area, and the second preset area in the second user interface are the same; the second user operation is that the finger of the user slides downward on the display by using the first preset area as a start point, and when a distance by which the finger of the user slides downward is less than an eighth distance threshold, the finger of the user stops sliding and stops touching the display; the third user operation is that the finger of the user slides downward on the display by using the first preset area as a start point, and a distance by which the finger of the user slides downward reaches the eighth distance threshold; or the third user operation is that the finger of the user slides downward on the display by using the first preset area as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to the eighth distance threshold, the finger of the user stops sliding and stops touching the display; a fifth user operation is that the finger of the user slides downward on the display by using the second preset area as a start point, and when a distance by which the finger of the user slides downward is less than a fifth distance threshold, the finger of the user stops sliding and stops touching the display; and the fourth user operation is that the finger of the user slides downward on the display by using the second preset area as a start point, and a distance by which the finger of the user slides downward reaches the fifth distance threshold; or the fourth user operation is that the finger of the user slides downward on the display by using the second preset area as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to the fifth distance threshold, the finger of the user stops sliding and stops touching the display.

With reference to the first aspect, in some embodiments, the display of the electronic device is a notch screen or a hole-punch display, a notch of the notch screen or a small hole of the hole-punch display is located at a middle location of an upper edge of the display, and the status bar in the second user interface is divided into left and right parts by using the notch or the small hole as a division point; and the first preset area is a left half part of the status bar in the second user interface, and the second preset area is a right half part of the status bar in the second user interface; or the first preset area is a right half part of the status bar in the second user interface, and the second preset area is a left half part of the status bar in the second user interface.

With reference to the first aspect, in some embodiments, the display of the electronic device is a foldable screen, and the second user interface is divided into a first interface and a second interface by using a folding track of the foldable screen as a division line; and the first preset area is a status bar in the first interface, and the second preset area is a status bar in the second interface; or the first preset area is a status bar in the second interface, and the second preset area is a status bar in the first interface.

With reference to the first aspect, in some embodiments, the display of the electronic device is a hole-punch display, a small hole of the hole-punch display is located on the status bar in the second user interface, and that the electronic device receives a second user operation performed on a status bar in a second user interface includes: The electronic device receives a sixth user operation performed on the status bar in the second user interface, where the sixth user operation is that the finger of the user approaches the small hole in a floating manner. The electronic device displays a menu navigation window around the small hole in response to the sixth user operation, where the menu navigation window includes a first option control, and the first option control is used to trigger the electronic device to display the hidden floating window. The electronic device receives the second user operation, where the second user operation is that the finger of the user taps the first option control.

With reference to the first aspect, in some embodiments, the display of the electronic device is a hole-punch display, a small hole of the hole-punch display is located on the status bar in the second user interface, and that the electronic device receives a third user operation performed on the status bar in the second user interface includes: The electronic device receives a sixth user operation performed on the status bar in the second user interface, where the sixth user operation is that the finger of the user approaches the small hole in a floating manner. The electronic device displays a menu navigation window around the small hole in response to the sixth user operation, where the menu navigation window includes a second option control, and the second option control is used to trigger the electronic device to display, in full screen mode, the video call interface corresponding to the hidden floating window. The electronic device receives the third user operation, where the third user operation is that the finger of the user taps the second option control.

With reference to the first aspect, in some embodiments, the display of the electronic device is a hole-punch display, a small hole of the hole-punch display is located on the status bar in the second user interface, and that the electronic device receives a third user operation performed on the status bar in the second user interface includes: The electronic device receives a sixth user operation performed on the status bar in the second user interface, where the sixth user operation is that the finger of the user approaches the small hole in a floating manner. The electronic device displays a menu navigation window around the small hole in response to the sixth user operation, where the menu navigation window includes a third option control, and the third option control is used to trigger the electronic device to display, in full screen mode, the video call interface corresponding to the hidden floating window. The electronic device receives the fourth user operation, where the fourth user operation is that the finger of the user taps the third option control.

With reference to the first aspect, in some embodiments, before the electronic device hides the floating window in response to the first user operation, the method further includes: The electronic device displays prompt information on the display before the user drags the floating window to the status bar in the first user interface, where the prompt information is used to prompt that the user drags the floating window to the status bar to hide the floating window.

With reference to the first aspect, in some embodiments, that the electronic device displays prompt information on the display before the user drags the floating window to the status bar in the first user interface includes: The electronic device displays the prompt information on the display when the electronic device detects that a distance between the upper edge of the floating window and the lower edge of the status bar in the first user interface is less than or equal to a ninth distance threshold, and the finger of the user continues to drag the floating window upward.

With reference to the first aspect, in some embodiments, the prompt information may be an animation, a text, and/or a picture.

With reference to the first aspect, in some embodiments, after the electronic device hides the floating window, the method further includes: The electronic device displays identification information on a status bar on the display, where the identification information is used to identify the hidden floating window.

With reference to the first aspect, in some embodiments, the prompt information may be an animation, a text, and/or a picture.

According to a second aspect, this application provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, the one or more memories are configured to store computer program code, where the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs the floating window management method according to the first aspect.

According to a third aspect, this application provides a computer storage medium, including computer instructions. When the computer instructions are run on an electronic device, the electronic device is enabled to perform the floating window management method according to the first aspect.

According to a fourth aspect, this application provides a computer program product. When the computer program product runs on a computer, the computer is enabled to perform the floating window management method according to the first aspect.

According to this application, when displaying a floating window used for a video call, the electronic device may hide the floating window based on a user operation, and the electronic device may further re-invoke the hidden floating window based on a user operation. In addition, in the foregoing process, when the electronic device continuously keeps the video call, the floating window is prevented from blocking a user interface, to improve convenience of the user operation.

DESCRIPTION OF EMBODIMENTS

The following clearly describes technical solutions in the embodiments of this application in detail with reference to accompanying drawings. In descriptions of the embodiments of this application, unless otherwise stated, “/” indicates “or”. For example, A/B may indicate A or B. The term “and/or” in this specification merely describes an association relationship for describing associated objects, and indicates that three relationships may exist. For example, A and/or B may indicate the following three cases: Only A exists, both A and B exist, and only B exists. In addition, in the descriptions of the embodiments of this application, “a plurality of” means two or more.

The following first describes an electronic device in the embodiments of this application. A type of the described electronic device is not specifically limited in this application. The electronic device may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (personal digital assistant, PDA), a wearable device, or a laptop (laptop). An example embodiment of the portable electronic device includes but is not limited to a portable electronic device using iOS, Android, Microsoft, or another operating system. The portable electronic device may alternatively be another portable electronic device, for example, a laptop (laptop) with a touch-sensitive surface (for example, a touch panel). It should be further understood that, in some other embodiments of this application, the electronic device may alternatively be not a portable electronic device, but a desktop computer with a touch-sensitive surface (for example, a touch panel) or a smart television.

In this application, a display is disposed on the electronic device, and may be configured to display interface content currently output by a system of the electronic device. The interface content may include an interface of a running application, a system-level menu, and the like, and may specifically include the following interface elements: input interface elements, for example, a button (button), a text (text) input box, a scroll bar (scroll Bar), a menu (menu), and the like, and output interface elements, for example, a window (window) and a label (label).

In this application, the display may be configured to display both a first user interface and a floating window.

In a possible implementation, the floating window is stacked on the first user interface. Herein, when the display displays the first user interface and the floating window in a stacked manner, the floating window may be transparent. To be specific, a user may see some content in the first user interface in an area in which the floating window is located. The floating window may alternatively be opaque. To be specific, the user cannot see content in the first user interface in the area in which the floating window is located.

In another possible implementation, when the display displays the first user interface, an area in which the floating window is located on the display is not used to display the first user interface, but is used to display the floating window. In this implementation, when the display displays the floating window, the display may display a scaled-down first user interface, and the floating window does not block the first user interface.

In this application, a touch panel is disposed on the display of the electronic device. In other words, the display is a touchscreen, and may be configured to receive a touch operation of the user. The touch operation is an operation that the user directly contacts the display by using a body part or a stylus. In some optional embodiments, the touchscreen may be further configured to receive a floating touch operation of the user. The floating touch operation is an operation that a hand of the user is floated above the display and is not in contact with the display.

In some optional embodiments of this application, the touchscreen of the electronic device may receive a user operation used to trigger the electronic device to hide the floating window.

In some optional embodiments of this application, the touchscreen of the electronic device may further receive a user operation used to trigger the electronic device to invoke the hidden floating window.

In some optional embodiments of this application, the touchscreen of the electronic device may further receive a user operation used to trigger the electronic device to invoke the hidden floating window and display, in full screen mode, an application interface corresponding to the floating window.

FIG. 2Ais a schematic diagram of a structure of an example electronic device100according to an embodiment of this application.

It may be understood that the structure shown in this embodiment of this application does not constitute a specific limitation on the electronic device100. In some other embodiments of this application, the electronic device100may include more or fewer components than those shown in the figure, or combine some components, or split some components, or may have different component arrangements. The components shown in the figure may be implemented by using hardware, software, or a combination of software and hardware.

The GPIO interface may be configured by using software. The GPIO interface may be configured as a control signal or a data signal. In some embodiments, the GPIO interface may be configured to connect the processor110to the camera193, the display194, the wireless communications module160, the audio module170, the sensor module180, or the like. The GPIO interface may alternatively be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, or the like.

The USB port130is a port that conforms to a USB standard specification, and may be specifically a mini USB port, a micro USB port, a USB Type-C port, or the like. The USB port130may be configured to connect to a charger for charging the electronic device100, may be configured to transmit data between the electronic device100and a peripheral device, or may be configured to connect to a headset for playing audio through the headset. Alternatively, the port may be configured to connect to another electronic device, for example, an AR device.

A wireless communication function of the electronic device100may be implemented through the antenna1, the antenna2, the mobile communications module150, the wireless communications module160, the modem processor, the baseband processor, and the like.

In some embodiments of this application, the display194displays interface content currently output by a system. For example, the interface content is an interface provided by an instant messaging application.

The electronic device100may implement a photographing function through the ISP, the camera193, the video codec, the GPU, the display194, the application processor, and the like.

The electronic device100may implement audio functions, for example, music playing and recording, by using the audio module170, the speaker170A, the receiver170B, the microphone170C, the headset jack170D, the application processor, and the like.

The audio module170is configured to convert digital audio information into an analog audio signal output, and is also configured to convert an analog audio input into a digital audio signal. The audio module170may be further configured to: code and decode an audio signal. In some embodiments, the audio module170may be disposed in the processor110, or some functional modules of the audio module170are disposed in the processor110.

The speaker170A, also referred to as a “horn”, is configured to convert an audio electrical signal into a sound signal. The electronic device100may be configured to listen to music or answer a call in a hands-free mode over the speaker170A.

The pressure sensor180A is configured to sense a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor180A may be disposed on the display194. In some optional embodiments of this application, the pressure sensor180A may be configured to: capture a pressure value generated when a finger part of the user contacts the display, and transmit the pressure value to the processor, so that the processor identifies a finger part through which the user enters the user operation.

There are a plurality of types of pressure sensors180A, for example, a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor. The capacitive pressure sensor may include at least two parallel plates made of conductive materials. When a force is applied to the pressure sensor180A, capacitance between electrodes changes. The electronic device100determines pressure intensity based on a capacitance change. When a touch operation is performed on the display194, the electronic device100detects intensity of the touch operation by using the pressure sensor180A. The electronic device100may calculate a touch location based on a detection signal of the pressure sensor180A. In some embodiments, touch operations that are performed at a same touch location but have different touch operation intensity may correspond to different operation instructions. For example, when a touch operation whose touch operation intensity is less than a first pressure threshold is performed on a Messages icon, an instruction for viewing an SMS message is executed. When a touch operation whose touch operation intensity is greater than or equal to the first pressure threshold is performed on a Messages icon, an instruction for creating an SMS message is executed. In some optional embodiments of this application, the pressure sensor180A may transmit a detected capacitance value to the processor, so that the processor identifies a finger part (a knuckle, a finger pad, or the like) through which the user enters a user operation. In some optional embodiments of this application, the pressure sensor180A may further calculate a quantity of touch points based on a detected signal, and transmit a calculated value to the processor, so that the processor identifies that the user enters a user operation through a single finger or a plurality of fingers.

The gyro sensor180B may be configured to determine a motion posture of the electronic device100. In some embodiments, an angular velocity of the electronic device100around three axes (namely, axes X, Y. and Z) may be determined by using the gyro sensor180B. The gyro sensor180B may be configured to perform image stabilization during photographing. For example, when a shutter is pressed, the gyro sensor180B detects an angle at which the electronic device100jitters, calculates, based on the angle, a distance for which a lens module needs to compensate, and allows the lens to cancel the jitter of the electronic device100through reverse motion, to implement image stabilization. The gyro sensor180B may be further used in a navigation scenario and a motion-sensing game scenario.

The barometric pressure sensor180C is configured to measure barometric pressure. In some embodiments, the electronic device100calculates an altitude based on a value of the barometric pressure measured by the barometric pressure sensor180C, to assist in positioning and navigation.

The magnetic sensor180D includes a Hall effect sensor. The electronic device100may detect opening and closing of a flip cover or a leather case by using the magnetic sensor180D. In some embodiments, when the electronic device100is a clamshell phone, the electronic device100may detect opening and closing of a flip cover by using the magnetic sensor180D. Further, a feature such as automatic unlocking upon opening of the flip cover is set based on a detected opening or closing state of the leather case or a detected opening or closing state of the flip cover.

The acceleration sensor180E may detect accelerations in various directions (usually on three axes) of the electronic device100, and may detect magnitude and a direction of gravity when the electronic device100is still. The acceleration sensor180E may be further configured to identify a posture of the electronic device, and is used in an application such as switching between landscape mode and portrait mode or a pedometer. In some optional embodiments of this application, the acceleration sensor180E may be configured to: capture an acceleration value generated when a finger part of the user contacts the display, and transmit the acceleration value to the processor, so that the processor identifies a finger part through which the user enters the user operation.

The distance sensor180F is configured to measure a distance. The electronic device100may measure the distance in an infrared manner or a laser manner. In some embodiments, in a photographing scenario, the electronic device100may measure a distance by using the distance sensor180F to implement quick focusing.

The optical proximity sensor180G may include, for example, a light-emitting diode (LED) and an optical detector such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The electronic device100emits infrared light by using the light-emitting diode. The electronic device100detects infrared reflected light from a nearby object by using the photodiode. When sufficient reflected light is detected, the electronic device100may determine that there is an object near the electronic device100. When insufficient reflected light is detected, the electronic device100may determine that there is no object near the electronic device100. The electronic device100may detect, by using the optical proximity sensor, that the user holds the electronic device100close to an ear to make a call, to automatically perform screen-off for power saving. The optical proximity sensor180G may also be used in a leather case mode or a pocket mode to automatically unlock or lock a screen.

The fingerprint sensor180H is configured to collect a fingerprint. The electronic device100may use a feature of the collected fingerprint to implement fingerprint-based unlocking, application lock access, fingerprint-based photographing, fingerprint-based call answering, and the like.

The temperature sensor180J is configured to detect a temperature. In some embodiments, the electronic device100executes a temperature processing policy based on the temperature detected by the temperature sensor180J. For example, when the temperature reported by the temperature sensor1803exceeds a threshold, the electronic device100lowers performance of a processor located near the temperature sensor180J, to reduce power consumption to implement thermal protection. In some other embodiments, when the temperature is less than another threshold, the electronic device100heats the battery142to prevent the electronic device100from being shut down abnormally due to a low temperature. In some other embodiments, when the temperature is less than still another threshold, the electronic device100boosts an output voltage of the battery142, to avoid abnormal shutdown due to a low temperature.

The touch sensor180K is also referred to as a “touch panel”. The touch sensor180K may be disposed on the display194, and the touch sensor180K and the display194form a touchscreen, which is also referred to as a “touchscreen”. The touch sensor180K is configured to detect a touch operation performed on or near the touch sensor180K. The touch operation is an operation that the user contacts the display194by using a hand, an elbow, a stylus, or the like. The touch sensor may transfer the detected touch operation to the application processor, to determine a type of a touch event. The display194may provide a visual output related to the touch operation. In some other embodiments, the touch sensor180K may alternatively be disposed on a surface of the electronic device100at a location different from a location of the display194.

The motor191may generate a vibration prompt. The motor191may be configured to produce an incoming call vibration prompt and a touch vibration feedback. For example, touch operations performed on different applications (for example, photographing and audio playing) may correspond to different vibration feedback effects. The motor191may also correspond to different vibration feedback effects for touch operations performed on different areas of the display194. Different application scenarios (for example, a time reminder scenario, an information receiving scenario, an alarm clock scenario, and a game scenario) may also correspond to different vibration feedback effects. A touch vibration feedback effect may be further customized.

The SIM card interface195is configured to connect to a SIM card. The SIM card may be inserted into the SIM card interface195or removed from the SIM card interface195, to implement contact with or separation from the electronic device100. The electronic device100may support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface195may support a nano-SIM card, a micro-SIM card, a SIM card, and the like. A plurality of cards may be simultaneously inserted into a same SIM card interface195. The plurality of cards may be of a same type or of different types. The SIM card interface195may be compatible with different types of SIM cards. The SIM card interface195may also be compatible with an external storage card. The electronic device100interacts with a network through the SIM card, to implement functions such as calling and data communication. In some embodiments, the electronic device100uses an eSIM, namely, an embedded SIM card. The eSIM card may be embedded into the electronic device100and cannot be separated from the electronic device100.

A software system of the electronic device100may use a layered architecture, an event-driven architecture, a microkernel architecture, a micro service architecture, or a cloud architecture. In an embodiment of this application, an Android system with a layered architecture is used as an example to describe a software structure of the electronic device100.

FIG. 2Bis a block diagram of the software structure of the electronic device100according to an embodiment of this application.

In this application, a floating launcher (floating launcher) may be further added to the application layer, is used as a default display application in the foregoing floating window, and is provided for the user to enter another application.

As shown inFIG. 2B, the application framework layer may include a window manager (window manager), a content provider, a view system, a phone manager, a resource manager, a notification manager, an activity manager (activity manager), and the like.

The window manager is configured to manage a window program. The window manager may obtain a size of the display, determine whether there is a status bar, lock the display, take a screenshot of the display, and the like. In this application, FloatingWindow may be extended based on native PhoneWindow of Android, and is dedicated to displaying the foregoing floating window, so as to distinguish the floating window from a common window. The window has an attribute of being displayed on a top layer of a series of windows in a floating manner. In some optional embodiments, a proper value of a size of the window may be given based on an actual size of a screen according to an optimal display algorithm. In some possible embodiments, an aspect ratio of the window may be considered as an aspect ratio of a screen of a conventional mainstream mobile phone by default. In addition, to help the user close and hide the floating window, an extra close button and an extra minimize button may be drawn in an upper right corner.

The content provider is configured to: store and obtain data, and enable the data to be accessed by an application. The data may include a video, an image, audio, calls that are made and received, a browsing history and bookmarks, an address book, and the like.

The view system includes visual controls, such as a control for displaying a text and a control for displaying a picture. The view system may be configured to construct an application. A display interface may include one or more views. For example, a display interface including an SMS message notification icon may include a text display view and a picture display view. In this application, a key view used for operations such as closing and minimization may be correspondingly added to the floating window, and bound to FloatingWindow in the window manager.

The phone manager is configured to provide a communication function of the electronic device100, for example, management of a call status (including answering or declining a call).

The resource manager provides various resources for an application, such as a localized character string, an icon, a picture, a layout file, and a video file.

The notification manager enables an application to display notification information in a status bar207, and may be configured to convey a notification message. The notification message may automatically disappear after a short pause without user interaction. For example, the notification manager is configured to provide notifications of download completing, a message prompt, and the like. The notification manager may alternatively be a notification that appears in a top status bar of the system in a form of a graph or a scroll bar text, for example, a notification of an application running in the background, or may be a notification that appears on the display in a form of a dialog window. For example, text information is displayed in the status bar, an alert sound is played, the electronic device vibrates, or the indicator light blinks.

The activity manager is configured to manage activities that are running in the system, including a process (process), an application, a service (service), task (task) information, and the like. In this application, an activity task stack dedicated to managing an activity of an application displayed in the floating window may be newly added to the activity manager module, to ensure that the activity and a task of the application in the floating window do not conflict with an application displayed on the screen in full screen mode.

In this application, a motion detector (motion detector) may be further added to the application framework layer, to perform logical determining on an obtained input event and identify a type of the input event. For example, the motion detector determines, based on information such as touch coordinates and a timestamp of a touch operation included in the input event, that the input event is a knuckle touch event, a finger pad touch event, or the like. In addition, the motion detector may further record a track of the input event, determine a gesture rule of the input event, and respond to different operations based on different gestures.

The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

The core library includes two parts: a function that needs to be invoked in Java language and a core library of Android.

The system library may include a plurality of functional modules, for example, an input manager (input manager), an input dispatcher (input dispatcher), a surface manager (surface manager), a media library (Media Library), a three-dimensional graphics processing library (for example, OpenGL ES), and a 2D graphics engine (for example, SGL).

The input manager is responsible for obtaining event data from an underlying input driver, parsing and encapsulating the event data, and sending the event data to the input dispatcher.

The input dispatcher is configured to store window information. After receiving an input event from the input manager, the input dispatcher searches windows stored by the input dispatcher for a proper window, and dispatches the event to the window.

The 2D graphics engine is a drawing engine for 2D drawing.

The following describes examples of working procedures of software and hardware of the electronic device100with reference to a photographing scenario.

When the touch sensor180K receives a touch operation, a corresponding hardware interruption is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including information such as touch coordinates and a timestamp of the touch operation). The original input event is stored at the kernel layer. The application framework layer obtains the original input event from the kernel layer, and identifies a control corresponding to the input event. For example, the touch operation is a single-tap touch operation and a control corresponding to the single-tap operation is a control of a camera application icon. A camera application invokes an interface at the application framework layer, so that the camera application is opened. Then, a camera driver is started by invoking the kernel layer, and a static image or a video is captured by using the camera193.

The following describes examples of working procedures of software and hardware of the electronic device100with reference to a floating window management method in this application.

Refer toFIG. 2C-1andFIG. 2C-2. A kernel, a Native framework, a Java framework, a SystemServer process, and an application process inFIG. 2C-1andFIG. 2C-2respectively correspond to the kernel layer, the system library, the application framework layer, and the application layer inFIG. 2B.

When the touch sensor180K receives a touch operation, a corresponding hardware interruption is sent to the kernel layer. The kernel layer processes the touch operation into an original input event, that is, /dev/input/event* inFIG. 2C-2. The original input time includes information such as touch coordinates and a timestamp of the touch operation.

The original input event is stored at the kernel layer. The input manager (input manager) of the system library obtains an original input event from the kernel layer, parses and encapsulates the original input event, and sends the original input event to the input dispatcher (input dispatcher). After receiving an input event from the input manager, the input dispatcher dispatches the input event to a proper window.

The motion detector (motion detector) at the application framework layer obtains the encapsulated input event from the input manager and performs logical determining on the event. For example, the touch operation received by the touch sensor180K is that a finger of the user slides on the display to drag the floating window to an area in which the status bar is located. The motion detector may determine, based on a pressure value of the display, a capacitance value, touch coordinates, a location of the floating window, and the like in the input event, that the input event is that the user drags the floating window to the area in which the status bar is located. If a logical determining result conforms to a gesture of hiding the floating window, a launcher of hiding the floating window is invoked to stop displaying the floating window on interface content currently output on the display.

A video call scenario is used as an example. The following first describes some user interfaces in a video call scenario implemented on the electronic device100according to an embodiment of this application.

For example, as shown inFIG. 3, the display194of the electronic device100displays interface content20currently output by the system, and the interface content20is a video call interface. In this application, a touch panel is disposed on the display194, and may be configured to receive a touch operation of the user. The touch operation is an operation that the user contacts the display194by using a hand, an elbow, a stylus, or the like.

FIG. 3shows a user interface used for a video call. The user interface is a video call interface provided by WeChat. In addition, the user interface may alternatively be an interface provided by another application for a video call, and the another application may be, for example, instant messaging software such as QQ, FaceTime of Apple, or MSN.

As shown inFIG. 3, a user interface20used for a video call may include a video display area201, a window switching control202, a hang-up control203, a camera switching control204, a voice switching control205, a window scale-down control206, a status bar207, a navigation bar208, and a call duration indicator209. An electronic device used by a local user is the electronic device100.

The video display area201is configured to display an image collected by a camera of an electronic device (or the electronic device100) of a video contact.

The window switching control202is configured to display an image collected by a camera of the electronic device100(or the electronic device of the video contact), and may also be configured to switch a video window. When the electronic device100may detect a touch operation performed on the window switching control202(for example, a tap operation on the window switching control202), in response to the operation, the electronic device100may switch an image displayed in the video display area201and an image displayed in the window switching control202.

For example, if the video display area201displays the image collected by the camera of the electronic device of the video contact, the window switching control202displays the image collected by the camera193of the electronic device100. After the electronic device100detects the touch operation performed on the window switching control202, in response to the operation, the electronic device100switches content displayed in the video display area201to the image collected by the camera193of the electronic device100, and simultaneously switches content displayed in the window switching control202to the image collected by the camera of the electronic device of the video contact.

Conversely, if the video display area201displays the image collected by the camera193of the electronic device100, the window switching control202displays the image collected by the camera of the electronic device of the video contact. After the electronic device100detects the touch operation performed on the window switching control202, in response to the operation, the electronic device100switches content displayed in the video display area201to the image collected by the camera of the electronic device of the video contact, and simultaneously switches content displayed in the window switching control202to the image collected by the camera193of the electronic device100.

The hang-up control203is configured to disconnect the video call. When the electronic device100may detect a touch operation performed on the hang-up control203(for example, a tap operation on the hang-up control203), the electronic device100may disconnect the video call in response to the operation.

The camera switching control204is configured to switch between cameras. When the electronic device100may detect a touch operation performed on the camera switching control204(for example, a tap operation on the camera switching control204), the electronic device100may switch between cameras in response to the operation. For example, the camera of the electronic device100is switched from a front-facing camera to a rear-facing camera, or the camera of the electronic device100is switched from a rear-facing camera to a front-facing camera.

The voice switching control205is configured to switch the video call to a voice call. When the electronic device100may detect a touch operation performed on the voice switching control205(for example, a tap operation on the voice switching control205), in response to the operation, the electronic device100may switch the video call to a voice call, and turn off the camera193.

The window scale-down control206is configured to scale down a window. When the electronic device100may detect a touch operation performed on the window scale-down control206(for example, a tap operation on the window scale-down control206), in response to the operation, the electronic device100may scale down a current video window to obtain a floating window, display the floating window at a preset location on the display, and display, in the scaled-down window, the image collected by the camera of the electronic device of the video contact.

The floating window is used to display the image collected by the camera of the electronic device100(and/or the electronic device of the video contact), and may also be used to switch a current user interface to a video call interface. When the electronic device100may detect a touch operation performed on the floating window (for example, a tap operation on the floating window), in response to the operation, the electronic device100may scale up the floating window to obtain the video call interface.

The status bar207may include one or more signal strength indicators207A of a mobile communications signal (also referred to as a cellular signal), an operator name (for example, “China Mobile”)207B, one or more signal strength indicators207C of a wireless fidelity (wireless fidelity, Wi-Fi) signal, a battery status indicator207D, and a time indicator207E.

The navigation bar208may include system navigation buttons such as a return button208A, a home screen (Home screen) button208B, and a historical call-out task button208C. A home screen is an interface displayed by the electronic device100after a user operation performed on the home screen button208B is detected in any user interface. When the electronic device100detects a touch operation performed on the return button208A, the electronic device100may display a previous user interface of a current user interface. When the electronic device100detects a touch operation performed on the home screen button208B, the electronic device100may display the home screen. When the electronic device100detects a touch operation performed on the historical call-out task button208C, the electronic device100may display a task last opened by the user. Each navigation button may have another name. For example,208A may be referred to as a back button,208B may be referred to as a home button, and208C may be referred to as a menu button. This is not limited in this application. The navigation buttons in the navigation bar208are not limited to virtual buttons, and may also be implemented as physical buttons. In some possible embodiments, the system navigation buttons such as the return button208A, the home screen (Home screen) button208B, or the historical call-out task button208C may also be referred to as a second control.

The call duration indicator209is used to indicate duration of a current video call.

For example, as shown inFIG. 4AandFIG. 4B, when the electronic device100detects a tap operation performed on the window scale-down control206, in response to the operation, the electronic device100displays both a chat interface21of a video contact and a floating window22on the display. The floating window22is displayed in the chat interface21of the video contact in a floating manner, and the floating window22displays an image collected by a camera of an electronic device of the video contact.

As shown inFIG. 4B, the chat interface21of the video contact may include a contact identifier301, an exit control302, an input box303, a voice trigger control304, an add control305, a status bar306, and a navigation bar307.

The contact identifier301is used to indicate an identity of a current call object.

The exit control302may be configured to exit a current user interface. When the electronic device100may detect a touch operation performed on the exit control302(for example, a tap operation on the exit control302), the electronic device100may exit the current user interface in response to the operation.

The input box303may be configured to input chat content, where the chat content may include a text, an emoticon, a picture, and the like. When the electronic device100may detect a touch operation performed on the input box303(for example, a tap operation on the input box303), the electronic device100may display an input keyboard in response to the operation.

The voice trigger control304may be configured to invoke a voice input control. When the electronic device100may detect a touch operation performed on the voice trigger control304(for example, a tap operation on the voice trigger control304), the electronic device100may display the voice input control in response to the operation. The user can tap (or touch and hold) the voice input control to input and send a voice.

The status bar306is the same as the status bar207in the user interface20. Details are not described herein.

The navigation bar307is the same as the status bar207in the user interface20. Details are not described herein.

For example, as shown inFIG. 4CandFIG. 4D, the current user interface is a user interface23used for a video call. When the electronic device100detects a tap operation performed on the return button208A, in response to the operation, the electronic device100displays a previous user interface of the user interface20, that is, a contact list interface23, displays a floating window22at a preset location on the display, and displays a video image in the video display area201in the floating window22, that is, the image collected by the camera of the electronic device of the video contact.

As shown inFIG. 4D, the electronic device100may display the user interface23on the display in full screen mode. The user interface51may include an application title bar308, a control309, a search box310, a QQ mail alert311, subscriptions312, one or more contact chat bars such as313A to313E, a menu314, a status bar315, and a navigation bar316.

The application title bar502may be used to indicate that a current page is used to display related interface information of the WeChat application.

The control309may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device100may display other controls, for example, Add contacts and New chat.

The one or more contact chat bars are used to display one or more chat records of one or more contacts. For example, the chat bar313A may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device100may display a chat interface of a contact corresponding to the chat bar313A. A latest chat time point is displayed on the chat bar313A.

The menu314includes a control314A, a control3114B, a control314C, and a control314D. Content displayed in the contact list interface23is related to a currently selected control in the menu314. As shown inFIG. 4D, in the current menu314, if the control314A is selected, the user interface51is configured to display the one or more chat records of the one or more contacts; if the control314B is selected, that is, when the control314B receives a user operation (for example, a touch operation), the electronic device100may display a WeChat friend list in response to the detected user operation; and if the control314C is selected, that is, when the control314C receives a user operation (for example, a touch operation), the electronic device100may display controls such as Moments and Scan in response to the detected user operation. If the control314D is selected, that is, when the control314D receives a user operation (for example, a touch operation), the electronic device100may display account information of the user in response to the detected user operation.

The status bar315is the same as the status bar207in the user interface20. Details are not described herein.

The navigation bar316is the same as the navigation bar208in the user interface20. Details are not described herein.

For example, as shown inFIG. 4EandFIG. 4F, the current user interface is the user interface20used for a video call. When the electronic device100detects a tap operation performed on the home screen button208B, in response to the operation, the electronic device100displays a home screen24, displays a floating window22on the home screen24, and displays a video image in the video display area201in the floating window22, that is, the image collected by the camera of the electronic device of the video contact.

As shown inFIG. 4F, the home screen24may further include a calendar indicator317, a weather indicator318, a tray319having frequently used application icons, a page indicator320, a status bar321, and a navigation bar322.

The calendar indicator317may be used to indicate current time, for example, a date, a day of a week, and hour-minute information.

The weather indicator318may be used to indicate a weather type, for example, Clouds Early/Clearing Late or Light Rain, and may be further used to indicate information such as a temperature.

The tray319having the frequently used application icons may display a Phone icon319A, a Contacts icon319B, a Messages icon319C, and a Camera icon319D.

For example, other application icons may include a WeChat (WeChat) icon323, a QQ icon324, a Mail icon325, a Cloud sharing icon326, a Memo icon327, and an Alipay icon328. The home screen24may further include a page indicator329. The other application icons may be distributed on a plurality of pages, and the page indicator213may be used to indicate a specific page on which an application is currently browsed by the user. The user may swipe left or right in an area of other application icons to browse application icons on other pages.

The status bar321is the same as the status bar321in the user interface20. Details are not described herein.

The navigation bar322is the same as the navigation bar208in the user interface20. Details are not described herein.

According to the floating window management method provided in this application, a currently displayed floating window may be hidden, and the hidden floating window may be re-invoked.

A video call scenario is used as an example. The following describes a video call scenario and an embodiment of a user interface in the video call scenario in the embodiments of this application.

As shown inFIG. 3, in the specific application scenario, when making a video call, the user may tap the window scale-down control206, the return button208A, or the home screen button208B in the video call interface20, so that the electronic device100exits the current video call interface20, displays the floating window22on the display194, and displays, in the floating window, the image collected by the camera of the electronic device (or the electronic device100) of the video contact. From a perspective of a display effect, the electronic device100scales down a video call window to obtain the floating window22used for the video call. Based on a requirement of the user, in this embodiment of this application, the floating window22may be hidden, to prevent the floating window22from blocking other interface content, so as to prevent the floating window22from affecting a user operation on the other interface content. In addition, the user expects the floating window22to keep running in the background, so that the user can re-invoke the floating window22.

In this application, the floating window22is movable. When the electronic device100detects a drag operation performed on the floating window22, the electronic device100moves a location of the floating window22on the display194in response to the operation. The drag operation may be that a finger of the user slides on the display194, and a sliding start point is in the floating window22. As shown inFIG. 5AandFIG. 5B, in a movement process of the floating window22, a relative location between a finger of the user and the floating window remains unchanged.

In this application, movement of the floating window22on the home screen24includes the following two cases.

Case 1: The floating window and the status bar on the display194of the electronic device100cannot be displayed in an overlapping manner. As shown inFIG. 5A,FIG. 5B, andFIG. 5C, the finger of the user slides on the display194to drag the floating window22to move upward. When an upper edge of the floating window22coincides with a lower edge of the status bar321, if the finger of the user continues to slide upward on the display194, the floating window22cannot continue to move upward, that is, a vertical location of the floating window22remains unchanged. In this application, that the upper edge of the floating window22coincides with the lower edge of the status bar321means that a distance between the upper edge of the floating window22and the lower edge of the status bar321is 0, or means that a distance between the upper edge of the floating window22and the lower edge of the status bar321is less than or equal to a minimum. For example, the minimum is equal to 0.1 mm.

Case 2: The floating window and the status bar on the display194of the electronic device100may be displayed in an overlapping manner, and after an upper edge of the floating window22coincides with an upper edge of the status bar321, the floating window22cannot continue to move upward. As shown inFIG. 5D,FIG. 5E, andFIG. 5F, the finger of the user slides on the display194to drag the floating window22to move upward. When the upper edge of the floating window22coincides with the lower edge of the status bar321, if the finger of the user continues to slide upward on the display194, the floating window22continues to move upward. After the upper edge of the floating window22coincides with an upper edge of the home screen24, if the finger of the user continues to slide upward on the display194, the floating window22cannot continue to move upward, that is, a vertical location of the floating window22remains unchanged, and a relative location between the finger of the user and the floating window changes. In this application, that the upper edge of the floating window22coincides with the upper edge of the status bar321means that a distance between the upper edge of the floating window22and the upper edge of the status bar321is 0, or means that a distance between the upper edge of the floating window22and the upper edge of the status bar321is less than or equal to a minimum. For example, the minimum is equal to 0.1 mm.

Case 3: The floating window and the status bar on the display194of the electronic device100may be displayed in an overlapping manner, and after an upper edge of the floating window22coincides with an upper edge of the status bar321, the floating window22may continue to move upward. As shown inFIG. 5G,FIG. 5H, andFIG. 5I, the finger of the user slides on the display194to drag the floating window22to move upward. When the upper edge of the floating window22coincides with the upper edge of the status bar321, if the finger of the user continues to slide upward on the display194, the floating window22continues to move upward, and a relative location between the finger of the user and the floating window remains unchanged.

In addition to the foregoing three cases, the movement process of the floating window22on the home screen24may further include another case. For example, after an upper edge of the floating window22coincides with a lower edge of the status bar321, if the finger of the user continues to slide upward on the display194, a form of a contact edge between the floating window22and the status bar321may be changed. A process of changing the form may be presented in a form of various animation effects. This is not specifically limited herein.

Detailed descriptions are provided below from the following two aspects.

Aspect 1: How to hide the floating window22.

The floating window22inFIG. 4Fis used as an example. An operation used to hide the floating window22may be referred to as a first user operation. When the user expects to hide the floating window22, the user performs the first user operation. In response to the first user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. The first user operation may be that the finger of the user slides on the display194, to drag the floating window22to an area in which the status bar321is located. As shown inFIG. 6A, a sliding start point of the finger of the user in the first user operation is in an area in which the floating window22is located, and a sliding trend of the finger of the user in the first user operation is toward the top of the home screen24.

A finger pad of the finger of the user slides on the display194, to drag the floating window22to the area in which the status bar321is located. In addition, in some embodiments of this application, the user may further slide on the display194by using another body part or a tool, to drag the floating window22to the area in which the status bar321is located. For example, the user may drag the floating window22by using a fingertip, a finger pad, an elbow, a stylus, or the like. This is not limited herein. For example, as shown inFIG. 6B, the user may slide on the display194by using a knuckle, to drag the floating window22to the area in which the status bar321is located. For example, as shown inFIG. 6C, the user may further slide on the display194by using a stylus, to drag the floating window22to the area in which the status bar321is located.

In a specific implementation, when the finger of the user contacts the display194of the electronic device100, different finger parts such as a finger pad, a fingertip, and a knuckle may generate different vibration and/or acoustic effects, and generate corresponding signals (including a pressure value generated by the contact operation on the display194, a capacitance value, an acceleration value generated for the electronic device, and the like). The signals generated by the different finger parts may be captured by using a sensor (for example, a capacitive touchscreen, a pressure touchscreen, an acceleration sensor, an impact sensor, a vibration sensor, an acoustic sensor, a displacement sensor, or a speed sensor) of the electronic device100. Therefore, the electronic device100may identify, by using the captured signals, a finger part used by the user to touch the display194. Further, the electronic device100may detect touch point coordinates of a location at which the finger of the user touches the display194in real time in the sliding process and a location of the floating window, and identify an input touch operation based on changes of the touch point coordinates in the sliding process and the location of the floating window.

In this application, a user operation used to trigger the electronic device100to hide the floating window22may be preset by a system of the electronic device100, or may be set by the user based on an operation habit of the user.

For Case 1 and Case 2, the following separately describes the embodiment of the user interface in which the floating window22is hidden.

Based on Case 1, details are as follows:

The floating window and the status bar on the display194of the electronic device100cannot be displayed in an overlapping manner. The first user operation may be that the finger of the user slides on the display194, to drag the floating window22upward to the status bar321, and a first preset condition is met.

In some embodiments of this application, the first preset condition is that the upper edge of the floating window22coincides with the lower edge of the status bar321. The electronic device100hides the floating window22after the electronic device100detects that the upper edge of the floating window22coincides with the lower edge of the status bar321.

For example, as shown inFIG. 7AandFIG. 7B, the finger of the user slides on the display194, to drag the floating window30to move on the home screen24, until the upper edge of the floating window22coincides with the lower edge of the status bar321. A sliding start point of the finger of the user is in the area in which the floating window22is located. As shown inFIG. 7C, when the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window22, and the electronic device100keeps the floating window22running in the background. It may be understood that regardless of whether the user continues to touch the area in which the floating window22is located on the display194, the electronic device100may hide the floating window22provided that the electronic device100detects that the upper edge of the floating window22coincides with the lower edge of the status bar321.

In some embodiments of this application, the first preset condition is that the upper edge of the floating window22coincides with the lower edge of the status bar321, and the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194.

For example, as shown inFIG. 7DandFIG. 7E, the finger of the user slides on the display194, to drag the floating window30to move on the home screen24, until the upper edge of the floating window22coincides with the lower edge of the status bar321. A sliding start point of the finger of the user is in the area in which the floating window22is located. As shown inFIG. 7F, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. As shown inFIG. 7G, when the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window22, and the electronic device100keeps the floating window22running in the background.

In some embodiments of this application, the user operation that the finger of the user drags the floating window22to the area in which the status bar321is located may have the following two user intents:

User intent 1: The user performs a first user operation used to hide the floating window22. The first user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located, so that the upper edge of the floating window22coincides with the lower edge of the status bar321.

User intent 2: The user intends to change a location of the floating window30on the display194, so that the upper edge of the floating window22coincides with the lower edge of the status bar321, and the user does not expect to hide the floating window30.

In some embodiments of this application, different user operations are used to distinguish between the foregoing two user intents. In this application, a user operation used to implement the user intent 2 is referred to as a seventh user operation.

In some optional embodiments, the first preset condition of the first user operation may be that after the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to slide upward until a distance by which the finger of the user continues to slide upward reaches a first distance threshold. The first preset condition of the first user operation may alternatively be that after the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to slide upward, and when a distance by which the finger of the user continues to slide is greater than or equal to a first distance threshold, the finger of the user stops sliding and stops touching the display194. The electronic device100detects the first user operation, and the electronic device100determines that the first user operation is used to implement the user intent 1. In response to the first user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. The seventh user operation may be that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to slide upward, and when a distance by which the finger of the user continues to slide is less than a first distance threshold, the finger of the user stops sliding and stops touching the display194. The electronic device100detects the seventh user operation, and the electronic device100determines that the user operation is used to implement the user intent 2. Therefore, the electronic device100continues to display the floating window22. It may be understood that, in the seventh user operation, after the finger of the user drags the floating window22to the area in which the status bar321is located, the distance by which the finger of the user continues to slide upward may be equal to 0.

For example, the first distance threshold is equal to L1. As shown inFIG. 8AandFIG. 8B, the finger of the user slides on the display194, a sliding start point is in the floating window22, a sliding trend is sliding toward the top of the home screen, and the floating window22moves toward the status bar321as the finger of the user slides. As shown inFIG. 8C, after the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to slide upward. As shown inFIG. 8CandFIG. 8D, after the electronic device100detects that the distance by which the finger of the user continues to slide upward reaches L1, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background.

In some optional embodiments, the first preset condition of the first user operation may be that after the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to touch the area in which the floating window22is located on the display194until a time period for which the finger of the user continues to touch the area reaches a first time threshold. The first preset condition of the first user operation may alternatively be that after the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to touch the area in which the floating window22is located on the display194, and when a time period for which the finger of the user continues to touch the area is greater than or equal to a first time threshold, the finger of the user stops touching the area in which the floating window22is located on the display194. In the first user operation, in a period for which the finger of the user continues to touch the area in which the floating window22is located on the display194, a sliding trend of the finger of the user may be sliding stop, sliding upward, sliding leftward, or sliding rightward. The seventh user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to touch the area in which the floating window22is located on the display194, and when a time period for which the finger of the user continues to touch the area is less than or equal to a first time threshold, the finger of the user stops touching the area in which the floating window22is located on the display194. In the seventh user operation, in a period for which the finger of the user continues to touch the area in which the floating window22is located on the display194, a sliding trend of the finger of the user may be sliding stop, sliding upward, sliding leftward, or sliding rightward. It may be understood that, in the seventh user operation, after the upper edge of the floating window22coincides with the lower edge of the status bar321, a time period for which the finger of the user stops sliding and continues to touch the area in which the floating window22is located on the display194may be equal to 0.

Based on Case 2, details are as follows:

The floating window and the status bar on the display194of the electronic device100may be displayed in an overlapping manner, and after the upper edge of the floating window22coincides with the upper edge of the status bar321, the floating window22cannot continue to move upward. The first user operation is that the finger of the user slides on the display194, to drag the floating window22upward to the status bar321, and a second preset condition is met.

In this application, the width of the status bar is a first width value.

In some embodiments of this application, the second preset condition may be that a distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value. It may be understood that the finger of the user drags the floating window22upward. After the upper edge of the floating window22coincides with a lower edge of the status bar321, if the electronic device100detects that a distance by which the floating window22moves upward is greater than 0, the electronic device100hides the floating window22.

For example, as shown inFIG. 9AandFIG. 9B, the finger of the user slides on the display194, to drag the floating window30to move on the home screen24. A sliding start point of the finger of the user is in the area in which the floating window22is located. As shown inFIG. 9C, after the upper edge of the floating window22coincides with the lower edge of the status bar321, the finger of the user continues to drag the floating window22upward, and the floating window continues to move upward as the finger of the user slides. If the electronic device100detects that the distance by which the floating window22continues to move upward is greater than 0, in response to the user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. It may be understood that regardless of whether the user continues to touch the area in which the floating window22is located on the display194, the electronic device100hides the floating window22provided that the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value.

In some embodiments of this application, the second preset condition may be that when the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194.

For example, as shown inFIG. 9DandFIG. 9E, the finger of the user slides on the display194, to drag the floating window22to move on the home screen24, until the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value. A sliding start point of the finger of the user is in the area in which the floating window22is located. As shown inFIG. 9F, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. As shown inFIG. 9G, when the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window22, and the electronic device100keeps the floating window22running in the background.

In some embodiments of this application, based on Case 2, the user operation that the finger of the user drags the floating window22to the area in which the status bar321is located may alternatively have the following two user intents:

User intent 3: The user performs a first user operation used to hide the floating window22. The first user operation may be that the finger of the user drags the floating window22to the area in which the status bar321is located, so that the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value.

User intent 4: The user intends to change a location of the floating window30in the user interface50, so that the distance between an upper edge of the floating window22and the upper edge of the status bar321is less than the first width value, and the user does not expect to hide the floating window30.

In some embodiments of this application, different user operations are used to distinguish between the foregoing two user intents. In this application, a user operation used to implement the user intent 4 is referred to as an eighth user operation.

In some optional embodiments, the second preset condition of the first user operation may be that when the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value, the finger of the user stops sliding and continues to touch the area in which the floating window22is located on the display194until a time period for which the finger of the user continues to touch the area reaches a second time threshold. The electronic device100detects the first user operation, and the electronic device100determines that the first user operation is used to implement the user intent 3. In response to the first user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. The second preset condition of the first user operation may alternatively be that when the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value, the finger of the user stops sliding and continues to touch the area in which the floating window22is located on the display194, and when a time period for which the finger of the user continues to touch the area is greater than or equal to a second time threshold, the finger of the user stops touching the area in which the floating window22is located on the display194. The eighth user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. When the distance between the upper edge of the floating window22and the upper edge of the status bar321is less than the first width value, the finger of the user stops sliding and continues to touch the area in which the floating window22is located on the display194, and when a time period for which the finger of the user continues to touch the area is less than a second time threshold, the finger of the user stops touching the area in which the floating window22is located on the display194. The electronic device100detects the eighth user operation, and the electronic device100determines that the eighth user operation is used to implement the user intent 2. Therefore, the electronic device100continues to display the floating window22. It may be understood that, in the eighth user operation, the time period for which the finger of the user continues to touch the area in which the floating window22is located on the display194may be equal to 0.

In some embodiments of this application, based on Case 2, the user operation that the finger of the user drags the floating window22to the area in which the status bar321is located may alternatively have the following two user intents:

User intent 5: The user performs a first user operation used to hide the floating window22. The first user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located, so that the upper edge of the floating window22coincides with the upper edge of the status bar321.

User intent 6: The user intends to change a location of the floating window30on the display194, so that the upper edge of the floating window22coincides with the upper edge of the status bar321, and the user does not expect to hide the floating window30.

In this application, that the upper edge of the floating window22coincides with the upper edge of the status bar321means that a distance between the upper edge of the floating window22and the upper edge of the status bar321is 0, or means that a distance between the upper edge of the floating window22and the upper edge of the status bar321is less than a minimum. For example, the minimum is equal to 0.1 mm.

In some embodiments of this application, different user operations are used to distinguish between the foregoing two user intents. In this application, a user operation used to implement the user intent 6 is referred to as a ninth user operation.

In some optional embodiments, the second preset condition of the first user operation may be that after the upper edge of the floating window22coincides with the upper edge of the status bar321, a distance by which the finger of the user continues to slide upward reaches a second distance threshold. The second preset condition of the first user operation may alternatively be that when the finger of the user drags the floating window22to the area in which the status bar321is located, after the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to slide upward, and when a distance by which the finger of the user continues to slide upward is greater than or equal to a second distance threshold, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. The electronic device100detects the first user operation, and the electronic device100determines that the first user operation is used to implement the user intent 5. In response to the first user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. The ninth user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to slide upward, and when a distance by which the finger of the user continues to slide upward is less than a second distance threshold, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. The electronic device100detects the ninth user operation, and the electronic device100determines that the ninth user operation is used to implement the user intent 6. Therefore, the electronic device100continues to display the floating window22. It may be understood that, in the ninth user operation, after the upper edge of the floating window22coincides with the upper edge of the status bar321, the distance by which the finger of the user continues to slide upward may be equal to 0.

For example, as shown inFIG. 10AandFIG. 10B, the finger of the user slides on the display194, a sliding start point is in the floating window22, a sliding trend is sliding toward the top of the home screen, and the floating window22moves toward the status bar321as the finger of the user slides. The second distance threshold is equal to L2. As shown inFIG. 10C, after the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to slide upward. As shown inFIG. 10D, after the electronic device100detects that the distance by which the finger of the user continues to slide upward reaches L2, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. For example, after the user operation shown inFIG. 9AandFIG. 9B, the finger of the user continues to slide upward. As shown inFIG. 9EandFIG. 9F, after the finger of the user continues to slide upward by S1, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194, where S1is less than the second distance threshold L2. When the electronic device100detects the user operation, in response to the user operation, the electronic device100continues to display the floating window22. As shown inFIG. 10EandFIG. 10F, a vertical location of the floating window22remains unchanged.

In some optional embodiments, the second preset condition of the first user operation may be that after the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to touch the area in which the floating window22is located on the display194until a time period for which the finger of the user continues to touch the area reaches a third time threshold. The second preset condition of the first user operation may alternatively be that after the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to touch the area in which the floating window22is located on the display194, and when a time period for which the user continues to touch the area is greater than or equal to a third time threshold, the finger of the user stops touching the area in which the floating window22is located on the display194. In the first user operation, in a period for which the finger of the user continues to touch the area in which the floating window22is located on the display194, a sliding trend of the finger of the user may be sliding stop, sliding upward, sliding leftward, or sliding rightward. The ninth user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to touch the area in which the floating window22is located on the display194, and when a time period for which the user continues to touch the area is less than a third time threshold, the finger of the user stops touching the area in which the floating window22is located on the display194. In the ninth user operation, in a period for which the finger of the user continues to touch the area in which the floating window22is located on the display194, a sliding trend of the finger of the user may be sliding stop, sliding upward, sliding leftward, or sliding rightward. It may be understood that, in the ninth user operation, after the upper edge of the floating window22coincides with the upper edge of the status bar321, the time period for which the finger of the user continues to touch the area in which the floating window22is located on the display194may be equal to 0.

Based on Case 3, details are as follows:

The floating window and the status bar on the display194of the electronic device100may be displayed in an overlapping manner, and after the upper edge of the floating window22coincides with the upper edge of the status bar321, the floating window22may continue to move upward. The first user operation is that the finger of the user slides on the display194, to drag the floating window22upward to the status bar321, and a third preset condition is met.

In some embodiments of this application, the current height of the floating window22is a first height value. The third preset condition is that a distance between a lower edge of the floating window22and the upper edge of the status bar321is less than the first height value. It may be understood that the finger of the user drags the floating window22upward. After the upper edge of the floating window22coincides with the upper edge of the status bar321, if the electronic device100detects that the floating window22continues to move upward, the electronic device100hides the floating window22.

In some embodiments of this application, the third preset condition may be that when the distance between the lower edge of the floating window22and the upper edge of the status bar321is less than the first height value, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194.

For example, a value of the first height value is K1. As shown inFIG. 11AandFIG. 11B, the finger of the user slides on the display194, to drag the floating window22to move on the home screen24. As shown inFIG. 11C, when the distance between the lower edge of the floating window22and the upper edge of the status bar321is less than the first height value, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. As shown inFIG. 11D, when the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window22, and the electronic device100keeps the floating window22running in the background.

In some embodiments of this application, based on Case 3, the user operation that the finger of the user drags the floating window22to the area in which the status bar321is located may alternatively have the following two user intents:

User intent 7: The user performs a first user operation used to hide the floating window22. The first user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located, so that the distance between the lower edge of the floating window22and the lower edge of the status bar321is less than the first height value.

User intent 8: The user intends to change a location of the floating window22on the display194, so that the distance between the lower edge of the floating window22and the lower edge of the status bar321is less than the first height value, and the user does not expect to hide the floating window22.

In some embodiments of this application, different user operations are used to distinguish between the foregoing two user intents. In this application, a user operation used to implement the user intent 8 is referred to as a tenth user operation.

In some optional embodiments, the third preset condition of the first user operation may be that a distance between the lower edge of the floating window22and the upper edge of the status bar321reaches a third distance threshold, where the third distance threshold is less than the first height value. The third preset condition of the first user operation may alternatively be that when a distance between the lower edge of the floating window22and the upper edge of the status bar321is less than a third distance threshold, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. The electronic device100detects the first user operation, and the electronic device100determines that the first user operation is used to implement the user intent 7. In response to the first user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. The tenth user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. When a distance between the lower edge of the floating window22and the upper edge of the status bar321is less than the first height value and greater than the third distance threshold, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. The electronic device100detects the tenth user operation, and the electronic device100determines that the tenth user operation is used to implement the user intent 8. Therefore, the electronic device100continues to display the floating window22.

For example, as shown inFIG. 12A,FIG. 12B, and FIG. I2C, the finger of the user slides on the display194, a sliding start point is in the floating window22, a sliding trend is sliding toward the top of the home screen, and the floating window22moves toward the status bar321as the finger of the user slides. When the distance between the lower edge of the floating window22and the upper edge of the status bar321is less than the first height value and greater than the third distance threshold, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. As shown inFIG. 12D, when the electronic device100detects the user operation, the electronic device100continues to display the floating window22. As shown inFIG. 12EandFIG. 12F, after the user operation shown inFIG. 12B, the finger of the user continues to slide on the display194until the distance between the lower edge of the floating window22and the upper edge of the status bar321reaches the third distance threshold. When the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window22, and keeps the floating window22running in the background. In some embodiments of this application, when the electronic device100detects that the user may have an intent to hide the floating window22, the electronic device100displays prompt information on the display194. The prompt information is used to indicate, to the user, how to hide the floating window, and the prompt information may be presented in a form of an animation, a text, and/or a picture. This is not specifically limited herein. For example, the prompt information may be that a color of the status bar321changes, the width of the status bar321increases, the status bar321blinks by changing brightness, or the like.

In some embodiments of this application, the prompt information may be related to content currently displayed in the floating window. For example, if the content currently displayed in the floating window22is an image collected by a camera of the electronic device100, the prompt information is that the color of the status bar changes to green. If the content currently displayed in the floating window22is an image collected by a camera of an electronic device of a contact, the prompt information is that the color of the status bar changes to blue.

For example, when the electronic device100detects that the user may have an intent to hide the floating window22, the electronic device100changes the status bar321from the first width value to a second width value, to prompt that the user may hide the floating window22by using the status bar321. The second width value is greater than the first width value.

For example, the first user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. As shown inFIG. 13A, when the electronic device100detects that the distance between the upper edge of the floating window22and the lower edge of the status bar321is less than or equal to a ninth distance threshold, and there is a sliding trend that a hand of the user continues to drag the floating window30upward, the electronic device100determines that the user may have an intent to hide the floating window22. In this case, the electronic device100displays prompt information on the status bar321, where content of the prompt information is “Drag here and release to hide”, and a value of the ninth distance threshold is L9.

For example, the first user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the upper edge of the status bar321, the finger of the user continues to slide upward until a distance by which the finger of the user continues to slide reaches the second distance threshold. As shown inFIG. 13B, after the upper edge of the floating window22coincides with the lower edge of the status bar321, when the electronic device100detects that the finger of the user continues to drag the floating window30upward, the electronic device100determines that the user may have an intent to hide the floating window22. In this case, the electronic device100displays prompt information on the status bar321, where content of the prompt information is “Continue to slide upward to hide”.

It may be understood that after the first user operation ends, the electronic device100stops displaying the prompt information.

In some embodiments of this application, in addition to the foregoing manner of displaying the prompt information on the display194, the prompt information may be further played by using a voice. For example, the first user operation is that the finger of the user drags the floating window22to the area in which the status bar321is located. After the upper edge of the floating window22coincides with the lower edge of the area in which the status bar321is located, the finger of the user stops sliding and stops touching the area in which the floating window22is located on the display194. When the electronic device100detects a sliding trend that the finger of the user drags the floating window30upward, the electronic device100plays voice prompt information, where voice content is “Drag to the status bar and release to hide the floating window”.

In addition to the foregoing user operation used to hide the floating window22, in a specific implementation, there may be another user operation to hide the floating window22.

For example, the user may hide the floating window22by drawing an S-shape on the display194. A drawing start point of the user on the display194is in the area in which the floating window is located.

Specifically, as shown inFIG. 14AandFIG. 14B, the first user operation may alternatively be that the finger of the user slides on the display194to draw an S-shape, and a drawing start point of the user on the display194is in the area in which the floating window is located. As shown inFIG. 14CandFIG. 14D, the user stops sliding and stops touching the area in which the floating window is located on the display. When the electronic device100detects the touch operation, in response to the touch operation, the electronic device100may hide the floating window22. In addition to drawing the S-shape on the display194, as shown inFIG. 14E, the touch operation may be drawing a Z-shape on the display194by using the finger, and as shown inFIG. 14F, the touch operation may be drawing a circle in the finger by using the finger or drawing another shape on the display194by using the finger. A drawing start point is in the area in which the floating window is located. The first user operation may be distinguished from a touch operation entered by the user in an area outside the floating window on the display194by using the finger, so that the electronic device100is prevented from mistakenly considering the user operation used to hide the floating window22as another user operation entered by the user for an interface element on the display194, to improve accuracy and efficiency of hiding the floating window22by the electronic device100. The drawn shape (for example, the S-shape, the Z-shape, a rectangle, or the circle) may be a shape that is obtained through a large amount of statistics collection and that best meets a psychological expectation of the user. The user may directly associate the shape with the hidden the floating window22, to reduce memory load of the user and meet a use habit of the user. The drawn shape may alternatively be pre-recorded by the user. In addition to the S-shape, the Z-shape, the rectangle, and the circle, the shape pre-recorded by the user may be another non-linear track shape.

Specifically, the S-shape drawn by the user on the display194may not be a standard shape. A specific error is allowed between the S-shape drawn by the user and a standard S-shape, provided that the shape is similar to the S-shape. The electronic device100may compare the S-shape detected in the user interface20with the standard S-shape. If a degree of matching between the S-shape detected in the user interface20and the standard S-shape exceeds a specific threshold, it may be considered that the detected S-shape is valid, that is, the user operation of drawing the S-shape may be used to enable the first control mode. Allowing a specific error between the S-shape drawn by the user and the standard S-shape can reduce difficulty in drawing the S-shape by the user, so that the user can draw the S-shape more randomly, and user experience is better.

For another example, the user may hide the floating window22by pressing the button190.

Specifically, as shown inFIG. 15, the button190used to hide the floating window22may include any one or more of a volume up button401, a volume down button402, and a power button403. The volume up button and the volume down button may be located on one side of the electronic device100, and the power button may be located on the other side of the electronic device100. When the button190used to hide the floating window22is a combination of two buttons, the electronic device100may hide the floating window22by receiving an operation of simultaneously pressing the two buttons by the user. The operation of simultaneously pressing the two buttons may be distinguished from an operation of pressing a single button, to prevent the electronic device100from making an incorrect response. When the button190used by the user to hide the floating window22is any one of the foregoing buttons, the electronic device100may hide the floating window22by receiving an operation of consecutively pressing the button twice or more by the user. The operation of consecutively pressing one button twice or more may be distinguished from an operation of pressing the button once, to prevent the electronic device100from making an incorrect response.

For another example, the user may hide the floating window22by using a gesture.

Specifically, the first user operation may alternatively be that the user makes a specific gesture within a collection range of the camera. For example, as shown inFIG. 16, the gesture is “V-shape made by using a hand of the user”. The electronic device100may collect, by using the camera, a gesture entered by the user, compare the collected gesture with a pre-stored gesture, and hide the floating window22if the collected gesture is the same as the pre-stored gesture. The floating window22is hidden by using the gesture. Therefore, the operation is simple and convenient. The gesture (for example, the V-shape or a gesture that five fingers are unbent and folded) may be a gesture that is obtained through a large amount of statistics collection and that best meets a psychological expectation of the user. The user may directly associate the gesture with the hidden the floating window22, to reduce memory load of the user and meet a use habit of the user.

For another example, the user may hide the floating window22by using a voice.

Specifically, the electronic device100may collect, by using a microphone, the voice entered by the user, for example, specific content of the voice is “Please hide the floating window”; compare the specific content “Please hide the floating window” of the collected voice with a pre-stored voice keyword “Please hide the floating window”, and compare a voice feature of the collected voice with a pre-stored voice feature of an owner; and hide the floating window22if the specific content of the voice is the same as the pre-stored voice keyword and a degree of matching between the voice feature of the collected voice and the voice feature of the owner exceeds a specific threshold. The floating window22is hidden by using the voice. Therefore, the operation is simple and convenient. In addition, because another person cannot imitate the voice feature of the owner, the floating window22cannot be hidden randomly, and security is high. The user operation used to hide the floating window22is not limited in this embodiment of this application.

In some embodiments of this application, after the electronic device100hides the floating window22, the electronic device100displays identification information of the hidden floating window22in the area in which the status bar321is located, where the identification information may indicate, to the user, that a floating window is hidden, that is, a small window runs in the background. The identification information may be presented on the display194in a form of a prompt bar, a small window icon, an arrow, a text, or the like. The identification information may also be used as an entrance for re-invoking the floating window22. For example, when the finger of the user taps the identification information, in response to the user operation, the electronic device100redisplays the floating window22. The identification information is displayed in the area in which the status bar321is located, so that the identification information can be prevented from blocking interface content on the home screen24, to avoid impact on browsing the interface content on the home screen24by the user, and avoid impact on a user operation performed by the user on the home screen24.

In some embodiments of this application, the electronic device100uses a color of the status bar321as the identification information. After the electronic device100hides the floating window22, the electronic device100indicates, to the user by changing the color of the status bar321, that the floating window is hidden.

For example, as shown inFIG. 17A, after the floating window22is hidden, a black prompt bar501may be displayed on an upper left side of the display194. For example, as shown inFIG. 17B, after the floating window22is hidden, a preset icon502of the floating window is displayed on the status bar321.

Aspect 2: How to re-invoke the floating window22.

It may be understood that after the user hides the floating window22, the display194displays the home screen24. Before the user re-invokes the floating window, the electronic device100may receive one or more user operations of the user. For example, the home screen24is switched to a second user interface. In this case, if the electronic device100detects a user operation used to re-invoke the floating window, in response to the user operation, the electronic device100displays both the second user interface and the floating window22on the display194. The second user interface may be the same as or may be different from the home screen24. The following further describes, by using an example in which the second user interface is the same as the home screen24, how to re-invoke the hidden floating window.

In some embodiments of this application, when the electronic device100may detect a user operation performed on the home screen24(for example, the user single-taps the status bar321on the home screen24), the electronic device100may re-invoke the floating window22in response to the user operation. In addition to single-tapping the status bar321on the home screen24, the user operation may be double-tapping the status bar321on the home screen24, touching and holding the status bar321on the home screen24, or the like. Herein, the tap operation and the touch and hold operation may be performed by using one or more knuckles, a finger pad, a fingertip, a stylus, or the like.

In this application, an operation used to re-invoke the floating window22may be referred to as a second user operation. When the user expects to re-invoke the floating window22, the user performs the second user operation. When the electronic device100detects the second user operation, in response to the second user operation, the electronic device100may re-invoke the floating window22, and display the floating window22at a preset location on the display194.

It may be understood that when the electronic device100detects the second user operation, the electronic device100determines whether there is a hidden floating window (that is, the floating window running in the background), and if there is the hidden floating window, the electronic device100re-invokes the hidden floating window22in response to the second user operation.

In this application, the user operation used to trigger the electronic device100to re-invoke the floating window may be preset by the system of the electronic device100, or may be set by the user based on an operation habit of the user.

In some embodiments of this application, the second user operation may be that the finger of the user slides leftward (or rightward) in the area in which the status bar321is located on the display194by a distance reaching a fourth distance threshold. In response to the user operation, the electronic device100displays the floating window22at a preset location on the display194.

For example, a value of the fourth distance threshold is L4. As shown inFIG. 18A,FIG. 18B, andFIG. 18C, the finger of the user slides in the area in which the status bar321is located on the display, and a sliding trend is sliding toward a left edge of the electronic device100. When the electronic device100detects that a distance by which the finger of the user slides leftward in the area in which the status bar321is located reaches the fourth distance threshold, the electronic device100displays the floating window22at a preset location on the display194.

In some embodiments of this application, the second user operation may be that the finger of the user slides leftward (or rightward) on the status bar321. When the finger of the user stops sliding and stops touching the area in which the status bar321is located on the display, a distance by which the finger of the user slides leftward (or rightward) is greater than or equal to a fourth distance threshold.

For example, as shown inFIG. 18DandFIG. 18E, the finger of the user slides on the area in which the status bar321is located on the display194, and a sliding trend is sliding toward a left edge of the electronic device100. As shown inFIG. 18F, when the finger of the user stops sliding and stops touching the area in which the status bar321is located on the display, a distance by which the finger of the user slides rightward is greater than the fourth threshold. As shown inFIG. 18G, when the electronic device100detects the user operation, in response to the user operation, the electronic device100displays the floating window22at a preset location on the display194.

In some embodiments of this application, the second user operation may be that the finger of the user slides leftward (or rightward) in the area in which the status bar321is located on the display194for a time period greater than a fourth time threshold.

In some embodiments of this application, if the user intends to invoke a system notification bar interface25on the display194, the finger of the user slides on the display194. A sliding start point is the status bar321on the home screen24, and a sliding trend is sliding toward the bottom of the electronic device100. If a distance by which the finger of the user slides downward is less than a fifth distance threshold, the finger of the user may pull down a system notification bar as the finger of the user slides. When a distance by which the finger of the user slides downward is less than the fifth distance threshold, if the finger of the user stops sliding and stops touching the display194, the electronic device100displays the system notification bar interface25in full screen mode. If the user intends to re-invoke the floating window, the second user operation may alternatively be that the finger of the user slides on the display194, a sliding start point is the status bar321in the user interface, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is greater than or equal to a fifth distance threshold, the finger of the user stops sliding and stops touching the display194. The second user operation may alternatively be that the finger of the user slides on the display194, a sliding start point is the status bar321in the user interface, a sliding trend is sliding toward the bottom of the electronic device100, and a distance by which the finger of the user slides downward reaches a fifth distance threshold.

In this application, the distance by which the finger of the user slides downward is a distance between the lower edge of the status bar321and the finger of the user.

For example, a value of the fifth distance threshold is L5. As shown inFIG. 19AandFIG. 19B, the finger of the user slides downward by using the status bar321as a start point. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays a part of the system notification bar interface, to present a display effect of pulling down the system notification bar interface25by the finger of the user. As shown inFIG. 19CandFIG. 19D, when the finger of the user stops sliding and stops touching the display194, a distance by which the finger of the user slides downward is less than the fifth distance threshold. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays the system notification bar interface25in full screen mode. The system notification bar interface25may include a search bar601, a scan icon602, a notification bar603, and a SmarCare bar604. A history search button and a history clear button may be further attached below the search bar601. In addition to the foregoing controls, the system notification bar interface25may further include another control. This is not specifically limited herein. As shown inFIG. 19E, after the user operation shown inFIG. 19C, the finger of the user continues to slide downward, and a distance by which the finger of the user slides downward reaches the fifth distance threshold. As shown inFIG. 19F, when the electronic device100detects the user operation, in response to the user operation, the electronic device100re-invokes the floating window22, and displays the floating window22at a preset location on the display194.

In this application, a user operation used to invoke the system notification bar interface25and display the system notification bar interface25in full screen mode may be referred to as a fifth user operation.

In some embodiments of this application, after hiding the floating window22, the user expects to continue watching the video image in the floating window22. Therefore, the user may have the following three user intents:

User intent 9: The user re-invokes the floating window22, and displays the floating window22at a preset location on the display194.

User intent 10: The user re-invokes the floating window22, and displays, in full screen mode, the video call interface20corresponding to the floating window22.

User intent 11: The user re-invokes the floating window22, and displays, in split-screen mode, the video call interface20corresponding to the floating window22. To be specific, the display194is divided into a first area and a second area, the first area is used to continue displaying the current user interface, and the second area is used to display the video call interface20corresponding to the floating window22.

In some embodiments of this application, different user operations are used to distinguish between the user intent 9 and the user intent 10. In this application, a user operation used to implement the user intent 10 is referred to as a third user operation. In this application, a user operation used to implement the user intent 11 is referred to as a fourth user operation.

In some embodiments of this application, the third user operation may be that the finger of the user single-taps or double-taps the status bar321in the second user interface; the third user operation may be that the finger of the user slides leftward or rightward on the status bar321in the second user interface for a time period greater than or equal to a fourth time threshold; the third user operation may be that the finger of the user slides leftward or rightward on the status bar321in the second user interface by a distance greater than or equal to a fourth distance threshold; the third user operation may be that the finger of the user touches and holds the status bar321in the second user interface for a time period greater than or equal to a fifth time threshold; or the third user operation may be that the finger of the user slides toward the bottom of the electronic device100on the display by using the status bar321as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to a fifth distance threshold, the finger of the user stops sliding and stops touching the display.

In some embodiments of this application, the fourth user operation may be that the finger of the user single-taps or double-taps the status bar321in the second user interface; the fourth user operation may be that the finger of the user slides leftward or rightward on the status bar321in the second user interface for a time period greater than or equal to a fourth time threshold; the fourth user operation may be that the finger of the user slides leftward or rightward on the status bar321in the second user interface by a distance greater than or equal to a fourth distance threshold; the fourth user operation may be that the finger of the user touches and holds the status bar321in the second user interface for a time period greater than or equal to a fifth time threshold; or the fourth user operation may be that the finger of the user slides toward the bottom of the electronic device100on the display by using the status bar321as a start point, and when a distance by which the finger of the user slides downward is greater than or equal to a fifth distance threshold, the finger of the user stops sliding and stops touching the display.

In some optional embodiments, the second user operation may be that the finger of the user single-taps the status bar321. The electronic device100detects the second user operation, and the electronic device100determines that the second user operation is used to implement the user intent 9. In response to the second user operation, the electronic device100displays the floating window22at a preset location on the display194. The third user operation may be that the finger of the user touches and holds the status bar321for a time period greater than the fifth time threshold. The electronic device100detects the third user operation, and the electronic device100determines that the third user operation is used to implement the user intent 10. In response to the third user operation, the electronic device100displays, in full screen mode, the video call interface20corresponding to the floating window22. The fourth user operation may be that the finger of the user touches and holds the status bar321for a time period greater than a sixth time threshold. The electronic device100detects the fourth user operation, and the electronic device100determines that the fourth user operation is used to implement the user intent 11. In response to the fourth user operation, the electronic device100displays, in split-screen mode, the video call interface20corresponding to the floating window22.

In some optional embodiments, the second user operation may be that the finger of the user slides on the area in which the status bar321is located on the display194, a sliding trend is sliding toward a left edge of the electronic device100, and a distance by which the finger of the user slides leftward reaches the fourth distance threshold. The third user operation may be that the finger of the user slides on the area in which the status bar321is located on the display194, a sliding trend is sliding toward a right edge of the electronic device100, and a distance by which the finger of the user slides rightward reaches the fourth distance threshold. The fourth user operation may be that the finger of the user slides on the area in which the status bar321is located on the display194, a sliding trend is sliding toward a right edge of the electronic device100, and when a distance by which the finger of the user slides rightward is greater than the fourth distance threshold, the finger of the user stops sliding and stops touching the display194.

In some optional embodiments, as shown inFIG. 19A,FIG. 19B, andFIG. 19C, the fifth user operation may be that the finger of the user slides on the display194, a sliding start point is in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is less than the fifth distance threshold, the finger of the user stops sliding and stops touching the display194. The second user operation may be that the finger of the user slides on the display194, a sliding start point is in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is greater than or equal to the fifth distance threshold and less than a sixth distance threshold, the finger of the user stops sliding and stops touching the display194. The third user operation may be that the finger of the user slides on the display194, a sliding start point is in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is greater than or equal to the sixth distance threshold and less than a seventh distance threshold, the finger of the user stops sliding and stops touching the display194. The fourth user operation may be that the finger of the user slides on the display194, a sliding start point is in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is greater than or equal to the seventh distance threshold, the finger of the user stops sliding and stops touching the display194. Alternatively, the fourth user operation may be that the finger of the user slides on the display194, a sliding start point is in the area in which the status bar321is located, and a sliding trend is sliding toward the bottom of the electronic device100, until a distance by which the finger of the user slides downward reaches the seventh distance threshold.

For example, a value of the sixth distance threshold is L6, and a value of the seventh distance threshold is L7. As shown inFIG. 20AandFIG. 20B, after the user operation shown inFIG. 19C, the finger of the user continues to slide downward, and when the finger of the user stops sliding and stops touching the display194, a distance by which the finger of the user slides downward is greater than the fifth distance threshold and less than the sixth distance threshold. As shown inFIG. 20C, when the electronic device100detects the user operation, in response to the user operation, the electronic device100re-invokes the floating window22, and displays the floating window22at a preset location on the display194. As shown inFIG. 20DandFIG. 20E, after the user operation shown inFIG. 20A, the finger of the user continues to slide downward, and when the finger of the user stops sliding and stops touching the display194, a distance by which the finger of the user slides downward is greater than the sixth distance threshold and less than the seventh distance threshold. As shown inFIG. 20F, when the electronic device100detects the user operation, in response to the user operation, the electronic device100displays, in full screen mode, the video call interface20corresponding to the floating window22. As shown inFIG. 20GandFIG. 20H, after the user operation shown inFIG. 20D, the finger of the user continues to slide downward. When the electronic device100detects that a distance by which the finger of the user slides downward reaches the seventh distance threshold, in response to the user operation, the electronic device100displays, in split-screen mode, the video call interface20corresponding to the floating window22.

It should be noted that, in addition to a split-screen interface shown inFIG. 20H, in a specific implementation, there may be another form of split-screen interface. This is not specifically limited herein.

In some embodiments of this application, the status bar321in the user interface may be divided into two parts: a first preset area and a second preset area. Widths of the status bar, the first preset area, and the second preset area in the second user interface are the same.

In some optional embodiments, the second user operation may be that the finger of the user slides on the display194, a sliding start point is in the first preset area in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is less than an eighth distance threshold, the finger of the user stops sliding and stops touching the display194. The third user operation may be that the finger of the user slides on the display194, a sliding start point is in the first preset area in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is greater than or equal to the eighth distance threshold, the finger of the user stops sliding and stops touching the display194. Alternatively, the third user operation may be that the finger of the user slides on the display194, a sliding start point is in the first preset area in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and a distance by which the finger of the user slides downward reaches the eighth distance threshold. The fifth user operation may be that the finger of the user slides on the display194, a sliding start point is in the second preset area in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is less than the fifth distance threshold, the finger of the user stops sliding and stops touching the display194. The fourth user operation may be that the finger of the user slides on the display194, a sliding start point is in the second preset area in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and when a distance by which the finger of the user slides downward is greater than or equal to the fifth distance threshold, the finger of the user stops sliding and stops touching the display194. Alternatively, the fourth user operation may be that the finger of the user slides on the display194, a sliding start point is in the second preset area in the area in which the status bar321is located, a sliding trend is sliding toward the bottom of the electronic device100, and a distance by which the finger of the user slides downward reaches the fifth distance threshold.

In some embodiments of this application, a notch of a notch screen or a small hole of a hole-punch display is located at a middle location of an upper edge of the display, and the status bar321in the second user interface is divided into left and right parts by using the notch or the small hole as a division point; and the first preset area is a left half part of the status bar321in the second user interface, and the second preset area is a right half part of the status bar321in the second user interface; or the first preset area is a right half part of the status bar321in the second user interface, and the second preset area is a left half part of the status bar321in the second user interface.

The notch screen refers to a screen design in which a notch is disposed on the display194, and the notch may be located at a middle location of an upper edge of the touch display194. In some embodiments of this application, the notch is configured to accommodate at least one front panel component, and the front panel component includes at least one of a camera, an optical proximity sensor, a distance sensor, an earpiece, and an ambient light sensor.

In some embodiments of this application, the notch on the upper edge of the display194that is the notch screen may be a semicircular notch, a right-angled rectangular notch, a rounded rectangular notch, or an irregular-shaped notch. For example, as shown inFIG. 21A, the notch screen may refer to a screen design in which a semicircular notch701is disposed at a central location of an upper edge of the display194. For example, as shown inFIG. 21B, the notch screen may refer to a screen design in which a rectangular notch702is disposed at a central location of an upper edge of the display194.

The hole-punch display may refer to a screen design in which at least one small hole46is disposed in an upper half part of the display194, and a location of the small hole46is used to accommodate at least one front panel component of a camera, a distance sensor, an earpiece, and an ambient light sensor.

For example, as shown inFIG. 21C, the hole-punch display may refer to a screen design in which a small hole703is disposed at a middle location of an upper edge of the display194. The hole-punch display may also be referred to as a water drop-shaped notch screen or a water drop screen.

For example, a value of the eighth distance threshold is L8. As shown inFIG. 22A,FIG. 22B,FIG. 22C, andFIG. 22D, the finger of the user slides downward from the second preset area802of the status bar321on the display194, and when a distance by which the finger of the user slides downward is less than the eighth distance threshold, the finger of the user stops sliding and stops touching the display194. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays the floating window22at a preset location on the display194. As shown inFIG. 22EandFIG. 22F, after the user operation shown inFIG. 22F, the finger of the user continues to slide downward, and when the electronic device100detects that a distance by which the finger of the user slides downward reaches the eighth distance threshold, in response to the user operation, the electronic device100displays, on the display194in full screen mode, the video call interface20corresponding to the floating window22. For example, as shown inFIG. 22G.FIG. 22H, andFIG. 22I, the finger of the user slides downward from the second preset area802of the status bar321on the display194, when a distance by which the finger of the user slides downward is less than the fifth distance threshold, the finger of the user stops sliding and stops touching the display194, and when the electronic device100detects the user operation, in response to the user operation, the electronic device100displays the system notification bar interface25in full screen mode. As shown inFIG. 22JandFIG. 22K, after the user operation inFIG. 22G, the finger of the user continues to slide downward, and when the electronic device100detects that a distance by which the finger of the user slides downward reaches the fifth distance threshold, in response to the user operation, the electronic device100displays, in split-screen mode, the video call interface20corresponding to the floating window22.

In some embodiments of this application, as shown inFIG. 23A, the display194may be divided into two parts: a first interface and a second interface by using a folding track of a foldable screen as a division line; and the first preset area is a status bar area803in the first interface, and the second preset area is a status bar area804in the second interface; or the first preset area is a status bar area804in the second interface, and the second preset area is a status bar area803in the first interface.

In some embodiments of this application, an area in which a small hole of the hole-punch display is located is used as a trigger point, and the finger of the user approaches, in a floating manner (or through single-tapping), the area in which the small hole of the hole-punch display is located. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays a menu navigation window on the display194. The menu navigation window includes at least a first option control and a second option control. The first option control is configured to trigger the electronic device100to re-invoke the floating window. The second option control is configured to trigger the electronic device100to re-invoke the floating window, and display, in full screen mode, the video call interface20corresponding to the floating window22. The second user operation may be that the finger of the user single-taps the first option control. The third user operation may be that the finger of the user single-taps the second option control.

For example, as shown inFIG. 23B, the hole-punch display may alternatively refer to a screen design in which a small hole704is disposed on the left of an upper edge of the display194.

For example, as shown inFIG. 24AandFIG. 24B, the finger of the user single-taps an area in which a small hole of the hole-punch display is located, and the finger of the user touches touch points around the small hole of the display. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays a menu navigation window26on the display194. The menu navigation window26includes a first option control901, a second option control902, and a third option control903. As shown inFIG. 24CandFIG. 24D, the finger of the user touches the first option control901. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays the floating window22at a preset location on the display194. As shown inFIG. 24EandFIG. 24F, the finger of the user single-taps the second option control902. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays, in full screen mode, the video call interface20corresponding to the floating window22. As shown inFIG. 24GandFIG. 24H, the finger of the user single-taps the third option control903. When the electronic device100detects the user operation, in response to the user operation, the electronic device100displays, in split-screen mode, the video call interface20corresponding to the floating window22.

In addition to the foregoing user operation used to re-invoke the floating window22, in a specific implementation, there may be another user operation to re-invoke the floating window22.

For example, the user may re-invoke the floating window22by pressing the button190.

Specifically, the button190used to re-invoke the floating window22may include any one or more of a volume up button, a volume down button, and a power button. A location of each button on the electronic device100is shown inFIG. 15. A manner of re-invoking the floating window22by pressing the button190is similar to a manner of hiding the floating window22by pressing the button190. Details are not described herein again.

For example, the user may re-invoke the floating window22by using a voice.

Specifically, the electronic device100may collect, by using a microphone, the voice entered by the user, for example, specific content of the voice is “Please re-invoke the floating window”; compare the specific content “Please re-invoke the floating window” of the collected voice with a pre-stored voice keyword “Please re-invoke the floating window”, and compare a voice feature of the collected voice with a pre-stored voice feature of an owner; and re-invoke the floating window if the specific content of the voice is the same as the pre-stored voice keyword and a degree of matching between the voice feature of the collected voice and the voice feature of the owner exceeds a specific threshold. The floating window is re-invoked by using the voice. Therefore, the operation is simple and convenient. In addition, because another person cannot imitate the voice feature of the owner, the hidden floating window cannot be invoked randomly, and security is high. The foregoing manner of re-invoking the floating window is merely used an example for description. Actually, the floating window may alternatively be re-invoked in another manner, for example, a specific pattern is entered in a specific area in the user interface. This is not limited in this embodiment of this application.

According to this application, when displaying a floating window used for a video call, the electronic device100may hide the floating window based on a user operation, and the electronic device100may further re-invoke the hidden floating window based on a user operation. In addition, in the foregoing process, when the electronic device100continuously keeps the video call, the floating window is prevented from blocking the user interface, to improve convenience of the user operation.

The floating window management method provided in this application may be further applied to a voice call scenario.

FIG. 25Ashows an example user interface30used for a call. The user interface may be a user interface opened by a user by tapping a dial control in a contact interface included in the Contacts. The Contacts includes one or more phone numbers of one or more contacts. In addition, the user may tap a dial control after entering a phone number on a dialer screen, to open the user interface used for the call.

As shown inFIG. 25A, the user interface30used for the call may include a contact identifier1001, a call duration indicator1002, a speaker control1003, an add call control1004, a keypad control1005, a mute control1006, a recording control1007, a contacts control1008, a hang-up control1009, a status bar1010, and a navigation bar1011.

The contact identifier1001is used to indicate an identity of a current call object.

The call duration indicator1002is used to indicate duration of a current call.

The speaker control1003is configured to switch a speaker working status. The speaker working status includes on and off. If the speaker working status is off, when the electronic device100detects a touch operation performed on the speaker control1003(for example, a tap operation on the speaker control1003), the electronic device100may switch the speaker working status from off to on in response to the operation, and vice versa.

The add call control1004is configured to add a call. When the electronic device100may detect a touch operation performed on the add call control1004(for example, a tap operation on the add call control1004), the electronic device100may display an add call user interface in response to the operation.

The keypad control1005is configured to open a keypad. When the electronic device100may detect a touch operation performed on the keypad control1005(for example, a tap operation on the keypad control1005), the electronic device100may display the keypad in the user interface30in response to the operation.

The mute control1006is configured to turn on or turn off a microphone. If the microphone is in an on state, when the electronic device100detects a touch operation performed on the mute control1006(for example, a tap operation on the mute control1006), the electronic device100may turn off the microphone in response to the operation, and vice versa.

The recording control1007is configured to start recording. When the electronic device100may detect a touch operation performed on the recording control1007(for example, a tap operation on the recording control1006), the electronic device100may start recording in response to the operation.

The contacts control1008is configured to open the Contacts. When the electronic device100may detect a touch operation performed on the contacts control1008(for example, a tap operation on the contacts control1008), the electronic device100may display information about at least one contact in response to the operation.

The hang-up control1009is configured to disconnect the call. When the electronic device100may detect a touch operation performed on the hang-up control1009(for example, a tap operation on the hang-up control1009), the electronic device100may disconnect the call in response to the operation.

The status bar1010is the same as the status bar207in the user interface20. Details are not described herein.

The navigation bar1011is the same as the navigation bar208in the user interface20. Details are not described herein.

For example, a current user interface is the user interface30used for the voice call. As shown inFIG. 25BandFIG. 25C, when the electronic device100detects a tap operation performed on a return button2011A, in response to the operation, the electronic device100displays both a contact list interface31and a floating window32, and displays duration of a current voice call in the floating window32. As shown in the figure, the floating window32is displayed in the contact list interface in a floating manner in a form of an icon.

The following describes the user interface31provided in the example UI embodiment shown inFIG. 25C. The user interface31may be a user interface opened by the user by tapping the return button1011A inFIG. 23A.

As shown inFIG. 25C, the electronic device may display the user interface31on the display in full screen mode. The user interface31may include a status bar1101and a user interface used to display one or more contact entries.

For the status bar1101, refer to the status bar207in the user interface20shown inFIG. 2A. Details are not described herein again.

The user interface used to display one or more contact entries may include an application title bar1102, a control1103, a search box1104, a letter display bar1105, a “Groups” entry1106, a “Contact cards” entry1107, a “My card” entry1108, one or more contact entries such as1109A to1109E, a menu1110, and a control1111.

The application title bar1102may be used to indicate that a current page is used to display one or more pieces of contact information stored in the electronic device. The application title bar1102may be represented in a form of text information “Contacts” or a form of an icon, or in another form.

The control1103may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device may display another control, for example, a control used to set a contact home page.

The “Groups” entry1106may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device may display information about one or more groups created by the user. One group includes one or more contacts.

The “Contact cards” entry1107may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device may display information carried in one or more paper business cards that are found (for example, found through a camera).

The “My card” entry1108may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device may display information about a card of the user that is created by the user.

The contact entry is used to display one or more pieces of contact information stored in the electronic device. The contact information may include an avatar, a name, a nickname, a phone number, and the like. When a plurality of contact entries are displayed in the user interface used to display one or more contact entries, the plurality of contact entries may be arranged from top to bottom in an order of initials of contact names from “A” to “Z”. The user may slide up and down an area used to display the contact entries in the user interface31, so as to view more contact entries.

The menu1110includes a control1110A, a control1110B, and a control1110C. Content displayed in the user interface used to display one or more contact entries is related to a currently selected control in the menu1110. As shown inFIG. 5A, in the current menu1110, if the control1110B is selected, the user interface31is used to display one or more contact entries stored in the electronic device; if the control1110A is selected, that is, when the control1110A receives a user operation (for example, a touch operation), the electronic device may display a dialer screen in response to the detected user operation; and if the control1110C is selected, that is, when the control1110C receives a user operation (for example, a touch operation), the electronic device may display information about a favorite contact in response to the detected user operation.

The control1111may receive a user operation (for example, a touch operation). In response to the detected user operation, the electronic device may display an interface used to add a new contact.

The navigation bar1112is the same as the navigation bar208in the user interface20. Details are not described herein.

In this scenario, after the electronic device100exits the voice call interface30, although the floating window32displayed by the electronic device100on the display194is presented in a form of an icon, the floating window41still blocks a user interface currently displayed on the display194. The user may intend to hide the floating window32, and keep the floating window running in the background, so that the user can re-invoke the floating window later.

Based on the foregoing voice call scenario, the following describes, from two aspects, some user interface embodiments implemented on the electronic device100.

Aspect 1: How to hide the floating window32.

In some embodiments of this application, the finger of the user slides on the display194, to drag the floating window32to an area in which the status bar1101is located. A sliding start point of the finger of the user is in an area in which the floating window32is located, and a sliding trend of the finger of the user is sliding toward the top of the home screen. When the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window32.

In some embodiments of this application, the finger of the user drags the floating window80to the area in which the status bar1101is located. After an upper edge of the floating window32coincides with a lower edge of the status bar1101, the electronic device100may hide the floating window80.

For example, as shown inFIG. 26AandFIG. 26B, the finger of the user slides on the display194, to drag the floating window80to move in the contact list interface, until the upper edge of the floating window32coincides with the lower edge of the status bar207. A sliding start point of the finger of the user is in the area in which the floating window32is located. As shown inFIG. 26C, when the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window32, and the electronic device100keeps the floating window32running in the background.

In this application, a user operation used to trigger the electronic device100to hide the floating window32may be preset by a system of the electronic device100, or may be set by the user based on an operation habit of the user.

In the foregoing voice call scenario, for the user operation used to hide the floating window32, refer to the first user operation in the video call scenario. Details are not described herein again.

Aspect 2: How to re-invoke the floating window32.

It may be understood that after the user hides the floating window32, the display194may display the contact list interface. Before the user re-invokes the floating window, the electronic device may receive a user operation performed by the user on the contact list interface. For example, the contact list interface is switched to a second user interface. In this case, a current user interface displayed on the display194of the electronic device100is the second user interface. If the electronic device100detects a user operation used to re-invoke the floating window32, in response to the user operation, the electronic device100displays the floating window32in the second user interface in a floating manner. The second user interface may be the same as or may be different from the contact list interface. The following describes, by using an example m which the second user interface may be the same as the contact list interface, how to re-invoke the hidden floating window.

In some embodiments of this application, when the electronic device100may detect a user operation performed on the contact list interface (for example, the user single-taps the status bar1101in the contact list interface), the electronic device100may re-invoke the floating window32in response to the user operation. In addition to single-tapping the status bar1101in the contact list interface, the user operation may be double-tapping the status bar1101in the contact list interface, touching and holding the status bar1101in the contact list interface, or the like. Herein, the tap operation and the touch and hold operation may be performed by using one or more knuckles, a finger pad, a fingertip, a stylus, or the like.

It may be understood that when the electronic device100detects the user operation used to hide the floating window32, the electronic device100first determines whether there is a hidden floating window (that is, the floating window running in the background), and if there is the hidden floating window, in response to the user operation, the electronic device100re-invokes the hidden floating window32, and displays the floating window32at a preset location on the display194.

For example, as shown inFIG. 27A.FIG. 27B, andFIG. 27C, the finger of the user single-taps the area in which the status bar1101is located on the display194. As shown inFIG. 27C, when the electronic device100detects the user operation, the electronic device100displays the floating window32at a preset location on the display194.

In this application, the user operation used to trigger the electronic device100to re-invoke the floating window32may be preset by the system of the electronic device100, or may be set by the user based on an operation habit of the user.

In the foregoing voice call scenario, for the user operation used to re-invoke the floating window32, refer to the second user operation in the video call scenario. Details are not described herein again.

The floating window management method provided in this application may be further applied to a video playing scenario.

FIG. 28Ashows an example video playing interface40displayed in full screen mode. The user interface may be a user interface provided by video playing software (for example, iQIYI or Youku).

In some embodiments of this application, displaying the video playing interface40in full screen mode means that the display194displays only the video playing interface40and does not display other content. In a possible implementation, when the video playing interface40is displayed in full screen mode, the video playing interface40may occupy an entire display area of the display194. In another possible implementation, the video playing interface40may alternatively occupy only a part of a display area of the display194. For example, when the display194is an abnormally cut screen (for example, a notch screen), the video interface is displayed in the middle of the abnormally cut screen, and an edge on one side or edges on both sides of the video interface are displayed in black, it may also be considered that the display194displays the video interface in full screen mode.

In some embodiments of this application, displaying the video playing interface40in full screen mode may mean that when displaying the video playing interface40, the display194may further display a system-level interface element, for example, a status bar or a floating shortcut menu (for example, Assistive Touch of Apple). The status bar may include a name of an operator (for example, China Mobile), time, a Wi-Fi icon, signal strength, current remaining battery power, and the like.

As shown inFIG. 28A, in addition to the navigation bar1207, the video playing interface40in which the user watches a video may further include an exit control1201, a content display area1202, a pause control1203, a previous control1204, a next control1205, and a progress bar1206.

The exit control1201may be configured to exit a current user interface. When the electronic device100may detect a touch operation performed on the exit control1201(for example, a tap operation on the exit control1201), the electronic device100may exit the current user interface in response to the operation.

The content display area1202may be configured to display video content. In addition, the content display area1202may further adjust playing brightness and playing volume. When the electronic device100may detect a touch operation (for example, a slide-up operation or a slide-down operation) performed on a left side of the content display area1202, the electronic device100may adjust (increase or decrease) current playing brightness in response to the operation. When the electronic device100may detect a touch operation (for example, a slide-up operation or a slide-down operation) performed on a right side of the content display area1202, the electronic device100may adjust (increase or decrease) current playing volume in response to the operation.

The pause control1203may be configured to pause playing of a video. When the electronic device100may detect a touch operation performed on the pause control1203(for example, a tap operation on the pause control1203), the electronic device100may pause playing of the video in response to the operation.

The previous control1204may be configured to switch played content to a previous episode. When the electronic device100may detect a touch operation performed on the previous control1204(for example, a tap operation on the previous control1204), the electronic device100may switch the played content to the previous episode in response to the operation.

The next control1205may be configured to switch played content to a next episode. When the electronic device100may detect a touch operation performed on the next control1205(for example, a tap operation on the next control505), the electronic device100may switch the played content to the next episode in response to the operation.

The progress bar1206is configured to display a current video playing progress, and may be configured to adjust the playing progress. When the electronic device100may detect a touch operation performed on the progress bar1206(for example, a tap operation on the progress bar1206), the electronic device100may adjust the current playing progress in response to the operation.

For example, a current user interface is the user interface40used for video play. As shown inFIG. 28A,FIG. 28B, andFIG. 28C, when the electronic device100detects a tap operation performed on a home screen button1207B, in response to the operation, the electronic device100displays both the home screen24and a floating window41, and displays, in the floating window41, a video image played in the content display area902. From a perspective of a display effect, the electronic device100scales down a video playing window to obtain the floating window41used for video play. In this scenario, after the electronic device100exits the video playing interface40, although the floating window41displayed by the electronic device100on the display194is presented in a form of a floating window, the floating window41still blocks a user interface currently displayed on the display194. The user may intend to hide the floating window41, and keep the floating window running in the background, so that the user can re-invoke the floating window later.

Based on the foregoing video playing scenario, the following describes, from two aspects, some user interface embodiments implemented on the electronic device100.

Aspect 1: How to hide the floating window41.

In some embodiments of this application, the finger of the user slides on the display194, to drag the floating window41to an area in which the status bar207is located. A sliding start point of the finger of the user is in an area in which the floating window41is located, and a sliding trend of the finger of the user is sliding toward the top of the home screen. When the electronic device100detects the user operation, in response to the user operation, the electronic device100stops displaying the floating window41.

For example, as shown inFIG. 29AandFIG. 29B, the finger of the user slides on the display194, to drag the floating window41to move on the home screen. A sliding start point of the finger of the user is in the area in which the floating window41is located. As shown inFIG. 29C, after the electronic device100detects that an upper edge of the floating window41coincides with a lower edge of the status bar207, in response to the user operation, the electronic device100stops displaying the floating window41, and the electronic device100keeps the floating window41running in the background.

In some embodiments of this application, based on Case 1, the finger of the user drags the floating window41to the area in which the status bar207is located. After the upper edge of the floating window41coincides with the lower edge of the status bar207, the finger of the user continues to slide upward, and when the electronic device100detects that a distance by which the finger of the user continues to slide upward reaches the first distance threshold, the electronic device100stops displaying the floating window41, and keeps the floating window41running in the background.

In this application, a user operation used to trigger the electronic device100to hide the floating window41may be preset by a system of the electronic device100, or may be set by the user based on an operation habit of the user.

In the foregoing voice call scenario, for the user operation used to hide the floating window41, refer to the first user operation in the video call scenario. Details are not described herein again.

Aspect 2: How to re-invoke the floating window41.

It may be understood that after the user hides the floating window41, the display194may display the home screen24. Before the user re-invokes the floating window, the electronic device may receive a user operation performed by the user on the home screen24. For example, the home screen24is switched to a third user interface. In this case, a current user interface displayed on the display194of the electronic device100is the third user interface. If the electronic device100detects a user operation used to re-invoke the floating window41, in response to the user operation, the electronic device100displays the floating window41in the second user interface in a floating manner. The third user interface may be the same as or may be different from the home screen24. The following describes, by using an example in which the third user interface may be the same as the home screen24, how to re-invoke the hidden floating window.

In some embodiments of this application, when the electronic device100may detect a user operation performed on the home screen24(for example, the user single-taps the status bar207on the home screen24), the electronic device100may re-invoke the floating window41in response to the user operation. In addition to single-tapping the status bar207on the home screen24, the user operation may be double-tapping the status bar207on the home screen24, touching and holding the status bar207on the home screen24, or the like. Herein, the tap operation and the touch and hold operation may be performed by using one or more knuckles, a finger pad, a fingertip, a stylus, or the like.

It may be understood that when the electronic device100detects the user operation used to hide the floating window41, the electronic device100first determines whether there is a hidden floating window (that is, the floating window running in the background), and if there is the hidden floating window, in response to the user operation, the electronic device100re-invokes the hidden floating window, and displays the floating window at a preset location on the display194.

For example, as shown inFIG. 30AandFIG. 30B, the finger of the user slides leftward in the area in which the status bar207is located on the display194. As shown inFIG. 30C, when the electronic device100detects that a distance by which the user operates to slide leftward reaches the fourth distance threshold, the electronic device100displays the floating window41at a preset location on the display194.

In this application, the user operation used to trigger the electronic device100to re-invoke the floating window41may be preset by the system of the electronic device100, or may be set by the user based on an operation habit of the user.

In the foregoing video playing scenario, for the user operation used to re-invoke the floating window41, refer to the second user operation in the video call scenario. Details are not described herein again.

An embodiment of this application further provides a computer-readable storage medium. All or some of the procedures in the foregoing method embodiments may be completed by a computer program instructing related hardware. The program may be stored in the foregoing computer storage medium. When the program is executed, the procedures of the foregoing method embodiments may be included. The computer-readable storage medium includes any medium that can store program code, such as a read-only memory (read-only memory, ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disc.

A sequence of the steps of the method in the embodiments of this application may be adjusted, combined, and deleted based on an actual requirement.

The modules in the apparatus in the embodiments of this application may be combined, divided, and deleted based on an actual requirement.

In conclusion, the foregoing embodiments are merely intended for describing the technical solutions of this application, but not for limiting this application. Although this application is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that modifications to the technical solutions recorded in the foregoing embodiments or equivalent replacements to some technical features thereof may still be made, without departing from the scope of the technical solutions of the embodiments of this application.