WO2022188667A1 - Screen rotation processing method and apparatus, medium and electronic device - Google Patents

Screen rotation processing method and apparatus, medium and electronic device Download PDF

Info

Publication number
WO2022188667A1
WO2022188667A1 PCT/CN2022/078706 CN2022078706W WO2022188667A1 WO 2022188667 A1 WO2022188667 A1 WO 2022188667A1 CN 2022078706 W CN2022078706 W CN 2022078706W WO 2022188667 A1 WO2022188667 A1 WO 2022188667A1
Authority
WO
WIPO (PCT)
Prior art keywords
screen
rotation
electronic device
angle
display state
Prior art date
Application number
PCT/CN2022/078706
Other languages
French (fr)
Chinese (zh)
Inventor
朱登奎
丁泽奇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022188667A1 publication Critical patent/WO2022188667A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
    • 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
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • 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/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units

Definitions

  • the present application relates to the technical field of screen display, and in particular, to a method, device, medium and electronic device for processing screen rotation.
  • screen rotation that is, screen rotation
  • Vertical screen display that is, horizontal and vertical screen rotation
  • the screen rotation process for horizontal and vertical screen rotation of an electronic device is relatively fixed.
  • the main flow of the current screen rotation is: when the screen needs to be rotated to 60 degrees, the electronic device takes a screenshot of the original interface currently displayed on the screen, obtains the screenshot layer (Layer), and loads the screenshot image (ie Screenshot Layer), screen-turning animation, environment construction and other resources required for screen-turning to realize the screen-turning process of gradient rotation.
  • the user in the current horizontal and vertical screen rotation process, the user must rotate the electronic device to a sufficient angle (ie, 60 degrees) to trigger the electronic device to start the screen rotation process, that is, the electronic device will not start to load the screen rotation until the rotation angle is reached.
  • a sufficient angle ie, 60 degrees
  • the electronic device will not start to load the screen rotation until the rotation angle is reached.
  • the entire screen-turning process there are many screen-turning resources that need to be loaded, and there are many modules involved in interaction in the operating system, which makes the whole screen-turning process take a long time.
  • the screen-turning animation ie, motion effect
  • the user perceives that the dynamic effect of the process of switching the image picture before the screen transition to the image picture after the screen transition is completed is laggy and stiff, and is not natural and smooth enough.
  • the electronic device will immediately start the above screen rotation process, and there is no user remorse mechanism.
  • the embodiments of the present application provide a method, device, medium, and electronic device for screen rotation processing, which can improve the speed of screen rotation and avoid false triggering of the screen rotation process.
  • an embodiment of the present application provides a screen rotation processing method, which is applied to an electronic device, including: when the rotation angle of the screen of the electronic device reaches a first angle threshold (such as 45 degrees), preloading the screen rotation resources, in which the screen of the electronic device is in the first screen display state (such as the horizontal screen display state or the vertical screen display state); the rotation angle of the screen increases from the first angle threshold to the second angle threshold (such as 60°) within a preset time period. degree), the screen rotation operation is completed based on the screen rotation resources, and the screen is switched to the second screen display state after the screen rotation operation is completed. In this way, the quickness of the screen transfer can be improved, and the screen transfer process can be avoided by mistake.
  • a first angle threshold such as 45 degrees
  • preloading the screen rotation resources in which the screen of the electronic device is in the first screen display state (such as the horizontal screen display state or the vertical screen display state)
  • the rotation angle of the screen increases from the first angle threshold to the second angle threshold (such as 60°) within
  • the above-mentioned method further includes: if the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period, controlling the screen to remain in the first angle The screen is displayed, that is, the screen rotation operation is not started.
  • the above-mentioned method further includes: when the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period, deleting the preloaded screen rotation resources, that is, to perform the rollback operation described below.
  • the above-mentioned screen rotation resource includes at least one of the following: a screenshot image obtained by performing a screenshot operation on the target interface currently displayed on the screen; a screen rotation animation generated according to the screenshot image; Blocks the resources entered on the screen.
  • the layout of the interface displayed on the screen is the layout corresponding to the second screen display state; when the screen is switched to the second screen display state Before the screen display state, the layout of the interface displayed on the screen is the layout corresponding to the first screen display state. That is, the electronic device can adjust the layout of the content displayed on the screen during the screen rotation process.
  • preloading the screen rotation resource includes: acquiring a first Sensor event, and The event preloads the screen rotation resource; wherein, the first Sensor event is used to indicate that the rotation angle of the screen reaches the first angle threshold and is used to trigger the preload of the screen rotation resource.
  • the screen rotation operation is completed based on the screen rotation resources, including: Obtain the second Sensor event (that is, the 60-degree screen rotation event below), and complete the screen rotation operation based on the screen rotation resource according to the second Sensor event; wherein, the second Sensor event is used to indicate that the rotation angle of the screen is within the preset time period.
  • the first angle threshold is increased to the second angle threshold, and the screen rotation operation is triggered.
  • an embodiment of the present application provides a screen rotation processing device, which is applied to an electronic device, and includes: a loading module for preloading the screen rotation when the rotation angle of the screen of the electronic device reaches a first angle threshold.
  • the resource wherein the screen of the electronic device is in the first screen display state; the execution module is used for, when the rotation angle of the screen increases from the first angle threshold to the second angle threshold within a preset time period, based on the rotation loaded by the loading module.
  • the screen resource completes the screen rotation operation, and the screen switches to the second screen display state after the screen rotation operation is completed.
  • the execution module is further configured to control the screen to continue to be in a state where the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period.
  • the first screen shows the status.
  • the above execution module is further configured to delete the preloaded image file when the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period. Screen transfer resources.
  • the above screen rotation resource includes at least one of the following: a screenshot image obtained by performing a screenshot operation on the target interface currently displayed on the screen; a screen rotation animation generated according to the screenshot image; Blocks the resources entered on the screen.
  • the layout of the interface displayed on the screen is the layout corresponding to the second screen display state; when the screen is switched to the second screen display state Before the screen display state, the layout of the interface displayed on the screen is the layout corresponding to the first screen display state.
  • the execution module is specifically configured to acquire the first Sensor event, and preload the screen rotation resource according to the first Sensor event; wherein the first Sensor event is used to indicate the rotation of the screen The angle reaches the first angle threshold and is used to trigger the preloading of screen rotation resources.
  • the above-mentioned execution module is specifically configured to acquire the second Sensor event, and complete the screen-turning operation based on the screen-turning resource according to the second Sensor event; wherein, the second Sensor event is used to indicate The rotation angle of the screen is increased from the first angle threshold to the second angle threshold within a preset time period, and the screen rotation operation is triggered.
  • a readable medium is provided, and instructions are stored on the readable medium, and when the instructions are executed on an electronic device, the electronic device is caused to perform the screen rotation process described in the first aspect. method.
  • the implementation of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, It is used for executing the screen rotation processing method described in the first aspect.
  • Fig. 1 is a kind of schematic flowchart of a screen rotation processing method provided by the prior art
  • FIG. 2 shows a schematic structural diagram of an electronic device according to some embodiments of the present application
  • FIG. 3 is a schematic flowchart of a Sensor event reporting provided by the related art
  • FIG. 5 shows a schematic flowchart of a method for screen rotation processing according to some embodiments of the present application
  • FIG. 6 is a schematic diagram of screen display content in a process of screen rotation processing according to some embodiments of the present application.
  • Fig. 7 shows a schematic diagram of screen display content during a screen rotation process according to some embodiments of the present application
  • FIG. 8 shows a schematic structural diagram of an electronic device according to some embodiments of the present application.
  • FIG. 9 is a block diagram showing a software structure of an electronic device according to some embodiments of the present application.
  • Illustrative embodiments of the present application include, but are not limited to, screen rotation processing methods, apparatuses, and electronic devices.
  • the screen rotation resource when the electronic device detects that the rotation angle of the screen reaches a small first threshold (eg 45 degrees), the screen rotation resource can be preloaded instead of immediately switching the screen display state. Until the rotation angle of the screen continues to increase to a larger second threshold within the preset time period, the screen rotation operation is completed based on the preloaded screen rotation resources to switch the screen display state, such as switching the landscape display state to portrait. display state, or switch from the portrait display state to the landscape display state. If the rotation angle of the screen does not increase to the second threshold within the preset time period, the electronic device will not perform the screen rotation operation to switch the screen display state, and will delete the preloaded screen rotation resources. In this way, the quickness of the screen transfer can be improved, and the possibility of accidentally triggering the screen transfer can be avoided.
  • a small first threshold eg 45 degrees
  • the execution subject may be an electronic device, or, a central processing unit (Central Processing Unit, CPU) of the electronic device, or a function in the electronic device for executing the rotation A control module or device for screen processing (or referred to as a screen rotation processing device).
  • a central processing unit Central Processing Unit, CPU
  • a function in the electronic device for executing the rotation A control module or device for screen processing or referred to as a screen rotation processing device.
  • an electronic device is used as an execution subject to describe the screen rotation processing method provided by the embodiments of the present application.
  • electronic devices suitable for use in this application may include, but are not limited to, cell phones, tablet computers, video cameras, cameras, desktop computers, laptop computers, handheld computers, notebook computers, desktop computers, super mobile personal computers ( ultra-mobile personal computer, UMPC), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) ⁇ virtual reality (VR) devices, media players, smart TVs , smart speakers, smart watches, etc.
  • PDAs personal digital assistants
  • AR augmented reality
  • VR virtual reality
  • the electronic device provided by the present application is an electronic device having a screen and supporting screen rotation (ie, screen rotation).
  • the electronic device is a mobile phone as an example for description.
  • FIG. 2 it is a schematic diagram of the structure and composition of the electronic device provided by the present application.
  • the electronic device 100 in FIG. 2 includes an application layer 11 , a framework layer 12 , a native (Native) layer 13 and a hardware layer 14 .
  • the hardware layer 14 includes a sensor (Sensor) 141 for detecting Sensor parameters such as the rotation angle and rotation direction of the screen of the electronic device 100, namely Sensor events (or messages), and reporting the Sensor events to the Native layer 13.
  • Sensor 141 includes, but is not limited to, a gyroscope, an acceleration sensor (such as a gravitational acceleration sensor), and the like.
  • the rotation angle of the screen refers to: during the rotation of the electronic device, the plane on which the screen is located remains unchanged or the angle difference between different planes on which the screen is located is within a certain threshold range (such as 0-5 degrees). ), the rotation angle of the screen along the screen it is on.
  • the details of the rotation direction of the screen are similar to the description of the rotation angle, and are not repeated here.
  • the Native layer 13 which can also be called a service layer, includes a Sensorhub (sensor controller) 131 and a layer composition management service 132 .
  • the Sensorhub 131 is used to obtain the screen rotation angle collected by the Sensor 141, and determine whether the rotation angle reaches the threshold, and then report the Sensor event whose rotation angle reaches the threshold to the framework layer 12, so as to realize the notification of the horizontal and vertical screen rotation to the framework layer 12.
  • the first threshold or the second threshold eg, the first threshold is 45 degrees and the second threshold is 60 degrees.
  • the layer composition management service 132 can be used to obtain screenshot images from the framework layer 12, and generate screen transition resources such as screen transition animations based on the screenshot images.
  • the framework layer 12 includes a Sensor management service 121 , a window management service 122 and a screen rotation module (screen rotation animation) 123 .
  • the sensor management service 121 is used to obtain the message notifying the horizontal and vertical screen rotation reported by the Native layer 13, and report the Sensor event to the window management service 122 according to the message, that is, reporting the message notifying the horizontal and vertical screen rotation.
  • the window management service 122 is used to send the message of starting the screen rotation to the screen rotation module 123 according to the message obtained from the Sensor management service 121 to notify the horizontal and vertical screen rotation, and to report to the system user interface (System UI) 111 in the application layer 11. Notify the message of horizontal and vertical screen rotation, and receive the message of ending the screen rotation animation feedback from System UI 111.
  • System UI system user interface
  • the screen-turning module 123 is configured to run the process corresponding to the screen-turning animation according to the message of starting the screen-turning, and the process includes actions such as taking screenshots, loading the screen-turning animation (ie, animation resources), and temporarily blocking screen input.
  • the screen transition module 123 is configured to send the screenshot obtained by the screenshot to the layer composition management service 132 in the Native layer 13 , and obtain the screen transition animation corresponding to the screen capture image from the layer composition management service 132 .
  • the application layer 11 includes a System UI 111 and a launch layer (Launcher) 112 .
  • the System UI 111 is used to rearrange the interface of the application program running when the horizontal and vertical screen is rotated according to the message obtained from the window management service 122 to notify the horizontal and vertical screen rotation, and is also used to rotate the interface of the application program in the horizontal and vertical screens.
  • a message for ending the screen-turning animation is sent to the window management service 122 to instruct the window management service 122 to end the current flow of horizontal and vertical screen rotation.
  • Launcher 112 is a system desktop launcher, used to trigger the display of a desktop interface on the screen, such as a main interface or a negative one-screen interface including one or more application images.
  • this application mainly takes the interface of the System UI 111 adjusting the application program when the horizontal and vertical screens are rotated as an example for description.
  • the Launcher 112 adjusting the desktop interface when the horizontal and vertical screens are rotated please refer to the relevant description of the System UI 111 adjusting interface. The embodiment of the present application This will not be repeated here.
  • the Sensorhub 131 in the Native layer 13 of the electronic device 100 reports the Sensor event whose screen rotation angle is 60 degrees to the window management service 122 in the framework layer 12, and immediately triggers the window management service 122 directly starts the process corresponding to the screen transition animation to perform horizontal and vertical screen conversion. That is, in the prior art, as long as the rotation angle of the screen is 60 degrees, the horizontal and vertical screen rotation will be triggered immediately, and the user does not have a back-off mechanism, which may easily cause the user to mistakenly trigger the screen rotation process of the electronic device.
  • the present application realizes the preprocessing screen transition process by adding the Sensor event corresponding to the reported rotation angle, so as to divide the screen transition process into the stages of preprocessing (that is, preloading the screen transition resources) and The stage in which the screen rotation operation is actually performed, and the staged screen rotation processing flow is realized.
  • the Sensor event reported by the Sensorhub 131 when the rotation angle of the screen is 45 degrees is a 45 degree pre-screen rotation event, and an increase in the screen When the rotation angle is 60 degrees, a 60-degree screen rotation event is reported.
  • there is a preset timing duration between the Sensorhub 131 reporting the 45-degree pre-screen rotation event and the 60-degree screen rotation event for example, the duration time1 shown in FIG. 4 .
  • an identification information is added in the Sensor event (Sensor parameter) reported by Sensorhub 131 to identify the 45-degree pre-rotation screen, and this Sensor event can be called a 45-degree pre-rotation screen at this time. event.
  • the 45-degree pre-rotation screen event is used to trigger the electronic device 100 to preload the screen-rotation resource when the screen rotation angle is 45 degrees, but the screen-rotation operation of rotating the screen is not performed immediately.
  • another identification information can be added to the Sensor event reported by Sensorhub 131 to identify the 60-degree screen rotation. At this time, the Sensor event can be called a 60-degree screen rotation event.
  • the 60-degree screen rotation event is used to trigger the electronic device 100 to start performing a screen rotation operation of rotating the screen when the rotation angle of the screen is 60 degrees.
  • the window management service 122 adds pre-screenshot and timeout rollback process functions, and provides it to the screen rotation animation (ie, the screen rotation module) 123 to call.
  • the screen rotation module 123 when it receives a 45-degree screen rotation event, it calls the pre-screenshot and timeout rollback process functions in the window management service 122 to preload the screen rotation resources and start the Thread is used for timeout rollback.
  • the screen-turning rotation animation that is, the screen-turning module
  • the screen-turning rotation animation 123 can call this function to first perform a screenshot operation on the interface currently displayed on the screen to obtain a screenshot image, and send the screenshot image to the layer composition management service 132 to obtain the screen-turning animation, but Screen-turning animation resources such as screen-turning animation (that is, screen-turning rotation animation) will not be run immediately.
  • the time-out rollback process refers to: starting a preset timer, and when the timer expires, the screen-turning module 123 cancels the screen-turning process, and deletes the preloaded screen-turning resources, that is, reverse screen-turning
  • the process performs a rollback operation.
  • the timing duration of the preset timer is the above-mentioned predetermined timing duration.
  • a rollback flag may be set in the screen rotation module 123, and the rollback flag may be modified when the screen rotation module 123 starts the timeout rollback process, such as changing the value of the rollback flag from 0 to 1 , indicating that the current screen rotation module 123 has pre-screened to obtain a screenshot image and enabled the timeout rollback process.
  • the window management service 122 when a 60-degree screen-turn event is received in the screen-turning module, the window management service 122 is called to execute the formal screen-turning process, and the window management service 122 interprets if there is a screenshot image obtained by the pre-screenshot operation, Then skip the screenshot process and control the restoration of the screenshot flag, for example, restore the value of the screenshot flag from 1 to 0.
  • the window management service 122 is called to execute the screen-turning state return. Scroll the process to keep the current landscape display state or portrait display state unchanged.
  • the screens shown in (a)-(d) in FIG. 6 are respectively a forward portrait display state, a forward landscape display state, a reverse portrait display state and a reverse landscape display state.
  • the rotation directions of the screens shown in FIG. 6 are all counterclockwise. It can be understood that, the screen shown in (a)-(d) of FIG. 6 may be continuously rotated in the counterclockwise direction, so that the rotation angle of the screen increases sequentially. Assuming that the state of the screen shown in (a) in FIG. 6 is the initial screen display state before the screen is rotated, that is, the rotation angle ⁇ 1 of the screen shown in (a) in FIG.
  • the The screens in (b)-(d) show that the rotation angles ⁇ 2, ⁇ 3 and ⁇ 4 of the screen are 90 degrees, 180 degrees and 270 degrees, respectively.
  • the user can trigger the screen of the electronic device 100 to rotate in a clockwise direction, for example, the state of the screen shown in (d) in FIG.
  • the screen display states shown in sequence (c), (b), and (a) in FIG. 6 can be obtained in sequence.
  • the coordinate plane XOY in FIG. 6 is used to represent the plane on which the screen of the electronic device 100 is located, and the straight line M is the horizontal central axis of the screen.
  • the rotation angle of the screen can be represented by the angle between the positive direction (ie the arrow direction) of the coordinate axis Y in the coordinate plane XOY shown in FIG. 6 and the positive direction (ie the arrow direction) of the straight line M, but is not limited to this.
  • the screen rotation processing method provided in the embodiment of the present application may be described by taking the screen rotation processing process between two adjacent screen display states in FIG. 6 as an example.
  • the screen rotation process between two adjacent screen display states specifically includes the electronic device 100 performing a pre-screen rotation process when the rotation angle increases from 0 degrees to 45 degrees, and the electronic device 100 when the rotation angle increases from 45 degrees to 60 degrees.
  • the screen transition process is officially started. It can be understood that when the rotation angle is 0 to 60 degrees, the electronic device 100 controls the screen to maintain the initial screen display state before the screen rotation; after the rotation angle is greater than 60 degrees, the electronic device 100 controls the screen to start the screen rotation process, and the screen is rotated. After the screen process is executed, switch the screen display state.
  • the forward vertical screen display state of the screen shown in (a) in FIG. 6 is the initial state before the screen is rotated, and the user controls the screen rotation of the electronic device 100 in the counterclockwise direction to obtain FIG. 6
  • the screen transition processing method provided by the embodiments of the present application is described by taking the screen transition processing process between the forward and horizontal screen display states of the screen shown in (b) as an example.
  • the forward vertical screen display state of the screen shown in (a) in FIG. 7 is the initial screen display state before the screen is rotated, that is, in FIG. 7
  • the rotation angle ⁇ 1 of the screen shown in (a) is 0 degrees.
  • the user triggers the screen in the electronic device 100 to rotate in a counterclockwise direction, so that the rotation angle continues to increase.
  • the rotation angles ⁇ 2 and ⁇ 3 of the screen of the electronic device 100 are 45 degrees and 60 degrees, respectively, and the display states of the screens are kept in the forward portrait display state. Subsequently, as shown in (d) of FIG.
  • the display state of the screen of the electronic device 100 is switched to the forward landscape display state.
  • the content in the interface displayed on the screen also changes. For example, as shown in FIG. 6( a ), the interface of the application 1 is displayed in the forward portrait display state, and the screen shown in FIG. 6( b ) is displayed in the forward landscape display state.
  • the interface of application 1 is displayed, the layout of the two interfaces on the screen is different.
  • FIG. 5 a schematic flowchart of a method for screen rotation processing provided by an embodiment of the present application, the method includes:
  • Step 501 The electronic device 100 recognizes the rotation of the screen through the Sensor 141 in the hardware layer 14.
  • the Sensor 141 can detect parameters such as the rotation angle of the screen.
  • the above-mentioned Sensor event may further include the rotation direction of the screen, so as to determine which direction the electronic device 100 needs to rotate the screen to, such as a clockwise direction or a counterclockwise direction.
  • Step 502 The electronic device 100 generates a 45-degree Sensor event when the sensor 141 detects that the rotation angle of the screen reaches 45 degrees, and the 45-degree Sensor event includes pre-rotation screen identification information for identifying the process of the 45-degree pre-rotation screen.
  • the rotation angle detected in step 502 includes, but is not limited to, 45 degrees, and may also be any smaller angle, such as 43 degrees or 47 degrees, which is not specifically limited in this embodiment of the present application.
  • step 502 when the sensor 141 detects that the rotation angle of the screen is less than 45 degrees, that is, when the rotation angle is between 0 and 45 degrees, the electronic device 100 will not generate the sensor 141 in the hardware layer 14. The Sensor event, or the Sensor event is not reported to the Native layer 13 even though the Sensor event is generated.
  • Step 503 The electronic device 100 reports the 45-degree Sensor event to the Sensorhub 131 in the Native layer 13 through the Sensor 141, so as to realize the process that the hardware layer 14 notifies the Native layer 13 of horizontal and vertical screen rotation.
  • Step 504 The electronic device 100 reports the 45-degree Sensor event to the sensor management service 121 in the framework layer 12 through the Sensorhub 131 in the Native layer 13, so as to realize the process that the Native layer 13 notifies the framework layer 12 of horizontal and vertical screen rotation.
  • Step 505 The electronic device 100 reports the 45-degree sensor event to the window management service 122 through the sensor management service 121 in the framework layer 12, so as to realize the process of notifying the horizontal and vertical screen rotation.
  • Step 506 The electronic device 100 sends a message of pre-screen rotation to the screen rotation module 123 through the window management service 122 in the framework layer 12 according to the 45-degree Sensor event, instructing the screen rotation module 123 to start the process of preloading the screen rotation resources.
  • process of pre-screen rotation refers to the process of preloading screen rotation resources.
  • the window management service 122 when the window management service 122 receives the 45-degree Sensor event, it learns the identification information of the pre-rotation screen in the 45-degree Sensor event, so as to start the process of performing the pre-rotation screen, such as pre-screening, instead of immediately Start turning the screen.
  • Step 507 The electronic device 100 calls the pre-screenshot and timeout rollback process functions in the window management service 122 through the screen rotation module 123 in the framework layer 12 , takes a screenshot of the interface currently displayed on the screen to obtain a screenshot image, and enables the screen rotation The thread that times out rolls back the process.
  • the rollback flag bit corresponding to the timeout rollback process function can be modified, for example, the value of the flag bit is changed from 0 to 1.
  • the timing duration time1 of the screen-turning timeout rollback process is a preset timing duration, such as 500ms (milliseconds).
  • the timeout in the above-mentioned screen transition timeout rollback process refers to that the timing duration exceeds the timing duration time1.
  • Step 508 The electronic device 100 sends the screenshot image to the layer composition management service 132 in the Native layer 13 through the screen rotation module 123 in the framework layer 12 .
  • Step 509 The electronic device 100 generates a screen transition animation corresponding to the acquired screenshot image through the layer composition management service 132 in the Native layer 13 , and sends the generated screen transition animation to the screen transition module 123 .
  • Step 510 The electronic device 100 preloads the acquired screen rotation animation through the screen rotation module 123 in the framework layer 12 .
  • Step 511 The electronic device 100 judges through the window management service 122 whether a 60-degree Sensor event is received within the time period of the timeout rollback process, and the 60-degree Sensor event includes screen rotation identification information, which is used to indicate the process of 60-degree screen rotation .
  • the window management service 122 when the window management service 122 receives the 60-degree Sensor event, it can learn the screen-turning identification information in the 60-degree Sensor event, thereby triggering the process of starting the screen-turning, such as loading the screen-turning animation and temporarily shielding the screen. input, etc.
  • the electronic device 100 executes the following step 512 to start the formal screen rotation process; otherwise, if the 60-degree Sensor event is not received over time, the electronic device 100 Execute the following step 518 to cancel the screen rotation process.
  • the electronic device 100 receives the 60-degree Sensor event through the window management service 122, indicating that the user needs to rotate the screen, rather than triggering the screen rotation process by mistake.
  • the rotation angle determined to be received in step 511 includes, but is not limited to, 60 degrees, and may also be any larger angle, such as 59 degrees or 63 degrees, which is not specifically limited in this embodiment of the present application.
  • step 511 when the Sensor 141 detects that the rotation angle of the screen is less than 60 degrees, that is, when the rotation angle is between 45 and 60 degrees, the electronic device 100 will not pass the Sensor 141 in the hardware layer 14. A Sensor event is generated, or although a Sensor event is generated, the Sensor event is not reported to the Native layer 13 .
  • Step 512a The electronic device 100 sends a message for starting the screen rotation to the screen rotation module 123 in the framework layer 12 through the window management service 122.
  • Step 512b The electronic device 100 sends a message notifying the application rotation to the System UI 111 in the application layer 11 through the window management service 122.
  • steps 512a and 512b shown in FIG. 5 may be performed simultaneously. In some other implementation manners, the steps 512a and 512b may also be performed in other execution sequences, which will not be repeated here.
  • the rollback flag bit corresponding to the timeout rollback process function can be restored, for example, the value of the flag bit can be restored from 1 to 0.
  • the window management service 122 may determine whether there is a pre-screenshot screenshot image. If there is a screen shot image obtained by pre-screening, the screen shot process is skipped; otherwise, the screen transfer module 123 is triggered to perform a screen capture operation to obtain a screen shot image, and then a screen transfer animation is obtained.
  • Step 513 The electronic device 100 runs the screen-turning animation through the screen-turning module 123 in the framework layer 12 , and ends the thread used for the screen-turning timeout rollback process.
  • the screen-turning module 123 runs the screen-turning animation, which may specifically include operations such as displaying the screen-turning animation on the screen and temporarily blocking screen input.
  • Step 514 The electronic device 100 rearranges the interface of the currently running application program on the screen through the System UI 111 in the application layer 11 according to the screen display state after the screen is rotated.
  • Step 515 When the interface of the currently running application program is rearranged by the System UI 111 in the application layer 11, the electronic device 100 sends an end screen transition message to the window management service 122 in the framework layer 12 to indicate Finish running the transition animation.
  • the electronic device 100 can use the System UI 111 to modify the current running of the application 1.
  • Re-layout in the interface includes but not limited to adjusting the display direction and display size of the content such as text and pictures in the interface.
  • Step 516 The electronic device 100 sends a screen-turning animation ending message to the screen-turning module 123 through the window management service 122 in the framework layer 12 according to the end-turning message.
  • Step 517 The electronic device 100 ends the running of the screen-turning animation through the screen-turning module 123 in the framework layer 12 according to the screen-turning end message.
  • Step 518 The electronic device 100 performs screen rollback through the window management service 122 in the framework layer 12 .
  • performing the screen rollback in the above step 518 may include at least one of the following: deleting the preloaded screenshot image, deleting the preload screen turning animation, restoring the rollback flag corresponding to the timeout rollback process function value and stop masking the input on the screen.
  • the electronic device can set the rotation angle (such as 45 degrees) that triggers the pre-rotation screen and the rotation angle (such as 60 degrees) that triggers the official screen rotation, so that the window management service can load the screen rotation animation in stages, and adjust the screen rotation animation in advance. Take a screenshot of the screen.
  • a rollback protection mechanism is added to ensure the atomic operation of the horizontal and vertical screens at 45 degrees and 60 degrees when the user rotates the screen, so as to prevent abnormality when the user repeatedly rotates the screen.
  • the present application provides a screen rotation processing method, which can reduce the screen rotation time by about 40ms, improve the screen rotation performance, and prevent the user from accidentally touching the screen.
  • FIG. 8 shows a schematic structural diagram of the electronic device 100 .
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, wherein different processing units may be independent devices or may be integrated in one or more processors.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been 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. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 is configured to support the electronic device 100 to perform the screen rotation method in the above method embodiments, and preload the screen rotation resource when the rotation angle of the screen is 45 degrees, and when the rotation angle continues to increase to 60 degrees, according to the preloaded rotation angle The loaded screen rotation resources are rotated horizontally and vertically.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • the electronic device 100 may establish wireless communication with the management device 200 through a wireless communication function.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the electronic device 100 implements a display function through the GPU, the display screen 194, and the application processor, etc., for example, displaying the driver management interface in the above example.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. or desktop interface.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example save music, video in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing the instructions stored in the internal memory 121 .
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
  • FIG. 9 shows an 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 with each other through software interfaces.
  • the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application layer 11 in the electronic device shown in FIG. 2 may be the application layer shown in FIG. 9 .
  • the application layer further includes System UI 111 and Launcher 112.
  • 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 a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
  • the framework layer 12 in the electronic device shown in FIG. 2 may be the application framework layer shown in FIG. 9 , such as the Sensor management service 121 , the window management service 122 and the screen rotation module 123 shown in FIG. 2 . It can be implemented by the window manager and the view system in the application framework layer shown in FIG. 9 .
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the SMS notification icon may include a view for displaying text and a view for displaying pictures, such as a UI interface for displaying the graphical deep learning model of the user in the above-mentioned application orchestration designer.
  • the phone manager is used to provide the communication function of the electronic device 100 .
  • the management of call status including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that the java language needs to call, and the other 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 layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • surface manager surface manager
  • media library Media Libraries
  • 3D graphics processing library eg: OpenGL ES
  • 2D graphics engine eg: SGL
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • 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.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • the Native layer 13 in the electronic device shown in FIG. 2 may be the kernel layer shown in FIG. 9 .
  • the Sensorhub (sensor controller) 131 shown in FIG. 2 may be driven by the sensor shown in FIG. 9 .
  • the layer composition management service 132 shown in FIG. 2 can be implemented by the display driver shown in FIG. 9 .
  • Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementation methods.
  • Embodiments of the present application may be implemented as a computer program or program code executing on a programmable system including at least one processor, a storage system (including volatile and nonvolatile memory and/or storage elements) , at least one input device, and at least one output device.
  • Program code may be applied to input instructions to perform the functions described herein and to generate output information.
  • the output information can be applied to one or more output devices in a known manner.
  • a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), microcontroller, application specific integrated circuit (ASIC), or microprocessor.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • the program code may be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system.
  • the program code may also be implemented in assembly or machine language, if desired.
  • the mechanisms described in this application are not limited in scope to any particular programming language. In either case, the language may be a compiled language or an interpreted language.
  • the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof.
  • the disclosed embodiments can also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (eg, computer-readable) storage media, which can be executed by one or more processors read and execute.
  • the instructions may be distributed over a network or over other computer-readable media.
  • a machine-readable medium can include any mechanism for storing or transmitting information in a form readable by a machine (eg, a computer), including, but not limited to, floppy disks, optical disks, optical disks, read only memories (CD-ROMs), magnetic Optical Disc, Read Only Memory (ROM), Random Access Memory (RAM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Magnetic or Optical Cards, Flash Memory, or Tangible machine-readable storage for transmitting information (eg, carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagating signals.
  • machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
  • each unit/module mentioned in each device embodiment of this application is a logical unit/module.
  • a logical unit/module may be a physical unit/module or a physical unit/module.
  • a part of a module can also be implemented by a combination of multiple physical units/modules.
  • the physical implementation of these logical units/modules is not the most important, and the combination of functions implemented by these logical units/modules is the solution to the problem of this application. The crux of the technical question raised.
  • the above-mentioned device embodiments of the present application do not introduce units/modules that are not closely related to solving the technical problems raised in the present application, which does not mean that the above-mentioned device embodiments do not exist. other units/modules.

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)
  • User Interface Of Digital Computer (AREA)

Abstract

Embodiments of the present application provide a screen rotation processing method and apparatus, a medium and an electronic device, which are beneficial to improving the rapidity of screen rotation and avoiding false triggering of a screen rotation process. In a case where a rotation angle of a screen of the electronic device reaches a first angle threshold, a screen rotation resource is preloaded, wherein the screen of the electronic device is in a first screen display state. In a case where the rotation angle of the screen increases from the first angle threshold to a second angle threshold within a preset duration, the screen rotation operation is completed on the basis of the screen rotation resource, and the screen is switched to a second screen display state after the screen rotation operation is completed.

Description

转屏处理方法、装置、介质及电子设备Screen transfer processing method, device, medium and electronic device
本申请要求于2021年03月08日提交国家知识产权局、申请号为202110249932.X、申请名称为“转屏处理方法、装置、介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the State Intellectual Property Office on March 08, 2021, the application number is 202110249932.X, and the application name is "screen rotation processing method, device, medium and electronic equipment", the entire content of which is Incorporated herein by reference.
技术领域technical field
本申请涉及屏幕显示技术领域,特别涉及一种转屏处理方法、装置、介质及电子设备。The present application relates to the technical field of screen display, and in particular, to a method, device, medium and electronic device for processing screen rotation.
背景技术Background technique
随着手机、平板电脑等电子设备的屏幕的尺寸越来越大,这些电子设备通常都支持屏幕旋转(即转屏),以支持用户根据喜好或者运行应用程序的显示需求随时切换横屏显示或者竖屏显示,即横竖屏旋转。As the screen sizes of electronic devices such as mobile phones and tablet computers become larger and larger, these electronic devices usually support screen rotation (that is, screen rotation), so as to allow users to switch the horizontal screen display or display at any time according to their preferences or the display needs of running applications. Vertical screen display, that is, horizontal and vertical screen rotation.
当前,电子设备进行横竖屏旋转的转屏流程比较固定。如图1所示,当前屏幕旋转的主要流程为:在屏幕需旋转到60度时,电子设备对屏幕当前显示的原始界面进行截屏操作,得到截屏图层(Layer),并加载截屏图像(即截屏Layer)、转屏动画、环境构建等转屏所需的所有资源,以实现渐变旋转这一转屏过程。Currently, the screen rotation process for horizontal and vertical screen rotation of an electronic device is relatively fixed. As shown in Figure 1, the main flow of the current screen rotation is: when the screen needs to be rotated to 60 degrees, the electronic device takes a screenshot of the original interface currently displayed on the screen, obtains the screenshot layer (Layer), and loads the screenshot image (ie Screenshot Layer), screen-turning animation, environment construction and other resources required for screen-turning to realize the screen-turning process of gradient rotation.
然而,在当前横竖屏旋转的过程中,用户必须将电子设备旋转到足够的角度(即60度)才会触发电子设备开启转屏流程,即电子设备达到该旋转角度之后才会开始加载转屏资源,而整个转屏流程中需要加载完成的转屏资源较多,并且涉及操作***中交互的模块较多,从而导致该转屏流程整体耗时较长。这样一来,将导致用户将电子设备旋转到60度之后,需要经过较长时间才能看到转屏动画(即动效)以及转屏完成后的图像画面。如此,用户感知到转屏前的图像画面切换到转屏完成后的图像画面的过程的动效比较卡顿和生硬,不够自然流畅。此外,用户一旦用户触发电子设备旋转到60度这一触发角度,电子设备就会立即开始上述转屏流程,并没有用户反悔机制。However, in the current horizontal and vertical screen rotation process, the user must rotate the electronic device to a sufficient angle (ie, 60 degrees) to trigger the electronic device to start the screen rotation process, that is, the electronic device will not start to load the screen rotation until the rotation angle is reached. However, in the entire screen-turning process, there are many screen-turning resources that need to be loaded, and there are many modules involved in interaction in the operating system, which makes the whole screen-turning process take a long time. As a result, after the user rotates the electronic device to 60 degrees, it takes a long time to see the screen-turning animation (ie, motion effect) and the image after the screen-turning is completed. In this way, the user perceives that the dynamic effect of the process of switching the image picture before the screen transition to the image picture after the screen transition is completed is laggy and stiff, and is not natural and smooth enough. In addition, once the user triggers the electronic device to rotate to the triggering angle of 60 degrees, the electronic device will immediately start the above screen rotation process, and there is no user remorse mechanism.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种转屏处理方法、装置、介质及电子设备,可以提 升转屏的快速性,并避免误触发转屏流程。The embodiments of the present application provide a method, device, medium, and electronic device for screen rotation processing, which can improve the speed of screen rotation and avoid false triggering of the screen rotation process.
第一方面,本申请实施例提供了一种转屏处理方法,应用于电子设备,包括:在电子设备的屏幕的旋转角度达到第一角度阈值(如45度)的情况下,预加载转屏资源,其中电子设备的屏幕处于第一屏幕显示状态(如横屏显示状态或者竖屏显示状态);在屏幕的旋转角度在预设时长内从第一角度阈值增加至第二角度阈值(如60度)的情况下,基于转屏资源完成转屏操作,在转屏操作完成后屏幕切换为第二屏幕显示状态。如此,可以提升转屏的快速性,并避免误触发转屏流程。In a first aspect, an embodiment of the present application provides a screen rotation processing method, which is applied to an electronic device, including: when the rotation angle of the screen of the electronic device reaches a first angle threshold (such as 45 degrees), preloading the screen rotation resources, in which the screen of the electronic device is in the first screen display state (such as the horizontal screen display state or the vertical screen display state); the rotation angle of the screen increases from the first angle threshold to the second angle threshold (such as 60°) within a preset time period. degree), the screen rotation operation is completed based on the screen rotation resources, and the screen is switched to the second screen display state after the screen rotation operation is completed. In this way, the quickness of the screen transfer can be improved, and the screen transfer process can be avoided by mistake.
在上述第一方面的一种可能的实现中,上述方法还包括:在屏幕的旋转角度在预设时长内未从第一角度阈值增加至第二角度阈值的情况下,控制屏幕持续处于第一屏幕显示状态,即不开始执行转屏操作。In a possible implementation of the above-mentioned first aspect, the above-mentioned method further includes: if the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period, controlling the screen to remain in the first angle The screen is displayed, that is, the screen rotation operation is not started.
在上述第一方面的一种可能的实现中,上述方法还包括:在屏幕的旋转角度在预设时长内未从第一角度阈值增加至第二角度阈值的情况下,删除预加载的转屏资源,即执行下文中的回滚操作。In a possible implementation of the above-mentioned first aspect, the above-mentioned method further includes: when the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period, deleting the preloaded screen rotation resources, that is, to perform the rollback operation described below.
在上述第一方面的一种可能的实现中,上述转屏资源包括以下至少一项:对屏幕当前显示的目标界面执行截屏操作得到的截屏图像;根据截屏图像生成的转屏动画;用于暂时屏蔽屏幕上的输入的资源。In a possible implementation of the above-mentioned first aspect, the above-mentioned screen rotation resource includes at least one of the following: a screenshot image obtained by performing a screenshot operation on the target interface currently displayed on the screen; a screen rotation animation generated according to the screenshot image; Blocks the resources entered on the screen.
在上述第一方面的一种可能的实现中,在屏幕切换为第二屏幕显示状态的情况下,屏幕上显示的界面的布局为与第二屏幕显示状态对应的布局;在屏幕切换为第二屏幕显示状态之前,屏幕上显示的界面的布局为与第一屏幕显示状态对应的布局。即转屏的过程中电子设备可以调整屏幕上显示的内容的布局。In a possible implementation of the above-mentioned first aspect, when the screen is switched to the second screen display state, the layout of the interface displayed on the screen is the layout corresponding to the second screen display state; when the screen is switched to the second screen display state Before the screen display state, the layout of the interface displayed on the screen is the layout corresponding to the first screen display state. That is, the electronic device can adjust the layout of the content displayed on the screen during the screen rotation process.
在上述第一方面的一种可能的实现中,上述在电子设备的屏幕的旋转角度达到第一角度阈值的情况下,预加载转屏资源,包括:获取第一Sensor事件,并根据第一Sensor事件预加载转屏资源;其中,第一Sensor事件用于指示屏幕的旋转角度达到第一角度阈值并用于触发预加载转屏资源。In a possible implementation of the above-mentioned first aspect, when the rotation angle of the screen of the electronic device reaches a first angle threshold, preloading the screen rotation resource includes: acquiring a first Sensor event, and The event preloads the screen rotation resource; wherein, the first Sensor event is used to indicate that the rotation angle of the screen reaches the first angle threshold and is used to trigger the preload of the screen rotation resource.
在上述第一方面的一种可能的实现中,上述在屏幕的旋转角度在预设时长内从第一角度阈值增加至第二角度阈值的情况下,基于转屏资源完成转屏操作,包括:获取第二Sensor事件(即下文中的60度转屏事件),并根据第二Sensor事件基于转屏资源完成转屏操作;其中,第二Sensor事件用于指示屏幕的旋转角度在预设时长内从第一角度阈值增加至第二角度阈值,并触发执行转屏操作。In a possible implementation of the above-mentioned first aspect, when the rotation angle of the screen increases from the first angle threshold to the second angle threshold within a preset time period, the screen rotation operation is completed based on the screen rotation resources, including: Obtain the second Sensor event (that is, the 60-degree screen rotation event below), and complete the screen rotation operation based on the screen rotation resource according to the second Sensor event; wherein, the second Sensor event is used to indicate that the rotation angle of the screen is within the preset time period. The first angle threshold is increased to the second angle threshold, and the screen rotation operation is triggered.
第二方面,本申请实施例提供了一种转屏处理装置,应用于电子设备,包括:加载模块,用于在电子设备的屏幕的旋转角度达到第一角度阈值的情况下,预加载转屏资源,其中电子设备的屏幕处于第一屏幕显示状态;执行模块,用于在屏幕的旋转角度在预设时长内从第一角度阈值增加至第二角度阈值的情况下,基于加载模块加载的转屏资源完成转屏操作,在转屏操作完成后屏幕切换为第二屏幕显示状态。In a second aspect, an embodiment of the present application provides a screen rotation processing device, which is applied to an electronic device, and includes: a loading module for preloading the screen rotation when the rotation angle of the screen of the electronic device reaches a first angle threshold. The resource, wherein the screen of the electronic device is in the first screen display state; the execution module is used for, when the rotation angle of the screen increases from the first angle threshold to the second angle threshold within a preset time period, based on the rotation loaded by the loading module. The screen resource completes the screen rotation operation, and the screen switches to the second screen display state after the screen rotation operation is completed.
在上述第二方面的一种可能的实现中,上述执行模块,还用于在屏幕的旋转角度在预设时长内未从第一角度阈值增加至第二角度阈值的情况下,控制屏 幕持续处于第一屏幕显示状态。In a possible implementation of the second aspect, the execution module is further configured to control the screen to continue to be in a state where the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period. The first screen shows the status.
在上述第二方面的一种可能的实现中,上述执行模块,还用于在屏幕的旋转角度在预设时长内未从第一角度阈值增加至第二角度阈值的情况下,删除预加载的转屏资源。In a possible implementation of the above second aspect, the above execution module is further configured to delete the preloaded image file when the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within a preset time period. Screen transfer resources.
在上述第二方面的一种可能的实现中,上述转屏资源包括以下至少一项:对屏幕当前显示的目标界面执行截屏操作得到的截屏图像;根据截屏图像生成的转屏动画;用于暂时屏蔽屏幕上的输入的资源。In a possible implementation of the above second aspect, the above screen rotation resource includes at least one of the following: a screenshot image obtained by performing a screenshot operation on the target interface currently displayed on the screen; a screen rotation animation generated according to the screenshot image; Blocks the resources entered on the screen.
在上述第二方面的一种可能的实现中,在屏幕切换为第二屏幕显示状态的情况下,屏幕上显示的界面的布局为与第二屏幕显示状态对应的布局;在屏幕切换为第二屏幕显示状态之前,屏幕上显示的界面的布局为与第一屏幕显示状态对应的布局。In a possible implementation of the above second aspect, when the screen is switched to the second screen display state, the layout of the interface displayed on the screen is the layout corresponding to the second screen display state; when the screen is switched to the second screen display state Before the screen display state, the layout of the interface displayed on the screen is the layout corresponding to the first screen display state.
在上述第二方面的一种可能的实现中,上述执行模块,具体用于获取第一Sensor事件,并根据第一Sensor事件预加载转屏资源;其中,第一Sensor事件用于指示屏幕的旋转角度达到第一角度阈值并用于触发预加载转屏资源。In a possible implementation of the second aspect, the execution module is specifically configured to acquire the first Sensor event, and preload the screen rotation resource according to the first Sensor event; wherein the first Sensor event is used to indicate the rotation of the screen The angle reaches the first angle threshold and is used to trigger the preloading of screen rotation resources.
在上述第二方面的一种可能的实现中,上述执行模块,具体用于获取第二Sensor事件,并根据第二Sensor事件基于转屏资源完成转屏操作;其中,第二Sensor事件用于指示屏幕的旋转角度在预设时长内从第一角度阈值增加至第二角度阈值,并触发执行转屏操作。In a possible implementation of the above-mentioned second aspect, the above-mentioned execution module is specifically configured to acquire the second Sensor event, and complete the screen-turning operation based on the screen-turning resource according to the second Sensor event; wherein, the second Sensor event is used to indicate The rotation angle of the screen is increased from the first angle threshold to the second angle threshold within a preset time period, and the screen rotation operation is triggered.
第三方面,本申请实施里提供了一种可读介质,该可读介质上存储有指令,所述指令在电子设备上执行时使所述电子设备执行上述第一方面所述的转屏处理方法。In a third aspect, in the implementation of the present application, a readable medium is provided, and instructions are stored on the readable medium, and when the instructions are executed on an electronic device, the electronic device is caused to perform the screen rotation process described in the first aspect. method.
第四方面,本申请实施里提供了一种电子设备,包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令,以及处理器,是该电子设备的处理器之一,用于执行如上述第一方面所述的转屏处理方法。In a fourth aspect, the implementation of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, It is used for executing the screen rotation processing method described in the first aspect.
附图说明Description of drawings
图1为现有技术提供的一种转屏处理方法的流程示意图;Fig. 1 is a kind of schematic flowchart of a screen rotation processing method provided by the prior art;
图2根据本申请的一些实施例,示出了一种电子设备的结构示意图;FIG. 2 shows a schematic structural diagram of an electronic device according to some embodiments of the present application;
图3为相关技术提供的一种Sensor事件上报的流程示意图;3 is a schematic flowchart of a Sensor event reporting provided by the related art;
图4根据本申请的一些实施例,示出了一种Sensor事件上报的流程示意图;4 shows a schematic flowchart of Sensor event reporting according to some embodiments of the present application;
图5根据本申请的一些实施例,示出了一种转屏处理方法的流程示意图;FIG. 5 shows a schematic flowchart of a method for screen rotation processing according to some embodiments of the present application;
图6根据本申请的一些实施例,示出了一种转屏处理过程中屏幕显示内容的示意图;FIG. 6 is a schematic diagram of screen display content in a process of screen rotation processing according to some embodiments of the present application;
图7根据本申请的一些实施例,示出了一种转屏处理过程中屏幕显示内容的示意图;Fig. 7 shows a schematic diagram of screen display content during a screen rotation process according to some embodiments of the present application;
图8根据本申请的一些实施例,示出了一种电子设备的结构示意图;FIG. 8 shows a schematic structural diagram of an electronic device according to some embodiments of the present application;
图9根据本申请的一些实施例,示出了一种电子设备的软件结构框图。FIG. 9 is a block diagram showing a software structure of an electronic device according to some embodiments of the present application.
具体实施方式Detailed ways
本申请的说明性实施例包括但不限于转屏处理方法、装置及电子设备。Illustrative embodiments of the present application include, but are not limited to, screen rotation processing methods, apparatuses, and electronic devices.
本申请实施例提供的转屏处理方法,电子设备在检测到屏幕的旋转角度达到较小的第一阈值(如45度)时,可以预加载转屏资源,而不是立即切换屏幕显示状态。直至预设定时时长内屏幕的旋转角度持续增大到较大的第二阈值时,才基于预加载的转屏资源完成转屏操作,以切换屏幕显示状态,如将横屏显示状态切换为竖屏显示状态,或者将竖屏显示状态切换为横屏显示状态。如果在预设定时时长内屏幕的旋转角度未增加至第二阈值,那么电子设备将不会执行转屏操作以切换屏幕显示状态,并会删除预加载的转屏资源。如此,可以提升转屏的快速性,并避免误触发转屏的可能性。In the screen rotation processing method provided by the embodiment of the present application, when the electronic device detects that the rotation angle of the screen reaches a small first threshold (eg 45 degrees), the screen rotation resource can be preloaded instead of immediately switching the screen display state. Until the rotation angle of the screen continues to increase to a larger second threshold within the preset time period, the screen rotation operation is completed based on the preloaded screen rotation resources to switch the screen display state, such as switching the landscape display state to portrait. display state, or switch from the portrait display state to the landscape display state. If the rotation angle of the screen does not increase to the second threshold within the preset time period, the electronic device will not perform the screen rotation operation to switch the screen display state, and will delete the preloaded screen rotation resources. In this way, the quickness of the screen transfer can be improved, and the possibility of accidentally triggering the screen transfer can be avoided.
需要说明的是,本申请实施例提供的转屏处理方法,执行主体可以为电子设备,或者,该电子设备的中央处理器(Central Processing Unit,CPU),或者该电子设备中的用于执行转屏处理的控制模块或装置(或称为转屏处理装置)。以下实施例中,以电子设备为执行主体,说明本申请实施例提供的转屏处理方法。It should be noted that, for the screen rotation processing method provided by the embodiments of the present application, the execution subject may be an electronic device, or, a central processing unit (Central Processing Unit, CPU) of the electronic device, or a function in the electronic device for executing the rotation A control module or device for screen processing (or referred to as a screen rotation processing device). In the following embodiments, an electronic device is used as an execution subject to describe the screen rotation processing method provided by the embodiments of the present application.
可以理解的是,适用于本申请的电子设备可包括但不限于:手机、平板电脑、摄像机、相机、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、台式电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmentedreality,AR)\虚拟现实(virtual reality,VR)设备、媒体播放器、智能电视、智能音箱、智能手表等。具体地,本申请提供的电子设备为具有屏幕,且支持屏幕旋转(即转屏)的电子设备。以下实施例中,以电子设备为手机为例进行说明。It is understood that electronic devices suitable for use in this application may include, but are not limited to, cell phones, tablet computers, video cameras, cameras, desktop computers, laptop computers, handheld computers, notebook computers, desktop computers, super mobile personal computers ( ultra-mobile personal computer, UMPC), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR)\virtual reality (VR) devices, media players, smart TVs , smart speakers, smart watches, etc. Specifically, the electronic device provided by the present application is an electronic device having a screen and supporting screen rotation (ie, screen rotation). In the following embodiments, the electronic device is a mobile phone as an example for description.
下面将结合附图对本申请的实施例作进一步地详细描述。The embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
如图2所示,为本申请提供的电子设备的结构组成示意图。图2中电子设备100包括应用层11、框架层12、本地(Native)层13和硬件层14。As shown in FIG. 2 , it is a schematic diagram of the structure and composition of the electronic device provided by the present application. The electronic device 100 in FIG. 2 includes an application layer 11 , a framework layer 12 , a native (Native) layer 13 and a hardware layer 14 .
其中,硬件层14中包括传感器(Sensor)141,用于检测电子设备100的屏幕的旋转角度和旋转方向等Sensor参数,即Sensor事件(或称消息),并将Sensor事件上报给Native层13。例如,上述Sensor 141包括但不限于陀螺仪、加速度传感器(如重力加速度传感器)等。可以理解的是,屏幕的旋转角度指的是:电子设备转动过程中,保持其屏幕所处的平面不变或者屏幕所处的不同平面之间的角度差处于一定阈值范围(如0-5度)内时,屏幕沿着其所在屏幕的旋转角度。此外,对屏幕的旋转方向的详细与旋转角度的描述类似,此处不再赘述。Wherein, the hardware layer 14 includes a sensor (Sensor) 141 for detecting Sensor parameters such as the rotation angle and rotation direction of the screen of the electronic device 100, namely Sensor events (or messages), and reporting the Sensor events to the Native layer 13. For example, the above-mentioned Sensor 141 includes, but is not limited to, a gyroscope, an acceleration sensor (such as a gravitational acceleration sensor), and the like. It can be understood that the rotation angle of the screen refers to: during the rotation of the electronic device, the plane on which the screen is located remains unchanged or the angle difference between different planes on which the screen is located is within a certain threshold range (such as 0-5 degrees). ), the rotation angle of the screen along the screen it is on. In addition, the details of the rotation direction of the screen are similar to the description of the rotation angle, and are not repeated here.
Native层13,也可以称为服务层,包括Sensorhub(传感器控制器)131和图层合成管理服务132。其中,Sensorhub 131用于获取Sensor 141采集的屏幕旋转角度,并判断旋转角度是否达到阈值,进而将旋转角度达到阈值的Sensor事件上报至框架层12,以实现向框架层12通知横竖屏旋转的消息。例 如,第一阈值或第二阈值,如第一阈值为45度,第二阈值为60度。图层合成管理服务132可以用于从框架层12获取截屏图像,并基于截屏图像生成转屏动画等转屏资源。The Native layer 13 , which can also be called a service layer, includes a Sensorhub (sensor controller) 131 and a layer composition management service 132 . Among them, the Sensorhub 131 is used to obtain the screen rotation angle collected by the Sensor 141, and determine whether the rotation angle reaches the threshold, and then report the Sensor event whose rotation angle reaches the threshold to the framework layer 12, so as to realize the notification of the horizontal and vertical screen rotation to the framework layer 12. . For example, the first threshold or the second threshold, eg, the first threshold is 45 degrees and the second threshold is 60 degrees. The layer composition management service 132 can be used to obtain screenshot images from the framework layer 12, and generate screen transition resources such as screen transition animations based on the screenshot images.
框架层12包括Sensor管理服务121、窗口管理服务122和转屏模块(屏幕旋转动画)123。其中,sensor管理服务121用于获取Native层13上报的通知横竖屏旋转的消息,并根据该消息向窗口管理服务122上报Sensor事件,即上报通知横竖屏旋转的消息。窗口管理服务122用于根据从Sensor管理服务121获取通知横竖屏旋转的消息,向转屏模块123发送启动转屏的消息,以及用于向应用层11中的***用户界面(System UI)111上报通知横竖屏旋转的消息,并接收System UI 111反馈的结束转屏动画的消息。转屏模块123,用于根据启动转屏的消息,运行转屏动画对应的流程,该流程包括截屏、加载转屏动画(即动画资源)、暂时屏蔽屏幕输入等动作。具体地,转屏模块123用于将截屏得到的截屏发送给Native层13中的图层合成管理服务132,并从图层合成管理服务132获取与该截屏图像对应的转屏动画。The framework layer 12 includes a Sensor management service 121 , a window management service 122 and a screen rotation module (screen rotation animation) 123 . Among them, the sensor management service 121 is used to obtain the message notifying the horizontal and vertical screen rotation reported by the Native layer 13, and report the Sensor event to the window management service 122 according to the message, that is, reporting the message notifying the horizontal and vertical screen rotation. The window management service 122 is used to send the message of starting the screen rotation to the screen rotation module 123 according to the message obtained from the Sensor management service 121 to notify the horizontal and vertical screen rotation, and to report to the system user interface (System UI) 111 in the application layer 11. Notify the message of horizontal and vertical screen rotation, and receive the message of ending the screen rotation animation feedback from System UI 111. The screen-turning module 123 is configured to run the process corresponding to the screen-turning animation according to the message of starting the screen-turning, and the process includes actions such as taking screenshots, loading the screen-turning animation (ie, animation resources), and temporarily blocking screen input. Specifically, the screen transition module 123 is configured to send the screenshot obtained by the screenshot to the layer composition management service 132 in the Native layer 13 , and obtain the screen transition animation corresponding to the screen capture image from the layer composition management service 132 .
应用层11包括System UI 111和发射层(Launcher)112。其中,System UI 111用于根据从窗口管理服务122获取的通知横竖屏旋转的消息,对横竖屏旋转时运行的应用程序的界面进行重新布局,还用于在对应用程序的界面在横竖屏旋转时重新布局完成后,向窗口管理服务122发送结束转屏动画的消息,以指示窗口管理服务122结束当前横竖屏旋转的流程。Launcher 112为***桌面启动器,用于触发在屏幕上显示桌面界面,如包括一个或多个应用程序图像的主界面或者负一屏界面。其中,本申请主要以横竖屏旋转时System UI 111调整应用程序的界面为例进行说明,对横竖屏旋转时Launcher 112调整桌面界面的描述可以参照System UI 111调整界面的相关描述,本申请实施例对此不做赘述。The application layer 11 includes a System UI 111 and a launch layer (Launcher) 112 . Among them, the System UI 111 is used to rearrange the interface of the application program running when the horizontal and vertical screen is rotated according to the message obtained from the window management service 122 to notify the horizontal and vertical screen rotation, and is also used to rotate the interface of the application program in the horizontal and vertical screens. After the time rearrangement is completed, a message for ending the screen-turning animation is sent to the window management service 122 to instruct the window management service 122 to end the current flow of horizontal and vertical screen rotation. Launcher 112 is a system desktop launcher, used to trigger the display of a desktop interface on the screen, such as a main interface or a negative one-screen interface including one or more application images. Among them, this application mainly takes the interface of the System UI 111 adjusting the application program when the horizontal and vertical screens are rotated as an example for description. For the description of the Launcher 112 adjusting the desktop interface when the horizontal and vertical screens are rotated, please refer to the relevant description of the System UI 111 adjusting interface. The embodiment of the present application This will not be repeated here.
在相关技术方案中,如图3所示,电子设备100的Native层13中的Sensorhub 131将屏幕旋转角度为60度的Sensor事件上报给框架层12中的窗口管理服务122,立刻触发窗口管理服务122直接启动转屏动画对应的流程执行横竖屏转换。即现有技术中只要屏幕的旋转角度为60度就会立即触发横竖屏旋转,用户没有反悔机制,容易导致用户误触发电子设备的转屏流程。此外,由于电子设备的屏幕旋转角度到达60度时就需要同时加载并运行所有转屏资源,导致转屏过程中电子设备的性能较差,并且从屏幕旋转角度到达触发转屏的60度起到转屏流程结束的耗时较长。In a related technical solution, as shown in FIG. 3 , the Sensorhub 131 in the Native layer 13 of the electronic device 100 reports the Sensor event whose screen rotation angle is 60 degrees to the window management service 122 in the framework layer 12, and immediately triggers the window management service 122 directly starts the process corresponding to the screen transition animation to perform horizontal and vertical screen conversion. That is, in the prior art, as long as the rotation angle of the screen is 60 degrees, the horizontal and vertical screen rotation will be triggered immediately, and the user does not have a back-off mechanism, which may easily cause the user to mistakenly trigger the screen rotation process of the electronic device. In addition, when the screen rotation angle of the electronic device reaches 60 degrees, all the screen rotation resources need to be loaded and run at the same time, resulting in poor performance of the electronic device during the screen rotation process, and the screen rotation angle reaches 60 degrees when the screen rotation is triggered. It takes a long time to complete the screen transition process.
为了解决上述相关技术方案存在的问题,本申请通过增加上报的旋转角度对应的Sensor事件,实现预处理转屏流程,以将转屏流程分为预处理(即预加载转屏资源)的阶段和实际执行转屏操作的阶段,实现分阶段的转屏处理流程。In order to solve the problems existing in the above-mentioned related technical solutions, the present application realizes the preprocessing screen transition process by adding the Sensor event corresponding to the reported rotation angle, so as to divide the screen transition process into the stages of preprocessing (that is, preloading the screen transition resources) and The stage in which the screen rotation operation is actually performed, and the staged screen rotation processing flow is realized.
例如,在图4所示的实施例中,本申请实施例中转屏处理的流程中,Sensorhub 131在屏幕的旋转角度为45度时上报的Sensor事件为45度预转屏事件,并增加在屏幕的旋转角度为60度时上报60度转屏事件。具体地, Sensorhub 131上报45度预转屏事件和60度转屏事件之间存在预设定时时长,例如,图4示出的时长time1。For example, in the embodiment shown in FIG. 4 , in the process of screen rotation processing in the embodiment of the present application, the Sensor event reported by the Sensorhub 131 when the rotation angle of the screen is 45 degrees is a 45 degree pre-screen rotation event, and an increase in the screen When the rotation angle is 60 degrees, a 60-degree screen rotation event is reported. Specifically, there is a preset timing duration between the Sensorhub 131 reporting the 45-degree pre-screen rotation event and the 60-degree screen rotation event, for example, the duration time1 shown in FIG. 4 .
以下将参考图3和图4示出Sensor的上报的流程,列举出图2示出的电子设备100中的各个部件之间执行本申请提供的转屏处理的流程,与执行现有技术的转屏处理的流程相比存在的区别:The following will show the reporting process of the Sensor with reference to FIG. 3 and FIG. 4, and enumerate the process of performing the screen switching process provided by the present application between the various components in the electronic device 100 shown in FIG. Compared with the process of screen processing, the differences exist:
1、在本申请的一些实施例中,Sensorhub 131上报的Sensor事件(Sensor参数)里增加了一个标识信息,用于标识45度预转屏,此时该Sensor事件可以称为45度预转屏事件。具体地,45度预转屏事件用于触发电子设备100在屏幕旋转角度为45度时预加载转屏资源,但不立即执行旋转屏幕的转屏操作。此外,在Sensorhub 131上报的Sensor事件里还可以增加另一个标识信息,用于标识60度转屏,此时该Sensor事件可以称为60度转屏事件。具体地,60度转屏事件用于触发电子设备100在屏幕的旋转角度为60度时开始执行旋转屏幕的转屏操作。1. In some embodiments of this application, an identification information is added in the Sensor event (Sensor parameter) reported by Sensorhub 131 to identify the 45-degree pre-rotation screen, and this Sensor event can be called a 45-degree pre-rotation screen at this time. event. Specifically, the 45-degree pre-rotation screen event is used to trigger the electronic device 100 to preload the screen-rotation resource when the screen rotation angle is 45 degrees, but the screen-rotation operation of rotating the screen is not performed immediately. In addition, another identification information can be added to the Sensor event reported by Sensorhub 131 to identify the 60-degree screen rotation. At this time, the Sensor event can be called a 60-degree screen rotation event. Specifically, the 60-degree screen rotation event is used to trigger the electronic device 100 to start performing a screen rotation operation of rotating the screen when the rotation angle of the screen is 60 degrees.
2、在本申请的一些实施例中,窗口管理服务122中增加预截屏和超时回滚流程函数,并提供给转屏旋转动画(即转屏模块)123调用。2. In some embodiments of the present application, the window management service 122 adds pre-screenshot and timeout rollback process functions, and provides it to the screen rotation animation (ie, the screen rotation module) 123 to call.
3、在本申请的一些实施例中,转屏模块123中收到45度转屏事件时,调用窗口管理服务122中的预截屏和超时回滚流程函数,实现预加载转屏资源,同时启动线程用于超时回滚。其中,转屏旋转动画(即转屏模块)123调用该函数可以先对屏幕当前显示的界面执行截屏操作得到截屏图像,以及将截屏图像发送给图层合成管理服务132以获取转屏动画,但是不会立即运行转屏动画(即转屏旋转动画)等转屏动画资源。其中,超时回滚流程指的是:启动预设定时器,并在定时器定时时长超时的情况下,转屏模块123取消转屏流程,并删除已经预加载的转屏资源,即对转屏流程进行回滚(roolback)操作。具体地,预设定时器的定时时长为上述预定定时时长。3. In some embodiments of the present application, when the screen rotation module 123 receives a 45-degree screen rotation event, it calls the pre-screenshot and timeout rollback process functions in the window management service 122 to preload the screen rotation resources and start the Thread is used for timeout rollback. Wherein, the screen-turning rotation animation (that is, the screen-turning module) 123 can call this function to first perform a screenshot operation on the interface currently displayed on the screen to obtain a screenshot image, and send the screenshot image to the layer composition management service 132 to obtain the screen-turning animation, but Screen-turning animation resources such as screen-turning animation (that is, screen-turning rotation animation) will not be run immediately. The time-out rollback process refers to: starting a preset timer, and when the timer expires, the screen-turning module 123 cancels the screen-turning process, and deletes the preloaded screen-turning resources, that is, reverse screen-turning The process performs a rollback operation. Specifically, the timing duration of the preset timer is the above-mentioned predetermined timing duration.
作为一种示例,转屏模块123中可以设置有回滚标志位,在转屏模块123开启超时回滚流程时可以修改该回滚标志位,如将回滚标志位的数值由0修改为1,表示当前转屏模块123已经预截屏得到截图图像并启用超时回滚流程。As an example, a rollback flag may be set in the screen rotation module 123, and the rollback flag may be modified when the screen rotation module 123 starts the timeout rollback process, such as changing the value of the rollback flag from 0 to 1 , indicating that the current screen rotation module 123 has pre-screened to obtain a screenshot image and enabled the timeout rollback process.
4、在本申请的一些实施例中,转屏模块中收到60度转屏事件时,调用窗口管理服务122执行正式转屏流程,窗口管理服务122判读如果有预截屏操作得到的截图图像,则跳过截屏流程,同时控制截屏标志位还原,如将截屏标志位的数值由1还原为0。4. In some embodiments of the present application, when a 60-degree screen-turn event is received in the screen-turning module, the window management service 122 is called to execute the formal screen-turning process, and the window management service 122 interprets if there is a screenshot image obtained by the pre-screenshot operation, Then skip the screenshot process and control the restoration of the screenshot flag, for example, restore the value of the screenshot flag from 1 to 0.
5、在本申请的一些实施例中,转屏旋转动画(即转屏模块)123中如果在设定时间阈值内未收到60度转屏事件,则调用窗口管理服务122执行转屏状态回滚流程,以保持当前的横屏显示状态或者竖屏显示状态不变。5. In some embodiments of the present application, in the screen-turning rotation animation (ie, the screen-turning module) 123, if the 60-degree screen-turning event is not received within the set time threshold, the window management service 122 is called to execute the screen-turning state return. Scroll the process to keep the current landscape display state or portrait display state unchanged.
作为一种示例,如图6中的(a)-(d)所示,以电子设备为手机为例,示出手机100的屏幕的状态的示意图。As an example, as shown in (a)-(d) of FIG. 6 , taking the electronic device as a mobile phone as an example, a schematic diagram of the state of the screen of the mobile phone 100 is shown.
其中,图6中的(a)-(d)示出的屏幕分别为正向竖屏显示状态、正向横屏显示状态、反向竖屏显示状态和反向横屏显示状态。并且,图6示出的屏幕 的旋转方向均为逆时针方向。可以理解的是,图6中的(a)-(d)示出的屏幕可以是沿着逆时针方向持续旋转,使得屏幕的旋转角度依次增大。假定图6中的(a)示出的屏幕的状态为未转屏之前的初始屏幕显示状态,即图6中的(a)示出的屏幕的旋转角度α1为0度,则图6中的(b)-(d)中的屏幕示出的屏幕的旋转角度α2、α3和α4依次为90度,180度和270度。此外,在其他实施例中,用户可以触发电子设备100的屏幕按照顺时针方向旋转,例如以图6中的(d)示出的屏幕的状态为未转屏之前的初始屏幕显示状态,按照顺时针方向持续旋转电子设备100中的屏幕,可以依次得到如图6中的(c)、(b)、(a)依次示出的屏幕显示状态。The screens shown in (a)-(d) in FIG. 6 are respectively a forward portrait display state, a forward landscape display state, a reverse portrait display state and a reverse landscape display state. Moreover, the rotation directions of the screens shown in FIG. 6 are all counterclockwise. It can be understood that, the screen shown in (a)-(d) of FIG. 6 may be continuously rotated in the counterclockwise direction, so that the rotation angle of the screen increases sequentially. Assuming that the state of the screen shown in (a) in FIG. 6 is the initial screen display state before the screen is rotated, that is, the rotation angle α1 of the screen shown in (a) in FIG. 6 is 0 degrees, then the The screens in (b)-(d) show that the rotation angles α2, α3 and α4 of the screen are 90 degrees, 180 degrees and 270 degrees, respectively. In addition, in other embodiments, the user can trigger the screen of the electronic device 100 to rotate in a clockwise direction, for example, the state of the screen shown in (d) in FIG. By continuously rotating the screen in the electronic device 100 in the clockwise direction, the screen display states shown in sequence (c), (b), and (a) in FIG. 6 can be obtained in sequence.
需要说明的是,图6中坐标平面XOY用于表示电子设备100的屏幕所在的平面,直线M为屏幕的横向中轴线。其中,屏幕的旋转角度可以通过图6中示出的坐标平面XOY中的坐标轴Y的正方向(即箭头方向)与直线M的正方向(即箭头方向)之间的角度表示,但不限于此。It should be noted that the coordinate plane XOY in FIG. 6 is used to represent the plane on which the screen of the electronic device 100 is located, and the straight line M is the horizontal central axis of the screen. The rotation angle of the screen can be represented by the angle between the positive direction (ie the arrow direction) of the coordinate axis Y in the coordinate plane XOY shown in FIG. 6 and the positive direction (ie the arrow direction) of the straight line M, but is not limited to this.
具体地,本申请实施例中提供的转屏处理方法,可以针对图6中相邻的两个屏幕显示状态之间的转屏处理过程为例进行说明。其中,相邻的两个屏幕显示状态之间的转屏处理具体包括旋转角度由0度增大至45度时电子设备100执行预转屏流程,由45度增大至60度时电子设备100正式开始执行转屏流程。可以理解的是,旋转角度为0到60度时,电子设备100控制屏幕保持为转屏之前的初始屏幕显示状态;旋转角度大于60度之后,电子设备100控制屏幕开始转屏流程,并在转屏流程执行完成后切换屏幕显示状态。Specifically, the screen rotation processing method provided in the embodiment of the present application may be described by taking the screen rotation processing process between two adjacent screen display states in FIG. 6 as an example. The screen rotation process between two adjacent screen display states specifically includes the electronic device 100 performing a pre-screen rotation process when the rotation angle increases from 0 degrees to 45 degrees, and the electronic device 100 when the rotation angle increases from 45 degrees to 60 degrees. The screen transition process is officially started. It can be understood that when the rotation angle is 0 to 60 degrees, the electronic device 100 controls the screen to maintain the initial screen display state before the screen rotation; after the rotation angle is greater than 60 degrees, the electronic device 100 controls the screen to start the screen rotation process, and the screen is rotated. After the screen process is executed, switch the screen display state.
一般而言,用户通常习惯在正向竖屏显示状态和正向横屏显示状态下使用电子设备100。以下实施例中,将以图6中的(a)示出的屏幕的正向竖屏显示状态为未转屏之前的初始状态,用户沿着逆时针方向控制电子设备100的屏幕旋转得到图6中的(b)示出的屏幕的正向横屏显示状态之间的转屏处理过程为例,描述本申请实施例提供的转屏处理方法。Generally speaking, users are usually used to using the electronic device 100 in a forward portrait display state and a forward landscape display state. In the following embodiments, the forward vertical screen display state of the screen shown in (a) in FIG. 6 is the initial state before the screen is rotated, and the user controls the screen rotation of the electronic device 100 in the counterclockwise direction to obtain FIG. 6 The screen transition processing method provided by the embodiments of the present application is described by taking the screen transition processing process between the forward and horizontal screen display states of the screen shown in (b) as an example.
在一些实施例中,结合图6,如图7所示,假定图7中的(a)示出的屏幕的正向竖屏显示状态为未转屏之前的初始屏幕显示状态,即图7中的(a)示出的屏幕的旋转角度β1为0度。随后,用户触发电子设备100中的屏幕按照逆时针方向旋转,使得旋转角度持续增大。如图7中的(b)和(c)所示,电子设备100的屏幕的旋转角度β2和β3分别为45度和60度,并且屏幕的显示状态均保持为正向竖屏显示状态。随后,如图7中的(d)所示,电子设备100的屏幕的旋转角度β4大于60度(如65度)时,屏幕的显示状态切换为正向横屏显示状态。此外,如图6和图7所示,随着电子设备100的屏幕显示状态发生变化,屏幕上显示的界面中的内容也随之变化。例如,如图6中的(a)示出的屏幕上以正向竖屏显示状态显示的应用程序1的界面,图6中的(b)示出的屏幕上以正向横屏显示状态下显示的应用程序1的界面,这两个界面在屏幕上的布局不同。In some embodiments, with reference to FIG. 6 , as shown in FIG. 7 , it is assumed that the forward vertical screen display state of the screen shown in (a) in FIG. 7 is the initial screen display state before the screen is rotated, that is, in FIG. 7 The rotation angle β1 of the screen shown in (a) is 0 degrees. Subsequently, the user triggers the screen in the electronic device 100 to rotate in a counterclockwise direction, so that the rotation angle continues to increase. As shown in (b) and (c) of FIG. 7 , the rotation angles β2 and β3 of the screen of the electronic device 100 are 45 degrees and 60 degrees, respectively, and the display states of the screens are kept in the forward portrait display state. Subsequently, as shown in (d) of FIG. 7 , when the rotation angle β4 of the screen of the electronic device 100 is greater than 60 degrees (eg, 65 degrees), the display state of the screen is switched to the forward landscape display state. In addition, as shown in FIG. 6 and FIG. 7 , as the display state of the screen of the electronic device 100 changes, the content in the interface displayed on the screen also changes. For example, as shown in FIG. 6( a ), the interface of the application 1 is displayed in the forward portrait display state, and the screen shown in FIG. 6( b ) is displayed in the forward landscape display state. The interface of application 1 is displayed, the layout of the two interfaces on the screen is different.
以下将根据本申请的一些实施例,结合上述图2中对电子设备100的描述, 以及图4中对转屏相关的Sensor事件的相关描述,描述电子设备100执行转动处理的工作流程。上述针对图2和图4描述的技术细节在此流程中依然适用,为了避免重复,有些在此次不再赘述。如图5所示,为本申请实施例提供的一种转屏处理方法的流程示意图,该方法包括:Hereinafter, according to some embodiments of the present application, the electronic device 100 will be described with reference to the description of the electronic device 100 in FIG. 2 and the related description of the sensor event related to screen rotation in FIG. 4 . The technical details described above with respect to FIG. 2 and FIG. 4 are still applicable in this process, and in order to avoid repetition, some details are not repeated here. As shown in FIG. 5 , a schematic flowchart of a method for screen rotation processing provided by an embodiment of the present application, the method includes:
步骤501:电子设备100通过硬件层14中的Sensor 141识别屏幕的旋转。Step 501: The electronic device 100 recognizes the rotation of the screen through the Sensor 141 in the hardware layer 14.
例如,在屏幕的旋转过程中,Sensor 141可以检测出屏幕的旋转角度等参数。For example, during the rotation of the screen, the Sensor 141 can detect parameters such as the rotation angle of the screen.
在一些实施例中,上述Sensor事件中还可以包括屏幕的旋转方向,以确定后续电子设备100需要将屏幕旋转至哪个方向,如顺时针方向还是逆时针方向。In some embodiments, the above-mentioned Sensor event may further include the rotation direction of the screen, so as to determine which direction the electronic device 100 needs to rotate the screen to, such as a clockwise direction or a counterclockwise direction.
步骤502:电子设备100通过Sensor 141检测到屏幕的旋转角度达到45度时生成45度Sensor事件,该45度Sensor事件中包括预转屏标识信息,用于标识45度预转屏的流程。Step 502: The electronic device 100 generates a 45-degree Sensor event when the sensor 141 detects that the rotation angle of the screen reaches 45 degrees, and the 45-degree Sensor event includes pre-rotation screen identification information for identifying the process of the 45-degree pre-rotation screen.
需要说明的是,步骤502中检测的旋转角度包括但不限于45度,还可以为任意较小的角度,如43度或47度等,本申请实施例对此不作具体限定。It should be noted that the rotation angle detected in step 502 includes, but is not limited to, 45 degrees, and may also be any smaller angle, such as 43 degrees or 47 degrees, which is not specifically limited in this embodiment of the present application.
另外,可以理解的是,步骤502中Sensor 141检测到屏幕的旋转角度小于45度,即旋转角度为0-45度之间的角度时,电子设备100将不会硬件层14中的Sensor 141生成Sensor事件,或者虽然生成Sensor事件但是不会向Native层13上报该Sensor事件。In addition, it can be understood that, in step 502, when the sensor 141 detects that the rotation angle of the screen is less than 45 degrees, that is, when the rotation angle is between 0 and 45 degrees, the electronic device 100 will not generate the sensor 141 in the hardware layer 14. The Sensor event, or the Sensor event is not reported to the Native layer 13 even though the Sensor event is generated.
步骤503:电子设备100通过Sensor 141向Native层13中的Sensorhub 131上报45度Sensor事件,以实现硬件层14向Native层13通知横竖屏旋转的流程。Step 503: The electronic device 100 reports the 45-degree Sensor event to the Sensorhub 131 in the Native layer 13 through the Sensor 141, so as to realize the process that the hardware layer 14 notifies the Native layer 13 of horizontal and vertical screen rotation.
步骤504:电子设备100通过Native层13中的Sensorhub 131,向框架层12中的sensor管理服务121上报45度Sensor事件,以实现Native层13向框架层12通知横竖屏旋转的流程。Step 504: The electronic device 100 reports the 45-degree Sensor event to the sensor management service 121 in the framework layer 12 through the Sensorhub 131 in the Native layer 13, so as to realize the process that the Native layer 13 notifies the framework layer 12 of horizontal and vertical screen rotation.
步骤505:电子设备100通过框架层12中的sensor管理服务121向窗口管理服务122上报45度Sensor事件,以实现通知横竖屏旋转的流程。Step 505: The electronic device 100 reports the 45-degree sensor event to the window management service 122 through the sensor management service 121 in the framework layer 12, so as to realize the process of notifying the horizontal and vertical screen rotation.
步骤506:电子设备100通过框架层12中的窗口管理服务122根据45度Sensor事件,向转屏模块123发送预转屏的消息,指示转屏模块123开始执行预加载转屏资源的流程。Step 506 : The electronic device 100 sends a message of pre-screen rotation to the screen rotation module 123 through the window management service 122 in the framework layer 12 according to the 45-degree Sensor event, instructing the screen rotation module 123 to start the process of preloading the screen rotation resources.
可以理解的是,预转屏的流程指的是预加载转屏资源的流程。It can be understood that the process of pre-screen rotation refers to the process of preloading screen rotation resources.
在一些实施例中,窗口管理服务122收到45度Sensor事件,就获知了该45度Sensor事件中的预转屏标识信息,从而开始执行预转屏的流程,如预截屏等,而不是立即开始转屏。In some embodiments, when the window management service 122 receives the 45-degree Sensor event, it learns the identification information of the pre-rotation screen in the 45-degree Sensor event, so as to start the process of performing the pre-rotation screen, such as pre-screening, instead of immediately Start turning the screen.
步骤507:电子设备100通过框架层12中的转屏模块123调用窗口管理服务122中的预截屏和超时回滚流程函数,对屏幕当前显示的界面进行截屏得到截屏图像,并启用用于转屏超时回滚流程的线程。Step 507 : The electronic device 100 calls the pre-screenshot and timeout rollback process functions in the window management service 122 through the screen rotation module 123 in the framework layer 12 , takes a screenshot of the interface currently displayed on the screen to obtain a screenshot image, and enables the screen rotation The thread that times out rolls back the process.
在一些实施例中,转屏模块123调用超时回滚流程函数的情况下,可以修改超时回滚流程函数对应的回滚标志位,如将该标志位的数值由0修改为1。In some embodiments, when the screen rotation module 123 calls the timeout rollback process function, the rollback flag bit corresponding to the timeout rollback process function can be modified, for example, the value of the flag bit is changed from 0 to 1.
可以理解的是,转屏超时回滚流程的定时时长time1为预设定时时长,如500ms(毫秒)。此时,上述转屏超时回滚流程中的超时指的是计时时长超过该定时时长time1。It can be understood that the timing duration time1 of the screen-turning timeout rollback process is a preset timing duration, such as 500ms (milliseconds). At this time, the timeout in the above-mentioned screen transition timeout rollback process refers to that the timing duration exceeds the timing duration time1.
步骤508:电子设备100通过框架层12中的转屏模块123向Native层13中的图层合成管理服务132发送截屏图像。Step 508 : The electronic device 100 sends the screenshot image to the layer composition management service 132 in the Native layer 13 through the screen rotation module 123 in the framework layer 12 .
步骤509:电子设备100通过Native层13中的图层合成管理服务132生成与获取的截屏图像对应的转屏动画,并向转屏模块123发送生成的转屏动画。Step 509 : The electronic device 100 generates a screen transition animation corresponding to the acquired screenshot image through the layer composition management service 132 in the Native layer 13 , and sends the generated screen transition animation to the screen transition module 123 .
步骤510:电子设备100通过框架层12中的转屏模块123预加载获取的转屏动画。Step 510 : The electronic device 100 preloads the acquired screen rotation animation through the screen rotation module 123 in the framework layer 12 .
步骤511:电子设备100通过窗口管理服务122判断在超时回滚流程的定时时长内是否接收到60度Sensor事件,该60度Sensor事件中包括转屏标识信息,用于指示60度转屏的流程。Step 511: The electronic device 100 judges through the window management service 122 whether a 60-degree Sensor event is received within the time period of the timeout rollback process, and the 60-degree Sensor event includes screen rotation identification information, which is used to indicate the process of 60-degree screen rotation .
在一些实施例中,窗口管理服务122收到60度Sensor事件,就可以获知该60度Sensor事件中的转屏标识信息,从而触发开始执行转屏的流程,如加载转屏动画和暂时屏蔽屏幕的输入等操作。In some embodiments, when the window management service 122 receives the 60-degree Sensor event, it can learn the screen-turning identification information in the 60-degree Sensor event, thereby triggering the process of starting the screen-turning, such as loading the screen-turning animation and temporarily shielding the screen. input, etc.
如果超时回滚流程的定时时长内接收到60度Sensor事件,则电子设备100执行下述步骤512,以开始正式的转屏流程;反之,如果超时未接收到60度Sensor事件,则电子设备100执行下述步骤518,以取消转屏流程。If the 60-degree Sensor event is received within the time period of the timeout rollback process, the electronic device 100 executes the following step 512 to start the formal screen rotation process; otherwise, if the 60-degree Sensor event is not received over time, the electronic device 100 Execute the following step 518 to cancel the screen rotation process.
可以理解的是,电子设备100通过窗口管理服务122接收到60度Sensor事件,说明用户需求旋转屏幕,而非误触发转屏流程。It can be understood that the electronic device 100 receives the 60-degree Sensor event through the window management service 122, indicating that the user needs to rotate the screen, rather than triggering the screen rotation process by mistake.
此外,步骤511中判断接收的旋转角度包括但不限于60度,还可以为任意较大的角度,如59度或63度等,本申请实施例对此不作具体限定。In addition, the rotation angle determined to be received in step 511 includes, but is not limited to, 60 degrees, and may also be any larger angle, such as 59 degrees or 63 degrees, which is not specifically limited in this embodiment of the present application.
另外,可以理解的是,步骤511中Sensor 141检测到屏幕的旋转角度小于60度,即旋转角度为45-60度之间的角度时,电子设备100将不会通过硬件层14中的Sensor 141生成Sensor事件,或者虽然生成Sensor事件但是不会向Native层13上报该Sensor事件。In addition, it can be understood that, in step 511, when the Sensor 141 detects that the rotation angle of the screen is less than 60 degrees, that is, when the rotation angle is between 45 and 60 degrees, the electronic device 100 will not pass the Sensor 141 in the hardware layer 14. A Sensor event is generated, or although a Sensor event is generated, the Sensor event is not reported to the Native layer 13 .
步骤512a:电子设备100通过窗口管理服务122向框架层12中的转屏模块123发送启动转屏的消息。Step 512a: The electronic device 100 sends a message for starting the screen rotation to the screen rotation module 123 in the framework layer 12 through the window management service 122.
步骤512b:电子设备100通过窗口管理服务122向应用层11中的System UI 111发送通知应用旋转的消息。Step 512b: The electronic device 100 sends a message notifying the application rotation to the System UI 111 in the application layer 11 through the window management service 122.
作为一种示例,图5示出的上述步骤512a和步骤512b可以同时执行,在其他一些实现方式中,步骤512a和步骤512b还可以为其他执行顺序,此处不再赘述。As an example, the above-mentioned steps 512a and 512b shown in FIG. 5 may be performed simultaneously. In some other implementation manners, the steps 512a and 512b may also be performed in other execution sequences, which will not be repeated here.
在一些实施例中,转屏模块123结束用于转屏超时回滚流程的线程的情况下,可以还原超时回滚流程函数对应的回滚标志位,如将该标志位的数值由1还原为0。In some embodiments, when the screen rotation module 123 terminates the thread used for the screen rotation timeout rollback process, the rollback flag bit corresponding to the timeout rollback process function can be restored, for example, the value of the flag bit can be restored from 1 to 0.
此外,在上述步骤512中窗口管理服务122可以判断是否存在预截屏得到的截屏图像。如果存在预截屏得到的截屏图像,则跳过截屏流程;反之,则触 发转屏模块123执行截屏操作得到截屏图像,进而获取转屏动画。In addition, in the above-mentioned step 512, the window management service 122 may determine whether there is a pre-screenshot screenshot image. If there is a screen shot image obtained by pre-screening, the screen shot process is skipped; otherwise, the screen transfer module 123 is triggered to perform a screen capture operation to obtain a screen shot image, and then a screen transfer animation is obtained.
步骤513:电子设备100通过框架层12中的转屏模块123运行转屏动画,并结束用于转屏超时回滚流程的线程。Step 513 : The electronic device 100 runs the screen-turning animation through the screen-turning module 123 in the framework layer 12 , and ends the thread used for the screen-turning timeout rollback process.
可以理解的是,转屏模块123运行转屏动画,具体可以包括在屏幕上显示转屏动画和暂时屏蔽屏幕输入等操作。It can be understood that the screen-turning module 123 runs the screen-turning animation, which may specifically include operations such as displaying the screen-turning animation on the screen and temporarily blocking screen input.
步骤514:电子设备100通过应用层11中的System UI 111按照转屏后的屏幕显示状态,将当前运行的应用程序的界面在屏幕上进行重新布局。Step 514: The electronic device 100 rearranges the interface of the currently running application program on the screen through the System UI 111 in the application layer 11 according to the screen display state after the screen is rotated.
步骤515:电子设备100通过应用层11中的System UI 111对当前运行的应用程序的界面进行重新布局完成的情况下,向框架层12中的窗口管理服务122发送结束转屏消息,用于指示结束运行转屏动画。Step 515: When the interface of the currently running application program is rearranged by the System UI 111 in the application layer 11, the electronic device 100 sends an end screen transition message to the window management service 122 in the framework layer 12 to indicate Finish running the transition animation.
示例性的,如图6和图7所示,在屏幕由正向竖屏显示状态切换为正向横屏显示状态的情况下,电子设备100可以通过System UI 111对当前运行的应用程序1的界面中的进行重新布局,例如包括但不限于调整界面中的文字和图片等内容的显示方向和显示尺寸等布局。Exemplarily, as shown in FIG. 6 and FIG. 7 , when the screen is switched from the forward portrait display state to the forward landscape display state, the electronic device 100 can use the System UI 111 to modify the current running of the application 1. Re-layout in the interface, for example, includes but not limited to adjusting the display direction and display size of the content such as text and pictures in the interface.
步骤516:电子设备100通过框架层12中的窗口管理服务122,根据结束旋转消息,向转屏模块123发送结束转屏动画消息。Step 516 : The electronic device 100 sends a screen-turning animation ending message to the screen-turning module 123 through the window management service 122 in the framework layer 12 according to the end-turning message.
步骤517:电子设备100通过框架层12中的转屏模块123根据结束转屏消息,结束运行转屏动画。Step 517 : The electronic device 100 ends the running of the screen-turning animation through the screen-turning module 123 in the framework layer 12 according to the screen-turning end message.
步骤518:电子设备100通过框架层12中的窗口管理服务122执行转屏回滚。Step 518 : The electronic device 100 performs screen rollback through the window management service 122 in the framework layer 12 .
在一些实施例中,上述步骤518中执行转屏回滚可以包括以下至少一项:删除预加载的截屏图像、删除预加载的转屏动画、还原与超时回滚流程函数对应的回滚标志位的数值以及停止屏蔽屏幕上的输入。In some embodiments, performing the screen rollback in the above step 518 may include at least one of the following: deleting the preloaded screenshot image, deleting the preload screen turning animation, restoring the rollback flag corresponding to the timeout rollback process function value and stop masking the input on the screen.
本申请实施例中,电子设备通过设定触发预转屏的旋转角度(如45度)以及触发正式转屏的旋转角度(如60度),实现窗口管理服务分阶段加载转屏动画,提前对屏幕进行截屏。同时增加回滚保护机制,保证用户在转屏时,横竖屏45度和60度的原子操作,防止用户反复转屏时出现异常。具体地,由于本申请在屏幕的旋转角度到达较大的实际触发转屏的旋转角度(即60度)之前,已经预加载完成了转屏资源,因此在屏幕的旋转角度到达实际触发转屏的旋转角度时,可以立即运行已经加载的转屏资源完成转屏操作,快速完成转屏流程。如此,本申请提供转屏处理方法,相比与现有技术在较小的旋转角度开始触发转屏流程,可以减少转屏时长约40ms,提升屏幕旋转性能,并避免用户转屏误触。In the embodiment of the present application, the electronic device can set the rotation angle (such as 45 degrees) that triggers the pre-rotation screen and the rotation angle (such as 60 degrees) that triggers the official screen rotation, so that the window management service can load the screen rotation animation in stages, and adjust the screen rotation animation in advance. Take a screenshot of the screen. At the same time, a rollback protection mechanism is added to ensure the atomic operation of the horizontal and vertical screens at 45 degrees and 60 degrees when the user rotates the screen, so as to prevent abnormality when the user repeatedly rotates the screen. Specifically, before the rotation angle of the screen reaches the larger rotation angle that actually triggers the screen rotation (ie, 60 degrees), the screen rotation resource has been preloaded, so when the rotation angle of the screen reaches the actual trigger screen rotation angle When rotating the angle, you can immediately run the loaded screen rotation resources to complete the screen rotation operation, and quickly complete the screen rotation process. In this way, the present application provides a screen rotation processing method, which can reduce the screen rotation time by about 40ms, improve the screen rotation performance, and prevent the user from accidentally touching the screen.
图8示出了电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191, 指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。FIG. 8 shows a schematic structural diagram of the electronic device 100 . The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, wherein different processing units may be independent devices or may be integrated in one or more processors.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。例如,处理器110用于支持电子设备100执行上述方法实施例中的转屏方法,在屏幕的旋转角度为45度时预加载转屏资源,在旋转角度持续增大至60度时,根据预加载的转屏资源进行横竖屏旋转。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been 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. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system. For example, the processor 110 is configured to support the electronic device 100 to perform the screen rotation method in the above method embodiments, and preload the screen rotation resource when the rotation angle of the screen is 45 degrees, and when the rotation angle continues to increase to 60 degrees, according to the preloaded rotation angle The loaded screen rotation resources are rotated horizontally and vertically.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。例如,电子设备100可以通过无线通信功能与管理设备200建立无线通信。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like. For example, the electronic device 100 may establish wireless communication with the management device 200 through a wireless communication function.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星***(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能,例如显示上述示例中的驱动管理界面。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through the GPU, the display screen 194, and the application processor, etc., for example, displaying the driver management interface in the above example. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能,如显示屏194用于在竖屏显示状态或横屏状态下显示应用程序的界面或者桌面界面。The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. or desktop interface.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩 展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example save music, video in external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。 Internal memory 121 may be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing the instructions stored in the internal memory 121 . The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
电子设备100的软件***可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android***为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
图9是本申请实施例的。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android***分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和***库,以及内核层。应用程序层可以包括一系列应用程序包。FIG. 9 shows an 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 with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer. The application layer can include a series of application packages.
如图9所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。在一些实施例中,图2示出的电子设备中的应用层11可以为图9示出的应用程序层,具体地应用程序层还包括System UI 111和Launcher 112。As shown in Figure 9, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. In some embodiments, the application layer 11 in the electronic device shown in FIG. 2 may be the application layer shown in FIG. 9 . Specifically, the application layer further includes System UI 111 and Launcher 112.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。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.
如图9所示,应用程序框架层可以包括窗口管理器,内容提供器,视图***,电话管理器,资源管理器,通知管理器等。在一些实施例中,图2示出的电子设备中的框架层12可以为图9示出的应用程序框架层,例如图2示出的Sensor管理服务121和窗口管理服务122和转屏模块123可以通过图9示出的应用程序框架层中窗口管理器和视图***实现。As shown in Figure 9, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like. In some embodiments, the framework layer 12 in the electronic device shown in FIG. 2 may be the application framework layer shown in FIG. 9 , such as the Sensor management service 121 , the window management service 122 and the screen rotation module 123 shown in FIG. 2 . It can be implemented by the window manager and the view system in the application framework layer shown in FIG. 9 .
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
视图***包括可视控件,例如显示文字的控件,显示图片的控件等。视图***可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图,如显示上述应用编排设计器中用户穿件图形化的深度学习模型的UI界面。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the SMS notification icon may include a view for displaying text and a view for displaying pictures, such as a UI interface for displaying the graphical deep learning model of the user in the above-mentioned application orchestration designer.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在***顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓***的调度和管理。Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
***库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子***进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. 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.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。在一些实施例中,图2示出的电子设备中的Native层13可以为图9示出的内核层,例如图2示出的Sensorhub(传感器控制器)131可以通过图9示出的传感器驱动实现,图2示出的图层合成管理服务132可以通过图9示出的显示驱动实现。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers. In some embodiments, the Native layer 13 in the electronic device shown in FIG. 2 may be the kernel layer shown in FIG. 9 . For example, the Sensorhub (sensor controller) 131 shown in FIG. 2 may be driven by the sensor shown in FIG. 9 . For implementation, the layer composition management service 132 shown in FIG. 2 can be implemented by the display driver shown in FIG. 9 .
本申请公开的机制的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程***上执行的计算机程序或程序代码,该可编程***包括至少一个处理器、存储***(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of the present application may be implemented as a computer program or program code executing on a programmable system including at least one processor, a storage system (including volatile and nonvolatile memory and/or storage elements) , at least one input device, and at least one output device.
可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理***包括具有诸如例如数字信号处理器(DSP)、微控制器、专用集成电路(ASIC)或微处理器之类的处理器的任何***。Program code may be applied to input instructions to perform the functions described herein and to generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), microcontroller, application specific integrated circuit (ASIC), or microprocessor.
程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理***通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。The program code may be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system. The program code may also be implemented in assembly or machine language, if desired. In fact, the mechanisms described in this application are not limited in scope to any particular programming language. In either case, the language may be a compiled language or an interpreted language.
在一些情况下,所公开的实施例可以以硬件、固件、软件或其任何组合来实现。所公开的实施例还可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如,指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、只读存储器(CD-ROMs)、磁光盘、只读存储器(ROM)、随机存取存储器(RAM)、可擦除可编程只读存储器(EPROM)、电可擦除可编程只读存储器(EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如,计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (eg, computer-readable) storage media, which can be executed by one or more processors read and execute. For example, the instructions may be distributed over a network or over other computer-readable media. Thus, a machine-readable medium can include any mechanism for storing or transmitting information in a form readable by a machine (eg, a computer), including, but not limited to, floppy disks, optical disks, optical disks, read only memories (CD-ROMs), magnetic Optical Disc, Read Only Memory (ROM), Random Access Memory (RAM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Magnetic or Optical Cards, Flash Memory, or Tangible machine-readable storage for transmitting information (eg, carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagating signals. Thus, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。In the drawings, some structural or method features may be shown in specific arrangements and/or sequences. It should be understood, however, that such specific arrangements and/or orderings may not be required. Rather, in some embodiments, the features may be arranged in a manner and/or order different from that shown in the illustrative figures. Additionally, the inclusion of structural or method features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments such features may not be included or may be combined with other features.
需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。It should be noted that each unit/module mentioned in each device embodiment of this application is a logical unit/module. Physically, a logical unit/module may be a physical unit/module or a physical unit/module. A part of a module can also be implemented by a combination of multiple physical units/modules. The physical implementation of these logical units/modules is not the most important, and the combination of functions implemented by these logical units/modules is the solution to the problem of this application. The crux of the technical question raised. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units/modules that are not closely related to solving the technical problems raised in the present application, which does not mean that the above-mentioned device embodiments do not exist. other units/modules.
需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in the examples and specification of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that Any such actual relationship or sequence exists between these entities or operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a" does not preclude the presence of additional identical elements in a process, method, article, or device that includes the element.
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be understood by those of ordinary skill in the art that various changes in form and detail may be made therein without departing from the present disclosure The spirit and scope of the application.

Claims (16)

  1. 一种转屏处理方法,应用于电子设备,其特征在于,包括:A screen rotation processing method, applied to electronic equipment, is characterized in that, comprising:
    在所述电子设备的屏幕的旋转角度达到第一角度阈值的情况下,预加载转屏资源,其中所述电子设备的屏幕处于第一屏幕显示状态;In the case that the rotation angle of the screen of the electronic device reaches the first angle threshold, preloading the screen rotation resource, wherein the screen of the electronic device is in the first screen display state;
    在所述屏幕的旋转角度在预设时长内从所述第一角度阈值增加至第二角度阈值的情况下,基于所述转屏资源完成转屏操作,在所述转屏操作完成后所述屏幕切换为第二屏幕显示状态。In the case where the rotation angle of the screen increases from the first angle threshold to the second angle threshold within a preset time period, the screen rotation operation is completed based on the screen rotation resource, and the screen rotation operation is completed after the screen rotation operation is completed. The screen switches to the second screen display state.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    在所述屏幕的旋转角度在所述预设时长内未从所述第一角度阈值增加至所述第二角度阈值的情况下,控制所述屏幕持续处于所述第一屏幕显示状态。In the case that the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within the preset time period, the screen is controlled to remain in the first screen display state.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    在所述屏幕的旋转角度在所述预设时长内未从所述第一角度阈值增加至所述第二角度阈值的情况下,删除预加载的所述转屏资源。In the case that the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within the preset time period, the preloaded screen rotation resource is deleted.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述转屏资源包括以下至少一项:对所述屏幕当前显示的目标界面执行截屏操作得到的截屏图像;根据所述截屏图像生成的转屏动画;用于暂时屏蔽所述屏幕上的输入的资源。The method according to any one of claims 1 to 3, wherein the screen rotation resource includes at least one of the following: a screenshot image obtained by performing a screenshot operation on a target interface currently displayed on the screen; Screenshot animations generated from screen shots; resources used to temporarily block input on the screen.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,在所述屏幕切换为所述第二屏幕显示状态的情况下,所述屏幕上显示的界面的布局为与所述第二屏幕显示状态对应的布局;在所述屏幕切换为所述第二屏幕显示状态之前,所述屏幕上显示的界面的布局为与所述第一屏幕显示状态对应的布局。The method according to any one of claims 1 to 4, wherein when the screen is switched to the second screen display state, the layout of the interface displayed on the screen is the same as that of the second screen. The layout corresponding to the second screen display state; before the screen is switched to the second screen display state, the layout of the interface displayed on the screen is the layout corresponding to the first screen display state.
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    所述在所述电子设备的屏幕的旋转角度达到第一角度阈值的情况下,预加载转屏资源,包括:When the rotation angle of the screen of the electronic device reaches the first angle threshold, preloading the screen rotation resource includes:
    获取第一Sensor事件,并根据第一Sensor事件预加载转屏资源;Obtain the first Sensor event, and preload the screen transition resources according to the first Sensor event;
    其中,所述第一Sensor事件用于指示所述屏幕的旋转角度达到所述第一角度阈值并用于触发预加载所述转屏资源。The first Sensor event is used to indicate that the rotation angle of the screen reaches the first angle threshold and to trigger preloading of the screen rotation resource.
  7. 根据权利要求1所述的方法,其特征在于,所述在所述屏幕的旋转角度在预设时长内从所述第一角度阈值增加至第二角度阈值的情况下,基于所述转屏资源完成转屏操作,包括:The method according to claim 1, wherein, in the case that the rotation angle of the screen increases from the first angle threshold to the second angle threshold within a preset time period, the screen rotation resource is based on the Complete the screen rotation operation, including:
    获取第二Sensor事件,并根据所述第二Sensor事件基于所述转屏资源完成所述转屏操作;Acquire a second Sensor event, and complete the screen-turning operation based on the screen-turning resource according to the second Sensor event;
    其中,所述第二Sensor事件用于指示所述屏幕的旋转角度在所述预设时长内从所述第一角度阈值增加至所述第二角度阈值,并触发执行所述转屏操作。The second Sensor event is used to indicate that the rotation angle of the screen increases from the first angle threshold to the second angle threshold within the preset time period, and triggers the execution of the screen rotation operation.
  8. 一种转屏处理装置,应用于电子设备,其特征在于,包括:A screen rotation processing device, applied to electronic equipment, is characterized in that, comprising:
    加载模块,用于在所述电子设备的屏幕的旋转角度达到第一角度阈值的情况下,预加载转屏资源,其中所述电子设备的屏幕处于第一屏幕显示状态;a loading module, configured to preload the screen rotation resource when the rotation angle of the screen of the electronic device reaches a first angle threshold, wherein the screen of the electronic device is in the first screen display state;
    执行模块,用于在所述屏幕的旋转角度在预设时长内从所述第一角度阈值增加至第二角度阈值的情况下,基于所述加载模块加载的所述转屏资源完成转屏操作,在所述转屏操作完成后所述屏幕切换为第二屏幕显示状态。an execution module, configured to complete the screen rotation operation based on the screen rotation resource loaded by the loading module when the rotation angle of the screen increases from the first angle threshold to the second angle threshold within a preset time period , the screen is switched to the second screen display state after the screen rotation operation is completed.
  9. 根据权利要求8所述的装置,其特征在于,The device of claim 8, wherein:
    所述执行模块,还用于在所述屏幕的旋转角度在所述预设时长内未从所述第一角度阈值增加至所述第二角度阈值的情况下,控制所述屏幕持续处于所述第一屏幕显示状态。The execution module is further configured to control the screen to continue to be in the The first screen shows the status.
  10. 根据权利要求8或9所述的装置,其特征在于,The device according to claim 8 or 9, characterized in that,
    所述执行模块,还用于在所述屏幕的旋转角度在所述预设时长内未从所述第一角度阈值增加至所述第二角度阈值的情况下,删除预加载的所述转屏资源。The execution module is further configured to delete the preloaded screen rotation when the rotation angle of the screen does not increase from the first angle threshold to the second angle threshold within the preset time period resource.
  11. 根据权利要求8至10中任一项所述的装置,其特征在于,所述转屏资源包括以下至少一项:对所述屏幕当前显示的目标界面执行截屏操作得到的截屏图像;根据所述截屏图像生成的转屏动画;用于暂时屏蔽所述屏幕上的输入的资源。The device according to any one of claims 8 to 10, wherein the screen rotation resource includes at least one of the following: a screenshot image obtained by performing a screenshot operation on a target interface currently displayed on the screen; Screenshot animations generated from screen shots; resources used to temporarily block input on the screen.
  12. 根据权利要求8至11中任一项所述的装置,其特征在于,在所述屏幕切换为所述第二屏幕显示状态的情况下,所述屏幕上显示的界面的布局为与所述第二屏幕显示状态对应的布局;在所述屏幕切换为所述第二屏幕显示状态之前,所述屏幕上显示的界面的布局为与所述第一屏幕显示状态对应的布局。The device according to any one of claims 8 to 11, wherein when the screen is switched to the second screen display state, the layout of the interface displayed on the screen is the same as that of the second screen. The layout corresponding to the second screen display state; before the screen is switched to the second screen display state, the layout of the interface displayed on the screen is the layout corresponding to the first screen display state.
  13. 根据权利要求8所述的装置,其特征在于,The device of claim 8, wherein:
    所述执行模块,具体用于获取第一Sensor事件,并根据第一Sensor事件预加载转屏资源;The execution module is specifically configured to acquire the first Sensor event, and preload the screen transition resource according to the first Sensor event;
    其中,所述第一Sensor事件用于指示所述屏幕的旋转角度达到所述第一角度阈值并用于触发预加载所述转屏资源。The first Sensor event is used to indicate that the rotation angle of the screen reaches the first angle threshold and to trigger preloading of the screen rotation resource.
  14. 根据权利要求8所述的装置,其特征在于,The device of claim 8, wherein:
    所述执行模块,具体用于获取第二Sensor事件,并根据所述第二Sensor事件基于所述转屏资源完成所述转屏操作;The execution module is specifically configured to acquire a second Sensor event, and complete the screen-turning operation based on the screen-turning resource according to the second Sensor event;
    其中,所述第二Sensor事件用于指示所述屏幕的旋转角度在所述预设时长内从所述第一角度阈值增加至所述第二角度阈值,并触发执行所述转屏操作。The second Sensor event is used to indicate that the rotation angle of the screen increases from the first angle threshold to the second angle threshold within the preset time period, and triggers the execution of the screen rotation operation.
  15. 一种可读介质,其特征在于,所述可读介质上存储有指令,所述指令在电子设备上执行时使所述电子设备执行权利要求1至7中任一项所述的转屏处理方法。A readable medium, wherein an instruction is stored on the readable medium, and when the instruction is executed on an electronic device, the electronic device executes the screen rotation process described in any one of claims 1 to 7 method.
  16. 一种电子设备,其特征在于,包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令,以及处理器,是所述电子设备的处理器之一,用于执行权利要求1至7中任一项所述的转屏处理方法。An electronic device, characterized by comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, for executing the claims The screen rotation processing method described in any one of 1 to 7.
PCT/CN2022/078706 2021-03-08 2022-03-02 Screen rotation processing method and apparatus, medium and electronic device WO2022188667A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110249932.X 2021-03-08
CN202110249932.XA CN115033193B (en) 2021-03-08 2021-03-08 Screen turning processing method and device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2022188667A1 true WO2022188667A1 (en) 2022-09-15

Family

ID=83118052

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/078706 WO2022188667A1 (en) 2021-03-08 2022-03-02 Screen rotation processing method and apparatus, medium and electronic device

Country Status (2)

Country Link
CN (1) CN115033193B (en)
WO (1) WO2022188667A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069223B (en) * 2023-03-07 2023-08-04 荣耀终端有限公司 Anti-shake method, anti-shake device and wearable equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110221667A1 (en) * 2010-03-09 2011-09-15 Samsung Electronics Co. Ltd. Apparatus and method for switching screen in mobile terminal
CN103809928A (en) * 2012-11-14 2014-05-21 腾讯科技(深圳)有限公司 Display method, device and system for transaction trend chart
CN106155476A (en) * 2016-06-21 2016-11-23 努比亚技术有限公司 Mobile terminal and screen content changing method
CN109213462A (en) * 2018-08-07 2019-01-15 武汉斗鱼网络科技有限公司 Android horizontal/vertical screen method of data synchronization, device, terminal and readable medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105915705A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Screen rotation method and screen rotation device
CN106406732A (en) * 2016-09-05 2017-02-15 努比亚技术有限公司 Virtual key processing device and method for terminal equipment
CN107015747A (en) * 2016-11-30 2017-08-04 阿里巴巴集团控股有限公司 Method and mobile terminal that control mobile terminal screen is shown
CN115016753A (en) * 2017-04-20 2022-09-06 华为技术有限公司 Display control method and device
KR101899323B1 (en) * 2018-06-11 2018-09-17 삼성전자 주식회사 Controlling Method For Rotating Screen And Portable Device, and Touch System supporting the same
CN111885265B (en) * 2020-07-31 2022-06-24 Oppo广东移动通信有限公司 Screen interface adjusting method and related device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110221667A1 (en) * 2010-03-09 2011-09-15 Samsung Electronics Co. Ltd. Apparatus and method for switching screen in mobile terminal
CN103809928A (en) * 2012-11-14 2014-05-21 腾讯科技(深圳)有限公司 Display method, device and system for transaction trend chart
CN106155476A (en) * 2016-06-21 2016-11-23 努比亚技术有限公司 Mobile terminal and screen content changing method
CN109213462A (en) * 2018-08-07 2019-01-15 武汉斗鱼网络科技有限公司 Android horizontal/vertical screen method of data synchronization, device, terminal and readable medium

Also Published As

Publication number Publication date
CN115033193A (en) 2022-09-09
CN115033193B (en) 2024-05-03

Similar Documents

Publication Publication Date Title
US10187872B2 (en) Electronic device and method of providing notification by electronic device
US20220075696A1 (en) Application Exception Recovery
US11294560B2 (en) Method and apparatus for changing the ratio between interfaces
EP2245589B1 (en) Multi-context graphics processing
AU2014288039B2 (en) Remote operation of applications using received data
US9448694B2 (en) Graphical user interface for navigating applications
US8477143B2 (en) Buffers for display acceleration
EP2798485B1 (en) Method and apparatus for intuitive multitasking
WO2021082739A1 (en) Multi-task interface management method and electronic device
AU2014200184B2 (en) Method and apparatus for controlling multitasking in electronic device using double-sided display
CN108463799B (en) Flexible display of electronic device and operation method thereof
KR102480895B1 (en) Electronic device and method for controlling operation thereof
US20180196584A1 (en) Execution of multiple applications on a device
CN114020652B (en) Application program management method and electronic equipment
WO2023024900A1 (en) Method for secure boot checking and electronic device
CN118276722A (en) Window display method and electronic device
CN112347048A (en) Electronic device and data sharing method thereof
WO2022188667A1 (en) Screen rotation processing method and apparatus, medium and electronic device
US10740252B2 (en) Serial peripheral interface filter for processor security
WO2022017328A1 (en) Method for displaying lock screen interface of electronic device and electronic device
US20240211122A1 (en) Screen rotation control method and apparatus, and electronic device
KR20150117968A (en) Apparatas and method for changing a function according to input direction in an electronic device
WO2019128545A1 (en) Process handling method, and electronic device and computer-readable storage medium
CN116088970B (en) Method for controlling application call and related device
CN117094876A (en) Data processing method, electronic device and readable storage medium

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: 22766193

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22766193

Country of ref document: EP

Kind code of ref document: A1