WO2024041583A1 - 一种窗口裁剪方法与电子设备 - Google Patents

一种窗口裁剪方法与电子设备 Download PDF

Info

Publication number
WO2024041583A1
WO2024041583A1 PCT/CN2023/114543 CN2023114543W WO2024041583A1 WO 2024041583 A1 WO2024041583 A1 WO 2024041583A1 CN 2023114543 W CN2023114543 W CN 2023114543W WO 2024041583 A1 WO2024041583 A1 WO 2024041583A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
cropping
area
display
cropped
Prior art date
Application number
PCT/CN2023/114543
Other languages
English (en)
French (fr)
Inventor
朱培
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024041583A1 publication Critical patent/WO2024041583A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus

Definitions

  • the present application relates to the field of electronic technology, and in particular to a window cutting method and electronic equipment.
  • terminals such as mobile phones have become electronic devices that are frequently used in people's daily lives and work.
  • users can use mobile phones to browse news information, watch videos, conduct online shopping, etc.
  • the user is browsing news information on his mobile phone.
  • the window of the instant messaging application will be opened in the foreground, and the window will cover the news information, resulting in the user being unable to browse the complete content of the news information. Decrease user experience.
  • the purpose of this application is to provide a window cropping method and an electronic device to improve the user's operating experience of the electronic device.
  • a first aspect provides a window cropping method, which method includes: in response to a first operation, displaying a first window, where the first window is a floating window, one of split-screen windows, or a full-screen window; in response to a first operation; The second operation is to crop the first window, wherein the cropping range of the first window is related to the second operation or the currently displayed content in the first window; display the cropped first window.
  • the cropping range of the first window is related to the second operation or the display content in the first window. That is to say, when the second operation is different, the cropping range of the first window is different. In this way, the user can realize cropping of different ranges of the first window by adjusting the second operation to achieve free cropping; or, the display in the first window
  • the cropping range of the first window is different. For example, when the first window displays the first interface, the cropping range is the middle range. When the second interface that is different from the first interface is displayed, the cropping range is the upper left corner.
  • the electronic device can determine the appropriate cropping range based on the current display content of the first window to achieve precise cropping.
  • the window cropping method provided by the embodiments of the present application can, on the one hand, reduce the degree of occlusion of the lower window (for example, the desktop), avoid as much as possible the user's need to switch between different windows due to window occlusion, and save operating steps. , to enhance the operating experience; on the other hand, it can achieve free cutting and precise cutting.
  • cropping the first window includes: in response to the second operation, retaining the information in the target area of the first window and canceling the display.
  • the second operation includes: a third operation for calling up a cropping frame and a fourth operation for confirming cropping, and in response to the second operation, performing a step on the first window.
  • Cropping includes: in response to the third operation, displaying a cropping frame in the first window, the area of the cropping frame being smaller than the area of the first window, and the first window in the cropping frame circle.
  • the target area within the first window is the cropping range of the first window, and the target area is related to the currently displayed content of the first window; in response to the fourth operation, canceling the display of the first window For other areas other than the target area, the target area is retained.
  • the cropping frame automatically circles the target area in the first window.
  • the user only needs to input and confirm the cropping operation to crop out the target area.
  • the operation is more convenient, and the target area is generally the user's The area you want to crop out is in your mind, so using this method will result in higher cropping accuracy.
  • the display position and/or the display area of the cropping frame are adjustable. That is to say, when a cropping frame appears on the electronic device, the cropping frame automatically circles the target area in the first window. If the target area is not the area that the user wants to crop out, the display position and/or display area of the cropping frame can be adjusted. , to reselect the target area. In this way, users can crop according to their own needs and have a better experience.
  • the target area includes at least one of the following: an area in the first window where the user is interested in information. domain; the user's area of interest includes the area in the first window where the number of user interactions is greater than the preset number; the area where the display content with the highest priority among multiple types of display content in the first window is located, the Multiple types of display content include: at least two of text, image, and video; a default area within the first window; and a user-specified area within the first window.
  • the cropping frame automatically circles the target area in the first window (for example, the user's area of interest, the highest priority area, the default area, the user-specified area, etc.), so that the user only needs to enter
  • the target area can be cropped after confirming the cropping operation.
  • the operation is more convenient.
  • the target area is generally the area that the user wants to crop out, so using this method, the cropping accuracy is higher.
  • the second operation includes: a third operation for calling up the cropping frame, a fourth operation for adjusting the cropping frame, and a fifth operation for confirming cropping.
  • the second operation is to determine the cropping range of the first window, including: in response to the third operation, displaying a cropping frame in the first window; and the entire display area of the first window in the cropping frame circle. , and the display position and/or display area of the cropping frame can be adjusted; in response to the fourth operation, the display position and/or the display area of the cropping frame are adjusted; in response to the fifth operation, the display of the cropping frame is canceled The area enclosed by the cropping frame that has not been adjusted in the first window is retained.
  • the cropping frame automatically circles the entire area of the first window.
  • the user can adjust the cropping frame to circle the target area for cropping. In this way, the user can crop according to their own needs. Achieve free window cutting and a better experience.
  • the display position and/or display area of the cropping frame can be adjusted, including: when receiving a drag operation for the first edge or the first vertex of the cropping frame, adjusting the The display area of the cropping frame; and/or, when receiving a drag operation for the first position in the cropping frame, adjusting the display position of the cropping frame. In this way, the window can be freely cropped.
  • the method further includes: receiving an operation indicating to restore the first window, and controlling the first window to restore to a state before cropping.
  • the cropped window can be restored to facilitate users to handle business in the original window and provide a better experience.
  • the second operation when the cropping button is displayed in the first window, the second operation includes a click operation on the cropping button; or, when the cropping button is not displayed in the first window, the second operation
  • the second operation includes an operation for calling up the cropping button and a click operation on the cropping button; or, the first window includes a status bar, and the second operation includes a long press on the status bar. and/or double-click operation. It should be noted that this is only an example of the second operation, and the second operation can also be other types of operations, which are not limited by the embodiments of the present application.
  • the first window includes a status bar
  • the status bar includes one or more shortcut icons for controlling the first window; after cropping the first window, The status bar is retained in the first window.
  • the status bar includes various shortcut icons, and users like to use the status bar to control windows.
  • the status bar in the first window is retained. This allows the user to control the cropped first window through the status bar without changing the user's usage habits, and the operating experience is better. good.
  • cropping the first window in response to the second operation, includes: in response to the second operation, keeping the layout of the displayed content in the first window unchanged, and cropping the first window.
  • the window is cropped.
  • the layout of the content displayed in the window after cropping can be consistent with the layout of content displayed in the window before cropping. The user can then process business in the window after cropping, and the experience is better.
  • the method further includes: after cropping the first window, displaying the information of the second region in the second window in the first region where the first window is cropped;
  • the second window is located below the first window, and the second area is the area in the second window that is covered by the first area in the first window before the first window is cropped. That is to say, before the first window is cropped, the first area in the first window blocks the second area of the lower second window. After the first area is cropped, the display content of the second area in the lower second window is exposed. , using this cropping method can alleviate the occlusion of the lower window.
  • the method further includes: when an input operation is received in the first area where the first window is cropped, the second area in the second window responds to the input operation in response. That is to say, before the first window is cropped, the first area in the first window blocks the second area of the lower second window. After the first area is cropped, the display content of the second area in the lower second window is exposed. . When an input operation is received in the first area, the second area in the lower second window responds. Using this cropping method can alleviate the occlusion of the lower window and increase the user's touch area on the lower window.
  • displaying the first window in response to the first operation includes: drawing the first graphic according to the bound size of the first window in response to the first operation, and drawing the first graphic in response to the first operation.
  • the first graphic is displayed in the first window; in response to the second operation, cropping the first window includes: in response to the second operation, setting a crop size of the first window, and the crop size is used to Indicates the size of the first window after being cropped; draw a second graphic based on the crop size of the first window, and add all the cropped
  • the second graphic is displayed in the first window.
  • windows are only set with a bound size and not a crop size.
  • the electronic device sets the crop size of the first window, and crops the first window according to the crop size. It is understandable that the crop size is smaller than the bound size, so the cropped window has less obstruction to the underlying window.
  • the method further includes: keeping the bound size unchanged so that the second graphic overlaps the first graphic.
  • the layout of the sections remains unchanged.
  • the bound size determines the layout of the display content of the window. If the bound size remains unchanged, the layout of the display content of the window remains unchanged.
  • the window size is adjusted by changing the bound size. However, by adjusting the bound size, the display content layout of the window is adjusted.
  • the electronic device sets the crop size of the first window, and, while keeping the bound size unchanged, crops the first window according to the crop size, that is, while maintaining the layout of the first window. In case of change, the first window is cropped.
  • the method further includes: receiving a first input event, the first input event including an operation position; comparing the operation position with the crop size of the first window; if the The operating position is located outside the crop size, and the second window responds to the first input event, and the second window is a lower window of the first window; if the operating position is located within the crop size, the second window responds to the first input event.
  • the cropped first window responds to the first input event.
  • the electronic device compares the coordinate position of the input event with the bound size of the window. If it is within the bound size, the window responds to the input event. However, in the embodiment of the present application, the electronic device compares the input event with the bound size of the window. The coordinate position is compared with the crop size of the window. If it is within the crop size, the cropped window responds to the input event. Otherwise, the lower window responds to the input event.
  • the method before comparing the operation position with the crop size of the first window, the method further includes: determining that the operation position is within the bound size of the first window, reading the The flag bit of the first window, wherein the flag bit is used to indicate that the first window is currently in any one of the cropped state, the uncropped state, and the cropping state; according to the flag bit of the first window , confirming that the first window is in a cropped state. That is to say, after receiving an input event, the electronic device first compares the coordinate position of the input event with the bound size of the window to find the target window for the input event, and then determines the target through the flag bit of the target window. Whether the window is cropped.
  • the target window responds to the input event directly. If the target window is cropped, continue to compare the coordinate position of the input event with the crop size of the target window. If it is within the crop size, the cropped window will respond. If it is outside the crop size, the underlying window will respond.
  • an electronic device including:
  • processor memory, and, one or more programs
  • the one or more programs are stored in the memory, and the one or more programs include instructions that, when executed by the processor, cause the electronic device to perform the first aspect as described above. The execution steps of the first device in the method.
  • a computer-readable storage medium is also provided.
  • the computer-readable storage medium is used to store a computer program.
  • the computer program When the computer program is run on a computer, it causes the computer to execute as described in the first aspect. Methods.
  • a computer program product including a computer program, which when the computer program is run on a computer, causes the computer to execute the method steps described in the first aspect.
  • a chip is also provided.
  • the chip is coupled to a memory in an electronic device, and is used to call a computer program stored in the memory and execute the technical solution of the first aspect.
  • "coupling” means Refers to two parts that are directly or indirectly combined with each other.
  • Figure 1 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of the software structure of an electronic device provided by an embodiment of the present application.
  • Figures 3 to 4 are schematic diagrams of an application scenario provided by an embodiment of the present application.
  • Figures 5 to 6 are schematic diagrams of another application scenario provided by an embodiment of the present application.
  • Figures 7 to 8 are schematic diagrams of another application scenario provided by an embodiment of the present application.
  • 9A to 9B are cropped schematic diagrams of a floating window provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of calling up a cropping frame according to an embodiment of the present application.
  • Figure 11 is a schematic diagram of adjusting a cropping frame provided by an embodiment of the present application.
  • Figure 12 is another schematic diagram of cutting a floating window provided by an embodiment of the present application.
  • Figures 13 to 14 are schematic diagrams of a cropped window provided by an embodiment of the present application.
  • FIGS 15 to 16 are schematic diagrams of cropping and restoration provided by an embodiment of the present application.
  • Figure 17 is a schematic flow chart of a window cropping method provided by an embodiment of the present application.
  • Figure 18 is another schematic flowchart of a window cropping method provided by an embodiment of the present application.
  • Figure 19 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the at least one involved in the embodiments of this application includes one or more; where multiple means greater than or equal to two.
  • words such as “first” and “second” are only used for the purpose of distinguishing the description, and cannot be understood to express or imply relative importance, nor can they be understood to express Or suggestive order.
  • the first window and the second window do not represent the importance of the two or the order of the two, but are only used to differentiate the description.
  • "and/or" only describes the association relationship, indicating that three relationships can exist, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone. these three situations.
  • the character "/" in this article generally indicates that the related objects are an "or" relationship.
  • the window cropping method provided by the embodiment of this application is suitable for electronic devices.
  • the electronic device can be a portable electronic device such as a mobile phone, a tablet computer, or a laptop; it can also be a wearable device such as a watch, a bracelet; or it can be a smart home device such as a television, a refrigerator; or it can be It can be a vehicle-mounted device, etc., or it can also be a virtual reality (Virtual Reality, VR) device, an augmented reality (Augmented Reality, AR) device, a mixed reality technology (Mixed Reality, MR) device, etc., in short, the embodiment of the present application
  • the specific type of electronic equipment is not limited.
  • FIG. 1 shows a schematic structural diagram of an electronic device.
  • the electronic device may be, for example, a mobile phone or the like.
  • the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait.
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • Interfaces may include integrated circuits (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, pulse code modulation (PCM) interface, universal asynchronous receiver/transmitter (UART) interface, mobile Mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and/or universal serial bus (universal serial bus) bus, USB) interface, etc.
  • I2C integrated circuits
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile Mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can separately couple the touch sensor 180K, charger, flash, camera 193, etc. through different I2C bus interfaces.
  • the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • processor 110 may include multiple sets of I2S buses.
  • the processor 110 can be coupled with the audio module 170 through the I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100 .
  • the processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, display screen 194, wireless communication module 160, audio module 170, sensor module 180, etc.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through them. This interface can also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationships between the modules illustrated in the embodiment of the present invention are only schematic illustrations and do not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the wireless communication function of the electronic device can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, etc.) used in electronic devices.
  • WLAN wireless local area networks
  • Wi-Fi wireless fidelity
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
  • the display screen 194 is used to display the display interface of the application, etc.
  • Display 194 includes a display panel.
  • the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the stored program area can store an operating system, software code of at least one application program, etc.
  • the storage data area can store data (such as images, videos, etc.) generated during the use of the electronic device.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, general-purpose flash memory, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, save pictures, videos, etc. files on an external memory card.
  • the electronic device can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through one or more speakers 170A, or listen to external playback scenarios such as hands-free calls.
  • the receiver 170B also called “earpiece” may be one or more and is used to convert audio electrical signals into sound signals.
  • the voice can be heard by bringing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the headphone interface 170D is used to connect wired headphones.
  • the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals.
  • pressure sensor 180A may be disposed on display screen 194 .
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device about three axes (ie, x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B can be used for image stabilization.
  • Air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • Magnetic sensor 180D includes a Hall sensor.
  • the electronic device can use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the acceleration sensor 180E can detect the acceleration of the electronic device in various directions (generally three axes). When the electronic device is stationary, the magnitude and direction of gravity can be detected.
  • Distance sensor 180F for measuring distance.
  • Electronic devices can measure distance via infrared or laser.
  • Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • Electronic devices emit infrared light through light-emitting diodes.
  • Electronic devices use photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device. When insufficient reflected light is detected, the electronic device can determine that there is no object near the electronic device.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic device can adaptively adjust the brightness of the display screen 194 based on perceived ambient light brightness.
  • Fingerprint sensor 180H is used to collect fingerprints.
  • Temperature sensor 180J is used to detect temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K can be disposed on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human body's vocal part.
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to realize contact and separation from the electronic device.
  • the components shown in Figure 1 do not constitute a specific limitation to the electronic device.
  • the electronic device in the embodiment of the present invention may include more or fewer components than in FIG. 1 .
  • the combination/connection relationship between the components in Figure 1 can also be adjusted and modified.
  • Figure 2 is a software structure diagram of an electronic device provided by an embodiment of the present application.
  • the software structure of electronic equipment can be a layered architecture.
  • the software can be divided into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the electronic device is an Android system, it may include an application layer (referred to as the application layer), an application framework layer (referred to as the framework layer) (framework, FWK), a hardware layer, and so on.
  • the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
  • the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions. For example, as shown in Figure 2, the application framework layer includes Window Manager Service (WMS), View Control (Surface Control), and Input Manager (Input Manager).
  • WMS Window Manager Service
  • View Control View Control
  • Input Manager Input Manager
  • the Input Manager is responsible for obtaining the user's input events (for example, the user's clicks, long presses, etc. on the display) and distributing the input events to the windows of each application. Specifically, after Input Manager receives an input event, it will determine which window to distribute the input event to. For example, Input Manager compares the coordinate position in the input event (that is, the coordinate position where the operation occurs) with the Bound size of the window. Comparison is made, and if it is within the Bound size of a certain window, the input event is dispatched to the window for processing. Among them, the Bound size of the window will be introduced below.
  • WMS is responsible for managing windows, including window creation, display, area adjustment, etc.
  • each window is represented by a WindowState
  • the WindowState includes a Bound, which represents the size of the window.
  • WMS is responsible for managing the WindowState of each window (such as managing the Bound in WindowState), thereby realizing the management of the window.
  • the Bound of the window represents the size of the window
  • SurfaceControl designs the layout of the content displayed in the window based on the Bound size. For example, assuming that the Bound size of the window is equal to the size of the display screen, that is, if the window is to be displayed in full screen, the displayed content will be laid out in a full screen display manner. Assuming that the Bound size of the window is smaller than the size of the display screen, that is, the window is to be displayed in a floating manner, then the layout of the displayed content is designed according to the Bound size, and the window is displayed in a floating manner. Simply put, the Bound size of the window is related to the display area of the window and the layout of the display content in the window.
  • WMS can monitor the user's action of resizing the window, and if detected, adjusts the Bound of the window.
  • SurfaceControl adjusts the layout of the information in the window based on the adjusted Bound. In this way, the layout of the information in the window is dynamically adjusted when the user adjusts the size of the window.
  • the Bound of the window represents the size of the window, which is used to compare with the coordinate position in the input event to determine whether the input event occurs within the window.
  • the Input Manager receives an input event that includes the coordinate position of the user's operation. Input Manager compares the coordinate position of the input event with the bound size of the window. If it is within the bound size of the window, it means that the input event occurred in the window, and then the input event is distributed to the window for processing.
  • Bound size has two main functions. One is to determine the layout of the content displayed in the window. When the Bound size changes, the layout within the window changes. The second is to compare with the coordinate position in the input event to determine whether the input event occurs within the window.
  • the WindowState of each window corresponds to a Surface for the final screen display.
  • SurfaceControl draws graphics based on the bound size of the window (including: designing the layout of the content displayed in the window based on the bound size of the window, and then drawing layers), and then displays the drawn graphics on the display.
  • the Input Manager is still responsible for obtaining the user's input events and distributing the input events to the windows of each application. That is, when the Input Manager receives an input event, it will determine which window to distribute the input event to. Different from the current technology, in this application, the Input Manager compares the coordinate position in the input event with the Bound size of the window. If it is within the Bound size of a certain window, it will continue to determine whether the window has a corresponding Crop size, if there is one, you need to continue to compare the coordinate position in the input event with the crop size of the window. If it is within the crop size of the window, it will be processed by the cropped window. If it is not within the crop size of the window, , it is processed by the lower window of the cropped window.
  • each window is represented by a WindowState, which includes not only the boundary (Bound) size, but also the crop (crop) size.
  • the functions of crop size include: 1. Crop size is used to indicate the cropping size of the window, such as what size the cropped window should be. It is understandable that the crop size is less than or equal to the Bound size. 2. The crop size is used to compare with the coordinate position in the input event to determine whether the input event occurs within the cropped window.
  • SurfaceControl is still responsible for layer processing and composite display of the window. Different from the current technology, in this application, SurfaceControl can also draw graphics based on the crop size of the window, and then display the drawn graphics through the display screen.
  • Figure 2 lists three modules (WMS, Input Manager, SurfaceControl) included in the application framework layer.
  • the application framework layer can also include more or fewer modules.
  • it may also include a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. (not shown in the figure).
  • the content provider is used to store and retrieve data and make the data accessible to applications.
  • Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
  • a view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 . For example, call status management (including connected, hung up, etc.).
  • the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, and more.
  • the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
  • the Hardware Abstraction Layer is responsible for the communication bridge between the upper layer (i.e., application framework layer) and the lower layer (i.e., kernel layer).
  • HAL includes sensor modules, graphics processing libraries, media libraries, etc. Taking the sensor module as an example, the sensor module in the HAL can call the sensor driver in the kernel layer (such as a touch sensor driver) to drive the sensor operation in the hardware layer; or, the sensor module in the HAL can call the sensor driver in the kernel layer (such as a touch sensor driver).
  • the input events reported by the driver are reported to the input manager in the application framework layer, and the input manager distributes them to the corresponding windows.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the hardware layer includes various hardware in electronic devices, such as displays, sensors (for example, acceleration sensors, gravity sensors, touch sensors), and so on.
  • sensors for example, acceleration sensors, gravity sensors, touch sensors
  • the window clipping method provided by the embodiment of the present application can be implemented by the software architecture shown in Figure 2, and the specific implementation process will be described later (for example, Figure 17 or Figure 18).
  • an electronic device such as a mobile phone
  • an application such as an instant messaging application
  • the window of the application will cover the current interface of the electronic device, causing the user to be unable to continue operating on the current interface.
  • the electronic device displays a desktop 301 .
  • the desktop 301 includes icons of various applications.
  • the electronic device receives an operation for the icon of the Huawei video application
  • the Huawei video application is opened and the interface 302 shown in (b) of Figure 3 is displayed.
  • the interface 302 is displayed in full screen and completely covers the desktop 301. This method of completely covering the old interface with the new interface has a low user experience.
  • the electronic device displays the Huawei video application interface 302 in full screen. If the user still wants to continue operating on the desktop 301 at this time, It is necessary to return to the desktop 301 from the interface 302 (for example, exit the Huawei video application or switch the Huawei video application to the background, etc.). It should be understood that after the electronic device returns to the desktop 301, it may be necessary to open the interface 302 of the Huawei video application again. In other words, it is necessary to repeatedly switch between the desktop 301 and the interface 302. It can be seen that this way of completely covering the old interface with the new interface is cumbersome and has a poor user experience.
  • embodiments of the present application provide a window cropping method.
  • the user can crop the window. For example, for a full-screen window, the user can crop the window to reduce its display area. This will reduce the degree of occlusion of the underlying window (for example, the desktop) and avoid as much as possible the user's need to Switch between different windows to save operating steps and improve the operating experience.
  • the window cropping method provided by this application may include: in response to the first operation, displaying the first window.
  • the first window may be a full-screen window, a floating window, a split-screen window, or the like.
  • the electronic device crops the first window.
  • the cropping range of the first window is related to the second operation or the display content of the first window. That is to say, when the second operation is different, the cropping range of the first window is different. In this way, the user can realize cropping of different ranges of the first window by adjusting the second operation to achieve free cropping; or, the display in the first window When the content is different, the cropping range of the first window is different.
  • the cropping range is the middle range.
  • the cropping range is the upper left corner.
  • the electronic device can determine the appropriate cropping range based on the current display content of the first window to achieve precise cropping.
  • the window cropping method provided by the embodiments of the present application can, on the one hand, reduce the degree of occlusion of the lower window (for example, the desktop), avoid the user's need to switch between different windows due to window occlusion, and save operating steps. Improve the operating experience; on the other hand, it can achieve free cutting and precise cutting.
  • the electronic device can crop the window 302 through a cropping frame (to be introduced later). For example, the portion of the window 302 located within the cropping frame 303 is retained and the portion located within the cropping frame is retained. Parts other than 303 will be cropped. There may be multiple methods for cropping the window through the cropping box, such as at least one of the following method 1 and method 2.
  • the cropping frame 303 when the cropping frame 303 is called up, it surrounds the target area in the window 302 (for example, the area where the video is located).
  • the target area is very likely to be the area that the user wants to keep. Therefore, the user only needs to enter the confirmation operation to complete the cropping.
  • the user only inputs two operations, one is to call up the cropping box, and the other is to confirm the cropping, which saves operating steps and provides a better experience.
  • the electronic device needs to determine the target area within the window 302 before it can display the cropping frame 303 in the target area. Among them, the method of determining the target area will be introduced later.
  • the user can adjust the cropping frame 303.
  • the display area of the cropping frame 303 can be changed by dragging the upper edge, lower edge, left edge, right edge or any vertex of the cropping frame 303; by dragging the first position (for example, the center point) of the cropping frame 303 The drag operation can change the display position of the cropping frame 303.
  • the window 302 is cropped according to the adjusted cropping frame 303 (located in the window 302
  • the part within the cropping frame 303 is retained, and the part outside the cropping frame 303 is cropped out).
  • FIG. 3(b) when the electronic device receives an operation for calling up the cropping frame (the specific implementation will be introduced later), the cropping frame 303 shown in FIG. 4(c) is displayed.
  • the difference from method one is that in method one, when the cropping frame 303 is called out, it surrounds the target area in the window 302 (that is, the area where the video is located).
  • method two when it is called out, the cropping frame 303 surrounds the target area of the window 302. All display areas.
  • the user can crop the window 302 by changing the area and position of the cropping frame 303. For example, in (c) of FIG.
  • the electronic device receives an operation of dragging the lower edge of the cropping frame 303 upward, and adjusts the size of the cropping frame 303 , as shown in (d) of FIG. 4 , in which the parts outside the cropping frame 303 are Use slashes or a dark background to indicate that this part of the content will be cropped.
  • the electronic device receives an operation to confirm cropping (the specific implementation method will be introduced later), it will crop the oblique line part and retain the part within the cropping box 303, as shown in the interface shown in Figure 4 (e), cropping box 303 Cancel display.
  • the cropping frame 303 surrounds the entire display area of the window 302 when called up, and the user can flexibly adjust the area and/or position of the cropping frame 303 according to needs to achieve precise cropping.
  • the display position and/or display area of the small window can be adjusted.
  • the user can move the position of the small window so that Perform operations on the lower window (i.e. desktop 301).
  • a floating window (referred to as a floating window) can be understood as a window that is not displayed in a fixed position or fixed size, but can be automatically dragged.
  • the display area of the floating window is smaller than the area of the display screen.
  • the floating window may be a freeform window customized by Huawei.
  • the freeform window can be a system-level floating window that remains on top regardless of whether the user switches pages or opens other applications or desktops.
  • the electronic device displays the window 501 of the browser application in full screen.
  • the window 502 is displayed in a floating manner, as shown in (b) of FIG. 5 .
  • the "operation for opening the floating window of the instant messaging application” can be opened through the multi-tasking interface or through the sidebar (sidebar), which is not explained in detail in this application.
  • the electronic device can crop the floating window 502 in (b) of Figure 5 .
  • the electronic device when it receives an operation for calling up a cropping frame, it displays the cropping frame 303 as shown in (a) of FIG. 6 .
  • the cropping frame 303 surrounds the target area in the window 502 (ie, the lower area of the window 502).
  • the window 502 is cropped into a small window as shown in (b) of Figure 6 , and the cropped area displays the information of the lower window (ie, the window 501).
  • the user only inputs two operations, one is to call up the cropping box, and the other is to confirm the cropping, which saves operating steps and provides a better experience.
  • the electronic device needs to determine the target area within the window 502 before displaying the cropping frame 303 in the target area.
  • the method of determining the target area will be introduced later. It can be understood that if the target area enclosed when the cropping frame 303 is called is not the area that the user wants to retain, at this time, the user can adjust the position and/or area of the cropping frame 303 to crop out the part that the user wants. . After the display position and/or display area of the cropping frame 303 is adjusted, if an operation to confirm cropping is received, the window 302 is cropped according to the adjusted cropping frame 303 .
  • FIG. 5(b) when the electronic device receives an operation for calling up the cropping frame (the specific implementation will be introduced later), the cropping frame 303 shown in FIG. 6(c) is displayed.
  • the cropping frame 303 surrounds the target area in the window 502 when it is called.
  • the cropping frame 303 when the cropping frame 303 is called out, it surrounds the entire display area of the window 502 .
  • the user can crop the window 502 by changing the area and position of the cropping frame 303 . For example, in (c) of FIG.
  • the electronic device receives an operation of dragging the upper edge of the cropping frame 303 downward, and adjusts the size of the cropping frame 303 , as shown in (d) of FIG. 6 , in which the parts other than the cropping frame 303 are Parts are represented by slashes or dark backgrounds, and this part of the content will be cropped.
  • the electronic device receives an operation to confirm cropping (the specific implementation method will be introduced later)
  • the interface shown in (e) of Figure 6 is displayed, and the cropping box 303 is canceled.
  • Split-screen window means that multiple windows are displayed in split-screen mode on the display screen, with no obstruction between any two windows.
  • this article takes the split-screen display of two windows as an example, including upper and lower split screens and left and right split screens.
  • This article mainly takes the upper and lower split screens as an example, but left and right split screens or other split screen modes can also be applied.
  • the electronic device displays the window 701 of the video playback application.
  • the electronic device displays the window 701 of the video playback application and the shopping application in split-screen mode. Window 702, as shown in (b) of Figure 7 .
  • the "operation for entering the split-screen mode" can be various types of operations, such as splitting the screen with knuckles, etc., which will not be described in detail in this application.
  • the electronic device can crop the split-screen window (for example, the window 702 of the instant messaging application) in (b) of Figure 7 .
  • FIG. 7(b) when the electronic device receives an operation for calling up the cropping frame, it displays the cropping frame 303 as shown in FIG. 8(a).
  • the cropping frame 303 surrounds the target area in the window 702 (ie, the lower area of the window 702).
  • the window 702 is cropped into a small window as shown in (b) of FIG. 8 , and the cropped area displays the information of the lower window (that is, the desktop).
  • the user inputs two operations, one is to call up the cropping box, and the other is to confirm the cropping, which saves operating steps and provides a better experience.
  • the electronic device needs to first determine the target area within the window 702.
  • the method of determining the target area will be introduced later. It can be understood that if the target area enclosed when the cropping frame 303 is called is not the area that the user wants to keep, the user can adjust the position and/or area of the cropping frame 303 to crop out the part that the user wants. After the display position and/or display area of the cropping frame 303 is adjusted, when an operation to determine cropping is received, the window 302 is cropped according to the adjusted cropping frame 303 .
  • the cropping frame 303 shown in (c) of FIG. 8 is displayed.
  • the cropping frame 303 surrounds the target area in the window 702 when it is called.
  • the cropping frame 303 when the cropping frame 303 is called out, it surrounds the entire display area of the window 702 .
  • the user can crop the window 702 by changing the area and position of the cropping frame 303 .
  • (c) of FIG. 7 For example, in (c) of FIG.
  • the electronic device receives an operation of dragging the upper edge of the cropping frame 303 downward, and adjusts the size of the cropping frame 303 , as shown in (d) of FIG. 8 , in which the parts other than the cropping frame 303 are Parts are represented by slashes or dark backgrounds, and this part of the content needs to be cropped out.
  • the electronic device receives the operation of confirming the cropping frame (the specific implementation method will be introduced later)
  • the interface shown in (e) of Figure 8 is displayed, and the cropping frame 303 is canceled.
  • the display position and/or display area of the small window can be adjusted, for example, it can be below the display screen Move the position and/or adjust the area within the area (the area not occupied by window 701).
  • the electronic device displays the first window in full screen.
  • the first window may be the aforementioned application scenario 2 (that is, the window 501 of the browser application in Figure 5).
  • the second window is displayed in a floating manner, as shown in (b) of FIG. 9A .
  • the second window may be the aforementioned application scenario 2 (ie, the window 502 of the instant messaging application in Figure 5).
  • the second window is suspended above the first window and covers all or part of the first window (for example, covers the button 901 in the first window).
  • the first window and the second window may be windows of different applications (eg, Figure 5), or may be different windows of the same application.
  • the first window is the window of News A of the browser application
  • the second window is the window of News B of the browser application
  • the first window is the instant messaging application (such as )of window
  • the second window is an instant messaging application (e.g. ) with a contact, etc.
  • the electronic device can operate the second window through the cropping frame.
  • Specific methods include method one and method two.
  • the electronic device When the electronic device receives the operation for calling up the cropping frame, it displays the cropping frame 303 as shown in (a) of FIG. 9B . When called up, the cropping frame 303 surrounds the target area within the second window.
  • “operation for calling up a cropping frame” includes but is not limited to at least one of the following methods.
  • the floating window i.e., the second window
  • the "operation for calling up the cropping frame" can be a double-click and/or a long press in a blank position in the status bar. operation.
  • Method B as shown in (a) of Figure 10, a crop button 901 is displayed in the status bar of the floating window (ie, the second window), which is used to instruct cropping of the second window. Therefore, the "operation for calling up the cropping frame" may be an operation (for example, a click operation) for the cropping 901 .
  • This method makes full use of the display area in the status bar. Users can quickly find the entrance to open the cropping box and have a better experience.
  • a prompt bar 902 is displayed in the status bar of the floating window (ie, the second window).
  • the prompt bar 902 is displayed as shown in (c) of Figure 10.
  • One or more buttons are shown, for example, the crop button 903 and the full screen button 904.
  • the “operation for calling up the cropping frame” may be an operation on the cropping button 903 .
  • this method considering that if many buttons are arranged in the status bar, it will appear crowded and affect the visual experience, so some buttons can be integrated into the prompt bar 902 to achieve a simple and clean layout in the status bar.
  • the above are examples of several implementation methods of calling up the cropping frame 303, mainly taking the operation in the status bar as an example. It can be understood that there may be other ways of calling up the cropping box 303, such as voice instructions for instructing to call up the cropping box, or operations of specific keys in the drop-down/sliding-up menu, etc., this application The embodiments are not given one by one. In short, the cropping frame 303 can be called up when the second window has a status bar or does not have a status bar.
  • the electronic device needs to first determine the target area within the floating window (ie, the second window), and then display the cropping frame 303 in the target area.
  • the target area can be determined in various ways.
  • the target area is a fixed area in the second window, such as the center area, the upper left corner area, the lower right corner area, etc. That is to say, the cropping frame 303 is displayed in a fixed area in the second window when it appears.
  • the fixed area may be set by the user or set by default by the system or application, where the fixed areas set by different applications may be different.
  • the target area may be the area of interest to the user in the second window.
  • the area of interest to the user may be an area where the number of user interactions recorded by the electronic device is greater than the preset number of times in the second window.
  • the second window includes a video playback interface.
  • the user can slide left and right in the video playback interface to fast forward or rewind the video.
  • the electronic device records the user's progress in video playback.
  • the number of interactions in the interface is greater than the preset number, so the target area is determined to be the area where the video playback interface is located.
  • Method 3 When the second window includes multiple types of information (text, pictures, videos, etc.), the target area can be determined based on the priority relationship of different types of information. For example, the priority relationship may be video>picture>text.
  • the second window includes text and pictures. Since the picture has a higher priority than the text, the target area is the area where the picture is located, that is, the cropping frame is displayed in the area where the picture is located.
  • the priority may be set by the user or set by default by the system or application, which is not limited by the embodiments of this application. It is understandable that when the target area is an area that the user is interested in or an area with a higher priority appears, the cropping box will surround the current area when it appears. In this way, the probability that the user needs to manually adjust the cropping box is reduced, saving user operations. Improve operational convenience.
  • the second window is cropped, as shown in (b) of Figure 9B.
  • the "operation to confirm cropping" may be an operation in which the user clicks on any position in the first window or the second window, and the operation may be a click, long press, or double-click operation.
  • the cropping frame 303 surrounds the target area when it appears. If the target area is not the area that the user wants to retain, the position and/or area of the cropping frame can be changed.
  • the "operation of changing the position of the cropping frame” includes: a dragging operation for the first position (for example, the center position) of the cropping frame 303; the "operation of changing the area of the cropping frame” includes, for example: the first positioning of the cropping frame 303.
  • Drag operation of edge or first vertex can be any one of the upper, lower, left, or right edges.
  • the first vertex can be any one of the four vertices. For example, please refer to (a) of Figure 11.
  • the cropping frame 303 was originally located in the target area of the second window.
  • the cropping frame is displayed as (b) of Figure 11.
  • 303 moves up.
  • the second window is cropped according to the cropping frame 303 after the movement up, that is, the second window in the cropping frame 303 is retained. The part within the second window that is outside the cropping frame 303 is cropped.
  • the electronic device When the electronic device receives the operation for calling up the cropping frame, it displays the cropping frame 303 as shown in (c) of FIG. 9B . When called up, the cropping frame 303 surrounds the entire display area of the second window. Among them, the "operation for calling up the cropping frame" has been introduced previously and will not be repeated. When the electronic device receives an operation for adjusting the cropping frame 303, the area and/or position of the cropping frame 303 is adjusted to change the cropping range. Among them, “the operation of adjusting the cropping frame” has been introduced previously and will not be repeated. For example, in (c) of FIG.
  • the hatched area other than the cropping frame 303 may be displayed or not displayed.
  • the display that is, after the electronic device adjusts the cropping frame 303, the diagonal portion has not been cropped.
  • the diagonal portion will be cropped only when an operation to confirm the cropping is received.
  • non-display that is, the electronic device can crop out the diagonal portion while adjusting the cropping frame 303. In short, while shrinking the cropping frame 303, the area outside the cropping frame 303 is cropped out.
  • method two and method one include: in method one, when the cropping frame 303 appears, it only occupies the target area in the second window. At this time, the cropping frame 303 is located on the upper layer of the second window. The user can change the position and area of the cropping frame 303. etc., the second window is not cropped during the change process, and the second window is cropped based on the cropping box 303 until an operation to confirm the cropping is received.
  • the cropping frame 303 occupies the entire display area of the second window when it appears. The user can change the area and position of the cropping frame 303.
  • the second window has been cropped until a cancel display of cropping is received. Frame operation to cancel the display of the cropping frame.
  • the electronic device calls up the cropping frame to perform cropping through the cropping frame. It is understandable that when the cropping box is called up, the user may give up on cropping. At this time, it is necessary to exit the cropping mode and cancel the display of the cropping box. For example, when the electronic device receives an operation for canceling the cropping frame, the display of the cropping frame is canceled.
  • the "operation for canceling the cropping box" can be similar to the previous "operation for calling up the cropping box" in method A, which is a long press and/or double-click operation on a blank position in the status bar.
  • the operation of clicking the crop button 901 in the status bar of the cropped second window for example, the crop button 901 includes a selected state and In the unselected state, when button 901 is in the selected state, the cropping box appears. When button 901 is in the unselected state, the cropping box is canceled. Therefore, the user can control the display and cancellation of the cropping box through one button (i.e. button 901). ).
  • the cropping button 903 includes a selected state and an unselected state. When the button 903 is in the selected state, the cropping box appears, and when the button 903 is in the unselected state, the cropping box is canceled.
  • the cropped area displays information of the lower window (ie, the first window).
  • the first window includes the button 901, and the second window blocks the button 901 when it appears, as shown in (b) of Figure 9A.
  • the button 901 in the first window appears.
  • the electronic device receives the user's operation on the button 901, the first window responds. Therefore, through the technical solution provided by the embodiment of the present application, the blocking area of the lower window by the floating window can be reduced, and the user's operating experience in the lower window can be improved.
  • the status bar in the second window is cropped.
  • the status bar is retained when the second window is cropped.
  • the electronic device receives the operation of confirming cropping
  • the second window is cropped, but the status bar is retained in the cropped second window.
  • the electronic device reduces the area of the cropping frame 303, the second window is cropped, and the status bar is still retained in the cropped second window. In this case, it is convenient for the user to continue to use the function of the status bar in the cropped second window.
  • the position and/or area of the second window after being cropped may be adjusted.
  • its status bar can be used.
  • the electronic device receives an operation for adjusting the display position
  • the display position of the cropped second window is changed, as shown in (b) of Figure 13.
  • the "operation for adjusting the display position” may include: long pressing and dragging at a blank position in the status bar.
  • the display area of the cropped second window is changed, as shown in (b) of Figure 14.
  • the "operation for adjusting the area” includes, for example: a drag operation on any vertex or any edge of the cropped second window.
  • the recovery method includes at least one of the following.
  • the second window has been cropped into a small window.
  • the cropping frame 303 is displayed, as shown in (b) of FIG. 15 .
  • the electronic device receives an operation of dragging the upper edge of the cropping frame 303 upward, the small window gradually returns to the second window, as shown in (c) of Figure 15 .
  • the display of the cropping frame is canceled, as shown in (d) of Figure 15 .
  • the cropped second window is manually restored through the cropping box.
  • the second method can realize "one-click restoration", that is, through one operation, the cropped second window can be restored to the state before cropping.
  • a mark 1601 appears on the display screen. This mark 1601 is used to implement "one-key recovery".
  • the mark 1601 may be displayed in the cropped second window or in the first window. To make it easier for users to notice the mark, it can be displayed suspended on the top layer.
  • the electronic device receives the operation on mark 1601, it automatically returns to the state before the second window is cropped in (b) of Figure 16 .
  • the electronic device has two different ways of cropping the window through the cropping box (ie, method one and method two), so the specific principles of these two methods are introduced below.
  • the flowchart shown in Figure 17 is the implementation principle of the first method
  • the flowchart shown in Figure 18 is the implementation principle of the second method. As shown in Figure 17, the process includes:
  • S1 corresponds to (a) of Figure 9A.
  • S1 may include multiple steps.
  • Input Manager receives the input event used to open the first window and sends the input event to WMS.
  • WMS creates the windowstate of the first window.
  • the windowstate includes the Bound corresponding to the first window.
  • the Bound is used to indicate the size of the first window.
  • WMS sends the Bound size of the first window to Surface Control.
  • Surface Control draws graphics based on the Bound size of the first window so that the first window is displayed on the display. For example, after Surface Control draws the graphics of the first window, it can call the display driver in the bottom layer (such as the kernel layer) to control the display of the first window through the display driver.
  • the Input Manager receives the first input event, and the first input event is used to instruct the second window to be suspended and displayed.
  • the first input event includes operation time, operation location, and operation type (such as click, long press, drag, etc.).
  • operation type such as click, long press, drag, etc.
  • the first input event may be an operation of opening a second window in the multitasking interface or sidebar.
  • Input Manager sends the first input event to WMS.
  • WMS stores the position information of all elements currently displayed on the display screen. For example, if there are multiple buttons displayed on the display screen, WMS can store the position of each button.
  • WMS receives the first input event When , it can be determined which key operation on the display screen the first input event is for. If it is an operation for a key used to open the second window (for example, the key is located in the sidebar), then S4 is executed.
  • WMS establishes the window state (windowstate) corresponding to the second window; the windowstate includes the Bound corresponding to the second window, and the Bound is used to indicate the size of the second window.
  • Bound size when an electronic device opens a floating window, its corresponding Bound size may be set by the system by default or set by the user, which is not limited in the embodiments of this application. It is understandable that the Bound size of the floating window is smaller than the size of the display screen.
  • WMS sends the Bound size of the second window to Surface Control.
  • S6 Surface Control draws graphics according to the Bound size of the second window, and the layout of the content displayed in the graphics is related to the Bound size.
  • the Bound size of the window determines the layout mode of the displayed content of the window. For example, for the same window, when the Bound size is full screen, the window has a layout mode, and when the Bound size is non-full screen , inside the window is another layout method. Specifically, the corresponding relationship between the Bound size of the window and the layout of the information in the window is determined by the application corresponding to the window. For example, when an application is released, the layout of the information in the window corresponding to the application's window under different Bound sizes will be provided. Therefore, Surface Control determines the layout of the display content in the second window based on the Bound size of the second window, and then draws graphics based on this layout.
  • S7 may correspond to (b) in Figure 9A.
  • the Input Manager receives the second input event, and the second input event is used to call out the cropping frame.
  • Input Manager sends the second input event to WMS.
  • WMS sets the cropping status of the second window to being cropping.
  • WMS can set the cropping state (CropState) of each window, which includes, for example, three cropping states: non-cropping state, cropping state, and cropped state.
  • the non-cropping state is, for example, the state (b) in Figure 9A
  • the cropping state is, for example, (a), (c)-(d) of Figure 9B, that is, the state where the cropping frame 303 is displayed
  • the cropped state is, for example, the states (b) and (e) in FIG. 9B .
  • WMS when WMS sets the crop state (CropState) of each window, it can be set through flag bits.
  • the flag bits may be 11, 10, 00, etc., where 11 represents the non-cropping state, 10 represents the cropping state, and 00 represents the cropped state.
  • the flag bit can also be NONE, CROPPING, and CROPPED, where NONE represents the non-cropping state, CROPPING represents the cropping state, and CROPPED represents the cropped state.
  • S10 can be executed or not, so S10 is represented by a dotted line in Figure 17.
  • WMS sends a command to draw a cropping frame to Surface Control.
  • S12 Surface Control displays the cropping frame, and the target area in the second window is circled in the cropping frame.
  • the cropping frame is shown in (a) of Figure 9B.
  • the Input Manager receives the third input event, and the third input event is used to indicate confirmation of cropping.
  • the electronic device can also adjust the position and/or area of the cropping frame based on user operations.
  • Input Manager sends the third input event to WMS.
  • WMS determines that the bound size of the second window remains unchanged, and determines the crop size of the second window.
  • the cropping frame surrounds the target area in the second window, so the crop size is the size of the target area.
  • WMS sends the crop size of the second window to Surface Control.
  • WMS can also send the command to keep the bound size of the second window unchanged to Surface Control, or, if by default, WMS has sent the bound size of the second window to Surface Control, if the bound size has not been changed. update, there is no need to send it again. Therefore, if Surface Control does not receive the new bound size, the bound size of the second window will not change by default.
  • the bound size of the second window determines the layout of the information in the second window. Since the bound size remains unchanged, the layout of the information in the second window remains unchanged. Therefore, cropping the second window is different from adjusting the area of the second window. When the area of the second window is adjusted, the bound size changes, so the layout of the information in the second window changes after the area is adjusted. However, when the area of the second window is adjusted, the bound size changes. When the second window is cropped, since the bound size remains unchanged, the layout is the same before and after cropping.
  • the cropped second window is as shown in (b) of Figure 9B.
  • WMS sets the cropping status of the second window to cropped.
  • the electronic device receives an input operation in the cropped area, the first window located below the second window responds to the input operation.
  • the specific implementation process includes:
  • the Input Manager receives the fourth input event, and the fourth input event is used to indicate operations within the cropped area of the second window.
  • the Input Manager determines that the fourth input event occurs within the bound size of the second window.
  • the Input Manager identifies the cropping state of the second window. If it is the cropped state, S24 is executed. If it is the uncropped state or the cropping state, the fifth input event is distributed to the second window.
  • the Input Manager can identify the cropping status of the second window through the flag bit of the second window, where the flag bit is used to indicate that the window is at least one of cropped, uncropped, and being cropped. Please refer to the previous introduction for flag bits.
  • S22 and S23 can be executed or not, so they are represented by dotted lines in the figure.
  • the Input Manager determines whether the fourth input event is within the crop of the second window. If so, it is distributed to the second window for processing, that is, S25. Otherwise, it is distributed to the first window for processing, that is, S26. .
  • Input Manager distributes the fourth input event to the second window.
  • Input Manager distributes the fourth input event to the first window.
  • Figure 18 Please refer to Figure 18 for the implementation principle of the second method when calling up the cropping frame. As shown in Figure 18, the process includes:
  • the Input Manager receives the first input event, and the first input event is used to instruct the second window to be suspended and displayed.
  • Input Manager sends the first input event to WMS.
  • WMS establishes the window state (windowstate) corresponding to the second window; the windowstate includes the Bound corresponding to the second window, and the Bound is used to indicate the size of the second window.
  • WMS sends the Bound size of the second window to Surface Control.
  • S1807 may correspond to (b) in Figure 9A.
  • the Input Manager receives the second input event, and the second input event is used to call out the cropping box.
  • Input Manager sends the second input event to WMS.
  • WMS sets the cropping status of the second window to being cropping.
  • S1810 can be executed or not, so S1810 is represented by a dotted line in Figure 18 .
  • WMS sends a command to draw a cropping box to Surface Control.
  • the cropping frame is shown in (c) of Figure 9B.
  • the Input Manager receives a third input event, and the third input event is used to instruct the area and/or size of the cropping frame to be adjusted.
  • the third input event may be the operation of dragging the upper edge of the cropping frame 303 downward in (d) of FIG. 9B .
  • Input Manager sends the third input event to WMS.
  • WMS sends an instruction to redraw the cropping box to Surface Control.
  • the Input Manager receives the fourth input event, and the fourth input event is used to indicate confirmation of cropping.
  • Input Manager sends the fourth input event to WMS.
  • WMS keeps the bound size of the second window unchanged and determines the crop size of the second window.
  • WMS sends the crop size of the second window to Surface Control.
  • WMS sets the cropping status of the second window to cropped.
  • the electronic device receives an input operation in the cropped area, the first window located below the second window responds to the input operation.
  • the specific implementation process includes:
  • the Input Manager receives the fifth input event.
  • the fifth input event is used to indicate operations within the cropped area of the second window.
  • the Input Manager determines that the fifth input event occurs within the bound size of the second window.
  • the Input Manager identifies the cropping state of the second window. If it is the cropped state, S1827 is executed. If it is the uncropped state or the cropping state, the fifth input event is distributed to the second window.
  • S1825 and S1826 can be executed or not, so they are represented by dotted lines in the figure.
  • the Input Manager determines whether the fifth input event is within the crop of the second window. If so, it is distributed to the second window for processing, which is S1828. Otherwise, it is distributed to the first window for processing, which is S1829. .
  • Input Manager distributes the fifth input event to the second window.
  • the Input Manager distributes the fifth input event to the first window.
  • FIG. 19 is a schematic structural diagram of an electronic device 1900 provided by an embodiment of the present application.
  • the electronic device 1900 may be the aforementioned electronic device such as a mobile phone.
  • the electronic device 1900 may include: one or more processors 1901; one or more memories 1902; a communication interface 1903, and one or more computer programs 1904. Each of the above devices may communicate through one or more Bus 1905 connection.
  • the one or more computer programs 1904 are stored in the memory 1902 and configured to be executed by the one or more processors 1901, the one or more computer programs 1904 include instructions.
  • the electronic device 1900 is the electronic device mentioned above, the instruction can be used to perform the relevant steps of the electronic device in the above corresponding embodiment, for example, the relevant steps of the electronic device in the embodiment shown in FIG. 17 or FIG. 18 .
  • the communication interface 1903 is used to implement communication between the electronic device 1900 and other devices.
  • the communication interface may be a transceiver.
  • the methods provided by the embodiments of the present application are introduced from the perspective of electronic devices (such as mobile phones and tablet computers) as execution subjects.
  • the electronic device may include a hardware structure and/or a software module to implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed as a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • the terms “when” or “after” may be interpreted to mean “if" or “after” or “in response to determining" or “in response to detecting ...”.
  • the phrase “when determining" or “if (stated condition or event) is detected” may be interpreted to mean “if it is determined" or “in response to determining" or “on detecting (stated condition or event)” or “in response to detecting (stated condition or event)”.
  • relational terms such as first and second are used to distinguish one entity from another entity, without limiting any actual relationship and order between these entities.
  • the above embodiments it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), etc.
  • SSD Solid State Disk

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种窗口裁剪方法与电子设备。其中,窗口裁剪方法包括:响应于第一操作,显示第一窗口,所述第一窗口是悬浮窗口,或者分屏窗口中的一个,或者全屏窗口;响应于第二操作,对所述第一窗口进行裁剪,其中,所述第一窗口的裁剪范围与所述第二操作或所述第一窗口中当前显示内容相关;显示裁剪后的所述第一窗口。通过这种方式,电子设备可以对悬浮窗口、分屏窗口,全屏窗口等进行裁剪,以避免对下层窗口的遮挡,提升操作体验。

Description

一种窗口裁剪方法与电子设备
相关申请的交叉引用
本申请要求在2022年08月24日提交中国专利局、申请号为202211019893.5、申请名称为“一种窗口裁剪方法与电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及一种窗口裁剪方法与电子设备。
背景技术
目前,手机等终端已成为人们日常生活及工作中使用频率较高的电子设备。例如,用户可使用手机浏览新闻资讯,观看视频,进行网上购物等。假设用户正使用手机浏览新闻资讯,此时,如果用户想要通过即时通讯与家人联系,会在前台打开即时通信应用的窗口,该窗口会覆盖新闻资讯,导致用户无法浏览新闻资讯的完整内容,降低用户体验。
发明内容
本申请的目的在于提供了一种窗口裁剪方法与电子设备,用以提升用户对电子设备的操作体验。
第一方面,提供一种窗口裁剪方法,该方法包括:响应于第一操作,显示第一窗口,所述第一窗口是悬浮窗口,或者分屏窗口中的一个,或者全屏窗口;响应于第二操作,对所述第一窗口进行裁剪,其中,所述第一窗口的裁剪范围与所述第二操作或所述第一窗口中当前显示内容相关;显示裁剪后的所述第一窗口。
也就是说,电子设备可以对悬浮窗口、分屏窗口、全屏窗口等进行裁剪。而且,第一窗口的裁剪范围与第二操作或第一窗口内的显示内容相关。也就是说,第二操作不同时,对第一窗口的裁剪范围不同,如此,用户可以通过调整第二操作实现对第一窗口的不同范围的裁剪,实现自由裁剪;或者,第一窗口内显示内容不同时,对第一窗口的裁剪范围不同,例如第一窗口显示第一界面时,裁剪范围为中间范围,显示与第一界面不同的第二界面时,裁剪范围为左上角范围,总之,电子设备可以根据第一窗口的当前显示内容确定合适的裁剪范围,实现精准裁剪。总结来说,本申请实施例提供的窗口裁剪方法,一方面可以降低对下层窗口(例如,桌面)的遮挡程度,尽可能的避免由于窗口遮挡导致用户需要在不同窗口之间切换,节省操作步骤,提升操作体验感;另一方面,可以实现自由裁剪、精准裁剪。
在一种可能的设计中,所述响应于第二操作,对所述第一窗口进行裁剪,包括:响应于所述第二操作,保留所述第一窗口中目标区域内的信息,取消显示所述目标区域以外的信息,所述目标区域与所述第一窗口当前显示内容相关。也就是说,用户对第一窗口进行裁剪时,可以实现一键裁剪,即输入一个确认裁剪的操作,就可以将第一窗口内目标区域以外的信息裁剪掉。其中,关于目标区域将在后文介绍。这种方式,能够实现快速裁剪,操作便捷。
在一种可能的设计中,所述第二操作包括:用于唤出裁剪框的第三操作和用于确认裁剪的第四操作,所述响应于第二操作,对所述第一窗口进行裁剪,包括:响应于所述第三操作,在所述第一窗口内显示裁剪框,所述裁剪框的面积小于所述第一窗口的面积,且所述裁剪框圈中所述第一窗口内的目标区域,所述目标区域为所述第一窗口的裁剪范围,所述目标区域与所述第一窗口当前显示内容相关;响应于所述第四操作,取消显示所述第一窗口中所述目标区域以外的其它区域,保留所述目标区域。也就是说,电子设备出现裁剪框时,裁剪框自动圈中第一窗口内的目标区域,这样用户只需要输入确认裁剪操作就可以裁剪出目标区域,操作比较方便,而且,目标区域一般是用户心目中想要裁剪出的区域,所以采用这种方式,裁剪准确性较高。
在一种可能的设计中,所述裁剪框的显示位置和/或显示面积可调整。也就是说,电子设备出现裁剪框时,裁剪框自动圈中第一窗口内的目标区域,如果该目标区域不是用户心中想要裁剪出的区域,可以调整裁剪框的显示位置和/或显示面积,以重新选择目标区域,这种方式,用户可以根据自己的需求进行裁剪,体验较好。
在一种可能的设计中,所述目标区域包括如下至少一种:所述第一窗口内用户感兴趣信息所在的区 域;所述用户感兴趣区域包括所述第一窗口内用户交互次数大于预设次数的区域;所述第一窗口内多种类型的显示内容中优先级最高的显示内容所在的区域,所述多种类型的显示内容包括:文字、图像、视频中的至少两种;所述第一窗口内默认区域;所述第一窗口内用户指定区域。也就是说,电子设备出现裁剪框时,裁剪框自动圈中第一窗口内的目标区域(例如,用户感兴趣区域、优先级最高区域,默认区域、用户指定区域等),这样用户只需要输入确认裁剪操作就可以裁剪出目标区域,操作比较方便,而且,目标区域一般是用户心目中想要裁剪出的区域,所以采用这种方式,裁剪准确性较高。
在一种可能的设计中,所述第二操作包括:用于唤出裁剪框的第三操作、用于调整裁剪框的第四操作和用于确认裁剪的第五操作,所述响应于第二操作,确定对所述第一窗口的裁剪范围,包括:响应于所述第三操作,在所述第一窗口内显示裁剪框;所述裁剪框圈中所述第一窗口的全部显示区域,且所述裁剪框的显示位置和/或显示面积可调整;响应于所述第四操作,调整所述裁剪框的显示位置和/或显示面积;响应于所述第五操作,取消显示所述第一窗口中未被调整后的所述裁剪框圈中的区域,保留被圈中的区域。也就是说,电子设备唤出裁剪框时,裁剪框自动圈中第一窗口的全部区域,用户可以调整裁剪框以圈中目标区域进行裁剪,这种方式,用户可以根据自己的需求进行裁剪,实现窗口自由裁剪,体验较好。
在一种可能的设计中,所述裁剪框的显示位置和/或显示面积可调整,包括:在接收到针对所述裁剪框的第一边缘或第一顶点的拖拽操作时,调整所述裁剪框的显示面积;和/或,在接收到针对所述裁剪框内第一位置的拖拽操作时,调整所述裁剪框的显示位置。采用这种方式,可以实现窗口自由裁剪。
在一种可能的设计中,所述方法还包括:接收到用于指示还原所述第一窗口的操作,控制所述第一窗口还原为裁剪之前的状态。也就是说,裁剪后的窗口还可以复原,以方便用户在原来的窗口内处理业务,体验较好。
在一种可能的设计中,所述第一窗口中显示裁剪按键时,所述第二操作包括针对所述裁剪按键点击操作;或者,所述第一窗口中未显示裁剪按键时,所述第二操作包括用于唤出所述裁剪按键的操作,以及针对所述裁剪按键的点击操作;或者,所述第一窗口中包括状态栏,所述第二操作包括针对所述状态栏的长按和/或双击操作。需要说明的是,此处只是对第二操作的举例,第二操作还可以是其它类型的操作,本申请实施例不作限定。
在一种可能的设计中,所述第一窗口内包括状态栏,所述状态栏中包括用于控制所述第一窗口的一个或多个快捷图标;对所述第一窗口进行裁剪之后,所述第一窗口内保留有所述状态栏。
一般,状态栏中包括各种快捷图标,用户喜欢使用状态栏对窗口进行控制。本申请实施例中,对第一窗口进行裁剪时,第一窗口内的状态栏保留,这样可以方便用户通过状态栏对裁剪后的第一窗口进行控制,不改变用户的使用习惯,操作体验较好。
在一种可能的设计中,响应于第二操作,对所述第一窗口进行裁剪,包括:响应于第二操作,保持所述第一窗口中显示内容布局方式不变,对所述第一窗口进行裁剪。采用这种方式,可以使得裁剪后的窗口内显示内容布局方式与裁剪前的窗口内显示内容布局方式一致,用户可以紧接着在裁剪后的窗口内处理业务,体验较好。
在一种可能的设计中,所述方法还包括:对所述第一窗口裁剪之后,所述第一窗口被裁剪掉的第一区域内显示第二窗口中第二区域的信息;所述第二窗口位于所述第一窗口下层,且所述第二区域是所述第二窗口中在所述第一窗口被裁剪之前被所述第一窗口中所述第一区域所覆盖的区域。也就是说,对第一窗口裁剪之前,第一窗口内第一区域遮挡了下层的第二窗口的第二区域,将第一区域裁剪之后,下层第二窗口内第二区域的显示内容暴露出来,采用这种裁剪方式,可以缓解对下层窗口的遮挡程度。
在一种可能的设计中,所述方法还包括:在所述第一窗口被裁剪掉的第一区域内接收到的输入操作时,所述第二窗口中所述第二区域对所述输入操作进行响应。也就是说,对第一窗口裁剪之前,第一窗口内第一区域遮挡了下层的第二窗口的第二区域,将第一区域裁剪之后,下层第二窗口内第二区域的显示内容暴露出来。当在第一区域内接收到输入操作时,由下层第二窗口内第二区域作响应。采用这种裁剪方式,可以缓解对下层窗口的遮挡程度,增大用户在下层窗口的触控区域。
在一种可能的设计中,所述响应于第一操作,显示第一窗口,包括:所述响应于第一操作,根据所述第一窗口的bound尺寸,绘制第一图形,并在所述第一窗口内显示所述第一图形;响应于第二操作,对所述第一窗口进行裁剪,包括:响应于第二操作,设置所述第一窗口的crop尺寸,所述crop尺寸用于指示所述第一窗口被裁剪之后的尺寸;根据所述第一窗口的crop尺寸,绘制第二图形,并在裁剪后的所 述第一窗口内显示所述第二图形。
需要说明的是,目前的技术中,窗口(例如全屏窗口、分屏窗口、悬浮窗口)只设置有bound尺寸,不设置crop尺寸。本申请实施例中,电子设备设置第一窗口的crop尺寸,根据该crop尺寸,对第一窗口进行裁剪。可以理解的是,crop尺寸小于bound尺寸,所以裁剪后的窗口对下层窗口的遮挡较小。
在一种可能的设计中,根据所述第一窗口的crop尺寸,绘制第二图形之前,还包括:保持所述bound尺寸不变,以使所述第二图形与所述第一图形的重叠部分的布局方式不变。需要说明的是,bound尺寸决定窗口的显示内容布局方式,如果bound尺寸不变,则窗口的显示内容布局方式不变。目前的技术中,通过改变bound尺寸才调整窗口大小,但是调整了bound尺寸,就调整了窗口的显示内容布局方式。在本申请实施例中,电子设备设置第一窗口的crop尺寸,而且,在保持bound尺寸不变的情况下,根据该crop尺寸,对第一窗口进行裁剪,即在保持第一窗口布局方式不变的情况下,对第一窗口裁剪。
在一种可能的设计中,所述方法还包括:接收到第一输入事件,所述第一输入事件包括操作位置;将所述操作位置与所述第一窗口的crop尺寸比较;若所述操作位置位于所述crop尺寸以外,第二窗口对所述第一输入事件进行响应,所述第二窗口是所述第一窗口的下层窗口;若所述操作位置位于所述crop尺寸以内,所述裁剪后的所述第一窗口对所述第一输入事件进行响应。
需要说明的是,目前的技术中,电子设备将输入事件的坐标位置与窗口的bound尺寸比较,如果在bound尺寸内,则该窗口响应输入事件,但是本申请实施例中,电子设备将输入事件的坐标位置与窗口的crop尺寸比较,如果在crop尺寸内,则裁剪后的窗口响应输入事件,否则,下层窗口响应输入事件。
在一种可能的设计中,在所述将所述操作位置与所述第一窗口的crop尺寸比较之前,还包括:确定所述操作位置处于所述第一窗口的bound尺寸内,读取所述第一窗口的标志位,其中,所述标志位用于指示所述第一窗口当前处于已裁剪状态、未裁剪状态、正在裁剪状态中的任一种;根据所述第一窗口的标志位,确定所述第一窗口处于已裁剪状态。也就是说,电子设备接收到一个输入事件之后,先将该输入事件的坐标位置与窗口的bound尺寸作比较,以寻找该输入事件针对的目标窗口,然后通过该目标窗口的标志位判断该目标窗口是否被裁剪,如果该目标窗口未被裁剪,则直接由于该目标窗口响应输入事件,如果该目标窗口被裁剪了,则继续将输入事件的坐标位置与该目标窗口的crop尺寸作比较,如果位于crop尺寸内,则由裁剪后的窗口响应,如果处于crop尺寸外,则由下层窗口响应。
第二方面,还提供一种电子设备,包括:
处理器,存储器,以及,一个或多个程序;
其中,所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述处理器执行时,使得所述电子设备执行如上述第一方面所述的方法中第一设备的执行步骤。
第三方面,还提供一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如上述第一方面所述的方法。
第四方面,还提供一种计算机程序产品,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如上述第一方面所述的方法步骤。
第五方面,还提供一种芯片,所述芯片与电子设备中的存储器耦合,用于调用存储器中存储的计算机程序并执行如上述第一方面的技术方案,本申请实施例中“耦合”是指两个部件彼此直接或间接地结合。
上述第二方面至第五方面的有益效果,参见第一方面的有益效果,不重复赘述。
附图说明
图1为本申请一实施例提供的电子设备的硬件结构示意图;
图2为本申请一实施例提供的电子设备的软件结构的示意图;
图3至图4为本申请一实施例提供的一种应用场景的示意图;
图5至图6为本申请一实施例提供的又一种应用场景的示意图;
图7至图8为本申请一实施例提供的另一种应用场景的示意图;
图9A至图9B为本申请一实施例提供的悬浮窗的裁剪示意图;
图10为本申请一实施例提供的唤出裁剪框的示意图;
图11为本申请一实施例提供的调整裁剪框的示意图;
图12为本申请一实施例提供的悬浮窗的裁剪的另一种示意图;
图13至图14为本申请一实施例提供的裁剪后的窗口示意图;
图15至图16为本申请一实施例提供的裁剪还原的示意图;
图17为本申请一实施例提供的窗口裁剪方法的一种流程示意图;
图18为本申请一实施例提供的窗口裁剪方法的另一种流程示意图;
图19为本申请一实施例提供的电子设备的结构示意图。
具体实施方式
以下,对本申请实施例中的部分用语进行解释说明,以便于本领域技术人员理解。
本申请实施例涉及的至少一个,包括一个或者多个;其中,多个是指大于或者等于两个。另外,需要理解的是,在本说明书的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为明示或暗示相对重要性,也不能理解为明示或暗示顺序。例如,第一窗口和第二窗口并不代表二者的重要程度或者代表二者的顺序,仅仅是为了区分描述。在本申请实施例中,“和/或”,仅仅是描述关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请实施例中所提到的方位用语,例如,“上”、“下”、“左”、“右”、“内”、“外”等,仅是参考附图的方向,因此,使用的方位用语是为了更好、更清楚地说明及理解本申请实施例,而不是指示或暗指所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请实施例的限制。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本说明书的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
本申请实施例提供的窗口裁剪方法适用于电子设备。示例性的,电子设备可以是手机、平板电脑、笔记本电脑等便捷式电子设备;还可以是手表、手环等穿戴设备;或者,还可以是电视机、冰箱等智能家居设备;或者,还可以是车载设备等等,或者,还可以是虚拟现实(Virtual Reality,VR)设备、增强现实(Augmented Reality,AR)设备、混合现实技术(Mixed Reality,MR)设备,等等,总之本申请实施例不限定电子设备的具体类型。
图1示出了电子设备的结构示意图。所述电子设备例如可以是手机等。如图1所示,电子设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated  circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在电子设备上的包括无线局域网(wireless local area networks, WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。
显示屏194用于显示应用的显示界面等。显示屏194包括显示面板。在一些实施例中,电子设备可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。其中,ISP用于处理摄像头193反馈的数据。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,以及至少一个应用程序的软件代码等。存储数据区可存储电子设备使用过程中所产生的数据(例如图像、视频等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将图片,视频等文件保存在外部存储卡中。
电子设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过一个或多个扬声器170A收听音乐,或收听免提通话等外放场景。
受话器170B,也称“听筒”,可以是一个或多个,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。
耳机接口170D用于连接有线耳机。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。
陀螺仪传感器180B可以用于确定电子设备的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。
气压传感器180C用于测量气压。在一些实施例中,电子设备通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备可以利用磁传感器180D检测翻盖皮套的开合。
加速度传感器180E可检测电子设备在各个方向上(一般为三轴)加速度的大小。当电子设备静止时可检测出重力的大小及方向。
距离传感器180F,用于测量距离。电子设备可以通过红外或激光测量距离。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备通过发光二极管向外发射红外光。电子设备使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备附近有物体。当检测到不充分的反射光时,电子设备可以确定电子设备附近没有物体。
环境光传感器180L用于感知环境光亮度。电子设备可以根据感知的环境光亮度自适应调节显示屏194亮度。
指纹传感器180H用于采集指纹。
温度传感器180J用于检测温度。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备可以接收按键输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备的接触和分离。
可以理解的是,图1所示的部件并不构成对电子设备的具体限定。本发明实施例中的电子设备可以包括比图1中更多或更少的部件。此外,图1中的部件之间的组合/连接关系也是可以调整修改的。
图2为本申请实施例提供的电子设备的软件结构图。
电子设备的软件结构可以是分层架构,例如可以将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。假设电子设备是Android系统,可包括应用程序层(简称应用层),应用程序框架层(简称框架层)(framework,FWK),硬件层等等。
其中,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。例如,如图2所示,应用程序框架层中包括窗口管理服务(Window Manager Service,WMS),视图控制(Surface Control),输入管理(Input Manager)。
以下,先说明目前的技术中Input Manager、WMS、Surface Control各自的功能,然后再说明本申请实施例中对Input Manager、WMS、Surface Control各自的功能的改进之处。
目前,Input Manager负责获取用户的输入事件(例如,用户在显示屏上的点击、长按等操作),并将输入事件对各个应用的窗口进行分发。具体而言,Input Manager接收到一个输入事件之后,会判断将该输入事件分发给哪一个窗口,例如,Input Manager将该输入事件中的坐标位置(即操作发生的坐标位置)与窗口的Bound尺寸进行比较,如果位于某个窗口的Bound尺寸内,则将输入事件分发给该窗口进行处理。其中,关于窗口的Bound尺寸将在下面介绍。
目前,WMS负责管理窗口,包括窗口的创建、显示、面积调整等等。在一些实施例中,每一个窗口都由一个WindowState来表示,WindowState中包括边界(Bound),代表了该窗口的尺寸大小。WMS负责对每个窗口的WindowState进行管理(例如对WindowState中的Bound进行管理),进而实现对窗口的管理。为了方便说明WMS对每个窗口的WindowState中的Bound的管理过程,下面先简单介绍Bound的功能。
(1)、窗口的Bound代表了该窗口的尺寸大小,SurfaceControl基于该Bound尺寸设计窗口内显示内容的布局方式。例如,假设窗口的Bound尺寸等于显示屏的尺寸,即该窗口要全屏显示,则按照全屏显示的方式布局显示内容。假设窗口的Bound尺寸小于显示屏的尺寸,即该窗口要悬浮显示,则按照该Bound尺寸设计显示内容的布局方式,并悬浮显示该窗口。简单来说,窗口的Bound尺寸与窗口的显示面积有关,且与窗口内的显示内容的布局方式有关。
因此,WMS可以监听用户调整窗口的尺寸大小的动作,如果监听到,则对该窗口的Bound进行调整。当Bound被调整之后,SurfaceControl基于调整后的Bound调整窗口内信息的布局方式,如此,就实现用户调整窗口的尺寸时,窗口内信息的布局动态调整的目的。
(2)、窗口的Bound代表了该窗口的尺寸大小,用于与输入事件中的坐标位置进行比较,判断输入事件是否发生在该窗口内。例如,Input Manager接收到一个输入事件,该输入事件中包括用户操作的坐标位置。Input Manager将该输入事件的坐标位置与窗口的bound尺寸进行比较,如果位于窗口的bound尺寸内,说明该输入事件发生于该窗口内,那么将该输入事件分发给该窗口进行处理。
总结来说,目前的技术中,Bound尺寸有两个主要的功能,一是决定窗口内显示内容的布局方式, 当Bound尺寸发生变化时,窗口内的布局方式变化。二是用于与输入事件中的坐标位置进行比较,判断输入事件是否发生在该窗口内。
目前,SurfaceControl负责对窗口进行图层处理和合成显示,每一个窗口的WindowState,都对应着一个Surface,用于最终的画面显示。例如,SurfaceControl根据窗口的bound尺寸绘制图形(包括:根据该窗口的bound尺寸设计窗口内显示内容的布局方式,然后绘制图层),然后将绘制的图形通过显示屏显示。
以上是目前的技术中,Input Manager、WMS、Surface Control各自的功能。为了实现本申请的技术方案,对Input Manager、WMS、Surface Control的功能分别进行了改进,下面一一介绍。
Input Manager还是负责获取用户的输入事件,并将输入事件对各个应用的窗口进行分发。即,当Input Manager接收到一个输入事件之后,会判断将该输入事件分发给哪一个窗口。与目前的技术不同的是,本申请中,Input Manager将该输入事件中的坐标位置与窗口的Bound尺寸进行比较,如果位于某个窗口的Bound尺寸内,还会继续判断该窗口是否有对应的crop尺寸,如果有,需要继续将输入事件中的坐标位置与该窗口的crop尺寸进行比较,如果处于该窗口的crop尺寸内,则由被裁剪后的窗口处理,如果不处于该窗口的crop内,则由被裁剪的窗口的下层窗口处理。
WMS还是负责管理窗口。与目前的技术不同的,本申请中,每一个窗口由一个WindowState来表示,WindowState中不仅包括边界(Bound)尺寸,还包括裁剪(crop)尺寸。crop尺寸的功能包括:一、crop尺寸用于指示对窗口的裁剪尺寸,例如裁剪后的窗口应该是多大的尺寸。可以理解的是,crop尺寸小于或等于Bound尺寸。二、crop尺寸用于与输入事件中的坐标位置进行比较,判断输入事件是否发生在被裁剪的窗口内。
SurfaceControl还是负责对窗口进行图层处理和合成显示。与目前的技术不同的是,本申请中,SurfaceControl还可以基于窗口的crop尺寸绘制图形,然后将绘制的图形通过显示屏显示。
关于改进之后的Input Manager、WMS、Surface Control之间的处理流程,将在后文介绍(例如图17和图18)。
需要说明的是,图2中列举了应用程序框架层中包含的3个模块(WMS、Input Manager、SurfaceControl),可以理解的是,应用程序框架层中还可以包括更多或更少的模块,例如,还可以包括内容提供器,视图系统,电话管理器,资源管理器,通知管理器等(图中未示出)。其中,内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,例如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。例如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
硬件抽象层(Hardware Abstraction Layer,HAL)负责高层(即应用程序框架层)与底层(即内核层)之间的通信桥梁。HAL中包括传感器模块、图形处理库、媒体库等。以传感器模块为例,HAL中的传感器模块可以调用内核层中传感器驱动(例如触摸传感器驱动)来驱动硬件层中的传感器运行;或者,HAL中的传感器模块将内核层中传感器驱动(例如触摸传感器驱动)上报的输入事件上报给应用程序框架层中input manager,由input manager分发给对应的窗口。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
硬件层中包括电子设备中各种硬件,例如,显示器、传感器(例如,加速度传感器、重力传感器、触摸传感器)等等。
本申请实施例提供的窗口裁剪方法可以由图2所示的软件架构实现,具体的实现过程将在后文(例如图17或图18)说明。
下文以电子设备是手机为例,结合附图介绍本申请实施例提供的技术方案。
如前文所述,电子设备(例如手机)打开某个应用(例如即时通信应用)时,该应用的窗口会覆盖电子设备当前界面,导致用户无法继续在当前界面进行操作。例如,如图3的(a),电子设备显示桌面301。桌面301中包括各种应用的图标。当电子设备接收到针对华为视频应用的图标的操作时,打开华为视频应用,显示如图3的(b)所示的界面302,该界面302全屏显示,完全覆盖了桌面301。这种新界面完全覆盖旧界面的方式体验感较低,以图3的(b)为例,电子设备全屏显示华为视频应用的界面302,如果此时用户还想要继续在桌面301上操作,需要从界面302返回到桌面301(例如退出华为视频应用或者将华为视频应用切换到后台等等)。应理解,电子设备返回到桌面301之后,可能还需要再次打开华为视频应用的界面302,换言之,需要在桌面301与界面302之间反复切换。可见,这种新界面完全覆盖旧界面的方式对于用户而言,操作繁琐且体验感不佳。
为了节省操作,本申请实施例中提供一种窗口裁剪方法,该方法中,电子设备显示某个窗口时,用户可以对该窗口进行裁剪。例如,对于全屏显示的窗口,用户可以对该窗口作裁剪,使其显示面积缩小,这样的话,就会降低对下层窗口(例如,桌面)的遮挡程度,尽可能的避免由于窗口遮挡导致用户需要在不同窗口之间切换,节省操作步骤,提升操作体验感。
示例性的,本申请提供的窗口裁剪方法可以包括:响应于第一操作,显示第一窗口。示例性的,第一窗口可以是全屏窗口、悬浮窗口中的一个或分屏窗口等。电子设备响应于第二操作,对第一窗口进行裁剪。其中,第一窗口的裁剪范围与第二操作或第一窗口的显示内容相关。也就是说,第二操作不同时,对第一窗口的裁剪范围不同,如此,用户可以通过调整第二操作实现对第一窗口的不同范围的裁剪,实现自由裁剪;或者,第一窗口内显示内容不同时,对第一窗口的裁剪范围不同,例如第一窗口显示第一界面时,裁剪范围为中间范围,显示与第一界面不同的第二界面时,裁剪范围为左上角范围,总之,电子设备可以根据第一窗口的当前显示内容确定合适的裁剪范围,实现精准裁剪。总结来说,本申请实施例提供的窗口裁剪方法,一方面可以降低对下层窗口(例如,桌面)的遮挡程度尽可能的避免由于窗口遮挡导致用户需要在不同窗口之间切换,节省操作步骤,提升操作体验感;另一方面,可以实现自由裁剪、精准裁剪。
下面介绍本申请实施例提供的技术方案所适用的几种应用场景。
应用场景一:对全屏窗口进行裁剪
继续以图3为例,电子设备从桌面301打开华为视频应用的窗口302之后,窗口302全屏显示完全覆盖了桌面301。用户可以对窗口302进行裁剪。示例性的,以图3(b)为例,电子设备可以通过裁剪框(将在后文介绍)对窗口302进行裁剪框,例如,窗口302中位于裁剪框303内的部分保留、位于裁剪框303以外的部分会被裁剪掉。其中,通过裁剪框对窗口进行裁剪可以有多种方式,例如如下方式一和方式二中的至少一种。
方式一
以图3的(b)为例,当电子设备接收到用于唤出裁剪框的操作(具体实现方式将在后文介绍)时,显示如图4的(a)所示的裁剪框303。裁剪框303围住了窗口302中视频所在区域。当接收到确认裁剪的操作(具体实现方式将在后文介绍)时,显示如图4的(b)所示的界面,该界面中窗口302已被裁剪为小窗口,被裁剪掉的区域显示下层窗口(即桌面301)的信息。
需要说明的是,方式一中,裁剪框303被唤出时就围住了窗口302内的目标区域(例如,视频所在区域),目标区域是用户想要保留下的区域的可能性很大,所以用户只需再输入确认裁剪的操作就可以完成裁剪。此过程中,用户只输入两个操作,一是唤出裁剪框的操作,二是确认裁剪的操作,节省操作步骤,体验较好。
应理解的是,采用方式一之前,电子设备需要先确定窗口302内的目标区域,才能在目标区域显示裁剪框303。其中,目标区域的确定方式将在后文介绍。
可以理解的是,使用方式一时,有可能遇到一种情况,即,裁剪框303被唤出时围住的目标区域并不是用户想要保留的区域,此时,用户可以调整裁剪框303的位置和/面积,以裁剪出用户想要的部分。也就是说,裁剪框303的显示位置和/或显示面积是可调整的。例如,通过对裁剪框303的上边缘、下边缘、左边缘、右边缘或任一顶点的拖拽操作可以改变裁剪框303的显示面积;通过对裁剪框303内第一位置(例如中心点)的拖拽操作,可以改变裁剪框303的显示位置。当裁剪框303的显示位置和/或显示面积被调整后,若接收到确定裁剪的操作,根据调整后的裁剪框303对窗口302进行裁剪(窗口302中位于 裁剪框303内的部分保留、位于裁剪框303以外的部分会被裁剪掉)。这种方式可以实现自由裁剪,即根据用户的需求进行裁剪。
方式二
以图3的(b)为例,当电子设备接收到用于唤出裁剪框的操作(具体实现方式将在后文介绍)时,显示如图4的(c)所示的裁剪框303。与方式一不同的是,方式一中裁剪框303被唤出时围住了窗口302中的目标区域(即视频所在区域),方式二中,裁剪框303被唤出时围住了窗口302的全部显示区域。用户可以通过改变裁剪框303的面积、位置对窗口302进行裁剪。例如,图4的(c)中,电子设备接收到将裁剪框303的下边缘向上拖拽的操作,调整裁剪框303的大小,如图4的(d),其中,裁剪框303以外的部分使用斜线或暗底表示,这部分内容会被裁剪掉。当电子设备接收到确认裁剪的操作(具体实现方式将在后文介绍)时,将斜线部分裁剪,保留裁剪框303以内的部分,如图4的(e)所示的界面,裁剪框303取消显示。
因此,方式二中,裁剪框303被唤出时围住窗口302的全部显示区域,用户可以根据需求灵活的调整裁剪框303的面积和/或位置,实现精准裁剪。
需要说明的是,图4的(b)或(e)中,窗口302被裁剪成小窗口之后,该小窗口的显示位置和/或显示面积可以调整,例如,用户可以移动小窗口位置,以便在下层窗口(即桌面301)上进行操作。
应用场景二:对悬浮窗口进行裁剪
悬浮窗口(简称悬浮窗)可以理解为,是一种不以固定位置、固定大小显示,而是可以自动拖动的窗口。一般来说,悬浮窗的显示面积小于显示屏的面积,当然,其面积可以调整。示例性的,悬浮窗口可以是华为定制的自由(freeform)小窗。在一些示例中,freeform小窗可以是一种系统级悬浮小窗,无论用户切换页面,还是打开其他应用或桌面,该freeform小窗均置顶显示。为了方便理解悬浮窗口,请参见图5的(a),电子设备全屏显示浏览器应用的窗口501。当接收到用于打开即时通信应用的悬浮窗口的操作时,悬浮显示窗口502,如图5的(b)。其中,“用于打开即时通信应用的悬浮窗口的操作”可以是通过多任务界面打开或者可以通过侧边栏(sidebar)打开,本申请不详细说明。应用场景二中,电子设备可以对图5的(b)中悬浮窗口502进行裁剪。
与前面的应用场景一类似,电子设备对悬浮窗口502裁剪时,可以通过裁剪框进行裁剪。具体的方式包括如下方式一和方式二中的至少一种。
方式一
以图5的(b)为例,电子设备接收到用于唤出裁剪框的操作时,显示如图6的(a)所示的裁剪框303。裁剪框303围住了窗口502中的目标区域(即窗口502的下方区域)。当接收到确认裁剪的操作时,将窗口502裁剪为如图6的(b)所示的小窗口,被裁剪掉的区域显示下层窗口(即窗口501)的信息。此过程中,用户只输入两个操作,一是唤出裁剪框的操作,二是确认裁剪的操作,节省操作步骤,体验较好。同理,采用方式一之前,电子设备需要先确定窗口502内的目标区域,才能在目标区域显示裁剪框303。其中,目标区域的确定方式将在后文介绍。可以理解的是,如果裁剪框303被唤出时围住的目标区域并不是用户想要保留的区域,此时,用户可以调整裁剪框303的位置和/面积,以裁剪出用户想要的部分。当裁剪框303的显示位置和/或显示面积被调整后,若接收到确认裁剪的操作,根据调整后的裁剪框303对窗口302进行裁剪。
方式二
以图5的(b)为例,当电子设备接收到用于唤出裁剪框的操作(具体实现方式将在后文介绍)时,显示如图6的(c)所示的裁剪框303。与方式一不同的是,方式一中裁剪框303被唤出时围住了窗口502中的目标区域,方式二中,裁剪框303被唤出时围住了窗口502的全部显示区域。用户可以通过改变裁剪框303的面积、位置对窗口502进行裁剪。例如,图6的(c)中,电子设备接收到将裁剪框303的上边缘向下拖拽的操作,调整裁剪框303的大小,如图6的(d),其中,裁剪框303以外的部分使用斜线或暗底表示,这部分内容会被裁剪掉。当电子设备接收到确认裁剪的操作(具体实现方式将在后文介绍)时,显示如图6的(e)所示的界面,裁剪框303取消显示。
需要说明的是,图6的(b)或(e)中,悬浮窗口502被裁剪成小窗口之后,该小窗口的显示位置和/或显示面积可以调整,例如,用户可以移动小窗口位置,以便在下层窗口(即窗口501)上进行操作。
应用场景三:对分屏窗口进行裁剪
分屏窗口是指显示屏上分屏显示多个窗口,任意两个窗口之间没有遮挡。为了方便理解,本文以两个窗口分屏显示为例,包括上下分屏、左右分屏,本文主要以上下分屏为例,但是左右分屏或者其它分屏模式也可以适用。示例性的,请参见图7的(a),电子设备显示视频播放应用的窗口701,当接收到用于进入分屏模式的操作时,电子设备分屏显示视频播放应用的窗口701和购物应用的窗口702,如图7的(b)。其中,“用于进入分屏模式的操作”可以是各种类型的操作,例如指关节分屏等,本申请不多赘述。本应用场景三中,电子设备可以对图7的(b)中分屏窗口(例如,即时通信应用的窗口702)进行裁剪。
与前面的应用场景一类似,电子设备对分屏窗口702裁剪时,可以通过裁剪框进行裁剪。具体方式包括如下方式一和方式二中的至少一种。
方式一
以图7(b)为例,电子设备接收到用于唤出裁剪框的操作时,显示如图8的(a)所示的裁剪框303。裁剪框303围住了窗口702中的目标区域(即窗口702的下方区域)。当接收到确认裁剪的操作时,将窗口702裁剪为如图8的(b)所示的小窗口,被裁剪掉的区域显示下层窗口(即桌面)的信息。此过程中,用户输入两个操作,一是唤出裁剪框的操作,二是确认裁剪的操作,节省操作步骤,体验较好。同理,采用方式一之前,电子设备需要先确定窗口702内的目标区域。其中,目标区域的确定方式将在后文介绍。可以理解的是,如果裁剪框303被唤出时围住的目标区域并不是用户想要保留的区域,用户可以调整裁剪框303的位置和/或面积,以裁剪出用户想要的部分。当裁剪框303的显示位置和/或显示面积被调整后,在接收到确定裁剪的操作时,根据调整后的裁剪框303对窗口302进行裁剪。
方式二
以图7的(b)为例,当电子设备接收到用于唤出裁剪框的操作(具体实现方式将在后文介绍)时,显示如图8的(c)所示的裁剪框303。与方式一不同的是,方式一中裁剪框303被唤出时围住了窗口702中的目标区域,方式二中,裁剪框303被唤出时围住了窗口702的全部显示区域。用户可以通过改变裁剪框303的面积、位置对窗口702进行裁剪。例如,图8的(c)中,电子设备接收到将裁剪框303的上边缘向下拖拽的操作,调整裁剪框303的大小,如图8的(d),其中,裁剪框303以外的部分使用斜线或暗底表示,这部分内容需要被裁剪掉。当电子设备接收到确认裁剪框的操作(具体实现方式将在后文介绍)时,显示如图8的(e)所示的界面,裁剪框303取消显示。
需要说明的是,图8的(b)或(e)中,分屏窗口702被裁剪成小窗口之后,该小窗口的显示位置和/或显示面积可以调整,例如,可以在显示屏的下方区域(窗口701未占用的区域)内移动位置和/或调整面积。
以上对电子设备的全屏窗口、悬浮窗口、分屏窗口这三种类型的窗口,使用本申请实施例提供的技术方案进行裁剪的过程,需要说明的是,本申请不限定于对以上三种类型的窗口,对于任何窗口都可以使用本申请的技术方案。
以下结合附图说明本申请实施例提供的技术方案。
为了方便理解,下文主要以前面的应用场景二(对悬浮窗口进行裁剪)为例进行说明,但是,对于应用场景一、应用场景三以及其它应用场景同样适用。
请参见图9A的(a),电子设备全屏显示第一窗口。例如,第一窗口可以是前文应用场景二(即图5中的浏览器应用的窗口501)。当电子设备接收到用于打开悬浮窗口的操作(例如,从多任务界面中打开或者从侧边栏中打开)时,悬浮显示第二窗口,如图9A的(b)。例如,第二窗口可以是前文应用场景二(即图5中的即时通信应用的窗口502)。第二窗口悬浮于第一窗口上层,且覆盖了第一窗口的全部或部分(例如,覆盖住了第一窗口内的按键901)。在一些示例中,第一窗口和第二窗口可以是不同应用的窗口(例如图5),或者,也可以是同一应用的不同窗口。例如,第一窗口是浏览器应用的新闻A的窗口,第二窗口是浏览器应用的新闻B的窗口;或者,第一窗口是即时通信应用(例如)的 的窗口,第二窗口是即时通信应用(例如)中与某个联系人的聊天窗口,等等。
图9A的(b)中,第二窗口悬浮显示的情况下,电子设备可以通过裁剪框对第二窗口进行操作。具体方式包括方式一和方式二。
方式一
电子设备接收到用于唤出裁剪框的操作时,显示如图9B的(a)所示的裁剪框303。裁剪框303被唤出时围住第二窗口内的目标区域。示例性的,“用于唤出裁剪框的操作”包括但不限定如下方式中的至少一种。
方式A,如图9A的(b),悬浮窗(即第二窗口)中包括状态栏,“用于唤出裁剪框的操作”可以是在状态栏内空白位置处的双击和/或长按的操作。
方式B,如图10的(a),悬浮窗(即第二窗口)的状态栏中显示一裁剪按键901,用于指示对第二窗口进行裁剪。因此,“用于唤出裁剪框的操作”可以是针对该裁剪901的操作(例如,点击操作)。这种方式充分利用了状态栏中的显示区域,用户可以快速的找到能够打开裁剪框的入口,体验较好。
方式C,如图10的(b),悬浮窗(即第二窗口)的状态栏中显示提示条902,当电子设备接收到针对提示条902的操作时,显示如图10的(c)所示的一个或多个按键,例如,裁剪按键903和全屏按键904。“用于唤出裁剪框的操作”可以是针对裁剪按键903的操作。这种方式中,考虑到如果在状态栏中布局较多的按键,会显得拥挤影响视觉体验,所以可以将一些按键集成在提示条902中,以达到状态栏中简单、干净的布局。
需要说明的是,以上是举例了唤出裁剪框303的几种实现方式,主要以在状态栏中进行操作为例。可以理解的是,还可以有其它的唤出裁剪框303的方式,例如,用于指示唤出裁剪框的语音指令,或者,针对下拉/上滑菜单内的特定按键的操作等等,本申请实施例不一一举例。总之,在第二窗口有状态栏或没有状态栏的情况下,都可以唤出裁剪框303。
可以理解的是,采用上述方式一时,电子设备需要先确定悬浮窗(即第二窗口)内的目标区域,然后在目标区域显示裁剪框303。示例性的,目标区域的确定方式有多种。例如,方式1,目标区域是第二窗口内的固定区域,例如中心区域、左上角区域、右下角区域等。也就是说,裁剪框303出现时显示于第二窗口内的固定区域。示例性的,所述固定区域可以是用户设置的、或者、系统或应用默认设置的,其中不同应用设置的固定区域可以不同。方式2,目标区域可以是第二窗口内用户感兴趣的区域。示例性的,用户感兴趣的区域可以是电子设备记录的用户在第二窗口内用户交互次数大于预设次数的区域。例如,以第二窗口是华为视频应用的窗口为例,第二窗口内包括视频播放界面,用户可以在视频播放界面内左右滑以对视频进行快进或快退,电子设备记录用户在视频播放界面内的交互次数大于预设次数,所以确定目标区域为视频播放界面所在区域。方式3,第二窗口内包括多种类型的信息(文字、图片、视频等等)时,可以根据不同类型信息的优先级关系,确定目标区域。例如,所述优先级关系可以是视频>图片>文字。以第二窗口是浏览器应用的窗口为例,第二窗口内包括文字和图片,由于图片的优先级高于文字,所以目标区域为图片所在区域,即裁剪框显示于图片所在区域。当然,所述优先级可以是用户设置的,或者,系统或应用默认设置的,本申请实施例不作限定。可以理解的是,目标区域是用户感兴趣的区域或者优先级较高的区域出现时,裁剪框出现时就围住该目前区域,这样,用户需要手动调整裁剪框的概率降低,节省用户操作,提升操作便捷性。
继续参见图9B的(a),裁剪框出现在目标区域后,当电子设备接收到确认裁剪的操作时,对第二窗口进行裁剪,如图9B的(b)。示例性的,“确认裁剪的操作”例如可以是用户点击第一窗口或第二窗口内任一位置的操作,所述操作可以是点击或长按或双击操作。
需要说明的是,采用方式一时,裁剪框303出现时围住目标区域,如果目标区域不是用户想要保留的区域,可以改变裁剪框的位置和/或面积。其中,“改变裁剪框的位置的操作”包括:针对裁剪框303的第一位置(例如中心位置)的拖拽操作;“改变裁剪框的面积的操作”例如包括:针对裁剪框303的第一边缘或第一顶点的拖拽操作,第一边缘可以是上、下、左、右边缘中的任一边缘,第一顶点可以是四个顶点中的任一顶点。示例性的,请参见图11的(a),裁剪框303原本位于第二窗口的目标区域,当接收到用于上移裁剪框303的操作时,显示如图11的(b),裁剪框303上移。图11的(b)中,在裁剪框303上移之后,若接收到确认裁剪的操作,则根据上移后的裁剪框303对第二窗口进行裁剪,即保留第二窗口中位于裁剪框303内的部分,裁剪掉第二窗口中位于裁剪框303以外的部分。
方式二
电子设备接收到用于唤出裁剪框的操作时,显示如图9B的(c)所示的裁剪框303。裁剪框303被唤出时围住第二窗口的全部显示区域。其中,“用于唤出裁剪框的操作”在前文已经介绍过,不重复赘述。当电子设备接收到用于调整裁剪框303的操作时,调整裁剪框303的面积和/或位置,以改变裁剪范围。 其中,“调整裁剪框的操作”在前文介绍过,不重复赘述。例如,图9B的(c)中,电子设备接收到用于将裁剪框303的上边缘向下拖拽的操作时,调整裁剪框303的面积,如图9B的(d)。其中,裁剪框303以外的区域使用斜线或暗底表示,这部分区域需要被裁剪(此时,这部分区域可以显示或不显示)。当电子设备接收到确认裁剪的操作时,显示如图9B的(e),取消显示裁剪框303。其中,“用于确认裁剪的操作”例如用户点击第一窗口或第二窗口内任一位置的操作(点击或长按或双击操作)。
需要说明的是,图9B的(d)中,裁剪框303以外的使用斜线表示的区域可以显示或不显示。以显示为例,即电子设备调整裁剪框303后,斜线部分还未被裁剪,当接收到确认裁剪的操作时,才将斜线部分裁剪掉。以不显示为例,即电子设备可以在调整裁剪框303的同时就将斜线部分裁剪掉了,简言之,缩小裁剪框303的同时裁剪框303以外的区域就被裁剪掉了。
方式二与方式一不同之处包括:方式一中,裁剪框303出现时只占用第二窗口内的目标区域,此时裁剪框303位于第二窗口上层,用户可以改变裁剪框303的位置、面积等,改变过程中并未对第二窗口裁剪,直到接收到确认裁剪的操作,才基于裁剪框303对第二窗口进行裁剪。方式二中,裁剪框303出现时占满第二窗口的全部显示区域,用户可以改变裁剪框303的面积、位置,在改变的过程中已经对第二窗口进行裁剪了,直到接收到取消显示裁剪框的操作,取消显示裁剪框。
前面的实施例中,电子设备唤出裁剪框,以通过裁剪框进行裁剪。可以理解的是,当裁剪框被唤出之后,用户可能会放弃裁剪,此时需要退出裁剪模式,取消显示裁剪框。例如,当电子设备接收到用于取消裁剪框的操作时,取消显示裁剪框。其中,“用于取消裁剪框的操作”可以是类似于前面“用于唤出裁剪框的操作”的方式A,在状态栏内空白位置的长按和/或双击操作。或者,还可以是类似于前面“用于唤出裁剪框的操作”的方式B,点击被裁剪后的第二窗口的状态栏中的裁剪按键901的操作(例如,裁剪按键901包括选中状态和非选中状态,当按键901处于选中状态时,裁剪框出现,当按键901处于非选中状态时,裁剪框取消显示,所以,用户可以通过一个按键(即按键901)控制裁剪框的显示和取消显示)。再或者,还可以是类似前面的方式C,点击提示条902以唤出裁剪按键903,然后点击裁剪按键903。同理,裁剪按键903包括选中状态和非选中状态,当按键903处于选中状态时,裁剪框出现,当按键903处于非选中状态时,裁剪框取消显示。
可以理解的是,第二窗口被裁剪之后,被裁剪掉的区域显示下层窗口(即第一窗口)的信息。例如,请继续参见图9A的(a),第一窗口内包括按键901,第二窗口出现时遮挡住了按键901,如图9A的(b)。继续参见图9B的(b)或(e),第二窗口被裁剪之后,第一窗口内的按键901出现。此时,如果电子设备接收到用户针对该按键901的操作,则由第一窗口响应。因此,通过本申请实施例提供的技术方案,可以减少悬浮窗口对下层窗口的遮挡面积,提升用户在下层窗口的操作体验。
在前面的示例(即图9B)中,第二窗口被裁剪后,第二窗口内的状态栏被裁剪掉。在另一些示例性中,对第二窗口裁剪时保留状态栏。例如,如图12的(a)和(b),电子设备接收到确认裁剪的操作时,对第二窗口裁剪,但是裁剪后的第二窗口中保留有状态栏。再例如,如图12的(c)、(d)和(e),电子设备缩小裁剪框303的面积时,第二窗口被裁剪,被裁剪后的第二窗口内仍然保留有状态栏。这样的话,可以方便用户继续使用被裁剪后的第二窗口中状态栏的功能。
例如,被裁剪之后的第二窗口的位置和/或面积可调整。在调整被裁剪后的第二窗口的位置和/或面积时,可以使用其状态栏。示例性的,请参见图13的(a),当电子设备接收到用于调整显示位置的操作时,改变被裁剪后第二窗口的显示位置,如图13的(b)。其中,“用于调整显示位置的操作”可以包括:在状态栏内空白位置处长按且拖拽的操作。示例性的,请参见图14的(a),当电子设备接收到用于调整面积的操作时,改变被裁剪后的第二窗口的显示面积,如图14的(b)。其中,“用于调整面积的操作”例如包括:对被裁剪后第二窗口的任一顶点或任一边缘的拖拽操作。
在一些示例中,第二窗口被裁剪之后,还可以复原,即,将复原为裁剪之前的状态。示例性的,复原方式包括如下至少一种。
方式一
示例性的,请参见图15的(a),第二窗口已被裁剪为小窗口。当电子设备接收到用户唤出裁剪框的操作时,显示裁剪框303,如图15的(b)。其中,“用于唤出裁剪框的操作”请参见前文介绍,不再 重复。如图15的(b),当电子设备接收到将裁剪框303的上边缘向上拖拽的操作时,小窗口逐渐还原为第二窗口,如图15的(c)。当电子设备接收到用于取消显示裁剪框的操作时,取消显示裁剪框,如图15的(d)。这种方式中,用户唤出裁剪框之后,通过裁剪框手动将被裁剪的第二窗口复原。
方式二
与方式一不同的是,方式二可以实现“一键复原”,即通过一个操作将被裁剪的第二窗口还原为裁剪之前的状态。示例性的,请参见图16的(a),第二窗口被裁剪后,显示屏上出现一个标记1601,该标记1601用于实现“一键复原”。其中,标记1601可以显示在被裁剪后的第二窗口内,也可以显示在第一窗口内。为了方便用户注意到该标记,可以悬浮显示在最上层。当电子设备接收到针对标记1601的操作时,自动恢复为如图16的(b)中第二窗口被裁剪之前的状态。
下文结合前文图2所示的软件结构,说明本申请提供的窗口裁剪方法(例如图9A和图9B)具体实现原理。需要说明的是,在前文图2中,已经说明了本申请对Input Manager、WMS、Surface Control各自功能的改进之处,为了方便理解,下文结合图17和图18说明改进之后的Input Manager、WMS与Surface Control之间的处理流程。
需要说明的是,在前面的实施例中,电子设备通过裁剪框对窗口裁剪时有两种不同的方式(即方式一和方式二),所以下文分别对这两种方式的具体原理进行介绍。其中,图17所示的流程图是方式一的实现原理,图18所示的流程图是方式二的实现原理。如图17,所述流程包括:
S1,Surface Control显示第一窗口。
示例性的,S1对应图9A的(a)。S1可以包括多个步骤,例如,Input Manager接收到用于打开第一窗口的输入事件,将该输入事件发送给WMS。WMS创建第一窗口的windowstate,windowstate中包括第一窗口对应的Bound,该Bound用于指示第一窗口的尺寸。WMS将第一窗口的Bound尺寸发送给Surface Control。Surface Control根据第一窗口的Bound尺寸绘制图形,以使显示屏上显示第一窗口。例如,Surface Control绘制完第一窗口的图形之后,可以调用底层(例如内核层)中的显示驱动,以通过显示驱动控制显示器显示第一窗口。
S2,Input Manager接收到第一输入事件,第一输入事件用于指示悬浮显示第二窗口。
示例性的,第一输入事件中包括操作时间、操作位置、操作类型(例如点击、长按、拖动等)。例如,第一输入事件可以是在多任务界面或侧边栏中打开第二窗口的操作。
S3,Input Manager将第一输入事件发送给WMS。
需要说明的是,WMS中存储有显示屏上当前显示的所有元素的位置信息,例如,显示屏上显示有多个按键,WMS中可以存储每个按键的位置,当WMS接收到第一输入事件时,可以判断第一输入事件是针对显示屏上哪一个按键的操作,如果是针对用于打开第二窗口的按键(例如该按键位于侧边栏中)的操作,则执行S4。
S4,WMS建立第二窗口对应的窗口状态(windowstate);windowstate中包括第二窗口对应的Bound,该Bound用于指示第二窗口的尺寸。
示例性的,电子设备打开悬浮窗口时,其对应的Bound尺寸可以是系统默认设置好的或者用户设置的,本申请实施例不作限定。可以理解的是,悬浮窗口的Bound尺寸小于显示屏的尺寸。
S5,WMS将第二窗口的Bound尺寸发送给Surface Control。
S6,Surface Control根据第二窗口的Bound尺寸绘制图形,图形中显示内容的布局方式与Bound尺寸相关。
示例性的,如前文所述,窗口的Bound尺寸决定该窗口的显示内容的布局方式,例如,对于同一窗口,其Bound尺寸是全屏时,该窗口内是一种布局方式,Bound尺寸是非全屏时,窗口内是另一种布局方式。具体而言,窗口的Bound尺寸与窗口内信息的布局方式之间的对应关系由该窗口对应的应用决定。例如,应用发布时,会提供该应用的窗口在不同Bound尺寸下对应的窗口内信息的布局方式。因此,Surface Control根据第二窗口的Bound尺寸,确定第二窗口内的显示内容的布局方式,然后基于该布局方式绘制图形。
S7,Surface Control悬浮显示第二窗口,第二窗口内显示所述图形。
示例性的,S7可以对应图9A中的(b)。
S8,Input Manager接收到第二输入事件,第二输入事件用于唤出裁剪框。
S9,Input Manager将第二输入事件发送给WMS。
S10,WMS设置第二窗口的裁剪状态为正在裁剪中。
在本申请实施例中,WMS可以设置每个窗口的裁剪状态(CropState),例如包括三个裁剪状态,分别为:非裁剪状态,正在裁剪中,已裁剪状态。以第二窗口为例,非裁剪状态例如为图9A中(b)的状态;正在裁剪中例如为图9B的(a)、(c)-(d),即显示有裁剪框303的状态;已裁剪状态例如为图9B中(b)和(e)的状态。
在一些示例中,WMS设置每个窗口的裁剪状态(CropState)时,可以通过标志位来设置。例如,标志位可以是11、10、00等,其中11表示非裁剪状态,10表示正在裁剪中,00表示已裁剪状态。或者,该标志位还可以是NONE、CROPPING和CROPPED,其中,NONE表示非裁剪状态,CROPPING表示正在裁剪中,CROPPED表示已裁剪状态。
需要说明的是,S10可以执行或不执行,所以图17中S10使用虚线表示。
S11,WMS向Surface Control发送绘制裁剪框的命令。
S12,Surface Control显示裁剪框,裁剪框圈中第二窗口中的目标区域。
示例性的,裁剪框请参见图9B的(a)所示。
S13,Input Manager接收到第三输入事件,第三输入事件用于指示确认裁剪。
可选的,考虑到裁剪框所圈中目标区域可能不是用户想要裁剪出的区域,所以在S13之前,电子设备还可以根据用户操作调整裁剪框的位置和/或面积。
S14,Input Manager将第三输入事件发送给WMS。
S15,WMS确定第二窗口的bound尺寸保持不变,并确定第二窗口的crop尺寸。
示例性的,图9B的(a)中,裁剪框围住了第二窗口内的目标区域,所以crop尺寸为目标区域的尺寸。
S16,WMS将第二窗口的crop尺寸发送给Surface Control。
可选的,WMS还可以将保持第二窗口bound尺寸不变的命令也发送给Surface Control,或者,如果默认在WMS已经将第二窗口的bound尺寸发送给Surface Control的情况下,如果bound尺寸未更新,则无需再次发送。因此,Surface Control未接收到新的bound尺寸,则默认第二窗口的bound尺寸没有变化。
S17,Surface Control按照第二窗口的crop尺寸重新绘制图形,该图形的布局方式与裁剪之前第二窗口内信息布局方式保持一致。
如前文所述,第二窗口的bound尺寸决定第二窗口内信息的布局方式,由于bound尺寸不变,所以第二窗口内信息的布局方式不变。因此,对第二窗口的裁剪与对第二窗口的面积调整不同,当调整第二窗口的面积时由于bound尺寸变化了,所以面积调整后的第二窗口内信息的布局方式变化,但是,当裁剪第二窗口时,由于bound尺寸不变,所以裁剪前后布局一致。
S18,Surface Control显示裁剪后的第二窗口。
示例性的,裁剪后的第二窗口例如图9B的(b)。
在一些示例中,对第二窗口裁剪完之后,还可以包括如下步骤:
S19,Surface Control向WMS发送裁剪完成指令。
S20,WMS设置第二窗口的裁剪状态为已裁剪。
另一些实施例中,第二窗口被裁剪之后,如果电子设备在被裁剪的区域内接收到输入操作,由位于第二窗口下层的第一窗口对该输入操作进行响应。具体实现过程包括:
S21,Input Manager接收到第四输入事件,第四输入事件用于指示在第二窗口被裁剪掉的区域内的操作。
S22,Input Manager确定第四输入事件发生在第二窗口的bound尺寸内。
S23,Input Manager识别第二窗口的裁剪状态,如果是已裁剪状态,则执行S24,如果是未裁剪状态或者正在裁剪状态,则将第五输入事件分发给第二窗口。
示例性的,Input Manager可以通过第二窗口的标志位识别第二窗口的裁剪状态,所述标志位用于表征窗口处于已裁剪、未裁剪、正在裁剪中的至少一种。关于标志位请参见前文介绍。
可选的,S22和S23可以执行或不执行,所以图中使用虚线表示。
S24,如果第二窗口是已裁剪状态,Input Manager判断第四输入事件是否处于第二窗口的crop内,如果是,则分发给第二窗口处理即S25,否则,分发给第一窗口处理即S26。
S25,Input Manager将第四输入事件分发给第二窗口。
S26,Input Manager将第四输入事件分发给第一窗口。
请参见图18,为前文中唤出裁剪框时的方式二的实现原理,如图18,所述流程包括:
S1801,Surface Control显示第一窗口。
S1802,Input Manager接收到第一输入事件,第一输入事件用于指示悬浮显示第二窗口。
S1803,Input Manager将第一输入事件发送给WMS。
S1804,WMS建立第二窗口对应的窗口状态(windowstate);windowstate中包括第二窗口对应的Bound,该Bound用于指示第二窗口的尺寸。
S1805,WMS将第二窗口的Bound尺寸发送给Surface Control。
S1806,Surface Control根据第二窗口的Bound尺寸绘制图形,图形中显示内容的布局方式与Bound尺寸相关。
S1807,Surface Control悬浮显示第二窗口,第二窗口内显示所述图形。
示例性的,S1807可以对应图9A中的(b)。
S1808,Input Manager接收到第二输入事件,第二输入事件用于唤出裁剪框。
S1809,Input Manager将第二输入事件发送给WMS。
S1810,WMS设置第二窗口的裁剪状态为正在裁剪中。
需要说明的是,S1810可以执行或不执行,所以图18中S1810使用虚线表示。
S1811,WMS向Surface Control发送绘制裁剪框的命令。
S1812,Surface Control显示裁剪框,裁剪框圈中第二窗口的全部区域。
示例性的,裁剪框请参见图9B的(c)所示。
S1813,Input Manager接收到第三输入事件,第三输入事件用于指示调整裁剪框的面积和/或尺寸。
例如,第三输入事件可以是图9B的(d)中将裁剪框303的上边缘向下拖拽的操作。
S1814,Input Manager将第三输入事件发送给WMS。
S1815,WMS向Surface Control发送重新绘制裁剪框的指令。
S1816,Surface Control显示调整后的裁剪框。
S1817,Input Manager接收到第四输入事件,第四输入事件用于指示确认裁剪。
S1818,Input Manager将第四输入事件发送给WMS。
S1819,WMS保持第二窗口的bound尺寸不变,确定第二窗口的crop尺寸。
示例性的,图9B的(d)中,第二窗口内显示内容布局不变,所以crop尺寸为调整后的裁剪框所围区域的尺寸。
S1820,WMS将第二窗口的crop尺寸发送给Surface Control。
S1821,Surface Control按照第二窗口的crop尺寸重新绘制图形,该图形的布局方式与裁剪之前第二窗口内信息布局方式保持一致。
S1822,Surface Control显示裁剪后的第二窗口。
S1823,WMS设置第二窗口的裁剪状态为已裁剪。
另一些实施例中,第二窗口被裁剪之后,如果电子设备在被裁剪的区域内接收到输入操作,由位于第二窗口下层的第一窗口对该输入操作进行响应。具体实现过程包括:
S1824,Input Manager接收到第五输入事件,第五输入事件用于指示在第二窗口被裁剪掉的区域内的操作。
S1825,Input Manager确定第五输入事件发生在第二窗口的bound尺寸内。
S1826,Input Manager识别第二窗口的裁剪状态,如果是已裁剪状态,则执行S1827,如果是未裁剪状态或者正在裁剪状态,则将第五输入事件分发给第二窗口。
可选的,S1825和S1826可以执行或不执行,所以图中使用虚线表示。
S1827,如果第二窗口是已裁剪状态,Input Manager判断第五输入事件是否处于第二窗口的crop内,如果是,则分发给第二窗口处理即S1828,否则,分发给第一窗口处理即S1829。
S1828,Input Manager将第五输入事件分发给第二窗口。
S1829,Input Manager将第五输入事件分发给第一窗口。
其中,S1824-S1829的实现原理请参见图17中的S21-S26,不重复赘述。
图19为本申请实施例提供的电子设备1900的结构示意图。电子设备1900可以是前文中的电子设备例如手机。如图19所示,电子设备1900可以包括:一个或多个处理器1901;一个或多个存储器1902;通信接口1903,以及一个或多个计算机程序1904,上述各器件可以通过一个或多个通信总线1905连接。其中该一个或多个计算机程序1904被存储在上述存储器1902中并被配置为被该一个或多个处理器1901执行,该一个或多个计算机程序1904包括指令。比如,当电子设备1900是前文中的电子设备时,该指令可以用于执行如上面相应实施例中电子设备的相关步骤,例如,图17或图18示的实施例中的电子设备的相关步骤。通信接口1903用于实现电子设备1900与其他设备的通信,比如通信接口可以是收发器。
上述本申请提供的实施例中,从电子设备(例如手机、平板电脑)作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
以上实施例中所用,根据上下文,术语“当…时”或“当…后”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。另外,在上述实施例中,使用诸如第一、第二之类的关系术语来区份一个实体和另一个实体,而并不限制这些实体之间的任何实际的关系和顺序。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。在不冲突的情况下,以上各实施例的方案都可以组合使用。
需要指出的是,本专利申请文件的一部分包含受著作权保护的内容。除了对专利局的专利文件或记录的专利文档内容制作副本以外,著作权人保留著作权。

Claims (16)

  1. 一种窗口裁剪方法,其特征在于,包括:
    响应于第一操作,显示第一窗口,所述第一窗口是悬浮窗口,或者分屏窗口中的一个,或者全屏窗口;
    响应于第二操作,对所述第一窗口进行裁剪,其中,所述第一窗口的裁剪范围与所述第二操作或所述第一窗口中当前显示内容相关;
    显示裁剪后的所述第一窗口。
  2. 根据权利要求1所述的方法,其特征在于,所述第二操作包括:用于唤出裁剪框的第三操作和用于确认裁剪的第四操作,所述响应于第二操作,对所述第一窗口进行裁剪,包括:
    响应于所述第三操作,在所述第一窗口内显示裁剪框,所述裁剪框的面积小于所述第一窗口的面积,且所述裁剪框圈中所述第一窗口内的目标区域,所述目标区域为所述第一窗口的裁剪范围,所述目标区域与所述第一窗口当前显示内容相关;
    响应于所述第四操作,取消显示所述第一窗口中所述目标区域以外的其它区域,保留所述目标区域。
  3. 根据权利要求2所述的方法,其特征在于,所述裁剪框的显示位置和/或显示面积可调整。
  4. 根据权利要求2或3所述的方法,其特征在于,所述目标区域包括如下至少一种:
    所述第一窗口内用户感兴趣信息所在的区域;所述用户感兴趣区域包括所述第一窗口内用户交互次数大于预设次数的区域;
    所述第一窗口内多种类型的显示内容中优先级最高的显示内容所在的区域,所述多种类型的显示内容包括:文字、图像、视频中的至少两种;
    所述第一窗口内默认区域;
    所述第一窗口内用户指定区域。
  5. 根据权利要求1所述的方法,其特征在于,所述第二操作包括:用于唤出裁剪框的第三操作、用于调整裁剪框的第四操作和用于确认裁剪的第五操作,所述响应于第二操作,确定对所述第一窗口的裁剪范围,包括:
    响应于所述第三操作,在所述第一窗口内显示裁剪框;所述裁剪框圈中所述第一窗口的全部显示区域,且所述裁剪框的显示位置和/或显示面积可调整;
    响应于所述第四操作,调整所述裁剪框的显示位置和/或显示面积;
    响应于所述第五操作,取消显示所述第一窗口中未被调整后的所述裁剪框圈中的区域,保留被圈中的区域。
  6. 根据权利要求3或5所述的方法,其特征在于,所述裁剪框的显示位置和/或显示面积可调整,包括:
    在接收到针对所述裁剪框的第一边缘或第一顶点的拖拽操作时,调整所述裁剪框的显示面积;和/或,
    在接收到针对所述裁剪框内第一位置的拖拽操作时,调整所述裁剪框的显示位置。
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述方法还包括:
    接收到用于指示还原所述第一窗口的操作,控制所述第一窗口还原为裁剪之前的状态。
  8. 根据权利要求1-7任一所述的方法,其特征在于,
    所述第一窗口中显示裁剪按键时,所述第二操作包括针对所述裁剪按键点击操作;或者,
    所述第一窗口中未显示裁剪按键时,所述第二操作包括用于唤出所述裁剪按键的操作,以及针对所述裁剪按键的点击操作;或者,
    所述第一窗口中包括状态栏,所述第二操作包括针对所述状态栏的长按和/或双击操作。
  9. 根据权利要求1-8任一所述的方法,其特征在于,
    所述第一窗口内包括状态栏,所述状态栏中包括用于控制所述第一窗口的一个或多个快捷图标;
    对所述第一窗口进行裁剪之后,所述第一窗口内保留有所述状态栏。
  10. 根据权利要求1-9任一所述的方法,其特征在于,响应于第二操作,对所述第一窗口进行裁剪,包括:
    响应于第二操作,保持所述第一窗口中显示内容布局方式不变,对所述第一窗口进行裁剪。
  11. 根据权利要求1所述的方法,其特征在于,
    所述响应于第一操作,显示第一窗口,包括:
    所述响应于第一操作,根据所述第一窗口的bound尺寸,绘制第一图形,并在所述第一窗口内显示所述第一图形;
    响应于第二操作,对所述第一窗口进行裁剪,包括:
    响应于第二操作,设置所述第一窗口的crop尺寸,所述crop尺寸用于指示所述第一窗口被裁剪之后的尺寸;
    根据所述第一窗口的crop尺寸,绘制第二图形,并在裁剪后的所述第一窗口内显示所述第二图形。
  12. 根据权利要求11所述的方法,其特征在于,根据所述第一窗口的crop尺寸,绘制第二图形之前,还包括:
    保持所述bound尺寸不变,以使所述第二图形与所述第一图形的重叠部分的布局方式不变。
  13. 根据权利要求11或12所述的方法,其特征在于,所述方法还包括:
    接收到第一输入事件,所述第一输入事件包括操作位置;
    将所述操作位置与所述第一窗口的crop尺寸比较;
    若所述操作位置位于所述crop尺寸以外,第二窗口对所述第一输入事件进行响应,所述第二窗口是所述第一窗口的下层窗口;
    若所述操作位置位于所述crop尺寸以内,裁剪后的所述第一窗口对所述第一输入事件进行响应。
  14. 根据权利要求13所述的方法,其特征在于,在所述将所述操作位置与所述第一窗口的crop尺寸比较之前,所述方法还包括:
    确定所述操作位置位于所述第一窗口的bound尺寸内;
    读取所述第一窗口的标志位,其中,所述标志位用于指示所述第一窗口当前处于已裁剪状态、未裁剪状态、正在裁剪状态中的任一种;
    根据所述第一窗口的标志位,确定所述第一窗口处于已裁剪状态。
  15. 一种电子设备,其特征在于,包括:
    处理器,存储器,以及,一个或多个程序;
    其中,所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述处理器执行时,使得所述电子设备执行如权利要求1-14任一项所述的方法。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1-14任一项所述的方法。
PCT/CN2023/114543 2022-08-24 2023-08-23 一种窗口裁剪方法与电子设备 WO2024041583A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211019893.5A CN117666893A (zh) 2022-08-24 2022-08-24 一种窗口裁剪方法与电子设备
CN202211019893.5 2022-08-24

Publications (1)

Publication Number Publication Date
WO2024041583A1 true WO2024041583A1 (zh) 2024-02-29

Family

ID=90012609

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/114543 WO2024041583A1 (zh) 2022-08-24 2023-08-23 一种窗口裁剪方法与电子设备

Country Status (2)

Country Link
CN (1) CN117666893A (zh)
WO (1) WO2024041583A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996241A (zh) * 2006-01-06 2007-07-11 国际商业机器公司 应用程序裁剪方法和系统
US20180239521A1 (en) * 2017-02-22 2018-08-23 International Business Machines Corporation Automated resizing of application windows based on interactive states
CN114647348A (zh) * 2020-12-16 2022-06-21 华为技术有限公司 一种应用界面的裁剪方法及电子设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996241A (zh) * 2006-01-06 2007-07-11 国际商业机器公司 应用程序裁剪方法和系统
US20180239521A1 (en) * 2017-02-22 2018-08-23 International Business Machines Corporation Automated resizing of application windows based on interactive states
CN114647348A (zh) * 2020-12-16 2022-06-21 华为技术有限公司 一种应用界面的裁剪方法及电子设备

Also Published As

Publication number Publication date
CN117666893A (zh) 2024-03-08

Similar Documents

Publication Publication Date Title
WO2021013158A1 (zh) 显示方法及相关装置
JP7142783B2 (ja) 音声制御方法及び電子装置
JP7326476B2 (ja) スクリーンショット方法及び電子装置
WO2021052147A1 (zh) 一种数据传输的方法及相关设备
WO2021139768A1 (zh) 跨设备任务处理的交互方法、电子设备及存储介质
WO2020052529A1 (zh) 全屏显示视频中快速调出小窗口的方法、图形用户接口及终端
WO2021103981A1 (zh) 分屏显示的处理方法、装置及电子设备
WO2021036571A1 (zh) 一种桌面的编辑方法及电子设备
WO2021000839A1 (zh) 一种分屏方法及电子设备
KR102534354B1 (ko) 시스템 탐색 바 표시 제어 방법, 그래픽 사용자 인터페이스 및 전자 디바이스
WO2021213164A1 (zh) 应用界面交互方法、电子设备和计算机可读存储介质
WO2021082835A1 (zh) 启动功能的方法及电子设备
WO2021063098A1 (zh) 一种触摸屏的响应方法及电子设备
WO2022068819A1 (zh) 一种界面显示方法及相关装置
WO2020238759A1 (zh) 一种界面显示方法和电子设备
WO2022017393A1 (zh) 显示交互系统、显示方法及设备
WO2021175272A1 (zh) 一种应用信息的显示方法及相关设备
WO2024001810A1 (zh) 设备交互方法、电子设备及计算机可读存储介质
WO2020259669A1 (zh) 一种视图显示方法和电子设备
WO2024021519A1 (zh) 卡片显示方法、终端设备
WO2021057699A1 (zh) 具有柔性屏幕的电子设备的控制方法及电子设备
WO2022142674A1 (zh) 一种快捷方式的创建方法及相关设备
WO2021190524A1 (zh) 截屏处理的方法、图形用户接口及终端
WO2021042881A1 (zh) 消息通知方法及电子设备
WO2023138305A9 (zh) 卡片显示方法、电子设备及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23856671

Country of ref document: EP

Kind code of ref document: A1