This application relates to the field of display technologies, and in particular, to a display control method and apparatus.
With the gradual maturity of folding screen technologies, there are more and more foldable electronic devices. When a foldable electronic device is in an unfolded state, the foldable electronic device can be used as a tablet, and displays content through an inner screen of the foldable electronic device. When the foldable electronic device is in a folded state, the foldable electronic device can be used as a mobile phone, and displays content through an outer screen of the foldable electronic device.
Display states of the inner screen and the outer screen include a landscape state and a portrait state. Content is displayed in the landscape state or the portrait state, but content display does not meet the needs of users. It can be seen that content display of the foldable electronic device needs to be improved.
This application provides a display control method and apparatus, aiming at improving content display of foldable electronic devices. To achieve the foregoing objective, this application provides the following technical solutions.
According to a first aspect, this application provides a display control method, applied to an electronic device including a first display screen and a second display screen. The method includes: in response to a first type of operation of a user, if the electronic device is in a first usage posture of a folded state, displaying first application content in a first display direction through the first display screen, and if the electronic device is in a first usage posture of an unfolded state, displaying the first application content in the first display direction through the second display screen; in response to a second type of operation of a user, if the electronic device is switched from the first usage posture of the folded state to a second usage posture of the folded state and a first control flag of the electronic device is a first value, displaying the first application content in a second display direction through the first display screen, where the second display direction is different from the first display direction, and the first usage posture is different from the second usage posture; and if the electronic device is switched from the first usage posture of the unfolded state to a second usage posture of the unfolded state and a second control flag of the electronic device is a second value, continuing to display the first application content in the first display direction through the second display screen.
It can be seen from the above technical solutions that the electronic device can be used in different usage postures of the folded state or the unfolded state, the content is displayed through the first display screen in the folded state, and the content is displayed through the second display screen in the unfolded state. If the electronic device is switched from the first usage posture of the folded state to the second usage posture of the folded state and the first control flag is the first value, the first display screen is switched from the first display direction to the second display direction, and the first application content is displayed in the second display direction. If the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state and the second control flag is the second value, the second display screen can continue to display the first application content in the first display direction, to control the first display screen and the second display screen based on the first control flag and the second control flag. Besides, the first control flag corresponds to the first display screen, and the second control flag corresponds to the second display screen. The first control flag and the second control flag are independent of each other and do not affect each other. Therefore, the first display screen can be independently controlled based on the first control flag, and the second display screen can be independently controlled based on the second control flag, preventing the display of the first display screen from affecting the display of the second display screen.
For example, the first usage posture and the second usage posture are respectively one of a portrait usage posture, a left landscape usage posture, and a right landscape usage posture. The portrait usage posture corresponds to portrait display, and the left landscape usage posture corresponds to left landscape display, and the right landscape usage gesture corresponds to right landscape display. If the electronic device is in the folded state and is switched from the portrait usage posture to the left landscape usage posture, the first control flag is the first value, and the first value indicates that a first display screen automatic rotation function is enabled, the electronic device can be switched from portrait display to left landscape display to display the first application content. If the electronic device is in the unfolded state and is switched from the portrait usage posture to the left landscape usage posture, the second control flag is the second value, and the second value indicates that an automatic rotation function of the second display screen is disabled, the usage posture of the electronic device changes but the second display screen still displays the first application content in the portrait mode, so that the display of the first display screen and the second display screen can be independently controlled according to whether the automatic rotation function is enabled, so as to prevent the first display screen and the second display screen from affecting each other.
In a possible implementation, the method further includes: if the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state, and the second control flag is the first value, displaying the first application content in the second display direction through the second display screen, where the first application content is content of a first application running in the foreground of the electronic device; in response to a third type of operation of the user, adjusting the second control flag from the first value to the second value; in response to the second type of operation of the user, if the electronic device is switched from the second usage posture of the unfolded state to a third usage posture of the unfolded state, displaying the first application content in the second display direction through the second display screen, where the second usage posture and the third usage posture are different; in response to a fourth type of operation of the user, switching an application running in the foreground of the electronic device from the first application to a second application, where the first application and the second application are landscape and portrait display applications; and displaying second application content in the second display direction through the second display screen, where the second application content is content of the second application.
In this embodiment, if the second control flag is the first value, it means that the electronic device has enabled the automatic rotation function of the second display screen, and when the usage posture of the electronic device in the unfolded state changes, the display direction of the second display screen can also change. When the second control flag maintains the second value, the application running in the foreground of the electronic device is switched from the first application to the second application of the same type as the first application, and the electronic device can display the content of the second application in the same display direction as that of the first application content, so that the first application and the second application of the same type can adopt the same display direction when the second control flag is the second value. Therefore, after the display direction is fixed, this reduces the probability that the display direction of the second display screen is forced to rotate due to application switching. For example, when the second control flag is the first value, the second display screen is displayed in left landscape mode, the electronic device is switched from the gallery application to the setting application, and when the setting application is started, the electronic device can display content of the setting application in left landscape mode.
In a possible implementation, the method further includes: in response to the fourth type of operation of the user, switching the application running in the foreground of the electronic device from the second application to the first application; and displaying the first application content in the second display direction through the second display screen, so that when the second control flag maintains the second value, after the electronic device runs the first application again, the content of the first application is still displayed in the previous display direction (that is, the second display direction).
In a possible implementation, after displaying the first application content in the second display direction through the second display screen or displaying the second application content in the second display direction through the second display screen, the method further includes: in response to a screen lock operation of the user, the second display screen is in a black screen state; when the second display screen is switched from the black screen state to an off screen display state, displaying an unlocking interface in the second display direction through the second display screen; and in response to an unlocking operation of the user, switching the second display screen from displaying the unlocking interface to displaying application content, and displaying application content in the second display direction through the second display screen. Because the second control flag maintains the second value, and the display direction of the electronic device is fixed at the second display direction, regardless of whether the unlocking interface or the application content is displayed, the electronic device can display the unlocking interface or the application content in the second display direction. Therefore, after the display direction is fixed, when the application is entered again, the display direction maintains unchanged and there is no forced rotation of the display direction.
In a possible implementation, the first application content is the content of the first application running in the foreground of the electronic device, and the first application is a landscape and portrait display application. The method further includes: in response to the fourth type of operation of the user, switching an application running in the foreground of the electronic device from the first application to a fourth application, where the fourth application is a portrait display application; and if the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state, and the second control flag is the first value, displaying fourth application content in the second display direction or the first display direction through the second display screen, where the fourth application content is content of the fourth application, a usage direction of the first usage posture is one of portrait and inverted portrait, a usage direction of the second usage posture is opposite to that of the first usage posture, and the second display direction is opposite to the first display direction. For a portrait display application, after the electronic device is switched from a portrait usage posture to an inverted portrait usage posture, the display direction of the second display screen may change or maintain unchanged.
In a possible implementation, the method further includes: in response to the first type of operation of the user, if the electronic device is in a special usage posture of the unfolded state, and the second control flag is the first value, displaying the first application content in a portrait display direction through the second display screen; in response to the third type of operation of the user, adjusting the second control flag from the first value to the second value; and when the electronic device maintains the special usage posture of the unfolded state, displaying the first application content in the portrait display direction through the second display screen. In this embodiment, the special usage posture may be a flat posture. If the electronic device is in the flat posture, and the second control flag is the first value before the first application is started, the second display screen can display the first application content in the portrait mode. After the first application is started, the second control flag is adjusted to the second value. In this case, the first application content can maintain display in the portrait mode.
In a possible implementation, the method further includes: if the electronic device is in the special usage posture of the unfolded state and the second control flag is the first value after displaying the first application content, maintaining the display direction of the second display screen unchanged. For example, the second display screen displays the first application content in the second display direction, and then the electronic device is in the special usage posture of the unfolded state. Even if the second control flag is the first value, the second display screen still displays the first application content in the second display direction. If switching from the first application to the second application, when the electronic device maintains the special usage posture, the second display screen can display the content of the second application in the second display direction, so that the display direction of the second display screen maintains unchanged under the special usage posture.
In a possible implementation, the method further includes: determining a current usage form of the electronic device through an angle recognition module of the electronic device; determining a current usage posture of the electronic device through a direction recognition module of the electronic device; if the current usage form of the electronic device is the folded state, controlling display of the first display screen through a first display screen direction control module of the electronic device according to the current usage posture of the electronic device and the first control flag; and if the current usage form of the electronic device is the unfolded state, controlling display of the second display screen through a second display screen direction control module of the electronic device according to the current usage posture of the electronic device and the second control flag, so as to control the first display screen through the first display screen direction control module, and control the second display screen through the second display screen direction control module.
In a possible implementation, the method further includes: determining a type of the first application running in the foreground of the electronic device; and referring to the type of the first application by the first display screen direction control module and the second display screen direction control module when controlling the display, so as to control the display of the first display screen or the second display screen according to the type of the first application.
In a possible implementation, the controlling, if the current usage form of the electronic device is the unfolded state, display of the second display screen through a second display screen direction control module of the electronic device according to the current usage posture of the electronic device and the second control flag includes: if the first application is a landscape display application, controlling the second display screen to display in the left landscape mode when the current usage posture of the electronic device is the left landscape usage posture, and controlling the second display screen to display in the right landscape mode when the current usage posture of the electronic device is the right landscape usage posture; if the first application is a landscape and portrait display application and the current usage posture of the electronic device is a special usage posture, if it is determined that the second control flag is the first value before the first application is started, controlling the second display screen to display in the portrait mode, and if it is determined that the second control flag is the first value after the first application is started, controlling the second display screen to display in a display direction that is used before the first application is started; if the first application is a landscape and portrait display application and the current usage posture of the electronic device is not the special usage posture, if it is determined that the second control flag is the first value, controlling the second display screen to display in a display direction that matches the usage posture; and if the first application is a landscape and portrait display application, if it is determined that the second control flag is the second value, controlling the second display screen to display in an original effective direction, where the original effective direction is a display direction used by the second display screen for the last time before the second control flag is adjusted to the second value.
In a possible implementation, the controlling, if the current usage form of the electronic device is the unfolded state, display of the second display screen through a second display screen direction control module of the electronic device according to the current usage posture of the electronic device and the second control flag includes: if the first application is a portrait display application and the second control flag is the first value, controlling the second display screen to display in the portrait mode when the current usage posture of the electronic device is the portrait usage posture, and controlling the second display screen to display in portrait or inverted portrait mode when the current usage posture of the electronic device is an inverted portrait usage posture.
In a possible implementation, the determining a current usage form of the electronic device through an angle recognition module of the electronic device includes: obtaining a folding angle of the electronic device through the angle recognition module; if the folding angle of the electronic device is greater than a preset angle, determining that the electronic device is in the unfolded state; and if the folding angle of the electronic device is less than or equal to the preset angle, determining that the electronic device is in the folded state.
In a possible implementation, the determining a current usage posture of the electronic device through a direction recognition module of the electronic device includes: obtaining, by the direction recognition module, a pitch angle of the electronic device according to an acceleration value of a current frame; obtaining, by the direction recognition module, a deflection angle of the electronic device according to the pitch angle of the electronic device; and determining, by the direction recognition module, a usage direction of the electronic device according to the deflection angle of the electronic device, where the usage direction of the electronic device represents the usage posture of the electronic device.
In a possible implementation, the direction recognition module obtaining a pitch angle of the electronic device based on the acceleration value of the current frame includes: if the direction recognition module determines that a modulus of the acceleration value of the current frame does not exceed a preset modulus threshold, an amplitude difference between the acceleration value of the current frame and an acceleration value of a previous frame does not exceed a preset amplitude difference threshold, and a y-axis amplitude value of the acceleration value of the current frame is not a preset value, obtaining, by the direction recognition module, the pitch angle of the electronic device according to the acceleration value of the current frame; obtaining, by the direction recognition module, the deflection angle of the electronic device when the pitch angle is less than a preset pitch angle, and the determining, by the direction recognition module, a usage direction of the electronic device according to the deflection angle of the electronic device includes: correcting, by the direction recognition module, the deflection angle of the electronic device, where correcting the deflection angle includes correcting the deflection angle of the electronic device to a positive number if it is determined that the deflection angle of the electronic device is a negative number; maintaining the deflection angle unchanged if it is determined that the deflection angle of the electronic device is a positive number; and obtaining, by the direction recognition module, the usage direction of the electronic device according to the corrected deflection angle.
In a possible implementation, if the direction recognition module determines that a modulus of the acceleration value of the current frame exceeds a preset modulus threshold, or an amplitude difference between the acceleration value of the current frame and an acceleration value of a previous frame exceeds a preset amplitude difference threshold, or a y-axis amplitude value of the acceleration value of the current frame is a preset value, the direction recognition module determines that the acceleration value of the current frame is invalid; and/or the direction recognition module determines that the usage posture of the electronic device is the special usage posture when the pitch angle is greater than or equal to the preset pitch angle; and/or the direction recognition module replaces the acceleration value of the previous frame with the acceleration value of the current frame after determining the usage direction of the electronic device.
According to a second aspect, this application provides an electronic device. The electronic device includes a first display screen, a second display screen, one or more processors, and a memory; where the memory stores programs, and when executed by the one or more processors, the programs cause the electronic device to perform the above display control method.
According to a third aspect, this application provides a readable storage medium. The readable storage medium stores a computer program, and when the computer program is executed by a processor, the above display control method is implemented.
According to a fourth aspect, this application provides a display control apparatus, applied to an electronic device including a first display screen and a second display screen. The apparatus includes: a first control module, configured to: in response to a first type of operation of a user, if the electronic device is in a first usage posture of a folded state, display first application content in a first display direction through the first display screen, and if the electronic device is in a first usage posture of an unfolded state, display the first application content in the first display direction through the second display screen; a first display screen direction control module, configured to: in response to a second type of operation of a user, if the electronic device is switched from the first usage posture of the folded state to a second usage posture of the folded state and a first control flag of the electronic device is a first value, display the first application content in a second display direction through the first display screen, where the second display direction is different from the first display direction, and the first usage posture is different from the second usage posture; and a second display screen direction control module, configured to: if the electronic device is switched from the first usage posture of the unfolded state to a second usage posture of the unfolded state and a second control flag of the electronic device is a second value, continue to display the first application content in the first display direction through the second display screen.
It can be seen from the above technical solutions that the electronic device can be used in different usage postures of the folded state or the unfolded state, the content is displayed through the first display screen in the folded state, and the content is displayed through the second display screen in the unfolded state. If the electronic device is switched from the first usage posture of the folded state to the second usage posture of the folded state and the first control flag is the first value, the first display screen is switched from the first display direction to the second display direction, and the first application content is displayed in the second display direction. If the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state and the second control flag is the second value, the second display screen can continue to display the first application content in the first display direction, to control the first display screen and the second display screen based on the first control flag and the second control flag. Besides, the first control flag corresponds to the first display screen, and the second control flag corresponds to the second display screen. The first control flag and the second control flag are independent of each other and do not affect each other. Therefore, the first display screen can be independently controlled based on the first control flag, and the second display screen can be independently controlled based on the second control flag, preventing the display of the first display screen from affecting the display of the second display screen.
For example, the first usage posture and the second usage posture are respectively one of a portrait usage posture, a left landscape usage posture, and a right landscape usage posture. The portrait usage posture corresponds to portrait display, and the left landscape usage posture corresponds to left landscape display, and the right landscape usage gesture corresponds to right landscape display. If the electronic device is in the folded state and is switched from the portrait usage posture to the left landscape usage posture, the first control flag is the first value, and the first value indicates that a first display screen automatic rotation function is enabled, the electronic device can be switched from portrait display to left landscape display to display the first application content. If the electronic device is in the unfolded state and is switched from the portrait usage posture to the left landscape usage posture, the second control flag is the second value, and the second value indicates that an automatic rotation function of the second display screen is disabled, the usage posture of the electronic device changes but the second display screen still displays the first application content in the portrait mode, so that the display of the first display screen and the second display screen can be independently controlled according to whether the automatic rotation function is enabled, so as to prevent the first display screen and the second display screen from affecting each other.
In a possible implementation, the second display screen direction control module is configured to: if the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state, and the second control flag is the first value, display the first application content in the second display direction through the second display screen, where the first application content is content of a first application running in the foreground of the electronic device. The apparatus further includes: an adjustment module and a switching module. The adjustment module is configured to: in response to the third type of operation of the user, adjust the second control flag from the first value to the second value. The second display screen direction control module is configured to: in response to the second type of operation of the user, if the electronic device is switched from the second usage posture of the unfolded state to a third usage posture of the unfolded state, display the first application content in the second display direction through the second display screen, where the second usage posture and the third usage posture are different. The switching module is configured to: in response to a fourth type of operation of the user, switch an application running in the foreground of the electronic device from the first application to a second application, where the first application and the second application are landscape and portrait display applications. The second display screen direction control module is configured to display second application content in the second display direction through the second display screen, where the second application content is content of the second application.
In this embodiment, if the second control flag is the first value, it means that the electronic device has enabled the automatic rotation function of the second display screen, and when the usage posture of the electronic device in the unfolded state changes, the display direction of the second display screen can also change. When the second control flag maintains the second value, the application running in the foreground of the electronic device is switched from the first application to the second application of the same type as the first application, and the electronic device can display the content of the second application in the same display direction as that of the first application content, so that the first application and the second application of the same type can adopt the same display direction when the second control flag is the second value. Therefore, after the display direction is fixed, this reduces the probability that the display direction of the second display screen is forced to rotate due to application switching. For example, when the second control flag is the first value, the second display screen is displayed in left landscape mode, the electronic device is switched from the gallery application to the setting application, and when the setting application is started, the electronic device can display content of the setting application in left landscape mode.
In a possible implementation, the switching module is configured to: in response to the fourth type of operation of the user, switch the application running in the foreground of the electronic device from the second application to the first application; and the second display screen direction control module is configured to display the first application content in the second display direction through the second display screen, so that when the second control flag maintains the second value, after the electronic device runs the first application again, the content of the first application is still displayed in the previous display direction (that is, the second display direction).
In a possible implementation, the apparatus further includes: a screen lock module, configured to: in response to a screen lock operation of the user, locking the second display screen in a black screen state; and an unlocking module, configured to: when the second display screen is switched from the black screen state to an off screen display state, display an unlocking interface in the second display direction through the second display screen; a second display screen direction control module, configured to: in response to an unlocking operation of the user, switch the second display screen from displaying the unlocking interface to displaying application content, and display application content in the second display direction through the second display screen. Because the second control flag maintains the second value, and the display direction of the electronic device is fixed at the second display direction, regardless of whether the unlocking interface or the application content is displayed, the electronic device can display the unlocking interface or the application content in the second display direction. Therefore, after the display direction is fixed, when the application is entered again, the display direction maintains unchanged and there is no forced rotation of the display direction.
In a possible implementation, the first application content is the content of the first application running in the foreground of the electronic device, and the first application is a landscape and portrait display application. The apparatus further includes: a switching module, configured to: in response to the fourth type of operation of the user, switch an application running in the foreground of the electronic device from the first application to a fourth application, where the fourth application is a portrait display application; and a second display screen direction control module, configured to: if the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state, and the second control flag is the first value, display fourth application content in the second display direction or the first display direction through the second display screen, where the fourth application content is content of the fourth application, a usage direction of the first usage posture is one of portrait and inverted portrait, a usage direction of the second usage posture is opposite to that of the first usage posture, and the second display direction is opposite to the first display direction. For a portrait display application, after the electronic device is switched from a portrait usage posture to an inverted portrait usage posture, the display direction of the second display screen may change or maintain unchanged.
In a possible implementation, the second display screen direction control module is configured to: in response to the first type of operation of the user, if the electronic device is in a special usage posture of the unfolded state, and the second control flag is the first value, display the first application content in a portrait display direction through the second display screen. The apparatus further includes: an adjustment module, configured to: in response to the third type of operation of the user, adjust the second control flag from the first value to the second value; and a second display screen direction control module, configured to: when the electronic device maintains the special usage posture of the unfolded state, display the first application content in the portrait display direction through the second display screen. In this embodiment, the special usage posture may be a flat posture. If the electronic device is in the flat posture, and the second control flag is the first value before the first application is started, the second display screen can display the first application content in the portrait mode. After the first application is started, the second control flag is adjusted to the second value. In this case, the first application content can maintain display in the portrait mode.
In a possible implementation, the second display screen direction control module is configured to: if the electronic device is in the special usage posture of the unfolded state and the second control flag is the first value after displaying the first application content, maintain the display direction of the second display screen unchanged. For example, the second display screen displays the first application content in the second display direction, and then the electronic device is in the special usage posture of the unfolded state. Even if the second control flag is the first value, the second display screen still displays the first application content in the second display direction. If switching from the first application to the second application, when the electronic device maintains the special usage posture, the second display screen can display the content of the second application in the second display direction, so that the display direction of the second display screen maintains unchanged under the special usage posture.
In a possible implementation, the apparatus further includes: an angle recognition module and a direction recognition module, where the angle recognition module is configured to determine the current usage form of the electronic device and the direction recognition module is configured to determine the current usage posture of the electronic device; a first display screen direction control module, configured to: if the current usage form of the electronic device is the folded state, control display of the first display screen according to the current usage posture of the electronic device and the first control flag; and a second display screen direction control module, configured to: if the current usage form of the electronic device is the unfolded state, control display of the second display screen according to the current usage posture of the electronic the second control flag, so as to control the first display screen through the first display screen direction control module, and control the second display screen through the second display screen direction control module.
In a possible implementation, the apparatus further includes: a determining module, configured to determine a type of the first application running in the foreground of the electronic device. The first display screen direction control module and the second display screen direction control module refer to the type of the first application when controlling the display, so as to control the display of the first display screen or the second display screen according to the type of the first application.
In a possible implementation, the second display screen direction control module being configured to: if the current usage form of the electronic device is the unfolded state, control display of the second display screen according to the current usage posture of the electronic device and the second control flag includes: if the first application is a landscape display application, controlling the second display screen to display in the left landscape mode when the current usage posture of the electronic device is the left landscape usage posture, and controlling the second display screen to display in the right landscape mode when the current usage posture of the electronic device is the right landscape usage posture; if the first application is a landscape and portrait display application and the current usage posture of the electronic device is a special usage posture, if it is determined that the second control flag is the first value before the first application is started, controlling the second display screen to display in the portrait mode, and if it is determined that the second control flag is the first value after the first application is started, controlling the second display screen to display in a display direction that is used before the first application is started; if the first application is a landscape and portrait display application and the current usage posture of the electronic device is not the special usage posture, if it is determined that the second control flag is the first value, controlling the second display screen to display in a display direction that matches the usage posture; and if the first application is a landscape and portrait display application, if it is determined that the second control flag is the second value, controlling the second display screen to display in an original effective direction, where the original effective direction is a display direction used by the second display screen for the last time before the second control flag is adjusted to the second value.
In a possible implementation, the second display screen direction control module being configured to: if the current usage form of the electronic device is the unfolded state, control display of the second display screen according to the current usage posture of the electronic device and the second control flag includes: if the first application is a portrait display application and the second control flag is the first value, controlling the second display screen to display in the portrait mode when the current usage posture of the electronic device is the portrait usage posture, and controlling the second display screen to display in portrait or inverted portrait mode when the current usage posture of the electronic device is an inverted portrait usage posture.
In a possible implementation, the angle recognition module is configured to obtain a folding angle of the electronic device; if the folding angle of the electronic device is greater than a preset angle, determine that the electronic device is in the unfolded state; and if the folding angle of the electronic device is less than or equal to the preset angle, determine that the electronic device is in the folded state.
In a possible implementation, the direction recognition module is configured to obtain a pitch angle of the electronic device based on the acceleration value of the current frame; obtain a deflection angle of the electronic device according to the pitch angle of the electronic device; and determine a usage direction of the electronic device according to the deflection angle of the electronic device, where the usage direction of the electronic device represents the usage posture of the electronic device.
In a possible implementation, the direction recognition module is configured to: if the direction recognition module determines that a modulus of the acceleration value of the current frame does not exceed a preset modulus threshold, an amplitude difference between the acceleration value of the current frame and an acceleration value of a previous frame does not exceed a preset amplitude difference threshold, and a y-axis amplitude value of the acceleration value of the current frame is not a preset value, obtain the pitch angle of the electronic device according to the acceleration value of the current frame; obtain a deflection angle of the electronic device when the pitch angle is less than a preset pitch angle; and correct the deflection angle of the electronic device, where correcting the deflection angle includes correcting the deflection angle of the electronic device to a positive number if it is determined that the deflection angle of the electronic device is a negative number; maintain the deflection angle unchanged if it is determined that the deflection angle of the electronic device is a positive number; and obtain the usage direction of the electronic device according to the corrected deflection angle.
In a possible implementation, if the direction recognition module determines that a modulus of the acceleration value of the current frame exceeds a preset modulus threshold, or an amplitude difference between the acceleration value of the current frame and an acceleration value of a previous frame exceeds a preset amplitude difference threshold, or a y-axis amplitude value of the acceleration value of the current frame is a preset value, the direction recognition module is configured to determine that the acceleration value of the current frame is invalid; and/or the direction recognition module is configured to determine that the usage posture of the electronic device is the special usage posture when the pitch angle is greater than or equal to the preset pitch angle; and/or the direction recognition module is configured to replace the acceleration value of the previous frame with the acceleration value of the current frame after determining the usage direction of the electronic device.
In this application, based on the implementations according to the foregoing aspects, further combination may be performed, to provide more implementations.
The following clearly and completely describes technical solutions in embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Terms used in the following embodiments are only intended to describe particular embodiments, and are not intended to limit this application. As used in this specification and the claims of this application, a singular expression form, “one”, “a”, “the”, “foregoing”, “the”, or “this”, is intended to also include “one or more” expression form, unless clearly indicated to the contrary in the context. It should be further understood that, in the embodiments of this application, “one or more” means one, two, or more. “and/or” describes an association relationship between associated objects and represents that three relationships may exist, for example, A and/or B may mean: only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The character “/” generally indicates that associated objects are in an “or” relationship.
Reference to “one embodiment” or “some embodiments” described in this specification means that a specific characteristic, structure or feature described in combination with this embodiment is included in one or more embodiments of this application. Therefore, the statements “in one embodiment”, “in some embodiments”, “in other embodiments”, “in some other embodiments”, and the like in the differences in this specification do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments”, unless otherwise specially emphasized in other ways. The terms “include”, “contain”, “have” and their variations mean “including but not limited to”, unless otherwise specially emphasized in other ways.
A plurality of involved in the embodiments of this application refers to two or more. It should be noted that in descriptions of the embodiments of this application, terms such as “first” and “second” are merely used for distinguishing descriptions, and cannot be understood as an indication or implication of relative importance, or an indication or implication of a sequence.
In order to provide a clear and concise description of the following embodiments, a brief introduction to relevant concepts or technologies is first provided:
An unfolded state means that an angle between a first body and a second body of an electronic device is 180 degrees or close to 180 degrees.
A folded state means that an angle between a first body and a second body of an electronic device may be 0 degrees or close to 0 degrees.
First portrait usage can also be called upward portrait usage or portrait usage, and refers to a portrait state in which when a user uses an electronic device, the top of the electronic device faces upwards. For example, in the world coordinate system, that the top of the electronic device faces upwards means that the top of the electronic device faces the positive direction of the Z-axis of the world coordinate system or has an angle with the positive direction of the Z-axis of the world coordinate system. An angle range of the angle can be (0, 45 degrees]. In the portrait state, the electronic device can be perpendicular to the horizontal plane formed by the X axis and the Y axis of the world coordinate system or has an angle with the horizontal plane. The top of the electronic device generally refers to the end of the electronic device with the camera.
Second portrait usage can also be called downward portrait usage or inverted portrait usage, and refers to a portrait state in which when a user uses an electronic device, the top of the electronic device faces downwards. For example, in the world coordinate system, that the top of the electronic device faces downwards means that the top of the electronic device faces the negative direction of the Z-axis of the world coordinate system or has an angle with the negative direction of the Z-axis of the world coordinate system. An angle range of the angle can be (−45 degrees, 0].
First landscape usage can also be called left landscape use, and refers to a landscape state in which when a user uses an electronic device, the top of the electronic device faces leftwards. For example, in the world coordinate system, that the top of the electronic device faces leftwards means that the top of the electronic device faces the negative direction of the X-axis of the world coordinate system. In the landscape state, the electronic device may be parallel to the landscape plane formed by the X axis and the Y axis of the world coordinate system or has an angle with the vertical plane formed by the Y axis and the Z axis.
Second landscape usage can also be called right landscape use, and refers to a landscape state in which when a user uses an electronic device, the top of the electronic device faces rightwards. For example, in the world coordinate system, that the top of the electronic device faces rightwards means that the top of the electronic device faces the positive direction of the X-axis of the world coordinate system.
The first portrait display, the second portrait display, the first landscape display and the second landscape display are four display modes (also called display directions) of content displayed by the electronic device. Among these four display modes, one display mode is the main one, and contents displayed in other display modes are rotated with reference to this display mode. For example, the first portrait display is the main one. When the electronic device displays content in first portrait mode, the rotation angle of the content is 0. Then, the second portrait display means that the content is rotated by 180 degrees relative to the first portrait display. First landscape display means that the content is rotated by 90° counterclockwise relative to the first portrait display, and second landscape display means that the content is rotated by 90° clockwise relative to the first portrait display. The first portrait display can be called upward portrait display or portrait display, the second portrait display can be called downward portrait display or inverted portrait display, the first landscape display can be called left landscape display, and the second landscape display may be called right landscape display.
For ease of description, the foldable electronic device is simply referred to as an electronic device. The electronic device can have two usage states, where the usage configuration of the electronic device includes an unfolded state and a folded state. (1) in
(2) in
Regardless of whether the electronic device is used as a tablet or a mobile phone, the electronic device can be used in landscape or portrait mode. When the electronic device is used, the display screen can display content in landscape or portrait mode. For example, when the electronic device is used in the portrait mode, the display screen can display content in the portrait mode. When the electronic device is used in landscape mode, the display screen can display content in landscape mode. Certainly, when the electronic device is used in the portrait mode, the display screen can display content in landscape mode. The landscape mode includes a first landscape mode and a second landscape mode, and the portrait mode includes a first portrait mode and a second portrait mode.
The display of content is described in conjunction with
The user folds the electronic device inwards, the electronic device is switched from the unfolded state to the folded state, and the electronic device is used as a mobile phone, and as shown in (2) in
In display of images, the user can view a control center menu through a slide down operation, and as shown in (5) in
The user can fold the electronic device outwards, the electronic device is switched from the folded state to the unfolded state, and the electronic device is first used as a tablet, as shown in (7) in
It can be seen from
In view of the above problems, this application provides a display control method, which can realize the separate control of the direction rotation of the inner and outer screens, realize the independent control of the automatic rotation of the inner and outer screens, and meet the user needs for landscape and portrait switching of the inner and outer screens, to reduce the interference between the automatic rotation functions when the electronic device is used as a mobile phone and a tablet. Independent control means that the automatic rotation of the inner screen does not affect the automatic rotation of the outer screen, and the automatic rotation of the outer screen does not affect the automatic rotation of the inner screen.
In this embodiment, the inner screen automatic rotation function and the outer screen automatic rotation function are two independent functions, a corresponding inner screen automatic rotation controlling control and outer screen automatic rotation controlling control are two variables, and a detection method of the electronic device for these two variables is as follows:
One detection method is to set an automatic rotation controlling control in the electronic device to determine the current usage form of the electronic device according to the folding angle. If the electronic device is in the unfolded state, the automatic rotation controlling control is the inner screen automatic rotation controlling control. If the electronic device is in the folded state, the automatic rotation controlling control is the outer screen automatic rotation control. The folding angle is an angle between the first body of the electronic device and the second body of the electronic device.
Another detection method is to set two automatic rotation controlling controls in the electronic device. As shown in
Based on the example in
It can be seen from the example in
In addition, when the electronic device implements the display control method, it can control the content display of the application program according to the type of the application program, where the type of application program includes: a first type of application program, a second type of application program, and a third type of application program. The first type of application program can be a mandatory landscape application program, which can be displayed in the left landscape and/or right landscape mode. For example, when the electronic device is used in the left landscape mode, the mandatory landscape application program can be displayed in the left landscape mode, and when the electronic device is used in the right landscape mode, the mandatory landscape application program can be displayed in the right landscape mode. The second type of application program can be a mandatory portrait application program, which can be displayed in the portrait and/or inverted portrait mode. For example, when the electronic device is used in the portrait mode, the mandatory portrait application program can be displayed in the portrait mode, and when the electronic device is used in the portrait mode, the mandatory portrait application program can be displayed in the portrait mode or inverted portrait mode.
The third type of application program may be an application program whose direction can be automatically rotated according to the state of the device (also referred to as the usage posture of the electronic device). In one example, the electronic device enables the automatic rotation function before the third type of application program is enabled, and then the display of the third type of application program can also change after the electronic device is rotated. For example, when the electronic device is used in the portrait mode, the third type of application program can be displayed in the portrait mode, and when the electronic device is used in the landscape mode, the third type of application program can be displayed in the landscape mode. However, if the electronic device disables the automatic rotation function after the third type of application program is enabled, the electronic device can continue to display the third type of application program in the display mode before disabling, for example, the electronic device is used in the left landscape mode and displays the third type of application program in the left landscape mode, and the automatic rotation function is disabled by the electronic device. Then, the electronic device may continue to display the third type of application program in the left landscape mode. If the electronic device disables the third type of application program or switches the third type of application program to the background, after the electronic device runs the third type of application program in the foreground, the electronic device may display the third type of application program in a default display mode.
For example, when the electronic device is used as a mobile phone, the electronic device includes a first type of application program, a second type of application program, and a third type of application program, the first type of application program may be a game application, the second type of application program may be a desktop and WeChat or the like, and the third type of application program can be settings and gallery or the like. When the electronic device is used as a tablet, the electronic device includes a first type of application program and a third type of application program, the first type of application program may be a game application, and the third type of application program may be an application other than the game program, for example, the third type of application program can be desktop, gallery, WeChat and so on.
The following uses different types of application programs as examples to illustrate.
The user rotates the electronic device by 90 degrees to the left, the electronic device is switched from portrait to left landscape, and correspondingly, the electronic device can display the game content in the left landscape mode as shown in (4) in
The user rotates the electronic device by 90 degrees to the left, and the electronic device is switched from portrait to left landscape. Because the gallery application can change the display mode along with the rotation of the electronic device, after the electronic device is switched to the left landscape, the electronic device displays images in the left landscape mode in (4) in
The user rotates the electronic device by 90 degrees to the left, the electronic device is switched from portrait to left landscape, and correspondingly, the electronic device can display the game content in the left landscape mode as shown in (4) in
The user rotates the electronic device by 90 degrees to the left, and the electronic device is switched from portrait to left landscape. Because the gallery application can change the display mode along with the rotation of the electronic device, after the electronic device is switched to the left landscape, the electronic device displays images in the left landscape mode in (4) in
As shown in
In
In this embodiment, the electronic device may be a mobile phone, a smart screen, a tablet personal computer, a wearable electronic device, a vehicle-mounted electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, or the like.
It may be understood that the schematic structure in this embodiment constitutes no specific limitation on the electronic device. In some other embodiments, the electronic device may include more or fewer components than those shown in the figure, or some components may be combined, or some components may be split, or components are arranged in different manners. The components in the portrait may be implemented by hardware, software, or a combination of software and hardware.
The processor may include one or more processing units. The processor may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), and the like. Different processing units may be separate devices, or may be integrated into one or more processors. The processor is the neural center and command center of the electronic device. The controller may generate an operation control signal based on an instruction operation code and a timing signal, to implement control of fetching an instruction and executing the instruction.
The outer memory interface may be configured to connect to an outer storage card, for example, a micro SD card, to expand a storage capability of the electronic device. The outer storage card communicates with the processor by using the outer memory interface, to implement a data storage function, for example, the processing rule, the automatic rotation controlling control flag, and the like are stored in the outer memory card. The inner memory may be configured to store computer-executable program code. The executable program code includes an instruction. The processor runs the instructions stored in the inner memory, to implement various functional applications and data processing of the electronic device. For example, in this application, the processor executes the instructions stored in the inner memory, so that the electronic device executes the display control method provided in this application.
The display screen may be configured to display an image, or a video. The display screen includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), or a quantum dot light emitting diode (QLED). In some embodiments, the electronic device may include one or N display screens. N is a positive integer greater than 2. As shown in
The camera is configured to capture a static image or a video. An optical image is generated for an object by using the lens and is projected onto the photosensitive element. The photosensitive element may be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts an optical signal into an electrical signal, and then transfers the electrical signal to the ISP, to convert the electrical signal into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard image signal in red green blue (RGB) and YUV formats. In some embodiments, the electronic device may include 2 or N cameras, and N is a positive integer greater than 2.
An operating system runs on the foregoing components, for example, the iOS operating system developed by Apple, the Android open-source operating system developed by Google, and the Windows operating system developed by Microsoft. An application program may be installed and run on the operating system.
An operating system of the electronic device may use a layered architecture, an event-driven architecture, a micro core architecture, a micro service architecture, or a cloud architecture. In this embodiment of this application, the software structure of the electronic device is illustrated by using an Android system with a layered architecture as an example.
The application layer may include a series of application packages. The application packages may include APPs such as camera, gallery, calendar, call, maps, WLAN, music, and videos. The application framework layer provides an application programming interface (API) and a programming framework for applications at the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like. The window manager is configured to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a state bar, lock the screen, capture the screen, or the like. For example, the window manager can obtain the state of the automatic rotation controlling control in the control center menu, and the state of the automatic rotation controlling control includes enabled and disabled.
The system library may include a plurality of function modules, For example, a surface manager, a media library (Media Libraries), a three-dimensional graphics processing library (for example, OpenGL ES), and a 2D graphics engine (for example, SGL) and so on. The system library can also include an inner screen direction control module and an outer screen direction control module. The inner screen direction control module is configured to control the real-time display direction of the inner screen, and the outer screen direction control module is configured to control the real-time display direction of the outer screen. The real-time display direction can include at least one of portrait display, left landscape display, right landscape display and inverted portrait display. The inner screen direction control module may be called a second display screen direction control module, and the outer screen direction control module may be called a first display screen direction control module.
The sensor hub layer is configured to obtain data from the hardware layer. For example, the sensor hub layer can obtain acceleration data (such as acceleration values) from the accelerometer, obtain Hall device data from the Hall device, or the like, and the sensor hub layer can include a direction recognition module and an angle recognition module. The angle recognition module is configured to obtain Hall device data, and calculate the folding angle according to the Hall device data, where the folding angle is the angle between the first body and the second body of the electronic device. The direction recognition module is configured to calculate the usage direction of the electronic device according to the acceleration value, where the usage direction is used to indicate the usage gesture (also called the usage posture) of the electronic device, such as portrait usage or left landscape usage. The hardware layer includes hardware such as an accelerometer and a Hall device. The accelerometer can feed back the acceleration value to the direction recognition module, and the Hall device can feed back the Hall device data to the angle recognition module.
In some examples, the direction recognition module and the angle recognition module can feed back information to the inner screen direction control module and the outer screen direction control module respectively, for example, the direction recognition module feeds back the usage direction to the inner screen direction control module and the outer screen direction control module, and the angle recognition module can feed back the folding angle to the inner screen direction control module and the outer screen direction control module. If the folding angle indicates that the electronic device is in the unfolded state, the inner screen direction control module is enabled, and the inner screen direction control module controls the inner screen to display the direction in real time. If the folding angle indicates that the electronic device is in the folded state, the outer screen direction control module is enabled, and the outer screen direction control module controls the outer screen to display the direction in real time.
In some examples, the angle recognition module can feed back the folding angle to the direction recognition module, and the folding angle is used to control the direction recognition module to feed back the usage direction to one of the inner screen direction control module and the outer screen direction control module. For example, if the folding angle indicates that the electronic device is in the unfolded state, the direction recognition module feeds back the usage direction to the inner screen direction control module, the inner screen direction control module is enabled, and the inner screen direction control module controls the inner screen to display the direction in real time. If the folding angle indicates that the electronic device is in the folded state, the direction recognition module feeds back the usage direction to the outer screen direction control module, the outer screen direction control module is enabled, and the outer screen direction control module controls the outer screen to display the direction in real time. During the control process of the outer screen direction control module and the inner screen direction control module, the application framework layer can feed back the state of the automatic rotation controlling control, for example, feed back the flag of the automatic rotation controlling control. If flag==false, it means that the electronic device disables the automatic rotation controlling control. If flag==true, it means that the electronic device enables the automatic rotation controlling control.
The electronic device invokes the angle recognition module, the direction recognition module, the outer screen direction control module and the inner screen direction control module to implement the display control method. The schematic diagram of the working process of the display control method is shown in
In some examples, the electronic device is configured with an automatic rotation controlling control. When the electronic device is in the unfolded state, the automatic rotation controlling control is used as an inner screen automatic rotation controlling control, and the corresponding flag of the automatic rotation controlling control is the inner screen rotation control flag. In some examples, the electronic device is configured with two automatic rotation controlling controls, one is an outer screen automatic rotation controlling control, and the other is an inner screen automatic rotation controlling control, and the inner screen rotation control flag is the flag of the inner screen automatic rotation controlling control.
In some examples, the electronic device is configured with an automatic rotation controlling control. When the electronic device is in the folded state, the automatic rotation controlling control is used as an outer screen automatic rotation controlling control, and the corresponding flag of the automatic rotation controlling control is the outer screen rotation control flag. In some examples, the electronic device is configured with two automatic rotation controlling controls, one is an outer screen automatic rotation controlling control, and the other is an inner screen automatic rotation controlling control, and the outer screen rotation control flag is the flag of the outer screen automatic rotation controlling control. The outer screen rotation control flag can be a first control flag, the inner screen rotation control flag can be a second control flag, true can be a first value of the first control flag and the second control flag, and false can be a second value of the first control flag and the second control flag.
The process of identifying the usage direction of the electronic device by the direction recognition module is shown in
The direction recognition module outputs an invalid value, indicating that the acceleration value of the current frame is invalid, and the direction recognition module can continue to use the valid acceleration value of the current frame to identify the usage direction, for example, the valid acceleration value of the current frame is the previously obtained acceleration value.
The modulus of the acceleration value can be obtained through sqrt (x2+y2+72), where sqrt represents the square root, and x, y and z are values in the three directions of x-axis, y-axis and z-axis collected by the accelerometer. Generally, the standard gravity acceleration value is 9.80665, and therefore the electronic device can preset the value range of the acceleration value, for example, the value range is (9.0, 10.6). This value range can be regarded as a preset modulus threshold of the acceleration value of the current frame, if the modulus value of the acceleration value of the current frame is not within this value range, it is determined that the state of the electronic device is unstable, and thus it is determined that the acceleration value of the current frame is invalid. An invalid value is output, for example, an invalid value −2 is output in some examples.
The acceleration value of the previous frame is the acceleration value of the previous frame of the acceleration value of the current frame, and the acceleration value of the previous frame is a valid acceleration value determined based on the modulus value and the amplitude difference. An acceleration value includes x-axis amplitude, y-axis amplitude and z-axis amplitude, and the direction recognition module can calculate the amplitude difference between the x-axis amplitude of the acceleration value of the current frame and the x-axis amplitude of the acceleration value of the previous frame, calculate the amplitude difference between the y-axis amplitude of the acceleration value of the current frame and the y-axis amplitude of the acceleration value of the previous frame, and calculate the amplitude difference between the z-axis amplitude of the acceleration value of the current frame and the z-axis amplitude of the acceleration value of the previous frame.
The direction recognition module determines whether the absolute value of the amplitude difference of any of the x-axis, y-axis and z-axis exceeds the range, and if the absolute value of the amplitude difference of any axis exceeds the range, an invalid value is output to determine that the acceleration value of the current frame is invalid. For example, if the absolute value of the amplitude difference of any axis is greater than 1.2 (1.2 is an example of a preset amplitude difference threshold), it is determined that the value is out of range and an invalid value is output. If the absolute value of the amplitude difference of any axis is out of range, the direction recognition module may determine that the state of the electronic device is unstable.
It should be noted that: when the direction recognition module recognizes the usage direction for the first time, the acceleration value of the previous frame is empty, and the direction recognition module can initialize the three-axis values of the acceleration value of the previous frame to 0. After completing recognition of the usage direction once, the acceleration value of the previous frame is updated. For example, after completing recognition of the usage direction once, the acceleration value of the current frame is used as the acceleration value of the previous frame, and the direction recognition module obtains the valid acceleration value again and then uses the updated acceleration value of the previous frame.
45 degrees and −1 are examples and are not limited here, a represents the pitch angle, and x, y and z represent the amplitude of the x-axis, the amplitude of the y-axis and the amplitude of the z-axis respectively.
In this embodiment, the usage direction of the electronic device is used to represent the usage posture/usage state of the electronic device. For example, the usage direction of the electronic device is portrait, indicating that the electronic device is used in the portrait mode. Another example is that the usage direction of the electronic device is the left landscape, indicating that the electronic device is used in left landscape mode. The direction recognition module can send the usage direction to the outer screen direction control module and/or the inner screen direction control module, and the outer screen direction control module and/or the inner screen direction control module control the content display according to the usage direction.
When the outer screen direction control module controls the content display according to the usage direction, the outer screen direction control module can refer to the application type and the outer screen rotation control flag. A processing rule of the outer screen direction control module is as follows:
For mandatory portrait applications (also called portrait display applications), the outer screen direction control module controls the applications to be displayed in the portrait and/or inverted portrait mode. For mandatory landscape applications (also called landscape display applications), the outer screen direction control module controls the applications to be displayed in the left landscape and/or right landscape mode.
For applications whose direction can be automatically rotated according to the state of the device (also called landscape and portrait display applications), the outer screen direction control module can control, according to the outer screen rotation control flag, such applications to be displayed, for example, before starting such applications, the outer screen rotation control flag indicates that the electronic device disables the outer screen automatic rotation function, and the outer screen direction control module controls such applications to be displayed in the portrait mode. If the outer screen rotation control flag indicates, before such applications are started, that the electronic device enables the automatic rotation function of the outer screen, after such application are started, the outer screen direction control module can control the display of such applications according to the usage direction of the electronic device, so that the display of such applications can change with the change of the usage direction of the electronic device. If the automatic rotation function is disabled after the application is started, the outer screen direction control module controls the application to be displayed in the display mode last used before the disabling.
The schematic diagram of the working process of the outer screen direction control module is shown in
The outer screen rotation control flag can indicate whether the outer screen automatic rotation function is enabled, and if flag==false, it means that the electronic device disables the outer screen automatic rotation function. If flag==true, it means that the electronic device enables the outer screen automatic rotation function.
For example, if the electronic device is used in the portrait mode, the outer screen direction control module controls the application program to be displayed in the portrait mode. If the electronic device is used in the inverted portrait mode, the outer screen direction control module controls the application program to be displayed in the portrait or inverted portrait mode. Mandatory portrait applications may not be affected by the outer screen rotation control flag, that is, regardless of whether the outer screen automatic rotation function is enabled or disabled on the electronic device, the outer screen direction control module can control the mandatory portrait application to be displayed in the portrait or inverted portrait mode. For example, if the outer screen rotation control flag indicates that the electronic device enables the outer screen automatic rotation function, and the electronic device is used in the left or right landscape mode, the outer screen direction control module can control this type of application to be used in the portrait mode.
As shown in
For example, if the electronic device is used in the left landscape mode, the outer screen direction control module controls the application program to be displayed in the left landscape mode. If the electronic device is used in the right landscape, the outer screen direction control module controls the application program to be displayed in the right landscape. Mandatory landscape applications may not be affected by the outer screen rotation control flag, that is, regardless of whether the outer screen automatic rotation function is enabled or disabled on the electronic device, the outer screen direction control module can control the mandatory landscape application to be displayed in the left landscape or right landscape mode. For example, if the outer screen rotation control flag indicates that the electronic device enables the outer screen automatic rotation function, and the electronic device is used in the portrait mode, the outer screen direction control module can control this type of application to be used in the left landscape mode.
As shown in
The original valid direction is the display direction last used by the electronic device before the outer screen automatic rotation function of the electronic device is disabled. Before the electronic device disables the outer screen automatic rotation function, if the display direction of the application program changes with change of the usage direction of the electronic device, the outer screen direction control module can update the original valid direction. After the electronic device disables the outer screen automatic rotation function, the original valid direction is not updated, and maintains unchanged until the outer screen automatic rotation function is enabled again.
Take
If the usage direction is not −1, the outer screen direction control module controls the display of the application program according to the usage direction of the electronic device. In addition, the outer screen direction control module updates the original valid direction after determining the change of the display direction of the application program. Take
In this embodiment, When the inner screen direction control module controls the content display according to the usage direction, the outer screen direction control module can refer to the application type and the inner screen rotation control flag. A processing rule of the inner screen direction control module is as follows:
For mandatory portrait applications, the inner screen direction control module controls the applications to be displayed in the portrait and/or inverted portrait mode. For mandatory landscape applications, the inner screen direction control module controls the applications to be displayed in the left landscape and/or right landscape mode.
For applications whose direction can be automatically rotated according to the state of the device, the inner screen direction control module can control the display of such applications according to the inner screen rotation control flag. For example, the inner screen rotation control flag indicates that the electronic device has enabled the inner screen automatic rotation function. The direction control module can control the display of the application program according to the usage direction of the electronic device, so that the display of such application program can change with the change of the usage direction of the electronic device. During the usage of such application program, if the inner screen rotation control flag indicates that the electronic device disables the inner screen automatic rotation function, that is, switches from enabling the inner screen automatic rotation function to disabling the inner screen automatic rotation function, the inner screen direction control module can control the application program to be displayed in the original valid direction.
The original valid direction is the display direction last used by the electronic device before the inner screen automatic rotation function of the electronic device is disabled. For example, the display direction used last time is the portrait, and the inner screen direction control module controls the application program to be displayed in the portrait mode. The display direction used last time is the landscape, and the inner screen direction control module may control the application program to be displayed in the landscape mode.
Before the electronic device disables the inner screen automatic rotation function, if the display direction of the application program changes with change of the usage direction of the electronic device, the inner screen direction control module can update the original valid direction. After the electronic device disables the inner screen automatic rotation function, the original valid direction is not updated, and maintains unchanged until the inner screen automatic rotation function is enabled again.
The schematic diagram of the working process of the inner screen direction control module is shown in
The inner screen rotation control flag can indicate whether the inner screen automatic rotation function is enabled, and if flag==false, it means that the electronic device disables the inner screen automatic rotation function. If flag==true, it means that the electronic device enables the inner screen automatic rotation function.
For example, if the electronic device is used in the left landscape mode, the inner screen direction control module controls the application program to be displayed in the left landscape mode. If the electronic device is used in the right landscape, the inner screen direction control module controls the application program to be displayed in the right landscape. Mandatory landscape applications may not be affected by the inner screen rotation control flag, that is, regardless of whether the inner screen automatic rotation function is enabled or disabled on the electronic device, the inner screen direction control module can control the mandatory landscape application to be displayed in the left landscape or right landscape mode. For example, if the inner screen rotation control flag indicates that the electronic device enables the inner screen automatic rotation function, and the electronic device is used in the portrait mode, the inner screen direction control module can control this type of application to be used in the left landscape mode.
As shown in
The original valid direction is the display direction last used by the electronic device before the inner screen automatic rotation function of the electronic device is disabled. Take
If the usage direction is not −1, the inner screen direction control module controls the display of the application program according to the usage direction of the electronic device. In addition, the inner screen direction control module updates the original valid direction after determining the change of the display direction of the application program. Take
For example, force landscape applications are always displayed in the landscape mode. If the electronic device is used in the left landscape mode, mandatory landscape applications are used in the left landscape mode; if the electronic device is used in the right landscape, mandatory landscape applications are used in the right landscape mode. For applications whose direction can be automatically rotated according to the state of the device (referred to as rotatable applications for short), if the electronic device enables the automatic rotation function of the inner screen, the display direction of the rotatable application can change with the change of the usage direction. If the electronic device disables the automatic rotation function of the inner screen, the display direction of the rotating application is the original valid direction.
For example, when the inner screen displays images, the original valid direction is the left landscape. If the electronic device disables the automatic rotation function of the inner screen and the electronic device is used in the left landscape mode, when the electronic device enters the desktop or other rotatable applications again, the desktop or other rotatable applications can be displayed in the left landscape mode. If the electronic device is used in the portrait mode when the electronic device enters the desktop or other rotatable applications again, the desktop or other rotatable applications can be displayed in the left landscape mode. That is, during the direction control process of the inner screen, the original valid direction is valid for all applications whose direction can be automatically rotated according to the state of the device. For example, when displaying an image, the original valid direction is the left landscape. If the electronic device started applications such as desktop and WeChat after the automatic rotation function of the inner screen is disabled, the desktop and WeChat can be displayed in the left landscape mode according to the original valid direction, that is, regardless of whether the electronic device is used in portrait or landscape mode, all applications that can be automatically rotated according to the state of the device are displayed by the electronic device in the original valid direction before the disabling. In addition, after the electronic device enters the desktop or other rotatable applications again, the user can enable the automatic rotation function of the inner screen, and the display direction of the desktop or other rotatable applications can change with the rotation of the electronic device. The original valid direction can be changed according to change of the display direction. However, once the automatic rotation function of the inner screen is disabled, the display direction of the desktop or other rotatable applications is the original valid direction before the disabling until the user enables the automatic rotation function of the inner screen again.
Besides, this application provides an electronic device. The electronic device includes a first display screen, a second display screen, one or more processors, and a memory; where the memory stores programs, and when executed by the one or more processors, the programs cause the electronic device to perform the above display control method.
This application further provides a readable storage medium. The readable storage medium stores a computer program, and when the computer program is executed by a processor, the above display control method is implemented.
This application further provides a display control apparatus, applied to an electronic device including a first display screen and a second display screen. The display control apparatus includes: a first control module, a first display screen direction control module, and a second display screen direction control module.
The first control module is configured to: in response to a first type of operation of a user, if the electronic device is in a first usage posture of a folded state, display first application content in a first display direction through the first display screen, and if the electronic device is in a first usage posture of an unfolded state, display the first application content in the first display direction through the second display screen.
The first display screen direction control module is configured to: in response to a second type of operation of a user, if the electronic device is switched from the first usage posture of the folded state to a second usage posture of the folded state and a first control flag of the electronic device is a first value, display the first application content in a second display direction through the first display screen, where the second display direction is different from the first display direction, and the first usage posture is different from the second usage posture.
The second display screen direction control module is configured to: if the electronic device is switched from the first usage posture of the unfolded state to a second usage posture of the unfolded state and a second control flag of the electronic device is a second value, continue to display the first application content in the first display direction through the second display screen.
It can be seen from the above technical solutions that the electronic device can be used in different usage postures of the folded state or the unfolded state, the content is displayed through the first display screen in the folded state, and the content is displayed through the second display screen in the unfolded state. If the electronic device is switched from the first usage posture of the folded state to the second usage posture of the folded state and the first control flag is the first value, the first display screen is switched from the first display direction to the second display direction, and the first application content is displayed in the second display direction. If the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state and the second control flag is the second value, and the second display screen can continue to display the first application content in the first display direction, to control the first display screen and the second display screen based on the first control flag and the second control flag. Besides, the first control flag corresponds to the first display screen, and the second control flag corresponds to the second display screen. The first control flag and the second control flag are independent of each other and do not affect each other. Therefore, the first display screen can be independently controlled based on the first control flag, and the second display screen can be independently controlled based on the second control flag, preventing the display of the first display screen from affecting the display of the second display screen.
For example, the first usage posture and the second usage posture are respectively one of a portrait usage posture, a left landscape usage posture, and a right landscape usage posture. The portrait usage posture corresponds to portrait display, and the left landscape usage posture corresponds to left landscape display, and the right landscape usage gesture corresponds to right landscape display. If the electronic device is in the folded state and is switched from the portrait usage posture to the left landscape usage posture, the first control flag is the first value, and the first value indicates that a first display screen automatic rotation function is enabled, the electronic device can be switched from portrait display to left landscape display to display the first application content. If the electronic device is in the unfolded state and is switched from the portrait usage posture to the left landscape usage posture, the second control flag is the second value, and the second value indicates that an automatic rotation function of the second display screen is disabled, the usage posture of the electronic device changes but the second display screen still displays the first application content in the portrait mode, so that the display of the first display screen and the second display screen can be independently controlled according to whether the automatic rotation function is enabled, so as to prevent the first display screen and the second display screen from affecting each other.
In a possible implementation, the second display screen direction control module is configured to: if the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state, and the second control flag is the first value, display the first application content in the second display direction through the second display screen, where the first application content is content of a first application running in the foreground of the electronic device. Correspondingly, the display control apparatus further includes: an adjustment module and a switching module. The adjustment module is configured to: in response to the third type of operation of the user, adjust the second control flag from the first value to the second value. The second display screen direction control module is configured to: in response to the second type of operation of the user, if the electronic device is switched from the second usage posture of the unfolded state to a third usage posture of the unfolded state, display the first application content in the second display direction through the second display screen, where the second usage posture and the third usage posture are different. The switching module is configured to: in response to a fourth type of operation of the user, switch an application running in the foreground of the electronic device from the first application to a second application, where the first application and the second application are landscape and portrait display applications. The second display screen direction control module is configured to display second application content in the second display direction through the second display screen, where the second application content is content of the second application.
In this embodiment, if the second control flag is the first value, it means that the electronic device has enabled the automatic rotation function of the second display screen, and when the usage posture of the electronic device in the unfolded state changes, the display direction of the second display screen can also change. When the second control flag maintains the second value, the application running in the foreground of the electronic device is switched from the first application to the second application of the same type as the first application, and the electronic device can display the content of the second application in the same display direction as that of the first application content, so that the first application and the second application of the same type can adopt the same display direction when the second control flag is the second value. Therefore, after the display direction is fixed, this reduces the probability that the display direction of the second display screen is forced to rotate due to application switching. For example, when the second control flag is the first value, the second display screen is displayed in left landscape mode, the electronic device is switched from the gallery application to the setting application, and when the setting application is started, the electronic device can display content of the setting application in left landscape mode.
In a possible implementation, the switching module is configured to: in response to the fourth type of operation of the user, switch the application running in the foreground of the electronic device from the second application to the first application; and the second display screen direction control module is configured to display the first application content in the second display direction through the second display screen, so that when the second control flag maintains the second value, after the electronic device runs the first application again, the content of the first application is still displayed in the previous display direction (that is, the second display direction).
In a possible implementation, the display control apparatus further includes: a screen lock module and an unlocking module. The screen lock module is configured to: in response to a screen lock operation of the user, locking the second display screen in a black screen state. The unlocking module is configured to: when the second display screen is switched from the black screen state to an off screen display state, display an unlocking interface in the second display direction through the second display screen. The second display screen direction control module is configured to: in response to an unlocking operation of the user, switch the second display screen from displaying the unlocking interface to displaying application content, and display application content in the second display direction through the second display screen. Because the second control flag maintains the second value, and the display direction of the electronic device is fixed at the second display direction, regardless of whether the unlocking interface or the application content is displayed, the electronic device can display the unlocking interface or the application content in the second display direction. Therefore, after the display direction is fixed, when the application is entered again, the display direction maintains unchanged and there is no forced rotation of the display direction.
In a possible implementation, the first application content is the content of the first application running in the foreground of the electronic device, and the first application is a landscape and portrait display application. The display control apparatus further includes: a switching module, configured to: in response to the fourth type of operation of the user, switch an application running in the foreground of the electronic device from the first application to a fourth application, where the fourth application is a portrait display application; and a second display screen direction control module, configured to: if the electronic device is switched from the first usage posture of the unfolded state to the second usage posture of the unfolded state, and the second control flag is the first value, display fourth application content in the second display direction or the first display direction through the second display screen, where the fourth application content is content of the fourth application, a usage direction of the first usage posture is one of portrait and inverted portrait, a usage direction of the second usage posture is opposite to that of the first usage posture, and the second display direction is opposite to the first display direction. For a portrait display application, after the electronic device is switched from a portrait usage posture to an inverted portrait usage posture, the display direction of the second display screen may change or maintain unchanged.
In a possible implementation, the second display screen direction control module is configured to: in response to the first type of operation of the user, if the electronic device is in a special usage posture of the unfolded state, and the second control flag is the first value, display the first application content in a portrait display direction through the second display screen. The display control apparatus further includes: an adjustment module, configured to: in response to the third type of operation of the user, adjust the second control flag from the first value to the second value; and a second display screen direction control module, configured to: when the electronic device maintains the special usage posture of the unfolded state, display the first application content in the portrait display direction through the second display screen. In this embodiment, the special usage posture may be a flat posture. If the electronic device is in the flat posture, and the second control flag is the first value before the first application is started, the second display screen can display the first application content in the portrait mode. After the first application is started, the second control flag is adjusted to the second value. In this case, the first application content can maintain display in the portrait mode.
In a possible implementation, the second display screen direction control module is configured to: if the electronic device is in the special usage posture of the unfolded state and the second control flag is the first value after displaying the first application content, maintain the display direction of the second display screen unchanged. For example, the second display screen displays the first application content in the second display direction, and then the electronic device is in the special usage posture of the unfolded state. Even if the second control flag is the first value, the second display screen still displays the first application content in the second display direction. If switching from the first application to the second application, when the electronic device maintains the special usage posture, the second display screen can display the content of the second application in the second display direction, so that the display direction of the second display screen maintains unchanged under the special usage posture.
In a possible implementation, the display control apparatus further includes: an angle recognition module and a direction recognition module, where the angle recognition module is configured to determine the current usage form of the electronic device. a direction recognition module, configured to determine the current usage posture of the electronic device; a first display screen direction control module, configured to: if the current usage form of the electronic device is the folded state, control display of the first display screen according to the current usage posture of the electronic device and the first control flag; and a second display screen direction control module, configured to: if the current usage form of the electronic device is the unfolded state, control display of the second display screen according to the current usage posture of the electronic the second control flag, so as to control the first display screen through the first display screen direction control module, and control the second display screen through the second display screen direction control module.
In a possible implementation, the display control apparatus further includes: a determining module, configured to determine a type of the first application running in the foreground of the electronic device. The first display screen direction control module and the second display screen direction control module refer to the type of the first application when controlling the display, so as to control the display of the first display screen or the second display screen according to the type of the first application.
In a possible implementation, the second display screen direction control module being configured to: if the current usage form of the electronic device is the unfolded state, control display of the second display screen according to the current usage posture of the electronic device and the second control flag includes: if the first application is a landscape display application, controlling the second display screen to display in the left landscape mode when the current usage posture of the electronic device is the left landscape usage posture, and controlling the second display screen to display in the right landscape mode when the current usage posture of the electronic device is the right landscape usage posture; if the first application is a landscape and portrait display application and the current usage posture of the electronic device is a special usage posture, if it is determined that the second control flag is the first value before the first application is started, controlling the second display screen to display in the portrait mode, and if it is determined that the second control flag is the first value after the first application is started, controlling the second display screen to display in a display direction that is used before the first application is started; if the first application is a landscape and portrait display application and the current usage posture of the electronic device is not the special usage posture, if it is determined that the second control flag is the first value, controlling the second display screen to display in a display direction that matches the usage posture; and if the first application is a landscape and portrait display application, if it is determined that the second control flag is the second value, controlling the second display screen to display in an original effective direction, where the original effective direction is a display direction used by the second display screen for the last time before the second control flag is adjusted to the second value.
In a possible implementation, the second display screen direction control module being configured to: if the current usage form of the electronic device is the unfolded state, control display of the second display screen according to the current usage posture of the electronic device and the second control flag includes: if the first application is a portrait display application and the second control flag is the first value, controlling the second display screen to display in the portrait mode when the current usage posture of the electronic device is the portrait usage posture, and controlling the second display screen to display in portrait or inverted portrait mode when the current usage posture of the electronic device is an inverted portrait usage posture.
In a possible implementation, the angle recognition module is configured to obtain a folding angle of the electronic device; if the folding angle of the electronic device is greater than a preset angle, determine that the electronic device is in the unfolded state; and if the folding angle of the electronic device is less than or equal to the preset angle, determine that the electronic device is in the folded state.
In a possible implementation, the direction recognition module is configured to obtain a pitch angle of the electronic device based on the acceleration value of the current frame; obtain a deflection angle of the electronic device according to the pitch angle of the electronic device; and determine a usage direction of the electronic device according to the deflection angle of the electronic device, where the usage direction of the electronic device represents the usage posture of the electronic device.
In a possible implementation, the direction recognition module is configured to: if the direction recognition module determines that a modulus of the acceleration value of the current frame does not exceed a preset modulus threshold, an amplitude difference between the acceleration value of the current frame and an acceleration value of a previous frame does not exceed a preset amplitude difference threshold, and a y-axis amplitude value of the acceleration value of the current frame is not a preset value, obtain the pitch angle of the electronic device according to the acceleration value of the current frame; obtain a deflection angle of the electronic device when the pitch angle is less than a preset pitch angle; and correct the deflection angle of the electronic device, where correcting the deflection angle includes correcting the deflection angle of the electronic device to a positive number if it is determined that the deflection angle of the electronic device is a negative number; maintain the deflection angle unchanged if it is determined that the deflection angle of the electronic device is a positive number; and obtain the usage direction of the electronic device according to the corrected deflection angle.
In a possible implementation, if the direction recognition module determines that a modulus of the acceleration value of the current frame exceeds a preset modulus threshold, or an amplitude difference between the acceleration value of the current frame and an acceleration value of a previous frame exceeds a preset amplitude difference threshold, or a y-axis amplitude value of the acceleration value of the current frame is a preset value, the direction recognition module is configured to determine that the acceleration value of the current frame is invalid; and/or the direction recognition module is configured to determine that the usage posture of the electronic device is the special usage posture when the pitch angle is greater than or equal to the preset pitch angle; and/or the direction recognition module is configured to replace the acceleration value of the previous frame with the acceleration value of the current frame after determining the usage direction of the electronic device.
The descriptions of the processes or structures corresponding to each of the above figures have their own emphasis. For parts that are not detailed in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
Number | Date | Country | Kind |
---|---|---|---|
202210635122.2 | Jun 2022 | CN | national |
This application is a national stage of International Application No. PCT/CN2023/089153, filed on Apr. 19, 2023, which claims priority to Chinese Patent Application No. 202210635122.2, filed on Jun. 7, 2022. The disclosures of both of the aforementioned application are hereby incorporated by reference in their entireties.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2023/089153 | 4/19/2023 | WO |