Window scaling method and electronic device
Patent Information
- Application Number
- PCT/CN2026/087079
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-04-18
- Filing Date
- 2026-03-30
- Publication Date
- 2026-10-22
Smart Images

Figure CN2026087079_22102026_PF_FP_ABST
Abstract
Description
A window scaling method and electronic device
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. 202510496925.8, filed on April 18, 2025, entitled "A Window Scaling Method and Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of electronic device technology, and in particular to a window scaling method and an electronic device. Background Technology
[0004] Currently, when users zoom in and out of windows of complex applications displayed on electronic devices, the size (or dimensions) of the window can generally change in real time with the user's operation. However, the time required to recalculate and update the content layout within the window is relatively long, which leads to a low display frame rate of the content interface in the window. This results in problems such as white or black borders, content jitter, and unresponsiveness during window zooming, thus resulting in poor window zooming effect and user experience. Summary of the Invention
[0005] This application provides a window scaling method and an electronic device to improve the window scaling effect.
[0006] In a first aspect, embodiments of this application provide a window scaling method applied to an electronic device. The method includes: displaying a first window; responding to a received first operation, displaying a second window that covers the first window; wherein the second window is a copy of the first window; scaling the form of the first window and the second window according to a received second operation; wherein, during the scaling of the second window, the content in the second window is scaled proportionally; updating the first window to a third window and stopping the display of the second window; wherein the third window is a window obtained by scaling the first window based on the second operation. The first operation is used to trigger scaling of the first window, and the second operation is used to scale the first window. Displaying the second window that covers the first window means displaying the second window on top of the first window. The window obtained by scaling the first window based on the second operation is a window obtained by rearranging the content of the first window based on the size corresponding to the second operation, where the size corresponding to the second operation is the size to be scaled to indicated by the second operation.
[0007] In this method, during the scaling of the first window, the electronic device can cover it with a second window, making the first window invisible to the user and avoiding the appearance of white or black borders that might occur during scaling. Furthermore, while scaling the first window, the electronic device can also scale the second window, with the content in the second window scaling proportionally. Therefore, the electronic device does not need to rearrange the window content when scaling the second window, greatly improving the speed of drawing and displaying the second window. This ensures responsiveness and avoids issues such as white or black borders or content jitter during scaling, achieving a smooth and fluid scaling effect for the second window. After scaling the second window, the electronic device can switch back to displaying the third window, i.e., the scaled-up first window, enabling actual window scaling. Based on this method, the electronic device can utilize window duplication to display the window scaling process in real-time and smoothly, achieving real-time stepless window scaling and avoiding issues such as white or black borders, content jitter, and responsiveness during scaling, thus improving the window scaling effect.
[0008] In the above method, the size of the second window is the same as the size of the first window. Both the first window and the second window can be scaled simultaneously. Scaled windows of the first window can display the effect of scaling the first window's form with the second operation. Scaled windows of the second window can display the effect of scaling the second window with the second operation. Since the second window covers the first window, the effect of scaling the second window with the second operation will cover the effect of scaling the first window's form with the second operation; therefore, the effect of scaling the first window's form with the second operation is not visible to the user.
[0009] In one possible design, the content in the second window is scaled proportionally by the larger of the horizontal scaling ratio and the vertical scaling ratio of the second window.
[0010] This method ensures that during the scaling process of the second window, the content in the second window always fills the display area of the second window without white or black borders, thus guaranteeing a stepless scaling effect.
[0011] In one possible design, the method further includes: when the content obtained after scaling the content in the second window proportionally contains content outside the window area of the second window, the content outside the window area of the second window is cropped.
[0012] The above method ensures that the content in the second window always fills the display area of the second window and does not exceed the display area during the non-uniform scaling process of the second window, thus guaranteeing the scaling effect of stepless scaling.
[0013] In one possible design, the third window includes the first content; updating the first window to the third window includes: displaying the first content in the first window in a fade-in manner.
[0014] This method allows for a smooth and seamless cancellation of the second window, facilitating smooth window switching during window scaling.
[0015] In one possible design, the same content in the first window and the third window is the same size.
[0016] In one possible design, stopping the display of the second window includes: stopping the display of the second window in a fade-out manner.
[0017] This method can smoothly display scaled windows, facilitating smooth window switching during the scaling process.
[0018] In one possible design, the method further includes: fading in the content of the first window when scaling the first window begins. The method also includes: fading out the second window when scaling the second window begins. This method allows for window switching with a fade-in / fade-out effect throughout the scaling process, thereby improving the smoothness and fluidity of window scaling.
[0019] In one possible design, updating the first window to a third window includes: updating the first window to a third window when a set condition is met. Optionally, the set condition includes at least one of the following: the display duration of the first window is greater than or equal to a first set duration; the duration during which the size of the first window remains unchanged is greater than or equal to a second set duration; the rate of change of the size of the first window is greater than or equal to a set rate of change; the duration of the content in the first window fading in is greater than or equal to a third set duration; and the duration of the second window fading out is greater than or equal to the third set duration.
[0020] Based on the above method, electronic devices can trigger the switching or re-layout of actual windows under different triggering conditions, offering high flexibility. It can also adapt to more scenarios, making it highly practical. Furthermore, the method reduces the number of times the content in the window is re-laid out during window scaling, thereby reducing power consumption and improving performance.
[0021] In one possible design, before displaying the second window that covers the first window, the method further includes: copying the first window to obtain the second window, and caching the second window. The cached second window can be used to display the effect of scaling the second window.
[0022] Based on this method, after caching the second window, the electronic device can quickly obtain the second window during the window scaling process, which helps to improve the overall processing efficiency.
[0023] In one possible design, the method further includes: displaying a fourth window that covers the third window; wherein the fourth window is a copy of the third window; scaling the form of the third window and the fourth window according to a received third operation; wherein, during the scaling of the fourth window, the content in the fourth window is scaled proportionally; updating the third window to a fifth window and stopping the display of the fourth window; wherein the fifth window is a window obtained by scaling the third window based on the third operation.
[0024] Based on the above method, after displaying a scaled window, the electronic device can continue to scale the window based on the scaled window, using the same method. That is, the window scaling process can be achieved through multiple stages of window scaling, with a rearrangement of the content within the window at each stage. During the intervals between rearrangements, the scaling effect is displayed based on a duplicate window. This method can reduce power consumption while performing smooth and fluid window scaling.
[0025] In a second aspect, this application provides an electronic device, the electronic device including a memory and one or more processors; wherein the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the one or more processors, the electronic device causes the electronic device to perform the method described in the first aspect or any possible design of the first aspect.
[0026] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the method described in the first aspect or any possible design of the first aspect.
[0027] Fourthly, this application provides a computer program product comprising a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any possible design of the first aspect.
[0028] Fifthly, this application provides a chip system including a processor and a memory, wherein the memory stores instructions; when the instructions are executed by the processor, they implement the methods described in the first aspect or any possible design of the first aspect. The chip system may be composed of chips or may include chips and other discrete devices.
[0029] The beneficial effects of the second to fifth aspects mentioned above can be found in the beneficial effects of the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0030] Figure 1 is a flowchart illustrating a window scaling method;
[0031] Figure 2 is a schematic diagram of the hardware architecture of an electronic device provided in an embodiment of this application;
[0032] Figure 3 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0033] Figure 4 is a schematic diagram of the relevant interface during a window scaling process provided in an embodiment of this application;
[0034] Figure 5 is a schematic diagram of a window display effect provided in an embodiment of this application;
[0035] Figure 6 is a schematic diagram of an application window provided in an embodiment of this application;
[0036] Figure 7 is a schematic diagram of the relevant interface during a window scaling process provided in an embodiment of this application;
[0037] Figure 8 is a schematic diagram of the relevant interface during a window scaling process provided in an embodiment of this application;
[0038] Figure 9 is a schematic diagram of the interface related to a window scaling method provided in an embodiment of this application;
[0039] Figure 10 is a schematic diagram of the architecture of a window scaling system provided in an embodiment of this application;
[0040] Figure 11 is a flowchart illustrating a window scaling method provided in an embodiment of this application;
[0041] Figure 12 is a schematic diagram of a window scaling method provided in an embodiment of this application;
[0042] Figure 13 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0044] In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature.
[0045] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0046] The main problem with current application window scaling is that during the window scaling process, the processing of recalculating and drawing the content layout under the new window size cannot keep up with the window scaling operation or the change of window size. This leads to problems such as white borders turning into black borders, unresponsiveness, and content jitter during window scaling, resulting in a less than smooth scaling effect.
[0047] Specifically, the display and scaling of current application windows are generally accomplished through collaboration between applications and system services within electronic devices. Applications can be used to calculate the content layout within the window. System services can be used to draw and display the window, specifically, drawing and displaying the content within the window based on the content layout calculated by the application. Figure 1 is a schematic diagram of a window scaling process. As shown in Figure 1, a current window scaling process may include:
[0048] S101: Applications in electronic devices display their windows via system services.
[0049] The window contains the application's content.
[0050] S102: The system service adjusts the size of the displayed window based on the received window scaling operation.
[0051] The window scaling operation is used to scale the window.
[0052] S103: System service notification application window size has changed and the new window size.
[0053] S104: The application redefines the layout of the new content in the changed window based on the changed window size.
[0054] S105: The application will layout new content to notify the system service.
[0055] S106: The system service lays out and displays the changed content in the window based on the new content layout.
[0056] S107: The system service determines whether the window scaling operation has ended; if yes, proceed to step S108; otherwise, proceed to step S102.
[0057] S108: The system service continues to display the current window.
[0058] In the above process, step S102 takes very little time, so the window size can change with the window scaling operation. However, steps S104 to S106 take a long time, so the display frame rate is low. During the window scaling process, the update of the content layout in the window may not keep up with the window size change, resulting in white or black borders, content jitter, and other problems in the window.
[0059] In another approach, the window size in the above method can also change to adapt to the content layout within the window, meaning that the change in window size is synchronized with the change in the content layout, thus avoiding white or black borders in the window. However, this can lead to the problem of the window not responding when resizing.
[0060] To address the above issues and improve the scaling effect of application windows, this application provides a window scaling method and an electronic device. This method ensures that the window size changes in real time and that there is always content filling the window during scaling, thus avoiding problems such as white or black borders, content jitter, and unresponsiveness, achieving smooth and seamless window scaling.
[0061] The technical solutions provided in this application can be executed by any electronic device with a window display function. In some embodiments of this application, the electronic device can be a portable device, such as a mobile phone, tablet computer, laptop computer, wearable device with wireless communication function (e.g., watch), vehicle terminal device, augmented reality (AR) / virtual reality (VR) device, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), smart home device (e.g., smart TV), intelligent robot, workshop equipment, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, or wireless terminal in smart home, flying equipment (e.g., intelligent robot, drone, airplane), etc. Among them, wearable device is a portable device that the user can wear directly on their body or integrate into the user's clothing or accessories.
[0062] In some embodiments of this application, the electronic device may also be a portable terminal device that includes other functions. Exemplary embodiments of the portable terminal device include, but are not limited to, carrying... Alternatively, it could be a portable terminal device with another operating system. The aforementioned portable terminal device could also be other portable terminal devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of this application, the aforementioned electronic device may not be a portable terminal device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0063] For more information on the performance of electronic devices, please refer to the relevant descriptions below.
[0064] Referring to Figure 2 below, the structure of the electronic device to which the method provided in the embodiments of this application is applicable will be described.
[0065] As shown in Figure 2, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc.
[0066] The sensor module 180 may include a gyroscope sensor, an accelerometer, a proximity sensor, a fingerprint sensor, a touch sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an ambient light sensor, a barometric pressure sensor, a bone conduction sensor, etc.
[0067] It is understood that the electronic device 100 shown in Figure 2 is merely an example and does not constitute a limitation on the electronic device. Furthermore, the electronic device may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in Figure 2 can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits (ASICs).
[0068] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0069] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0070] The window scaling method provided in this application embodiment can be executed by the processor 110, which can control or call other components. For example, it can call the processing program of this application embodiment stored in the internal memory 121, or call the processing program of this application embodiment stored in a third-party device through the external memory interface 120 to control the wireless communication module 160 to communicate with other devices, thereby improving the intelligence and convenience of the electronic device 100 and enhancing the user experience. The processor 110 may include different devices. For example, when integrating a CPU and a GPU, the CPU and GPU can cooperate to execute the window scaling method provided in this application embodiment. For example, some algorithms in the window scaling method can be executed by the CPU, and other algorithms can be executed by the GPU to achieve faster processing efficiency.
[0071] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays screens 194, where N is a positive integer greater than 1. Display screen 194 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs). For example, display screen 194 can display photos, videos, web pages, or documents, etc.
[0072] In this embodiment of the application, the display screen 194 can be a single flexible display screen, or it can be a splicing display screen composed of two rigid screens and a flexible screen located between the two rigid screens.
[0073] Camera 193 (a front-facing camera or a rear-facing camera, or a single camera that can function as both) is used to capture still images or videos. Typically, camera 193 may include a photosensitive element such as a lens assembly and an image sensor. The lens assembly includes multiple lenses (convex or concave lenses) for collecting light signals reflected from the object being photographed and transmitting these signals to the image sensor. The image sensor generates a raw image of the object being photographed based on the light signals.
[0074] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area can store the operating system, application program code (such as the functions corresponding to the scheme in this application), etc. The data storage area can store data created during the use of the electronic device 100.
[0075] The internal memory 121 may also store one or more computer programs corresponding to the algorithm of this application. The one or more computer programs are stored in the internal memory 121 and configured to be executed by one or more processors 110. The one or more computer programs include instructions that can be used to perform the various steps in the following embodiments.
[0076] In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0077] Of course, the algorithm code of the embodiment of this application can also be stored in external memory. In this case, the processor 110 can run the algorithm code of the embodiment of this application stored in external memory through the external memory interface 120.
[0078] A touch sensor, also known as a "touch panel," can be located on the display screen 194. The touch sensor and display screen 194 together form a touch display screen, also called a "touch screen." The touch sensor detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor may also be located on the surface of the electronic device 100, in a different position than the display screen 194.
[0079] For example, the display screen 194 of the electronic device 100 can display a main interface, which includes icons for multiple applications (such as a camera application, a fitness and health application, etc.). For instance, a user can tap the camera application icon on the main interface using a touch sensor, triggering the processor 110 to launch the camera application and open the camera 193. The display screen 194 then displays the camera application's interface, such as the viewfinder.
[0080] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0081] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0082] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device. In this embodiment, the mobile communication module 150 can also be used for information interaction with other devices.
[0083] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0084] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2. In this embodiment, the wireless communication module 160 can be used to establish connections with other electronic devices for data interaction. Alternatively, the wireless communication module 160 can be used to access access point devices, send control commands to other electronic devices, or receive data from other electronic devices.
[0085] In addition, the electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor, such as music playback and recording. The electronic device 100 can receive input from buttons 190, generating key signal inputs related to user settings and function control. The electronic device 100 can use a motor 191 to generate vibration alerts (such as vibration alerts for incoming calls). The indicator 192 in the electronic device 100 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. The SIM card interface 195 in the electronic device 100 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
[0086] It should be understood that in practical applications, the electronic device 100 may include more or fewer components than those shown in FIG. 2, and the embodiments of this application are not limited thereto. The illustrated electronic device 100 is merely an example, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0087] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. A layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. For example, as shown in Figure 3, this software architecture can be divided into four layers, from top to bottom: the application layer, the application framework layer (framework, FWK), the runtime and system libraries, and the (Linux) kernel layer.
[0088] The application layer is the top layer of the operating system and includes native operating system applications such as camera, gallery, calendar, Bluetooth, music, video, and messaging applications, as well as third-party applications. The applications discussed in this application embodiment are referred to as applications (APPs), which are software programs capable of performing one or more specific functions. Typically, multiple applications can be installed on an electronic device, such as camera applications and email applications. The applications mentioned below can be system applications pre-installed on the electronic device at the factory, or third-party applications downloaded by the user from the network or obtained from other electronic devices during the use of the electronic device.
[0089] Of course, for developers, they can write applications and install them into this layer. In one possible implementation, the application can be developed using the Java language, by calling the application programming interface (API) provided by the application framework layer. Developers can then interact with the underlying operating system (such as the kernel layer) through the application framework to develop their own applications.
[0090] The application framework layer provides the API and programming framework for the application layer. It can include predefined functions. The application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0091] The window manager is used to manage window programs. The window manager can obtain the screen size, determine if a status bar is present, lock the screen (or display), and capture the screen, among other things.
[0092] Content providers are used to store and retrieve data, and make that data accessible to applications. This data may include files (e.g., documents, videos, images, audio), text, and other information.
[0093] A view system includes visual controls, such as controls that display text, images, documents, and other content. View systems can be used to build applications. An interface in a display window can consist of one or more views. For example, a display interface including a text message notification icon could include a view that displays text and a view that displays images.
[0094] The phone manager provides communication functionality for electronic devices. The notification manager allows applications to display notification information in the status bar; it can be used to convey informative messages and can disappear automatically after a short pause without user interaction.
[0095] The runtime includes the core libraries and the virtual machine. The runtime is responsible for system scheduling and management.
[0096] The system's core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part is the system's core library. The application layer and application framework layer run in a virtual machine. Taking Java as an example, the virtual machine executes the Java files in the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0097] The system library can include multiple functional modules. Examples include: a surface manager, a media library, a 3D graphics processing library (e.g., OpenGL ES), a 2D graphics engine (e.g., SGL), and an image processing library. The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.564, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0098] The kernel layer provides core system services for the operating system, such as security, memory management, process management, network protocol stack, and driver models, all of which are implemented based on the kernel layer. The kernel layer also serves as an abstraction layer between the hardware and software stacks. This layer contains many drivers related to electronic devices, including: display drivers; keyboard drivers as input devices; Flash drivers for memory-based devices; camera drivers; audio drivers; Bluetooth drivers; and WiFi drivers.
[0099] It is important to understand that the functional services described above are just an example. In practical applications, electronic devices may be divided into more or fewer functional services based on other factors, or the functions of each service may be divided in other ways, or they may not be divided into functional services but work as a whole.
[0100] The methods provided in the embodiments of this application will be described in detail below.
[0101] In the method provided in this application embodiment, after the electronic device displays an application window, it can perform real-time, stepless window scaling based on a received window scaling operation. The window scaling operation is used to control the scaling of the application window. Stepless window scaling means continuous and smooth window scaling.
[0102] Specifically, when an electronic device is not displaying an application window in full screen, and the user is resizing the application window, the electronic device can cache a copy of the application window when the user starts resizing it. The device can then scale the application window and the copy window accordingly as the user resizes the window, displaying the copy window on top of the application window in real time. When the application window or copy window reaches a set size, or when a re-layout of the application window is completed, the electronic device can switch the copy window to the re-laid-out application window. This can be achieved through animations or effects such as the re-laid-out application window fading in (or appearing) and the copy window fading out (or disappearing). If the user continues to resize the application window after displaying the re-laid-out application window, the electronic device can cache the copy window again and use a similar method to display the real-time scaling effect. When scaling windows using this method, the window size can be changed in real time with user operation while avoiding problems such as white or black borders in the window, allowing users to see a smooth and fluid window change process, thereby improving the window scaling effect.
[0103] The method will be described in detail below with reference to the accompanying drawings.
[0104] The method provided in this application embodiment can be executed collaboratively by a system service and a first application in an electronic device. The first application can be any application in the electronic device, and the application window displayed on the electronic device can be the window of the first application. In the scenario of displaying and scaling the application window, the first application can be used to determine the content layout of the content to be displayed in the application window. The system service can draw and display the application window based on the content layout determined by the first application. Optionally, after the system service draws the application window, it can send it to the display via the GPU.
[0105] In the method provided in this application embodiment, on one hand, after the electronic device displays the application window of the first application, it can perform at least one relayout during the window scaling process. Each relayout includes: determining a new content layout for the content to be displayed in the scaled application window through the first application; drawing the scaled application window (i.e., the relayout window) based on the new content layout determined by the first application through a system service; and displaying the relayout window. The relayout window drawn by the system service can be stored in memory. The above process can be implemented with reference to the method described in Figure 1, and will not be repeated here. On the other hand, when window scaling begins, the system service can cache a copy of the currently displayed application window, and before the next relayout, cover the currently displayed application window with the copy window that scales in real-time with the window scaling operation. The system service can cache the copy of the relayout window obtained each time it obtains the relayout window, and cover the currently displayed application window with the copy window that scales in real-time with the window scaling operation before the next relayout.
[0106] The above method will be explained in detail below using a scenario where an electronic device can perform two re-layouts during window scaling as an example. Methods for scenarios where an electronic device performs fewer or more re-layouts during window scaling can be implemented using the following methods, which will not be detailed further in this embodiment.
[0107] In some embodiments of this application, the process of displaying and scaling an application window by an electronic device may include the methods described in stages 1 to 5 below.
[0108] Phase 1: Application Window Display
[0109] During this stage, the electronic device can display a first application window. The size of the first application window can be a first size, and the content in the first application window conforms to a first content layout. The content layout of the content included in the first application window can be determined by the first application and instructed to the system service. The system service can draw and display the first application window based on the layout instructed by the first application and store the first application window in memory. The first application window can include various types of elements such as controls, graphics, text, images, and videos.
[0110] Example 1: In one example, taking a laptop computer as an example, the first application window displayed by the electronic device can be window A as shown in the schematic diagram in Figure 4(a).
[0111] Phase 2, First Window Scaling Phase
[0112] During this stage, after the electronic device displays the first application window, when the system service receives the first user operation to trigger scaling of the first application window, the system service can perform the following steps A1 to A2:
[0113] A1: The system service caches a copy of the first application window. For ease of description, the copy of the first application window will be referred to as the first copy window below.
[0114] In this context, the copied window of the application window can also be understood as or replaced with an image of the application window.
[0115] Optionally, the system service can cache the first copy window in the memory corresponding to the GPU (such as the graphics card or video memory).
[0116] A2: When the system service receives a second user operation to scale the first application window, it can display the scaling effect of the first application window along with the received user operation, and display the first window effect based on the first copied window; wherein, the second user operation and the first user operation are consecutive operations, and the first window effect includes the effect of the first copied window covering the first application window scaling synchronously with the first application window, and the size of the first copied window is always the same as the size of the first application window. The size of the first copied window and the size of the second copied window are the sizes corresponding to the received user operation.
[0117] The scaling effect of the first application window includes adjusting its size according to the second user's operation. During the scaling of the first copy window, the content area of the first copy window (including the content within the first copy window) can be scaled proportionally to the scaling ratio of the side with the largest change ratio in the first copy window. During the scaling process, content that exceeds the area of the first copy window can be cropped (i.e., not displayed).
[0118] For example, when a second user action is used to instruct the first application window to be scaled from a first size to a second size, the system service can respond to the second user action by displaying the effect of scaling the first application window from the first size to the second size and the first window effect, which may include the effect of scaling a first copy window that covers the first application window from the first size to the second size.
[0119] Optionally, the system service can receive user operations through an input device. For example, the input device may include a touchscreen, touchpad, external input device (such as a mouse), or other types of input devices; no specific limitations are imposed in this embodiment.
[0120] The above method will be illustrated by example in Example 2 below.
[0121] Example 2: In one example, based on the scenario described in Example 1, taking a scenario where a system service receives user operations via mouse as an example, the first user operation can be the operation of the user placing the mouse cursor at any boundary position of the first application window and selecting it. The second user operation can be a movement operation performed by the user after the first user operation. In this scenario, taking the operation of moving from the first position P1 to the second position P2 as shown in the schematic diagram in Figure 4(a) as an example, the second user operation can be used to enlarge the window A (first size) shown in the schematic diagram in Figure 4(a) to the second size shown in the schematic diagram in Figure 4(a) (i.e., the size marked by the dashed box).
[0122] In this scenario, when the system service begins receiving the second user's operation, it can display a copy window B that covers window A. That is, it can switch from the interface shown in diagram (a) of Figure 4 to the interface shown in diagram (b) of Figure 4. Here, the copy window B shown in diagram (b) of Figure 4 is a copy of window A shown in diagram (a) of Figure 4. While continuing to receive the second user's operation, the system service can display a real-time magnified window A and the first window effect. The first window effect can include the effect of gradually magnifying the copy window B shown in diagram (b) of Figure 4 to the copy window B shown in diagram (c) of Figure 4, and then gradually magnifying it to the copy window B shown in diagram (d) of Figure 4. Here, the size of the copy window B shown in diagram (d) of Figure 4 is the second size. As shown in diagrams (b) to (d) of Figure 4, during the display of the first window effect, the content in the copy window B is scaled proportionally.
[0123] It should be noted that the interfaces shown in schematic diagram (b) of Figure 4 and schematic diagram (d) of Figure 4 are the interfaces corresponding to the start and end of the first window effect, respectively. Schematic diagram (c) of Figure 4 only shows the interface at a certain moment in the display process of the first window effect, not all interfaces, and therefore does not limit the display process of the first window effect.
[0124] It should also be noted that in the interface shown in Figure 4(b), the area where the copied window B is located actually displays both window A (the actual window) and the copied window B. As shown in Figure 5, since the size of the copied window B is the same as the size of window A and the copied window B is displayed on top of window A, the display effect is as shown in Figure 4(b). The effects shown in Figure 4(c) and Figure 4(d) are similar. The interfaces shown in Figure 4(c), Figure 4(d), or other moments during the scaling process are similar.
[0125] In the above method, because the system service caches the copied window B, during the window scaling process based on the second user's operation, the system service can adjust the size of the original window (window A) in real time and draw and display the real-time changing window scaling effect based on the cached copied window B, without requiring the first application to redefine the real-time changing content layout before drawing and displaying. This improves processing speed, ensures real-time window size changes while presenting the effect of the content filling the entire window (without white or black borders), and reduces content jitter. Therefore, the above method can achieve a smooth and fluid window scaling effect.
[0126] Phase 3, First Reconfiguration Phase
[0127] During this phase, when the second user operation described in phase 2 above ends, the following steps B1 to B4 can be executed:
[0128] B1: The system service determines the first target size that the first application window needs to be scaled to based on the second user's operation, and notifies the first application.
[0129] For example, when a second user action is used to instruct the first application window to be scaled from a first size to a second size, the first target size is the second size.
[0130] B2: The first application redetermines the second content layout in the second application window obtained when the first application window is scaled to the first target size, and instructs the system service on the second content layout.
[0131] B3: The system service draws the second application window based on the second content layout.
[0132] The second application window can be stored in memory.
[0133] Optionally, the system service can cache the second copy window in the memory corresponding to the GPU (such as the graphics card or video memory).
[0134] Example 3: In one example, based on the scenario described in Example 2 above, the second application window can be window A as shown in Figure 6, that is, the window obtained by enlarging window A shown in the schematic diagram in Figure 4(a) from the first size to the second size. As shown in Figure 6, the size of the enlarged window A can be the second size, and the content layout in the enlarged window A can be different from the content layout in the first application window shown in the schematic diagram in Figure 4(a).
[0135] B4: The system service updates the first application window and the first copied window to the second application window.
[0136] In some embodiments of this application, the system service updates the first application window and the first copied window to the second application window by displaying an animation effect that gradually switches from the first application window and the first copied window to the second application window, thereby further improving the smoothness and fluidity.
[0137] Example 4: In one example, based on the scenario described in Example 3 above, after the system service draws the enlarged window A, it can gradually switch from the interface shown in the schematic diagram (d) of Figure 4 to the interface shown in Figure 6. During the switching process, an animation effect can be displayed to show the gradual transition from the window shown in the schematic diagram (d) of Figure 4 to window A shown in Figure 6. This animation effect can be a fade-in / fade-out animation or a fade-out / fade-in animation. The animation effect is described in detail below.
[0138] In this scenario, the position of window A shown in the schematic diagram of Figure 4(a) can be designated as position 1, and the position of the enlarged window A (i.e., window A in Figure 6) can be designated as position 2. Window A may include a form and a content area. The form may include shadows, borders, etc., and the content area includes the content within window A. As the user zooms in on window A, the form of window A can be zoomed from position 1 to position 2, and the copied window B can be zoomed from position 1 to position 2.
[0139] In this embodiment, during the process of scaling up window A from position 1 to position 2 and scaling up the copied window B from position 1 to position 2, the content area of window A and the copied window B can have a fade-in / fade-out effect. Specifically, the content area of window A fades in while the copied window B fades out, thus achieving a smooth transition effect where the copied window gradually transforms into the actual window. The size of the fade-in window A can be imported based on the scaled-up new window size. Optionally, the fade-in of window A and the fade-out of window B can begin when scaling up from position 1, or at some point during the scaling process from position 1 to position 2; this embodiment does not impose specific limitations. Based on this method, when the fade-in of window A is complete and the fade-out of the copied window B is complete, the copied window completely transforms into the actual window.
[0140] Example 5: In one example, consider a scenario where a user shrinks window A (the application window) shown in diagram (a) of Figure 7 to the size shown in diagram (d) of Figure 7. When the user triggers the shrinking of window A, the system service can display a copy window B of window A on top of window A shown in diagram (a) of Figure 7, i.e., display the interface shown in diagram (b) of Figure 7. During the process of the user shrinking window A, as shown in diagrams (b) to (d) of Figure 7, the form of window A can shrink to the size shown in diagram (d) of Figure 7 in real time with the user's operation, and the copy window B can also shrink to the size shown in diagram (d) of Figure 7 in real time with the user's operation. The dashed boxes shown in diagrams (c) and (d) of Figure 7 are used to represent the initial size of the copy window B and window A, which is the same as the size of window A shown in diagram (a) of Figure 7. When the form of window A and its copy window B begin to shrink, or at a moment during the shrinking process of the form of window A and its copy window B (e.g., at the moment when the interface shown in schematic diagram (c) of Figure 7 is displayed), the content area of window A may be presented with a fade-in effect, and window B may be displayed with a fade-out effect until the shrunk window A shown in schematic diagram (d) of Figure 7 is displayed.
[0141] Example 6: In one example, as shown in Figure 8, consider a scenario where a user zooms in on window A (the application window) shown in diagram (a) of Figure 8 to the position indicated by the dashed box, i.e., zooms in on window A as shown in diagram (d) of Figure 8. When the user triggers the zooming of window A, the system service can display a copy window B of window A on top of window A shown in diagram (a) of Figure 8, i.e., display the interface shown in diagram (b) of Figure 8. During the process of the user zooming in on window A, as shown in diagrams (b) to (d) of Figure 8, the form of window A can be zoomed in real time to the size shown in diagram (d) of Figure 8, and the copy window B can also be zoomed in real time to the size shown in diagram (d) of Figure 8.
[0142] In the above scenario, since the scaling ratio of the width of window A is higher than that of the height of window A, the scaling ratio of the width of window A is used as the scaling ratio when the content area of the copied window B is scaled up proportionally. For example, in the scenario shown in Figure 8, when window A is scaled up from the size L1×L2 shown in the schematic diagram in Figure 8(a) to the size L3×L4 shown in the schematic diagram in Figure 8(c), the scaling ratio of the width of window A is L3 / L1, the scaling ratio of the height of window A is L4 / L2, and L4 / L2 is less than L3 / L1. Therefore, the scaling ratio of the content area of the copied window B is L3 / L1. Therefore, during the process of scaling window A from L1×L2 as shown in diagram (a) of Figure 8 to L3×L4 as shown in diagram (c) of Figure 8, as shown in Figure 9, the window of the copied window B scales from L1×L2 to L3×L4 (the same scaling as window A). However, the content area of the copied window B can be scaled proportionally according to the scaling ratio L3 / L1, thus exceeding the window area of window B. In this scenario, the portion of the content area of window B that exceeds the window area of the copied window B after scaling can be clipped, resulting in the effect of the copied window B shown in diagram (c) of Figure 8. The effects at other moments during the scaling process are similar and will not be listed and explained one by one.
[0143] In some embodiments of this application, the system service can execute the method described in stage 3 only when the relayout condition is met. The relayout condition can be a set condition used to trigger the application to recalculate the content layout within the window. Based on this method, after receiving the first user operation, the system service can execute the relayout method described in stage 3 when it detects that the relayout condition is met. The second user operation is a user operation received by the system service within the time period between receiving the first user operation and detecting that the relayout condition is met. This method can reduce the frequency of relayout during window scaling, thereby reducing performance overhead and improving the frame rate of complex applications during window scaling.
[0144] In some embodiments of this application, the reconfiguration conditions may include at least one of the following:
[0145] 1) The rate of change of the window size exceeds the set rate of change.
[0146] 2) The time interval since the last content layout reaches a first set duration. Content layout includes content layout performed when the application window is displayed or re-layout performed during window scaling.
[0147] 3) The duration during which the received window scaling operation remains unchanged reaches the second preset duration. That is, the duration during which the user pauses scaling during the window scaling operation reaches the second preset duration.
[0148] 4) The display duration of the fade-in / fade-out effect (or animation) reaches the third set duration.
[0149] 5) The distance the point of action of the received window scaling operation has moved has reached the set distance.
[0150] The above conditions can be set differently for different applications.
[0151] Phase 4, Second Window Scaling Phase
[0152] During this stage, the electronic device can cache a copy of the second application window after drawing the second application window (i.e., step B3 above) or displaying the second application window (i.e., step B4 above). For ease of description, the copy of the second application window will be referred to as the second copy window below. Optionally, the system service can cache the second copy window in the memory corresponding to the GPU (e.g., the graphics card or video memory).
[0153] When the system service receives a third user operation that triggers scaling of the second application window, the system service can perform the following steps: While receiving the third user operation to scale the second application window, the system service can display the scaling effect of the second application window in sync with the received user operation, and display the second window effect based on a cached second copy window; wherein, the second window effect includes the effect of the second copy window covering the second application window scaling synchronously with the second application window, and the size of the second copy window is always the same as the size of the second application window (the size corresponding to the received user operation). Optionally, the third user operation and the second user operation can be consecutive operations. The scaling effect of the second application window includes the effect of adjusting the size of the second application window in sync with the third user operation. The specific implementation method for this step can be referred to the method described in step A2 above, and will not be detailed here.
[0154] Phase 5, Second Restructuring Phase
[0155] During this phase, when the third user operation described in phase 2 above ends and a fourth user operation is received to trigger the stop window scaling, the system service can execute the following steps D1 to D4:
[0156] D1: The system service determines the second target size that the second application window needs to be scaled to based on the third user's operation, and notifies the first application.
[0157] D2: The first application redefines the third content layout in the third application window obtained when the second application window is scaled to the second target size, and instructs the system service on the third content layout.
[0158] D3: The system service draws the third application window based on the third content layout.
[0159] D4: The system service updates the second application window and the second copied window to the third application window.
[0160] The specific implementation methods for steps D1 to D4 can be referred to the methods described in steps B1 to B4 above, and will not be detailed here.
[0161] The fourth and third user operations mentioned above can be consecutive operations. In this scenario, the consecutive first, second, third, and fourth user operations can constitute the aforementioned window scaling operation.
[0162] In some embodiments of this application, the system service may execute the method described in stage 5 only when the above-described reconfiguration conditions are met.
[0163] Based on the method provided in the above embodiments, the window size can be changed in real time with the user's operation during the window scaling process, and no white or black borders will appear during the window change process, reducing the content jitter effect and thus improving the window scaling effect.
[0164] Figure 10 is a schematic diagram of a possible system architecture to which the method provided in the above embodiments of this application applies. Optionally, the system can be deployed in an electronic device. As shown in Figure 10, the system may include an application (such as the aforementioned first application), system services, an input device, and a GPU. In the scenario of displaying and scaling the application window, the application can be used to determine the content layout of the application window. The system service can draw the application window based on the content layout determined by the application and display the application window via the GPU. The input device can be used to receive user operations (such as operations for controlling the display and scaling of the application window). For example, the input device may include a touchscreen, a touchpad, an external input device (such as a mouse), or other types of input devices; no specific limitations are made in the embodiments of this application.
[0165] System services and applications can scale the application window based on the methods described in the foregoing embodiments.
[0166] In some embodiments of this application, as shown in FIG10, the system service may include an application framework, an input subsystem, a window management subsystem, and a graphics subsystem.
[0167] The application framework provides basic functionalities for common applications, simplifying development and reducing investment. The input subsystem receives and processes signals from input devices (indicating received user actions, etc.), converting them into data for other subsystems or applications to process. The window management subsystem manages windows for different applications, such as their position, size, and hierarchy. It also receives data from the input subsystem and submits it to the application. The graphics subsystem renders actual graphics or image content (e.g., rendering application windows) and displays it via the GPU.
[0168] It should be understood that the system architecture in the electronic device described above is merely an example. In practical applications, modules can be added or removed, or modules can be split or merged. This application does not impose specific limitations. The division of functional modules in the system architecture of the electronic device described above is illustrative and only represents a logical functional division. In actual implementation, there may be other division methods, and the specific functions performed by each functional module may also be divided in other ways. For example, the electronic device may also be divided into more or fewer functional services according to other factors, or the functions of each service may be divided in other ways, or it may not be divided into functional services but work as a whole. The names of the functional modules described above are merely examples, and the names of the functional modules in the embodiments of this application are not limited.
[0169] Based on the system architecture shown in Figure 10 and the method provided in the foregoing embodiments, as shown in Figure 11, a possible window scaling process provided in this application embodiment may include:
[0170] S1101: The application window for the system service display application in the electronic device.
[0171] Optionally, the application can display the application window through the window subsystem, graphics subsystem, etc. shown in Figure 10.
[0172] Optionally, step S1101 can be implemented by referring to the method of stage 1 above, and will not be described in detail here.
[0173] S1102: The system service has determined to begin receiving window resizing operations.
[0174] Optionally, the window scaling operation can be received through the input device shown in Figure 10, and the start of the window scaling operation can be completed collaboratively by the input subsystem and the window management subsystem shown in Figure 10.
[0175] S1103: The system service caches a copy of the currently displayed application window.
[0176] Optionally, this step can be performed using the graphics subsystem shown in Figure 10.
[0177] Optionally, steps S1102 to S1103 can be implemented by referring to the method described in step A1 of stage 2 above, and will not be described in detail here.
[0178] S1104: The system service determines whether the relocation conditions are met; if yes, proceed to step S1106; otherwise, proceed to step S1105.
[0179] Optionally, the reconfiguration conditions can be referred to the description in the foregoing embodiments, and will not be described in detail here.
[0180] Optionally, this step can be performed through the window subsystem shown in Figure 10.
[0181] S1105: Based on the received window scaling operation, the system service adjusts the size of the original application window in real time and displays the effect of the copied window covering the original application window scaling synchronously with the original application window. Then, it executes step S1104.
[0182] Optionally, this step can be performed using the graphics subsystem shown in Figure 10.
[0183] Optionally, step S1105 can be implemented by referring to the method described in step A2 of stage 2 above, which will not be described in detail here.
[0184] S1106: The system service notifies the application to determine the new content layout when the application's window is scaled to the target size.
[0185] Optionally, this step can be performed through the window subsystem shown in Figure 10.
[0186] S1107: The application determines the layout of new content.
[0187] S1108: The application will notify the system service of new content layout.
[0188] S1109: The system service draws the corresponding new application window based on the new content layout.
[0189] Optionally, this step can be performed using the graphics subsystem shown in Figure 10.
[0190] S1110: The animation effect of the system service display switching from the current display window to the new application window.
[0191] Optionally, this step can be performed using the graphics subsystem shown in Figure 10.
[0192] Optionally, steps S1106 to S1110 can be implemented with reference to the method described in stage 3 above, and will not be described in detail here.
[0193] S1111: The system service determines whether the window scaling operation has ended; if yes, proceed to step S1112; otherwise, proceed to step S1103.
[0194] S1112: The system service continues to display the current application window.
[0195] It should be understood that the implementation processes provided in the above embodiments are merely illustrative examples of the applicable method processes in the embodiments of this application. The execution order of each step in each implementation process can be adjusted according to actual needs, and other steps can be added or some steps can be removed. The execution order between steps that are not temporally related in each implementation process can be arbitrary, and this application embodiment does not impose any restrictions on this.
[0196] It should be noted that the application scenarios provided in the above embodiments are merely illustrative examples of the applicable scenarios of the embodiments of this application, and do not limit the applicable scenarios of the solutions of this application. Some methods or the same technical concepts provided in any of the above embodiments can also be applied in other embodiments or other scenarios, or can be combined with the methods provided in other embodiments. Specifically, they can be applied in combination with specific embodiments or specific scenarios, and will not be listed and described one by one in this application.
[0197] Based on the above embodiments and the same technical concept, this application also provides a window scaling method, as shown in FIG12, which may include:
[0198] S1201: The electronic device displays the first window.
[0199] In some embodiments of this application, the first window can be referred to the first application window described in the foregoing embodiments, and the method for displaying the first window on an electronic device can be referred to the method for displaying the first application window described in stage 1 above, which will not be described in detail here.
[0200] S1202: In response to the received first operation, the electronic device displays a second window that covers the first window; wherein the second window is a copy of the first window.
[0201] The first operation can be used to trigger scaling of the first window. Optionally, the first operation can be referred to the first user operation described in the foregoing embodiments.
[0202] In some embodiments of this application, before displaying a second window that covers the first window, the electronic device can copy the first window to obtain a second window upon receiving a first operation, and cache the second window, for example, by caching it in the memory corresponding to the GPU. When displaying the second window that covers the first window, the electronic device can send the cached second window to the display via the GPU.
[0203] In one instance, when the first window is window A as shown in schematic diagram (a) of Figure 4, the second window can be a copy window B as shown in schematic diagram (b) of Figure 4.
[0204] Optionally, the second window can refer to the first copy window shown in the foregoing embodiment, and the method for the electronic device to display the second window in this step can refer to the method for displaying the first copy window described in stage 2 above, which will not be described in detail here.
[0205] S1203: The electronic device scales the form of the first window and the second window according to the received second operation; wherein, during the scaling of the second window, the content in the second window is scaled proportionally.
[0206] The second operation is used to scale the first window. The second operation and the second operation are consecutive operations. Optionally, the second operation can be referenced to the second user operation described in the foregoing embodiments.
[0207] In some embodiments of this application, the size of the second window is always the same as the size of the first window. The electronic device can simultaneously scale the form of the first window and the second window. The sizes of the first window and the second window during the scaling process can be determined based on a second operation and change with that operation. Based on this method, scaling the form of the first window specifically includes: displaying the effect of the first window scaling with the second operation. Scaling the second window specifically includes: displaying the effect of the second window scaling with the second operation.
[0208] Optionally, in the above method, during the scaling of the first window, the content of the first window may remain unchanged or may change with the second operation (e.g., updating based on traditional methods). This application embodiment does not impose any restrictions on this.
[0209] Based on the above method, during the scaling of the second window, the window body or size of the second window can be scaled with the second operation. This scaling can be proportional or non-proportional. The content in the second window can be scaled proportionally based on the scaling ratio of the second window (i.e., the size of the second window). Specifically, the proportional scaling ratio of the content in the second window is the larger of the horizontal and vertical scaling ratios of the second window. That is, the content in the second window is scaled proportionally with the side of the second window that has the larger rate of change as a reference. During the scaling of the second window, if there is content outside the window body after proportional scaling, this content can be cropped. For example, in the scenario shown in Figure 9, content exceeding the window body of the scaled second window can be cropped.
[0210] The method for scaling the first window and the second window described above can also be referred to the method described in step A2 of stage 2 above, and will not be repeated here.
[0211] S1204: The electronic device updates the first window to the third window and stops displaying the second window; wherein the third window is a window obtained by scaling the first window based on the second operation.
[0212] The aforementioned electronic device updates the first window to the third window and stops displaying the second window. This can also be understood as the electronic device updating the stacked first and second windows to the third window. The third window can be a window obtained by scaling the first window based on the second operation using a traditional method (such as the method shown in Figure 1). In other words, the third window is a window obtained by rearranging the first window to the corresponding size based on the second operation.
[0213] In some embodiments of this application, the electronic device can update the first window to a third window and stop displaying the second window based on a fade-in / fade-out method. Specifically, the third window may include the first content, and updating the first window to the third window can specifically include displaying the first content in the first window using a fade-in method. Stopping the display of the second window can specifically include stopping the display of the second window using a fade-out method. That is, the electronic device can achieve the above effect by fading in the first content and fading out the second window. In the above method, the same content in the first window and the third window has the same size.
[0214] The method described above for updating the first window to the third window and stopping the display of the second window using a fade-in / fade-out approach in electronic devices can be implemented by referring to the method described in stage 3 above, and will not be repeated here.
[0215] In some embodiments of this application, the electronic device may also begin to fade in the content of the first window when scaling the first window's form, and begin to fade out the second window when scaling the second window's form.
[0216] In some embodiments of this application, the condition for triggering the updating of the first window to the third window and stopping the display of the second window can be a set condition. That is, the electronic device can update the first window to the third window and stop displaying the second window when the set condition is met. Optionally, the set condition may include at least one of the following:
[0217] 1) The display duration of the first window is greater than or equal to the first set duration.
[0218] Based on this method, electronic devices can perform a re-layout and update at regular intervals while receiving operations that resize the window.
[0219] 2) The duration of the first window with a fixed size is greater than or equal to the second set duration.
[0220] Based on this method, when an electronic device receives a zoom window operation, it can trigger a re-layout and update if the user pauses the zooming action for a relatively long time.
[0221] 3) The rate of change of the size of the first window is greater than or equal to the set rate of change.
[0222] Based on this method, when an electronic device receives a window scaling operation, it can perform a re-layout and update every time the window changes a certain proportion.
[0223] 4) The fade-in display duration of the content in the first window is greater than or equal to the third set duration.
[0224] Based on this method, electronic devices can undergo a re-layout and update after a certain duration of fade-in animation display.
[0225] 5) The duration of the second window's fade-out display is greater than or equal to the duration set by the third window.
[0226] Based on this method, electronic devices can undergo a re-layout and update after a certain period of fade-out animation display.
[0227] Optionally, the relayout conditions described in the foregoing embodiments can also be used as a reference for setting the conditions.
[0228] Based on the above method, electronic devices can smoothly display the process of scaling the first window to the third window when the user scales the first window, thereby avoiding problems such as white or black borders that affect the scaling effect during window scaling.
[0229] In some embodiments of this application, after the electronic device scales the first window to the third window using the above method, if the user continues to perform scaling operations, the electronic device can continue displaying the window scaling process using the above method. For example, after displaying the third window, the electronic device can continue to display a fourth window that covers the third window; wherein the fourth window is a copy of the third window. It can also scale the form of the third window and the fourth window according to the received third operation; wherein, during the scaling of the fourth window, the content in the fourth window is scaled proportionally; finally, the third window is updated to the fifth window, and the display of the fourth window stops; wherein the fifth window is the window obtained by scaling the third window based on the third operation. The method described in stages 4 to 5 above can be referred to, and will not be repeated here.
[0230] In some embodiments of this application, the above method can be applied to system services in electronic devices.
[0231] The specific steps performed by the electronic device in the above method can be found in the relevant descriptions in the foregoing embodiments, and will not be repeated here.
[0232] Based on the above embodiments and the same technical concept, this application also provides an electronic device for implementing the window scaling method provided in this application. As shown in FIG13, the electronic device 1300 may include: a memory 1301, one or more processors 1302, and one or more computer programs (not shown in the figure). The above-mentioned devices can be coupled through one or more communication buses 1303. Optionally, the electronic device 1300 may also include a display screen 1304.
[0233] The memory 1301 stores one or more computer programs (code), and the one or more computer programs include computer instructions; one or more processors 1302 call the computer instructions stored in the memory 1301, causing the electronic device 1300 to execute the window scaling method provided in the embodiments of this application.
[0234] In a specific implementation, memory 1301 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. Memory 1301 may store an operating system (hereinafter referred to as the system), such as embedded operating systems like Android, iOS, Windows, or Linux. Memory 1301 can be used to store implementation programs of the embodiments of this application. Memory 1301 may also store network communication programs, which can be used to communicate with one or more additional devices, one or more user devices, or one or more network devices.
[0235] One or more processors 1302 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs according to the present application.
[0236] Display screen 1304 is used to display application interfaces and other related user interfaces.
[0237] It should be noted that Figure 13 is only one implementation of the electronic device 1300 provided in this application embodiment. In actual applications, the electronic device 1300 may include more or fewer components. For details, please refer to the specific structure and description shown in Figure 2. No limitations are imposed here.
[0238] Based on the above embodiments and the same technical concept, this application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method provided in the above embodiments.
[0239] Based on the above embodiments and the same technical concept, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer performs the method provided in the above embodiments.
[0240] Based on the above embodiments and the same technical concept, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer performs the method provided in the above embodiments.
[0241] The methods provided in this application can be implemented, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs), or semiconductor media (e.g., SSDs), etc.
[0242] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A window scaling method, applied to electronic devices, characterized in that, The method includes: Display the first window; In response to the received first operation, a second window is displayed that covers the first window; wherein the second window is a copy of the first window; Based on the received second operation, the form of the first window and the second window are scaled; wherein, during the scaling of the second window, the content in the second window is scaled proportionally. The first window is updated to the third window, and the second window is stopped from being displayed; wherein the third window is a window obtained by scaling the first window based on the second operation.
2. The method as described in claim 1, characterized in that, The second window has the same size as the first window.
3. The method as described in claim 1 or 2, characterized in that, The scaling factor of the content in the second window is the larger of the horizontal scaling factor and the vertical scaling factor of the second window.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: When the content in the second window is scaled proportionally and contains content outside the window's bounds, the content outside the window's bounds is cropped.
5. The method according to any one of claims 1 to 4, characterized in that, The third window includes the first content; updating the first window to the third window includes: The first content is displayed in the first window in a fade-in manner.
6. The method according to any one of claims 1 to 5, characterized in that, The same content in the first window and the third window is the same size.
7. The method according to any one of claims 1 to 6, characterized in that, The step of stopping the display of the second window includes: Stop displaying the second window by fading it out.
8. The method according to any one of claims 1 to 7, characterized in that, The step of updating the first window to the third window includes: When the set conditions are met, the first window will be updated to the third window.
9. The method as described in claim 8, characterized in that, The setting conditions include at least one of the following: The display duration of the first window is greater than or equal to the first set duration; The duration during which the first window size remains unchanged is greater than or equal to the second set duration; The rate of change of the size of the first window is greater than or equal to the set rate of change; The fade-in display duration of the content in the first window is greater than or equal to the third set duration; The duration of the second window's fade-out display is greater than or equal to the third set duration.
10. The method according to any one of claims 1 to 9, characterized in that, Before displaying the second window that covers the first window, the method further includes: The first window is copied to obtain the second window, and the second window is cached.
11. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Display a fourth window that covers the third window; wherein the fourth window is a copy of the third window; Based on the received third operation, the form of the third window and the fourth window are scaled; wherein, during the scaling of the fourth window, the content in the fourth window is scaled proportionally. The third window is updated to the fifth window, and the fourth window is stopped from being displayed; wherein the fifth window is a window obtained by scaling the third window based on the third operation.
12. An electronic device, characterized in that, The electronic device includes a memory and one or more processors; The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the one or more processors, the electronic device performs the method as described in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 11.
14. A computer program product, characterized in that, The computer program product includes a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 11.