CN115361468B - Display optimization method, device and storage medium when screen rotates - Google Patents

Display optimization method, device and storage medium when screen rotates Download PDF

Info

Publication number
CN115361468B
CN115361468B CN202211293081.XA CN202211293081A CN115361468B CN 115361468 B CN115361468 B CN 115361468B CN 202211293081 A CN202211293081 A CN 202211293081A CN 115361468 B CN115361468 B CN 115361468B
Authority
CN
China
Prior art keywords
screen
display
application interface
image
occlusion image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211293081.XA
Other languages
Chinese (zh)
Other versions
CN115361468A (en
Inventor
刘雅坤
肖坊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211293081.XA priority Critical patent/CN115361468B/en
Publication of CN115361468A publication Critical patent/CN115361468A/en
Application granted granted Critical
Publication of CN115361468B publication Critical patent/CN115361468B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a display optimization method and device during screen rotation and a storage medium, and belongs to the technical field of screen display. The method comprises the following steps: displaying a first application interface of the application, wherein the display strategy of the blocked image corresponding to the first application interface is a first display strategy; responding to the screen rotation operation, and acquiring a second display strategy, wherein the second display strategy is a shielding image display strategy corresponding to a second application interface after the first application interface is subjected to interface rotation; and under the condition that the first display strategy is different from the second display strategy, switching the first application interface to the second application interface, and hiding or displaying the shielding image before switching to the second application interface according to the second display strategy. Therefore, when the screen rotates, the shielding image can be displayed or hidden on the hole digging screen in advance before the screen rotates, so that the time difference between the displayed or hidden shielding image and the rotation of the application interface is shortened, and the visual blockage during the rotation of the screen is relieved.

Description

屏幕旋转时的显示优化方法、设备及存储介质Display optimization method, device and storage medium when screen rotates

技术领域technical field

本申请涉及屏幕显示技术领域,特别涉及一种屏幕旋转时的显示优化方法、设备及存储介质。The present application relates to the technical field of screen display, and in particular to a display optimization method, device and storage medium when the screen rotates.

背景技术Background technique

挖孔屏是目前手机等电子设备中经常使用的一种屏幕结构,对于挖孔屏设备(即具有挖孔屏的电子设备),若当前显示的应用界面和挖孔屏不适配,则挖孔屏设备可以在屏幕顶部区域和/或侧边区域显示遮挡图像,例如挖孔屏顶部和侧边的黑条,从而遮挡对应区域。The hole-digging screen is a screen structure often used in mobile phones and other electronic devices. For a hole-digging screen device (that is, an electronic device with a hole-digging screen), if the currently displayed application interface does not match the hole-digging screen, the hole-digging screen The hole screen device can display occlusion images on the top area and/or side area of the screen, such as black bars on the top and sides of the hole screen, thereby blocking the corresponding area.

在电子设备的屏幕显示某个应用的应用界面时,若屏幕发生旋转,比如从竖屏模式切换至横屏模式,则电子设备需要将应用的竖屏应用界面向横屏应用界面进行切换。但是,应用的竖屏显示界面和横屏显示界面根据是否适配挖孔屏,其对应的遮挡图像显示策略可能不同。比如,若应用的竖屏应用界面适配挖孔屏,横屏应用界面不适配挖孔屏,则从竖屏应用界面切换到横屏应用界面时,需要隐藏遮挡图像。若应用的竖屏应用界面不适配挖孔屏,横屏应用界面适配挖孔屏,则从竖屏应用界面切换到横屏应用界面时,需要显示遮挡图像。When the screen of an electronic device displays an application interface of an application, if the screen rotates, for example, switching from a portrait mode to a landscape mode, the electronic device needs to switch the application interface from the portrait mode to the landscape mode. However, depending on whether the application's vertical screen display interface and horizontal screen display interface are adapted to the hole-punch screen, the corresponding occlusion image display strategies may be different. For example, if the vertical screen application interface of the application is suitable for the punch-hole screen, but the horizontal screen application interface is not suitable for the punch-hole screen, then when switching from the vertical screen application interface to the horizontal screen application interface, the occlusion image needs to be hidden. If the vertical screen application interface of the application is not suitable for the punch-hole screen, and the horizontal screen application interface is suitable for the punch-hole screen, then when switching from the vertical screen application interface to the horizontal screen application interface, the occluded image needs to be displayed.

目前的电子设备中,显示或隐藏遮挡图像和应用界面旋转之间有较长的时间差,给用户造成不好的使用体验。In current electronic devices, there is a long time lag between displaying or hiding the occluded image and the rotation of the application interface, resulting in a bad user experience for the user.

发明内容Contents of the invention

本申请提供了一种屏幕旋转时的显示优化方法、设备及存储介质,可以缩短显示或隐藏遮挡图像和应用界面旋转之间的时间差,改善屏幕旋转时调整遮挡图像的视觉体验。所述技术方案如下:The present application provides a display optimization method, device and storage medium when the screen is rotated, which can shorten the time difference between displaying or hiding a occlusion image and application interface rotation, and improve the visual experience of adjusting the occlusion image when the screen is rotating. Described technical scheme is as follows:

第一方面,提供了一种屏幕旋转时的显示优化方法,应用于配置有挖孔屏的电子设备,所述方法包括:显示应用的第一应用界面,第一应用界面对应的遮挡图像显示策略为第一显示策略;响应于屏幕旋转操作,获取第二显示策略,第二显示策略为第一应用界面进行界面旋转后的第二应用界面对应的遮挡图像显示策略;在第一显示策略与第二显示策略不同的情况下,将第一应用界面向所述第二应用界面切换,并根据第二显示策略,在切换至第二应用界面之前隐藏或显示遮挡图像。In the first aspect, a display optimization method when the screen is rotated is provided, which is applied to an electronic device configured with a hole-digging screen, and the method includes: displaying a first application interface of the application, and a occlusion image display strategy corresponding to the first application interface is the first display strategy; in response to the screen rotation operation, obtain the second display strategy, the second display strategy is the occlusion image display strategy corresponding to the second application interface after the first application interface rotates the interface; between the first display strategy and the second When the two display strategies are different, switch the first application interface to the second application interface, and hide or display the blocking image before switching to the second application interface according to the second display strategy.

如此,在屏幕旋转时,可以在完成屏幕旋转之前提前在挖孔屏上显示或隐藏遮挡图像,从而缩短了显示或隐藏遮挡图像和应用界面旋转之间的时间差,缓解了屏幕旋转时隐藏或显示遮挡图像而导致的视觉上的卡顿,改善用户的使用体验。In this way, when the screen is rotating, the occlusion image can be displayed or hidden on the hole-punch screen in advance before the screen rotation is completed, thereby shortening the time difference between displaying or hiding the occlusion image and the rotation of the application interface, and alleviating the need for hiding or displaying when the screen rotates. The visual freeze caused by blocking the image improves the user experience.

其中,遮挡图像用于遮挡挖孔屏的顶部区域和/或侧边区域。比如,遮挡图像可以包括顶部黑条和/或侧边黑条。Wherein, the blocking image is used to block the top area and/or side area of the hole-digging screen. For example, the occlusion image may include top black bars and/or side black bars.

在一种可能的示例中,第一显示策略为在挖孔屏上显示遮挡图像,第二显示策略为在所述挖孔屏上不显示所述遮挡图像;显示应用的第一应用界面,包括:显示应用的第一应用界面,并在挖孔屏上显示所述遮挡图像;在切换至所述第二应用界面之前隐藏或显示遮挡图像,包括:在切换至第二应用界面之前,隐藏挖孔屏上显示的遮挡图像。In a possible example, the first display strategy is to display the occlusion image on the hole-digging screen, and the second display strategy is not to display the occlusion image on the hole-digging screen; displaying the first application interface of the application includes : display the first application interface of the application, and display the masked image on the hole-digging screen; hide or display the masked image before switching to the second application interface, including: before switching to the second application interface, hide the masking image Occlusion image displayed on hole screen.

如此,可以在第一应用界面对应的遮挡图像显示策略为显示遮挡图像,旋转后的第二应用界面对应的遮挡图像显示策略为不显示遮挡图像的情况下,在切换至第二应用界面之前,提前隐藏挖孔屏上显示的遮挡图像,缩短隐藏遮挡图像和应用界面旋转之间的时间差,缓解了屏幕旋转时隐藏遮挡图像而导致的视觉上的卡顿。In this way, when the occlusion image display strategy corresponding to the first application interface is to display occlusion images, and the occlusion image display strategy corresponding to the rotated second application interface is not to display occlusion images, before switching to the second application interface, The occlusion image displayed on the hole-digging screen is hidden in advance, the time difference between hiding the occlusion image and the rotation of the application interface is shortened, and the visual lag caused by hiding the occlusion image when the screen is rotated is alleviated.

在一种可能的示例中,隐藏挖孔屏上显示的所述遮挡图像,包括:逐次缩小所述挖孔屏上显示的遮挡图像的尺寸,直至遮挡图像被隐藏;或者,逐次提高挖孔屏上显示的遮挡图像的透明度,直至遮挡图像被隐藏。In a possible example, hiding the occlusion image displayed on the hole-digging screen includes: gradually reducing the size of the occlusion image displayed on the hole-digging screen until the occlusion image is hidden; The transparency of the occlusion image shown above until the occlusion image is hidden.

如此,可以实现以渐出效果隐藏遮挡图像,缓解从显示到隐藏遮挡图像的跳变,在视觉上增加隐藏遮挡图像的过程感和流畅感,增强用户的使用体验。In this way, the occluded image can be hidden with a fade-out effect, the transition from displaying to hiding the occluded image can be eased, the sense of process and smoothness of hiding the occluded image can be visually increased, and the user experience can be enhanced.

在一种可能的示例中,第一显示策略为在挖孔屏上不显示遮挡图像,第二显示策略为在挖孔屏上显示所述遮挡图像;在切换至第二应用界面之前隐藏或显示遮挡图像,包括:在切换至第二应用界面之前,在挖孔屏上显示所述遮挡图像。In a possible example, the first display strategy is not to display the occlusion image on the hole-digging screen, and the second display strategy is to display the occlusion image on the hole-digging screen; hide or display the image before switching to the second application interface Blocking the image includes: displaying the blocking image on the hole-digging screen before switching to the second application interface.

如此,可以在第一应用界面对应的遮挡图像显示策略为不显示遮挡图像,旋转后的第二应用界面对应的遮挡图像显示策略为显示遮挡图像的情况下,在切换至第二应用界面之前,提前在挖孔屏上显示遮挡图像,缩短显示遮挡图像和应用界面旋转之间的时间差,缓解幕旋转时显示遮挡图像而导致的视觉上的卡顿。In this way, when the occlusion image display strategy corresponding to the first application interface is not to display the occlusion image, and the occlusion image display strategy corresponding to the rotated second application interface is to display the occlusion image, before switching to the second application interface, Display the occluded image on the hole-digging screen in advance, shorten the time difference between displaying the occluded image and the rotation of the application interface, and alleviate the visual freeze caused by displaying the occluded image when the screen rotates.

在一种可能的示例中,在挖孔屏上显示遮挡图像,包括:在挖孔屏上显示遮挡图像的部分区域,逐次增加显示的遮挡图像的部分区域的尺寸,直至在挖孔屏上显示完整的遮挡图像;或者,在挖孔屏上以第一透明度显示遮挡图像,逐次减小遮挡图像的透明度,直至遮挡图像的透明度减小至第二透明度,第二透明度小于第一透明度。In a possible example, displaying the occluded image on the hole-digging screen includes: displaying a partial area of the occluded image on the hole-digging screen, increasing the size of the displayed partial area of the occluded image until it is displayed on the hole-digging screen A complete occlusion image; or, the occlusion image is displayed on the hole-digging screen with a first transparency, and the transparency of the occlusion image is gradually reduced until the transparency of the occlusion image is reduced to a second transparency, which is smaller than the first transparency.

如此,可以实现以渐现效果显示遮挡图像,缓解从隐藏到显示遮挡图像的跳变,在视觉上增加显示遮挡图像的过程感和流畅感,增强用户的使用体验。In this way, the occluded image can be displayed with a fade-in effect, the jump from hiding to displaying the occluded image can be eased, the process and smoothness of displaying the occluded image can be visually increased, and the user experience can be enhanced.

在一种可能的示例中,第一显示策略和第二显示策略均包括第一遮挡图像的显示策略和第二遮挡图像的显示策略,第一遮挡图像用于遮挡挖孔屏的顶部区域,第二遮挡图像用于遮挡挖孔屏的侧边区域;在切换至第二应用界面之前隐藏或显示遮挡图像,包括:In a possible example, both the first display strategy and the second display strategy include a display strategy of a first occlusion image and a display strategy of a second occlusion image, the first occlusion image is used to cover the top area of the hole-digging screen, and the first The second occlusion image is used to block the side area of the hole-digging screen; before switching to the second application interface, hide or display the occlusion image, including:

在第一显示策略和第二显示策略中的第一遮挡图像的显示策略不同、第二遮挡图像的显示策略相同的情况下,在切换至第二应用界面之前隐藏或显示第一遮挡图像;In the case that the display strategy of the first occlusion image in the first display strategy and the second display strategy are different, and the display strategy of the second occlusion image is the same, hide or display the first occlusion image before switching to the second application interface;

在第一显示策略和第二显示策略中的第一遮挡图像的显示策略相同、第二遮挡图像的显示策略不同的情况下,在切换至第二应用界面之前隐藏或显示第二遮挡图像;In the case where the display strategy of the first occlusion image in the first display strategy and the second display strategy are the same, and the display strategy of the second occlusion image is different, hiding or displaying the second occlusion image before switching to the second application interface;

在第一显示策略和第二显示策略中的第一遮挡图像的显示策略不同、第二遮挡图像的显示策略也不同的情况下,在切换至第二应用界面之前隐藏或显示第一遮挡图像、以及隐藏或显示第二遮挡图像。In the case that the display strategy of the first occlusion image in the first display strategy and the second display strategy are different, and the display strategy of the second occlusion image is also different, before switching to the second application interface, hide or display the first occlusion image, and hide or show the second occlusion image.

如此,增加了遮挡图像显示策略的多样性,可以根据需要灵活配置应用的横竖屏应用界面对应的遮挡图像显示策略。另外,可以根据多样性的遮挡图像显示策略,在切换至第二应用界面之前,适应性地隐藏或显示遮挡图像。In this way, the diversity of occlusion image display strategies is increased, and the occlusion image display strategies corresponding to the horizontal and vertical screen application interfaces of the application can be flexibly configured according to needs. In addition, the occlusion image can be adaptively hidden or displayed before switching to the second application interface according to various occlusion image display strategies.

在一种可能的示例中,电子设备的操作系统包括窗口管理服务模块、系统用户界面和显示旋转模块;响应于屏幕旋转操作,获取第二显示策略,包括:In a possible example, the operating system of the electronic device includes a window management service module, a system user interface, and a display rotation module; in response to a screen rotation operation, obtaining a second display strategy includes:

窗口管理服务模块若检测到屏幕旋转指令,则查询第二应用界面对应的遮挡图像显示策略,第二应用界面对应的遮挡图像显示策略为第二显示策略,屏幕方向包括横屏方向和竖屏方向;If the window management service module detects the screen rotation command, it will query the occlusion image display strategy corresponding to the second application interface. The occlusion image display strategy corresponding to the second application interface is the second display strategy, and the screen orientation includes landscape orientation and portrait orientation. ;

将第一应用界面向第二应用界面切换,根据第二显示策略,在切换至第二应用界面之前隐藏或显示遮挡图像,包括:Switching the first application interface to the second application interface, according to the second display strategy, hiding or displaying the occluded image before switching to the second application interface, including:

窗口管理服务模块通知显示旋转模块进行屏幕旋转,并根据第二显示策略通知系统用户界面隐藏或显示遮挡图像;显示旋转模块响应窗口管理服务模块的通知,将第一应用界面向第二应用界面切换;系统用户界面在显示旋转模块将第一应用界面切换至第二应用界面切换之前,响应窗口管理服务模块的通知,隐藏或显示遮挡图像。The window management service module notifies the display rotation module to rotate the screen, and notifies the system user interface to hide or display the occluded image according to the second display policy; the display rotation module responds to the notification of the window management service module, and switches the first application interface to the second application interface ; Before the system user interface displays the rotation module to switch the first application interface to the second application interface, it responds to the notification of the window management service module to hide or display the blocking image.

如此,WMS可以在通知显示旋转模块进行屏幕旋转之前,提前获取旋转后的应用界面对应的遮挡图像显示策略,以及在显示旋转模块完成屏幕旋转之前,根据旋转后的应用界面对应的遮挡图像显示策略提前通知系统用户界面隐藏或显示遮挡图像,从而缩短了隐藏或显示遮挡图像和应用界面旋转之间的时间差,缓解了屏幕旋转时隐藏或显示遮挡图像而导致的视觉上的卡顿。In this way, the WMS can obtain the occlusion image display strategy corresponding to the rotated application interface in advance before informing the display rotation module to rotate the screen, and before the display rotation module completes the screen rotation, according to the occlusion image display strategy corresponding to the rotated application interface Notify the system user interface in advance to hide or display the occluded image, thereby shortening the time difference between hiding or displaying the occluded image and the rotation of the application interface, and alleviating the visual lag caused by hiding or displaying the occluded image when the screen rotates.

其中,屏幕旋转指令用于指示屏幕需要进行旋转。窗口管理服务模块可以在接收到电子设备的重力方向变化事件后,根据重力方向变化事件确定屏幕需要进行旋转时,确定检测到屏幕旋转指令。或者,在接收到横竖屏姿态变化事件时,确定检测到屏幕旋转指令。或者,在接收到自动旋转功能按钮的触发事件时,确定检测到屏幕旋转指令。当然,也可以在其他情况下确定检测到屏幕旋转指令,本申请实施例对此不作限定。Wherein, the screen rotation command is used to indicate that the screen needs to be rotated. After receiving the gravity direction change event of the electronic device, the window management service module may determine that the screen rotation instruction is detected when determining that the screen needs to be rotated according to the gravity direction change event. Alternatively, when a horizontal and vertical screen posture change event is received, it is determined that a screen rotation instruction is detected. Alternatively, when the trigger event of the automatic rotation function button is received, it is determined that the screen rotation instruction is detected. Of course, it may also be determined in other circumstances that the screen rotation instruction is detected, which is not limited in this embodiment of the present application.

在一种可能的示例中,操作系统还包括SurfaceFlinger;显示旋转模块响应窗口管理服务模块的通知,将第一应用界面向第二应用界面切换,包括:In a possible example, the operating system further includes SurfaceFlinger; the display rotation module switches the first application interface to the second application interface in response to the notification of the window management service module, including:

显示旋转模块响应窗口管理服务模块的通知,通知SurfaceFlinger播放屏幕旋转动画效果,屏幕旋转动画效果是指将第一应用界面向第二应用界面切换的动画效果。通过在屏幕旋转时播放屏幕旋转动画效果,可以增加屏幕旋转的过程感和流畅感,提高用户的视觉体验。The display rotation module responds to the notification of the window management service module, and notifies SurfaceFlinger to play the screen rotation animation effect. The screen rotation animation effect refers to the animation effect of switching the first application interface to the second application interface. By playing the screen rotation animation effect when the screen rotates, the sense of process and smoothness of the screen rotation can be increased, and the user's visual experience can be improved.

在一种可能的示例中,系统用户界面可以以渐隐效果隐藏遮挡图像,或者以渐现效果显示遮挡图像。比如,窗口管理服务模块可以在通知显示旋转模块进行屏幕旋转同时,根据第二显示策略通知系统用户界面播放遮挡图像的渐隐动画效果或渐现动画效果。显示旋转模块响应窗口管理服务模块的通知,通知SurfaceFlinger播放屏幕旋转动画效果,同时,系统用户界面响应窗口管理服务模块的通知,播放遮挡图像的渐隐动画效果或渐现动画效果。如此,可以保证屏幕旋转动效与遮挡图像的渐隐渐现动效同时进行,而不是在屏幕旋转动效播放完成之外才隐藏或显示遮挡图像,增强用户体验。In a possible example, the system user interface may hide the occlusion image with a fading effect, or display the occlusion image with a fading effect. For example, the window management service module may notify the system user interface to play the fading animation effect or fading animation effect of the occluded image according to the second display strategy while notifying the display rotation module to perform screen rotation. The display rotation module responds to the notification of the window management service module, and notifies SurfaceFlinger to play the screen rotation animation effect. At the same time, the system user interface responds to the notification of the window management service module, and plays the fading animation effect or fading animation effect of the occluded image. In this way, it is possible to ensure that the screen rotation animation and the fade-in and fade-out animation of the occluded image are performed simultaneously, instead of hiding or displaying the occluded image after the screen rotation animation is played, thereby enhancing user experience.

在一种可能的示例中,电子设备的操作系统还包括传感器模块,传感器模块用于获取电子设备的横竖屏姿态;窗口管理服务模块查询第二应用界面对应的遮挡图像显示策略之前,还包括:传感器模块若检测到电子设备的横竖屏姿态发生变化,则向窗口管理服务模块发送横竖屏姿态变化事件;窗口管理服务模块接收横竖屏姿态变化事件,根据接收到的横竖屏姿态变化事件,确定检测到屏幕旋转指令。In a possible example, the operating system of the electronic device further includes a sensor module, and the sensor module is used to obtain the horizontal and vertical screen posture of the electronic device; before the window management service module queries the occlusion image display strategy corresponding to the second application interface, it also includes: If the sensor module detects a change in the horizontal and vertical screen posture of the electronic device, it will send a horizontal and vertical screen posture change event to the window management service module; the window management service module receives the horizontal and vertical screen posture change event, and determines the detection according to the received horizontal and vertical screen posture change event. to the screen rotation command.

第二方面,提供了一种屏幕旋转时的显示优化装置,所述屏幕旋转时的显示优化装置具有实现上述第一方面中屏幕旋转时的显示优化方法行为的功能。所述屏幕旋转时的显示优化装置包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的屏幕旋转时的显示优化方法。The second aspect provides a display optimization device when the screen rotates, and the display optimization device when the screen rotates has the function of implementing the behavior of the display optimization method when the screen rotates in the above first aspect. The apparatus for display optimization when the screen rotates includes at least one module, and the at least one module is configured to implement the display optimization method for screen rotation provided in the first aspect above.

第三方面,提供了一种屏幕旋转时的显示优化装置,所述屏幕旋转时的显示优化装置的结构中包括处理器和存储器,所述存储器用于存储支持屏幕旋转时的显示优化装置执行上述第一方面所提供的屏幕旋转时的显示优化方法的程序,以及存储用于实现上述第一方面所述的屏幕旋转时的显示优化方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述屏幕旋转时的显示优化装置还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。The third aspect provides a display optimization device when the screen rotates. The structure of the display optimization device when the screen rotates includes a processor and a memory. The memory is used to store the display optimization device when the screen rotates to support the execution of the above The first aspect provides the program of the display optimization method when the screen rotates, and stores the data involved in implementing the display optimization method when the screen rotates in the first aspect. The processor is configured to execute programs stored in the memory. The display optimization device when the screen rotates may further include a communication bus for establishing a connection between the processor and the memory.

第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的屏幕旋转时的显示优化方法。In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer performs the display optimization when the screen is rotated as described in the first aspect above method.

第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的屏幕旋转时的显示优化方法。A fifth aspect provides a computer program product containing instructions, which, when run on a computer, cause the computer to execute the display optimization method when the screen is rotated as described in the first aspect above.

上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above-mentioned second aspect, third aspect, fourth aspect and fifth aspect are similar to those obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.

附图说明Description of drawings

图1是本申请实施例提供的一种手机在竖屏模式下在挖孔屏上显示未适配挖孔屏的竖屏应用界面以及遮挡图像的示意图;Fig. 1 is a schematic diagram of a mobile phone displaying a vertical screen application interface not adapted to a hole-digging screen and blocking images on a hole-digging screen in a vertical screen mode provided by an embodiment of the present application;

图2是相关技术提供的一种手机从适配挖孔屏的竖屏应用界面向未适配挖孔屏的横屏应用界面切换的场景示意图;Fig. 2 is a schematic diagram of a mobile phone switching from a vertical screen application interface adapted to a hole-digging screen to a horizontal screen application interface not adapted to a hole-digging screen provided by related technologies;

图3是相关技术提供的一种手机从未适配挖孔屏的竖屏应用界面向适配挖孔屏的横屏应用界面切换的场景示意图;FIG. 3 is a schematic diagram of a scenario where a mobile phone is switched from a vertical screen application interface adapted to a hole-digging screen to a horizontal screen application interface adapted to a hole-digging screen provided by related technologies;

图4是本申请实施例提供的一种手机从适配挖孔屏的横屏应用界面向未适配挖孔屏的竖屏应用界面切换的场景示意图;FIG. 4 is a schematic diagram of a mobile phone switching from a horizontal screen application interface adapted to a hole-digging screen to a vertical screen application interface not adapted to a hole-digging screen according to an embodiment of the present application;

图5是本申请实施例提供的一种手机从未适配挖孔屏的竖屏应用界面向适配挖孔屏的横屏应用界面切换的场景示意图;Fig. 5 is a schematic diagram of a scenario where a mobile phone is switched from a vertical screen application interface adapted to a hole-digging screen to a horizontal screen application interface adapted to a hole-digging screen according to an embodiment of the present application;

图6是本申请实施例提供的一种电子设备的结构示意图;FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

图7是本申请实施例提供的一种电子设备的软件系统的框图;FIG. 7 is a block diagram of a software system of an electronic device provided by an embodiment of the present application;

图8是相关技术中提供的一种屏幕旋转时的显示方法的流程图;Fig. 8 is a flow chart of a display method when the screen rotates provided in the related art;

图9是本申请实施例提供的一种屏幕旋转时的显示优化方法的流程图;FIG. 9 is a flow chart of a display optimization method when the screen is rotated according to an embodiment of the present application;

图10是本申请实施例提供的一种屏幕旋转时的显示优化方法的信令图。FIG. 10 is a signaling diagram of a display optimization method when the screen is rotated according to an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manner of the present application will be further described in detail below in conjunction with the accompanying drawings.

应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "plurality" mentioned in this application means two or more. In the description of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this article is just a description of the relationship between associated objects, It means that there can be three kinds of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in order to clearly describe the technical solution of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not necessarily limit the difference.

为了便于理解本申请,首先对本申请实施例可能涉及的术语进行说明。In order to facilitate the understanding of the present application, terms that may be involved in the embodiments of the present application are described first.

全面屏设备:全面屏设备是指通过缩小边框的尺寸而获得较高的屏占比的电子设备。屏占比是指屏幕面积和电子设备正面(一般以屏幕所在的一面为正面)的面积的比值。通过缩小边框的宽度,全面屏的屏占比可以达到80%至90%。Full-screen device: A full-screen device refers to an electronic device that obtains a higher screen-to-body ratio by reducing the size of the frame. The screen-to-body ratio refers to the ratio of the screen area to the area of the front of the electronic device (generally, the side where the screen is located is the front). By reducing the width of the frame, the screen-to-body ratio of the full screen can reach 80% to 90%.

瀑布屏设备:瀑布屏是在全面屏设备的基础上进一步改进后的产物。瀑布屏设备的屏幕侧边具有一定的弧度,因而与全面屏设备相比,瀑布屏设备能够完全取消屏幕两侧的边框,进一步提高了屏占比,使得瀑布屏设备的屏占比可以达到90%以上。Waterfall screen device: The waterfall screen is a product that has been further improved on the basis of the full screen device. The screen side of the waterfall screen device has a certain curvature. Therefore, compared with the full screen device, the waterfall screen device can completely cancel the borders on both sides of the screen, further improving the screen ratio, so that the screen ratio of the waterfall screen device can reach 90. %above.

挖孔屏:设置有挖孔区域的上述全面屏和瀑布屏可以统称为挖孔屏,配置的屏幕为挖孔屏的电子设备可以称为挖孔屏设备。Hole-digging screen: The above-mentioned full screen and waterfall screen with a hole-digging area can be collectively called a hole-digging screen, and an electronic device configured with a hole-digging screen can be called a hole-digging screen device.

一般的,全面屏设备和瀑布屏设备的屏幕上可以设置挖孔区域,该挖孔区域的形状可以是圆形、圆角矩形或其他不规则形状,挖孔区域可以位于屏幕的一角(比如位于靠近左上角的位置),也可以位于屏幕顶部中央的位置,本申请实施例对挖孔区域的位置和形状均不做限定。电子设备上需要安装在正面的器件可以安装在挖孔区域内。需要安装在正面的器件可以包括前置摄像头、接近光传感器等。Generally, a hole-digging area can be set on the screen of a full-screen device or a waterfall-screen device. The shape of the hole-digging area can be a circle, a rectangle with rounded corners, or other irregular shapes. The position near the upper left corner), or the position at the top center of the screen. The embodiment of the present application does not limit the position and shape of the hole-digging area. Devices that need to be mounted on the front of the electronic equipment can be installed in the cutout area. Devices that need to be mounted on the front can include front-facing cameras, proximity light sensors, and more.

遮挡图像:遮挡图像是指电子设备在屏幕的顶部区域和/或侧边区域显示的用于遮挡对应区域的图像。遮挡图像的样式和尺寸,可以基于系统的默认配置确定,也可以基于用户设置确定。比如,若应用界面不适配挖孔屏,则电子设备可以在显示应用界面的同时,在挖孔屏的顶部区域和/或侧边区域显示遮挡图像。Blocking image: a blocking image refers to an image displayed by an electronic device on a top area and/or a side area of a screen to block a corresponding area. The style and size of the occluded image can be determined based on the default configuration of the system, or can be determined based on user settings. For example, if the application interface is not suitable for the hole-digging screen, the electronic device may display a blocking image on the top area and/or the side area of the hole-digging screen while displaying the application interface.

接下来,对申请实施例涉及的应用场景进行说明。Next, the application scenarios involved in the embodiments of the application are described.

当电子设备的屏幕为挖孔屏时,不同应用的应用界面对挖孔屏的适配情况可能不同,同一应用的竖屏应用界面和横屏应用界面对挖孔屏的适配情况也可能不同。竖屏应用界面是指在竖屏模式下适配于竖向屏幕的应用界面。横屏应用界面是指在横屏模式下适配于横向屏幕的应用界面。When the screen of the electronic device is a hole-digging screen, the application interface of different applications may adapt to the hole-digging screen differently, and the adaptation of the vertical screen application interface and the horizontal screen application interface of the same application to the hole-digging screen may also be different . The vertical screen application interface refers to an application interface adapted to a vertical screen in a vertical screen mode. The landscape application interface refers to the application interface adapted to the landscape screen in the landscape mode.

比如,对于有些应用来说,这些应用的竖屏应用界面适配挖孔屏,而横屏应用界面未适配挖孔屏。因此,其竖屏应用界面在挖孔屏上显示时能占满整个屏幕,电子设备在显示适配挖孔屏的竖屏应用界面时不需要在屏幕的顶部区域和/或侧边区域显示遮挡图像。而其横屏应用界面在挖孔屏上显示时不能占满整个屏幕,电子设备在显示不适配挖孔屏的横屏应用界面时,会在屏幕顶部区域和/或侧边区域显示遮挡图像,使屏幕上未被遮挡的可视区域和横屏应用界面适配。For example, for some applications, the vertical screen application interface of these applications is adapted to the punch-hole screen, while the horizontal screen application interface is not adapted to the punch-hole screen. Therefore, when the vertical screen application interface is displayed on the hole-digging screen, it can occupy the entire screen, and when the electronic device displays the vertical screen application interface adapted to the hole-digging screen, it does not need to display occlusion in the top area and/or side area of the screen. image. However, when the horizontal screen application interface is displayed on the hole-punch screen, it cannot occupy the entire screen. When the electronic device displays a horizontal screen application interface that is not suitable for the hole-punch screen, it will display an occluded image on the top area and/or side area of the screen. , so that the unobstructed visible area on the screen can adapt to the application interface of the landscape screen.

再比如,对于另一些应用来说,这些应用的竖屏应用界面不适配挖孔屏,而横屏应用界面适配挖孔屏。因此,其竖屏应用界面在挖孔屏上显示时不能占满整个屏幕,电子设备在显示不适配挖孔屏的竖屏应用界面时,会在屏幕顶部区域和/或侧边区域显示遮挡图像,使屏幕上未被遮挡的可视区域和竖屏应用界面适配。而其横屏应用界面在挖孔屏上显示时能占满整个屏幕,电子设备在显示适配挖孔屏的横屏应用界面时不需要在屏幕的顶部区域和/或侧边区域显示遮挡图像。For another example, for other applications, the vertical screen application interface of these applications is not suitable for the punch-hole screen, while the horizontal screen application interface is suitable for the punch-hole screen. Therefore, when the vertical screen application interface is displayed on the hole-digging screen, it cannot occupy the entire screen. When the electronic device displays a vertical screen application interface that is not suitable for the hole-digging screen, it will display occlusion in the top area and/or side area of the screen. Image, so that the unobstructed visible area on the screen fits with the vertical screen application interface. However, its horizontal screen application interface can occupy the entire screen when displayed on the hole-punch screen, and the electronic device does not need to display occlusion images on the top area and/or side area of the screen when displaying the horizontal screen application interface adapted to the hole-punch screen. .

由上可知,应用的竖屏应用界面和横屏应用界面对应的遮挡图像显示策略可以根据对应应用界面是否适配挖孔屏设置。比如,若应用界面适配挖孔屏,则其对应的遮挡图像显示策略为不在挖孔屏上显示遮挡图像,即在挖孔屏上隐藏遮挡图像。若应用界面未适配挖孔屏,则其对应的遮挡图像显示策略为在挖孔屏上显示遮挡图像。It can be seen from the above that the occlusion image display strategy corresponding to the vertical screen application interface and the horizontal screen application interface of the application can be set according to whether the corresponding application interface is adapted to the punch-hole screen. For example, if the application interface is adapted to the hole-digging screen, its corresponding occlusion image display strategy is not to display the occlusion image on the hole-digging screen, that is, to hide the occlusion image on the hole-digging screen. If the application interface is not adapted to the hole-punch screen, the corresponding occlusion image display strategy is to display the occlusion image on the hole-punch screen.

另外,在显示未适配挖孔屏的横屏应用界面或竖屏应用界面时,根据应用界面在挖孔屏上覆盖的区域,电子设备可以同时在顶部区域和侧边区域显示遮挡图像,或者可以仅在顶部区域显示遮挡图像,还可以仅在侧边区域显示遮挡图像。总之,显示遮挡图像的具体位置可以根据当前显示的应用界面决定,本实施例对此不做限定。In addition, when displaying a horizontal screen application interface or a vertical screen application interface that is not adapted to the punch-hole screen, according to the area covered by the application interface on the punch-hole screen, the electronic device can simultaneously display a blocking image on the top area and the side area, or The occluded image can be displayed only in the top area, and can be displayed only in the side areas. In short, the specific position for displaying the blocking image may be determined according to the currently displayed application interface, which is not limited in this embodiment.

因此,未适配挖孔屏的应用界面对应的遮挡图像显示策略可能包括多种显示策略。比如包括如下几种显示策略:在顶部区域和侧边区域显示遮挡图像;在顶部区域显示遮挡图像但不在侧边区域显示遮挡图像;在侧边区域显示遮挡图像但不在顶部区域显示遮挡图像。Therefore, the occlusion image display strategy corresponding to the application interface that is not adapted to the punch-hole screen may include multiple display strategies. For example, it includes the following display strategies: display occluded images in the top area and side areas; display occluded images in the top area but not in the side area; display occluded images in the side area but not in the top area.

由上可知,即使应用的竖屏应用界面和横屏应用界面均未适配挖孔屏,其对应的遮挡图像显示策略也可能不同。比如,竖屏应用界面对应的遮挡图像显示策略为:在顶部区域和侧边区域显示遮挡图像。横屏应用界面对应的遮挡图像显示策略为:在顶部区域显示遮挡图像但不在侧边区域显示遮挡图像。It can be seen from the above that even if neither the vertical screen application interface nor the horizontal screen application interface of the application is adapted to the punch-hole screen, the corresponding occlusion image display strategies may be different. For example, the occlusion image display policy corresponding to the vertical screen application interface is: display occlusion images in the top area and the side area. The occluded image display strategy corresponding to the horizontal screen application interface is: display the occluded image on the top area but not display the occluded image on the side area.

若电子设备在显示某个应用的应用界面时进行屏幕旋转,即横竖屏模式发生切换,则电子设备将从竖屏应用界面切换至横屏应用界面,或者从横屏应用界面切换至竖屏应用界面。在电子设备从竖屏应用界面切换至横屏应用界面,或者从横屏应用界面切换至竖屏应用界面时,若切换前的应用界面与切换后的应用界面对应的遮挡图像显示策略不同,电子设备将会在应用界面切换后在屏幕上显示或隐藏遮挡图像。比如,若旋转前的应用界面适配挖孔屏,旋转后的应用界面不适配挖孔屏,则将在应用界面旋转后在挖孔屏上显示遮挡图像。若旋转前的应用界面不适配挖孔屏,旋转后的应用界面适配挖孔屏,则将在应用界面旋转后在挖孔屏上隐藏遮挡图像。If the electronic device rotates the screen when displaying the application interface of an application, that is, the horizontal and vertical screen modes are switched, the electronic device will switch from the vertical screen application interface to the horizontal screen application interface, or switch from the horizontal screen application interface to the vertical screen application interface. When the electronic device switches from a vertical screen application interface to a horizontal screen application interface, or from a horizontal screen application interface to a vertical screen application interface, if the occlusion image display strategies corresponding to the application interface before switching and the application interface after switching are different, the electronic The device will display or hide the occlusion image on the screen after the application interface is switched. For example, if the application interface before rotation is suitable for the hole-digging screen, but the application interface after rotation is not suitable for the hole-digging screen, the occlusion image will be displayed on the hole-digging screen after the application interface is rotated. If the application interface before rotation is not suitable for the hole-digging screen, and the application interface after rotation is suitable for the hole-digging screen, the occlusion image will be hidden on the hole-digging screen after the application interface is rotated.

需要说明的是,本申请实施例涉及的电子设备为配置有挖孔屏的电子设备,具体可以为手机、平板电脑、智能可穿戴设备等,本申请实施例对电子设备的具体类型不做限定。为了便于理解,接下来将以电子设备为手机为例进行举例说明。It should be noted that the electronic device involved in the embodiment of the present application is an electronic device equipped with a hole-digging screen, specifically, a mobile phone, a tablet computer, a smart wearable device, etc. The embodiment of the present application does not limit the specific type of the electronic device . For ease of understanding, the electronic device is a mobile phone as an example for illustration in the following.

请参考图1,图1是本申请实施例提供的一种手机在竖屏模式下在挖孔屏上显示未适配挖孔屏的竖屏应用界面以及遮挡图像的示意图。由图1可以看出,手机100的屏幕上设置有挖孔区域101,挖孔区域101内安装有前置摄像头。屏幕顶部,即挖孔区域101所在的区域为挖孔屏的顶部区域102,屏幕两侧的长条形区域为挖孔屏的侧边区域103。Please refer to FIG. 1 . FIG. 1 is a schematic diagram of a mobile phone displaying a vertical screen application interface not adapted to a punch-hole screen and blocking images on a punch-hole screen in portrait mode according to an embodiment of the present application. It can be seen from FIG. 1 that a hole-digging area 101 is set on the screen of the mobile phone 100 , and a front camera is installed in the hole-digging area 101 . The top of the screen, that is, the area where the hole-digging area 101 is located is the top area 102 of the hole-digging screen, and the strip-shaped areas on both sides of the screen are the side areas 103 of the hole-digging screen.

手机100在竖屏模式下运行视频应用时,手机100的挖孔屏上显示图示的视频应用的竖屏应用界面。由于视频应用的竖屏应用界面未适配挖孔屏,电子设备在显示视频应用的竖屏应用界面的同时,在挖孔屏的顶部区域102显示如图1所示的顶部黑条104,在挖孔屏的侧边区域103显示如图1所示的侧边黑条105,图1所示的顶部黑条104和侧边黑条105,即是本申请实施例所述的遮挡图像的一种具体实现形式。When the mobile phone 100 runs the video application in the portrait mode, the hole-digging screen of the mobile phone 100 displays the illustrated vertical screen application interface of the video application. Since the vertical screen application interface of the video application is not adapted to the hole-digging screen, while the electronic device displays the vertical screen application interface of the video application, the top black bar 104 shown in FIG. The side area 103 of the hole-digging screen displays side black bars 105 as shown in FIG. 1, and the top black bars 104 and side black bars 105 shown in FIG. A specific form of implementation.

除图1所示的场景以外,在实际应用中,显示未适配挖孔屏的竖屏应用界面或横屏应用界面时,根据应用界面在挖孔屏上覆盖的区域,电子设备可以同时在顶部区域和侧边区域显示遮挡图像,或者可以仅在顶部区域显示遮挡图像,还可以仅在侧边区域显示遮挡图像。总之,显示遮挡图像的具体位置可以根据当前显示的应用界面决定,本实施例对此不做限定。In addition to the scenarios shown in Figure 1, in actual applications, when displaying a vertical screen application interface or a horizontal screen application interface that is not adapted to the hole-digging screen, the electronic device can simultaneously display the application interface according to the area covered by the hole-digging screen. The occluded image is displayed in the top area and the side area, or the occluded image may be displayed only in the top area, and the occluded image may be displayed only in the side area. In short, the specific position for displaying the blocking image may be determined according to the currently displayed application interface, which is not limited in this embodiment.

在对手机进行屏幕旋转时,比如将手机由竖屏模式切换为横屏模式时,手机会将当前显示的竖屏应用界面切换为适配于横向屏幕的横屏应用界面。若竖屏应用界面未适配挖孔屏,而横屏应用界面适配挖孔屏,则在手机显示横屏应用界面时,会隐藏遮挡图像。比如,在对手机100进行屏幕旋转,从而将图1所示的竖屏显示界面切换为适配挖孔屏的横屏应用界面时,将隐藏屏幕上的遮挡图像,即隐藏顶部区域102的顶部黑条以及侧边区域103的侧边黑条,使得横屏应用界面占满屏幕。When the screen of the mobile phone is rotated, for example, when the mobile phone is switched from the portrait mode to the landscape mode, the mobile phone will switch the currently displayed portrait application interface to a landscape application interface suitable for the landscape screen. If the vertical screen application interface is not adapted to the punch-hole screen, but the horizontal screen application interface is adapted to the punch-hole screen, when the mobile phone displays the horizontal screen application interface, the occlusion image will be hidden. For example, when the screen of the mobile phone 100 is rotated to switch the vertical screen display interface shown in FIG. The black bars and the side black bars of the side area 103 make the horizontal screen application interface occupy the entire screen.

相关技术中,电子设备跟随应用界面旋转而显示或隐藏遮挡图像时,存在如下的问题:In the related art, when the electronic device displays or hides the occlusion image following the rotation of the application interface, there are the following problems:

目前的电子设备在从竖屏应用界面向横屏应用界面切换,或者从横屏应用界面向竖屏应用界面切换时,都是在屏幕旋转动画效果播放结束之后再调整屏幕上遮挡图像的显示或隐藏,这类电子设备在进行屏幕旋转时,用户看到的视觉效果一般是,屏幕旋转动画效果播放完后,屏幕上显示的界面发生跳变,从显示遮挡图像的界面直接切换为隐藏遮挡图像的界面,或者从隐藏遮挡图像的界面切换为显示遮挡图像的界面。这种在屏幕旋转动画效果播放完后的跳变,会造成视觉上的卡顿感,即用户感觉电子设备在屏幕旋转的过程发生卡顿和闪屏。When current electronic devices switch from a vertical screen application interface to a horizontal screen application interface, or from a horizontal screen application interface to a vertical screen application interface, they all adjust the display or display of the occluded image on the screen after the screen rotation animation effect is played. Hidden, when this type of electronic device rotates the screen, the visual effect that the user sees is generally that after the screen rotation animation is played, the interface displayed on the screen jumps, and the interface that displays the occluded image is directly switched to hide the occluded image , or switch from hiding the occluded image interface to showing the occluded image interface. This kind of jump after the screen rotation animation effect is played will cause a visual sense of freeze, that is, the user feels that the electronic device freezes and flickers during the screen rotation process.

比如,请参考图2,图2是相关技术提供的一种手机从适配挖孔屏的竖屏应用界面向未适配挖孔屏的横屏应用界面切换的场景示意图。For example, please refer to FIG. 2 . FIG. 2 is a schematic diagram of a mobile phone switching from a vertical screen application interface adapted to a hole-digging screen to a horizontal screen application interface not adapted to a hole-digging screen provided by related technologies.

手机处于竖屏模式时,用户打开手机安装的视频应用播放视频,手机响应于用户的操作启动视频应用,通过视频应用播放视频,并显示如图2的(a)图所示的竖屏模式下视频应用的竖屏应用界面。由于竖屏模式下视频应用的竖屏应用界面适配挖孔屏,因此显示竖屏应用界面时,挖孔屏上未显示遮挡图像。在视频应用播放视频期间,用户执行屏幕旋转操作,手机响应于屏幕旋转操作,将视频应用的竖屏应用界面向横屏应用界面切换,显示如图2中的(b)图所示的视频应用的横屏应用界面。另外,在手机从视频应用的竖屏应用界面向横屏应用界面切换的过程中,可以播放屏幕旋转动画效果,屏幕旋转动画效果是指从竖屏应用界面向横屏应用界面切换的动画效果。手机在切换至如图2中的(b)图所示的横屏应用界面后,获取横屏应用界面对应的遮挡图像显示策略。若横屏应用界面对应的遮挡图像显示策略为显示顶部黑条和侧边黑条,再将图2中的(b)图所示的界面切换为图2中的(c)图所示界面,即在屏幕的顶部区域显示顶部黑条,以及在侧边区域显示侧边黑条。When the mobile phone is in portrait mode, the user opens the video application installed on the mobile phone to play the video, and the mobile phone starts the video application in response to the user's operation, plays the video through the video application, and displays the vertical screen mode as shown in (a) of Figure 2. Portrait app interface for video apps. Since the vertical screen application interface of the video application in portrait mode is adapted to the hole-punch screen, when the vertical screen application interface is displayed, no occlusion image is displayed on the punch-hole screen. When the video application is playing a video, the user performs a screen rotation operation. In response to the screen rotation operation, the mobile phone switches the application interface of the video application from the vertical screen to the application interface of the horizontal screen, and displays the video application as shown in (b) in Figure 2 horizontal screen application interface. In addition, when the mobile phone is switching from the vertical screen application interface of the video application to the horizontal screen application interface, the screen rotation animation effect can be played, and the screen rotation animation effect refers to the animation effect of switching from the vertical screen application interface to the horizontal screen application interface. After the mobile phone switches to the horizontal screen application interface shown in (b) in Figure 2, it obtains the occlusion image display strategy corresponding to the horizontal screen application interface. If the occlusion image display strategy corresponding to the horizontal screen application interface is to display the top black bar and the side black bar, then switch the interface shown in (b) in Figure 2 to the interface shown in (c) in Figure 2, That is, the top black bar is displayed on the top area of the screen, and the side black bars are displayed on the side area.

再比如,请参考图3,图3是相关技术提供的一种手机从未适配挖孔屏的竖屏应用界面向适配挖孔屏的横屏应用界面切换的场景示意图。For another example, please refer to FIG. 3 . FIG. 3 is a schematic diagram of a scenario where a mobile phone is switched from a vertical screen application interface not adapted to a hole-digging screen to a horizontal screen application interface adapted to a hole-digging screen provided by related technologies.

手机处于竖屏模式时,用户打开手机安装的视频应用播放视频,手机响应于用户的操作启动视频应用,通过视频应用播放视频,并显示如图3的(a)图所示的竖屏模式下视频应用的竖屏应用界面。由于竖屏模式下视频应用的竖屏应用界面适配挖孔屏,因此显示竖屏应用界面时,挖孔屏上显示有遮挡图像,遮挡图像包括顶部黑条和侧边黑条。在视频应用播放视频期间,用户执行屏幕旋转操作,手机响应于屏幕旋转操作,将视频应用的竖屏应用界面向横屏应用界面切换,显示如图3中的(b)图所示的视频应用的横屏应用界面以及遮挡图像。另外,在手机从视频应用的竖屏应用界面向横屏应用界面切换的过程中,可以播放屏幕旋转动画效果。手机在切换至如图3中的(b)图所示的横屏应用界面后,获取横屏应用界面对应的遮挡图像显示策略。若横屏应用界面对应的遮挡图像显示策略为不显示顶部黑条和侧边黑条,则将图3中的(b)图所示的界面切换为图3中的(c)图所示的界面,即隐藏顶部区域的顶部黑条以及侧边区域的侧边黑条。When the mobile phone is in portrait mode, the user opens the video application installed on the mobile phone to play the video, and the mobile phone starts the video application in response to the user's operation, plays the video through the video application, and displays the vertical screen mode as shown in (a) of Figure 3. Portrait app interface for video apps. Since the vertical screen application interface of the video application in portrait mode is adapted to the hole-digging screen, when the vertical screen application interface is displayed, the hole-digging screen displays an occluded image, which includes black bars on the top and black bars on the sides. When the video application is playing a video, the user performs a screen rotation operation. In response to the screen rotation operation, the mobile phone switches the application interface of the video application from the vertical screen to the application interface of the horizontal screen, and displays the video application as shown in (b) in Figure 3 The horizontal screen application interface and occlusion image. In addition, when the mobile phone switches from the vertical screen application interface of the video application to the horizontal screen application interface, an animation effect of screen rotation can be played. After switching to the horizontal screen application interface shown in (b) in Figure 3, the mobile phone acquires the occlusion image display strategy corresponding to the horizontal screen application interface. If the occlusion image display strategy corresponding to the horizontal screen application interface is not to display the top black bar and side black bar, then switch the interface shown in (b) in Figure 3 to the one shown in (c) in Figure 3 Interface, which hides the top black bar in the top area and the side black bar in the side area.

由上述图2可知,相关技术中,从适配挖孔屏的竖屏应用界面向不适配挖孔屏的横屏应用界面切换时,先从隐藏遮挡图像的竖屏应用界面切换到隐藏遮挡图像的横屏应用界面,再在横屏应用界面上添加遮挡图像。由上述图3可知,相关技术中,从未适配挖孔屏的竖屏应用界面向适配挖孔屏的横屏应用界面切换时,先从显示遮挡图像的竖屏应用界面切换到显示遮挡图像的横屏应用界面,再隐藏横屏应用界面上的遮挡图像。这将导致手机在应用界面旋转时,用户看到的视觉效果一般是,屏幕旋转动画效果播放完后,屏幕上显示的界面发生跳变,从显示遮挡图像的界面直接切换为隐藏遮挡图像的界面,或者从隐藏遮挡图像的界面切换为显示遮挡图像的界面。这种在屏幕旋转动画效果播放完后的跳变,会造成视觉上的卡顿感,即用户感觉手机在屏幕旋转的过程发生卡顿和闪屏。As can be seen from Figure 2 above, in the related art, when switching from a vertical screen application interface that is suitable for a hole-digging screen to a horizontal screen application interface that is not suitable for a hole-digging screen, first switch from a vertical screen application interface that hides the occluded image to a hidden occlusion The horizontal screen application interface of the image, and then add an occlusion image on the horizontal screen application interface. As can be seen from Figure 3 above, in the related art, when switching from a vertical screen application interface that is not adapted to a hole-digging screen to a horizontal screen application interface that is adapted to a hole-digging screen, first switch from a vertical screen application interface that displays occluded images to display occlusion The horizontal screen application interface of the image, and then hide the occluded image on the horizontal screen application interface. This will cause the visual effect that the user sees when the mobile phone rotates on the application interface. After the screen rotation animation is played, the interface displayed on the screen jumps, switching directly from the interface that displays the occluded image to the interface that hides the occluded image. , or switch from hiding the occluded image interface to showing the occluded image interface. This jump after the screen rotation animation effect is played will cause a visual freeze, that is, the user feels that the mobile phone freezes and flickers during the screen rotation process.

针对上述问题,本申请实施例提供了一种屏幕旋转时的显示优化方法,以改善电子设备在屏幕旋转时造成的卡顿感和闪烁感,改善用户的使用体验。在本申请实施例提供的显示优化方法中,在显示应用的第一应用界面时,若检测到屏幕旋转操作,则响应于屏幕旋转操作,先获取第一应用界面进行界面旋转后的第二应用界面对应的遮挡图像显示策略。如果第二应用界面与第一应用界面对应的遮挡图像显示策略不同,则将第一应用界面向所述第二应用界面切换,并根据第二应用界面的遮挡图像显示策略,在切换至第二应用界面之前隐藏或显示遮挡图像。如此,在屏幕旋转时,可以在完成屏幕旋转之前提前在挖孔屏上显示或隐藏遮挡图像,从而缓解屏幕旋转时的卡顿感。In view of the above problems, the embodiment of the present application provides a display optimization method when the screen is rotated, so as to improve the stuck and flickering feeling caused by the electronic device when the screen is rotated, and improve the user experience. In the display optimization method provided in the embodiment of the present application, when displaying the first application interface of an application, if a screen rotation operation is detected, in response to the screen rotation operation, first obtain the second application after the first application interface is rotated The occlusion image display strategy corresponding to the interface. If the occlusion image display strategy corresponding to the second application interface is different from that of the first application interface, switch the first application interface to the second application interface, and switch to the second application interface according to the occlusion image display strategy of the second application interface. Hide or show occluded images before applying the interface. In this way, when the screen rotates, the occlusion image can be displayed or hidden on the punch-hole screen in advance before the screen rotation is completed, thereby alleviating the stuttering feeling when the screen rotates.

其中,第二应用界面为对第一应用界面进行界面旋转后得到的应用界面,即对第一应用界面进行横竖屏切换后得到的应用界面。也就是说,第一应用界面和第二应用界面为应用的同一应用界面在横竖屏模式下的不同显示形式。比如,若第一应用界面为竖屏应用界面,则第二应用界面为横屏应用界面。若第一应用界面为横屏应用界面,则第二应用界面为竖屏应用界面。Wherein, the second application interface is an application interface obtained by rotating the first application interface, that is, an application interface obtained by switching the first application interface between horizontal and vertical screens. That is to say, the first application interface and the second application interface are different display forms of the same application interface of the application in the horizontal and vertical screen modes. For example, if the first application interface is a vertical screen application interface, then the second application interface is a horizontal screen application interface. If the first application interface is a horizontal screen application interface, then the second application interface is a vertical screen application interface.

下面以手机这一具体的电子设备为示例,说明应用本申请实施例的显示优化方法的手机进行屏幕旋转时的场景。The mobile phone, which is a specific electronic device, is taken as an example below to illustrate the scene when the screen of the mobile phone is rotated by applying the display optimization method of the embodiment of the present application.

请参见图4,图4是本申请实施例提供的一种手机从适配挖孔屏的横屏应用界面向未适配挖孔屏的竖屏应用界面切换的场景示意图。Please refer to FIG. 4 . FIG. 4 is a schematic diagram of a mobile phone switching from a horizontal screen application interface adapted to a punch-hole screen to a vertical screen application interface not adapted to a punch-hole screen according to an embodiment of the present application.

手机处于竖屏模式时,用户打开手机安装的视频应用并播放视频,手机响应于用户的操作启动视频应用,通过视频应用开始播放视频,并显示如图4的(a)图所示的竖屏模式下视频应用的竖屏应用界面。由于竖屏模式下视频应用的竖屏应用界面适配挖孔屏,因此显示竖屏应用界面时,挖孔屏上未显示遮挡图像。在视频应用播放视频期间,用户执行屏幕旋转操作,手机响应于屏幕旋转操作,先获取当前显示的竖屏应用界面对应的横屏应用界面的遮挡图像显示策略,若横屏应用界面的遮挡图像显示策略为显示顶部黑条和侧边黑条,则将竖屏应用界面向横屏应用界面切换,并根据横屏应用界面的遮挡图像显示策略,在切换至横屏应用界面之前,提前在挖孔屏上显示顶部黑条和侧边黑条。如此,如图4的(b)图所示,在完成屏幕旋转时,即可直接在挖孔屏上显示横屏应用界面、顶部黑条和侧边黑条,缓解了屏幕旋转时先显示切换后的横屏应用界面、再在横屏应用界面上添加遮挡图像导致的视觉上的卡顿。When the mobile phone is in portrait mode, the user opens the video application installed on the mobile phone and plays the video. The mobile phone starts the video application in response to the user's operation, starts to play the video through the video application, and displays the vertical screen as shown in (a) of Figure 4 The vertical screen application interface of the video application in modal. Since the vertical screen application interface of the video application in portrait mode is adapted to the hole-punch screen, when the vertical screen application interface is displayed, no occlusion image is displayed on the punch-hole screen. When the video application is playing a video, the user performs a screen rotation operation. In response to the screen rotation operation, the mobile phone first obtains the occlusion image display policy of the horizontal application interface corresponding to the currently displayed portrait application interface. If the occlusion image of the horizontal application interface is displayed If the strategy is to display black bars on the top and sides, switch the application interface from the vertical screen to the application interface on the horizontal screen, and according to the occlusion image display strategy of the application interface on the horizontal screen, before switching to the application interface on the horizontal screen, dig a hole in advance The top and side black bars are displayed on the screen. In this way, as shown in (b) of Figure 4, when the screen rotation is completed, the horizontal screen application interface, the top black bar and the side black bar can be directly displayed on the hole-punch screen, which eases the display switching when the screen is rotated After the horizontal screen application interface, add the visual lag caused by the occluded image to the horizontal screen application interface.

其中,屏幕旋转操作是指触发屏幕进行旋转的操作,可以为用户旋转手机的操作,也可以为点击自动旋转功能图标的操作等,本申请实施例对屏幕旋转操作不做限定。Wherein, the screen rotation operation refers to the operation of triggering the rotation of the screen, which may be the operation of rotating the mobile phone by the user, or the operation of clicking the automatic rotation function icon, etc. The embodiment of the present application does not limit the screen rotation operation.

再比如,请参考图5,图5是本申请实施例提供的一种手机从未适配挖孔屏的竖屏应用界面向适配挖孔屏的横屏应用界面切换的场景示意图。For another example, please refer to FIG. 5 . FIG. 5 is a schematic diagram of a scenario where a mobile phone is switched from a vertical screen application interface not adapted to a punch-hole screen to a horizontal screen application interface adapted to a punch-hole screen according to an embodiment of the present application.

手机处于竖屏模式时,用户打开手机安装的视频应用并播放视频,手机响应于用户的操作启动视频应用,通过视频应用开始播放视频,并显示如图5的(a)图所示的竖屏模式下视频应用的竖屏应用界面。由于竖屏模式下视频应用的竖屏应用界面为适配挖孔屏,因此显示竖屏模式的竖屏应用界面时,挖孔屏上显示有遮挡图像,遮挡图像包括顶部黑条和侧边黑条。在视频应用播放视频期间,用户执行屏幕旋转操作,手机响应于屏幕旋转操作,先获取当前显示的竖屏应用界面对应的横屏应用界面的遮挡图像显示策略,若横屏应用界面的遮挡图像显示策略为隐藏遮挡图像(不显示顶部黑条和侧边黑条),则将竖屏应用界面向横屏应用界面切换,并根据横屏应用界面的遮挡图像显示策略,在切换至横屏应用界面之前,提前在挖孔屏上隐藏顶部黑条和侧边黑条。如此,如图5的(b)图所示,在完成屏幕旋转时,即可直接在挖孔屏上显示隐藏了顶部黑条和侧边黑条的横屏应用界面,缓解了屏幕旋转时先显示切换后的横屏应用界面和遮挡图像、再隐藏遮挡图像导致的视觉上的卡顿。When the mobile phone is in portrait mode, the user opens the video application installed on the mobile phone and plays the video. The mobile phone starts the video application in response to the user's operation, starts to play the video through the video application, and displays the vertical screen as shown in (a) of Figure 5 Portrait app interface of the video app in modal. Since the vertical screen application interface of the video application in portrait mode is adapted to the hole-digging screen, when the vertical screen application interface in portrait mode is displayed, the hole-digging screen displays an occluded image. The occluded image includes black bars on the top and black bars on the sides. strip. When the video application is playing a video, the user performs a screen rotation operation. In response to the screen rotation operation, the mobile phone first obtains the occlusion image display policy of the horizontal application interface corresponding to the currently displayed portrait application interface. If the occlusion image of the horizontal application interface is displayed If the strategy is to hide the occlusion image (do not display the top black bar and side black bar), switch the application interface from the portrait screen to the application interface on the landscape screen, and switch to the application interface on the landscape screen according to the occlusion image display strategy of the landscape screen application interface Previously, the top black bars and side black bars were hidden on the digging screen in advance. In this way, as shown in (b) of Figure 5, when the screen rotation is completed, the horizontal screen application interface with the black bars on the top and the black bars on the sides hidden can be displayed directly on the hole-digging screen, which alleviates the problem of having to wait until the screen is rotated. Visual lag caused by displaying the switched landscape application interface and occluding images, and then hiding the occluded images.

此外,在完成屏幕旋转之前提前在挖孔屏上显示遮挡图像时,还可以以渐现效果显示遮挡图像,比如播放遮挡图像的渐现动画效果,以缓解从隐藏到显示遮挡图像的跳变,在视觉上增加显示遮挡图像的过程感和流畅感,增强用户体验。比如,在屏幕上逐次增加遮挡图像的尺寸,直至在屏幕上显示完整的遮挡图像;或者,在屏幕上逐次减小遮挡图像的透明度,直至遮挡图像的透明度减小至能够清楚地看到遮挡图像的透明度。当然,也可以采用其他方式实现以渐现效果显示遮挡图像,本申请实施例对此不做限定。In addition, when the occlusion image is displayed on the hole-digging screen before the screen rotation is completed, the occlusion image can also be displayed with a fade-in effect, such as playing the fade-in animation effect of the occlusion image, to ease the jump from hiding to displaying the occlusion image, Visually increase the sense of process and fluency of displaying occluded images, and enhance user experience. For example, gradually increase the size of the occlusion image on the screen until the complete occlusion image is displayed on the screen; or gradually reduce the transparency of the occlusion image on the screen until the transparency of the occlusion image is reduced enough to clearly see the occlusion image transparency. Of course, other methods may also be used to display the occlusion image with a fade-in effect, which is not limited in this embodiment of the present application.

此外,在完成屏幕旋转之前提前在挖孔屏上隐藏遮挡图像时,还可以以渐出效果隐藏遮挡图像,比如播放遮挡图像的渐隐动画效果,以缓解从显示到隐藏遮挡图像的跳变,在视觉上增加隐藏遮挡图像的过程感和流畅感,增强用户体验。比如,在屏幕上逐次减小遮挡图像的尺寸,直至遮挡图像被隐藏;或者,在屏幕上逐次增加遮挡图像的透明度,直至遮挡图像被隐藏。当然,也可以采用其他方式实现以渐出效果隐藏遮挡图像,本申请实施例对此不做限定。In addition, when hiding the occlusion image on the hole-punch screen before completing the screen rotation, you can also hide the occlusion image with a fade-out effect, such as playing the fade-out animation effect of the occlusion image, to ease the jump from displaying to hiding the occlusion image, Visually increase the sense of process and smoothness of hiding occluded images, and enhance user experience. For example, the size of the occluded image is gradually reduced on the screen until the occluded image is hidden; or, the transparency of the occluded image is gradually increased on the screen until the occluded image is hidden. Of course, other methods may also be used to hide the occluded image with a fade-out effect, which is not limited in this embodiment of the present application.

接下来,对本申请实施例涉及的电子设备予以说明。Next, the electronic device involved in the embodiment of the present application will be described.

图6是本申请实施例提供的一种电子设备100的结构示意图,其具体可以是手机、平板电脑、可穿戴设备等设备。参见图6,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriberidentification module,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。FIG. 6 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application, which may specifically be a mobile phone, a tablet computer, a wearable device, and the like. 6, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, and an antenna 1. Antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display A screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an environmental Light sensor 180L, bone conduction sensor 180M, etc.

处理器110可以包括一个或多个处理单元,比如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly recalled from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is an integer greater than 1.

电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.

ISP 用于处理摄像头193反馈的数据。比如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the optical signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is an integer greater than 1.

外部存储器接口120可以用于连接外部存储卡,比如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。比如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,计算机可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,来执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100在使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,比如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.

加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。加速度传感器180E还可以用于识别电子设备100的姿态,应用于横竖屏切换,计步器等应用。当然,加速度传感器180E也可以结合陀螺仪传感器180B,来识别电子设备100的姿态,应用于横竖屏切换。The acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 180E can also be used to identify the posture of the electronic device 100, and is applied to applications such as horizontal and vertical screen switching, pedometer, and the like. Of course, the acceleration sensor 180E can also be combined with the gyro sensor 180B to identify the posture of the electronic device 100 and be applied to switch between horizontal and vertical screens.

陀螺仪传感器180B可以用于确定终端100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定终端100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测终端100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端100的抖动,实现防抖。陀螺仪传感器180B还可以用于横竖屏切换,导航,体感游戏场景。The gyro sensor 180B can be used to determine the motion posture of the terminal 100 . In some embodiments, the angular velocity of the terminal 100 around three axes (ie, x, y and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the terminal 100, and calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the terminal 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for horizontal and vertical screen switching, navigation, and somatosensory game scenes.

以上是以电子设备100为例对本申请实施例作出的具体说明。可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。The above is a specific description of the embodiment of the present application by taking the electronic device 100 as an example. It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.

本申请实施例提供的电子设备可以是用户设备(user equipment,UE),例如移动终端(如手机)、平板电脑、桌面型、膝上型笔记本电脑、手持计算机、上网本、个人数字助理(personal digital assistant,PAD)等设备。The electronic device provided in the embodiment of the present application may be user equipment (UE), such as mobile terminal (such as mobile phone), tablet computer, desktop, laptop computer, handheld computer, netbook, personal digital assistant (personal digital assistant) assistant, PAD) and other equipment.

另外,在上述部件之上,运行有操作系统。例如苹果公司所开发的IOS操作系统,谷歌公司所开发的Android开源操作系统,微软公司所开发的Windows操作系统等。在In addition, an operating system runs on top of the above 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. exist

电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。为了更清楚的说明本申请实施例提供的屏幕旋转时的显示优化方法,本申请实施例以分层架构的安卓(Android)系统为例,对电子设备100的软件系统进行示例性说明。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In order to more clearly illustrate the display optimization method when the screen rotates provided by the embodiment of the present application, the embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software system of the electronic device 100 .

图7是本申请实施例提供的一种电子设备100的软件系统的框图。参见图7,电子设备可以包括硬件层和软件层,其中,分层架构的Android系统可以包括应用层,应用框架层,系统库层和内核层。在一些可选的实施例中,电子设备的系统还可以包括上述技术架构未提及的层级,如安卓运行时(Android Runtime)。FIG. 7 is a block diagram of a software system of an electronic device 100 provided by an embodiment of the present application. Referring to FIG. 7 , the electronic device may include a hardware layer and a software layer, wherein the layered Android system may include an application layer, an application framework layer, a system library layer and a kernel layer. In some optional embodiments, the system of the electronic device may also include layers not mentioned above in the technical architecture, such as Android Runtime (Android Runtime).

应用程序层可以包括一系列应用程序包,如导航应用,音乐应用和视频应用等。如图7所示,应用程序包可以包括视频、聊天等应用,以及系统用户界面(system userinterface,System UI)。The application layer can include a series of application packages, such as navigation applications, music applications, and video applications. As shown in FIG. 7 , the application package may include applications such as video and chat, and a system user interface (system user interface, System UI).

视频、聊天等应用用于为用户提供对应的服务。例如,用户使用视频应用观看视频,使用聊天应用和其他用户聊天,使用音乐应用收听音乐。Applications such as video and chat are used to provide users with corresponding services. For example, a user uses a video application to watch a video, uses a chat application to chat with other users, and uses a music application to listen to music.

SystemUI用于管理电子设备的人机交互界面(user interface,UI),在本申请实施例中,SystemUI用于管理挖孔屏边缘区域的遮挡图像的显示和隐藏。The SystemUI is used to manage the human-computer interaction interface (user interface, UI) of the electronic device. In the embodiment of the present application, the SystemUI is used to manage the display and hiding of the occlusion image in the edge area of the hole-digging screen.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图7所示,应用程序框架层可以包括窗口管理服务模块(window manageservice,WMS),显示旋转模块(又称DisplayRotation),应用管理服务模块(activitymanage service,AMS)和输入管理模块(又称Input)等。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 7, the application framework layer may include window management service module (window management service, WMS), display rotation module (also known as DisplayRotation), application management service module (activitymanage service, AMS) and input management module (also known as Input )wait.

WMS用于管理窗口程序。窗口管理器可以获取屏幕大小,判断是否有状态栏,锁定屏幕,截取屏幕等。本申请实施例中,WMS可以创建并管理应用对应的窗口。WMS is used to manage window programs. The window manager can get the screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. In the embodiment of the present application, the WMS can create and manage the windows corresponding to the application.

显示旋转模块用于控制屏幕进行旋转,通过旋转使得屏幕呈现出竖屏或者横屏的布局。比如在确定需要进行屏幕旋转时,通知Surfaceflinger进行应用界面的横竖屏切换。The display rotation module is used to control the rotation of the screen, so that the screen presents a vertical or horizontal layout through rotation. For example, when it is determined that the screen needs to be rotated, Surfaceflinger is notified to switch between the horizontal and vertical screens of the application interface.

AMS用于根据用户的操作启动特定的应用。例如,当用户点击桌面的视频应用图标时,AMS将视频应用设置为前台运行的状态,并创建视频应用对应的应用堆栈,使视频应用能够正常运行。AMS is used to launch specific applications according to user operations. For example, when the user clicks the video application icon on the desktop, AMS sets the video application to run in the foreground, and creates an application stack corresponding to the video application, so that the video application can run normally.

系统库层可以包括多个功能模块,比如:传感器模块(又称sensor)和SurfaceFlinger。The system library layer can include multiple functional modules, such as: sensor module (also known as sensor) and SurfaceFlinger.

传感器模块用于获取传感器采集的数据,比如获取加速度传感器采集的电子设备的重力方向信息。或者,传感器模块也可以根据电子设备的重力方向信息,确定电子设备的横竖屏状态信息,横竖屏状态信息用于指示电子设备处于横屏状态还是竖屏状态。The sensor module is used to obtain data collected by the sensor, for example, to obtain the gravity direction information of the electronic device collected by the acceleration sensor. Or, the sensor module can also determine the horizontal and vertical screen state information of the electronic device according to the gravity direction information of the electronic device, and the horizontal and vertical screen state information is used to indicate whether the electronic device is in a horizontal screen state or a vertical screen state.

Surfaceflinger是一种系统服务,用于图层的创建、控制和管理等功能。本申请实施例中,Surfaceflinger可以用于进行应用界面的横竖屏切换,比如播放屏幕旋转动画效果。Surfaceflinger is a system service for functions such as layer creation, control, and management. In the embodiment of the present application, Surfaceflinger can be used to switch between horizontal and vertical screens of the application interface, such as playing screen rotation animation effects.

另外,系统库层还可以包括:表面管理器(surface manager),媒体库(MediaLibraries),三维图形处理库(比如:OpenGL ES),2D图形引擎(比如:SGL)等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,比如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。In addition, the system library layer may also include: a surface manager (surface manager), a media library (MediaLibraries), a 3D graphics processing library (such as: OpenGL ES), a 2D graphics engine (such as: SGL), and so on. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc. 2D graphics engine is a drawing engine for 2D drawing.

内核层是硬件和软件之间的层。在本申请实施例中,内核层至少包含触控驱动模块和显示驱动模块。The kernel layer is the layer between hardware and software. In the embodiment of the present application, the kernel layer includes at least a touch driver module and a display driver module.

显示驱动模块用于根据应用框架层的模块和应用层的应用程序所提供的图像数据,在触摸屏上显示对应的图像。例如,视频应用将视频的一帧图像数据传递给显示驱动模块,显示驱动模块根据该图像数据在触摸屏上显示视频中的一帧图像。SystemUI将遮挡图像的图像数据传递给显示驱动模块,显示驱动模块根据遮挡图像的图像数据在挖孔屏指定的区域显示该遮挡图像。The display driver module is used for displaying corresponding images on the touch screen according to the image data provided by the modules of the application framework layer and the application programs of the application layer. For example, the video application transmits one frame of image data of the video to the display driver module, and the display driver module displays one frame of image in the video on the touch screen according to the image data. The SystemUI transmits the image data of the occlusion image to the display driver module, and the display driver module displays the occlusion image in the area specified by the hole-digging screen according to the image data of the occlusion image.

触控驱动模块用于监测触摸屏各区域的电容值。当用户在触摸屏上点击或滑动时,被点击或滑动的区域的电容值会发生变化,触控驱动模块能够监测到触摸屏上各区域电容值的变化,并向输入管理模块发送电容值变化消息,电容值变化消息中携带有触摸屏各个区域的电容值(或电容采样值)的变化幅度以及发生变化的时间等信息。The touch driver module is used to monitor the capacitance value of each area of the touch screen. When the user clicks or slides on the touch screen, the capacitance value of the clicked or slided area will change, and the touch driver module can monitor the change of the capacitance value of each area on the touch screen, and send a capacitance value change message to the input management module, The capacitance value change message carries information such as the variation range of the capacitance value (or capacitance sampling value) of each area of the touch screen and the time when the change occurs.

输入管理模块根据上报的电容值变化消息可以确定触控操作,然后将识别到的触控操作发送给其他模块。这里的触控操作可以包括点击操作,拖拽操作,以及特定的手势操作(如上滑手势操作,横滑手势操作等)。The input management module can determine the touch operation according to the reported capacitance value change message, and then send the recognized touch operation to other modules. The touch operation here may include a click operation, a drag operation, and a specific gesture operation (such as an upward swipe gesture operation, a horizontal swipe gesture operation, etc.).

硬件层包括挖孔屏和姿态传感器等,姿态传感器可以包括加速度传感器,还可以包括陀螺仪。姿态传感器用于检测电子设备的姿态信息,比如重力方向信息等。The hardware layer includes a hole-digging screen and an attitude sensor. The attitude sensor can include an acceleration sensor and a gyroscope. The attitude sensor is used to detect the attitude information of the electronic device, such as gravity direction information and the like.

例如,用户在手机处于竖屏姿态时旋转手机,将手机从竖屏姿态旋转为横屏姿态,传感器模块根据加速度传感器上报的数据识别出手机的重力方向发生变化,然后向WMS发送重力方向变化事件,WMS根据重力方向变化事件判断手机从竖屏姿态旋转为横屏姿态,然后确定需要进行屏幕旋转。或者,传感器模块根据加速度传感器上报的数据识别出手机的横竖屏状态发生变化,然后向WMS发送横竖屏姿态变化事件,WMS根据横竖屏状态变化事件确定需要进行屏幕旋转。For example, when the user rotates the mobile phone when the mobile phone is in a vertical posture, and rotates the mobile phone from a vertical posture to a horizontal posture, the sensor module recognizes that the gravity direction of the mobile phone has changed according to the data reported by the acceleration sensor, and then sends a gravity direction change event to the WMS. , the WMS judges that the mobile phone is rotated from the vertical screen posture to the horizontal screen posture according to the gravity direction change event, and then determines that the screen rotation is required. Or, the sensor module recognizes that the horizontal and vertical screen status of the mobile phone changes according to the data reported by the acceleration sensor, and then sends a horizontal and vertical screen attitude change event to the WMS, and the WMS determines that the screen needs to be rotated according to the horizontal and vertical screen status change event.

再例如,手机在相关界面提供自动旋转功能图标,比如在菜单栏或视频播放界面提供自动旋转功能图标,用户点击自动旋转功能图标后,输入管理模块根据上报的电容值变化消息识别出自动旋转功能图标的点击操作,然后将自动旋转功能图标的点击事件上报给WMS,WMS根据自动旋转功能图标的点击事件确定需要进行屏幕旋转。For another example, the mobile phone provides the automatic rotation function icon on the relevant interface, such as the automatic rotation function icon provided on the menu bar or the video playback interface. After the user clicks the automatic rotation function icon, the input management module recognizes the automatic rotation function according to the reported capacitance value change message The icon is clicked, and then the click event of the auto-rotation function icon is reported to the WMS, and the WMS determines that the screen needs to be rotated according to the click event of the auto-rotation function icon.

需要说明的是,本申请实施例虽然以Android系统为例进行说明,但是其基本原理同样适用于基于iOS或Windows等操作系统的电子设备。It should be noted that although the embodiment of the present application uses the Android system as an example for illustration, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.

上述技术架构列举了电子设备中本申请可能涉及的模块和器件。在实际应用中,电子设备可以包括上述技术架构的全部或部分模块和器件,以及其他上述技术架构未提及的模块和器件,当然,也可以只包括上述技术架构的模块和器件,本实施例对此不做限定。The technical architecture above lists the modules and devices that may be involved in the present application in the electronic equipment. In practical applications, electronic equipment may include all or part of the modules and devices of the above-mentioned technical architecture, and other modules and devices not mentioned in the above-mentioned technical architecture. Of course, it may also include only the modules and devices of the above-mentioned technical architecture. This embodiment There is no limit to this.

为了便于理解本申请实施例提供的屏幕旋转时的显示优化方法,下面先结合图7所示的电子设备的技术架构,以电子设备为手机为例,说明相关技术提供的屏幕旋转时的显示方法的实现方式。In order to facilitate the understanding of the display optimization method when the screen is rotated provided by the embodiment of the present application, the following first combines the technical architecture of the electronic device shown in FIG. way of realization.

请参考8,图8是相关技术中提供的一种屏幕旋转时的显示方法的流程图,该方法包括如下步骤:Please refer to 8. FIG. 8 is a flow chart of a display method when the screen rotates provided in the related art. The method includes the following steps:

步骤801:用户旋转手机。Step 801: The user rotates the mobile phone.

比如,用户在手机显示应用的第一应用界面时,旋转手机。第一应用界面可以为横屏应用界面或竖屏应用界面。For example, when the mobile phone displays the first application interface of the application, the user rotates the mobile phone. The first application interface may be a horizontal screen application interface or a vertical screen application interface.

步骤802:传感器模块检测到手机的重力方向发生变化。Step 802: the sensor module detects that the gravity direction of the mobile phone changes.

传感器模块可以获取手机安装的加速度传感器上报的重力信息,根据加速度传感器在手机旋转过程中上报的重力信息,检测到手机的重力方向发生变化。The sensor module can obtain the gravity information reported by the acceleration sensor installed in the mobile phone, and detect the change of the gravity direction of the mobile phone according to the gravity information reported by the acceleration sensor during the rotation of the mobile phone.

步骤803:传感器模块向窗口管理服务模块(以下简称WMS)发送重力方向变化事件。Step 803: the sensor module sends a gravity direction change event to the window management service module (hereinafter referred to as WMS).

传感器模块可以在检测到手机的重力方向发生变化后,向WMS发送重力方向变化事件。The sensor module can send a gravity direction change event to the WMS after detecting that the gravity direction of the mobile phone changes.

步骤804:WMS在接收到重力方向变化事件后,根据重力方向变化事件判断手机是否需要进行屏幕旋转。Step 804: After receiving the gravity direction change event, the WMS judges whether the mobile phone needs to rotate the screen according to the gravity direction change event.

其中,重力方向变化事件可以包括变化前后的重力方向信息。WMS可以根据变化前后的重力方向信息确定手机的姿态变化,根据手机的姿态变化确定手机的屏幕姿态是否发生变化,比如是否从横屏姿态旋转为竖屏姿态,或者是否从竖屏姿态旋转为横屏姿态。若手机的屏幕姿态发生变化,则确定手机需要进行屏幕旋转,若屏幕姿态未发生变化,则确定手机不需要进行屏幕旋转。Wherein, the gravity direction change event may include gravity direction information before and after the change. WMS can determine the attitude change of the mobile phone according to the gravity direction information before and after the change, and determine whether the screen attitude of the mobile phone has changed according to the attitude change of the mobile phone, such as whether to rotate from a landscape attitude to a portrait attitude, or whether to rotate from a portrait attitude to a landscape orientation screen gesture. If the screen posture of the mobile phone changes, it is determined that the mobile phone needs to perform screen rotation, and if the screen posture does not change, it is determined that the mobile phone does not need to perform screen rotation.

步骤805:WMS若确定手机需要进行屏幕旋转,则通知显示旋转模块进行屏幕旋转。Step 805: If the WMS determines that the mobile phone needs to perform screen rotation, it notifies the display rotation module to perform screen rotation.

步骤806:显示旋转模块响应于WMS的通知,通知SurfaceFlinger播放屏幕旋转动画效果。Step 806: The display rotation module notifies SurfaceFlinger to play the screen rotation animation effect in response to the WMS notification.

其中,屏幕旋转动画效果是指从第一应用界面切换为第二应用界面的动画效果。第二应用界面为当前显示的第一应用界面进行界面旋转后的应用界面。比如,若第一应用界面为竖屏应用界面,则第二应用界面为横屏应用界面。若第一应用界面为横屏应用界面,则第二应用界面为竖屏应用界面。Wherein, the screen rotation animation effect refers to the animation effect of switching from the first application interface to the second application interface. The second application interface is an application interface obtained by performing interface rotation on the currently displayed first application interface. For example, if the first application interface is a vertical screen application interface, then the second application interface is a horizontal screen application interface. If the first application interface is a horizontal screen application interface, then the second application interface is a vertical screen application interface.

也即是,相关技术中,WMS在确定手机需要进行屏幕旋转时,就立即通知显示旋转模块进行屏幕旋转,从而将第一应用界面切换为第二应用界面。That is, in the related art, when the WMS determines that the mobile phone needs to rotate the screen, it immediately notifies the display rotation module to perform screen rotation, thereby switching the first application interface to the second application interface.

步骤807:WMS在检测到屏幕发生旋转后,查询旋转后界面对应的遮挡图像显示策略。Step 807: After the WMS detects that the screen is rotated, it queries the occluded image display policy corresponding to the rotated interface.

其中,旋转后界面是指当前显示的第一应用界面进行界面旋转后的第二应用界面。遮挡图像显示策略可以为显示遮挡图像或隐藏遮挡图像。Wherein, the rotated interface refers to the second application interface after the currently displayed first application interface is rotated. The occluded image display strategy may be to display the occluded image or hide the occluded image.

比如,WMS可以从窗口管理信息中查询旋转后的界面对应的遮挡图像显示策略。窗口管理信息存储有多个应用的横屏显示界面和竖屏显示界面分别对应的遮挡图像显示策略。For example, the WMS may query the occlusion image display policy corresponding to the rotated interface from the window management information. The window management information stores the masking image display strategies corresponding to the horizontal screen display interface and the vertical screen display interface of multiple applications respectively.

步骤808:WMS根据旋转后界面对应的遮挡图像显示策略,通知SystemUI隐藏或显示遮挡图像。Step 808: The WMS notifies SystemUI to hide or display the occluded image according to the occluded image display policy corresponding to the rotated interface.

比如,若旋转后界面对应的遮挡图像显示策略为隐藏遮挡图像,则通知SystemUI隐藏遮挡图像。若旋转后界面对应的遮挡图像显示策略为显示遮挡图像,则通知SystemUI隐藏显示遮挡图像。For example, if the occlusion image display strategy corresponding to the rotated interface is to hide the occlusion image, notify SystemUI to hide the occlusion image. If the occlusion image display policy corresponding to the rotated interface is to display occlusion images, notify SystemUI to hide and display the occlusion images.

步骤809:SystemUI响应WMS的通知,隐藏或显示遮挡图像。Step 809: SystemUI hides or displays the occluded image in response to the WMS notification.

相关技术中,由于WMS在确定手机需要进行屏幕旋转时,是先通知显示旋转模块进行屏幕旋转,在检测到屏幕发生旋转后再查询旋转后界面对应的遮挡图像显示策略,根据旋转后界面对应的遮挡图像显示策略通知SystemUI隐藏或显示遮挡图像,因此这将导致手机在完成屏幕旋转后,再根据旋转后界面对应的遮挡图像显示策略隐藏或显示遮挡图像。用户看到的视觉效果一般是,屏幕旋转动画效果播放完后,屏幕上显示的界面发生跳变,从显示遮挡图像的界面直接切换为隐藏遮挡图像的界面,或者从隐藏遮挡图像的界面切换为显示遮挡图像的界面。这种在屏幕旋转动画效果播放完后的跳变,会造成视觉上的卡顿感,即用户感觉电子设备在屏幕旋转的过程发生卡顿和闪屏。In related technologies, when the WMS determines that the mobile phone needs to rotate the screen, it first notifies the display rotation module to rotate the screen, and then queries the occlusion image display strategy corresponding to the rotated interface after detecting that the screen rotates. The occlusion image display policy informs SystemUI to hide or display the occlusion image, so this will cause the mobile phone to hide or display the occlusion image according to the occlusion image display policy corresponding to the rotated interface after the screen rotation is completed. The visual effect that the user sees is generally that after the screen rotation animation is played, the interface displayed on the screen jumps, directly switching from the interface showing the occlusion image to the interface of hiding the occlusion image, or switching from the interface of hiding the occlusion image to Displays the interface for occluding images. This kind of jump after the screen rotation animation effect is played will cause a visual sense of freeze, that is, the user feels that the electronic device freezes and flickers during the screen rotation process.

针对上述问题,本申请实施例提供了一种屏幕旋转时的显示优化方法,以改善电子设备在屏幕旋转时造成的卡顿感和闪烁感,改善用户的使用体验。In view of the above problems, the embodiment of the present application provides a display optimization method when the screen is rotated, so as to improve the stuck and flickering feeling caused by the electronic device when the screen is rotated, and improve the user experience.

下面结合图7所示的电子设备的技术架构,以电子设备为手机为例,说明本申请实施例提供的屏幕旋转时的显示优化方法的实现方式。Combining with the technical architecture of the electronic device shown in FIG. 7 , and taking the electronic device as a mobile phone as an example, the implementation of the method for display optimization when the screen rotates provided by the embodiment of the present application is described below.

请参考图9,图9是本申请实施例提供的一种屏幕旋转时的显示优化方法的流程图,该方法包括如下步骤:Please refer to FIG. 9. FIG. 9 is a flowchart of a method for display optimization when the screen is rotated according to an embodiment of the present application. The method includes the following steps:

步骤901:应用管理服务模块启动应用。Step 901: the application management service module starts the application.

其中,应用可以是电子设备上安装的任意一款应用,比如可以为聊天应用或视频应用等。Wherein, the application may be any application installed on the electronic device, such as a chat application or a video application.

应用管理服务模块(以下简称AMS)可以响应于用户打开应用的操作,启动应用。在使用电子设备时,用户可以通过多种方式打开电子设备安装的一个应用,例如,点击桌面上的应用图标,点击消息通知栏中应用的通知消息等。The application management service module (hereinafter referred to as AMS) may start the application in response to the user's operation of opening the application. When using an electronic device, a user may open an application installed on the electronic device in various ways, for example, clicking an application icon on a desktop, clicking a notification message of the application in a message notification bar, and the like.

步骤902:AMS向窗口管理服务模块通知启动该应用的窗口。Step 902: AMS notifies the window management service module of the window that starts the application.

AMS启动应用后,向窗口管理服务模块通知启动该应用的窗口,从而触发WMS创建该应用的窗口。比如,AMS可以向WMS发送一个窗口启动通知,该通知中携带有被AMS启动的应用的应用标识。After the application is started, the AMS notifies the window management service module of the window that starts the application, thereby triggering the WMS to create the window of the application. For example, the AMS may send a window start notification to the WMS, and the notification carries the application identifier of the application started by the AMS.

步骤903:WMS响应于AMS的通知,创建该应用对应的窗口。Step 903: The WMS creates a window corresponding to the application in response to the notification of the AMS.

比如,WMS收到窗口启动通知后,可以根据窗口启动通知携带的应用标识创建被该应用对应的窗口。For example, after receiving the window start notification, the WMS may create a window corresponding to the application according to the application identifier carried in the window start notification.

应用对应的窗口被启动后,切换到前台运行的应用将应用界面的图像数据发送给显示驱动模块,显示驱动模块即可根据应用界面的图像数据在屏幕上显示被启动的应用的应用界面。After the window corresponding to the application is started, the application switching to the foreground sends the image data of the application interface to the display driver module, and the display driver module can display the application interface of the started application on the screen according to the image data of the application interface.

步骤904:在手机显示该应用的第一应用界面的情况下,用户旋转手机,第一应用界面对应的遮挡图像显示策略为第一显示策略。Step 904: When the mobile phone displays the first application interface of the application, the user rotates the mobile phone, and the occluded image display strategy corresponding to the first application interface is the first display strategy.

其中,显示第一应用界面时手机可以处于横屏状态或竖屏状态,相应地,第一应用界面可以为横屏应用界面或竖屏应用界面。Wherein, when the first application interface is displayed, the mobile phone may be in a landscape or portrait state, and correspondingly, the first application interface may be a landscape application interface or a portrait application interface.

第一应用界面对应的遮挡图像显示策略可以为显示遮挡图像或隐藏遮挡图像。比如,若第一显示策略为显示遮挡图像,则在显示第一应用界面时在屏幕上显示遮挡图像,譬如在屏幕的顶部区域和/或侧边区域显示遮挡图像。若第一显示策略为隐藏挡图像,则在显示第一应用界面时隐藏屏幕上的遮挡图像。The occlusion image display policy corresponding to the first application interface may be displaying the occlusion image or hiding the occlusion image. For example, if the first display strategy is to display a occlusion image, the occlusion image is displayed on the screen when the first application interface is displayed, for example, the occlusion image is displayed on the top area and/or the side area of the screen. If the first display strategy is to hide the blocking image, the blocking image on the screen is hidden when the first application interface is displayed.

进一步地,遮挡图像显示策略可以包括第一遮挡图像的显示策略和第二遮挡图像的显示策略。第一遮挡图像用于遮挡屏幕的顶部区域,比如第一遮挡图像为顶部黑条。第二遮挡图像用于遮挡屏幕的侧边区域,比如第二遮挡图像为侧边黑条。第一遮挡图像的显示策略包括显示或隐藏第一遮挡图像。第二遮挡图像的显示策略包括显示或隐藏遮挡图像。Further, the occlusion image display strategy may include a display strategy of the first occlusion image and a display strategy of the second occlusion image. The first occlusion image is used to occlude the top area of the screen, for example, the first occlusion image is a top black bar. The second occlusion image is used to occlude the side area of the screen, for example, the second occlusion image is a side black bar. The display policy of the first occlusion image includes displaying or hiding the first occlusion image. The display policy of the second occlusion image includes displaying or hiding the occlusion image.

比如,若第一显示策略为显示第一遮挡图像和第二遮挡图像,则在显示第一显示界面时在屏幕的顶部区域显示第一遮挡图像,并在侧边区域显示第二遮挡图像。若第一显示策略为显示第一遮挡图像和隐藏第二遮挡图像,则在显示第一显示界面时在屏幕的顶部区域显示第一遮挡图像,并隐藏侧边区域上的第二遮挡图像。若第一显示策略为隐藏第一遮挡图像和显示第二遮挡图像,则在显示第一显示界面时隐藏屏幕的顶部区域上的第一遮挡图像,并在屏幕的侧边区域显示第二遮挡图像。若第一显示策略为隐藏第一遮挡图像和第二遮挡图像,则在显示第一显示界面时隐藏屏幕的顶部区域上的第一遮挡图像,并隐藏侧边区域上的第二遮挡图像。For example, if the first display strategy is to display the first occlusion image and the second occlusion image, when the first display interface is displayed, the first occlusion image is displayed on the top area of the screen, and the second occlusion image is displayed on the side area. If the first display strategy is to display the first occlusion image and hide the second occlusion image, then when the first display interface is displayed, the first occlusion image is displayed on the top area of the screen, and the second occlusion image on the side area is hidden. If the first display strategy is to hide the first occlusion image and display the second occlusion image, then hide the first occlusion image on the top area of the screen when the first display interface is displayed, and display the second occlusion image on the side area of the screen . If the first display strategy is to hide the first occlusion image and the second occlusion image, then hide the first occlusion image on the top area of the screen and hide the second occlusion image on the side area when the first display interface is displayed.

步骤905:传感器模块检测到手机的重力方向发生变化。Step 905: the sensor module detects that the gravity direction of the mobile phone changes.

传感器模块可以获取手机安装的加速度传感器上报的重力信息,根据加速度传感器在手机旋转过程中上报的重力信息,检测到手机的重力方向发生变化。The sensor module can obtain the gravity information reported by the acceleration sensor installed in the mobile phone, and detect the change of the gravity direction of the mobile phone according to the gravity information reported by the acceleration sensor during the rotation of the mobile phone.

步骤906:传感器模块向WMS发送重力方向变化事件。Step 906: The sensor module sends a gravity direction change event to the WMS.

感器模块可以在检测到手机的重力方向发生变化后,向WMS发送重力方向变化事件。The sensor module can send a gravity direction change event to the WMS after detecting that the gravity direction of the mobile phone changes.

步骤907:WMS在接收重力方向变化事件后,根据重力方向变化事件判断手机是否需要进行屏幕旋转。Step 907: After receiving the gravity direction change event, the WMS determines whether the mobile phone needs to rotate the screen according to the gravity direction change event.

WMS可以采用预设判断策略,根据重力方向变化事件判断手机是否需要进行屏幕旋转。The WMS can adopt a preset judgment strategy to judge whether the mobile phone needs to rotate the screen according to the gravity direction change event.

比如,重力方向变化事件可以包括变化前后的重力方向信息。WMS根据变化前后的重力方向信息可以确定手机的姿态变化,根据手机的姿态变化即可确定手机的横竖屏姿态是否发生变化,比如是否从横屏姿态旋转为竖屏姿态,或者是否从竖屏姿态旋转为横屏姿态。若手机的横竖屏姿态发生变化,则确定手机需要进行屏幕旋转,若横竖屏姿态未发生变化,则确定手机不需要进行屏幕旋转。For example, the gravity direction change event may include gravity direction information before and after the change. WMS can determine the attitude change of the mobile phone according to the gravity direction information before and after the change. According to the attitude change of the mobile phone, it can determine whether the horizontal and vertical screen attitude of the mobile phone has changed, such as whether to rotate from the landscape attitude to the portrait attitude, or whether to change from the portrait attitude Rotate to landscape orientation. If the horizontal and vertical screen posture of the mobile phone changes, it is determined that the mobile phone needs to perform screen rotation, and if the horizontal and vertical screen posture does not change, it is determined that the mobile phone does not need to perform screen rotation.

应理解,预设判断策略也可以为其他实现形式,本申请实施例对此不做限定。It should be understood that the preset judgment strategy may also be implemented in other forms, which is not limited in this embodiment of the present application.

此外,本申请实施例仅是以WMS根据重力方向变化事件判断手机是否需要进行屏幕旋转进行举例说明,应理解,WMS也可以根据其他信息判断手机是否需要进行屏幕旋转。In addition, the embodiment of the present application is only illustrated by using the WMS to determine whether the mobile phone needs to rotate the screen according to the gravity direction change event. It should be understood that the WMS can also determine whether the mobile phone needs to rotate the screen according to other information.

比如,传感器模块可以根据加速度传感器上报的数据识别出手机的横竖屏姿态发生变化,然后向WMS发送横竖屏姿态变化事件,WMS根据横竖屏姿态变化事件判断是否需要进行屏幕旋转。For example, the sensor module can recognize the change of the horizontal and vertical screen posture of the mobile phone according to the data reported by the acceleration sensor, and then send a horizontal and vertical screen posture change event to the WMS, and the WMS judges whether the screen needs to be rotated according to the horizontal and vertical screen posture change event.

再比如,手机在相关界面提供自动旋转功能图标,譬如在菜单栏或视频播放界面提供自动旋转功能图标,用户点击自动旋转功能图标后,输入管理模块根据上报的电容值变化消息识别出自动旋转功能图标的点击操作,然后将自动旋转功能图标的点击事件上报给WMS,WMS根据自动旋转功能图标的点击事件确定需要进行屏幕旋转。For another example, the mobile phone provides the auto-rotation function icon on the relevant interface, for example, the menu bar or the video playback interface provides the auto-rotation function icon. After the user clicks the auto-rotation function icon, the input management module recognizes the auto-rotation function according to the reported capacitance value change message The icon is clicked, and then the click event of the auto-rotation function icon is reported to the WMS, and the WMS determines that the screen needs to be rotated according to the click event of the auto-rotation function icon.

步骤908:WMS若判断手机需要进行屏幕旋转,则获取第二显示策略,第二显示策略为当前显示的第一应用界面进行界面旋转后的第二应用界面对应的遮挡图像显示策略。Step 908: If the WMS judges that the mobile phone needs to rotate the screen, obtain the second display strategy, the second display strategy is the blocking image display strategy corresponding to the second application interface after the interface rotation of the currently displayed first application interface.

WMS可以在该应用安装好之后,通过该应用的接口获得该应用的第二应用界面对应的遮挡图像显示策略。After the application is installed, the WMS can obtain, through the interface of the application, the occlusion image display strategy corresponding to the second application interface of the application.

应用的每个应用界面都有其对应的任务(Activity)对象,应用安装好之后,WMS通过应用的接口可以获得该应用的各个Activity的信息,即任务信息(ActivityInform),任务信息中包含Activity对应的应用界面对挖孔屏的适配情况,也就是包含获得各个Activity对应的应用界面是否适配挖孔屏。Activity对应的应用界面可以包括横屏应用界面和竖屏应用界面。Each application interface of the application has its corresponding task (Activity) object. After the application is installed, WMS can obtain the information of each Activity of the application through the application interface, that is, the task information (ActivityInform). The task information contains the corresponding Activity Adaptation of the application interface to the punch-hole screen, that is, whether the application interface corresponding to each Activity is adapted to the punch-hole screen. The application interface corresponding to the Activity may include a horizontal screen application interface and a vertical screen application interface.

对于未适配挖孔屏的应用界面,WMS可以基于系统默认的配置信息确定需要显示遮挡图像的区域。示例性的,配置信息可以是,显示未适配挖孔屏的应用界面时需要在顶部区域显示黑边,也可以是,显示未适配挖孔屏的应用界面时需要在顶部区域和侧边区域显示黑边,还可以是,显示未适配挖孔屏的应用界面时需要在侧边区域显示黑边。For the application interface that is not adapted to the punch-hole screen, WMS can determine the area that needs to display the occluded image based on the default configuration information of the system. Exemplarily, the configuration information may be that when displaying an application interface that is not adapted to a punch-hole screen, a black border needs to be displayed in the top area, or it may be that when displaying an application interface that is not adapted to a punch-hole screen, a black border needs to be displayed on the top area and on the side The area displays black borders. It is also possible to display black borders in the side area when displaying an application interface that is not adapted to the punch-hole screen.

综上,WMS可以根据应用的任务信息中Activity对应的应用界面的适配情况以及上述默认的配置信息,确定应用的各个应用界面的遮挡图像显示策略。当然,也可以通过其他方式确定应用的各个应用界面的遮挡图像显示策略。To sum up, the WMS can determine the occlusion image display strategy of each application interface of the application according to the adaptation of the application interface corresponding to the Activity in the application task information and the above-mentioned default configuration information. Certainly, the blocking image display policy of each application interface of the application may also be determined in other ways.

步骤909:WMS通知显示旋转模块进行屏幕旋转。Step 909: WMS notifies the display rotation module to perform screen rotation.

步骤910:显示旋转模块响应于WMS的通知,通知SurfaceFlinger播放屏幕旋转动画效果。Step 910: The display rotation module notifies SurfaceFlinger to play the screen rotation animation effect in response to the WMS notification.

其中,屏幕旋转动画效果是指将第一应用界面向第二应用界面切换的动画效果。Wherein, the screen rotation animation effect refers to the animation effect of switching the first application interface to the second application interface.

显示旋转模块通过通知SurfaceFlinger播放屏幕旋转动画效果,可以控制SurfaceFlinger开始播放屏幕旋转动画效果,即控制第一应用界面开始向第二应用界面切换。也就是说,第一应用界面向第二应用界面切换的动画效果是从步骤910开始的。The display rotation module can control Surface Flinger to start playing the screen rotation animation effect by notifying SurfaceFlinger to play the screen rotation animation effect, that is, control the first application interface to start switching to the second application interface. That is to say, the animation effect of switching from the first application interface to the second application interface starts from step 910 .

步骤911:SurfaceFlinger响应于显示旋转模块的通知,播放屏幕旋转动画效果。Step 911: SurfaceFlinger plays the screen rotation animation effect in response to the notification of displaying the rotation module.

步骤912:在第一显示策略与第二显示策略不同的情况下,WMS根据第二显示策略,通知SystemUI播放遮挡图像的渐隐动画效果或渐现动画效果。Step 912: In the case that the first display strategy is different from the second display strategy, the WMS notifies the SystemUI to play the fading animation effect or fade-in animation effect of the occluded image according to the second display strategy.

在第一显示策略与第二显示策略不同的情况下,WMS可以根据第二显示策略,通知SystemUI隐藏或显示遮挡图像。本申请实施例仅是以渐隐效果来逐渐隐藏遮挡图像,以渐现效果来逐渐显示遮挡图像为例进行举例说明,当然也可以采用其他方式隐藏或显示遮挡图像,本申请实施例对此不做限定。In the case that the first display strategy is different from the second display strategy, the WMS may notify the SystemUI to hide or display the occluded image according to the second display strategy. The embodiment of the present application only uses the fade-in effect to gradually hide the occluded image, and uses the fade-in effect to gradually display the occluded image as an example for illustration. Of course, other methods can also be used to hide or display the occluded image. The embodiment of the present application does not discuss this Do limited.

比如,若第一显示策略为隐藏遮挡图像,第二显示策略为显示遮挡图像,则WMS可以根据第二显示策略,在屏幕旋转动画效果播放完成之前通知SystemUI播放遮挡图像的渐隐动画效果。或者,若第一显示策略为显示遮挡图像,第二显示策略为隐藏遮挡图像,则WMS可以根据第二显示策略,在屏幕旋转动画效果播放完成之前通知SystemUI播放遮挡图像的渐现动画效果。For example, if the first display strategy is to hide the occluded image and the second display strategy is to display the occluded image, then the WMS can notify SystemUI to play the fade animation effect of the occluded image before the screen rotation animation effect is played according to the second display strategy. Or, if the first display strategy is to display the occluded image and the second display strategy is to hide the occluded image, then the WMS can notify SystemUI to play the fade-in animation effect of the occluded image before the screen rotation animation effect is played according to the second display strategy.

进一步地,若第一显示策略和第二显示策略均包括第一遮挡图像的显示策略和第二遮挡图像的显示策略,在第一应用界面切换至第二应用界面之前通知SystemUI隐藏或显示遮挡图像还可以包括以下几种情况:Further, if both the first display strategy and the second display strategy include the display strategy of the first occlusion image and the display strategy of the second occlusion image, notify SystemUI to hide or display the occlusion image before switching from the first application interface to the second application interface It can also include the following situations:

第一种情况:在第一显示策略和第二显示策略中的第一遮挡图像的显示策略不同、第二遮挡图像的显示策略相同的情况下,在切换至第二应用界面之前通知SystemUI隐藏或显示第一遮挡图像。The first case: in the first display strategy and the second display strategy, the display strategy of the first occlusion image is different, and the display strategy of the second occlusion image is the same, before switching to the second application interface, notify the SystemUI to hide or A first occlusion image is displayed.

比如,若第一显示策略中的第一遮挡图像显示策略为显示第一遮挡图像、第二显示策略中的第二遮挡图像显示策略为隐藏第一遮挡图像,则在切换至第二应用界面之前通知SystemUI隐藏第一遮挡图像。若第一显示策略中的第一遮挡图像显示策略为隐藏第一遮挡图像、第二显示策略中的第一遮挡图像显示策略为显示第一遮挡图像,则在切换至第二应用界面之前通知SystemUI显示第一遮挡图像,比如通知SystemUI播放第一遮挡图像的渐现动画效果。For example, if the first occlusion image display strategy in the first display strategy is to display the first occlusion image, and the second occlusion image display strategy in the second display strategy is to hide the first occlusion image, before switching to the second application interface Notify SystemUI to hide the first occlusion image. If the first occlusion image display strategy in the first display strategy is to hide the first occlusion image, and the first occlusion image display strategy in the second display strategy is to display the first occlusion image, notify SystemUI before switching to the second application interface Displaying the first occlusion image, for example, notifying SystemUI to play the fade-in animation effect of the first occlusion image.

第二种情况:在第一显示策略和第二显示策略中的第一遮挡图像的显示策略相同、第二遮挡图像的显示策略不同的情况下,在切换至第二应用界面之前通知SystemUI隐藏或显示第二遮挡图像,比如通知SystemUI播放第二遮挡图像的渐隐动画效果或渐现动画效果。The second case: in the first display strategy and the second display strategy, the display strategy of the first occlusion image is the same, and the display strategy of the second occlusion image is different, before switching to the second application interface, notify the SystemUI to hide or Displaying the second occlusion image, for example, notifying the SystemUI to play the fading animation effect or fade-in animation effect of the second occlusion image.

比如,若第一显示策略中的第二遮挡图像显示策略为显示第二遮挡图像、第二显示策略中的第二遮挡图像显示策略为隐藏第二遮挡图像,则在切换至第二应用界面之前通知SystemUI隐藏第二遮挡图像。若第一显示策略中的第二遮挡图像显示策略为隐藏第二遮挡图像、第二显示策略中的第二遮挡图像显示策略为显示第二遮挡图像,则在切换至第二应用界面之前通知SystemUI显示第二遮挡图像,比如通知SystemUI播放第二遮挡图像的渐现动画效果。For example, if the second occlusion image display strategy in the first display strategy is to display the second occlusion image, and the second occlusion image display strategy in the second display strategy is to hide the second occlusion image, before switching to the second application interface Notifies SystemUI to hide the second occlusion image. If the second occlusion image display strategy in the first display strategy is to hide the second occlusion image, and the second occlusion image display strategy in the second display strategy is to display the second occlusion image, notify SystemUI before switching to the second application interface Display the second occlusion image, for example, notify SystemUI to play the fade-in animation effect of the second occlusion image.

第三种情况:在第一显示策略和所述第二显示策略中的第一遮挡图像的显示策略不同、第二遮挡图像的显示策略也不同的情况下,在切换至第二应用界面之前通知SystemUI隐藏或显示第一遮挡图像、以及隐藏或显示第二遮挡图像,比如通知SystemUI播放第一遮挡图像的渐隐动画效果或渐现动画效果,以及播放第二遮挡图像的渐隐动画效果或渐现动画效果。The third case: in the case that the display strategy of the first occlusion image in the first display strategy and the second display strategy are different, and the display strategy of the second occlusion image is also different, notify before switching to the second application interface SystemUI hides or displays the first occlusion image, and hides or displays the second occlusion image, such as instructing SystemUI to play the fading animation effect or fading animation effect of the first occlusion image, and play the fading animation effect or fading animation effect of the second occlusion image animation effect.

应理解,第三种情况的具体实现方式可以根据上述第一种情况和第二种情况的组合推理得到,本申请示例在此不再赘述。It should be understood that the specific implementation manner of the third case can be deduced from the combination of the above first case and the second case, and the examples in this application will not be repeated here.

作为一个示例,WMS可以在通知显示旋转模块进行屏幕旋转的同时,通知SystemUI播放遮挡图像的渐隐动画效果或渐现动画效果,或者在通知显示旋转模块进行屏幕旋转后的预设时长内,通知SystemUI播放遮挡图像的渐隐动画效果或渐现动画效果,该预设时长为屏幕旋转动画效果的播放所需时长,如此,可以实现在屏幕旋转动效播放完成前,遮挡图像的渐隐渐现动效同步播放完成,提高屏幕旋转过程在视觉上的流畅感,进而提高用户体现。As an example, while notifying the display rotation module to rotate the screen, the WMS can notify the SystemUI to play the fading animation effect or fade-in animation effect of occluded images, or notify the display rotation module within a preset time period after notifying the display rotation module to rotate the screen. SystemUI plays the fading animation effect or fading animation effect of the occluded image. The preset duration is the duration required for playing the screen rotation animation effect. In this way, the fading and fading of the occluded image can be realized before the screen rotation animation playback is completed. The synchronous playback of dynamic effects is completed, which improves the visual fluency of the screen rotation process, thereby improving user experience.

在一种可能的实现方式中,步骤908和步骤909可以同时执行,即WMS在判断手机需要进行屏幕旋转后,在通知显示旋转模块进行屏幕旋转的同时,获取第二显示策略。之后,步骤910和步骤912可以同时执行,即在显示旋转模块通知SurfaceFlinger播放屏幕旋转动效的同时,WMS根据第二显示策略通知SystemUI播放遮挡图像的渐隐渐现动效的同时。之后,步骤911和步骤913可以同时执行,即在SurfaceFlinger播放屏幕旋转动效的同时,SystemUI播放遮挡图像的渐隐动效或渐显动效。如此,可以实现屏幕旋转动效和遮挡图像的渐隐渐现动效的同步进行,提高用户体验。In a possible implementation, step 908 and step 909 can be executed simultaneously, that is, after the WMS determines that the mobile phone needs to rotate the screen, it notifies the display rotation module to perform screen rotation, and at the same time obtains the second display strategy. Afterwards, step 910 and step 912 can be executed simultaneously, that is, while the display rotation module notifies SurfaceFlinger to play the screen rotation animation, WMS notifies SystemUI to play the fade-in and fade-in animation of the occluded image according to the second display strategy. Afterwards, step 911 and step 913 can be executed simultaneously, that is, while SurfaceFlinger plays the screen rotation animation effect, SystemUI plays the fade-out animation effect or fade-out animation effect of the occluded image. In this way, the synchronous execution of the screen rotation motion effect and the fade-in and fade-out motion effect of blocking the image can be achieved, thereby improving user experience.

步骤913:SystemUI响应于WMS的通知,播放遮挡图像的渐隐动画效果或渐显动画效果。Step 913: The SystemUI responds to the notification of the WMS, and plays a fading animation effect or a fading animation effect of the occluded image.

SystemUI响应于WMS的通知,可以隐藏或显示遮挡图像。其中,若WMS通知SystemUI隐藏遮挡图像,则SystemUI响应于WMS的通知,隐藏遮挡图像。若WMS通知SystemUI显示遮挡图像,则SystemUI响应于WMS的通知,显示遮挡图像。SystemUI can hide or show occluded images in response to WMS notifications. Wherein, if the WMS notifies the SystemUI to hide the occlusion image, the SystemUI responds to the WMS notification and hides the occlusion image. If the WMS notifies the SystemUI to display the occlusion image, the SystemUI displays the occlusion image in response to the WMS notification.

本申请实施例仅是以渐隐效果来逐渐隐藏遮挡图像,以渐现效果来逐渐显示遮挡图像为例进行举例说明。比如,若WMS通知SystemUI播放遮挡图像的渐隐动画效果,则SystemUI响应于WMS的通知,播放遮挡图像的渐隐动画效果。若WMS通知SystemUI播放遮挡图像的渐现动画效果,则SystemUI响应于WMS的通知,显示播放遮挡图像的渐现动画效果。In the embodiment of the present application, the occlusion image is gradually hidden by the fade-in effect, and the occlusion image is gradually displayed by the fade-in effect as an example for illustration. For example, if the WMS notifies the SystemUI to play the fading animation effect of the occluded image, the SystemUI responds to the notification of the WMS and plays the faded animation effect of the occluded image. If the WMS notifies the SystemUI to play the fade-in animation effect of the occluded image, the SystemUI responds to the WMS notification and displays the fade-in animation effect of playing the occluded image.

比如,遮挡图像的渐隐动画效果的实现形式可以包括:在屏幕上逐次减小遮挡图像的尺寸,直至遮挡图像被隐藏;或者,在屏幕上逐次增加遮挡图像的透明度,直至遮挡图像被隐藏。当然,也可以采用其他方式实现以渐出效果隐藏遮挡图像,本申请实施例对此不做限定。For example, the implementation form of the fading animation effect of the occluded image may include: gradually reducing the size of the occluded image on the screen until the occluded image is hidden; or gradually increasing the transparency of the occluded image on the screen until the occluded image is hidden. Of course, other methods may also be used to hide the occluded image with a fade-out effect, which is not limited in this embodiment of the present application.

比如,遮挡图像的渐现动画效果的实现形式可以包括:在屏幕上逐次增加遮挡图像的尺寸,直至在屏幕上显示完整的遮挡图像;或者,在屏幕上逐次减小遮挡图像的透明度,直至遮挡图像的透明度减小至能够清楚地看到遮挡图像的透明度。当然,也可以采用其他方式实现以渐现效果显示遮挡图像,本申请实施例对此不做限定。For example, the implementation of the fade-in animation effect of the occlusion image may include: gradually increasing the size of the occlusion image on the screen until the complete occlusion image is displayed on the screen; or gradually reducing the transparency of the occlusion image on the screen until the occlusion The transparency of the image is reduced to a level where the occluding image can be clearly seen. Of course, other methods may also be used to display the occlusion image with a fade-in effect, which is not limited in this embodiment of the present application.

在一种可能的实现方式中,先在屏幕上显示遮挡图像的部分区域,然后逐次增加遮挡图像的部分区域的尺寸,直至在屏幕上显示完整的遮挡图像。其中,先在屏幕上显示遮挡图像的部分区域可以预先设置,比如可以为遮挡图像的上部区域或下部区域等,本申请实施例对此不做限定。In a possible implementation manner, a partial area of the occluded image is displayed on the screen first, and then the size of the partial area of the occluded image is gradually increased until a complete occluded image is displayed on the screen. Wherein, the partial area where the occlusion image is first displayed on the screen may be preset, for example, may be an upper area or a lower area of the occlusion image, which is not limited in this embodiment of the present application.

在另一种可能的实现方式中,先在挖孔屏上以第一透明度显示所述遮挡图像,然后逐次减小遮挡图像的透明度,直至遮挡图像的透明度减小至第二透明度。其中,第二透明度小于第一透明度,第二透明度为能够清楚地看到遮挡图像的透明度。第一透明度和第二透明度可以根据需要预先进行设置,本申请实施例对此不做限定。In another possible implementation manner, the occlusion image is first displayed on the hole-digging screen with a first transparency, and then the transparency of the occlusion image is gradually reduced until the transparency of the occlusion image decreases to the second transparency. Wherein, the second transparency is smaller than the first transparency, and the second transparency is such that the occluded image can be clearly seen. The first transparency and the second transparency may be preset as required, which is not limited in this embodiment of the present application.

本申请实施例中,在确定需要进行屏幕旋转后,WMS可以在显示旋转模块进行屏幕旋转之前,提前获取旋转后的应用界面对应的遮挡图像显示策略,以及在屏幕旋转动效播放完成之前,根据旋转后的应用界面对应的遮挡图像显示策略提前通知系统用户界面播放遮挡图像的渐隐动画效果或渐现动画效果,实现了在屏幕旋转动效播放完成前,遮挡图像的渐隐渐现动效同步播放完成,提高了屏幕旋转过程在视觉上的流畅感,缓解了屏幕旋转时隐藏或显示遮挡图像而导致的视觉上的卡顿,进而提高了用户体验。In this embodiment of the application, after it is determined that the screen rotation is required, the WMS can obtain the occlusion image display strategy corresponding to the rotated application interface in advance before the display rotation module performs the screen rotation, and before the screen rotation animation playback is completed, according to The occlusion image display strategy corresponding to the rotated application interface notifies the system user interface in advance to play the fading animation effect or fading animation effect of the occlusion image, which realizes the fading animation effect of the occlusion image before the screen rotation animation playback is completed The synchronous playback is completed, which improves the visual fluency of the screen rotation process, alleviates the visual freeze caused by hiding or displaying occluded images when the screen rotates, and thus improves the user experience.

一般地,电子设备中各个模块之间的交互,以及模块自身功能的实现都依赖于对系统中各函数的调用。为了进一步理解本申请提供的显示优化方法,下面以图5所示的电子设备从未适配挖孔屏的竖屏应用界面向适配挖孔屏的横屏应用界面切换的场景为示例,说明该过程中电子设备内部的函数调用关系。Generally, the interaction between various modules in the electronic device, and the realization of the functions of the modules themselves all depend on calling various functions in the system. In order to further understand the display optimization method provided by the present application, the scene shown in FIG. 5 is taken as an example in which the electronic device is switched from a vertical screen application interface not adapted to a hole-digging screen to a horizontal screen application interface adapted to a hole-digging screen. The function call relationship inside the electronic device in this process.

请参见图10,图10是本申请实施例提供的一种屏幕旋转时的显示优化方法的信令图。Please refer to FIG. 10 . FIG. 10 is a signaling diagram of a display optimization method when the screen is rotated according to an embodiment of the present application.

如图10所示,WMS具体可以包括如下组件:As shown in Figure 10, WMS can specifically include the following components:

显示管理组件,又称DisplayManagerService;显示内容组件,又称DisplyContent;电话窗口管理组件,又称HwPhoneWindowManager。The display management component is also called DisplayManagerService; the display content component is also called DisplyContent; the phone window management component is also called HwPhoneWindowManager.

SurfaceFlinger可以包括如下组件:SurfaceFlinger can include the following components:

屏幕旋转动画组件,又称Screen Rotation Animation。Screen rotation animation component, also known as Screen Rotation Animation.

手机显示图5中的(a)图所示的竖屏应用界面和遮挡图像时,若用户旋转手机,则传感器模块可以检测到手机的重力方向发生变化,然后调用1:传感器事件,又称sensorEvent(),即传感器模块的检测数据变化触发的事件。传感器模块通过调用传感器事件,将手机的重力方向变化事件上报给显示管理组件。When the mobile phone displays the vertical screen application interface shown in (a) in Figure 5 and blocks the image, if the user rotates the mobile phone, the sensor module can detect the change of the gravity direction of the mobile phone, and then call 1: sensor event, also known as sensorEvent (), that is, the event triggered by the detection data change of the sensor module. The sensor module reports the gravity direction change event of the mobile phone to the display management component by calling the sensor event.

调用1的过程,可以视为图9中步骤906的一种具体实现方式。The process of calling 1 can be regarded as a specific implementation manner of step 906 in FIG. 9 .

显示管理组件接收到传感器模块上报的重力方向变化事件后,可以根据重力方向变化事件判断手机是否需要进行屏幕旋转,若判断手机需要进行屏幕旋转,则调用2:显示切换函数,又称onDisplayChanged(),通过调用显示切换函数通知显示内容组件当前显示的竖屏显示界面需要进行屏幕旋转。After the display management component receives the gravity direction change event reported by the sensor module, it can judge whether the mobile phone needs to rotate the screen according to the gravity direction change event. If it judges that the mobile phone needs to rotate the screen, call 2: display switching function, also known as onDisplayChanged() , by calling the display switching function to notify the display content component that the currently displayed vertical screen display interface needs to be rotated.

显示内容组件响应于显示管理组件的通知,调用3:旋转切换确认函数,又称updateRotationUnchecked,显示内容组件通过调用旋转切换确认函可以配置旋转数据,比如配置旋转角度、旋转后的横屏应用界面的长和宽等,将配置的旋转数据上报给显示旋转模块。In response to the notification from the display management component, the display content component calls 3: the rotation switching confirmation function, also known as updateRotationUnchecked. The display content component can configure the rotation data by calling the rotation switching confirmation letter, such as configuring the rotation angle and the horizontal screen application interface after rotation. Length and width, etc., and report the configured rotation data to the display rotation module.

显示旋转模块接收到显示内容组件上报的旋转数据后,可以调用4:开启旋转动画函数,又称startRotationAnimation(),通过调用开启旋转动画函数,控制屏幕旋转动画组件开始播放屏幕旋转动画效果,即开始播放从竖屏应用界面切换为横屏应用界面的动画效果。也就是说,从竖屏应用界面向横屏应用界面切换的动画效果是从调用4的时刻开始播放。After the display rotation module receives the rotation data reported by the display content component, it can call 4: Start the rotation animation function, also known as startRotationAnimation(). By calling the start rotation animation function, the screen rotation animation component is controlled to start playing the screen rotation animation effect, that is, start Play the animation effect of switching from the portrait application interface to the landscape application interface. That is to say, the animation effect of switching from the vertical screen application interface to the horizontal screen application interface is played from the moment when 4 is called.

本申请实施例中,调用3的过程可以视为前述步骤907的一种具体实现方式,调用4的过程可以视为前述步骤909的一种具体实现方式。In the embodiment of the present application, the process of calling 3 may be regarded as a specific implementation manner of the aforementioned step 907, and the process of calling 4 may be regarded as a specific implementation manner of the aforementioned step 909.

另外,显示旋转模块接收到显示内容组件上报的旋转数据后,在调用4的同时,还可以调用5:查询屏幕边缘控制策略函数,又称queryNotchControlFiletForSideScreen,通过调用查询屏幕边沿控制策略函数,向电话窗口管理组件发送查询旋转后的横屏应用界面对应的遮挡图像显示策略的查询请求。电话窗口管理组件接收到该查询请求后,从窗口管理信息中查询旋转后的横屏应用界面对应的遮挡图像显示策略,横屏应用界面对应的遮挡图像显示策略包括顶部黑条和侧边黑条的显示策略。若查询到横屏应用界面对应的遮挡图像显示策略为隐藏顶部黑条和侧边黑条,则电话窗口管理组件调用6:屏幕边沿可视化函数,又称setScreenSideBoxVisibilityAnimation(),将横屏应用界面对应的遮挡图像显示策略为隐藏顶部黑条和侧边黑条反馈给显示旋转模块。In addition, after the display rotation module receives the rotation data reported by the display content component, while calling 4, it can also call 5: Query the screen edge control strategy function, also known as queryNotchControlFiletForSideScreen, by calling the query screen edge control strategy function, to the phone window The management component sends a query request for querying the occlusion image display strategy corresponding to the rotated landscape application interface. After receiving the query request, the phone window management component queries the occlusion image display strategy corresponding to the rotated landscape application interface from the window management information. The occlusion image display strategy corresponding to the landscape application interface includes top black bars and side black bars display strategy. If the occlusion image display strategy corresponding to the horizontal screen application interface is found to hide the top black bar and side black bar, then the phone window management component calls 6: the screen edge visualization function, also known as setScreenSideBoxVisibilityAnimation(), and the horizontal screen application interface corresponds to The occluded image display strategy is to hide the top and side black bars and feed them back to the display rotation module.

显示旋转模块在接收到电话窗口管理组件反馈的横屏应用界面对应的遮挡图像显示策略后,还可以根据横屏应用界面对应的遮挡图像显示策略,调用7:开启隐藏动画函数,又称startFadeAnimation()。显示管理组件通过调用开启隐藏动画函数,可以通知系统用户界面隐藏遮挡图像。接收到隐藏遮挡图像的通知后,系统用户界面可以按预定的隐藏方式将屏幕顶部和侧边显示的黑条隐藏,比如以浅出效果隐藏屏幕顶部和侧边显示的黑条,并在隐藏完成后,调用8:隐藏动画完成函数,又称onfadeAnimationEnd(),以通知显示旋转模块顶部及侧边黑条已经完全隐藏。After the display rotation module receives the occlusion image display strategy corresponding to the horizontal screen application interface fed back by the phone window management component, it can also call 7: start the hidden animation function according to the occlusion image display strategy corresponding to the horizontal screen application interface, also known as startFadeAnimation( ). The display management component can notify the system user interface to hide the occluded image by calling the function to enable the hidden animation. After receiving the notification of hiding the occluded image, the system user interface can hide the black bars displayed on the top and sides of the screen according to the predetermined hiding method, such as hiding the black bars displayed on the top and sides of the screen with a light-out effect, and after the hiding is completed , call 8: hide animation completion function, also known as onfadeAnimationEnd(), to notify that the top and side black bars of the display rotation module have been completely hidden.

另外,屏幕旋转动画组件播放屏幕旋转动画效果完成后,还可以调用9:旋转动画完成函数,又称onRotationAnimationEnd(),以通知显示管理组件屏幕旋转动画效果播放完成。In addition, after the screen rotation animation component finishes playing the screen rotation animation effect, it can also call the 9: rotation animation completion function, also known as onRotationAnimationEnd(), to notify the display management component that the screen rotation animation effect has been played.

此外,也可以由显示内容组件响应于显示管理组件的通知调用5,再根据电话窗口管理组件反馈的信息调用7,通知系统用户界面隐藏遮挡图像。In addition, the display content component can also call 5 in response to the notification of the display management component, and then call 7 according to the information fed back by the phone window management component, to notify the system user interface to hide the occluded image.

本实施例中,显示旋转模块可以在通知屏幕旋转动画组件播放屏幕旋转动效,即调用函数4的同时,查询旋转后界面的遮挡图像显示策略,根据查询到的显示策略通知系统用户界面播放遮挡图像的隐藏动画,即调用函数5-7。如此,屏幕旋转动效和遮挡图像的隐藏动画可以同时进行,从而缩短了隐藏遮挡图像和屏幕旋转之间的时间差,改善了挖孔屏从未适配挖孔屏的应用界面切换到适配挖孔屏的应用界面时的视觉效果。In this embodiment, the display rotation module can query the occlusion image display strategy of the rotated interface while notifying the screen rotation animation component to play the screen rotation animation effect, that is, call function 4, and notify the system user interface to play occlusion according to the queried display strategy The hidden animation of the image, that is, call function 5-7. In this way, the screen rotation animation and the hidden animation of the occluded image can be performed at the same time, thereby shortening the time difference between hiding the occluded image and the screen rotation, and improving the switching of the hole-digging screen from the application interface that is not adapted to the hole-digging screen to the one that is adapted to the hole-digging screen. The visual effect of the application interface of the hole screen.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,比如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(比如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(比如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(比如:软盘、硬盘、磁带)、光介质(比如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(比如:固态硬盘(Solid State Disk,SSD))等。In the above embodiments, all or part may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be accessed from a website, computer, server, or data center Transmission to another website site, computer, server or data center via wired (such as: coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as: infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or may be a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a digital versatile disk (Digital Versatile Disc, DVD)), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)) wait.

以上所述为本申请提供的可选实施例,并不用以限制本申请,凡在本申请的揭露的技术范围之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above-mentioned optional embodiments provided by the application are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope of the disclosure of the application shall be included in the scope of the application. within the scope of protection.

Claims (11)

1. A display optimization method during screen rotation is characterized in that the method is applied to electronic equipment provided with a hole digging screen, and comprises the following steps:
displaying a first application interface of an application, wherein a display strategy of an occlusion image corresponding to the first application interface is a first display strategy, and the occlusion image is used for occluding a top area and/or a side area of the hole digging screen;
responding to screen rotation operation, and acquiring a second display strategy, wherein the second display strategy is a shielding image display strategy corresponding to a second application interface after the first application interface performs interface rotation;
and under the condition that the first display strategy is different from the second display strategy, switching the first application interface to the second application interface, and hiding or displaying the shielding image before switching to the second application interface according to the second display strategy.
2. The method of claim 1, wherein said first display policy is to display said occlusion image on said trombone screen and said second display policy is to not display said occlusion image on said trombone screen;
the first application interface of the display application comprises:
displaying a first application interface of the application, and displaying the shielding image on the hole digging screen;
the hiding or displaying the occlusion image before switching to the second application interface includes:
hiding the occlusion image displayed on the excavation screen prior to switching to the second application interface.
3. The method of claim 2, wherein said concealing said occlusion image displayed on said excavation screen comprises:
gradually reducing the size of the shielding image displayed on the hole digging screen until the shielding image is hidden;
or,
and gradually improving the transparency of the shielding image displayed on the hole digging screen until the shielding image is hidden.
4. The method of claim 1, wherein the first display strategy is to not display the occlusion image on the excavation screen, and the second display strategy is to display the occlusion image on the excavation screen;
the hiding or displaying the occlusion image before switching to the second application interface includes:
displaying the occlusion image on the excavation screen prior to switching to the second application interface.
5. The method of claim 4, wherein said displaying said occlusion image on said excavation screen comprises:
displaying a partial area of the shielding image on the hole digging screen, and gradually increasing the size of the displayed partial area of the shielding image until the complete shielding image is displayed on the hole digging screen;
or,
and displaying the shielding image on the hole digging screen in a first transparency, and gradually reducing the transparency of the shielding image until the transparency of the shielding image is reduced to a second transparency, wherein the second transparency is smaller than the first transparency.
6. The method of claim 1, wherein the first display strategy and the second display strategy each comprise a display strategy of a first occlusion image for occluding a top area of the hole-cutting screen and a display strategy of a second occlusion image for occluding a side area of the hole-cutting screen;
the hiding or displaying the occlusion image before switching to the second application interface includes:
hiding or displaying the first occlusion image before switching to the second application interface under the condition that the display strategies of the first occlusion image and the second occlusion image in the first display strategy and the second display strategy are different and the display strategies of the second occlusion image are the same;
hiding or displaying the second occlusion image before switching to the second application interface under the condition that the display strategies of the first occlusion image and the second occlusion image in the first display strategy and the second display strategy are the same and the display strategy of the second occlusion image is different;
and hiding or displaying the first occlusion image and hiding or displaying the second occlusion image before switching to the second application interface under the condition that the display strategies of the first occlusion image and the second occlusion image in the first display strategy and the second display strategy are different.
7. The method of any of claims 1-6, wherein an operating system of the electronic device includes a window management service module, a system user interface, and a display rotation module;
the obtaining of the second display strategy in response to the screen rotation operation includes:
if the window management service module detects a screen rotation instruction, inquiring an occlusion image display strategy corresponding to the second application interface, wherein the occlusion image display strategy corresponding to the second application interface is the second display strategy;
the switching the first application interface to the second application interface, and hiding or displaying the occlusion image before switching to the second application interface according to the second display policy includes:
the window management service module informs the display rotation module of screen rotation and informs the system user interface of hiding or displaying the occlusion image according to the second display strategy;
the display rotation module responds to the notification of the window management service module and switches the first application interface to the second application interface;
and the system user interface responds to the notice of the window management service module and hides or displays the shielding image before the display rotation module switches the first application interface to the second application interface.
8. The method of claim 7, wherein the operating system further comprises a surface flinger;
the display rotation module responds to the notification of the window management service module and switches the first application interface to the second application interface, and the method comprises the following steps:
and the display rotation module responds to the notification of the window management service module and notifies the surface flag to play a screen rotation animation effect, wherein the screen rotation animation effect is an animation effect for switching the first application interface to the second application interface.
9. The method of claim 7, wherein the operating system of the electronic device further comprises a sensor module for obtaining a landscape and portrait pose of the electronic device;
before the window management service module queries the occlusion image display policy corresponding to the second application interface, the method further includes:
if the sensor module detects that the horizontal and vertical screen postures of the electronic equipment change, a horizontal and vertical screen posture change event is sent to the window management service module;
and the window management service module receives the horizontal and vertical screen posture change event and determines to detect the screen rotation instruction according to the received horizontal and vertical screen posture change event.
10. An electronic device, characterized in that the electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, which computer program, when executed by the processor, implements the method according to any of claims 1 to 9.
11. A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1-9.
CN202211293081.XA 2022-10-21 2022-10-21 Display optimization method, device and storage medium when screen rotates Active CN115361468B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211293081.XA CN115361468B (en) 2022-10-21 2022-10-21 Display optimization method, device and storage medium when screen rotates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211293081.XA CN115361468B (en) 2022-10-21 2022-10-21 Display optimization method, device and storage medium when screen rotates

Publications (2)

Publication Number Publication Date
CN115361468A CN115361468A (en) 2022-11-18
CN115361468B true CN115361468B (en) 2023-02-28

Family

ID=84007719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211293081.XA Active CN115361468B (en) 2022-10-21 2022-10-21 Display optimization method, device and storage medium when screen rotates

Country Status (1)

Country Link
CN (1) CN115361468B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389496B (en) * 2023-09-19 2024-10-18 荣耀终端有限公司 Folding screen display method, electronic equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3495935A1 (en) * 2017-12-11 2019-06-12 Guangdong Oppo Mobile Telecommunications Corp., Ltd Method for screenshot and related products
CN109885373A (en) * 2019-02-27 2019-06-14 腾讯科技(深圳)有限公司 A kind of rendering method and device of user interface
CN110134475A (en) * 2019-04-17 2019-08-16 深圳壹账通智能科技有限公司 Method, apparatus, computer equipment and the storage medium of display interface parameter configuration
CN110874177A (en) * 2018-08-29 2020-03-10 中兴通讯股份有限公司 Display method of display screen, electronic equipment and storage medium
WO2020078273A1 (en) * 2018-10-15 2020-04-23 华为技术有限公司 Photographing method, and electronic device
CN114168031A (en) * 2022-02-11 2022-03-11 荣耀终端有限公司 Display optimization method, device and storage medium for hole-digging screen

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3495935A1 (en) * 2017-12-11 2019-06-12 Guangdong Oppo Mobile Telecommunications Corp., Ltd Method for screenshot and related products
CN110874177A (en) * 2018-08-29 2020-03-10 中兴通讯股份有限公司 Display method of display screen, electronic equipment and storage medium
WO2020078273A1 (en) * 2018-10-15 2020-04-23 华为技术有限公司 Photographing method, and electronic device
CN109885373A (en) * 2019-02-27 2019-06-14 腾讯科技(深圳)有限公司 A kind of rendering method and device of user interface
CN110134475A (en) * 2019-04-17 2019-08-16 深圳壹账通智能科技有限公司 Method, apparatus, computer equipment and the storage medium of display interface parameter configuration
CN114168031A (en) * 2022-02-11 2022-03-11 荣耀终端有限公司 Display optimization method, device and storage medium for hole-digging screen

Also Published As

Publication number Publication date
CN115361468A (en) 2022-11-18

Similar Documents

Publication Publication Date Title
CN110839096B (en) A touch method for a device with a folding screen and a folding screen device
CN111966252A (en) Application window display method and electronic equipment
CN113805745B (en) Control method of suspension window and electronic equipment
CN112269527A (en) Application interface generation method and related device
WO2021129253A1 (en) Method for displaying multiple windows, and electronic device and system
CN114168031B (en) Display optimization method and device for hole digging screen and storage medium
CN112527174B (en) Information processing method and electronic equipment
CN115097994B (en) Data processing method and related device
CN114637451B (en) Display optimization method, device and storage medium when switching applications
JP7571961B2 (en) INTERFACE DISPLAY METHOD AND ELECTRONIC DEVICE
CN114461120A (en) Display method and electronic device
CN117724781A (en) Playing method for starting animation by application program and electronic equipment
CN115361468B (en) Display optimization method, device and storage medium when screen rotates
CN115033333B (en) Suspended window display method, electronic equipment and storage medium
WO2022237316A1 (en) Display method and electronic device
CN113986072B (en) Keyboard display method, folding screen device and computer readable storage medium
CN115643485B (en) Photography methods and electronic equipment
CN116719587A (en) Screen display method, electronic device and computer-readable storage medium
CN115484399A (en) Video processing method and electronic equipment
CN117746762B (en) Display processing method and device and electronic equipment
CN117894256B (en) Display processing method, device and electronic equipment
EP4579415A1 (en) Display method, display apparatus, and electronic device
CN117130509B (en) Brightness control method and related equipment
CN117130510B (en) Brightness control method and related device
WO2022237315A1 (en) Display method and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address