WO2023279980A1 - 一种转屏控制方法、装置及电子设备 - Google Patents

一种转屏控制方法、装置及电子设备 Download PDF

Info

Publication number
WO2023279980A1
WO2023279980A1 PCT/CN2022/100825 CN2022100825W WO2023279980A1 WO 2023279980 A1 WO2023279980 A1 WO 2023279980A1 CN 2022100825 W CN2022100825 W CN 2022100825W WO 2023279980 A1 WO2023279980 A1 WO 2023279980A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
window
application
display
electronic device
Prior art date
Application number
PCT/CN2022/100825
Other languages
English (en)
French (fr)
Inventor
王波
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22836734.8A priority Critical patent/EP4345593A1/en
Publication of WO2023279980A1 publication Critical patent/WO2023279980A1/zh
Priority to US18/402,391 priority patent/US20240211122A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/1633Constructional details or arrangements of portable computers not specific to the type of enclosures covered by groups G06F1/1615 - G06F1/1626
    • G06F1/1684Constructional details or arrangements related to integrated I/O peripherals not covered by groups G06F1/1635 - G06F1/1675
    • G06F1/1694Constructional details or arrangements related to integrated I/O peripherals not covered by groups G06F1/1635 - G06F1/1675 the I/O peripheral being a single or a set of motion sensors for pointer control or gesture input obtained by sensing movements of the portable computer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2200/00Indexing scheme relating to G06F1/04 - G06F1/32
    • G06F2200/16Indexing scheme relating to G06F1/16 - G06F1/18
    • G06F2200/161Indexing scheme relating to constructional details of the monitor
    • G06F2200/1614Image rotation following screen orientation, e.g. switching from landscape to portrait mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2200/00Indexing scheme relating to G06F1/04 - G06F1/32
    • G06F2200/16Indexing scheme relating to G06F1/16 - G06F1/18
    • G06F2200/163Indexing scheme relating to constructional details of the computer
    • G06F2200/1637Sensing arrangement for detection of housing movement or orientation, e.g. for controlling scrolling or cursor movement on the display of an handheld computer

Definitions

  • the present invention relates to the field of communication technologies, in particular to a method, device and electronic equipment for controlling screen rotation.
  • Application display technology is more and more widely used on terminal devices.
  • the display orientation on a terminal device can be divided into four directions: landscape, portrait, reverse landscape, and reverse portrait. Not all windows of all applications can support all Orientation display. For example, some applications only support display in portrait orientation. Even if the device is turned to landscape orientation, the application is still displayed in portrait orientation.
  • Embodiments of the present application provide a method, device, and electronic device for controlling screen transfer, which can realize differentiated management of the screen transfer status of the foreground display application and the background application according to the physical holding state of the current device, so that when the top-level application returns, the next An application to be displayed is the final display state, which improves the experience of switching scenes.
  • the embodiment of the present application provides a method for controlling screen rotation, which can be applied to an electronic device with a display screen.
  • the method includes: displaying a first interface of a first application, wherein the window direction of the first interface is the same as the The holding direction of the electronic device is the same; when the operation of opening the second interface of the second application through the first interface is detected, and it is determined that the preset window direction of the second interface is different from the holding direction of the electronic device, the second interface
  • the preset window direction of the first target application displays the interface of the first target application and keeps the window direction of the second target application unchanged; wherein, the first target application includes the second application, and the second target application includes the first application.
  • the screen switching method provided in the embodiment of the present application is mainly aimed at switching display interfaces between applications.
  • the screen transfer operation only the screen transfer process is performed for the current application that needs to be transferred, and no screen transfer processing is performed for other applications, so that when the user closes the top-level window, the next window to be displayed is already in the final display state. The experience effect when switching windows is guaranteed.
  • the method further includes: When the holding direction changes, determine whether the window display direction of the first target application is the same as the current holding direction of the electronic device; based on the window display direction of the first target application being the same as the current holding direction of the electronic device, update the The window directions of other applications except the first target application, so that the window directions of other applications except the first target application are the same as the current holding direction of the electronic device; based on the window display direction of the first target application and the electronic device The current holding orientation of the electronic device is different, and the window orientation of each application on the electronic device is updated, so that the window orientation of each application on the electronic device is the same as the current holding orientation of the electronic device.
  • the second The preset window direction of the second interface Displaying the interface of the first target application and keeping the window direction of the second target application unchanged includes: obtaining the preset window direction of the second interface of the second application through the activity activity manager, when the preset window When the direction is different from the holding direction of the electronic device, the activity manager triggers the screen switching module to perform a screen switching operation on the display window corresponding to the first target application.
  • the activity manager triggering the screen switching module to perform screen switching operation on the display window corresponding to the first target application includes: adjusting the width information of the display window corresponding to the first target application according to the preset window direction of the second interface , height information, and orientation information of the displayed content, so that the window orientation of the display window corresponding to the first target application is the same as the preset window orientation of the second interface.
  • the method further includes: the activity manager sends a resource update event to the first target application , to trigger the first target application to refresh the window layout corresponding to the first target application according to the resource update event.
  • the first target application further includes a background application that allows a prompt window to pop up.
  • the first application is a desktop application.
  • the method further includes: closing the second application During the operation, the first interface of the first application is displayed; wherein, the window display direction of the first interface of the first application is the same as the holding direction of the electronic device.
  • the embodiment of the present application provides a method for controlling screen rotation, which can be applied to an electronic device with a display screen.
  • the method includes: displaying the first interface of the first application, wherein the window direction of the first interface is the same as that of the electronic
  • the holding direction of the device is the same; when the operation of opening the second interface of the first application through the first interface of the first application is detected, and it is determined that the preset window direction of the second interface is different from the holding direction of the electronic device, the The second interface is displayed in the preset window direction of the second interface; when an operation of closing the second interface by the user is detected, the window direction of the first interface is obtained, and the first interface is displayed in the window direction of the first interface interface.
  • the screen switching control method provided in the embodiment of the present application is mainly aimed at switching display interfaces between the same applications.
  • the screen switching control method is mainly aimed at switching display interfaces between the same applications.
  • obtaining the window orientation of the first interface, and displaying the first interface in the window orientation of the first interface includes: when the activity manager detects When the user closes the operation of the second interface, the activity manager acquires the window direction of the first interface, and determines whether the window direction of the first interface is the same as the holding direction of the electronic device; based on the window direction of the first interface and the electronic device If the holding direction of the application is different, the activity manager notifies the screen transfer module to perform screen transfer operation on the display window of the first application without displaying the screen transfer motion effect.
  • the activity manager notifies the screen transfer module to perform the screen transfer operation on the display window of the first application, including: adjusting the width information, height information and display information of the display window corresponding to the first application according to the window direction of the first interface.
  • the orientation information of the content so that the window orientation of the display window corresponding to the first application is the same as the preset window orientation of the first interface.
  • the window direction of the next interface to be displayed ie, the first interface of the first application
  • the screen switching operation is performed on the display window of the first application, but the screen switching motion effect is not displayed, so that the user is not aware of the screen switching process, and the user's operating experience is improved.
  • the activity manager closes the display window of the second interface and displays a closing motion effect, displaying the display of the first interface window, and display the startup animation.
  • the screen-turning decision-making process for the next window to be displayed and the closing animation of the current window are executed simultaneously to ensure that the first interface of the first application has been updated to the final state after the second interface of the first application is closed. Improved user experience.
  • an embodiment of the present application provides a screen-turning control device, including: a display unit configured to display a first interface of a first application, wherein the window direction of the first interface is the same as the holding direction of the electronic device ;
  • the processing unit is configured to trigger the display unit to open the second interface of the second application through the first interface when the operation of opening the second interface of the second application is detected, and when it is determined that the preset window direction of the second interface is different from the holding direction of the electronic device,
  • the preset window orientation of the first target application displays the interface of the first target application and keeps the window orientation of the second target application unchanged, wherein the first target application includes the second application, and the second target application includes the first application.
  • the processing unit is further configured to: when detecting that the holding direction of the electronic device changes, determine whether the window display direction of the first target application is the same as the current holding direction of the electronic device;
  • the window display orientation of the first target application is the same as the current holding orientation of the electronic device, and the window orientations of other applications on the electronic device except the first target application are updated so that the window orientations of other applications except the first target application are the same as The current holding direction of the electronic device is the same; based on the fact that the window display direction of the first target application is different from the current holding direction of the electronic device, the window direction of each application on the electronic device is such that the window direction of each application on the electronic device The window direction is the same as the current holding direction of the electronic device.
  • the second interface Displaying the interface of the first target application and keeping the window orientation of the second target application unchanged includes: obtaining the preset window orientation of the second interface of the second application through the activity activity manager, when the preset window orientation is the same as When the holding directions of the electronic devices are different, the activity manager triggers the screen switching module to perform a screen switching operation on the display window corresponding to the first target application.
  • the activity manager triggering the screen switching module to perform screen switching operation on the display window corresponding to the first target application includes: adjusting the width information of the display window corresponding to the first target application according to the preset window direction of the second interface , height information, and orientation information of the displayed content, so that the window orientation of the display window corresponding to the first target application is the same as the preset window orientation of the second interface.
  • the activity manager after the activity manager triggers the screen transfer module to perform screen transfer operation on the display window corresponding to the first target application, it further includes: the activity manager sends a resource update event to the first target application to The first target application is triggered to refresh the window layout corresponding to the first target application according to the resource update event.
  • the first target application further includes a background application that allows a prompt window to pop up.
  • the first application is a desktop application.
  • the processing unit is further configured to: When the operation of the second application is closed, the display unit is triggered to display the first interface of the first application, wherein the display direction of the window of the first interface of the first application is the same as the holding direction of the electronic device.
  • an embodiment of the present application provides a device for controlling screen rotation, including: a display unit configured to display a first interface of a first application, where the window direction of the first interface is the same as the holding direction of the electronic device;
  • the processing unit is configured to trigger the display unit when an operation of opening the second interface of the first application through the first interface of the first application is detected and it is determined that the preset window direction of the second interface is different from the holding direction of the electronic device Displaying the second interface with the preset window direction of the second interface; when detecting the user's operation to close the second interface, obtaining the window direction of the first interface, and triggering the display unit to display the first interface with the window direction of the first interface.
  • obtaining the window orientation of the first interface, and displaying the first interface in the window orientation of the first interface includes: when the activity manager detects When the user closes the operation on the second interface, the activity manager acquires the window orientation of the first interface, and determines whether the window orientation of the first interface is the same as the holding orientation of the electronic device; based on the window orientation of the first interface and the electronic device's If the holding direction is different, the activity manager notifies the screen transfer module to perform screen transfer operation on the display window of the first application without displaying the screen transfer effect.
  • the activity manager notifies the screen transfer module to perform the screen transfer operation on the display window of the first application, including: adjusting the width information, height information and display information of the display window corresponding to the first application according to the window direction of the first interface.
  • the orientation information of the content so that the window orientation of the display window corresponding to the first application is the same as the preset window orientation of the first interface.
  • the activity manager closes the display window of the second interface and displays a closing motion effect, displaying the display of the first interface window, and display the startup animation.
  • the embodiment of the present application provides an electronic device, including the apparatus provided in the third aspect or the fourth aspect.
  • the embodiment of the present application provides a computer storage medium, and instructions are stored in the computer storage medium, and when the instructions are run on the computer, the computer is made to execute the method provided in the first aspect, or execute the method in the second aspect. provided method.
  • the embodiment of the present application provides a computer product containing instructions, and when the instructions are run on the computer, the computer is made to execute the method provided in the first aspect, or execute the method provided in the second aspect .
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application.
  • FIG. 3 is a schematic diagram of the architecture of an operating system in an electronic device provided in an embodiment of the present application
  • Fig. 4a is a schematic diagram of a display interface on an electronic device provided in an embodiment of the present application.
  • Fig. 4b is a schematic diagram of a display interface on another electronic device provided in the embodiment of the present application.
  • Fig. 4c is a schematic diagram of a display interface on another electronic device provided in the embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for controlling screen transition provided by an embodiment of the present application.
  • FIG. 6a is a schematic diagram of a display interface on an electronic device provided in an embodiment of the present application.
  • Fig. 6b is a schematic diagram of a display interface on another electronic device provided in the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a method for controlling screen transition provided in an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a rotating screen device provided in the embodiment of the present application.
  • Fig. 9 is a schematic structural diagram of another screen-turning device provided in the embodiment of the present application.
  • any embodiment or design scheme of "exemplary”, “for example” or “for example” should not be understood as being more preferred or more advantageous than other embodiments or design schemes . Rather, the use of words such as “exemplary”, “for example” or “for example” is intended to present related concepts in a specific manner.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • Fig. 1 is a schematic diagram of an application scenario provided by the embodiment of the present application.
  • Fig. 1 when the electronic device 100 is held in a landscape orientation, an Apps displayed in landscape orientation are not supported, and the content displayed on the screen on the electronic device will switch to portrait orientation.
  • the display screen of the electronic device will first display the desktop in vertical screen, and then switch to horizontal screen display, which makes the user experience poor.
  • the differentiated management of the screen switching status of the foreground application and the background application is realized, so that when the top-level application returns, the next application to be displayed is already the final display. state, which improves the experience of switching scenes.
  • the electronic device may be a mobile phone, a tablet computer, a digital camera, a personal digital assistant (personal digital assistant, PDA), a wearable device, and the like.
  • Exemplary embodiments of electronic equipment include, but are not limited to, electronic equipment equipped with iOS, android, Windows, Harmony OS, or other operating systems.
  • the aforementioned electronic device may also be other electronic devices, such as a laptop computer (laptop) with a touch-sensitive surface (eg, a touch panel).
  • the embodiment of the present application does not specifically limit the type of the electronic device.
  • FIG. 2 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • the electronic device 100 may include a processor 110 , a memory 120 , a display screen 130 and a sensor 140 .
  • the structure shown in the embodiment of this solution does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may be a general purpose processor or a special purpose processor.
  • the processor 110 may include a central processing unit (central processing unit, CPU) and/or a baseband processor.
  • the baseband processor can be used to process communication data
  • the CPU can be used to implement corresponding control and processing functions, execute software programs, and process data of the software programs.
  • a program (or an instruction or code) may be stored in the memory 120, and the program may be executed by the processor 110, so that the processor 110 executes the method described in this solution.
  • the memory 120 may store instructions or data that are just used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory 120, so as to avoid repeated access, reduce the waiting time of the processor 110, and improve the efficiency of the system.
  • the display screen 130 is used to display images, videos and the like.
  • the display screen 130 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 or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • electronic device 100 may include one or more display screens 130 .
  • the display screen 130 can be used to display an interface of an application program.
  • the sensor 140 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, an ambient light sensor, a bone conduction sensor, and the like.
  • the sensor 140 may also include a gravity sensor and a touch sensor.
  • the gravity sensor can be used to detect whether the holding direction of the electronic device changes. Specifically, the acceleration change caused by gravity can be measured through the gravity sensor, and the inclination angle of the electronic device relative to the horizontal plane can be calculated to determine whether the holding direction of the electronic device changes.
  • the touch sensor can be used to detect a touch operation on or near it.
  • the touch sensor can collect the touch event of the user on or near it (such as the operation of the user on the surface of the touch sensor with any suitable object such as a finger or a stylus), and send the collected touch information to other devices, Such as processor 110 and so on.
  • the touch sensor sends the touch event collected from the display screen of the electronic device 100 to the processor 110, so that the processor 110 can determine the display interface on the display screen of the electronic device 100 according to the touch event. Whether a switchover has occurred.
  • the touch sensor can be implemented in various ways such as resistive, capacitive, infrared, and surface acoustic wave.
  • the touch sensor can be arranged on the display screen 130, and the touch screen is composed of the touch sensor and the display screen 130, also called "touch screen”; or, the touch sensor and the display screen 130 can be used as two independent components to realize the input and output function.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the Android system with a layered architecture is taken as an example to illustrate the software structure of the electronic device 100 .
  • FIG. 3 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are application layer, application framework layer, Android runtime and system library, and kernel layer from top to bottom. Among them, Huawei's self-developed mobile terminal operating system can also refer to this structure.
  • the application layer can include a series of application packages.
  • the application program package may include application programs (applications, APPs) such as life, video, map, shopping, gallery, calendar, call, navigation, and music.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include an Activity manager, a Window display manager, an application resource manager, a screen transfer module, and the like.
  • the Activity Manager is responsible for the management of the Activity components. Its main tasks include Activity startup management, state management, and life cycle management.
  • the Window window display manager is responsible for the display management of the window. Its main tasks include window display level, window display coordinates, window display dynamic effects, etc.
  • the application resource manager is responsible for the management of application resources, managing the resources loaded by the application, updating resource information such as screen width, height, density, etc.
  • the window information refreshes the layout.
  • the screen transition module is responsible for the screen transition management of the system, responsible for monitoring sensor events, realizing transition decision management, screen transition dynamic effect execution, screen transition notification, etc.
  • the Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application program layer and the application program framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • a system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
  • the desktop application is displayed in a horizontal display mode on a tablet held in a horizontal screen, so that icons of multiple applications can be displayed on the display screen of the tablet, and the user can open the application icon by triggering the icon of a certain application.
  • UI For example, when a user clicks a video application on the desktop with a finger, the tablet responds to the user's click operation to determine whether the preset window direction of the initial interface of the video application is the same as the current holding direction of the tablet.
  • the preset window orientation of the initial interface of the video application is portrait orientation
  • the current orientation of the tablet is landscape orientation, as shown in the figure 4b, but at the same time, it is necessary to keep the default window direction of the desktop application unchanged.
  • the holding direction of the tablet is the horizontal screen orientation
  • the window display direction of the initial interface of the video application displayed on the display screen of the tablet is the vertical screen orientation.
  • the display interface of the tablet as shown in Figure 4b when the user converts the tablet held in the horizontal screen to the vertical screen as shown in Figure 4c, since the display interface of the tablet shown in Figure 4b shows The initial interface of the video application is already displayed on the vertical screen, so when the tablet is changed from the landscape holding state to the portrait holding state, the window orientation of the initial interface of the video application displayed on the tablet display screen does not change. Further, in the tablet display interface as shown in FIG. 4b, when the initial interface of the video application is displayed in the window display orientation of the vertical screen, the preset window orientations of other applications (including desktop applications) other than the video application are not changed. Change, that is, in the tablet display interface as shown in FIG.
  • Step S501 in response to the user's operation instruction to open the initial interface of Huawei Video in the desktop application displayed on the horizontal screen, the activity manager acquires the default window orientation of the initial interface of Huawei Video, when the acquired preset window orientation is the same as that of the tablet When the holding directions are different, the activity manager triggers the screen switching module to perform a screen switching operation on the display window corresponding to the first target application including Huawei Video.
  • the holding direction of the tablet includes: portrait orientation, reverse portrait orientation, landscape orientation, and reverse landscape orientation.
  • the current holding direction of the tablet can be acquired according to the gravity sensor installed in the tablet.
  • the preset window direction refers to the expected display direction of the window to be opened.
  • each display window corresponds to a default display direction and a dynamic display direction.
  • the priority of the dynamic display direction is higher than that of the default display direction. That is, when the user opens a new display window, if the window is set with a dynamic display direction, the current direction that needs to be dynamically displayed will be used as the preset window direction; if the window is not set with a dynamic display direction, the window's default Display orientation as default window orientation.
  • the first target application refers to an application having a display layer on the current display interface of the tablet, such as a status bar, other floating windows, other split-screen applications, and the like. Further, the first target application may also be configured by the system itself. Specifically, whitelist preset may be performed by the system side.
  • step S502 the screen switching module performs a screen switching operation on the display window of the first target application and sends a screen switching notification to the activity manager.
  • the first target application may be determined by the activity manager, and the activity manager may synchronously send the information of the first target application that needs to perform the screen-turning operation when triggering the screen-turning module to perform the screen-turning operation Give the screen transfer module. It may also be that the screen switching module itself determines the first target application that needs to perform the screen switching operation before performing the screen switching operation.
  • the screen switching module Before the screen switching module executes the screen switching operation on the display window of the first target application, it first needs to obtain the size information of the display windows corresponding to each application in the first target application, that is, the length information and width information, and the direction of the display content in each display window information, and then exchange the length information and width information of each display window, and adjust the direction of the display content in the display window of each application to be the same as the preset direction of the display window of each application.
  • the screen transfer module When the screen transfer module completes the screen transfer operation, it sends a screen transfer notification to the activity manager, and the screen transfer notification is used to trigger the activity manager to perform subsequent screen transfer operations.
  • the activity manager after receiving the screen transfer notification from the screen transfer module, the activity manager only sends the screen transfer broadcast to the first target application that needs to perform the screen transfer operation.
  • step S503 the activity manager sends a screen switching instruction to the window window information manager, so that the display window corresponding to the first target application is displayed in a vertical screen.
  • the Activity manager After the Activity manager sends the screen-turning broadcast to the first target application, it also needs to send a screen-turning instruction to the Window window display manager, so that the display interface of the newly opened application can be displayed in a vertical screen mode.
  • Step S504 the activity manager sends an update instruction to the application resource manager, so that the application resource manager updates the resource information of the first target application, and sends a resource update callback instruction to the first target application after the update is completed.
  • the update instruction sent by the activity manager to the application resource manager includes the resource update event of the first target application, so that the application resource manager only updates the resource information of the first target application.
  • each application in the first target application corresponds to a resource update event.
  • Each resource update event includes width information, height information, orientation information and display related information of the application to be updated. If the application explorer cannot receive these events, it will not actively trigger a layout refresh on the display window of the application that needs to be updated.
  • step S503 and step S504 may be executed at the same time, or step S503 may be executed first, or step S504 may be executed first.
  • the present application is aimed at switching between windows between applications.
  • the preset window direction of the newly opened application by the user is different from the holding direction of the current electronic device, only the newly opened application and the application having a display layer on the display interface of the current electronic device need to perform screen transfer processing. And continue to keep the window display direction of other applications in the same direction as the holding direction of the current electronic device, that is, applications other than newly opened applications and applications with display layers on the display interface of the current electronic device have zero perception of the screen-turning event.
  • the specific operation process includes:
  • Step S505 the screen transfer module obtains the current holding direction of the electronic device and the direction of the display window of the application displayed on the current electronic device, and according to the current holding direction of the electronic device and the direction of the display window of the application displayed on the current electronic device, Perform a screen transfer operation, and send a screen transfer notification to the activity manager, which is used to trigger the activity manager to perform subsequent screen transfer operations.
  • the screen-turning module compares the obtained holding direction of the current electronic device with the direction of the display window of the application currently displayed on the electronic device.
  • the direction of the display window of the application displayed on the current electronic device is the same as the holding direction of the electronic device
  • applications other than the application displayed on the current electronic device and the application with a display layer on the display interface of the current electronic device Other applications perform screen switching operations.
  • the screen switching operation performed by the screen switching module includes: exchanging the length information and width information of the display window of the application that needs to be switched, and adjusting the direction of the display content in the display window, so that the display window The orientation of the displayed content is the same as the current holding orientation of the electronic device.
  • the screen switching module needs to perform a screen switching operation on all the applications on the current electronic device.
  • step S506 after the activity manager receives the screen transfer notification, it determines the applications that need screen transfer on the current electronic device according to the received screen transfer notification, and sends the screen transfer notification to the applications that need screen transfer.
  • the activity manager judges the display windows of the applications on the current electronic device to determine the applications that need screen transfer, and sends screen transfer broadcasts to the applications that need screen transfer.
  • the activity manager obtains the application information on the current electronic device that needs to transfer the screen from the screen transfer notification, and sends a transfer request to the application that needs to transfer the screen according to the application information carried in the screen transfer notification. screen notifications.
  • Step S507 The activity manager sends an update instruction to the application resource manager, so that the application resource manager updates the resource information of other applications except the currently displayed application and the system interface display application related to the currently displayed application, and sends the corresponding The application sends a resource update callback command.
  • the embodiment of the present application takes the scene of holding the screen in landscape as an example, but it is not limited to the scene of holding in landscape screen, and is also applicable to the scene of holding in portrait screen.
  • a video application is opened on the display interface of the tablet held in portrait mode, and the first interface of the opened video application is as shown in FIG. 6a. Open and play the first episode of video of the selected media file on the tablet interface as shown in FIG. 6a, and the video application jumps to the second interface as shown in FIG. 6b.
  • the holding direction of the tablet is a portrait orientation
  • the window orientation of the opened second interface is a landscape orientation.
  • the process of opening the second interface of the video application through the first interface of the video application includes: determining whether the window display direction of the second interface of the video application is the same as the holding direction of the current tablet. When the window display direction of the second interface is different from the holding direction of the current tablet, the screen switching operation is performed on all applications on the current tablet.
  • Step S701 in response to the user's operation instruction to close the second interface, the activity manager obtains the window direction corresponding to the first interface, and when the obtained window direction is different from the current holding direction of the electronic device, triggers the screen transfer module to monitor the video
  • the display window of the application performs a screen transfer operation, and sends a screen transfer notification to the activity manager.
  • the next window to be displayed is the display window of the first interface.
  • the screen-turning module When the screen-turning module performs the screen-turning operation, it first needs to obtain the preset window direction information of the window corresponding to the first interface, and interact with the width information and height information of the display window of the first interface according to the direction information of the preset window. change, and adjust the direction of the content in the display window of the first interface, so that the direction of the content to be displayed next is the same as the direction of the preset window.
  • the screen-turning module executes the screen-turning operation on the next window to be displayed, it does not need to perform the screen-turning motion effect, which makes the user unaware of the screen-turning operation.
  • step S702 the activity manager sends an update instruction to the application resource manager in response to the received screen transition notification, so that the application resource manager updates the resource information of all applications on the electronic device.
  • step S703 the activity manager triggers the window window display manager to execute an operation command to close the second interface, execute a closing motion effect, and display the display window of the first interface at the same time.
  • the activity activity manager will search for the next window to be displayed, and make decisions and execute them on the screen.
  • the flow, resources and state of the next window to be displayed have been updated to the final orientation before the current window is closed. Since the closing of the window generally takes time, ranging from hundreds of millimeters, when the window is closed, the next window to be displayed that the user sees is already in the display state of the final orientation. Execute the decision-making process of screen switching, window closing and animation at the same time to ensure that the state of the next window to be displayed after the top-level window is closed has been updated to the final state. The experience is smoother.
  • the embodiment of the present application takes the scene of holding the screen vertically as an example, but it is not limited to the scene of holding the screen vertically, and is also applicable to the scene of holding the screen horizontally.
  • FIG. 8 is a schematic structural diagram of a screen switching device provided by an embodiment of the present application. As shown in FIG. 8 , the screen switching device 200 includes: a display unit 801 and a processing unit 802 .
  • the display unit 801 is configured to display a first interface of a first application, and the window direction of the first interface is the same as the holding direction of the electronic device.
  • the processing unit 802 is configured to trigger the display unit 801 to open the second interface of the second application through the first interface and determine that the preset window direction of the second interface is different from the holding direction of the electronic device, triggering the display unit 801 to display the second
  • the preset window direction of the interface displays the interface of the first target application and keeps the window direction of the second target application unchanged.
  • the first target application includes the second application
  • the second target application includes the first application.
  • the preset window direction of the second interface of the second application can be acquired through the activity manager, and when the acquired preset window direction is different from the holding direction of the electronic device, the activity manager triggers
  • the screen switching module performs a screen switching operation on the display window corresponding to the first target application. Specifically, it includes: adjusting the width information, height information, and orientation information of the display window corresponding to the first target application according to the preset window orientation of the second interface, so that the window orientation of the display window corresponding to the first target application is the same as that of the second target application.
  • the default window directions of the two interfaces are the same.
  • the activity manager after the activity manager triggers the screen transfer module to perform a screen transfer operation on the display window corresponding to the first target application, the activity manager also needs to send a resource update event to the first target application, so as to trigger the first target application to The resource update event refreshes the window layout corresponding to the first target application.
  • the first target application includes a background application that allows a prompt window to pop up.
  • the first application is a desktop application.
  • the processing unit 802 detects that the holding direction of the electronic device changes, it determines whether the window display direction of the first target application is the same as the current holding direction of the current electronic device.
  • the window display direction of the first target application is the same as the current holding direction of the current electronic device, update the window directions of other applications on the electronic device except the first target application so that the windows of other applications except the first target application
  • the orientation is the same as the current holding orientation of the electronic device.
  • the processing unit 802 when detecting the user's operation to close the second application, the processing unit 802 triggers the display unit 801 to display the first interface of the first application, where the window display direction of the first interface of the first application is the same as The holding directions of the electronic devices are the same.
  • the display direction of the application is not consistent with the holding direction of the current electronic device, only the foreground application including the application currently displayed on the device is subjected to screen transfer processing. Other applications continue to maintain the horizontal screen state, and have zero awareness of screen-turning events.
  • the holding direction of the current electronic device changes, for example, when the holding direction of the current electronic device is changed from horizontal screen holding to vertical screen holding, the window display direction of other applications in the horizontal screen state is updated to vertical screen show.
  • the foreground display application and other applications are independently controlled to switch screens, so that the window display direction of other applications is always consistent with the holding direction of the corresponding electronic device.
  • FIG. 9 is a schematic structural diagram of a screen-rotating device provided by an embodiment of the present application.
  • the screen switching device 300 includes: a display unit 901 and a processing unit 902 .
  • the display unit 901 is configured to display a first interface of a first application, wherein the window direction of the first interface is the same as the current holding direction of the electronic device.
  • the processing unit 902 is configured to detect the operation of opening the second interface of the first application through the first interface of the first application, and determine that the preset window orientation of the second interface is different from the current holding orientation of the electronic device, The display unit 901 is triggered to display the second interface in the preset window direction of the second interface. Further, the processing unit 902 is further configured to acquire the window orientation of the first interface when detecting the user's operation to close the second interface, and trigger the display unit 901 to display the first interface in the window orientation of the first interface.
  • the activity activity manager when the user's operation to close the second interface is detected by the activity manager, the next interface to be displayed is acquired as the first interface, and the window orientation of the first interface is determined through the activity management Whether the window direction of the first interface is the same as the holding direction of the current electronic device. Based on the fact that the window direction of the first interface is different from the holding direction of the current electronic device, the activity activity manager notifies the screen switching module to perform a screen switching operation on the display window of the first application without displaying the screen switching motion effect.
  • the screen switching module performs the screen switching operation on the display window of the first application, including: adjusting the width information, height information and direction information of the display window of the first application according to the window direction of the first interface, so that the first application
  • the window direction of the display window corresponding to an application is the same as the preset window direction of the first interface.
  • the Activity manager closes the display window of the second interface and displays a closing motion effect, and displays the display window of the first interface and displays a starting motion effect.
  • the system before the system executes the operation of closing the top-level window, it needs to find the next window to be displayed in advance, and execute the screen switching decision according to the preset window direction of the next window to be displayed. For example, when the preset window direction of the next window to be displayed is different from the current holding direction of the electronic device, a screen switching operation is required. Specifically, when performing the screen-turning operation, there is no need to perform the screen-turning motion effect, and only need to update the screen-turning notification, update resources, etc. And screen transfer notification, resource refresh and other actions, because the top-level window has not been closed at this time, so there is no need to deal with it.
  • the embodiments of the present application further provide an electronic device, where the electronic device includes any screen switching device provided in the above embodiments.
  • the method steps in the embodiments of the present application may be implemented by means of hardware, or may be implemented by means of a processor executing software instructions.
  • the software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (random access memory, RAM), flash memory, read-only memory (read-only memory, ROM), programmable read-only memory (programmable rom) , PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or known in the art any other form of storage medium.
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • the processor and storage medium can be located in the ASIC.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted via a computer-readable storage medium.
  • the computer instructions may be transmitted from one website site, computer, server, or data center to another website site by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) , computer, server or data center for transmission.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.

Landscapes

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

Abstract

一种转屏控制方法,该方法可以包括:在电子设备的显示屏上显示第一应用的第一界面,其中第一界面的窗口方向与电子设备的持握方向相同;在检测到通过第一界面打开第二应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变;其中,第一目标应用包括第二应用,第二目标应用包括第一应用。通过对前台显示应用和后台应用的进行差异化的管理,使得顶层应用返回时,下一个要显示的应用已是最终的显示状态,提高了切换场景的体验。

Description

一种转屏控制方法、装置及电子设备
本申请要求在2021年7月05日提交中国国家知识产权局、申请号为202110758909.3,发明名称为“一种转屏控制方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种转屏控制方法、装置及电子设备。
背景技术
应用显示技术在终端设备上使用越来越广泛,在一个终端设备上显示方向可以分为横屏、竖屏、反横屏、反竖屏四个方向,并非所有应用的所有窗口都能支持所有方向显示,比如有的应用只支持在竖屏方向显示,即使设备转到横屏方向,应用仍然以竖屏方向显示。
发明内容
本申请实施例提供了一种转屏控制方法、装置及电子设备,能根据当前设备的物理持握状态,实现前台显示应用和后台应用转屏状态的差异化管理,使顶层应用返回时,下一个要显示的应用已是最终的显示状态,提高了切换场景的体验。
第一方面,本申请实施例提供了一种转屏控制方法,可应用于具有显示屏的电子设备上,该方法包括:显示第一应用的第一界面,其中,第一界面的窗口方向与电子设备的持握方向相同;在检测到通过第一界面打开第二应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变;其中,第一目标应用包括第二应用,第二目标应用包括第一应用。
也就是说,本申请实施例提供的转屏方法,主要针对跨应用之间的显示界面的切换。在执行转屏操作时,只对当前需要转屏的应用进行转屏处理,而对其他应用不作转屏处理,使得用户在关闭顶层窗口时,下一个需要显示的窗口已经处于最终的显示状态,保证了窗口切换时的体验效果。
在一个可能的实现方式中,当以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后,该方法还包括:在检测到电子设备的持握方向发生改变时,确定第一目标应用的窗口显示方向与电子设备的当前持握方向是否相同;基于第一目标应用的窗口显示方向与电子设备的当前持握方向相同,更新该电子设备上除第一目标应用以外的其他应用的窗口方向,以使除第一目标应用以外的其他应用的窗口方向与该电子设备的当前持握方向相同;基于第一目标应用的窗口显示方向与电子设备的当前持握方向不同,更新该电子设备上的每一个应用的窗口方向,以使该电子设备上的每一个应 用的窗口方向与该电子设备的当前持握方向相同。
也就是说,当用户改变电子设备的持握方向以后,判断前台显示应用的窗口方向与电子设备的当前持握方向是否相同,当前台显示应用的窗口方向与电子设备的当前持握方向相同时,只需要对除前台显示应用以外的应用执行转屏操作。
在一个可能的实现方式中,在检测到通过第一界面打开第二应用的第二界面的操作,且确定第二界面的预设窗口方向与所述电子设备的持握方向不同时,以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变包括:通过activity活动管理器获取第二应用的第二界面的预设窗口方向,当预设窗口方向与电子设备的持握方向不同时,activity活动管理器触发转屏模块对第一目标应用对应的显示窗口进行转屏操作。
进一步地,activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作包括:根据第二界面的预设窗口方向,调整第一目标应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一目标应用对应的显示窗口的窗口方向与第二界面的预设窗口方向相同。
在一个可能的实现方式中,当activity活动管理器触发转屏模块对第一目标应用对应的显示窗口进行转屏操作以后,该方法还包括:activity活动管理器向第一目标应用发送资源更新事件,以触发第一目标应用根据所述资源更新事件刷新第一目标应用对应的窗口布局。
在一个可能的实现方式中,第一目标应用还包括允许弹出提示窗口的后台应用。
在一个可能的实现方式中,第一应用为桌面应用。
在一个可能的实现方式中,在以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后,该方法还包括:在检测到关闭第二应用的操作时,显示所示第一应用的第一界面;其中,第一应用的第一界面的窗口显示方向与电子设备的持握方向相同。
第二方面,本申请实施例提供了一种转屏控制方法,可以应用于具有显示屏的电子设备上,该方法包括:显示第一应用的第一界面,其中第一界面的窗口方向与电子设备的持握方向相同;在检测到通过第一应用的第一界面打开第一应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,以第二界面的预设窗口方向显示所述第二界面;在检测到用户关闭所述第二界面的操作时,获取第一界面的窗口方向,并以第一界面的窗口方向显示所述第一界面。
也就是说,本申请实施例提供的转屏控制方法,主要针对的是同一个应用之间的显示界面的切换。当在关闭第一应用的第二界面时,需要寻找到下一个需要显示的窗口即第一应用的第一界面的显示窗口,并确保第一应用的第二界面关闭以后第一应用的第一界面为最终的显示状态,提高了用户的体验感。
在一个可能的实现方式中,在检测到用户关闭所述第二界面的操作时,获取第一界面的窗口方向,并以第一界面的窗口方向显示第一界面包括:当activity活动管理器检测到用户关闭第二界面的操作时,该activity活动管理器获取第一界面的窗口方向,确定第一界面的窗口方向与电子设备的持握方向是否相同;基于第一界面的窗口方向与电子设 备的持握方向不同,该activity活动管理器通知转屏模块对第一应用的显示窗口进行转屏操作,且不显示转屏动效。
进一步地,activity活动管理器通知转屏模块对所述第一应用的显示窗口进行转屏操作包括:根据第一界面的窗口方向,调整第一应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一应用对应的显示窗口的窗口方向与第一界面的预设窗口方向相同。
也就是说,在关闭第一应用的的第二界面之前,需要对下一个需要显示的界面(即第一应用的第一界面)的窗口方向进行判断,确定是否需要对其进行转屏操作。当需要执行转屏操作时,对第一应用的显示窗口进行转屏操作,但不显示转屏动效,使得用户对该转屏过程无感知,提高了用户的操作体验。
在一个可能的实现方式中,当转屏模块对所述第一应用的显示窗口进行转屏操作以后,activity活动管理器关闭第二界面的显示窗口并显示关闭动效,显示第一界面的显示窗口,并显示启动动效。
也就是说,将针对下一个需要显示的窗口的转屏决策流程和当前窗口的关闭动效同时执行,确保第一应用的第二界面关闭以后第一应用的第一界面已经更新为最终状态,提高了用户的体验感。
第三方面,本申请实施例提供了一种转屏控制装置,包括:显示单元,用于显示第一应用的第一界面,其中第一界面的窗口方向与所述电子设备的持握方向相同;
处理单元,用于在检测到通过第一界面打开第二应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,触发显示单元以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变,其中第一目标应用包括第二应用,第二目标应用包括第一应用。
在一个可能的实现方式中,所述处理单元还用于:在检测到电子设备的持握方向发生改变时,确定第一目标应用的窗口显示方向与电子设备的当前持握方向是否相同;基于第一目标应用的窗口显示方向与电子设备的当前持握方向相同,更新电子设备上除第一目标应用以外的其他应用的窗口方向,以使除第一目标应用以外的其他应用的窗口方向与该电子设备的当前持握方向相同;基于第一目标应用的窗口显示方向与电子设备的当前持握方向不同,电子设备上的每一个应用的窗口方向,以使电子设备上的每一个应用的窗口方向与电子设备的当前持握方向相同。
在一个可能的实现方式中,在检测到通过第一界面打开第二应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变包括:通过activity活动管理器获取第二应用的第二界面的预设窗口方向,当预设窗口方向与电子设备的持握方向不同时,所述activity活动管理器触发转屏模块对第一目标应用对应的显示窗口进行转屏操作。
进一步地,activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作包括:根据第二界面的预设窗口方向,调整第一目标应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一目标应用对应的显示窗口的窗口方向 与所述第二界面的预设窗口方向相同。
在一个可能的实现方式中,当activity活动管理器触发转屏模块对第一目标应用对应的显示窗口进行转屏操作以后,还包括:activity活动管理器向第一目标应用发送资源更新事件,以触发第一目标应用根据该资源更新事件刷新所述第一目标应用对应的窗口布局。
在一个可能的实现方式中,第一目标应用还包括允许弹出提示窗口的后台应用。
在一个可能的实现方式中,第一应用为桌面应用。
在一个可能的实现方式中,在显示单元以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后,该处理单元还用于:在检测到关闭第二应用的操作时,触发显示单元显示第一应用的第一界面,其中第一应用的第一界面的窗口显示方向与电子设备的持握方向相同。
第四方面,本申请实施例提供了一种转屏控制装置,包括:显示单元,用于显示第一应用的第一界面,第一界面的窗口方向与电子设备的持握方向相同;
处理单元,用于在检测到通过第一应用的第一界面打开第一应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,触发显示单元以第二界面的预设窗口方向显示第二界面;在检测到用户关闭第二界面的操作时,获取第一界面的窗口方向,并触发显示单元以第一界面的窗口方向显示第一界面。
在一个可能的实现方式中,在检测到用户关闭第二界面的操作时,获取第一界面的窗口方向,并以第一界面的窗口方向显示第一界面包括:当所述activity活动管理器检测到用户关闭第二界面的操作时,activity活动管理器获取第一界面的窗口方向,确定第一界面的窗口方向与电子设备的持握方向是否相同;基于第一界面的窗口方向与电子设备的持握方向不同,activity活动管理器通知转屏模块对第一应用的显示窗口进行转屏操作,且不显示转屏动效。
进一步地,activity活动管理器通知转屏模块对所述第一应用的显示窗口进行转屏操作包括:根据第一界面的窗口方向,调整第一应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一应用对应的显示窗口的窗口方向与第一界面的预设窗口方向相同。
在一个可能的实现方式中,当转屏模块对所述第一应用的显示窗口进行转屏操作以后,activity活动管理器关闭第二界面的显示窗口并显示关闭动效,显示第一界面的显示窗口,并显示启动动效。
第五方面,本申请实施例提供了一种电子设备,包含第三方面或第四方面中所提供的装置。
第六方面,本申请实施例提供了一种计算机存储介质,计算机存储介质中存储有指令,当指令在计算机上运行时,使得计算机执行第一方面中所提供的方法,或者执行第二方面中所提供的方法。
第七方面,本申请实施例提供了一种包含指令的计算机产品,当指令在计算机上运行时,使得所述计算机执行第一方面中所提供的方法,或者执行第二方面中所提供的方法。
附图说明
图1为本申请实施例提供的一种应用场景示意图;
图2为本申请实施例提供的一种电子设备的硬件结构示意图;
图3为本申请实施例提供的一种电子设备中操作系统的架构示意图;
图4a为本申请实施例提供的一种电子设备上的显示界面示意图;
图4b为本申请实施例提供的又一种电子设备上的显示界面示意图;
图4c为本申请实施例提供的又一种电子设备上的显示界面示意图;
图5为本申请实施例提供的一种转屏控制方法的流程示意图;
图6a为本申请实施例提供的一种电子设备上的显示界面示意图;
图6b为本申请实施例提供的又一种电子设备上的显示界面示意图;
图7为本申请实施例提供的一种转屏控制方法的流程示意图;
图8为本申请实施例提供的一种转屏装的结构示意图;
图9为本申请实施例提供的又一种转屏装的结构示意图。
具体实施方式
为了使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图,对本申请实施例中的技术方案进行描述。
在本申请实施例中的描述中,“示例性的”、“例如”或者“举例来说”的任何实施例或设计方案不应该被理解为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”、“例如”或者“举例来说”等词旨在以具体方式呈现相关概念。
在本申请实施例的描述中,属于“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如A和/或B,可以表示:单独存在A,单独存在B,同时存在A和B这三种情况。另外,除非另有说明,术语“多个”的含义是指两个或两个以上。例如,多个系统是指两个或两个以上的系统,多个屏幕终端是指两个或两个以上的屏幕终端。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
图1是本申请实施例提供的一种应用场景示意图,如图1所示,当在电子设备100横屏持握的情况下从桌面(桌面既支持横屏显示也支持竖屏显示)打开一个不支持横屏显示的应用,这时电子设备上的屏幕显示内容会切换到竖屏。此时,若按下back键返回到桌面时,电子设备的显示屏上会先竖屏显示桌面,然后再转到横屏显示,使得用户的体验感较差。而在本申请实施例中,根据当前电子设备的物理持握状态,实现前台显示应用和后台应用转屏状态的差异化管理,使顶层应用返回时,下一个要显示的应用已是最终的显示状态,提高了切换场景的体验。
可以理解的是,本申请实施例中,电子设备可以为手机、平板电脑、数码相机、个人数字助理(personal digitalassistant,PDA)、可穿戴设备等。电子设备的示 例性实施例包括但不限于搭载iOS、android、Windows、鸿蒙系统(Harmony OS)或者其他操作系统的电子设备。上述电子设备也可以是其他电子设备,诸如具有触敏表面(例如触控面板)的膝上型计算机(laptop)等。本申请实施例对电子设备的类型不做具体限定。
图2是本申请实施例提供的一种电子设备的硬件结构示意图。如图2所示,该电子设备100可以包括处理器110,存储器120,显示屏130和传感器140。可以理解的是,本方案实施例示意的结构并不构成对电子设备100的具体限定。在本方案另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
其中,处理器110可以是通用处理器或者专用处理器。例如,处理器110可以包括中央处理器(central processing unit,CPU)和/或基带处理器。其中,基带处理器可以用于处理通信数据,CPU可以用于实现相应的控制和处理功能,执行软件程序,处理软件程序的数据。
存储器120上可以存有程序(也可以是指令或者代码),程序可被处理器110运行,使得处理器110执行本方案中描述的方法。可选地,该存储器120可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器120中直接调用,以避免了重复存取,减少了处理器110的等待时间,提高系统的效率。
显示屏130用于显示图像,视频等。显示屏130包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些示例中,电子设备100可以包括一个或多个显示屏130。在一个示例中,显示屏130可以用于显示应用程序的界面。
传感器140可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,环境光传感器,骨传导传感器等。
在本方案中,传感器140也可以包括,重力传感器和触摸传感器。重力传感器可以用于检测电子设备的持握方向是否发生改变。具体地,通过重力传感器可以测量由于重力引起的加速度改变,可以计算出电子设备相对于水平面的倾斜角度,进而判断电子设备的持握方向是否发生改变。
触摸传感器可以用于检测作用于其上或附近的触摸操作。其中,触摸传感器可以采集用户在其上或附近的触摸事件(如用户使用手指、触控笔等任何适合的物体在触摸传感器表面上的操作),并将采集到的触摸信息发送给其他器件,如处理器110等。在一个可能的示例中,触摸传感器将从电子设备100的显示屏幕上采集到的触摸事件发送给处理器110,以使处理器110可以根据该触摸事件判断电子设备100的显示屏 幕上的显示界面是否发生了切换。
示例性的,触摸传感器可采用电阻式,电容式,红外线以及表面声波等多种方式实现。触摸传感器可以设置于显示屏130,由触摸传感器与显示屏130组成触摸屏,也称“触控屏”;或者,触摸传感器和显示屏130可作为两个独立的部件来实现电子设备100的输入和输出功能。
可以理解的是,上述电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本方案以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图3是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。其中,华为自研发的移动终端操作系统也可以参考该结构。
1、应用层
应用层可以包括一系列应用程序包。如图3所示,应用程序包可以包括生活、视频、地图、购物、图库、日历、通话、导航、音乐等应用程序(application,APP)。
2、应用程序框架层
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图3所示,应用程序框架层可以包括Activity活动管理器、Window窗口显示管理器、应用资源管理器、转屏模块等。
Activity活动管理器用于负责Activity组件的管理,主要工作包括Activity启动管理、状态管理、生命周期管理等。
Window窗口显示管理器用于负责窗口的显示管理,主要工作包括窗口显示层级、窗口显示坐标、窗口显示动效等。
应用资源管理器用于负责应用资源的管理,管理应用加载的资源、向应用更新屏幕宽高、density等资源信息,并在应用的窗口发生变化时向应用发送资源更新的回调,让应用及时根据新的窗口信息刷新布局。
转屏模块用于负责系统的转屏管理,负责监听sensor事件,实现转屏决策管理、转屏动效执行、转屏通知等。
3、Android Runtime和系统库
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。
4、内核层
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
以下实施例中所涉及的技术方案均可以在具有上述硬件架构和软件架构的电子设备100中实现。
下面以电子设备100是平板为例,结合附图对本申请提供的技术方案进行详细说明。
如4a所示,在横屏持握的平板上以横屏显示的方式显示桌面应用,使得平板的显示屏幕上可以显示多个应用的图标,用户通过触发某一个应用的图标可以打开该应用的显示界面。例如,当用户通过手指点击桌面上的视频应用时,则平板响应于用户点击操作,判断视频应用的初始界面的预设窗口方向与平板的当前持握方向是否相同。当视频应用的初始界面的窗口方向与平板的当前持握方向不相同时,如视频应用的初始界面预设窗口方向为竖屏方向,而平板的当前持握方向为横屏方向,显示如图4b所示的界面,但同时需要保持桌面应用的预设窗口方向不变。
在图4b所示的平板显示的界面中,平板的持握方向为横屏方向,在平板的显示屏幕上所显示的视频应用的初始界面的窗口显示方向为竖屏方向。当用户在如图4b所示的平板显示界面中输入预先设定的退出当前界面的操作指令,例如,点击屏幕上的返回按钮或者在屏幕上以一定的方向滑动,则平板响应于检测得到的用户输入的指令,直接返回到如图4a所示的桌面应用显示界面。
进一步地,针对如图4b所示的平板显示界面,当用户将横屏持握的平板转换为如图4c所示的竖屏持握时,由于图4b中所示的平板的显示界面中显示的视频应用的初始界面已经是竖屏显示了,所以在将平板从横屏持握状态转换为竖屏持握状态时,平板显示屏幕上显示的视频应用的初始界面的窗口方向不发生改变。进一步地,在如图4b所示平板显示界面中,在以竖屏的窗口显示方向显示视频应用的初始界面时,除该视频应用以外的其他应用(包括桌面应用)的预设窗口方向并未改变,即在如图4b所示的平板显示界面中,除视频应用以外的其他应用的预设窗口方向仍然是横屏显示的。因此,再将平板从如图4b所示的横屏持握状态转换为如图4c所示的竖屏持握状态时,需要将除视频应用以外的其他应用的预设窗口方向更新为横屏方向。
接下来,结合图5,以横屏持握场景为例,对本申请实施例提供的转屏控制方法 进行说明,包括:
步骤S501,响应于用户在横屏显示的桌面应用中打开华为视频的初始界面的操作指令,activity活动管理器获取华为视频的初始界面的预设窗口方向,当获取的预设窗口方向与平板的持握方向不同时,activity活动管理器触发转屏模块对包括华为视频在内的第一目标应用对应的显示窗口进行转屏操作。
在本申请实施例中平板的持握方向包括:竖屏方向、反竖屏方向、横屏方向、反横屏方向。在确定平板的当前持握方向时,可以根据平板中安装的重力传感器来获取当前平板的持握方向。
预设窗口方向是指需要打开的窗口所期望的显示方向。具体地,每一个显示窗口都对应了一个默认显示方向和动态显示方向。其中,动态显示方向的优先级高于默认显示方向的优先级。即,当用户打开一个新的显示窗口时,如果该窗口设置了动态显示方向,则将当前需要动态显示的方向作为预设窗口方向,如果该窗口没有设置动态显示方向,则将该窗口的默认显示方向作为预设窗口方向。
第一目标应用是指在当前的平板的显示界面上具有显示图层的应用,如状态栏、其他悬浮窗、其他分屏应用等。进一步地,第一目标应用还可以是由系统侧进行自行配置。具体地,可以是由系统侧进行白名单预设。
步骤S502,转屏模块对第一目标应用的显示窗口执行转屏操作并向activity活动管理器发送转屏通知。
在一个示例中,第一目标应用可以是由activity活动管理器确定的,activity活动管理器在触发转屏模块进行转屏操作时,可以同步将需要进行转屏操作的第一目标应用的信息发送给转屏模块。也可以是,由转屏模块在执行转屏操作之前自己确定需要进行转屏操作的第一目标应用。
转屏模块在对第一目标应用的显示窗口执行转屏操作前,首先需要获取第一目标用中各应用对应的显示窗口的大小信息即长度信息和宽度信息以及各显示窗口内显示内容的方向信息,然后将各显示窗口的长度信息和宽度信息进行互换,并将调整各应用的显示窗口内显示内容的方向与各应用的显示窗口的预设方向相同。
转屏模块在执行完转屏操作的同时,向activity活动管理器发送转屏通知,该转屏通知用于触发activity活动管理器进行后续的转屏操作。
进一步地,activity活动管理器接收到转屏模块的转屏通知以后,只向需要进行转屏操作的第一目标应用发送转屏广播。
步骤S503,activity活动管理器向window窗口信息管理器发送转屏指令,使得第一目标应用对应的显示窗口以竖屏显示。
Activity活动管理器在向第一目标应用发送转屏广播以后,还需要向Window窗口显示管理器发送转屏指令,使得新打开的应用的显示界面可以以竖屏的方式进行显示。
步骤S504,activity活动管理器向应用资源管理器发送更新指令,使得应用资源管理器对第一目标应用的资源信息进行更新,并在更新完成以后向第一目标应用发送资源更新回调指令。
Activity活动管理器向应用资源管理器发送的更新指令中包括了第一目标应用 的资源更新事件,以使应用资源管理器只对第一目标应用的资源信息进行更新。
其中,第一目标应用中的每一个应用都对应了一个资源更新事件。每个资源更新事件包括需要更新的应用的宽度信息、高度信息、方向信息和display的相关信息。如果应用资源管理器不能接收到这些事件,就不会主动触发需要更新的应用的显示窗口上的布局刷新。
需要说明的是,在步骤S503和步骤S504之间是不存在先后顺序的,可以是同时执行,也可以是步骤S503先执行,或者步骤S504先执行。
在本申请实施例中,针对跨应用之间的窗口的切换。当用户新打开的应用的预设窗口方向与当前电子设备的持握方向不相同时,只需要对新打开的应用以及在当前电子设备的显示界面具有显示图层的应用进行转屏处理。而继续保持其他应用的窗口显示方向与当前电子设备的持握方向相同,即除新打开的应用以及在当前电子设备的显示界面具有显示图层的应用以外的其他应用对转屏事件零感知。
进一步地,当电子设备中安装的重力传感器监听到电子设备的持握方向发生改变后,触发转屏模块进行转屏进行转屏操作。具体操作过程包括:
步骤S505,转屏模块获取当前电子设备的持握方向以及当前电子设备上所显示的应用的显示窗口方向,根据当前电子设备的持握方向以及当前电子设备上所显示的应用的显示窗口方向,进行转屏操作,并向activity活动管理器发送转屏通知,该转屏通知用于触发activity活动管理器进行后续的转屏操作。
转屏模块将获取的当前电子设备的持握方向与当前电子设备上所显示的应用的显示窗口方向进行比较。当当前电子设备上所显示的应用的显示窗口方向与电子设备的持握方向相同时,对除当前电子设备的上所显示的应用以及在当前电子设备的显示界面具有显示图层的应用以外的其他应用进行转屏操作。其中,转屏模块进行的转屏操作包括:对需要转屏的应用的显示窗口的长度信息和宽度信息进行互换,以及对显示窗口内的显示内容的方向进行调整,以使该显示窗口内显示内容的方向与当前电子设备的持握方向相同。
当前电子设备上所显示的应用的显示窗口方向与电子设备的持握方向不同时,转屏模块需要对当前电子设备上的所有应用进行转屏操作。
其中,转屏模块执行转屏操作和向activity活动管理器发送转屏通知这两个动作之间是不存在先后顺序的,可以是同时进行的。
步骤S506,activity活动管理器接收到转屏通知以后,根据接收到转屏通知确定当前电子设备上需要进行转屏的应用,并向需要转屏的应用发送转屏通知。
进一步地,activity活动管理器在接收到转屏通知以后,对当前电子设备上的应用的显示窗口进行判断,以确定需要进行转屏的应用,并对需要进行转屏的应用发送转屏广播。或者,activity活动管理器接收到转屏通知以后,从该转屏通知中获取当前电子设备上需要转屏的应用信息,并根据该转屏通知中携带的应用信息对需要转屏的应用发送转屏通知。
步骤S507:Activity活动管理器向应用资源管理器发送更新指令,使得应用资源管理器对除当前显示应用以及与当前显示应用相关的系统界面显示应用以外的其他应用的资源信息进行更新,并向对应的应用发送资源更新回调指令。
需要说明的是,本申请实施例以横屏持握场景为例,但并不仅限于横屏持握的场景,对于竖屏持握的场景同样适用。
在一个可能的实施例中,在以竖屏持握的平板的显示界面中打开一个视频应用,且打开的视频应用的第一界面如图6a所示。在如图6a所示的平板界面上打开选中的媒体文件的第一集视频进行播放,此时该视频应用跳转到如图6b所示的第二界面上。
在图6b所示的平板的显示界面中,平板的持握方向为竖屏方向,打开的第二界面的窗口方向为横屏方向。当用户在如图6b所示的平板显示界面中输入预先设定的退出当前界面的操作指令,例如,点击屏幕上的返回按钮或者在屏幕上以一定的方向滑动,则平板响应于检测得到的用户输入的指令,直接返回到如图6a所示的视频应用的第一界面。
其中,通过视频应用的第一界面打开视频应用的第二界面的过程包括:确定该视频应用的第二界面的窗口显示方向与当前平板的持握方向是否相同。当该第二界面的窗口显示方向与当前平板的持握方向不同时,对当前平板上的所有应用进行转屏操作。
接下来,结合图7,以竖屏持握场景为例,对本申请实施例中关闭视频应用的第二显示界面的过程进行说明,包括:
步骤S701,响应于用户关闭第二界面的操作指令,activity活动管理器获取第一界面对应的窗口方向,当获取的窗口方向与当前的电子设备的持握方向不同时,触发转屏模块对视频应用的显示窗口进行转屏操作,并向activity活动管理器发送转屏通知。
由于视频应用的第二界面是通过第一界面打开的,即在关闭第二界面的显示窗口时,下一个需要显示的窗口就是第一界面的显示窗口。
转屏模块执行转屏操作时,首先需要获取第一界面对应的窗口的预设窗口方向信息,并根据该预设窗口的方向信息,对第一界面的显示窗口的宽度信息和高度信息进行互换,以及对第一界面的显示窗口内的内容的方向进行调整,使得下一个需要显示的内容的方向与预设窗口的方向相同。
进一步地,转屏模块在对下一个需要显示的窗口执行转屏操作时,是不需要执行转屏动效的,这样使用户对转屏操作无感知。
步骤S702,activity活动管理器响应于接收到的转屏通知,向应用资源管理器发送更新指令,使得应用资源管理器更新电子设备上的所有应用的资源信息。
步骤S703,activity活动管理器触发window窗口显示管理器执行关闭第二界面的操作指令,并执行关闭动效,同时显示第一界面的显示窗口。
在本申请实施例中,针对同一个应用内的不同窗口之间的切换,在activity活动管理器执行窗口关闭之前,activity活动管理器会去寻找下一个需要显示的窗口,走转屏决策和执行流程,下一个需要显示的窗口的资源及状态在当前窗口关闭之前已经被更新为最终的方向。由于窗口执行关闭一般需要耗时,几百毫米不等,所以当窗口关闭时,用户看到的下一个需要显示的窗口已经是最终方向的显示状态了。将转屏决策流程和窗口关闭及动效同时执行,确保顶层窗口关闭后下一个需要显示的窗口的状态已经更新为最终状态。体验较为平滑。
需要说明的是,本申请实施例以竖屏持握场景为例,但并不仅限于竖屏持握的场景,对于横屏持握的场景同样适用。
基于上述实施例中的方法,本申请实施例还提供了一种转屏装置,其中,该转屏装置部署在具有显示屏的电子设备上。图8为本申请实施例提供的一种转屏装置的结构示意图,如图8所示,该转屏装置200包括:显示单元801、处理单元802。
显示单元801用于显示第一应用的第一界面,第一界面的窗口方向与电子设备的持握方向相同。
处理单元802用于在检测到通过第一界面打开第二应用的第二界面的操作,且确定第二界面的预设窗口方向与电子设备的持握方向不同时,触发显示单元801以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变。其中,第一目标应用包括第二应用,第二目标应用包括第一应用。
在一个可能的实施例中,可以通过activity活动管理器获取第二应用的第二界面的预设窗口方向,当获取的预设窗口方向与电子设备的持握方向不同时,activity活动管理器触发转屏模块对第一目标应用对应的显示窗口进行转屏操作。具体包括:根据第二界面的预设窗口方向,调整第一目标应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一目标应用对应的显示窗口的窗口方向与第二界面的预设窗口方向相同。
进一步地,当activity活动管理器触发转屏模块对第一目标应用对应的显示窗口进行转屏操作以后,activity活动管理器还需要向第一目标应用发送资源更新事件,以触发第一目标应用根据该资源更新事件刷新第一目标应用对应的窗口布局。
在一个可能的示例中,第一目标应用包括允许弹出提示窗口的后台应用。
在一个可能的示例中,第一应用为桌面应用。
在一个可能的实施例中,在显示单元以第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后。当处理单元802检测到电子设备的持握方向发生改变时,确定第一目标应用的窗口显示方向与当前电子设备的当前持握方向是否相同。
基于第一目标应用的窗口显示方向与当前电子设备的当前持握方向相同,更新电子设备上除第一目标应用以外的其他应用的窗口方向,以使除第一目标应用以外的其他应用的窗口方向与电子设备的当前持握方向相同。
基于第一目标应用的窗口显示方向与电子设备的当前持握方向不同,更新当前电子设备上的每一个应用的窗口方向,以使当前电子设备上的每一个应用的窗口方向与电子设备的当前持握方向相同。
在一个可能的实施例中,当检测到用户关闭第二应用的操作时,处理单元802触发显示单元801显示第一应用的第一界面,其中,第一应用的第一界面的窗口显示方向与所述电子设备的持握方向相同。
在本申请实施例中,如果应用的显示方向与当前电子设备的持握方向不一致时,只对包括设备当前显示应用的前台应用进行转屏处理。其他应用则继续保持横屏状态,对转屏事件零感知。当当前电子设备的持握方向发生改变时,如当前电子设备的持握方向由横屏持握变为竖屏持握时,才将其他处于横屏状态的应用的窗口显示方向更新为竖屏显示。在本申请实施例中,将前台显示应用和其他应用进行转屏独立控制,使得其他应用的窗口显 示方向和对应电子设备的持握方向始终保持一致。
基于上述实施例中的方法,本申请实施例还提供了一种转屏装置。图9为本申请实施例提供的一种转屏装置的结构示意图。如图9所示,该转屏装置300包括:显示单元901、处理单元902。
显示单元901用于显示第一应用的第一界面,其中第一界面的窗口方向与当前电子设备的持握方向相同。
处理单元902用于在检测到通过所述第一应用的第一界面打开第一应用的第二界面的操作,且确定第二界面的预设窗口方向与当前电子设备的持握方向不同时,触发显示单元901以第二界面的预设窗口方向显示第二界面。进一步地,处理单元902还用于在检测到用户关闭第二界面的操作时,获取第一界面的窗口方向,并触发显示单元901以第一界面的窗口方向显示第一界面。
在一个可能的实施例中,当通过activity活动管理器检测到用户关闭第二界面的操作时,获取下一个需要显示的界面为第一界面,并通过activity活动管理获取第一界面的窗口方向确定第一界面的窗口方向与当前电子设备的持握方向是否相同。基于第一界面的窗口方向与当前电子设备的持握方向不同,activity活动管理器通知转屏模块对第一应用的显示窗口进行转屏操作,且不显示转屏动效。
其中,转屏模块在对第一应用的显示窗口进行转屏操作包括:根据第一界面的窗口方向,调整第一应用的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一应用对应的显示窗口的窗口方向与第一界面的预设窗口方向相同。
当转屏模块完成对第一应用的显示窗口的转屏操作以后。Activity活动管理器关闭第二界面的显示窗口,并显示关闭动效,以及显示第一界面的显示窗口,并显示启动动效。
在本申请实施例中,在系统执行关闭顶层窗口的操作前,需要提前找到下一个需要显示的窗口,并根据下一个需要显示的窗口的预设窗口方向,执行转屏决策。如,当下一个需要显示的窗口的预设窗口方向与当前电子设备的持握方向不同时,则需要进行转屏操作。具体地,在执行转屏操作时,不需要执行转屏动效,只需向所有应用更新转屏通知、更新资源等,同时对顶层正在关闭的窗口,不做任何处理,包括转屏动效及转屏通知、资源刷新等动作,因为顶层窗口此时还没有关闭,所以不需要处理它。在执行完转屏操作以后,再移除需要关闭的顶层窗口,并显示关闭动效。在移除需要关闭的顶层窗口的同时显示新窗口的启动特效,此时,新窗口的显示状态已经为最终显示状态。
基于上述实施例中的装置,本申请实施例还提供了一种电子设备,该电子设备包含上述实施例中所提供的任一转屏装置。
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable rom,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、 寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。

Claims (27)

  1. 一种转屏控制方法,其特征在于,应用于具有显示屏的电子设备上,所述方法包括:
    显示第一应用的第一界面,所述第一界面的窗口方向与所述电子设备的持握方向相同;
    在检测到通过所述第一界面打开第二应用的第二界面的操作,且确定所述第二界面的预设窗口方向与所述电子设备的持握方向不同时,以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变,所述第一目标应用包括第二应用,所述第二目标应用包括第一应用。
  2. 根据权利要求1所述的方法,其特征在于,当以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后,所述方法还包括:
    在检测到所述电子设备的持握方向发生改变时,确定所述第一目标应用的窗口显示方向与所述电子设备的当前持握方向是否相同;
    基于所述第一目标应用的窗口显示方向与所述电子设备的当前持握方向相同,更新所述电子设备上除第一目标应用以外的其他应用的窗口方向,以使除第一目标应用以外的其他应用的窗口方向与所述电子设备的当前持握方向相同;
    基于所述第一目标应用的窗口显示方向与所述电子设备的当前持握方向不同,更新所述电子设备上的每一个应用的窗口方向,以使所述电子设备上的每一个应用的窗口方向与所述电子设备的当前持握方向相同。
  3. 根据权利要求1所述的方法,其特征在于,所述在检测到通过所述第一界面打开第二应用的第二界面的操作,且确定所述第二界面的预设窗口方向与所述电子设备的持握方向不同时,以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变包括:
    通过activity活动管理器获取所述第二应用的第二界面的预设窗口方向,当所述预设窗口方向与所述电子设备的持握方向不同时,所述activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作。
  4. 根据权利要求3所述的方法,其特征在于,所述activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作包括:
    根据所述第二界面的预设窗口方向,调整所述第一目标应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一目标应用对应的显示窗口的窗口方向与所述第二界面的预设窗口方向相同。
  5. 根据权利要求3所述的方法,其特征在于,当所述activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作以后,所述方法还包括:
    所述activity活动管理器向第一目标应用发送资源更新事件,以触发第一目标应用根据所述资源更新事件刷新所述第一目标应用对应的窗口布局。
  6. 根据权利要求1所述的方法,其特征在于,所述第一目标应用还包括允许弹出提示窗口的后台应用。
  7. 根据权利要求1所述的方法,其特征在于,所述第一应用为桌面应用。
  8. 根据权利要求1所述的方法,其特征在于,在以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后,所述方法还包括:
    在检测到关闭所述第二应用的操作时,显示所示第一应用的第一界面,所述第一应用 的第一界面的窗口显示方向与所述电子设备的持握方向相同。
  9. 一种转屏控制方法,其特征在于,应用于具有显示屏的电子设备上,所述方法包括:
    显示第一应用的第一界面,所述第一界面的窗口方向与所述电子设备的持握方向相同;
    在检测到通过所述第一应用的第一界面打开所述第一应用的第二界面的操作,且确定所述第二界面的预设窗口方向与所述电子设备的持握方向不同时,以所述第二界面的预设窗口方向显示所述第二界面;
    在检测到用户关闭所述第二界面的操作时,获取所述第一界面的窗口方向,并以所述第一界面的窗口方向显示所述第一界面。
  10. 根据权利要求9所述的方法,其特征在于,所述在检测到用户关闭所述第二界面的操作时,获取所述第一界面的窗口方向,并以所述第一界面的窗口方向显示所述第一界面包括:
    当所述activity活动管理器检测到用户关闭所述第二界面的操作时,所述activity活动管理器获取所述第一界面的窗口方向,确定所述第一界面的窗口方向与所述电子设备的持握方向是否相同;
    基于所述第一界面的窗口方向与所述电子设备的持握方向不同,所述activity活动管理器通知所述转屏模块对所述第一应用的显示窗口进行转屏操作,且不显示转屏动效。
  11. 根据权利要求10所述的方法,其特征在于,所述activity活动管理器通知所述转屏模块对所述第一应用的显示窗口进行转屏操作包括:
    根据所述第一界面的窗口方向,调整所述第一应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使所述第一应用对应的显示窗口的窗口方向与所述第一界面的预设窗口方向相同。
  12. 根据权利要求10所述的方法,其特征在于,当所述转屏模块对所述第一应用的显示窗口进行转屏操作以后,所述activity活动管理器关闭所述第二界面的显示窗口并显示关闭动效,显示第一界面的显示窗口,并显示启动动效。
  13. 一种转屏控制装置,其特征在于,包括:
    显示单元,用于显示第一应用的第一界面,所述第一界面的窗口方向与所述电子设备的持握方向相同;
    处理单元,用于在检测到通过所述第一界面打开第二应用的第二界面的操作,且确定所述第二界面的预设窗口方向与所述电子设备的持握方向不同时,触发所述显示单元以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变,所述第一目标应用包括第二应用,所述第二目标应用包括第一应用。
  14. 根据权利要求13所述的装置,其特征在于,所述处理单元还用于:
    在检测到所述电子设备的持握方向发生改变时,确定所述第一目标应用的窗口显示方向与所述电子设备的当前持握方向是否相同;
    基于所述第一目标应用的窗口显示方向与所述电子设备的当前持握方向相同,更新所述电子设备上除第一目标应用以外的其他应用的窗口方向,以使除第一目标应用以外的其他应用的窗口方向与所述电子设备的当前持握方向相同;
    基于所述第一目标应用的窗口显示方向与所述电子设备的当前持握方向不同,更新所述电子设备上的每一个应用的窗口方向,以使所述电子设备上的每一个应用的窗口方向与所述电子设备的当前持握方向相同。
  15. 根据权利要求13所述的装置,其特征在于,所述在检测到通过所述第一界面打开第二应用的第二界面的操作,且确定所述第二界面的预设窗口方向与所述电子设备的持握方向不同时,以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变包括:
    通过activity活动管理器获取所述第二应用的第二界面的预设窗口方向,当所述预设窗口方向与所述电子设备的持握方向不同时,所述activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作。
  16. 根据权利要求15所述的装置,其特征在于,所述activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作包括:
    根据所述第二界面的预设窗口方向,调整所述第一目标应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使第一目标应用对应的显示窗口的窗口方向与所述第二界面的预设窗口方向相同。
  17. 根据权利要求15所述的装置,其特征在于,当所述activity活动管理器触发转屏模块对所述第一目标应用对应的显示窗口进行转屏操作以后,还包括:
    所述activity活动管理器向第一目标应用发送资源更新事件,以触发第一目标应用根据所述资源更新事件刷新所述第一目标应用对应的窗口布局。
  18. 根据权利要求13所述的装置,其特征在于,所述第一目标应用还包括允许弹出提示窗口的后台应用。
  19. 根据权利要求13所述的装置,其特征在于,所述第一应用为桌面应用。
  20. 根据权利要求13所述的装置,其特征在于,在显示单元以所述第二界面的预设窗口方向显示第一目标应用的界面并保持第二目标应用的窗口方向不变以后,所述处理单元还用于:
    在检测到关闭所述第二应用的操作时,触发显示单元显示所述第一应用的第一界面,所述第一应用的第一界面的窗口显示方向与所述电子设备的持握方向相同。
  21. 一种转屏控制装置,其特征在于,包括:
    显示单元,用于显示第一应用的第一界面,所述第一界面的窗口方向与所述电子设备的持握方向相同;
    处理单元,用于在检测到通过所述第一应用的第一界面打开所述第一应用的第二界面的操作,且确定所述第二界面的预设窗口方向与所述电子设备的持握方向不同时,触发所述显示单元以所述第二界面的预设窗口方向显示所述第二界面;
    所述处理单元,还用于在检测到用户关闭所述第二界面的操作时,获取所述第一界面的窗口方向,并触发所述显示单元以所述第一界面的窗口方向显示所述第一界面。
  22. 根据权利要求21所述的装置,其特征在于,所述在检测到用户关闭所述第二界面的操作时,获取所述第一界面的窗口方向,并以所述第一界面的窗口方向显示所述第一界面包括:
    当所述activity活动管理器检测到用户关闭所述第二界面的操作时,所述activity活动管理器获取所述第一界面的窗口方向,确定所述第一界面的窗口方向与所述电子设备的持握方向是否相同;
    基于所述第一界面的窗口方向与所述电子设备的持握方向不同,所述activity活动管理器通知所述转屏模块对所述第一应用的显示窗口进行转屏操作,且不显示转屏动效。
  23. 根据权利要求22所述的装置,其特征在于,所述activity活动管理器通知所述转屏模块对所述第一应用的显示窗口进行转屏操作包括:
    根据所述第一界面的窗口方向,调整所述第一应用对应的显示窗口的宽度信息、高度信息和显示内容的方向信息,以使所述第一应用对应的显示窗口的窗口方向与所述第一界面的预设窗口方向相同。
  24. 根据权利要求22所述的装置,其特征在于,当所述转屏模块对所述第一应用的显示窗口进行转屏操作以后,所述activity活动管理器关闭所述第二界面的显示窗口并显示关闭动效,显示第一界面的显示窗口,并显示启动动效。
  25. 一种电子设备,其特征在于,包含权利要求13-20任一项所述的装置,或者包括权利要求21-24任一项所述的装置。
  26. 一种计算机存储介质,所述计算机存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行如权利要求1-8任一项所述的方法,或者执行如权利要求9-12任一项所述的方法。
  27. 一种包含指令的计算机产品,当所述指令在计算机上运行时,使得所述计算机执行如权利要求1-8任一项所述的方法,或者执行如权利要求9-12任一项所述的方法。
PCT/CN2022/100825 2021-07-05 2022-06-23 一种转屏控制方法、装置及电子设备 WO2023279980A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22836734.8A EP4345593A1 (en) 2021-07-05 2022-06-23 Screen rotation control method and apparatus, and electronic device
US18/402,391 US20240211122A1 (en) 2021-07-05 2024-01-02 Screen rotation control method and apparatus, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110758909.3A CN115639936A (zh) 2021-07-05 2021-07-05 一种转屏控制方法、装置及电子设备
CN202110758909.3 2021-07-05

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/402,391 Continuation US20240211122A1 (en) 2021-07-05 2024-01-02 Screen rotation control method and apparatus, and electronic device

Publications (1)

Publication Number Publication Date
WO2023279980A1 true WO2023279980A1 (zh) 2023-01-12

Family

ID=84800851

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100825 WO2023279980A1 (zh) 2021-07-05 2022-06-23 一种转屏控制方法、装置及电子设备

Country Status (4)

Country Link
US (1) US20240211122A1 (zh)
EP (1) EP4345593A1 (zh)
CN (1) CN115639936A (zh)
WO (1) WO2023279980A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009024A (zh) * 2023-09-12 2023-11-07 荣耀终端有限公司 显示方向的切换方法及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105359085A (zh) * 2013-07-02 2016-02-24 三星电子株式会社 电子装置和用于控制电子装置中的多个窗口的方法
CN108132747A (zh) * 2017-01-03 2018-06-08 中兴通讯股份有限公司 一种屏幕内容切换方法和双屏移动终端
CN110290269A (zh) * 2019-06-26 2019-09-27 努比亚技术有限公司 显示控制方法、移动终端及计算机可读存储介质
CN110851067A (zh) * 2019-10-29 2020-02-28 华为技术有限公司 屏幕显示模式的切换方法、装置及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105359085A (zh) * 2013-07-02 2016-02-24 三星电子株式会社 电子装置和用于控制电子装置中的多个窗口的方法
CN108132747A (zh) * 2017-01-03 2018-06-08 中兴通讯股份有限公司 一种屏幕内容切换方法和双屏移动终端
CN110290269A (zh) * 2019-06-26 2019-09-27 努比亚技术有限公司 显示控制方法、移动终端及计算机可读存储介质
CN110851067A (zh) * 2019-10-29 2020-02-28 华为技术有限公司 屏幕显示模式的切换方法、装置及电子设备

Also Published As

Publication number Publication date
CN115639936A (zh) 2023-01-24
EP4345593A1 (en) 2024-04-03
US20240211122A1 (en) 2024-06-27

Similar Documents

Publication Publication Date Title
US11281360B2 (en) Display management for native user experiences
US11334311B2 (en) Electronic device and method for sharing screen
WO2022052671A1 (zh) 一种显示窗口的方法、切换窗口的方法、电子设备和系统
KR102343361B1 (ko) 전자 기기 및 이의 웹 페이지 디스플레이 방법
US20240211122A1 (en) Screen rotation control method and apparatus, and electronic device
WO2023226455A1 (zh) 应用图标的显示方法、电子设备及可读存储介质
US20180196584A1 (en) Execution of multiple applications on a device
CN118276722A (zh) 窗口的显示方法和电子设备
WO2022017328A1 (zh) 一种电子设备的锁屏界面显示方法和电子设备
US20240077998A1 (en) Application compatibility on a computing device
US10250943B2 (en) Method, apparatus, and computer readable recording medium for automatic grouping and management of content in real-time
WO2023083218A1 (zh) 投屏中流畅显示画面的方法、相关装置及系统
WO2022242356A1 (zh) 界面显示方法和设备
US11061544B2 (en) Method and electronic device for processing input
WO2022252788A1 (zh) 一种控制方法及电子设备
WO2023284625A1 (zh) 应用的跨平台显示方法、可读介质和电子设备
WO2021073549A1 (zh) 转屏画面显示方法、装置、计算机设备和存储介质
WO2023030276A1 (zh) 一种显示方法、装置、设备及存储介质
US20230007103A1 (en) Content Obtaining Method and System, User Terminal, and Content Server
WO2024109220A1 (zh) 显示卡片的方法、电子设备及可读存储介质
WO2024046317A1 (zh) 一种内容显示方法及电子设备
WO2022242503A1 (zh) 投屏方法及相关装置
CN114416644A (zh) 电子设备和文件访问方法
CN117724780A (zh) 一种信息获取方法

Legal Events

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

Ref document number: 22836734

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022836734

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2022836734

Country of ref document: EP

Effective date: 20231229