Application window switching method, electronic device, and storage medium
By drawing mask animations and controlling the playback of rotation animations in electronic devices, the problem of abnormal animation effects during window switching was solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-31
- Publication Date
- 2026-04-28
AI Technical Summary
In electronic devices, when the forced display orientation of an application differs from the grip orientation, animations during window switching become choppy, leading to a degraded user experience.
By drawing mask animations and controlling the sequential playback of mask animations and rotation animations, pausing and resuming calls to the rotation class, the window shape and display orientation can be adjusted to ensure synchronization.
It improves the user experience during application window switching, avoids abnormal coupling between window shape and display orientation changes, and enhances the smoothness of switching.
Smart Images

Figure CN120428885B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display technology, and in particular to an application window switching method, electronic device, and storage medium. Background Technology
[0002] With the diversification of usage scenarios for electronic devices, electronic devices typically run multiple applications simultaneously. Each application opens a separate window on the screen of the electronic device, and each window displays the application interface of an application in a split-screen manner.
[0003] Currently, when an electronic device displays multiple windows, the window can be switched from split-screen display to full-screen display via the top menu bar of each window.
[0004] However, when the application's display orientation is a forced orientation (the forced display orientation does not change with the way the electronic device is held), and the forced display orientation is different from the way the electronic device is held, switching the application's window from split-screen to full-screen display via the top bar requires changing both the window's shape and display orientation simultaneously. This causes abnormal animation effects during window switching, such as stuttering, which reduces the user experience during application window switching. Summary of the Invention
[0005] In view of the above, embodiments of this application provide an application window switching method, an electronic device, and a storage medium to overcome the problems of the prior art.
[0006] In a first aspect, embodiments of this application provide an application window switching method applied to an electronic device. The application window switching method includes: displaying a first window of a first application and a second window of a second application on the display screen of the electronic device in a split-screen manner; when a window switching operation is received, determining the holding direction of the electronic device, the window switching operation being used to instruct the first window to be displayed in full screen; when it is determined that the forced display direction of the first application is different from the holding direction, drawing a mask animation, the mask animation being used to adjust the window size of the first window to be the same as the display screen size; pausing the call to a display rotation class, the display rotation class being used to rotate the first window from the forced display direction to the holding direction; playing the mask animation; and when the mask animation finishes playing, resuming the call to the display rotation class so that the first window is displayed in full screen in the holding direction.
[0007] The solution provided in this application, during the application window switching process, when it is determined that the forced display direction of the application is different from the holding direction of the electronic device, draws a mask animation and controls the mask animation and rotation animation to play in sequence. After updating the window shape of the application window, the display direction of the window is rotated. This can suppress the problem of abnormal animation effects caused by the coupling of window shape change and display direction change, and improve the user experience during the application window switching process.
[0008] In some optional embodiments, before pausing the call to the display rotation class, the application window switching method further includes: calling the display rotation pause class method so that the display rotation pause class method updates the orientation control assignment of the display screen from 0 to 1. When the orientation control assignment is 0, the display orientation of the display screen can be changed according to the application's requested orientation. When the orientation control assignment is 1, the display orientation cannot be changed according to the requested orientation.
[0009] The solution provided in this embodiment modifies the display orientation control permission of the display screen to a disabled state by calling the display rotation pause class method before pausing the call to the display rotation pause class. This helps to improve the success rate of suppressing the coupling between changes in the window shape of the application window and changes in the display orientation.
[0010] In some optional embodiments, before restoring the display rotation class call, the application window switching method further includes: calling the display rotation restoration class method so that the display rotation restoration class method updates the orientation control assignment of the display screen from 1 to 0. When the orientation control assignment is 0, the display orientation of the display screen can be changed according to the application's requested orientation. When the orientation control assignment is 1, the display orientation cannot be changed according to the requested orientation.
[0011] The solution provided in this embodiment modifies the display orientation control permission of the display screen to the enabled state by calling the display rotation recovery class method before restoring the display rotation class, which helps to improve the success rate of controlling the display orientation of application windows.
[0012] In some optional embodiments, when it is determined that the forced display direction of the first application is different from the holding direction, drawing a mask animation includes: when it is determined that the forced display direction is different from the holding direction, obtaining window elements in the first window; laying out the window elements to obtain a layout image; adding a full-screen blur layer and animation attributes to the layout image to obtain a mask animation.
[0013] The solution provided in this embodiment draws a mask animation based on the window elements in the window. During the process of switching window forms by playing the mask animation, the animation effect of the mask animation matches the application, which helps to improve the user experience during the application window switching process.
[0014] In some optional embodiments, when it is determined that the forced display direction is different from the holding direction, obtaining window elements in the first window includes: when it is determined that the forced display direction is different from the holding direction, capturing the window image of the first window; and performing image recognition on the window image to obtain the window elements.
[0015] The solution provided in this embodiment obtains window elements based on image recognition of the window image, thereby improving the accuracy of window element acquisition.
[0016] In some optional embodiments, the window elements are laid out to obtain a layout image, including: obtaining the display screen size; and laying out the window elements according to the display screen size to obtain a layout image.
[0017] The solution provided in this embodiment lays out window elements according to the screen size of the display screen. The window elements in the layout image are adapted to the display screen, which helps to improve the user's viewing experience.
[0018] In some optional embodiments, the electronic device is equipped with an acceleration sensor. When a window switching operation is received, the holding direction of the electronic device is determined, including: when the window switching operation is received, the acceleration of the electronic device is collected based on the acceleration sensor; and the holding direction is determined based on the acceleration.
[0019] The solution provided in this embodiment detects the grip direction of electronic devices based on an accelerometer, thereby improving the accuracy of grip direction detection.
[0020] In some optional embodiments, the holding direction is the portrait holding direction, and the forced display direction is the forced landscape display direction.
[0021] The solution provided in this embodiment addresses the issue of abnormal animation during application window switching when the application's forced display direction is landscape and the electronic device is held in portrait mode. By drawing a mask animation and controlling the mask animation and rotation animation to play sequentially, the window's display direction is rotated after the application window's shape is updated. This suppresses the problem of abnormal animation effects caused by the coupling of window shape changes and display direction changes, thus improving the user experience during application window switching.
[0022] In some optional embodiments, the first window includes a full-screen button, and the window switching operation is a first click operation on the full-screen button of the first window. When the window switching operation is received, the holding direction of the electronic device is determined, including: when the first click operation is received, determining that the holding direction of the electronic device is a portrait holding direction.
[0023] The solution provided in this embodiment detects the holding direction when the window of an application with a forced display orientation is triggered to switch from split-screen display to full-screen display. This can suppress the problem of erroneous triggering of application window switching when the system has not received the user's window switching request, and is conducive to improving the control accuracy of application window switching.
[0024] In some optional embodiments, the second window includes a floating window button, and the window switching operation is a second click operation on the floating window button of the second window. When the window switching operation is received, the holding direction of the electronic device is determined, including: when the second click operation is received, determining that the holding direction of the electronic device is a portrait holding direction.
[0025] The solution provided in this embodiment detects the holding direction when the second window is triggered to display as a floating window, and the first window is triggered to switch from split-screen display to full-screen display. This can suppress the problem of erroneous triggering of application window switching when the system does not receive the user's window switching request, and is conducive to improving the control accuracy of application window switching.
[0026] In some optional embodiments, the application window switching method further includes: determining a first blank display content area when the first window is displayed in full screen in the portrait grip direction; and suspending the second window in the first blank display content area.
[0027] The solution provided in this embodiment displays the second window floating in the first blank display area of the full-screen first window, allowing users to browse the display content of the first application and the second application simultaneously, further improving the user experience during application window switching.
[0028] In some optional embodiments, the holding direction is the landscape holding direction, and the forced display direction is the forced portrait display direction.
[0029] The solution provided in this embodiment addresses the issue of abnormal animation during application window switching when the application's forced display direction is portrait and the electronic device is held in landscape mode. By drawing a mask animation and controlling the mask animation and rotation animation to play sequentially, the window's display direction is rotated after the application window's shape is updated. This suppresses the problem of abnormal animation effects caused by the coupling of window shape changes and display direction changes, thus improving the user experience during application window switching.
[0030] In some optional embodiments, the first window includes a full-screen button, and the window switching operation is a third click operation on the full-screen button of the first window. When the window switching operation is received, the holding direction of the electronic device is determined, including: when the third click operation is received, determining that the holding direction of the electronic device is a landscape holding direction.
[0031] The solution provided in this embodiment detects the holding direction when the window of an application with a forced display orientation is triggered to switch from split-screen display to full-screen display. This can suppress the problem of erroneous triggering of application window switching when the system has not received the user's window switching request, and is conducive to improving the control accuracy of application window switching.
[0032] In some optional embodiments, the second window includes a floating window button, and the window switching operation is a fourth click operation on the floating window button of the second window. When the window switching operation is received, the holding direction of the electronic device is determined, including: when the fourth click operation is received, determining that the holding direction of the electronic device is a landscape holding direction.
[0033] The solution provided in this embodiment detects the holding direction when the second window is triggered to display as a floating window, and the first window is triggered to switch from split-screen display to full-screen display. This can suppress the problem of erroneous triggering of application window switching when the system does not receive the user's window switching request, and is conducive to improving the control accuracy of application window switching.
[0034] In some optional embodiments, the application window switching method further includes: determining a second blank display content area when the first window is displayed in full screen in the landscape grip direction; and suspending the second window in the second blank display content area.
[0035] The solution provided in this embodiment displays the second window floating in the second blank display area of the first window in full-screen display, allowing users to browse the display content of the first application and the second application at the same time, further improving the user experience during application window switching.
[0036] Secondly, embodiments of this application provide an electronic device, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and one or more processors call the computer instructions to cause the electronic device to execute the application window switching method provided in the first aspect above.
[0037] Thirdly, embodiments of this application provide a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to execute the application window switching method provided in the first aspect above.
[0038] In some alternative embodiments, the chip system further includes a memory connected to one or more processors via circuits or wires.
[0039] In some alternative embodiments, the chip system also includes a communication interface.
[0040] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the application window switching method provided in the first aspect above.
[0041] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the application window switching method provided in the first aspect above.
[0042] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A schematic diagram of the software system of an electronic device provided in an embodiment of this application is shown.
[0045] Figure 2 This paper illustrates another structural diagram of the software system of the electronic device provided in an embodiment of this application.
[0046] Figure 3 This paper illustrates a flowchart of an application window switching method provided in an embodiment of this application.
[0047] Figure 4 This illustration shows a scenario of split-screen display in the application window switching method provided in this application embodiment.
[0048] Figure 5This illustration shows a scenario after window size adjustment in the application window switching method provided in this application embodiment.
[0049] Figure 6 This illustration shows a scenario after window switching in the application window switching method provided in this application embodiment.
[0050] Figure 7 This illustration shows a timing diagram of an application window switching method provided in an embodiment of this application.
[0051] Figure 8 This illustration shows another flowchart of the application window switching method provided in an embodiment of this application.
[0052] Figure 9 This illustration shows another flowchart of the application window switching method provided in the embodiments of this application.
[0053] Figure 10 A structural block diagram of an application window switching device provided in an embodiment of this application is shown.
[0054] Figure 11 A schematic diagram of a hardware structure of an electronic device provided in an embodiment of this application is shown.
[0055] Figure 12 A functional block diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0056] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0057] The following disclosure provides many different implementations or examples for carrying out different structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or reference letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various implementations and / or arrangements discussed.
[0058] With the diversification of usage scenarios for electronic devices, electronic devices typically run multiple applications simultaneously. Each application opens a separate window on the screen of the electronic device, and each window displays the application interface of an application in a split-screen manner.
[0059] Currently, when an electronic device displays multiple windows, the window can be switched from split-screen display to full-screen display via the top menu bar of each window.
[0060] However, when the application's display orientation is a forced orientation (the forced display orientation does not change with the way the electronic device is held), and the forced display orientation is different from the way the electronic device is held, switching the application's window from split-screen to full-screen display via the top bar requires changing both the window's shape and display orientation simultaneously. This causes abnormal animation effects during window switching, such as stuttering, which reduces the user experience during application window switching.
[0061] To address the aforementioned issues, this application provides an application window switching method, an electronic device, and a storage medium. The application window switching method is applied to an electronic device, which displays a first window of a first application and a second window of a second application on the electronic device's screen in a split-screen manner. When a window switching operation is received, the holding direction of the electronic device is determined. The window switching operation instructs the first window to be displayed in full screen. When it is determined that the forced display direction of the first application differs from the holding direction, a mask animation is drawn. The mask animation is used to adjust the window size of the first window to be the same as the screen size, and the call to the display rotation class is paused. The display rotation class is used to adjust the first window... This system rotates the window from the forced display orientation to the grip orientation, plays a mask animation, and then, upon completion of the mask animation, restores the display rotation class to ensure the first window is displayed in full-screen mode in the grip orientation. This addresses the issue of abnormal animations during application window switching when the forced display orientation of the application differs from the grip orientation of the electronic device. By drawing a mask animation and controlling its sequential playback with the rotation animation, the window's display orientation is rotated after the application window's shape is updated. This suppresses the coupling between window shape changes and display orientation changes that can cause abnormal animations during window switching, thus improving the user experience during application window switching.
[0062] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0063] The application window switching method provided in this application embodiment can be applied to electronic devices. Electronic devices may include various terminal devices, which may also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc.
[0064] Terminal devices can include mobile phones, robot vacuum cleaners, drones, smart TVs, wearable devices, personal digital assistants (PDAs), computers with wireless transceiver capabilities, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, and wireless terminals in smart homes. The type of terminal device is not limited here; it can be configured according to actual needs.
[0065] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of an electronic device.
[0066] Please see Figure 1 This illustration shows a schematic diagram of the software system of an electronic device according to an embodiment of this application. The software system includes several layers, each with a clear role and division of labor, and the layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system library, and the kernel layer.
[0067] The application layer can include a series of applications, such as the system user interface (UI), camera, gallery, call, wireless local area network (WLAN), music, video, media provider, FUSE (Filesystem in Userspace) file system, etc.
[0068] The MediaProvider is used to create or access multimedia files within the FUSE file system. Applications in the application layer can create or access multimedia files within the FUSE file system through the MediaProvider.
[0069] The FUSE file system is used to store multimedia files created by media providers. Of course, in other embodiments, the FUSE file system can also be used to store other data.
[0070] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer may include window manager classes, content providers, resource managers, view systems, package manager services (PMS), and activity manager services (AMS), etc.
[0071] The window management class can be used to call window management class methods to manage the application's application windows. Window management class methods are some predefined functions.
[0072] For example, window management classes can obtain the screen size, determine whether there is a status bar, lock the screen, and capture the screen.
[0073] Window management classes can include multi-window animation classes (HnMultiWindowAnimation.java), basic animation scene classes (HnBasicAnimScene.java), activity task management service classes (HwActivityTaskManagerServicesEx.java), display rotation classes (DisplayRotation.java), split-screen to freeform animation classes (HnSplitToFreeformAnimation.java), multi-window transition handler classes (MultiWindowTransitionHandler.java), window organization controller classes (WindowOrganizerController.java), window management service classes (WindowManagerService.java), and display content classes (DisplayContent.java), etc.
[0074] Window management methods can include methods such as `startSplitToFreeformAnimation` (to trigger the split-screen to freeform animation), `startSwitchWindow` (to switch windows), `rotationControlForMultiWinSwitch` (to control rotation during multi-window switching), `com.android.server.wm.DisplayRotation#pause` (to pause rotation), `processWindowSwitch` (to handle window switching), `switchWindowModeWithoutAnimation` (to switch between non-animated window modes), `startNewTransition` (to transition), `relayoutWindow` (to rearrange window), `updateRotation` (to update rotation), `updateRotationUnchecked` (to check for rotation update overflow), `startChangingAnimator` (to start mask animation), and `com.android.server.wm.DisplayRotation#resume` (to resume rotation).
[0075] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0076] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0077] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0078] The package management service, acting as a package manager service, is primarily responsible for installing, managing, and uninstalling applications on Android devices. It scans specified directories in the system to find files ending in APK, parses these files to obtain all application information, and stores it in packages.xml.
[0079] When a new application is installed, the package management service identifies all components of the application (such as Activities, Services, and Broadcast Receivers) and assigns appropriate permissions to these components. Simultaneously, the package management service monitors the status of installed applications to ensure their integrity and security.
[0080] The package management service also manages application DE (Device Encrypted) and CE (Credential Encrypted) data. The key for DE data is only available after a verifiable boot process has been performed on the system. CE data is encrypted using a key associated with user authentication (e.g., pattern, password), which is only available after the user has authenticated.
[0081] The application's CE directory may include the application's original UID. The package management service is used to execute the file management method in this embodiment.
[0082] The Activity Management Service, acting as the Activity Manager service, is primarily responsible for managing and tracking the activity tasks and lifecycle of all applications. When an application is opened, the Activity Management Service starts the application's process and allocates processor resources and memory to it. When the application is no longer in the foreground or background, or when system memory is insufficient, the Activity Management Service terminates or kills the application's process.
[0083] System libraries may include Surface Manager, Media Libraries, Android Rruntime, etc.
[0084] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java needs to call, and the other part consists of the Android core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0085] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0086] 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.264, MP3, AAC, AMR, JPG, and PNG.
[0087] The kernel layer can include modules such as audio driver, display driver, WiFi driver, Bluetooth driver, and sensor driver.
[0088] also, Figure 1 The document also illustrates a data layer associated with the software system, which stores user-preset data. For example, the data layer may pre-store data related to the privacy mode of an electronic device.
[0089] Understandable, Figure 1 The layers in the illustrated software structure and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0090] In one application scenario, such as Figure 2 As shown, the application layer may include the system user interface (System UI), and the window manager class may include the multi-window animation class (HnMultiWindowAnimation.java), the basic animation scene class (HnBasicAnimScene.java), the activity task management service class (HwActivityTaskManagerServicesEx.java), the display rotation class (DisplayRotation.java), the window management service class (WindowManagerService.java), and the display content class (DisplayContent.java), etc.
[0091] The display rotation class (DisplayRotation.java), the window management service class (WindowManagerService.java), and the display content class (DisplayContent.java) can form the Android Open Source Project (AOSP).
[0092] The system user interface (UI) can be used to call the multi-window animation class (HnMultiWindowAnimation.java) and the basic animation scene class (HnBasicAnimScene.java), and through the multi-window animation class (HnMultiWindowAnimation.java) and the basic animation scene class (HnBasicAnimScene.java), it can call the activity task management service class (HwActivityTaskManagerServicesEx.java).
[0093] The activity task management service class (HwActivityTaskManagerServicesEx.java) can be used to call the display rotation class (DisplayRotation.java), window management service class (WindowManagerService.java), and display content class (DisplayContent.java) in AOSP.
[0094] Please see Figure 3 This document illustrates a flowchart of an application window switching method provided in one embodiment of this application. In a specific embodiment, the window switching method can be applied to electronic devices. The following example uses an electronic device to illustrate this method. Figure 3 The process shown is described in detail. The window switching method may include the following steps 101 to 106.
[0095] Step 101: Display the first window of the first application and the second window of the second application on the screen of the electronic device in a split-screen format.
[0096] In this embodiment of the application, when a user needs to split the first application and the second application into a single screen, the user can tap the first application, the split-screen button, and the second application on the display screen of the electronic device. The electronic device receives and responds to the user's tap operation and displays the first window of the first application and the second window of the second application in a split-screen format on the display screen.
[0097] The first application is a forced display orientation application, and the forced display orientation of the first application does not change with the direction in which the screen is held.
[0098] Forced display orientation can include forced landscape display orientation and forced portrait display orientation, etc., and grip orientation can include portrait grip orientation and landscape grip orientation, etc.
[0099] The second application is a non-forced display orientation application, and the display orientation of the second application changes with the way the screen is held.
[0100] Step 102: When a window switching operation is received, determine the holding direction of the electronic device.
[0101] In this embodiment of the application, when the user needs to display the first window in full screen, the user can perform a window switching operation on the display screen interface. The electronic device receives and responds to the window switching operation and determines the holding direction of the electronic device.
[0102] The window switching operation can be used to instruct the electronic device to display the first window in full screen. The window switching operation can be clicking the full-screen button of the first window, or clicking the floating window button of the second window, etc., and there is no limitation here.
[0103] When the first window is displayed in full screen by clicking the full-screen button, the second application is pushed to the background; when the second window is displayed in a floating window by clicking the floating window button, the first window is displayed in full screen.
[0104] In one application scenario, when an electronic device is held horizontally, the first application is a forced portrait-oriented application. The first window of the first application and the second window of the second application are displayed on the screen in a split-screen manner. The first window may include a full-screen button and a floating window button, such as... Figure 4 As shown, the window switching operation can be the click operation of clicking the full-screen button of the first window.
[0105] Specifically, the electronic device can be equipped with an acceleration sensor. When the user needs to display the first window in full screen, the user can switch windows on the display screen. The electronic device receives and responds to the window switching operation, collects the acceleration of the electronic device based on the acceleration sensor, and determines the holding direction of the electronic device based on the acceleration. The detection of the holding direction of the electronic device based on the acceleration sensor improves the detection accuracy of the holding direction.
[0106] The accelerometer can be any one of the following: capacitive accelerometer, inductive accelerometer, strain gauge accelerometer, piezoresistive accelerometer, or piezoelectric accelerometer; no specific limitation is made here.
[0107] In some implementations, the electronic device is held in a portrait orientation, the forced display orientation is a forced landscape orientation, the first window may include a full-screen button, and the window switching operation may be a first click operation on the full-screen button of the first window.
[0108] When a user needs to display the first window in full screen, they can click the full-screen button on the first window. The electronic device receives and responds to the first click. Based on the acceleration sensor, the system collects the acceleration of the electronic device and determines the holding direction of the electronic device as the portrait holding direction. When the window of an application that forces the display direction is triggered to switch from split-screen display to full-screen display, the holding direction is detected. This can suppress the problem of erroneous triggering of application window switching when the system has not received the user's window switching request, which helps to improve the accuracy of application window switching control.
[0109] In some implementations, the electronic device is held in a portrait orientation, the forced display orientation is a forced landscape orientation, and the second window may include a floating window button. The window switching operation may be a second click operation on the floating window button of the second window.
[0110] When a user needs to display the first window in full screen, they can click the floating button of the second window. The electronic device receives and responds to the second click, collects the acceleration of the electronic device based on the accelerometer, and determines the holding direction of the electronic device as the portrait holding direction based on the acceleration. The floating window of the second window is triggered to display. When the first window is triggered to switch from split-screen display to full-screen display, the holding direction is detected. This can suppress the problem of erroneous triggering of application window switching when the system does not receive the user's window switching request, which helps to improve the accuracy of application window switching control.
[0111] In some implementations, the electronic device is held in a landscape orientation, the forced display orientation is a forced portrait orientation, the first window may include a full-screen button, and the window switching operation may be a third click operation on the full-screen button of the first window.
[0112] When a user needs to display the first window in full-screen mode, they can click the full-screen button on the first window a third time. The electronic device receives and responds to the third click. Based on the acceleration sensor, the system collects the acceleration of the electronic device and determines the holding direction of the electronic device as the landscape holding direction. When the window of an application that forces the display direction is triggered to switch from split-screen display to full-screen display, the holding direction is detected. This can suppress the problem of erroneous triggering of application window switching when the system has not received the user's window switching request, and help improve the accuracy of application window switching control.
[0113] In some implementations, the electronic device is held in a landscape orientation, the forced display orientation is a forced portrait orientation, the second window may include a floating window button, and the window switching operation may be a fourth click operation on the floating window button of the second window.
[0114] When a user needs to display the first window in full screen, they can click the floating button of the second window a fourth time. The electronic device receives and responds to the fourth click, collects the acceleration of the electronic device based on the accelerometer, and determines the holding direction of the electronic device as the landscape holding direction based on the acceleration. The floating window of the second window is triggered to display. When the first window is triggered to switch from split-screen display to full-screen display, the holding direction is detected. This can suppress the problem of erroneous triggering of application window switching when the system does not receive the user's window switching request, which helps to improve the accuracy of application window switching control.
[0115] Step 103: When it is determined that the forced display orientation of the first application is different from the grip orientation, draw the mask animation.
[0116] In this embodiment of the application, when the electronic device determines that the forced display direction of the first application is different from the holding direction of the electronic device, a mask animation can be drawn.
[0117] Mask animation can be used to adjust the size of the first window to match the screen size of the display.
[0118] Specifically, when the electronic device determines that the forced display direction of the first application is different from the holding direction of the electronic device, it can obtain the window elements in the first window, lay out the window elements to obtain a layout image, and add a full-screen blur layer and animation attributes to the layout image to obtain a mask animation. The mask animation is drawn based on the window elements in the window. During the process of switching window forms by playing the mask animation, the animation effect of the mask animation matches the application, which helps to improve the user experience during the application window switching process.
[0119] Among them, the animation properties can be used to control the transparency, position movement, and deformation effects during the playback of the mask animation, and there are no restrictions here.
[0120] Electronic devices can capture the window image of the first window and perform image recognition on the window image to obtain window elements. Obtaining window elements based on image recognition of the window image improves the accuracy of window element acquisition.
[0121] Window elements can be display objects in the first window. Display objects can include text display objects and / or image display objects, etc., without limitation here.
[0122] Electronic devices can obtain the screen size and lay out window elements according to the screen size to obtain a layout image. The window elements in the layout image are adapted to the screen, which helps to improve the user's viewing experience.
[0123] Regarding the process by which the above-mentioned electronic device obtains the display screen size, in some embodiments, the electronic device can capture an image of the display screen and analyze the image to obtain the display screen size.
[0124] Regarding the process by which the electronic device obtains the display screen size, in some embodiments, the electronic device pre-stores the display screen size, and the electronic device can read the pre-stored display screen size.
[0125] Regarding the process by which the electronic device obtains the display screen size, in some embodiments, the electronic device can generate a prompt message and receive the display screen size uploaded by the user based on the prompt message.
[0126] The prompt message can be used to prompt the user to upload the display screen size to the electronic device. The prompt message can be at least one of the following: text prompt message, sound prompt message, or light prompt message, etc., without limitation.
[0127] Step 104: Pause the call to the display rotation class.
[0128] In this embodiment of the application, the electronic device may pause the call to the display rotation class, which can be used to rotate the first window from the forced display direction to the holding direction.
[0129] In some implementations, the electronic device can call a display rotation pause class method, which updates the orientation control assignment of the display screen from 0 to 1. The electronic device pauses the call to the display rotation class. Before pausing the call to the display rotation class, the display orientation control permission of the display screen is modified to a disabled state by calling the display rotation pause class method. This helps to improve the success rate of suppressing the coupling between changes in the window shape of the application window and changes in the display orientation.
[0130] When the direction control value is 0, the display direction can be changed according to the application's requested direction; when the direction control value is 1, the display direction cannot be changed according to the requested direction.
[0131] As an example, the display rotation pause class method can be com.android.server.wm.DisplayRotation#pause, and the direction control assignment can be com.android.server.wm.DisplayRotation#mDeferredRotationPauseCount.
[0132] The default value for the direction control assignment is 0;
[0133] The default value of com.android.server.wm.DisplayRotation#mDeferredRotationPauseCount is 0.
[0134] In response to a call from an electronic device, com.android.server.wm.DisplayRotation#pause changes the value of com.android.server.wm.DisplayRotation#mDeferredRotationPauseCount from 0 to 1, thus disabling the display orientation control permission.
[0135] Step 105: Play the mask animation.
[0136] In this embodiment of the application, the electronic device can play a mask animation to adjust the window size of the first window to be the same as the display screen size.
[0137] Specifically, the electronic device can call the mask animation launch class method, which controls the playback of the mask animation so that the window size of the first window is adjusted to be the same as the screen size after the mask animation finishes playing.
[0138] In one application scenario, when an electronic device is held horizontally, the first application is forced to be displayed in portrait orientation. The first window of the first application and the second window of the second application are displayed in a split-screen format on the screen. The electronic device calls a masked animation launch method, which adjusts the window size of the first window to match the screen size. Figure 5 As shown.
[0139] Step 106: When the mask animation finishes playing, restore the display rotation class so that the first window is displayed in full-screen mode in the grip direction.
[0140] In this embodiment, when the mask animation finishes playing, the electronic device can call a display rotation class. The display rotation class rotates the first window from the forced display direction to the grip direction, so that the first window is displayed in full-screen mode in the grip direction. This achieves the following: when it is determined that the forced display direction of the application is different from the grip direction of the electronic device during application window switching, by drawing a mask animation and controlling the mask animation and rotation animation to play in sequence, the display direction of the window is rotated after updating the window shape of the application window. This can suppress the problem of abnormal animation effects caused by the coupling of window shape change and display direction change, and improve the user experience during application window switching.
[0141] In some implementations, when the mask animation finishes playing, the electronic device can call the display rotation restore class method. The display rotation restore class method updates the orientation control assignment of the display screen from 1 to 0, and the electronic device resumes calling the display rotation class. Before resuming the call to the display rotation class, the display orientation control permission of the display screen is modified to the enabled state by calling the display rotation restore class method, which helps to improve the success rate of controlling the display orientation of application windows.
[0142] As an example, the display rotation recovery class method can be com.android.server.wm.DisplayRotation#resume, and the direction control assignment can be com.android.server.wm.DisplayRotation#mDeferredRotationPauseCount.
[0143] In response to a call from an electronic device, com.android.server.wm.DisplayRotation#resume changes the value of com.android.server.wm.DisplayRotation#mDeferredRotationPauseCount from 1 to 0, thus enabling the display orientation control permission.
[0144] In one application scenario, when an electronic device is held horizontally, the first application is forced to be displayed in portrait orientation. The first window of the first application and the second window of the second application are displayed in a split-screen manner on the screen. When the mask animation completes, the electronic device calls the display rotation restoration method to update the display orientation control value from 1 to 0, and then restores the display rotation class. The first window is then displayed in full-screen mode in the horizontal holding orientation. Figure 6 As shown.
[0145] In one application scenario, Figure 2 Based on the software system architecture of the electronic device shown, such as Figure 7 As shown, the application window switching method may include steps 201 to 219.
[0146] Step 201: The System UI displays the first and second windows on the screen in a split-screen manner.
[0147] Step 202: The System UI receives the window switching operation and calls startSplitToFreeformAnimation.
[0148] Specifically, System UI sends a window switching request to HnMultiWindowAnimation.java by calling startSplitToFreeformAnimation.
[0149] Step 203: HnMultiWindowAnimation.java calls startSwitchWindow.
[0150] HnMultiWindowAnimation.java forwards the window switching request to HnBasicAnimScene.java by calling startSwitchWindow.
[0151] Step 204: HnBasicAnimScene.java draws the mask animation.
[0152] Specifically, HnBasicAnimScene.java calls rotationControlForMultiWinSwitch to capture the window image of the first window, lays out the window elements in the first window image to obtain a layout image, adds a full-screen blur layer and animation attributes to the layout image to obtain a mask animation, and sends a pause request to HwActivityTaskManagerServicesEx.java.
[0153] Step 205: HwActivityTaskManagerServicesEx.java calls com.android.server.wm.DisplayRotation#pause.
[0154] Specifically, HwActivityTaskManagerServicesEx.java calls com.android.server.wm.DisplayRotation#pause to change mDeferredRotationPauseCount from 0 to 1, thereby causing HwActivityTaskManagerServicesEx.java to pause calls to DisplayRotation.java.
[0155] Step 206: HwActivityTaskManagerServicesEx.java calls processWindowSwitch.
[0156] Specifically, HwActivityTaskManagerServicesEx.java sends a window switching request to HnSplitToFreeformAnimation.java by calling processWindowSwitch.
[0157] Step 207: HnSplitToFreeformAnimation.java calls switchWindowModeWithoutAnimation.
[0158] Specifically, HnSplitToFreeformAnimation.java calls switchWindowModeWithoutAnimation to forward the window switching request to MultiWindowTransitionHandler.java.
[0159] Step 208: MultiWindowTransitionHandler.java calls startNewTransition.
[0160] Specifically, MultiWindowTransitionHandler.java sends the mask animation playback command to WindowOrganizerController.java by calling startNewTransition.
[0161] Step 209: WindowOrganizerController.java calls relayWindow.
[0162] Specifically, WindowOrganizerController.java sends a first display direction update request to WindowManagerService.java by calling relayWindow.
[0163] Step 210: WindowManagerService.java calls updateRotation.
[0164] Specifically, WindowManagerService.java forwards the first display direction update request to DisplayContent.java by calling updateRotation.
[0165] Step 211: DisplayContent.java calls updateRotationUnchecked.
[0166] DisplayContent.java determines that the display orientation of the first window will not be updated by calling updateRotationUnchecked.
[0167] Specifically, DisplayContent.java sets mDeferredRotationPauseCount to 1, indicating that the display orientation of the first window will not be updated.
[0168] Step 212: The System UI calls startChangingAnimator.
[0169] Specifically, System UI sends the mask animation playback command to HnBasicAnimScene.java by calling startChangingAnimator.
[0170] Step 213: HnBasicAnimScene.java plays the mask animation.
[0171] Step 214: When the mask animation finishes playing, HnBasicAnimScene.java calls rotationControlForMultiWinSwitch.
[0172] Specifically, HnBasicAnimScene.java sends a second display direction update request to HwActivityTaskManagerServicesEx.java by calling rotationControlForMultiWinSwitch.
[0173] Step 215: HwActivityTaskManagerServicesEx.java calls com.android.server.wm.DisplayRotation#resume.
[0174] Specifically, HwActivityTaskManagerServicesEx.java calls com.android.server.wm.DisplayRotation#resume to change mDeferredRotationPauseCount from 1 to 0 and sends a display orientation update command to DisplayRotation.java.
[0175] Step 216: DisplayRotation.java calls relayWindow.
[0176] DisplayRotation.java sends a second display direction update request to WindowManagerService.java by calling relayWindow.
[0177] Step 217: WindowManagerService.java calls updateRotationUnchecked.
[0178] Specifically, WindowManagerService.java forwards the second display direction update request to DisplayContent.java by calling updateRotation.
[0179] Step 218: DisplayContent.java calls updateRotationUnchecked.
[0180] Specifically, DisplayContent.java determines that mDeferredRotationPauseCount is 0 by calling updateRotationUnchecked, and then sends a display orientation update command to DisplayRotation.
[0181] Step 219: DisplayRotation rotates the first window from the forced display orientation to full-screen orientation for full-screen display.
[0182] The solution provided in this application displays a first window of a first application and a second window of a second application on the screen of an electronic device in a split-screen manner. When a window switching operation is received, the holding direction of the electronic device is determined. The window switching operation is used to instruct the full-screen display of the first window. When it is determined that the forced display direction of the first application is different from the holding direction, a mask animation is drawn. The mask animation is used to adjust the window size of the first window to be the same as the screen size, and the call to the display rotation class is paused. The display rotation class is used to rotate the first window from the forced display direction to the holding direction and play the mask animation. When the mask animation finishes playing, the call to the display rotation class is resumed so that the first window is displayed in full-screen mode in the holding direction. This achieves the problem of abnormal animation effects caused by the coupling of window shape change and display direction change during application window switching. By drawing a mask animation and controlling the sequential playback of the mask animation and rotation animation, the display direction of the window is rotated after the window shape of the application window is updated. This can suppress the problem of abnormal animation effects during window switching caused by the coupling of window shape change and display direction change, and improve the user experience during application window switching.
[0183] Please see Figure 8 This document illustrates a flowchart of an application window switching method provided in another embodiment of this application. In a specific embodiment, the window switching method can be applied to electronic devices. The following example uses an electronic device to illustrate this method. Figure 8 The process shown is described in detail. The window switching method may include the following steps 301 to 308.
[0184] Step 301: Display the first window of the first application and the second window of the second application on the screen of the electronic device in a split-screen format.
[0185] Step 302: When the second click operation is received, determine the vertical screen holding direction.
[0186] Step 303: When it is determined that the forced landscape display direction of the first application is different from the portrait grip direction, draw a mask animation.
[0187] Step 304: Pause the call to the display rotation class.
[0188] Step 305: Play the mask animation.
[0189] Step 306: When the mask animation finishes playing, restore the call to the display rotation class so that the first window is displayed in full-screen mode in portrait grip direction.
[0190] In this embodiment, steps 301, 302, 303, 304, 305 and 306 can be referred to the contents of the corresponding steps in the foregoing embodiments, and will not be repeated here.
[0191] Step 307: Determine the first blank display content area when the first window is displayed in full screen in portrait orientation.
[0192] In this embodiment, the electronic device can determine the first blank display content area when the first window is displayed in full screen in the portrait grip direction, so as to display the second floating window in the first blank display content area.
[0193] The first blank display area can be an area in the first window that has no content or displays very little content.
[0194] In some implementations, the electronic device can capture a first screen image when the first window is displayed in full screen in the vertical grip direction, perform boundary detection on the graphic elements in the first screen image to obtain a first graphic boundary, determine a first blank area in the first screen image based on the first image boundary, and map the first blank area to the first window displayed in full screen in the vertical grip direction based on the pixel position of the first blank area to obtain a first blank display content area.
[0195] In some implementations, the electronic device can capture a first screen image when the first window is displayed in full screen in the portrait grip direction, analyze the first screen image to obtain the grayscale value of each pixel, determine a first blank area in the first screen image based on the grayscale value of each pixel, and map the first blank area to the first window displayed in full screen in the portrait grip direction based on the pixel position of the first blank area to obtain a first blank display content area.
[0196] Step 308: Float the second window over the first blank display content area.
[0197] In this embodiment, the electronic device can display the second window floating in the first blank display content area and the second window floating in the first blank display content area of the full-screen first window, so that the user can browse the display content of the first application and the second application at the same time, further improving the user experience during the application window switching process.
[0198] The solution provided in this embodiment displays a first window of a first application and a second window of a second application on the display screen of an electronic device in a split-screen manner. When a second click operation is received, the vertical grip direction is determined. When it is determined that the forced horizontal display direction of the first application is different from the vertical grip direction, a mask animation is drawn, the call to the display rotation class is paused, and the mask animation is played. When the mask animation finishes playing, the call to the display rotation class is resumed, so that the first window is displayed in full-screen mode in the vertical grip direction. The solution also determines the first blank display content area when the first window is displayed in full-screen mode in the vertical grip direction, and floats the second window in the first blank display content area. This achieves the problem of abnormal animation effects during window switching when it is determined that the forced display direction of the application is different from the grip direction of the electronic device. By drawing a mask animation and controlling the sequential playback of the mask animation and the rotation animation, the window display direction is rotated after the window shape of the application window is updated. This can suppress the problem of abnormal animation effects during window switching caused by the coupling of window shape change and display direction change, and improve the user experience during application window switching.
[0199] The second window is displayed floating above the first blank display area of the full-screen first window, allowing users to browse the content of both the first and second applications simultaneously, further enhancing the user experience during application window switching.
[0200] Please see Figure 9 This document illustrates a flowchart of an application window switching method provided in another embodiment of this application. In a specific embodiment, the window switching method can be applied to electronic devices. The following example uses an electronic device to illustrate this method. Figure 9 The process shown is described in detail. The window switching method may include the following steps 401 to 408.
[0201] Step 401: Display the first window of the first application and the second window of the second application on the display screen of the electronic device in a split-screen manner.
[0202] Step 402: When the fourth click operation is received, determine the landscape grip direction.
[0203] Step 403: When it is determined that the forced portrait display direction of the first application is different from the landscape grip direction, draw a mask animation.
[0204] Step 404: Pause the call to the display rotation class.
[0205] Step 405: Play the mask animation.
[0206] Step 406: When the mask animation finishes playing, restore the call to the display rotation class so that the first window is displayed in full-screen mode in landscape grip direction.
[0207] In this embodiment, steps 401, 402, 403, 404, 405, and 406 can be found in the corresponding steps in the foregoing embodiments, and will not be repeated here.
[0208] Step 407: Determine the second blank display content area when the first window is displayed in full screen in landscape orientation.
[0209] In this embodiment, the electronic device can determine the second blank display content area when the first window is displayed in full screen in the landscape grip direction, so as to display the second floating window in the second blank display content area.
[0210] The second blank display area can be an area in the first window that has no content or displays very little content.
[0211] In some implementations, the electronic device can capture a second screen image when the first window is displayed in full-screen mode in the landscape grip direction, perform boundary detection on the graphic elements in the second screen image to obtain a second graphic boundary, determine a second blank area in the second screen image based on the second image boundary, and map the second blank area to the first window displayed in full-screen mode in the landscape grip direction based on the pixel position of the second blank area to obtain a second blank display content area.
[0212] In some implementations, the electronic device can capture a second screen image when the first window is displayed in full-screen mode in the landscape grip direction, analyze the second screen image to obtain a second grayscale value for each pixel, determine a second blank area in the second screen image based on the second grayscale value of each pixel, and map the first blank area to the first window displayed in full-screen mode in the landscape grip direction based on the pixel position of the second blank area to obtain a second blank display content area.
[0213] Step 408: Float the second window over the second blank display content area.
[0214] In this embodiment, the electronic device can display the second window floating in the second blank display content area, and also display the second window floating in the second blank display content area of the full-screen first window, allowing users to browse the display content of the first application and the second application simultaneously, further improving the user experience during application window switching.
[0215] The solution provided in this embodiment displays a first window of a first application and a second window of a second application on the display screen of an electronic device in a split-screen manner. When a second click operation is received, the portrait grip direction is determined. When it is determined that the forced landscape display direction of the first application is different from the portrait grip direction, a mask animation is drawn, the call to the display rotation class is paused, and the mask animation is played. When the mask animation finishes playing, the call to the display rotation class is resumed, so that the first window is displayed in full-screen mode in the portrait grip direction. The solution also determines the second blank display content area when the first window is displayed in full-screen mode in the landscape grip direction, and floats the second window in the second blank display content area. This solution achieves the problem of abnormal animation effects during window switching when it is determined that the forced display direction of the application is different from the grip direction of the electronic device. By drawing a mask animation and controlling the sequential playback of the mask animation and the rotation animation, the display direction of the window is rotated after the window shape of the application window is updated. This can suppress the problem of abnormal animation effects during window switching caused by the coupling of window shape change and display direction change, and improve the user experience during application window switching.
[0216] The second window is displayed floating in the second blank display area of the first window in full-screen mode, allowing users to browse the display content of the first and second applications simultaneously, further enhancing the user experience during application window switching.
[0217] Please see Figure 10 This document illustrates an application window switching device 500 provided in one embodiment of this application. The application window switching device 500 can be applied to electronic devices. The following section uses an electronic device as an example to illustrate... Figure 10 The application window switching device 500 shown will be described in detail. The application window switching device 500 may include a split-screen display module 501, a first determination module 502, a drawing module 503, a pause module 504, a playback module 505, and a resume module 506.
[0218] The split-screen display module 501 can be used to display the first window of the first application and the second window of the second application on the display screen of the electronic device in a split-screen manner; the first determination module 502 can be used to determine the holding direction of the electronic device when a window switching operation is received, and the window switching operation can be used to instruct the first window to be displayed in full screen; the drawing module 503 can be used to draw a mask animation when it is determined that the forced display direction of the first application is different from the holding direction, and the mask animation can be used to adjust the window size of the first window to be the same as the display screen size; the pause module 504 can be used to pause the call to the display rotation class, and the display rotation class can be used to rotate the first window from the forced display direction to the holding direction; the playback module 505 can be used to play the mask animation; the resume module 506 can be used to resume the call to the display rotation class when the mask animation is finished playing, so that the first window is displayed in full screen mode in the holding direction.
[0219] In some implementations, the application window switching device 500 may also include a first invocation module.
[0220] The first calling module can be used to call the display rotation pause class method before the pause module 504 pauses the call to the display rotation pause class, so that the display rotation pause class method updates the orientation control assignment of the display screen from 0 to 1. When the orientation control assignment is 0, the display orientation of the display screen can be changed according to the application's requested orientation. When the orientation control assignment is 1, the display orientation cannot be changed according to the requested orientation.
[0221] In some implementations, the application window switching device 500 may also include a second calling module.
[0222] The second calling module can be used to call the display rotation recovery class method before the recovery module 506 calls the display rotation recovery class, so that the display rotation recovery class method updates the orientation control assignment of the display screen from 1 to 0. When the orientation control assignment is 0, the display orientation of the display screen can be changed according to the application's requested orientation. When the orientation control assignment is 1, the display orientation cannot be changed according to the requested orientation.
[0223] In some implementations, the drawing module 503 may include an acquisition unit, a layout unit, and an addition unit.
[0224] The Get unit can be used to get window elements in the first window when the forced display direction is different from the holding direction; the Layout unit can be used to lay out window elements and obtain a layout image; the Add unit can be used to add a full-screen blur layer and animation properties to the layout image and obtain a mask animation.
[0225] In some implementations, the acquisition unit may include a truncation subunit and an identification subunit.
[0226] The capture subunit can be used to capture the window image of the first window when the forced display direction is different from the holding direction; the recognition subunit can be used to perform image recognition on the window image to obtain the window elements.
[0227] In some implementations, the layout unit may include an acquisition subunit and a layout subunit.
[0228] The get sub-unit can be used to obtain the screen size; the layout sub-unit can be used to lay out window elements according to the screen size to obtain a layout image.
[0229] In some implementations, the electronic device may be equipped with an acceleration sensor, and the first determining module 502 may include a data acquisition unit and a first determining unit.
[0230] The acquisition unit can be used to acquire the acceleration of the electronic device based on the acceleration sensor when a window switching operation is received; the first determination unit can be used to determine the gripping direction based on the acceleration.
[0231] In some implementations, the holding direction can be the portrait holding direction, and the forced display direction can be the forced landscape display direction.
[0232] In some implementations, the first window may include a full-screen button, and the window switching operation may be a first click operation on the full-screen button of the first window. The first determining module 502 may also include a second determining unit.
[0233] The second determining unit can be used to determine, when the first click operation is received, that the holding direction of the electronic device is the vertical screen holding direction.
[0234] In some implementations, the second window may include a floating window button, and the window switching operation may be a second click operation on the floating window button of the second window. The first determining module 502 may also include a third determining unit.
[0235] The third determining unit can be used to determine, when the second click operation is received, that the holding direction of the electronic device is the vertical screen holding direction.
[0236] In some implementations, the application window switching device 500 may further include a second determining module and a first display module.
[0237] The second determining module can be used to determine the first blank display content area when the first window is displayed in full screen in the portrait grip direction; the first display module can be used to float the second window in the first blank display content area.
[0238] In some implementations, the grip direction can be a landscape grip direction, and the forced display direction can be a forced portrait display direction.
[0239] In some implementations, the first window includes a full-screen button, and the window switching operation can be a third click operation on the full-screen button of the first window. The first determining module 502 may also include a fourth determining unit.
[0240] The fourth determining unit can be used to determine, when a third click operation is received, that the holding direction of the electronic device is a landscape holding direction.
[0241] In some implementations, the second window may include a floating window button, and the window switching operation may be a fourth click operation on the floating window button of the second window. The first determining module 502 may also include a fifth determining unit.
[0242] The fifth determining unit can be used to determine, when the fourth click operation is received, that the holding direction of the electronic device is the landscape holding direction.
[0243] In some implementations, the application window switching device 500 may further include a third determining module and a second display module.
[0244] The third determining module can be used to determine the second blank display content area when the first window is displayed in full screen in the landscape grip direction; the second display module can be used to float the second window in the second blank display content area.
[0245] The solution provided in this embodiment displays a first window of a first application and a second window of a second application on the display screen of an electronic device in a split-screen manner. When a window switching operation is received, the holding direction of the electronic device is determined. The window switching operation is used to instruct the first window to be displayed in full screen. When it is determined that the forced display direction of the first application is different from the holding direction, a mask animation is drawn. The mask animation is used to adjust the window size of the first window to be the same as the display screen size, and the call to the display rotation class is paused. The display rotation class is used to rotate the first window from the forced display direction to the holding direction and play the mask animation. When the mask animation finishes playing, the call to the display rotation class is resumed so that the first window is displayed in full screen in the holding direction. This achieves the problem of abnormal animation effects caused by the coupling of window shape change and display direction change during application window switching. By drawing a mask animation and controlling the sequential playback of the mask animation and rotation animation, the display direction of the window is rotated after the window shape of the application window is updated. This can suppress the problem of abnormal animation effects during window switching caused by the coupling of window shape change and display direction change, and improve the user experience during application window switching.
[0246] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to in the description of the method embodiments. Any processing method described in the method embodiments can be implemented in the device embodiments through corresponding processing modules, and will not be elaborated upon further in the device embodiments.
[0247] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0248] Please see Figure 11 This illustrates a schematic diagram of the hardware structure of an electronic device 600 provided in one embodiment of this application. Figure 11 As shown, the electronic device 600 may include a processor 610, an external memory interface 620, an internal memory 621, a Universal Serial Bus (USB) interface 630, a charging management module 640, a power management module 641, a battery 642, an antenna 1, an antenna 2, a mobile communication module 650, a wireless communication module 660, an audio module 670, a speaker 670A, a receiver 670B, a microphone 670C, a headphone jack 670D, a sensor module 680, buttons 690, a motor 691, an indicator 692, a camera 693, a display screen 694, and a Subscriber Identification Module (SIM) card interface 695, etc. The sensor module 680 may include a pressure sensor 680A, a gyroscope sensor 680B, a barometric pressure sensor 680C, a magnetic sensor 680D, an accelerometer sensor 680E, a distance sensor 680F, a proximity light sensor 680G, a fingerprint sensor 680H, a temperature sensor 680J, a touch sensor 680K, an ambient light sensor 680L, a bone conduction sensor 680M, etc.
[0249] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 600. In other embodiments of this application, the electronic device 600 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0250] For example, Figure 11 The processor 610 shown may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0251] The controller can be the nerve center and command center of the electronic device 600. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0252] The processor 610 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. This memory can store instructions or data that the processor 610 has just used or that are used repeatedly. If the processor 610 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 610, and thus improves the efficiency of the system.
[0253] In some embodiments, the processor 610 may include one or more interfaces. Interfaces may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI) interface, a General Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.
[0254] In some embodiments, the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). The processor 610 may include multiple I2C buses. The processor 610 can couple to the touch sensor 680K, charger, flash, camera 693, etc., through different I2C bus interfaces. For example, the processor 610 can couple to the touch sensor 680K through the I2C interface, enabling communication between the processor 610 and the touch sensor 680K via the I2C bus interface, thus realizing the touch function of the electronic device 600.
[0255] In some embodiments, the I2S interface can be used for audio communication. The processor 610 may include multiple I2S buses. The processor 610 can be coupled to the audio module 670 via the I2S buses to enable communication between the processor 610 and the audio module 670.
[0256] In some embodiments, the audio module 670 can transmit audio signals to the wireless communication module 660 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0257] In some embodiments, the PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. The audio module 670 and the wireless communication module 660 can be coupled via the PCM bus interface.
[0258] In some embodiments, the audio module 670 can also transmit audio signals to the wireless communication module 660 via the PCM interface to enable the function of answering phone calls through a Bluetooth headset. It should be understood that both the I2S interface and the PCM interface can be used for audio communication.
[0259] In some embodiments, the UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. The UART interface is typically used to connect the processor 610 and the wireless communication module 660. For example, the processor 610 communicates with the Bluetooth module in the wireless communication module 660 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 670 can transmit audio signals to the wireless communication module 660 via the UART interface to enable music playback via Bluetooth headphones.
[0260] In some embodiments, the MIPI interface can be used to connect the processor 610 to peripheral devices such as the display screen 694 and the camera 693. The MIPI interface includes a Camera Serial Interface (CSI) and a Display Serial Interface (DSI). The processor 610 and the camera 693 communicate via the CSI interface to enable the electronic device 600 to capture images. The processor 610 and the display screen 694 communicate via the DSI interface to enable the electronic device 600 to display images.
[0261] In some embodiments, the GPIO interface can be configured via software. The GPIO interface can be configured as a control signal or a data signal. The GPIO interface can be used to connect the processor 610 to a camera 693, a display screen 694, a wireless communication module 660, an audio module 670, a sensor module 680, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0262] For example, the USB interface 630 is an interface compliant with the USB standard specification, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 630 can be used to connect a charger to charge the electronic device 600, and can also be used for data transfer between the electronic device 600 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0263] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 600. In other embodiments of this application, the electronic device 600 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0264] The charging management module 640 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 640 receives charging input from the wired charger via a USB interface 630. In some wireless charging embodiments, the charging management module 640 receives wireless charging input via the wireless charging coil of the electronic device 600. While charging the battery 642, the charging management module 640 can also supply power to the electronic device via the power management module 641.
[0265] The power management module 641 can be used to connect the battery 642, the charging management module 640, and the processor 610. The power management module 641 receives input from the battery 642 and / or the charging management module 640, and supplies power to the processor 610, internal memory 621, external memory, display screen 694, camera 693, and wireless communication module 660, etc. The power management module 641 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 641 can also be located within the processor 610. In other embodiments, the power management module 641 and the charging management module 640 can also be located in the same device.
[0266] The wireless communication function of the electronic device 600 can be implemented through antenna 1, antenna 2, mobile communication module 650, wireless communication module 660, modem processor, and baseband processor.
[0267] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 600 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 a tuning switch.
[0268] The mobile communication module 650 can provide a wireless communication solution applied to the electronic device 600, such as at least one of the following: a second-generation (2G) mobile communication solution, a third-generation (3G) mobile communication solution, a fourth-generation (4G) mobile communication solution, and a fifth-generation (5G) mobile communication solution. The mobile communication module 650 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 650 can receive electromagnetic waves via antenna 1, and perform filtering and amplification on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 650 can also amplify the signal modulated by the modem processor, and the amplified signal is converted into electromagnetic waves and radiated by antenna 1. In some embodiments, at least some functional modules of the mobile communication module 650 may be housed in the processor 610. In some embodiments, at least some functional modules of the mobile communication module 650 and at least some modules of the processor 610 may be housed in the same device.
[0269] 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 670A, receiver 670B, etc.) or displays images or videos through a display screen 694. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 610 and may be housed in the same device as the mobile communication module 650 or other functional modules.
[0270] The wireless communication module 660 can provide solutions for wireless communication applications on the electronic device 600, including Wireless Local Area Networks (WLANs) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR) technologies. The wireless communication module 660 can be one or more devices integrating at least one communication processing module. The wireless communication module 660 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 610. The wireless communication module 660 can also receive signals to be transmitted from processor 610, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0271] In some embodiments, antenna 1 of electronic device 600 is coupled to mobile communication module 650, and antenna 2 of electronic device 600 is coupled to wireless communication module 660, enabling electronic device 600 to communicate with networks and other electronic devices via wireless communication technology. This wireless communication technology may include at least one of the following communication technologies: Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wide-band Code Division Multiple Access (WCDMA), Time-division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and IR technologies. The GNSS may include at least one of the following positioning technologies: Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and Satellite Based Augmentation Systems (SBAS).
[0272] Electronic device 600 implements display functions through a GPU, a display screen 694, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 694 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 610 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0273] Display screen 694 is used to display images, videos, etc. Display screen 694 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 Mini-LED, a Micro-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 600 may include one or N displays 694, where N is a positive integer greater than 1.
[0274] Electronic device 600 can achieve shooting function through ISP, camera 693, video codec, GPU, display 694 and application processor.
[0275] The ISP (Image Signal Processor) is used to process data fed back from the camera 693. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 693.
[0276] Camera 693 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, electronic device 600 may include one or N cameras 693, where N is a positive integer greater than 1.
[0277] A digital signal processor (DSP) is used to process digital signals. Besides digital image signals, it can also process other digital signals. For example, when electronic device 600 is selecting a frequency, the DSP is used to perform Fourier transforms on the frequency energy.
[0278] Video codecs are used to compress or decompress digital video. Electronic device 600 may support one or more video codecs. Thus, electronic device 600 can play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0279] NPU stands for Neural Network (NN) computing processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0280] The external storage interface 620 can be used to connect an external memory card, such as a Secure Digital (SD) card, to expand the storage capacity of the electronic device 600. The external memory card communicates with the processor 610 through the external storage interface 620 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0281] Internal memory 621 can be used to store executable program code, including instructions. Processor 610 executes various functional applications and data processing of electronic device 600 by running the instructions stored in internal memory 621. Internal memory 621 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 600 (such as audio data, phonebook, etc.). Furthermore, internal memory 621 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.
[0282] Electronic device 600 can implement audio functions through audio module 670, speaker 670A, receiver 670B, microphone 670C, headphone jack 670D, and application processor. Examples include music playback and recording.
[0283] The audio module 670 can be used to convert digital audio information into analog audio signal output, and can also be used to convert analog audio input into digital audio signal. The audio module 670 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 670 can be located in the processor 610, or some functional modules of the audio module 670 can be located in the processor 610.
[0284] The speaker 670A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic device 600 can listen to music or make hands-free calls through the speaker 670A.
[0285] The receiver 670B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 600 answers a telephone call or voice message, the receiver 670B can be brought close to the ear to listen to the voice.
[0286] Microphone 670C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 670C, inputting the sound signal into microphone 670C. Electronic device 600 may have at least one microphone 670C. In some embodiments, electronic device 600 may have two microphones 670C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 600 may have three, four, or more microphones 670C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0287] The headphone jack 670D is used to connect wired headphones. The headphone jack 670D can be a USB 630 interface, or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
[0288] Pressure sensor 680A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 680A can be disposed on display screen 694. There are many types of pressure sensors 680A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor can consist of at least two parallel plates with conductive material. When force is applied to pressure sensor 680A, the capacitance between the electrodes changes. Electronic device 600 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 694, electronic device 600 detects the touch operation intensity based on pressure sensor 680A. Electronic device 600 can also calculate the touch position based on the detection signal from pressure sensor 680A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS message is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS message is executed.
[0289] The gyroscope sensor 680B can be used to determine the motion attitude of the electronic device 600. In some embodiments, the gyroscope sensor 680B can determine the angular velocity of the electronic device 600 around three axes (i.e., the x, y, and z axes). The gyroscope sensor 680B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 680B detects the angle of the electronic device 600's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 600 through reverse movement, thus achieving image stabilization. The gyroscope sensor 680B can also be used in navigation and motion-sensing game scenarios.
[0290] The barometric pressure sensor 680C is used to measure air pressure. In some embodiments, the electronic device 600 uses the air pressure value measured by the barometric pressure sensor 680C to calculate altitude, assist in positioning, and navigate.
[0291] The magnetic sensor 680D includes a Hall sensor. The electronic device 600 can use the magnetic sensor 680D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 600 is a flip phone, the electronic device 600 can detect the opening and closing of the flip cover using the magnetic sensor 680D, and set features such as automatic flip unlocking based on the detected opening and closing state of the cover or the flip cover.
[0292] The accelerometer 680E can detect the magnitude of acceleration of electronic device 600 in various directions (typically three axes). When electronic device 600 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic device, and can be applied to applications such as screen orientation switching and pedometers.
[0293] The distance sensor 680F is used to measure distance. The electronic device 600 can measure distance via infrared or laser. In some embodiments, during a shooting scene, the electronic device 600 can utilize the distance sensor 680F to measure distance for rapid focusing.
[0294] The proximity sensor 680G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 600 emits infrared light outward through the LED. The electronic device 600 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the electronic device 600. When insufficient reflected light is detected, the electronic device 600 can determine that no object is near the electronic device 600. The electronic device 600 may use the proximity sensor 680G to detect when a user holds the electronic device 600 close to their ear for a phone call, so as to automatically turn off the screen to save power. The proximity sensor 680G can also be used for automatic unlocking and locking of the screen in folding mode and pocket mode.
[0295] The fingerprint sensor 680H is used to collect fingerprints. The electronic device 600 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, and answering calls with fingerprints.
[0296] Temperature sensor 680J is used to detect temperature. In some embodiments, electronic device 600 uses the temperature detected by temperature sensor 680J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 680J exceeds a threshold, electronic device 600 performs thermal protection by reducing the performance of a processor located near temperature sensor 680J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 600 heats battery 642 to prevent abnormal shutdown of electronic device 600 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 600 boosts the output voltage of battery 642 to prevent abnormal shutdown due to low temperature.
[0297] Touch sensor 680K, also known as a "touch panel," can be located on display screen 694. The touch sensor 680K and display screen 694 together form a touchscreen, also known as a "touch screen." Touch sensor 680K detects touch operations applied to or near it. Touch sensor 680K can transmit the detected touch operation to application processor 610 to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 694. In other embodiments, touch sensor 680K may also be located on the surface of electronic device 600, in a different position than display screen 694.
[0298] The ambient light sensor 680L is used to sense the brightness of ambient light. The electronic device 600 can adaptively adjust the brightness of its display screen 694 based on the sensed ambient light level. The ambient light sensor 680L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 680L can also work in conjunction with the proximity sensor 680G to detect whether the electronic device 600 is in a pocket, preventing accidental touches.
[0299] The bone conduction sensor 680M can acquire vibration signals. In some embodiments, the bone conduction sensor 680M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 680M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 680M can also be incorporated into headphones to form bone conduction headphones. The audio module 670 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 680M to realize voice functionality. The application processor 610 can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 680M to realize heart rate detection functionality.
[0300] Buttons 690 include a power button, volume buttons, etc. Buttons 690 can be mechanical buttons or touch-sensitive buttons. Electronic device 600 can receive button input and generate key signal inputs related to user settings and function control of electronic device 600.
[0301] Motor 691 can generate vibration alerts. Motor 691 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 691 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 694. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0302] Indicator 692 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0303] The SIM card interface 695 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 695 to make contact with and separate from the electronic device 600. The electronic device 600 can support one or N SIM card interfaces 695, where N is a positive integer greater than 1. The SIM card interface 695 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 695 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 695 is also compatible with different types of SIM cards. The SIM card interface 695 is also compatible with external memory cards. The electronic device 600 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 600 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 600 and cannot be separated from the electronic device 600.
[0304] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 600. In other embodiments of this application, the electronic device 600 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0305] This application does not specifically limit the structure of the execution entity of an ambient light detection method. As long as the code recording an ambient light detection method according to this application is executed, communication can be performed according to the ambient light detection method provided in this application. For example, the execution entity of an ambient light detection method provided in this application can be a functional module in an electronic device capable of calling and executing programs, or a communication device applied in an electronic device, such as a chip.
[0306] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to in the description of the method embodiments. Any processing method described in the method embodiments can be implemented in the device embodiments through corresponding processing modules, and will not be elaborated upon further in the device embodiments.
[0307] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0308] Please see Figure 12 This illustrates a functional block diagram of an electronic device 700 according to an embodiment of this application. Figure 12 As shown, the electronic device 700 includes: one or more processors 710 ( Figure 12 Only one processor is shown in the diagram) and a memory 720, which is coupled to one or more processors 710. The memory 720 is used to store computer program code 730, which includes computer instructions. One or more processors 710 call the computer instructions to cause the electronic device 700 to perform the steps in any of the above methods.
[0309] Those skilled in the art will understand that Figure 12 This is merely an example of electronic device 700 and does not constitute a limitation on electronic device 700. In practice, electronic device 700 may include more or fewer components than shown, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc. Electronic device 700 may also be the same device as the electronic device 700 described in the above embodiments.
[0310] The processor 710 can be a Central Processing Unit (CPU), other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0311] In some embodiments, memory 720 may be an internal storage unit of electronic device 700, such as a hard disk or memory of electronic device 700. In other embodiments, memory 720 may be an external storage device of electronic device 700, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on electronic device 700. Optionally, memory 720 may include both internal and external storage units of electronic device 700. Memory 720 is used to store operating system, application programs, bootloaders, data, and other programs, such as program code of computer programs. Memory 720 may also be used to temporarily store data that has been output or will be output.
[0312] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0313] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0314] This application also provides a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to implement the steps in any of the above methods.
[0315] In some implementations, the chip system also includes a memory connected to one or more processors via circuitry or wiring.
[0316] In some implementations, the chip system also includes a communication interface.
[0317] This application also provides a computer-readable medium including instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in the above-described method embodiments.
[0318] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the aforementioned related steps to implement the methods described in the various method embodiments above.
[0319] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0320] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0321] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0322] In the embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0323] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0324] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0325] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0326] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0327] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0328] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for switching application windows, characterized in that, The application window switching method, applied to electronic devices, includes: The first window of the first application and the second window of the second application are displayed in a split-screen format on the screen of the electronic device. When a window switching operation is received, the holding direction of the electronic device is determined, and the window switching operation is used to instruct the first window to be displayed in full screen; When it is determined that the forced display orientation of the first application is different from the grip orientation, a mask animation is drawn, which is used to adjust the window size of the first window to be the same as the display screen size; Pause the call to the display rotation class, which is used to rotate the first window from the forced display direction to the gripping direction; Play the masked animation; When the mask animation finishes playing, the display rotation class is invoked again so that the first window is displayed in full-screen mode in the gripping direction.
2. The application window switching method according to claim 1, characterized in that, Before pausing the display rotation class, the application window switching method further includes: The display rotation pause class method is called so that the display rotation pause class method updates the orientation control assignment of the display screen from 0 to 1. When the orientation control assignment is 0, the display orientation of the display screen can be changed according to the application's requested orientation. When the orientation control assignment is 1, the display orientation cannot be changed according to the requested orientation.
3. The application window switching method according to claim 1, characterized in that, Before restoring the call to the display rotation class, the application window switching method further includes: The display rotation recovery class method is called so that the display rotation recovery class method updates the orientation control assignment of the display screen from 1 to 0. When the orientation control assignment is 0, the display orientation of the display screen can be changed according to the application's requested orientation. When the orientation control assignment is 1, the display orientation cannot be changed according to the requested orientation.
4. The application window switching method according to claim 1, characterized in that, When it is determined that the forced display direction of the first application is different from the grip direction, the mask animation is drawn, including: When it is determined that the forced display direction is different from the gripping direction, the window elements in the first window are obtained; The window elements are laid out to obtain a layout image; Add a full-screen blur layer and animation properties to the layout image to obtain the mask animation.
5. The application window switching method according to claim 4, characterized in that, When it is determined that the forced display direction is different from the gripping direction, the step of obtaining window elements in the first window includes: When it is determined that the forced display direction is different from the gripping direction, the window image of the first window is captured; The window image is subjected to image recognition to obtain the window elements.
6. The application window switching method according to claim 4, characterized in that, The step of laying out the window elements to obtain a layout image includes: Obtain the screen size; The window elements are laid out according to the screen size to obtain the layout image.
7. The application window switching method according to claim 1, characterized in that, The electronic device is equipped with an acceleration sensor. When a window switching operation is received, determining the gripping direction of the electronic device includes: When the window switching operation is received, the acceleration of the electronic device is collected based on the acceleration sensor; The grip direction is determined based on the acceleration.
8. The application window switching method according to any one of claims 1 to 7, characterized in that, The grip direction is the portrait grip direction, and the forced display direction is the forced landscape display direction.
9. The application window switching method according to claim 8, characterized in that, The first window includes a full-screen button, and the window switching operation is a first click operation on the full-screen button of the first window. When a window switching operation is received, determining the holding direction of the electronic device includes: When the first click operation is received, the holding direction of the electronic device is determined to be the vertical screen holding direction.
10. The application window switching method according to claim 8, characterized in that, The second window includes a floating window button, and the window switching operation is a second click operation on the floating window button of the second window. When a window switching operation is received, determining the holding direction of the electronic device includes: When the second click operation is received, the holding direction of the electronic device is determined to be the vertical screen holding direction.
11. The application window switching method according to claim 10, characterized in that, Also includes: Determine the first blank display content area when the first window is displayed in full screen in the vertical screen grip direction; The second window is displayed floating over the first blank display content area.
12. The application window switching method according to any one of claims 1 to 7, characterized in that, The grip direction is the landscape grip direction, and the forced display direction is the forced portrait display direction.
13. The application window switching method according to claim 12, characterized in that, The first window includes a full-screen button, and the window switching operation is a third click operation on the full-screen button of the first window. When a window switching operation is received, determining the holding direction of the electronic device includes: When the third click operation is received, the gripping direction of the electronic device is determined to be the landscape gripping direction.
14. The application window switching method according to claim 12, characterized in that, The second window includes a floating window button, and the window switching operation is a fourth click operation on the floating window button of the second window. When a window switching operation is received, determining the holding direction of the electronic device includes: When the fourth click operation is received, the gripping direction of the electronic device is determined to be the landscape gripping direction.
15. The application window switching method according to claim 14, characterized in that, Also includes: Determine the second blank display content area when the first window is displayed in full screen in the landscape grip direction; The second window is displayed floating over the second blank display content area.
16. An electronic device, characterized in that, The electronic device includes: one or more processors, and a memory; The memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the electronic device to perform the application window switching method as described in any one of claims 1 to 15.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the application window switching method as described in any one of claims 1 to 15.
Citation Information
Patent Citations
Method and apparatus for providing multi-window in touch device
CN103677627A
Processing method and device of split-screen exiting, storage medium and electronic equipment
CN108549575A