CN117707661A - Interface display method and related devices - Google Patents
Interface display method and related devices Download PDFInfo
- Publication number
- CN117707661A CN117707661A CN202310891320.XA CN202310891320A CN117707661A CN 117707661 A CN117707661 A CN 117707661A CN 202310891320 A CN202310891320 A CN 202310891320A CN 117707661 A CN117707661 A CN 117707661A
- Authority
- CN
- China
- Prior art keywords
- interface
- application
- display
- screen
- terminal device
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 101
- 230000000694 effects Effects 0.000 claims description 107
- 238000004590 computer program Methods 0.000 claims description 18
- 238000010586 diagram Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 17
- 238000012545 processing Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 11
- 230000009286 beneficial effect Effects 0.000 description 10
- 230000004044 response Effects 0.000 description 9
- 230000008859 change Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 6
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 239000000835 fiber Substances 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04847—Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Description
技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种界面显示方法及相关装置。The present application relates to the field of terminal technology, and in particular, to an interface display method and related devices.
背景技术Background technique
终端设备安装有多个应用,这些应用中存在可以支持竖屏显示和横屏显示的应用,还存在仅支持竖屏显示的应用。对于支持竖屏显示和横屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以横屏显示应用的界面;对于仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,无法横屏显示应用的界面,不能满足用户横屏的需求,导致用户体验较差。There are multiple applications installed on the terminal device. Among these applications, there are applications that can support vertical screen display and horizontal screen display, and there are also applications that only support vertical screen display. For applications that support vertical screen display and horizontal screen display, when the terminal device switches from the vertical screen state to the horizontal screen state, the application interface can be displayed in horizontal screen; for applications that only support vertical screen display, the terminal device switches from the vertical screen state to In the horizontal screen state, the application interface cannot be displayed horizontally, which cannot meet the user's horizontal screen needs, resulting in poor user experience.
发明内容Contents of the invention
本申请提供一种界面显示方法及相关装置,应用于终端技术领域,本申请中,对于终端设备中仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以横屏显示应用的界面,有利于满足用户横屏的需求,提高用户体验。This application provides an interface display method and related devices, which are applied in the field of terminal technology. In this application, for applications in terminal equipment that only support vertical screen display, when the terminal equipment switches from the vertical screen state to the horizontal screen state, the horizontal screen can be Displaying the application interface is conducive to meeting the user's horizontal screen needs and improving the user experience.
第一方面,本申请提出一种界面显示方法,可以应用于终端设备。该方法包括:竖屏显示第一应用的第一界面,第一界面为全屏界面,第一应用的第一标识为第一值,第一值用于标识第一应用不支持横屏显示;当终端设备从竖屏状态切换到横屏状态时,若第一应用的标识在预设应用名单,计算将第一界面横屏显示时所需的显示相关信息;根据显示相关信息横屏显示第一应用的第二界面。In the first aspect, this application proposes an interface display method, which can be applied to terminal equipment. The method includes: displaying the first interface of the first application in vertical screen, the first interface being a full-screen interface, and the first identifier of the first application being a first value, and the first value being used to identify that the first application does not support horizontal screen display; when When the terminal device switches from the vertical screen state to the horizontal screen state, if the logo of the first application is in the preset application list, the display related information required to display the first interface in the horizontal screen is calculated; the first interface is displayed in the horizontal screen according to the display related information. The second interface of the application.
第一界面为全屏界面,则说明第一界面的宽等于终端设备的屏幕的宽,第一界面的高等于终端设备的屏幕的高。第一界面也可以称为竖屏时第一应用的界面,本申请对比不作限定。第一标识可以用于表示第一应用是否支持横屏显示。第一标识为第一值,第一值用于标识第一应用不支持横屏显示。第一应用不支持横屏显示取决于应用本身。第二界面也可以称为横屏时第一应用的界面,本申请对比不作限定。If the first interface is a full-screen interface, it means that the width of the first interface is equal to the width of the screen of the terminal device, and the height of the first interface is equal to the height of the screen of the terminal device. The first interface may also be called the interface of the first application when the screen is vertical, and this comparison is not limited in this application. The first identifier may be used to indicate whether the first application supports horizontal screen display. The first identifier is a first value, and the first value is used to identify that the first application does not support horizontal screen display. The first application does not support landscape display depends on the application itself. The second interface may also be called the interface of the first application when the screen is horizontal, and the comparison is not limited in this application.
预设应用名单为终端设备预设的应用名单。预设应用名单中可以包括一个或多个应用的标识,这些应用标识对应的应用均可以支持强制横屏,即在第一应用不支持横屏显示的情况下,若第一应用的标识在预设应用名单,终端设备可以横屏显示第一应用的界面。显示相关信息用于表示终端设备将第一界面横屏显示时所需的信息,以便于实现横屏显示。The default application list is the application list preset by the terminal device. The default application list may include the identification of one or more applications, and the applications corresponding to these application identifications may all support forced horizontal screen. That is, when the first application does not support horizontal screen display, if the identification of the first application is in the preset Assuming an application list, the terminal device can display the interface of the first application horizontally. The display related information is used to represent the information required when the terminal device displays the first interface in a horizontal screen, so as to facilitate the horizontal screen display.
本申请提供的方法,对于终端设备中不支持横屏显示的第一应用,终端设备从竖屏状态切换至横屏状态时,若第一应用的标识在预设应用名单中,可以横屏显示应用的界面,有利于满足用户横屏的需求,提高用户体验。According to the method provided by this application, for the first application in the terminal device that does not support horizontal screen display, when the terminal device switches from the vertical screen state to the horizontal screen state, if the logo of the first application is in the preset application list, it can be displayed in the horizontal screen. The interface of the application is conducive to meeting the user's horizontal screen needs and improving the user experience.
一种可能的实现中,显示相关信息包括第二界面的显示区域信息,在根据显示相关信息横屏显示第一应用的第二界面之前,方法还包括:更新第一应用的显示区域信息bounds为第二界面的显示区域信息;根据显示相关信息横屏显示第一应用的第二界面,包括:若判断第一应用的bounds被修改,根据显示相关信息横屏显示第一应用的第二界面。In a possible implementation, the display related information includes the display area information of the second interface. Before displaying the second interface of the first application horizontally according to the display related information, the method further includes: updating the display area information bounds of the first application to display area information of the second interface; displaying the second interface of the first application horizontally based on displaying relevant information, including: if it is determined that the bounds of the first application has been modified, displaying horizontally displaying the second interface of the first application based on displaying relevant information.
第一应用的显示区域信息bounds可以表示第一应用的界面的显示区域信息。终端设备竖屏时,bounds为第一界面的显示区域信息。当终端设备从竖屏状态切换到横屏状态时,若第一应用的标识在预设应用名单,终端设备将bounds更新为第二界面的显示区域信息。若第一应用的bounds被修改,说明第一界面的显示区域信息不等于第二界面的显示区域信息,终端设备可以横屏显示第一应用的第二界面。The display area information bounds of the first application may represent the display area information of the interface of the first application. When the terminal device is in portrait orientation, bounds is the display area information of the first interface. When the terminal device switches from the portrait screen state to the landscape screen state, if the identifier of the first application is in the default application list, the terminal device updates bounds to the display area information of the second interface. If the bounds of the first application is modified, it means that the display area information of the first interface is not equal to the display area information of the second interface, and the terminal device can display the second interface of the first application horizontally.
这种实现方式,更新bounds,可以说明第一应用的显示区域信息发生变化,可以根据变化的信息显示界面,有利于减少由于bounds未变化而导致不能横屏显示的概率。In this implementation, updating the bounds can indicate that the display area information of the first application has changed, and the interface can be displayed according to the changed information, which is beneficial to reducing the probability that the horizontal screen cannot be displayed because the bounds has not changed.
一种可能的实现中,若判断第一应用的bounds被修改,根据显示相关信息横屏显示第一应用的第二界面,包括:若判断第一应用的bounds被修改,且第二界面的显示区域不是全屏显示,则根据显示相关信息横屏显示第一应用的第二界面;其中,第二界面的显示区域信息包括第二界面的宽和高,第二界面的宽小于第一界面的宽,第二界面的高小于第一界面的高。In one possible implementation, if it is determined that the bounds of the first application has been modified, displaying the second interface of the first application horizontally based on the display relevant information includes: if it is determined that the bounds of the first application has been modified, and the display of the second interface If the area is not displayed in full screen, the second interface of the first application is displayed horizontally according to the display related information; wherein, the display area information of the second interface includes the width and height of the second interface, and the width of the second interface is smaller than the width of the first interface. , the height of the second interface is smaller than the height of the first interface.
若第一应用的bounds被修改,且第二界面的显示区域不是全屏显示,可以说明终端设备可以强制横屏显示第二界面,且第二界面未占用整个终端设备的屏幕。终端设备可以按照第二界面的宽和高横屏显示第二界面。If the bounds of the first application is modified and the display area of the second interface is not displayed in full screen, it can be explained that the terminal device can force the second interface to be displayed horizontally, and the second interface does not occupy the entire screen of the terminal device. The terminal device may display the second interface horizontally according to the width and height of the second interface.
这样,终端设备在第一应用的bounds被修改,且第二界面的显示区域不是全屏显示的情况下,横屏显示第二界面,有利于合理地显示第二界面。In this way, when the bounds of the first application is modified and the display area of the second interface is not displayed in full screen, the terminal device displays the second interface horizontally, which is conducive to reasonable display of the second interface.
一种可能的实现中,第二界面的高等于第一界面的宽,第二界面的宽满足下述公式:w2=h2/(w1/h1),其中,w2第二界面的宽,h2为第二界面的高,w1为第一界面的宽,h1为第一界面的高。这样,计算简单方便,有利于快速得到第二界面的宽和高。In a possible implementation, the height of the second interface is equal to the width of the first interface, and the width of the second interface satisfies the following formula: w 2 =h 2 /(w 1 /h 1 ), where w 2 second interface The width of h 2 is the height of the second interface, w 1 is the width of the first interface, and h 1 is the height of the first interface. In this way, the calculation is simple and convenient, which is conducive to quickly obtaining the width and height of the second interface.
一种可能的实现中,第二界面显示在终端设备的屏幕的预设区域,屏幕中除预设区域之外的区域显示有预设效果。In one possible implementation, the second interface is displayed in a preset area of the screen of the terminal device, and areas on the screen other than the preset area are displayed with preset effects.
预设效果可以为具有一定透明度的图片,但本申请并不限于此。第二界面的显示区域不是全屏显示,则终端设备可以在屏幕的预设区域显示第二界面,为了提高用户体验,可以在除预设区域之外的区域显示预设效果,相比除预设区域之外的区域为黑色的方案,可以提高用户体验。The preset effect can be a picture with a certain transparency, but the application is not limited to this. If the display area of the second interface is not full-screen, the terminal device can display the second interface in a preset area of the screen. In order to improve the user experience, the preset effect can be displayed in areas other than the preset area. The area outside the area is a black scheme, which can improve the user experience.
一种可能的实现中,方法还包括:若第一应用的第二标识为第二值,则将第二标识设置为第三值,第二值用于标识对第一界面的宽和高进行调整,第三值用于标识不对第一界面的宽和高进行调整。In a possible implementation, the method further includes: if the second identifier of the first application is a second value, setting the second identifier to a third value, and the second value is used to identify the width and height of the first interface. Adjustment, the third value is used to indicate that the width and height of the first interface will not be adjusted.
第二标识用于表示是否对第一界面的宽和高进行调整。若第二标识为第二值,可以说明第一应用自身请求对第一界面的宽和高进行调整,终端设备可以将第二标识设置为第三值,即不对第一界面的宽和高进行调整。这样,有利于减少由于对第一界面的宽和高进行调整导致不能显示预设效果的概率。The second identifier is used to indicate whether to adjust the width and height of the first interface. If the second identifier is the second value, it can mean that the first application itself requests to adjust the width and height of the first interface. The terminal device can set the second identifier to the third value, that is, the width and height of the first interface are not adjusted. Adjustment. In this way, it is helpful to reduce the probability that the preset effect cannot be displayed due to the adjustment of the width and height of the first interface.
一种可能的实现中,若判断第一应用的bounds被修改,根据显示相关信息横屏显示第一应用的第二界面,包括:若判断第一应用的bounds被修改,且第二界面的显示区域是全屏显示,则根据显示相关信息横屏显示第一应用的第二界面;其中,第二界面的显示区域信息包括第二界面的宽和高,第二界面的宽等于第一界面的高,第二界面的高等于第一界面的宽。In one possible implementation, if it is determined that the bounds of the first application has been modified, displaying the second interface of the first application horizontally based on the display relevant information includes: if it is determined that the bounds of the first application has been modified, and the display of the second interface If the area is displayed in full screen, the second interface of the first application will be displayed horizontally according to the display related information; wherein, the display area information of the second interface includes the width and height of the second interface, and the width of the second interface is equal to the height of the first interface. , the height of the second interface is equal to the width of the first interface.
若第一应用的bounds被修改,且第二界面的显示区域是全屏显示,可以说明终端设备可以强制横屏显示第二界面,且第二界面占用整个终端设备的屏幕。终端设备可以按照第二界面的宽和高横屏显示第二界面。If the bounds of the first application is modified and the display area of the second interface is displayed in full screen, it can be explained that the terminal device can force the second interface to be displayed horizontally, and the second interface occupies the entire screen of the terminal device. The terminal device may display the second interface horizontally according to the width and height of the second interface.
这样,终端设备在第一应用的bounds被修改,且第二界面的显示区域是全屏显示的情况下,横屏显示第二界面,有利于合理地显示第二界面。In this way, when the bounds of the first application is modified and the display area of the second interface is displayed in full screen, the terminal device displays the second interface horizontally, which is conducive to reasonable display of the second interface.
一种可能的实现中,方法还包括:若在预设应用名单中第一应用对应的显示模式不是全屏显示,则判断第二界面的显示区域不是全屏显示;或者,若在预设应用名单中第一应用对应的显示模式是全屏显示,则判断第二界面的显示区域是全屏显示。In a possible implementation, the method further includes: if the display mode corresponding to the first application in the default application list is not full-screen display, then determining that the display area of the second interface is not full-screen display; or, if the display mode in the default application list is not full-screen display, If the display mode corresponding to the first application is full-screen display, it is determined that the display area of the second interface is full-screen display.
预设应用名单中包括的应用均可以进行横屏显示,预设应用名单中的应用还对应显示模式,显示模式为全屏显示或者不是全屏显示(或者说比例显示)。第一应用在预设应用名单中,若在预设应用名单中第一应用对应的显示模式不是全屏显示,则判断第二界面的显示区域不是全屏显示。若在预设应用名单中第一应用对应的显示模式是全屏显示,则判断第二界面的显示区域是全屏显示。The applications included in the preset application list can all be displayed in horizontal screen. The applications in the preset application list also correspond to the display mode, and the display mode is full screen display or not full screen display (or proportional display). The first application is in the default application list. If the display mode corresponding to the first application in the default application list is not full-screen display, it is determined that the display area of the second interface is not full-screen display. If the display mode corresponding to the first application in the default application list is full-screen display, it is determined that the display area of the second interface is full-screen display.
这样,终端设备从预设应用名单中便可确定第二界面的显示模式,以便于后续根据确定的显示模式横屏显示第二界面。In this way, the terminal device can determine the display mode of the second interface from the preset application list, so as to subsequently display the second interface horizontally according to the determined display mode.
一种可能的实现中,计算将第一界面横屏显示时所需的显示相关信息,包括:调用applyAspectRatio()接口计算显示相关信息。这样,通过现有的接口实现计算显示相关信息,简单方便。In one possible implementation, calculating the display-related information required when displaying the first interface horizontally includes: calling the applyAspectRatio() interface to calculate the display-related information. In this way, it is simple and convenient to calculate and display relevant information through the existing interface.
一种可能的实现中,方法还包括:竖屏显示第二应用的第三界面,第二应用的第一标识为第四值,第四值用于标识第二应用支持横屏显示;当终端设备从竖屏状态切换到横屏状态时,横屏显示第二应用的第四界面。In a possible implementation, the method further includes: displaying the third interface of the second application in vertical screen, and the first identification of the second application is a fourth value, and the fourth value is used to identify that the second application supports horizontal screen display; when the terminal When the device switches from the portrait screen state to the landscape screen state, the fourth interface of the second application is displayed in the landscape screen.
第二应用与第一应用不同。第二应用的第一标识为第四值,用于表示第二应用支持横屏显示。第二应用支持横屏显示取决于应用本身。The second application is different from the first application. The first identifier of the second application is a fourth value, which is used to indicate that the second application supports horizontal screen display. The second application's support for landscape display depends on the application itself.
这样,本申请可以对支持横屏显示的第二应用,在终端设备从竖屏状态切换到横屏状态的情况下,横屏显示第二应用的界面,还可以对不支持横屏显示的第一应用,若第一应用在预设应用名单中,在终端设备从竖屏状态切换到横屏状态的情况下,终端设备可以横屏显示第一应用的界面,两种方法互不影响,有利于终端设备的稳定运行。In this way, this application can display the interface of the second application in the horizontal screen when the terminal device switches from the vertical screen state to the horizontal screen state, and can also display the interface of the second application in the horizontal screen that does not support the horizontal screen display. One application, if the first application is in the preset application list, when the terminal device switches from the portrait screen state to the landscape screen state, the terminal device can display the interface of the first application in the landscape screen. The two methods do not affect each other. Conducive to the stable operation of terminal equipment.
第二方面,本申请提供一种终端设备,终端设备也可以称为终端(terminal)、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等。终端设备可以是手机(mobile phone)、智能电视、穿戴式设备、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmentedreality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。In a second aspect, this application provides a terminal device. The terminal device may also be called a terminal (terminal), user equipment (UE), mobile station (MS), mobile terminal (MT), etc. . The terminal device can be a mobile phone (mobile phone), smart TV, wearable device, tablet computer (Pad), computer with wireless transceiver function, virtual reality (VR) terminal device, augmented reality (AR) terminal device , wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, transportation safety Wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc.
该终端设备包括:处理器和存储器;存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,使得终端设备执行如第一方面的方法。The terminal device includes: a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the terminal device executes the method of the first aspect.
第三方面,本申请提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序。计算机程序被处理器执行时实现如第一方面的方法。In a third aspect, this application provides a computer-readable storage medium that stores a computer program. The method of the first aspect is implemented when the computer program is executed by the processor.
第四方面,本申请提供一种计算机程序产品,计算机程序产品包括计算机程序,当计算机程序被运行时,使得计算机执行如第一方面的方法。In a fourth aspect, the present application provides a computer program product. The computer program product includes a computer program. When the computer program is run, it causes the computer to execute the method of the first aspect.
第五方面,本申请提供了一种芯片,芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面所述的方法。In a fifth aspect, the present application provides a chip. The chip includes a processor, and the processor is configured to call a computer program in a memory to execute the method as described in the first aspect.
应当理解的是,本申请的第二方面至第五方面与本申请的第一方面的技术方案相对应或者本申请的第二方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。It should be understood that the second to fifth aspects of the present application correspond to the technical solution of the first aspect of the present application or the technical solution of the second aspect of the present application, and each aspect and the corresponding feasible implementation manner are obtained The beneficial effects are similar and will not be described again.
附图说明Description of the drawings
图1是一种竖屏状态切换至横屏状态的示意图;Figure 1 is a schematic diagram of switching from a vertical screen state to a horizontal screen state;
图2是本申请实施例提供的一种终端设备的结构示意图;Figure 2 is a schematic structural diagram of a terminal device provided by an embodiment of the present application;
图3是本申请实施例提供的一种终端设备的软件结构框图;Figure 3 is a software structure block diagram of a terminal device provided by an embodiment of the present application;
图4是本申请实施例提供的一种界面显示方法的示意图;Figure 4 is a schematic diagram of an interface display method provided by an embodiment of the present application;
图5是本申请实施例提供的一种接口调用的示意性流程图;Figure 5 is a schematic flow chart of an interface call provided by an embodiment of the present application;
图6是本申请实施例提供的一种界面显示方法的模块交互示意图;Figure 6 is a schematic diagram of module interaction of an interface display method provided by an embodiment of the present application;
图7是本申请实施例提供的另一种界面显示方法的示意性流程图;Figure 7 is a schematic flow chart of another interface display method provided by an embodiment of the present application;
图8是本申请实施例提供的一种芯片的结构示意图。FIG. 8 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
为了便于清楚描述本申请实施例的技术方案,首先进行以下说明:In order to facilitate a clear description of the technical solutions of the embodiments of the present application, the following description is first provided:
在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一应用和第二应用仅仅是为了区分不同的应用,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the embodiments of the present application, words such as “first” and “second” are used to distinguish identical or similar items with basically the same functions and effects. For example, the first application and the second application are only used to distinguish different applications, and their order is not limited. 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 limit the number and execution order.
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a--c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of this application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c can mean: a, b, c, a-b, a--c, b-c, or a-b-c, where a, b, c can be single, or It's multiple.
需要说明的是,本申请实施例中的“在……时”,可以为在某种情况发生的瞬时,也可以为在某种情况发生前后的一段时间内,本申请实施例对此不作具体限定。此外,本申请实施例提供的显示界面仅作为示例,显示界面还可以包括更多或更少的内容。It should be noted that "at..." in the embodiments of the present application can be the instant when a certain situation occurs, or it can be a period of time before and after the occurrence of a certain situation. The embodiments of the present application do not specify this. limited. In addition, the display interface provided by the embodiment of the present application is only an example, and the display interface may also include more or less content.
对于具有大屏的终端设备例如平板、具有折叠屏的手机等,终端设备可以竖屏显示界面,也可以横屏显示界面。终端设备安装有多个应用,这些应用中存在可以支持竖屏显示和横屏显示的应用,还存在仅支持竖屏显示的应用。对于支持竖屏显示和横屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以横屏显示应用的界面;对于仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,无法横屏显示应用的界面,不能满足用户横屏需求,导致用户体验较差。For terminal devices with large screens, such as tablets, mobile phones with folding screens, etc., the terminal device can display the interface vertically or horizontally. There are multiple applications installed on the terminal device. Among these applications, there are applications that can support vertical screen display and horizontal screen display, and there are also applications that only support vertical screen display. For applications that support vertical screen display and horizontal screen display, when the terminal device switches from the vertical screen state to the horizontal screen state, the application interface can be displayed in horizontal screen; for applications that only support vertical screen display, the terminal device switches from the vertical screen state to In the horizontal screen state, the application interface cannot be displayed horizontally, which cannot meet the user's horizontal screen needs, resulting in poor user experience.
有鉴于此,本申请实施例提供一种界面显示方法及相关装置,对于仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以横屏显示应用的界面,有利于满足用户的横屏需求,提高用户体验。In view of this, embodiments of the present application provide an interface display method and related devices. For applications that only support vertical screen display, when the terminal device switches from the vertical screen state to the horizontal screen state, the application interface can be displayed in the horizontal screen, which is beneficial to Meet users’ horizontal screen needs and improve user experience.
本申请实施例提供的方法,可以称为强制横屏。强制横屏是指对于终端设备中仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以横屏显示应用的界面。The method provided by the embodiment of this application can be called forced horizontal screen. Forced horizontal screen means that for applications that only support vertical screen display in the terminal device, when the terminal device switches from the vertical screen state to the horizontal screen state, the application interface can be displayed in the horizontal screen.
本申请实施例提供的强制横屏可以包括两种显示模式,一种显示模式是全屏显示,另一种显示模式是比例显示。其中,全屏显示是指对于终端设备中仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以全屏显示应用的界面。比例显示是指对于终端设备中仅支持竖屏显示的应用,终端设备从竖屏状态切换至横屏状态时,可以在屏幕的中间区域显示应用的界面,并在屏幕的中间区域的两边区域显示预设效果。该预设效果可以是具有一定透明度的图片,本申请实施例对此不作限定。The forced horizontal screen provided by the embodiment of the present application may include two display modes, one display mode is full-screen display, and the other display mode is proportional display. Among them, full-screen display means that for applications that only support vertical screen display in the terminal device, when the terminal device switches from the vertical screen state to the horizontal screen state, the application interface can be displayed in full screen. Proportional display means that for applications that only support vertical screen display in the terminal device, when the terminal device switches from the vertical screen state to the horizontal screen state, the application interface can be displayed in the middle area of the screen and displayed on both sides of the middle area of the screen. Preset effects. The preset effect may be a picture with a certain degree of transparency, which is not limited in the embodiments of this application.
示例性地,图1示出了一种竖屏状态切换至横屏状态的示意图。如图1所示,终端设备为平板。如图1中的a界面所示,平板竖屏时,显示设置应用的界面。设置应用可以为仅支持竖屏显示的应用。平板从竖屏状态切换至横屏状态时,平板可以进行强制横屏。在一种示例中,平板从竖屏状态切换至横屏状态时,平板可以以比例显示的方法显示设置应用的界面,即在屏幕的中间区域显示设置应用的界面,并在屏幕的中间区域的两边区域显示预设效果,该预设效果可以为具有一定透明度的图片,如图1中的b界面所示。在另一种示例中,平板从竖屏状态切换到横屏状态时,平板可以以全屏显示的方法显示设置应用的界面,即全屏显示设置应用的界面,如图1中的c界面所示。For example, FIG. 1 shows a schematic diagram of switching from a portrait screen state to a landscape screen state. As shown in Figure 1, the terminal device is a tablet. As shown in interface a in Figure 1, when the tablet is in portrait orientation, the interface for setting the application is displayed. The settings application can be an application that only supports vertical screen display. When the tablet switches from portrait to landscape mode, the tablet can be forced into landscape mode. In one example, when the tablet switches from the portrait screen state to the landscape screen state, the tablet can display the interface of the settings application in a proportional display method, that is, the interface of the settings application is displayed in the middle area of the screen, and the interface of the settings application is displayed in the middle area of the screen. The areas on both sides display preset effects, which can be pictures with a certain degree of transparency, as shown in interface b in Figure 1. In another example, when the tablet switches from the portrait screen state to the landscape screen state, the tablet can display the interface of the settings application in full screen mode, that is, display the interface of the settings application in full screen, as shown in interface c in Figure 1 .
为了更好地理解本申请实施例,首先对终端设备的硬件结构进行说明。In order to better understand the embodiments of the present application, the hardware structure of the terminal device is first described.
示例性地,图2为本申请实施例提供的一种终端设备的结构示意图。如图2所示,终端设备包括:终端设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Exemplarily, FIG. 2 is a schematic structural diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 2 , the terminal device includes: the terminal device may include a processor 110 , an external memory interface 120 , an internal memory 121 , a universal serial bus (USB) interface 130 , a charging management module 140 , and a power management module 141 , battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192 , camera 193, display screen 194, and subscriber identification module (subscriber identification module, SIM) card interface 195, etc. 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本发明实施例示意的结构并不构成对终端设备的具体限定。在本申请另一些实施例中,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or less components than shown in the figures, or some components may be combined, or some components may be separated, or may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。示例性地,终端设备可以通过处理器110执行本申请实施例提供的方法。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 (GPU), an image signal processor ( image signal processor (ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, the terminal device can execute the method provided by the embodiment of the present application through the processor 110.
终端设备通过GPU,显示屏194,以及应用处理器等实现显示功能。示例性地,终端设备可以通过GPU,显示屏194,以及应用处理器显示上述图1所示的界面。其中,GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device implements display functions through the GPU, the display screen 194, and the application processor. For example, the terminal device can display the interface shown in Figure 1 above through the GPU, the display screen 194, and the application processor. Among them, the GPU is an image processing microprocessor 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 alter 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 dotlightemitting diodes,QLED)等。在一些实施例中,终端设备可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, etc. Display 194 includes a display panel. The display panel can use 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 diodes (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1.
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。示例性地,内部存储器121可以存储本申请实施例提供的方法对应的代码。Internal memory 121 may be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. For example, the internal memory 121 may store codes corresponding to the methods provided by the embodiments of the present application.
另外,在上述部件之上,设备还运行有操作系统。例如iOS操作系统,安卓(android)操作系统,或Windows操作系统等。在操作系统上可以安装运行应用程序。In addition, on top of the above components, the device also runs an operating system. For example, iOS operating system, Android operating system, or Windows operating system, etc. Applications can be installed and run on the operating system.
终端设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构等,在此不再赘述。The software system of the terminal device can adopt a layered architecture, event-driven architecture, micro-kernel architecture, micro-service architecture, or cloud architecture, etc., which will not be described again here.
本申请实施例以分层架构的Android系统为例,示例性说明终端设备的软件结构。The embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the terminal device.
图3是本申请实施例的终端设备的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,可以将安卓(android)系统分为五层,从上至下分别为应用程序层、应用程序框架(framework)层、硬件抽象层(hardware abstraction layer,HAL)、内核层(kernel)、硬件层。Figure 3 is a software structure block diagram of the terminal device according to the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system can be divided into five layers, from top to bottom: application layer, application framework (framework) layer, hardware abstraction layer (HAL), kernel layer ( kernel), hardware layer.
应用层可以包括一系列应用程序包。应用程序层通过调用框架层所提供的应用程序接口(application programming interface,API)运行应用程序。如图3所示,应用程序包可以包括相机,日历,地图,电话,音乐以及设置等应用程序。The application layer can include a series of application packages. The application layer runs the application by calling the application programming interface (API) provided by the framework layer. As shown in Figure 3, application packages can include applications such as camera, calendar, map, phone, music, and settings.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图3所示,框架层可以包括窗口管理器(window manager service)和显示管理器(display manager service)等等。其中,窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,触摸屏幕,拖拽屏幕,截取屏幕等。显示管理器用来管理显示的生命周期,它决定如何根据当前连接的物理显示设备控制其逻辑显示,并且在状态更改时,向系统和应用程序发送通知等等。在本申请实施例中,终端设备显示应用的界面时,终端设备从竖屏状态切换至横屏状态,窗口管理器可以通过活动记录模块_1(ActivityRecord_1)响应于终端设备从竖屏状态切换至横屏状态,判断应用自身请求的方向是否包括横屏显示,判断该应用是否在预设应用名单中,并判断该应用是否使用兼容模式,若应用自身请求的方向不支持横屏显示,且应用的标识在预设应用名单中,终端设备可以从预设应用名单中确定该应用的界面显示模式例如全屏显示或者比例显示,若该应用的界面显示模式为比例显示,则无论应用是否使用兼容模式,均基于横屏时显示的应用的界面的宽和高,计算横屏时显示的应用界面的宽和高,还可以在比例显示的情况下,获取预设效果。窗口管理器还可以通过活动记录模块_1向活动记录模块_2传递横屏时显示的应用界面的宽和高。窗口管理器也可以通过活动记录模块_1向显示管理器中的信箱UI控制器(LetterboxUiController)传递预设效果的属性,预设效果的属性可以包括透明度、显示区域以及尺寸等等。窗口管理器可以通过活动记录模块_2(ActivityRecord_2)判断应用的显示区域是否发生变化,并在发生变化的情况下,向活动记录模块_1传递变化后的显示区域。显示管理器可以通过信箱UI控制器基于预设效果的属性,显示预设效果。As shown in Figure 3, the framework layer can include a window manager (window manager service), a display manager (display manager service), and so on. Among them, the window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc. The display manager is used to manage the life cycle of the display. It determines how to control its logical display based on the currently connected physical display device, and when the status changes, sends notifications to the system and applications, etc. In the embodiment of the present application, when the terminal device displays the interface of the application, the terminal device switches from the portrait screen state to the landscape screen state, and the window manager can respond to the terminal device switching from the portrait screen state to the landscape screen state through the activity record module_1 (ActivityRecord_1). Landscape status, determine whether the direction requested by the application includes landscape display, determine whether the application is in the default application list, and determine whether the application uses compatibility mode. If the direction requested by the application does not support landscape display, and the application The logo is in the default application list. The terminal device can determine the interface display mode of the application from the default application list, such as full-screen display or proportional display. If the interface display mode of the application is proportional display, no matter whether the application uses compatibility mode or not , both based on the width and height of the application interface displayed in landscape mode, calculate the width and height of the application interface displayed in landscape mode, and can also obtain the preset effect in the case of proportional display. The window manager can also pass the width and height of the application interface displayed in landscape mode to activity record module_2 through activity record module_1. The window manager can also pass the properties of the preset effect to the letterbox UI controller (LetterboxUiController) in the display manager through the activity record module_1. The properties of the preset effect can include transparency, display area, size, etc. The window manager can determine whether the display area of the application has changed through the activity record module_2 (ActivityRecord_2), and in the case of a change, transfer the changed display area to the activity record module_1. The display manager can display the preset effect based on the properties of the preset effect through the mailbox UI controller.
HAL层的目的在于将硬件抽象化,可以为上层的应用提供一个统一的查询硬件设备的接口,或也可以为上层应用提供数据存储服务。如图3所示,该HAL层可以包括显示驱动模块、传感器硬件抽象(sensor hidl)。显示驱动模块用于控制显示驱动在显示屏上显示图片、界面以及通知信息等内容。传感器硬件抽象可以控制传感器,并监测传感器驱动的事件变化通知。HAL层中的多个模块可以遵循硬件抽象层接口描述语言(HAL interfacedefinition language,HIDL)或安卓接口描述语言(Android interface definitionlanguage,AIDL)。The purpose of the HAL layer is to abstract the hardware and provide a unified interface for querying hardware devices for upper-layer applications, or it can also provide data storage services for upper-layer applications. As shown in Figure 3, the HAL layer may include a display driver module and a sensor hardware abstraction (sensor hidl). The display driver module is used to control the display driver to display pictures, interfaces, notification information, etc. on the display screen. The sensor hardware abstraction can control sensors and monitor sensor-driven event change notifications. Multiple modules in the HAL layer can follow the hardware abstraction layer interface description language (HAL interface definition language, HIDL) or the Android interface definition language (Android interface definition language, AIDL).
内核层是硬件和软件之间的层。如图3所示,该内核层中可以包括下述一种或多种:传感器驱动和显示驱动等。The kernel layer is the layer between hardware and software. As shown in Figure 3, the kernel layer may include one or more of the following: sensor driver, display driver, etc.
硬件层中可以包括:麦克风、摄像头以及显示屏等硬件。The hardware layer can include hardware such as microphones, cameras, and displays.
应理解,在一些实施例中,可以将实现相同功能的层称为其他名称,或者将能够实现多个层的功能的层作为一层,或者将能够实现多个层的功能的层划分为多层。本申请实施例对此不做限制。It should be understood that in some embodiments, layers that implement the same function can be called other names, or a layer that can implement the functions of multiple layers is regarded as one layer, or a layer that can implement the functions of multiple layers is divided into multiple layers. layer. The embodiments of this application do not limit this.
上面结合图2和图3介绍了终端设备的硬件结构和软件架构,下面将结合图4介绍本申请实施例提供的适用于终端设备的方法。The hardware structure and software architecture of the terminal device are introduced above with reference to Figures 2 and 3. The method suitable for the terminal device provided by the embodiment of the present application will be introduced below with reference to Figure 4.
图4示出了本申请实施例提供的一种界面显示方法的示意图。如图4所示,该方法可以包括如下步骤:Figure 4 shows a schematic diagram of an interface display method provided by an embodiment of the present application. As shown in Figure 4, the method may include the following steps:
S401、竖屏显示第一应用的界面时,终端设备响应于竖屏状态切换至横屏状态,得到第一信息。S401. When the interface of the first application is displayed in the vertical screen, the terminal device switches to the horizontal screen state in response to the vertical screen state, and obtains the first information.
第一应用可以为上述图2所示的相机、日历、地图、电话、音乐或者设置应用。终端设备可以包括自动旋转控件,当自动旋转控件被选中时,终端设备可以支持竖屏显示和横屏显示。当自动旋转控件被选中时,终端设备可以实时或者周期性地获取当前终端设备的持有方向(竖向持有或者用户横向持有),当终端设备检测到用户从竖向持有切换到横向持有,响应于竖屏状态切换为横屏状态,得到第一信息。The first application may be the camera, calendar, map, phone, music or setting application shown in Figure 2 above. The terminal device may include an automatic rotation control. When the automatic rotation control is selected, the terminal device may support vertical screen display and horizontal screen display. When the auto-rotate control is selected, the terminal device can obtain the holding direction of the current terminal device (vertical holding or horizontal holding by the user) in real time or periodically. When the terminal device detects that the user switches from vertical holding to horizontal Holding, in response to switching from the portrait screen state to the landscape screen state, the first information is obtained.
第一信息可以包括第一应用的标识、第一应用是否支持横屏显示、第一应用是否使用兼容模式以及第一应用的界面的宽和高等信息。其中,第一应用的标识可以为应用的名称,也可以为符号、数字或者字母中至少一种的组合,本申请实施例对此不作限定。第一应用是否支持横屏显示是指应用自身请求的方向是否包括横屏,若第一应用支持横屏显示,则可以说明应用自身请求的方向包括横屏,第一应用为支持横屏显示的应用;若第一应用不支持横屏显示,则可以说明应用自身请求的方向不包括横屏,第一应用为仅支持竖屏显示的应用。第一应用是否支持横屏显示可以通过第一标识表示,第一标识为真时,可以表示第一应用支持横屏显示,第一标识为假时,可以表示第一应用不支持横屏显示。第一应用是否使用兼容模式是指第一应用的界面是否使用兼容模式处理。第一应用的界面是否使用兼容模式处理可以通过第二标识表示。若第一应用使用兼容模式例如第二标识为真(true),则终端设备可以使用兼容模式处理第一应用的界面;若第一应用不使用兼容模式例如第二标识为假(false),则终端设备可以不对第一应用的界面进行处理。其中,兼容模式是指终端设备预设的调整应用界面显示效果的方法,例如,调整应用界面以16:9的比例显示,或者,调整应用界面以16:10的比例显示,或者,调整应用界面以4:3的比例显示。兼容模式可以改变第一应用的界面的宽和高。第一应用是否使用兼容模式取决于应用本身。第一应用的界面的宽和高可以表示第一应用的显示区域,可以用符号bounds表示,但本申请实施例并不限于此。可以理解的是,竖屏时第一应用的界面的宽等于终端设备的屏幕的宽,竖屏时第一应用的界面的高等于终端设备的屏幕的高。The first information may include information such as an identifier of the first application, whether the first application supports horizontal screen display, whether the first application uses compatibility mode, and the width and height of the interface of the first application. The identifier of the first application may be the name of the application, or may be a combination of at least one of symbols, numbers, or letters, which is not limited in this embodiment of the present application. Whether the first application supports horizontal screen display refers to whether the direction requested by the application itself includes horizontal screen display. If the first application supports horizontal screen display, it can mean that the direction requested by the application itself includes horizontal screen display. The first application supports horizontal screen display. application; if the first application does not support horizontal screen display, it can mean that the direction requested by the application itself does not include horizontal screen, and the first application is an application that only supports vertical screen display. Whether the first application supports horizontal screen display may be indicated by a first flag. When the first flag is true, it may indicate that the first application supports horizontal screen display. When the first flag is false, it may indicate that the first application does not support horizontal screen display. Whether the first application uses the compatibility mode refers to whether the interface of the first application uses the compatibility mode. Whether the interface of the first application uses compatibility mode processing may be indicated by a second identifier. If the first application uses the compatibility mode, for example, the second identifier is true, the terminal device can use the compatibility mode to process the interface of the first application; if the first application does not use the compatibility mode, for example, the second identifier is false, then The terminal device may not process the interface of the first application. Among them, compatibility mode refers to the method preset by the terminal device to adjust the display effect of the application interface. For example, adjust the application interface to display in a 16:9 ratio, or adjust the application interface to display in a 16:10 ratio, or adjust the application interface to display in a ratio of 16:10. Displayed in 4:3 ratio. Compatibility mode can change the width and height of the first application's interface. Whether the first application uses compatibility mode depends on the application itself. The width and height of the interface of the first application may represent the display area of the first application and may be represented by the symbol bounds, but the embodiment of the present application is not limited thereto. It can be understood that when the screen is in portrait orientation, the width of the interface of the first application is equal to the width of the screen of the terminal device, and when the screen is in portrait orientation, the height of the interface of the first application is equal to the height of the screen of the terminal device.
示例性地,终端设备显示第一应用的界面时,可以通过configurationchange()接口响应竖屏状态切换为横屏状态,得到第一信息。第一信息可以用符号config表示,但本申请实施例并不限于此。For example, when the terminal device displays the interface of the first application, it can respond to switching from the portrait screen state to the landscape screen state through the configurationchange() interface to obtain the first information. The first information can be represented by the symbol config, but the embodiment of the present application is not limited to this.
S402、基于第一信息,终端设备判断第一应用是否支持横屏显示。S402. Based on the first information, the terminal device determines whether the first application supports horizontal screen display.
第一信息包括第一应用是否支持横屏显示的信息。若第一应用包括第一应用支持横屏显示的信息,可以说明第一应用为支持横屏显示的应用,终端设备可以横屏显示第一应用的界面,即执行S403。若第一应用包括第一应用不支持横屏显示的信息,可以说明第一应用为仅支持竖屏显示的应用,终端设备可以判断第一应用是否支持强制横屏,即执行S404。The first information includes information about whether the first application supports horizontal screen display. If the first application includes information that the first application supports horizontal screen display, it can be indicated that the first application is an application that supports horizontal screen display, and the terminal device can display the interface of the first application in horizontal screen, that is, perform S403. If the first application includes information that the first application does not support horizontal screen display, it can be indicated that the first application only supports vertical screen display. The terminal device can determine whether the first application supports forced horizontal screen display, that is, perform S404.
S403、若第一应用支持横屏显示,则终端设备可以横屏显示第一应用的界面。S403. If the first application supports horizontal screen display, the terminal device can display the interface of the first application in horizontal screen.
若第一应用支持横屏显示,则终端设备实现横屏显示第一应用的界面。本申请实施例对横屏时第一应用的界面的显示区域和显示位置等参数均不作限定。对于支持横屏显示的应用,终端设备从竖屏状态切换至横屏状态时,终端设备可以横屏显示第一应用的界面。If the first application supports horizontal screen display, the terminal device implements horizontal screen display of the interface of the first application. The embodiment of the present application does not limit parameters such as the display area and display position of the interface of the first application when the screen is horizontal. For applications that support horizontal screen display, when the terminal device switches from the vertical screen state to the horizontal screen state, the terminal device can display the interface of the first application in the horizontal screen.
S404、若第一应用不支持横屏显示,则终端设备判断第一应用是否支持强制横屏。S404. If the first application does not support horizontal screen display, the terminal device determines whether the first application supports forced horizontal screen display.
终端设备预设有应用名单,该应用名单中包括的应用均可以支持强制横屏。该应用名单中的应用还对应显示模式例如比例显示或者全屏显示。The terminal device has a default application list, and all applications included in the application list can support forced horizontal screen. The apps in this app list also correspond to display modes such as proportional display or full-screen display.
若第一应用不支持横屏显示,终端设备可以判断应用名单中是否包括第一应用的标识,若应用名单中包括第一应用的标识,可以说明第一应用支持强制横屏,则终端设备可以进一步从应用名单中得到第一应用的显示模式例如比例显示或者全屏显示。若第一应用支持强制横屏,且支持比例显示,终端设备可以基于S407的方法计算横屏时第一应用的界面的宽和高。若第一应用支持强制横屏,且支持全屏显示,终端设备可以基于S412的方法计算横屏时第一应用的界面的宽和高。若应用名单中不包括第一应用的标识,可以说明第一应用不支持强制横屏,则终端设备仍然竖屏显示第一应用的界面,即执行S416。If the first application does not support horizontal screen display, the terminal device can determine whether the application list includes the identification of the first application. If the application list includes the identification of the first application, it means that the first application supports forced horizontal screen display, and the terminal device can The display mode of the first application, such as proportional display or full-screen display, is further obtained from the application list. If the first application supports forced horizontal screen and supports proportional display, the terminal device can calculate the width and height of the interface of the first application in horizontal screen based on the method in S407. If the first application supports forced horizontal screen and supports full-screen display, the terminal device can calculate the width and height of the interface of the first application in horizontal screen based on the method of S412. If the application list does not include the identification of the first application, it means that the first application does not support forced horizontal screen, and the terminal device still displays the interface of the first application in vertical screen, that is, S416 is executed.
S405、若第一应用支持强制横屏,判断第一应用是否使用兼容模式。S405. If the first application supports forced horizontal screen, determine whether the first application uses the compatibility mode.
第一信息中可以包括第二标识,该第二标识用于标识第一应用是否使用兼容模式,若第二标识为真(true),可以说明第一应用使用兼容模式;若第二标识为假(false),可以说明第一应用不使用兼容模式。The first information may include a second identifier, which is used to identify whether the first application uses the compatibility mode. If the second identifier is true, it can indicate that the first application uses the compatibility mode; if the second identifier is false, (false), it can indicate that the first application does not use compatibility mode.
S406、若第一应用支持强制横屏,使用兼容模式,且支持比例显示,则终端设备可以跳过兼容模式。S406. If the first application supports forced horizontal screen, uses compatibility mode, and supports proportional display, the terminal device can skip the compatibility mode.
兼容模式可以通过CompatMode()接口实现。终端设备跳过兼容模式,也就是说,不执行兼容模式,或者说,不调用CompatMode()接口,不通过兼容模式对竖屏时第一应用的界面进行调整。Compatibility mode can be implemented through the CompatMode() interface. The terminal device skips the compatibility mode, that is to say, the compatibility mode is not executed, or the CompatMode() interface is not called, and the interface of the first application in portrait mode is not adjusted through the compatibility mode.
示例性地,第二标识用于标识第一应用是否使用兼容模式,若第二标识为真(true),第一应用使用兼容模式,终端设备可以将第二标识设置为假(false),终端设备检测到false为假,则不执行兼容模式。For example, the second identifier is used to identify whether the first application uses the compatibility mode. If the second identifier is true (true) and the first application uses the compatibility mode, the terminal device can set the second identifier to false (false). If the device detects false, it does not execute compatibility mode.
在一种示例中,上述S402、S404、S405以及S406,终端设备均可以调用resolveOverrideConfiguration()接口实现。In an example, the terminal device can call the resolveOverrideConfiguration() interface to implement the above S402, S404, S405 and S406.
需要说明的是,本申请实施例不限定S402、S404以及S405的执行顺序,上述图4所示的顺序仅仅为一个示例。It should be noted that the embodiment of the present application does not limit the execution order of S402, S404, and S405. The order shown in Figure 4 is just an example.
S407、若第一应用支持强制横屏,且支持比例显示,则终端设备基于缩放比和竖屏时第一应用的界面的宽和高,计算横屏时第一应用的界面的宽和高。S407. If the first application supports forced horizontal screen and supports proportional display, the terminal device calculates the width and height of the interface of the first application in horizontal screen based on the scaling ratio and the width and height of the interface of the first application in vertical screen.
缩放比也可以称为应用界面显示缩略比,本申请实施例对此不作限定。缩放比可以是预设的,也可以是基于预设的规则计算的,本申请实施例对此不作限定。横屏时第一应用的界面的宽和高可以表示横屏时第一应用的显示区域。The scaling ratio may also be referred to as the application interface display thumbnail ratio, which is not limited in the embodiments of the present application. The scaling ratio may be preset or may be calculated based on preset rules, which is not limited in the embodiments of the present application. The width and height of the interface of the first application in landscape mode may represent the display area of the first application in landscape mode.
示例性地,竖屏时第一应用的界面的宽和高为终端设备屏幕的宽和高(例如w1和h1),缩放比可以为宽与高的比值(例如w1/h1),横屏时第一应用的界面的高等于竖屏时第一应用的界面的宽(例如w1=h2),横屏时第一应用的界面的高除以缩放比等于横屏时第一应用的界面的宽(例如h2/(w1/h1)=w2)。For example, when the screen is in portrait orientation, the width and height of the interface of the first application are the width and height of the terminal device screen (for example, w 1 and h 1 ), and the scaling ratio can be the ratio of width to height (for example, w 1 /h 1 ). , the height of the interface of the first application in landscape mode is equal to the width of the interface of the first application in portrait mode (for example, w 1 = h 2 ), and the height of the interface of the first application in landscape mode divided by the zoom ratio is equal to the width of the interface of the first application in landscape mode. The width of an application's interface (for example, h 2 /(w 1 /h 1 )=w 2 ).
示例性地,终端设备可以调用applyAspectRatio()接口基于缩放比和竖屏时第一应用的界面的宽和高,计算横屏时第一应用的界面的宽和高。For example, the terminal device can call the applyAspectRatio() interface to calculate the width and height of the first application's interface in landscape mode based on the zoom ratio and the width and height of the first application's interface in portrait mode.
S408、终端设备将bounds更新为横屏时第一应用的界面的宽和高,并判断bounds是否被修改。S408: The terminal device updates the bounds to the width and height of the interface of the first application when the screen is horizontal, and determines whether the bounds has been modified.
第一信息包括竖屏时第一应用的界面的宽和高,该竖屏时第一应用的界面的宽和高可以用bounds表示,终端设备可以将bounds更新为横屏时第一应用的界面的宽和高,换句话说,在S408之前,bounds用于表示竖屏时第一应用的界面的宽和高,在S408之后,bounds用于表示横屏时第一应用的界面的宽和高。The first information includes the width and height of the interface of the first application in portrait mode. The width and height of the interface of the first application in portrait mode can be represented by bounds. The terminal device can update bounds to the interface of the first application in landscape mode. The width and height of .
终端设备可以判断bounds是否被修改,也就是判断竖屏时第一应用的界面的宽是否等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的高是否等于横屏时第一应用的界面的高,若均相等,则说明bounds未被修改,仍然为竖屏时第一应用的显示区域,终端设备可以仍然竖屏显示第一应用的界面,即执行S416。若存在一个不相等,或者均不相等,则说明bounds被修改,终端设备判断第一应用是否为比例显示,即执行S409。The terminal device can determine whether bounds has been modified, that is, determine whether the width of the first application's interface in portrait mode is equal to the width of the first application's interface in landscape mode, and whether the height of the first application's interface in portrait mode is equal to that of landscape screen. If the heights of the interfaces of the first application are all equal, it means that the bounds have not been modified and are still the display area of the first application in portrait mode. The terminal device can still display the interface of the first application in portrait mode, that is, perform S416. If there is one inequality, or none of them is equal, it means that bounds has been modified, and the terminal device determines whether the first application is a proportional display, that is, executes S409.
从上述S407可以得知,横屏时第一应用的界面的高等于竖屏时第一应用的界面的宽,横屏时第一应用的界面的高除以缩放比等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的宽不等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的高不等于横屏时第一应用的界面的高,则bounds被修改,终端设备可以执行S409。It can be known from the above S407 that the height of the interface of the first application in landscape mode is equal to the width of the interface of the first application in portrait mode, and the height of the interface of the first application in landscape mode divided by the zoom ratio is equal to the width of the interface of the first application in landscape mode. The width of the interface. The width of the interface of the first application in portrait mode is not equal to the width of the interface of the first application in landscape mode. The height of the interface of the first application in portrait mode is not equal to the height of the interface of the first application in landscape mode. , then bounds is modified and the terminal device can execute S409.
S409、若bounds被修改,则终端设备判断第一应用是否为比例显示。S409. If bounds is modified, the terminal device determines whether the first application is proportional display.
若应用名单中第一应用对应的显示模式为比例显示,则终端设备判断第一应用为比例显示。若第一应用对应的显示模式为全屏显示,则终端设备判断第一应用不是比例显示。If the display mode corresponding to the first application in the application list is proportional display, the terminal device determines that the first application is proportional display. If the display mode corresponding to the first application is full-screen display, the terminal device determines that the first application is not proportional display.
上述S407是在第一应用支持比例显示的情况下执行的,第一应用为比例显示。The above S407 is executed when the first application supports proportional display, and the first application is proportional display.
S410、若第一应用是比例显示,则终端设备获取预设效果。S410. If the first application is proportional display, the terminal device obtains the preset effect.
预设效果的透明度、颜色、显示区域等参数是预设的,可以存储于终端设备的缓冲区(buffer)。若第一应用是比例显示,终端设备可以从缓冲区中获取预设效果。终端设备获取预设效果,也可以理解为终端设备加载预设效果。The transparency, color, display area and other parameters of the preset effect are preset and can be stored in the buffer of the terminal device. If the first application is proportional display, the terminal device can obtain the preset effect from the buffer. The terminal device obtains the preset effect, which can also be understood as the terminal device loading the preset effect.
S411、终端设备在屏幕中间区域显示第一应用的界面,并在屏幕中间区域的两边区域显示预设效果。S411. The terminal device displays the interface of the first application in the middle area of the screen, and displays the preset effects in areas on both sides of the middle area of the screen.
终端设备可以按照上述S407计算的横屏时第一应用的界面的宽和高,在屏幕中间区域显示的第一应用的界面,并在屏幕中间区域的两边区域显示上述S410获取的预设效果。The terminal device can display the interface of the first application in the middle area of the screen according to the width and height of the first application interface in the horizontal screen calculated in the above S407, and display the preset effect obtained in the above S410 in areas on both sides of the middle area of the screen.
S412、若第一应用支持强制横屏,且支持全屏显示,则终端设备得到第一信息包括的竖屏时第一应用的界面的宽和高,将竖屏时第一应用的界面的宽和高对调,得到横屏时第一应用的界面的宽和高。S412. If the first application supports forced horizontal screen and supports full-screen display, the terminal device obtains the width and height of the interface of the first application in portrait mode included in the first information and adds the width and height of the interface of the first application in portrait mode. Swap the height to get the width and height of the interface of the first application in landscape mode.
若第一应用支持强制横屏,且支持全屏显示,则终端设备可以以全屏显示的方法在横屏时全屏显示第一应用的界面。终端设备在全屏显示第一应用的界面之前,可以先计算横屏时第一应用的界面的宽和高。终端设备可以得到第一信息包括的竖屏时第一应用的界面的宽和高,竖屏时第一应用的界面的宽为w1,竖屏时第一应用的界面的高为h1,终端设备将竖屏时第一应用的界面的宽确定为横屏时第一应用的界面的高即h2=w1,将竖屏时第一应用的界面的高确定为横屏时第一应用的界面的宽即w2=h1,得到横屏时第一应用的界面的宽和高。If the first application supports forced horizontal screen and supports full-screen display, the terminal device can display the interface of the first application in full-screen mode in the horizontal screen mode. Before displaying the interface of the first application in full screen, the terminal device may first calculate the width and height of the interface of the first application in landscape orientation. The terminal device can obtain the width and height of the interface of the first application when the screen is in portrait orientation, which is included in the first information. The width of the interface of the first application in portrait orientation is w 1 , and the height of the interface of the first application when the screen is in portrait orientation is h 1 . The terminal device determines the width of the interface of the first application in portrait mode as the height of the interface of the first application in landscape mode, that is, h 2 = w 1 , and determines the height of the interface of the first application in portrait mode as the height of the interface of the first application in landscape mode. The width of the application interface is w 2 = h 1 , and the width and height of the first application interface in landscape mode are obtained.
示例性地,终端设备可以调用applyAspectRatio()接口将第一应用的界面的宽和高对调,得到横屏时第一应用的界面的宽和高。For example, the terminal device can call the applyAspectRatio() interface to swap the width and height of the interface of the first application to obtain the width and height of the interface of the first application in landscape orientation.
S413、终端设备将bounds更新为横屏时第一应用的显示区域,并判断bounds是否被修改。S413. The terminal device updates the bounds to the display area of the first application when the screen is horizontal, and determines whether the bounds has been modified.
第一信息包括竖屏时第一应用的界面的宽和高,该竖屏时第一应用的界面的宽和高可以用bounds表示,终端设备可以将bounds更新为横屏时第一应用的界面的宽和高,换句话说,在S413之前,bounds用于表示竖屏时第一应用的界面的宽和高,在S413之后,bounds用于表示横屏时第一应用的界面的宽和高。The first information includes the width and height of the interface of the first application in portrait mode. The width and height of the interface of the first application in portrait mode can be represented by bounds. The terminal device can update bounds to the interface of the first application in landscape mode. The width and height of .
终端设备可以判断bounds是否被修改,也就是判断竖屏时第一应用的界面的宽是否等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的高是否等于横屏时第一应用的界面的高,若均相等,则说明bounds未被修改,仍然为竖屏时第一应用的显示区域,终端设备可以仍然竖屏显示第一应用的界面,即执行S416。若存在一个不相等,或者均不相等,则说明bounds被修改,终端设备判断第一应用是否为比例显示,即执行S414。The terminal device can determine whether bounds has been modified, that is, determine whether the width of the first application's interface in portrait mode is equal to the width of the first application's interface in landscape mode, and whether the height of the first application's interface in portrait mode is equal to that of landscape screen. If the heights of the interfaces of the first application are all equal, it means that the bounds have not been modified and are still the display area of the first application in portrait mode. The terminal device can still display the interface of the first application in portrait mode, that is, perform S416. If there is one inequality, or none of them is equal, it means that bounds has been modified, and the terminal device determines whether the first application is a proportional display, that is, executes S414.
上述S412中,将竖屏时第一应用的界面的宽和高对调,得到横屏时第一应用的界面的宽和高,也就是说竖屏时第一应用的界面的宽不等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的高不等于横屏时第一应用的界面的高,则bounds被修改,终端设备判断第一应用是否为比例显示,即执行S414。In the above S412, the width and height of the interface of the first application in the vertical screen are swapped to obtain the width and height of the interface of the first application in the horizontal screen. That is to say, the width of the interface of the first application in the vertical screen is not equal to the width of the horizontal screen. is the width of the interface of the first application, and the height of the interface of the first application in portrait mode is not equal to the height of the interface of the first application in landscape mode, then bounds is modified, and the terminal device determines whether the first application is a proportional display, that is, executes S414.
S414、若bounds被修改,则终端设备判断第一应用是否为比例显示。S414. If bounds is modified, the terminal device determines whether the first application is proportional display.
上述S412是在第一应用支持全屏显示的情况下执行的,第一应用为全屏显示,不是比例显示。The above S412 is executed when the first application supports full-screen display, and the first application is full-screen display, not proportional display.
S415、若第一应用不是比例显示,则终端设备全屏显示第一应用的界面。S415. If the first application is not proportionally displayed, the terminal device displays the interface of the first application in full screen.
终端设备可以按照上述S412计算的横屏时第一应用的界面的宽和高,显示第一应用的界面。The terminal device may display the interface of the first application according to the width and height of the interface of the first application in the horizontal screen calculated in S412 above.
需要说明的是,第一应用支持比例显示的情况下,终端设备执行S407至S411,第一应用支持全屏显示的情况下,终端设备执行S412至S415。对于同一个应用,S407至S411与S412至S415不会同时执行。It should be noted that, if the first application supports proportional display, the terminal device executes S407 to S411; if the first application supports full-screen display, the terminal device executes S412 to S415. For the same application, S407 to S411 and S412 to S415 will not be executed at the same time.
S416、若第一应用不支持横屏显示,且不支持强制横屏,则终端设备仍然竖屏显示第一应用的界面。或者,若第一应用不支持横屏显示,且支持强制横屏,且bounds未被修改的情况下,仍然竖屏显示第一应用的界面。S416. If the first application does not support horizontal screen display and does not support forced horizontal screen display, the terminal device still displays the interface of the first application in vertical screen mode. Or, if the first application does not support horizontal screen display and supports forced horizontal screen display, and the bounds has not been modified, the interface of the first application is still displayed vertically.
在图4所示的方法中,可以得到:In the method shown in Figure 4, we can get:
终端设备显示第一应用的界面,响应于终端设备从竖屏状态切换至横屏状态,终端设备可以在第一应用不支持横屏显示,支持强制横屏,支持比例显示,且bounds被修改的情况下,在屏幕中间区域显示第一应用的界面,并在屏幕中间区域的两边区域显示预设效果。The terminal device displays the interface of the first application. In response to the terminal device switching from the portrait screen state to the landscape screen state, the terminal device can display the first application in a horizontal screen that does not support horizontal screen display, supports forced horizontal screen, supports proportional display, and the bounds is modified. In this case, the interface of the first application is displayed in the middle area of the screen, and the preset effects are displayed in areas on both sides of the middle area of the screen.
终端设备显示第一应用的界面,响应于终端设备从竖屏状态切换至横屏状态,终端设备可以在第一应用不支持横屏显示,支持强制横屏,支持全屏显示,且bounds被修改的情况下,全屏显示第一应用的界面。The terminal device displays the interface of the first application. In response to the terminal device switching from the vertical screen state to the horizontal screen state, the terminal device can support the first application that does not support horizontal screen display, supports forced horizontal screen, supports full screen display, and the bounds is modified. In this case, the interface of the first application is displayed in full screen.
在终端设备支持强制横屏,且支持比例显示的情况下,若第一应用使用兼容模式,则不执行兼容模式。在终端设备支持强制横屏,且支持全屏显示的情况下,若第一应用使用兼容模式,则终端设备可以执行兼容模式。When the terminal device supports forced horizontal screen and proportional display, if the first application uses the compatibility mode, the compatibility mode will not be executed. When the terminal device supports forced horizontal screen and full-screen display, if the first application uses the compatibility mode, the terminal device can execute the compatibility mode.
终端设备显示第一应用的界面,响应于终端设备从竖屏状态切换至横屏状态,终端设备可以在第一应用不支持横屏显示,不支持强制横屏的情况下,仍然竖屏显示第一应用的界面。或者,终端设备可以在第一应用不支持横屏显示,支持强制横屏,且bounds未被修改的情况下,仍然竖屏显示第一应用的界面。The terminal device displays the interface of the first application. In response to the terminal device switching from the vertical screen state to the horizontal screen state, the terminal device can still display the third application vertically in the vertical screen when the first application does not support horizontal screen display and does not support forced horizontal screen. An application interface. Alternatively, the terminal device may still display the interface of the first application vertically when the first application does not support horizontal screen display but supports forced horizontal screen display and the bounds has not been modified.
终端设备显示第一应用的界面,响应于终端设备从竖屏状态切换至横屏状态,终端设备可以在第一应用支持横屏显示的情况下,横屏显示第一应用的界面。The terminal device displays the interface of the first application. In response to the terminal device switching from the vertical screen state to the horizontal screen state, the terminal device may display the interface of the first application in the horizontal screen mode if the first application supports horizontal screen display.
本申请实施例提供的方法,终端设备显示第一应用的界面,响应于终端设备从竖屏状态切换横屏状态时,在第一应用不支持横屏显示,支持强制横屏的情况下,可以横屏显示第一应用的界面,有利于满足用户横屏的需求,提高用户体验。本申请实施例在第一应用支持强制横屏的情况下,提供比例显示和全屏显示,可以为不同的应用提供不同的显示效果,灵活性更强。若终端设备支持强制横屏,且支持比例显示,由于比例显示下的预设效果的显示位置区域是基于终端设备的屏幕的宽和高确定的,故要求不能对第一信息中包括的第一应用的界面的宽和高进行调整,但若第一应用使用兼容模式,会对第一应用的界面的宽和高进行调整,使得横屏时显示的应用界面的宽和高与预设效果的显示区域不比配,导致预设效果不能显示。所以,在本申请实施例中,在终端设备支持强制横屏,且支持比例显示的情况下,若第一应用使用兼容模式,则跳过兼容模式,有利于避免兼容模式对第一信息包括的第一应用界面的宽和高的影响,基于竖屏显示的应用界面的宽和高确定横屏时显示的应用界面的宽和高,使得横屏时显示的应用界面的宽和高与壁纸的显示区域相比配,进而显示应用的界面和预设效果,有利于降低显示出错的概率,提高用户体验。另外,终端设备判断bounds是否被修改,在bounds被修改的情况下,在屏幕中间显示第一应用的界面,并在屏幕中间区域的两边区域显示预设效果,预设效果和第一应用的界面同时显示,有利于在横屏时显示预设效果,在bounds被修改情况下,获取预设效果,既可以避免多次获取又可以在需要时获取,有利于降低显示出错概率。In the method provided by the embodiment of the present application, the terminal device displays the interface of the first application, and in response to the terminal device switching from the vertical screen state to the horizontal screen state, when the first application does not support horizontal screen display and supports forced horizontal screen, you can Displaying the interface of the first application in horizontal screen is conducive to meeting the user's horizontal screen needs and improving user experience. The embodiment of the present application provides proportional display and full-screen display when the first application supports forced horizontal screen, which can provide different display effects for different applications and has greater flexibility. If the terminal device supports forced horizontal screen and proportional display, since the display position area of the preset effect under proportional display is determined based on the width and height of the screen of the terminal device, it is required that the first part included in the first information cannot be The width and height of the application's interface are adjusted. However, if the first application uses compatibility mode, the width and height of the first application's interface will be adjusted so that the width and height of the application interface displayed in landscape mode are consistent with the preset effect. The display area does not match, resulting in the preset effect not being displayed. Therefore, in the embodiment of the present application, when the terminal device supports forced horizontal screen and supports proportional display, if the first application uses the compatibility mode, the compatibility mode is skipped, which is beneficial to avoid the compatibility mode affecting the first information included. The influence of the width and height of the first application interface, based on the width and height of the application interface displayed in the vertical screen, determines the width and height of the application interface displayed in the horizontal screen, so that the width and height of the application interface displayed in the horizontal screen are consistent with the wallpaper The display area is matched to display the application interface and preset effects, which helps reduce the probability of display errors and improves user experience. In addition, the terminal device determines whether the bounds has been modified. If the bounds is modified, the interface of the first application is displayed in the middle of the screen, and the preset effect, the preset effect and the interface of the first application are displayed on both sides of the middle area of the screen. Simultaneous display is beneficial to displaying the preset effect in landscape mode. When the bounds is modified, obtaining the preset effect can avoid multiple acquisitions and obtain it when needed, which is beneficial to reducing the probability of display errors.
上述图4对本申请实施例提供的方法进行了详细说明,为了更好地理解本申请实施例提供的方法,下面结合图5从接口调用的角度对本申请实施例提供的方法进行说明。The above-mentioned Figure 4 provides a detailed description of the method provided by the embodiment of the present application. In order to better understand the method provided by the embodiment of the present application, the method provided by the embodiment of the present application will be described below in conjunction with Figure 5 from the perspective of interface calling.
图5示出了一种接口调用的示意性流程图。如图5所示,该方法可以包括如下步骤:Figure 5 shows a schematic flow chart of an interface call. As shown in Figure 5, the method may include the following steps:
S501、竖屏显示第一应用的界面时,终端设备通过配置改变接口响应于竖屏状态切换至横屏状态,得到第一信息。S501. When the interface of the first application is displayed in vertical screen, the terminal device switches from the vertical screen state to the horizontal screen state through the configuration change interface to obtain the first information.
该步骤与上述S401相同,此处不再赘述。This step is the same as S401 above and will not be described again here.
配置改变接口可以表示为configurationchange()接口。示例性地,终端设备显示第一应用的界面时,可以通过configurationchange()接口响应竖屏状态切换为横屏状态,得到第一信息。第一信息可以用符号config表示,但本申请实施例并不限于此。The configuration change interface can be represented as the configurationchange() interface. For example, when the terminal device displays the interface of the first application, it can respond to switching from the portrait screen state to the landscape screen state through the configurationchange() interface to obtain the first information. The first information can be represented by the symbol config, but the embodiment of the present application is not limited to this.
S502、基于第一信息,终端设备可以通过解析覆盖接口判断第一应用是否支持横屏显示,判断第一应用是否支持强制横屏,并判断第一应用是否使用兼容模式。S502. Based on the first information, the terminal device can determine whether the first application supports horizontal screen display by parsing the coverage interface, determine whether the first application supports forced horizontal screen, and determine whether the first application uses the compatibility mode.
该步骤对应上述S402、S404以及S405。本申请实施例不限定这3个步骤的执行顺序。This step corresponds to the above S402, S404 and S405. The embodiment of the present application does not limit the execution order of these three steps.
解析覆盖接口可以表示为resolveOverrideConfiguration()接口。示例性地,终端设备可以调用resolveOverrideConfiguration()接口判断第一应用是否支持横屏显示,判断第一应用是否支持强制横屏,并判断第一应用是否使用兼容模式。The resolution override interface can be expressed as the resolveOverrideConfiguration() interface. For example, the terminal device can call the resolveOverrideConfiguration() interface to determine whether the first application supports horizontal screen display, determine whether the first application supports forced horizontal screen, and determine whether the first application uses compatibility mode.
若终端设备支持强制横屏,可以说明第一应用的标识在预设的应用名单中。终端设备还可以从预设应用名单中获取第一应用对应的显示模式例如全屏显示或者比例显示。If the terminal device supports forced horizontal screen, it can mean that the identifier of the first application is in the default application list. The terminal device may also obtain the display mode corresponding to the first application from the preset application list, such as full-screen display or proportional display.
S503、在除第一应用支持强制横屏,且第一应用为比例显示的情况外,若第一应用支持兼容模式,则终端设备可以调用兼容模式接口对第一应用的界面的宽和高进行调整。S503. Except for the case where the first application supports forced horizontal screen and the first application is proportional display, if the first application supports the compatibility mode, the terminal device can call the compatibility mode interface to adjust the width and height of the interface of the first application. Adjustment.
兼容模式接口可以表示为CompatMode()接口。示例性地,在除第一应用支持强制横屏,且第一应用为比例显示的情况外,若第一应用支持兼容模式,则终端设备可以调用CompatMode()接口对第一应用的界面的宽和高进行调整。The compatibility mode interface can be represented as the CompatMode() interface. For example, in addition to the case where the first application supports forced horizontal screen and the first application is proportional display, if the first application supports compatibility mode, the terminal device can call the CompatMode() interface to adjust the width of the interface of the first application. and high to adjust.
S504、若第一应用支持强制横屏,则终端设备调用应用纵横比接口计算横屏时第一应用的界面的宽和高。S504. If the first application supports forced horizontal screen, the terminal device calls the application aspect ratio interface to calculate the width and height of the interface of the first application in horizontal screen.
该步骤对应上述S407或S412。当第一应用支持强制横屏,且支持比例显示时,终端设备按照上述S407所示的方法计算横屏时第一应用的界面的宽和高。当第一应用支持强制横屏,且支持全屏显示时,终端设备按照上述S412所示的方法计算横屏时第一应用的界面的宽和高。This step corresponds to the above-mentioned S407 or S412. When the first application supports forced horizontal screen and supports proportional display, the terminal device calculates the width and height of the interface of the first application in horizontal screen according to the method shown in S407 above. When the first application supports forced horizontal screen and supports full-screen display, the terminal device calculates the width and height of the interface of the first application in horizontal screen according to the method shown in S412 above.
应用纵横比接口可以表示为applyAspectRatio()接口。示例性地,终端设备可以通过applyAspectRatio()接口计算横屏时第一应用的界面的宽和高。The application aspect ratio interface can be expressed as the applyAspectRatio() interface. For example, the terminal device can calculate the width and height of the interface of the first application in landscape mode through the applyAspectRatio() interface.
S505、终端设备调用设置显示区域接口基于横屏时第一应用的界面的宽和高,更新bounds。S505. The terminal device calls the setting display area interface and updates bounds based on the width and height of the interface of the first application when the screen is horizontal.
第一信息包括竖屏时第一应用的界面的宽和高,该竖屏时第一应用的界面的宽和高可以用bounds表示,终端设备可以将bounds更新为横屏时第一应用的界面的宽和高,换句话说,在S505之前,bounds用于表示竖屏时第一应用的界面的宽和高,在S505之后,bounds用于表示横屏时第一应用的界面的宽和高。The first information includes the width and height of the interface of the first application in portrait mode. The width and height of the interface of the first application in portrait mode can be represented by bounds. The terminal device can update bounds to the interface of the first application in landscape mode. The width and height of .
设置显示区域接口可以表示为setBounds()接口。示例性地,终端设备可以通过setBounds()接口基于横屏时第一应用的界面的宽和高,更新bounds。The interface for setting the display area can be expressed as the setBounds() interface. For example, the terminal device can update bounds based on the width and height of the interface of the first application in landscape mode through the setBounds() interface.
S506、终端设备判断bounds是否被修改。S506. The terminal device determines whether bounds has been modified.
该步骤对应上述S408或者S413,终端设备判断更新后的bounds与更新前的bounds是否相同,换句话说,终端设备判断竖屏时第一应用的界面的宽是否等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的高是否等于横屏时第一应用的界面的高。This step corresponds to the above-mentioned S408 or S413. The terminal device determines whether the bounds after the update are the same as the bounds before the update. In other words, the terminal device determines whether the width of the interface of the first application in portrait mode is equal to the interface of the first application in landscape mode. The width and height of the first application's interface in portrait mode are equal to the height of the first application's interface in landscape mode.
若bounds未被修改,则终端设备仍然竖屏显示第一应用的界面。若bounds被修改,则终端设备可以判断第一应用是否为比例显示,即执行S507。If bounds has not been modified, the terminal device still displays the interface of the first application vertically. If bounds is modified, the terminal device can determine whether the first application is a proportional display, that is, execute S507.
S507、若bounds被修改,则终端设备判断第一应用是否为比例显示。S507. If bounds is modified, the terminal device determines whether the first application is proportional display.
该步骤对应上述S409或者S414,此处不再赘述。This step corresponds to the above-mentioned S409 or S414, and will not be described again here.
若第一应用不是比例显示,则终端设备全屏显示第一应用的界面。若第一应用为比例显示,则终端设备可以获取预设效果,即执行S508。If the first application is not displayed proportionally, the terminal device displays the interface of the first application in full screen. If the first application is proportional display, the terminal device can obtain the preset effect, that is, execute S508.
S508、若第一应用为比例显示,则终端设备获取预设效果。S508. If the first application is proportional display, the terminal device obtains the preset effect.
预设效果可以表示为addwallpaper,若第一应用为比例显示,则终端设备可以获取addwallpaper。The preset effect can be expressed as addwallpaper. If the first application is proportional display, the terminal device can obtain addwallpaper.
该步骤对应上述S410,此处不再赘述。This step corresponds to the above-mentioned S410 and will not be described again here.
本申请实施例提供的方法,终端设备可以调用各种接口获取预设效果,并与兼容模式进行兼容处理,有利于提高终端设备的运行稳定性。With the method provided by the embodiments of this application, the terminal device can call various interfaces to obtain preset effects, and perform compatibility processing with the compatibility mode, which is beneficial to improving the operating stability of the terminal device.
在本申请实施例中,终端设备在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,横屏显示第一应用的界面,并显示预设效果。为了尽可能的使第一应用的界面和预设效果同时显示,本申请实施例可以在计算横屏时第一应用的界面的宽和高之后,更新bounds,并判断bounds是否被修改,在bounds被修改的情况下,获取预设效果。In the embodiment of the present application, when the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, the terminal device displays the interface of the first application in horizontal screen and displays the preset effect. In order to display the interface of the first application and the preset effect at the same time as much as possible, the embodiment of the present application can update the bounds after calculating the width and height of the interface of the first application in the horizontal screen, and determine whether the bounds has been modified. In the bounds If modified, get the default effect.
本申请实施例将对终端设备获取预设效果的方案进行详细说明。终端设备的软件架构可以如上述图4所示,下面结合图6对上述图4中的模块的具体交互进行说明。The embodiment of this application will describe in detail the solution for the terminal device to obtain the preset effect. The software architecture of the terminal device can be as shown in the above-mentioned Figure 4. The specific interaction of the modules in the above-mentioned Figure 4 will be described below in conjunction with Figure 6.
图6示出了一种界面显示方法的模块交互示意图。终端设备的应用程序框架层包括活动记录模块_1、活动记录模块_2以及信箱UI控制器。如图6所示,该方法包括如下步骤:Figure 6 shows a schematic diagram of module interaction of an interface display method. The application framework layer of the terminal device includes activity recording module_1, activity recording module_2, and mailbox UI controller. As shown in Figure 6, the method includes the following steps:
S601、终端设备显示第一应用的界面时,活动记录模块_1响应于终端设备从竖屏状态切换至横屏状态,得到第一信息。S601. When the terminal device displays the interface of the first application, the activity recording module_1 obtains the first information in response to the terminal device switching from the vertical screen state to the horizontal screen state.
示例性地,终端设备显示第一应用的界面时,可以通过configurationchange()接口响应终端设备从竖屏状态切换为横屏状态,得到第一信息。第一信息可以用符号config表示,但本申请实施例并不限于此。第一信息可以包括第一应用的标识、第一应用是否支持横屏显示、第一应用是否使用兼容模式以及第一应用的界面的大小等信息。第一应用的界面的大小可以用符号bounds表示。For example, when the terminal device displays the interface of the first application, the first information may be obtained in response to the terminal device switching from the portrait screen state to the landscape screen state through the configurationchange() interface. The first information can be represented by the symbol config, but the embodiment of the present application is not limited to this. The first information may include information such as an identifier of the first application, whether the first application supports horizontal screen display, whether the first application uses compatibility mode, and the size of the interface of the first application. The size of the first application interface can be represented by the symbol bounds.
S602、活动记录模块_1基于第一信息,判断第一应用是否使用兼容模式。S602. The activity record module_1 determines whether the first application uses the compatibility mode based on the first information.
示例性地,活动记录模块_1基于第一信息,可以调用resolveFixedOrientationConfiguration()接口判断第一应用是否使用兼容模式。第一信息中包括用于表示第一应用是否使用兼容模式的第二标识,若第二标识为真(true),可以说明第一应用使用兼容模式;若第二标识为假(false),可以说明第一应用不使用兼容模式。For example, based on the first information, the activity record module_1 can call the resolveFixedOrientationConfiguration() interface to determine whether the first application uses the compatibility mode. The first information includes a second identifier used to indicate whether the first application uses the compatibility mode. If the second identifier is true, it can indicate that the first application uses the compatibility mode; if the second identifier is false, it can Explain that the first application does not use compatibility mode.
S603、在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,活动记录模块_1不执行兼容模式。S603. When the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, the activity record module_1 does not execute the compatibility mode.
在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,即使第一应用使用兼容模式,活动记录模块_1不执行兼容模式。例如,在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,若第一应用使用兼容模式,活动记录模块_1调用isSkipUseCompatMode()接口跳过兼容模式,即不执行兼容模式。In the case where the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, even if the first application uses the compatibility mode, the activity record module_1 does not execute the compatibility mode. For example, if the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, if the first application uses the compatibility mode, the activity record module_1 calls the isSkipUseCompatMode() interface to skip the compatibility mode, that is, it does not Enable compatibility mode.
S604、基于缩放比和竖屏时第一应用的界面的宽和高,计算横屏时第一应用的界面的宽和高。S604. Based on the scaling ratio and the width and height of the interface of the first application in portrait mode, calculate the width and height of the interface of the first application in landscape mode.
在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,活动记录模块_1基于缩放比和竖屏时第一应用的界面的宽和高,计算横屏时第一应用的界面的宽和高。具体的计算过程如上述S408所示,在此不再重复赘述。When the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, the activity record module_1 calculates the first application interface width and height based on the scaling ratio and the vertical screen. The width and height of an application's interface. The specific calculation process is as shown in S408 above, and will not be repeated here.
示例性地,活动记录模块_1可以调用resolveAspectRadioRestriction()接口判断第一应用是否支持强制横屏,并在第一应用支持强制横屏的情况下,在应用名单中获取第一应用的显示方式例如比例显示或者全屏显示。在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,活动记录模块_1可以调用applyAspectRatio()接口基于缩放比和竖屏时第一应用的界面的宽和高,计算横屏时第一应用的界面的宽和高。For example, the activity record module_1 can call the resolveAspectRadioRestriction() interface to determine whether the first application supports forced horizontal screen, and if the first application supports forced horizontal screen, obtain the display mode of the first application in the application list, for example Proportional display or full screen display. When the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, the activity record module_1 can call the applyAspectRatio() interface based on the scaling ratio and the width and height of the first application's interface in portrait mode. , calculate the width and height of the interface of the first application in landscape mode.
S605、活动记录模块_1向活动记录模块_2传递横屏时第一应用的界面的宽和高,对应地,活动记录模块_2从活动记录模块_1中得到横屏时第一应用的界面的宽和高。S605. Activity record module_1 transmits the width and height of the interface of the first application in landscape mode to activity record module_2. Correspondingly, activity record module_2 obtains the width and height of the first application in landscape mode from activity record module_1. The width and height of the interface.
示例性地,活动记录模块_1可以调用applyAppDisplayRect()接口向活动记录模块_2传递横屏时第一应用的界面的宽和高。For example, activity record module_1 can call the applyAppDisplayRect() interface to pass the width and height of the first application interface in landscape mode to activity record module_2.
S606、活动记录模块_2基于横屏时第一应用的界面的宽和高更新bounds。S606. The activity record module_2 updates bounds based on the width and height of the interface of the first application in landscape mode.
在S606之前,bounds等于竖屏时第一应用的界面的宽和高,在S606之后,bounds等于横屏时第一应用的界面的宽和高。Before S606, bounds is equal to the width and height of the interface of the first application in portrait mode. After S606, bounds is equal to the width and height of the interface of the first application in landscape mode.
示例性地,活动记录模块_2可以调用setBounds()接口基于横屏时第一应用的界面的宽和高更新bounds。For example, activity record module_2 may call the setBounds() interface to update bounds based on the width and height of the interface of the first application in landscape mode.
S607、活动记录模块_2判断bounds是否被修改。S607. Activity record module_2 determines whether bounds has been modified.
活动记录模块_2判断bounds是否被修改,换句话说,活动记录模块_2判断判断竖屏时第一应用的界面的宽是否等于横屏时第一应用的界面的宽,竖屏时第一应用的界面的高是否等于横屏时第一应用的界面的高。Activity record module_2 determines whether bounds has been modified. In other words, activity record module_2 determines whether the width of the interface of the first application in portrait mode is equal to the width of the interface of the first application in landscape mode. Whether the height of the application's interface is equal to the height of the first application's interface in landscape mode.
示例性地,活动记录模块_2可以调用getAppDisplayRect()接口判断bounds是否被修改。For example, activity record module_2 can call the getAppDisplayRect() interface to determine whether bounds has been modified.
S608、若bounds被修改,则判断是否为比例显示。S608. If bounds is modified, determine whether it is proportional display.
该步骤对应上述S409或者S414,此处不再赘述。This step corresponds to the above-mentioned S409 or S414, and will not be described again here.
S609、若bounds被修改,且为比例显示的情况下,则活动记录模块_2可以向活动记录模块_1传递更新后的bounds,对应地,活动记录模块_1从活动记录模块_2中得到更新后的bounds。S609. If the bounds is modified and is displayed in proportion, the activity record module_2 can transfer the updated bounds to the activity record module_1. Correspondingly, the activity record module_1 obtains it from the activity record module_2. Updated bounds.
示例性地,活动记录模块_2可以通过!OutBounds.equals(containingBounds)标识向活动记录模块_1传递更新后的bounds。For example, activity record module_2 can pass! OutBounds.equals(containingBounds) identifies the updated bounds passed to active record module_1.
S610、活动记录模块_1基于更新后的bounds,将标记设置为真(true)。S610. The activity record module_1 sets the flag to true based on the updated bounds.
该标记用于指示是否获取预设效果。该标记默认为假(false)。若标记为真,活动记录模块_1可以获取预设效果,即执行S611。This flag is used to indicate whether to obtain the preset effect. This flag defaults to false. If the flag is true, the activity recording module_1 can obtain the preset effect, that is, execute S611.
示例性地,该标记可以为shouldShowBlurWallpaperForLetterbox。活动记录模块_2基于bounds变化的指示信息,将标记设置为真,即shouldShowBlurWallpaperForLetterbox=true。For example, the tag may be shouldShowBlurWallpaperForLetterbox. Activity record module_2 sets the flag to true based on the indication information of bounds change, that is, shouldShowBlurWallpaperForLetterbox=true.
S611、在标记为真的情况下,活动记录模块_1获取预设效果。S611. When the mark is true, the activity recording module_1 obtains the preset effect.
示例性地,活动记录模块_1可以调用onLeashAnimationStarting(addWallpaper)接口在标记为真的情况下,获取预设效果。For example, activity record module_1 can call the onLeashAnimationStarting(addWallpaper) interface to obtain the preset effect when the mark is true.
S612、活动记录模块_1向信箱UI控制器传递预设效果的属性,对应地,信箱UI控制器从活动记录模块_1中得到预设效果的属性。S612. The activity record module_1 transmits the attributes of the preset effect to the mailbox UI controller. Correspondingly, the mailbox UI controller obtains the attributes of the preset effect from the activity record module_1.
预设效果的属性包括壁纸的透明度、尺寸、颜色以及显示区域等等。预设效果的属性是预设的,活动记录模块_1获取预设效果时,可以得到预设效果的属性。The attributes of the preset effects include the transparency, size, color, display area, etc. of the wallpaper. The attributes of the preset effect are preset. When the activity recording module_1 obtains the preset effect, it can obtain the attributes of the preset effect.
示例性地,活动记录模块_1可以调用getLetterboxinnerBounds()接口向信箱UI控制器传递预设效果的属性。For example, the activity record module_1 can call the getLetterboxinnerBounds() interface to transfer the attributes of the preset effect to the mailbox UI controller.
S613、信箱UI控制器基于预设效果的属性,显示预设效果。S613. The mailbox UI controller displays the preset effect based on the attributes of the preset effect.
示例性地,信箱UI控制器可以调用shouldShowLetterboxUI()接口基于预设效果的属性,显示预设效果。For example, the letterbox UI controller can call the shouldShowLetterboxUI() interface to display the preset effect based on the properties of the preset effect.
本申请实施例提供的界面显示方法,在第一应用不支持横屏显示,支持强制横屏,且支持比例显示的情况下,若第一应用使用兼容模式,活动记录模块_1不执行兼容模式,使得横屏时第一应用的界面的宽和高基于竖屏时第一应用的界面的宽和高确定,有利于减小预设效果出错的概率。另外,活动记录模块_1在bounds被修改的情况下,将标记设置为真,使得后续获取预设效果,既可以避免多次获取又可以在需要时获取,有利于降低显示出错概率。According to the interface display method provided by the embodiment of this application, when the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, if the first application uses the compatibility mode, the activity recording module_1 does not execute the compatibility mode. , so that the width and height of the interface of the first application in the horizontal screen are determined based on the width and height of the interface of the first application in the vertical screen, which is beneficial to reducing the probability of errors in the preset effect. In addition, activity record module_1 sets the flag to true when bounds is modified, so that subsequent acquisition of preset effects can avoid multiple acquisitions and obtain them when needed, which is beneficial to reducing the probability of display errors.
需要说明的是,本申请实施例所涉及的模块名称均可以定义为其他的名称,能够实现各模块的作用即可,不对模块的名称做具体限制。It should be noted that the module names involved in the embodiments of this application can be defined as other names, as long as the functions of each module can be realized, and there are no specific restrictions on the names of the modules.
上面结合终端设备中各软件模块示例性说明本申请界面显示方法的软件交互流程,下面继续结合步骤流程详细说明本申请实施例的界面显示方法。The software interaction process of the interface display method of the present application is exemplified above with reference to each software module in the terminal device. The interface display method of the embodiment of the present application will be described in detail below with reference to the step process.
示例性的,图7示出了本申请实施例提供的一种界面显示方法的示意性流程图。该方法适用于终端设备。如图7所示,该方法包括如下步骤:Exemplarily, FIG. 7 shows a schematic flow chart of an interface display method provided by an embodiment of the present application. This method is suitable for terminal devices. As shown in Figure 7, the method includes the following steps:
S701、竖屏显示第一应用的第一界面,第一界面为全屏界面,第一应用的第一标识为第一值,第一值用于标识第一应用不支持横屏显示。S701. Display the first interface of the first application in vertical screen. The first interface is a full-screen interface. The first identifier of the first application is a first value. The first value is used to identify that the first application does not support horizontal screen display.
第一界面为全屏界面,则说明第一界面的宽等于终端设备的屏幕的宽,第一界面的高等于终端设备的屏幕的高。第一界面可以用于表示上述图4中竖屏时第一应用的界面。第一标识可以用于表示第一应用是否支持横屏显示。第一标识为第一值,第一值用于标识第一应用不支持横屏显示,在一种示例中,第一值可以为假(false)或者“0”,本申请实施例对此不作限定。第一应用不支持横屏显示取决于应用本身。If the first interface is a full-screen interface, it means that the width of the first interface is equal to the width of the screen of the terminal device, and the height of the first interface is equal to the height of the screen of the terminal device. The first interface may be used to represent the interface of the first application when the screen is vertical as shown in FIG. 4 . The first identifier may be used to indicate whether the first application supports horizontal screen display. The first identifier is a first value, and the first value is used to identify that the first application does not support horizontal screen display. In one example, the first value may be false (false) or “0”, which is not the case in this embodiment. limited. The first application does not support landscape display depends on the application itself.
S702、当终端设备从竖屏状态切换到横屏状态时,若第一应用的标识在预设应用名单,计算将第一界面横屏显示时所需的显示相关信息。S702. When the terminal device switches from the vertical screen state to the horizontal screen state, if the identifier of the first application is in the preset application list, calculate the display related information required to display the first interface in the horizontal screen.
预设应用名单为终端设备预设的应用名单。预设应用名单中可以包括一个或多个应用的标识,这些应用标识对应的应用均可以支持强制横屏,即在第一应用不支持横屏显示的情况下,若第一应用的标识在预设应用名单,终端设备可以横屏显示第一应用的界面。显示相关信息用于表示终端设备将第一界面横屏显示时所需的信息,以便于实现横屏显示。The default application list is the application list preset by the terminal device. The default application list may include the identification of one or more applications, and the applications corresponding to these application identifications may all support forced horizontal screen. That is, when the first application does not support horizontal screen display, if the identification of the first application is in the preset Assuming an application list, the terminal device can display the interface of the first application horizontally. The display related information is used to represent the information required when the terminal device displays the first interface in a horizontal screen, so as to facilitate the horizontal screen display.
示例性地,终端设备可以根据上述图4中S405或者S406计算将第一界面横屏显示时所需的显示相关信息。For example, the terminal device may calculate the display related information required to display the first interface in horizontal screen according to S405 or S406 in FIG. 4 .
S703、根据显示相关信息横屏显示第一应用的第二界面。S703. Display the second interface of the first application horizontally according to the display related information.
第二界面可以用于表示上述图4中横屏时第一应用的界面。本申请实施例提供的方法,对于终端设备中不支持横屏显示的第一应用,终端设备从竖屏状态切换至横屏状态时,若第一应用的标识在预设应用名单中,可以横屏显示应用的界面,有利于满足用户横屏的需求,提高用户体验。The second interface may be used to represent the interface of the first application in the horizontal screen mode in FIG. 4 . According to the method provided by the embodiment of the present application, for the first application in the terminal device that does not support horizontal screen display, when the terminal device switches from the vertical screen state to the horizontal screen state, if the identifier of the first application is in the default application list, the first application can be displayed horizontally. The interface of the screen display application is conducive to meeting the user's horizontal screen needs and improving the user experience.
可选地,显示相关信息包括第二界面的显示区域信息,在根据显示相关信息横屏显示第一应用的第二界面之前,方法还包括:更新第一应用的显示区域信息bounds为第二界面的显示区域信息;根据显示相关信息横屏显示第一应用的第二界面,包括:若判断第一应用的bounds被修改,根据显示相关信息横屏显示第一应用的第二界面。Optionally, the display related information includes the display area information of the second interface. Before displaying the second interface of the first application horizontally according to the display related information, the method further includes: updating the display area information bounds of the first application to the second interface. display area information; displaying the second interface of the first application horizontally based on displaying relevant information, including: if it is determined that the bounds of the first application has been modified, displaying horizontally displaying the second interface of the first application based on displaying relevant information.
第一应用的显示区域信息bounds可以表示第一应用的界面的显示区域信息。终端设备竖屏时,bounds为第一界面的显示区域信息。当终端设备从竖屏状态切换到横屏状态时,若第一应用的标识在预设应用名单,终端设备将bounds更新为第二界面的显示区域信息。若第一应用的bounds被修改,说明第一界面的显示区域信息不等于第二界面的显示区域信息,终端设备可以横屏显示第一应用的第二界面。The display area information bounds of the first application may represent the display area information of the interface of the first application. When the terminal device is in portrait orientation, bounds is the display area information of the first interface. When the terminal device switches from the portrait screen state to the landscape screen state, if the identifier of the first application is in the default application list, the terminal device updates bounds to the display area information of the second interface. If the bounds of the first application is modified, it means that the display area information of the first interface is not equal to the display area information of the second interface, and the terminal device can display the second interface of the first application horizontally.
该方法的具体实现可以参考上述图4中的S406或者S411,此处不再具体赘述。For the specific implementation of this method, reference can be made to S406 or S411 in the above-mentioned Figure 4, which will not be described in detail here.
这种实现方式,更新bounds,可以说明第一应用的显示区域信息发生变化,可以根据变化的信息显示界面,有利于减少由于bounds未变化而导致不能横屏显示的概率。In this implementation, updating the bounds can indicate that the display area information of the first application has changed, and the interface can be displayed according to the changed information, which is beneficial to reducing the probability that the horizontal screen cannot be displayed because the bounds has not changed.
可选地,若判断第一应用的bounds被修改,根据显示相关信息横屏显示第一应用的第二界面,包括:若判断第一应用的bounds被修改,且第二界面的显示区域不是全屏显示,则根据显示相关信息横屏显示第一应用的第二界面;其中,第二界面的显示区域信息包括第二界面的宽和高,第二界面的宽小于第一界面的宽,第二界面的高小于第一界面的高。Optionally, if it is determined that the bounds of the first application has been modified, display the second interface of the first application horizontally according to the display related information, including: if it is determined that the bounds of the first application has been modified, and the display area of the second interface is not full screen display, the second interface of the first application is displayed horizontally according to the display-related information; wherein, the display area information of the second interface includes the width and height of the second interface, the width of the second interface is smaller than the width of the first interface, and the second interface The height of the interface is smaller than the height of the first interface.
若第一应用的bounds被修改,且第二界面的显示区域不是全屏显示,可以说明终端设备可以强制横屏显示第二界面,且第二界面未占用整个终端设备的屏幕。终端设备可以按照第二界面的宽和高横屏显示第二界面。If the bounds of the first application is modified and the display area of the second interface is not displayed in full screen, it can be explained that the terminal device can force the second interface to be displayed horizontally, and the second interface does not occupy the entire screen of the terminal device. The terminal device may display the second interface horizontally according to the width and height of the second interface.
这样,终端设备在第一应用的bounds被修改,且第二界面的显示区域不是全屏显示的情况下,横屏显示第二界面,有利于合理地显示第二界面。In this way, when the bounds of the first application is modified and the display area of the second interface is not displayed in full screen, the terminal device displays the second interface horizontally, which is conducive to reasonable display of the second interface.
可选地,第二界面的高等于第一界面的宽,第二界面的宽满足下述公式:w2=h2/(w1/h1),其中,w2第二界面的宽,h2为第二界面的高,w1为第一界面的宽,h1为第一界面的高。Optionally, the height of the second interface is equal to the width of the first interface, and the width of the second interface satisfies the following formula: w 2 =h 2 /(w 1 /h 1 ), where w 2 the width of the second interface, h 2 is the height of the second interface, w 1 is the width of the first interface, and h 1 is the height of the first interface.
可选地,第二界面显示在终端设备的屏幕的预设区域,屏幕中除预设区域之外的区域显示有预设效果。Optionally, the second interface is displayed in a preset area of the screen of the terminal device, and the area on the screen other than the preset area displays the preset effect.
预设效果可以为具有一定透明度的图片,但本申请实施例并不限于此。第二界面的显示区域不是全屏显示,则终端设备可以在屏幕的预设区域显示第二界面,为了提高用户体验,可以在除预设区域之外的区域显示预设效果,相比除预设区域之外的区域为黑色的方案,可以提高用户体验。The preset effect may be a picture with a certain degree of transparency, but the embodiments of the present application are not limited to this. If the display area of the second interface is not full-screen, the terminal device can display the second interface in a preset area of the screen. In order to improve the user experience, the preset effect can be displayed in areas other than the preset area. The area outside the area is a black scheme, which can improve the user experience.
示例性地,终端设备可以在屏幕的中间区域显示第二界面,在除预设区域之外的区域即中间区域的两边区域显示预设效果,例如上述图1中的b界面所示。For example, the terminal device can display the second interface in the middle area of the screen, and display the preset effect in areas other than the preset area, that is, areas on both sides of the middle area, such as shown in interface b in Figure 1 above.
可选地,方法还包括:若第一应用的第二标识为第二值,则将第二标识设置为第三值,第二值用于标识对第一界面的宽和高进行调整,第三值用于标识不对第一界面的宽和高进行调整。Optionally, the method further includes: if the second identifier of the first application is a second value, setting the second identifier to a third value, where the second value is used to identify adjustment of the width and height of the first interface, and The three values are used to indicate that the width and height of the first interface will not be adjusted.
第二标识用于表示是否对第一界面的宽和高进行调整。第二值可以为真(true)或者为“1”,本申请实施例对此不作限定。第三值可以为假(flase)或者为“0”,本申请实施例对此不作限定。在本申请实施例中,对第一界面的宽和高进行调整的方法是兼容模式。The second identifier is used to indicate whether to adjust the width and height of the first interface. The second value may be true or "1", which is not limited in the embodiment of the present application. The third value may be false or "0", which is not limited in the embodiment of the present application. In this embodiment of the present application, the method for adjusting the width and height of the first interface is compatibility mode.
若第二标识为第二值,可以说明第一应用自身请求对第一界面的宽和高进行调整,终端设备可以将第二标识设置为第三值,即不对第一界面的宽和高进行调整。该方法可以对应上述图4中的S405和S406,在第一应用不支持横屏显示,支持强制横屏,其支持比例显示的情况下,若使用兼容模式,或者说,第二标识为第二值,终端设备可以将第二标识设置为第三值,不执行兼容模式,或者说,跳过兼容模式。这样,有利于减少由于对第一界面的宽和高进行调整导致不能显示预设效果的概率。If the second identifier is the second value, it can mean that the first application itself requests to adjust the width and height of the first interface. The terminal device can set the second identifier to the third value, that is, the width and height of the first interface are not adjusted. Adjustment. This method can correspond to S405 and S406 in Figure 4 above. When the first application does not support horizontal screen display, supports forced horizontal screen, and supports proportional display, if the compatibility mode is used, or in other words, the second identification is the second value, the terminal device may set the second identifier to the third value and not execute the compatibility mode, or in other words, skip the compatibility mode. In this way, it is helpful to reduce the probability that the preset effect cannot be displayed due to the adjustment of the width and height of the first interface.
可选地,若判断第一应用的bounds被修改,根据显示相关信息横屏显示第一应用的第二界面,包括:若判断第一应用的bounds被修改,且第二界面的显示区域是全屏显示,则根据显示相关信息横屏显示第一应用的第二界面;其中,第二界面的显示区域信息包括第二界面的宽和高,第二界面的宽等于第一界面的高,第二界面的高等于第一界面的宽。Optionally, if it is determined that the bounds of the first application has been modified, display the second interface of the first application horizontally according to the display related information, including: if it is determined that the bounds of the first application has been modified, and the display area of the second interface is full screen display, the second interface of the first application is displayed horizontally according to the display-related information; wherein, the display area information of the second interface includes the width and height of the second interface, the width of the second interface is equal to the height of the first interface, and the second interface is equal to the height of the first interface. The height of the interface is equal to the width of the first interface.
若第一应用的bounds被修改,且第二界面的显示区域是全屏显示,可以说明终端设备可以强制横屏显示第二界面,且第二界面占用整个终端设备的屏幕。终端设备可以按照第二界面的宽和高横屏显示第二界面。If the bounds of the first application is modified and the display area of the second interface is displayed in full screen, it can be explained that the terminal device can force the second interface to be displayed horizontally, and the second interface occupies the entire screen of the terminal device. The terminal device may display the second interface horizontally according to the width and height of the second interface.
这样,终端设备在第一应用的bounds被修改,且第二界面的显示区域是全屏显示的情况下,横屏显示第二界面,有利于合理地显示第二界面。In this way, when the bounds of the first application is modified and the display area of the second interface is displayed in full screen, the terminal device displays the second interface horizontally, which is conducive to reasonable display of the second interface.
可选地,方法还包括:若在预设应用名单中第一应用对应的显示模式不是全屏显示,则判断第二界面的显示区域不是全屏显示;或者,若在预设应用名单中第一应用对应的显示模式是全屏显示,则判断第二界面的显示区域是全屏显示。Optionally, the method further includes: if the display mode corresponding to the first application in the preset application list is not full-screen display, determining that the display area of the second interface is not full-screen display; or, if the display mode of the first application in the preset application list is not full-screen display. If the corresponding display mode is full-screen display, it is determined that the display area of the second interface is full-screen display.
预设应用名单中包括的应用均可以进行横屏显示,预设应用名单中的应用还对应显示模式,显示模式为全屏显示或者不是全屏显示(或者说比例显示)。第一应用在预设应用名单中,若在预设应用名单中第一应用对应的显示模式不是全屏显示,则判断第二界面的显示区域不是全屏显示。若在预设应用名单中第一应用对应的显示模式是全屏显示,则判断第二界面的显示区域是全屏显示。The applications included in the preset application list can all be displayed in horizontal screen. The applications in the preset application list also correspond to the display mode, and the display mode is full screen display or not full screen display (or proportional display). The first application is in the default application list. If the display mode corresponding to the first application in the default application list is not full-screen display, it is determined that the display area of the second interface is not full-screen display. If the display mode corresponding to the first application in the default application list is full-screen display, it is determined that the display area of the second interface is full-screen display.
这样,终端设备从预设应用名单中便可确定第二界面的显示模式,以便于后续根据确定的显示模式横屏显示第二界面。In this way, the terminal device can determine the display mode of the second interface from the preset application list, so as to subsequently display the second interface horizontally according to the determined display mode.
可选地,计算将第一界面横屏显示时所需的显示相关信息,包括:调用applyAspectRatio()接口计算显示相关信息。该步骤可以对应上述图5中的S504,此处不再赘述。Optionally, calculating the display-related information required when displaying the first interface horizontally includes: calling the applyAspectRatio() interface to calculate the display-related information. This step may correspond to S504 in Figure 5 above, and will not be described again here.
可选地,方法还包括:竖屏显示第二应用的第三界面,第二应用的第一标识为第四值,第四值用于标识第二应用支持横屏显示;当终端设备从竖屏状态切换到横屏状态时,横屏显示第二应用的第四界面。Optionally, the method further includes: displaying the third interface of the second application in vertical screen, and the first identification of the second application is a fourth value, and the fourth value is used to identify that the second application supports horizontal screen display; when the terminal device changes from vertical screen to vertical screen When the screen state is switched to the horizontal screen state, the fourth interface of the second application is displayed in the horizontal screen.
第二应用与第一应用不同。第二应用的第一标识为第四值,用于表示第二应用支持横屏显示。在一种示例中,第四值可以为真(true)或者“1”,本申请实施例对此不作限定。第二应用支持横屏显示取决于应用本身。The second application is different from the first application. The first identifier of the second application is a fourth value, which is used to indicate that the second application supports horizontal screen display. In an example, the fourth value may be true or "1", which is not limited in this embodiment of the present application. The second application's support for landscape display depends on the application itself.
这样,本申请实施例可以对支持横屏显示的第二应用,在终端设备从竖屏状态切换到横屏状态的情况下,横屏显示第二应用的界面,还可以对不支持横屏显示的第一应用,若第一应用在预设应用名单中,在终端设备从竖屏状态切换到横屏状态的情况下,终端设备可以横屏显示第一应用的界面,两种方法互不影响,有利于终端设备的稳定运行。In this way, the embodiments of the present application can display the interface of the second application in horizontal screen mode when the terminal device switches from the vertical screen state to the horizontal screen state, and can also display the interface of the second application in horizontal screen mode that does not support horizontal screen display. The first application, if the first application is in the preset application list, when the terminal device switches from the vertical screen state to the horizontal screen state, the terminal device can display the interface of the first application in the horizontal screen. The two methods do not affect each other. , which is conducive to the stable operation of terminal equipment.
上面已对本申请实施例的界面显示方法进行了说明,下面对本申请实施例提供的执行上述界面显示方法的装置进行描述。本领域技术人员可以理解,方法和装置可以相互结合和引用,本申请实施例提供的相关装置可以执行上述界面显示方法中的步骤。The interface display method of the embodiment of the present application has been described above. The device for executing the above interface display method provided by the embodiment of the present application will be described below. Those skilled in the art can understand that methods and devices can be combined and referenced with each other, and the relevant devices provided in the embodiments of the present application can perform the steps in the above interface display method.
为了实现上述功能,实现界面显示装置包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。In order to realize the above functions, the interface display device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that the method steps of each example described in conjunction with the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对实现界面显示方法的装置进行功能模块的划分,例如可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。Embodiments of the present application can divide the device that implements the interface display method into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. Integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.
如图8为本申请实施例提供的一种芯片的结构示意图。芯片80包括一个或两个以上(包括两个)处理器801、通信线路802、通信接口803和存储器804。Figure 8 is a schematic structural diagram of a chip provided by an embodiment of the present application. The chip 80 includes one or more (including two) processors 801, a communication line 802, a communication interface 803 and a memory 804.
在一些实施方式中,存储器804存储了如下的元素:可执行模块或者数据结构,或者他们的子集,或者他们的扩展集。In some embodiments, memory 804 stores the following elements: executable modules or data structures, or subsets thereof, or extensions thereof.
上述本申请实施例描述的方法可以应用于处理器801中,或者由处理器801实现。处理器801可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器801中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器801可以是通用处理器(例如,微处理器或常规处理器)、数字信号处理器(digitalsignal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门、晶体管逻辑器件或分立硬件组件,处理器801可以实现或者执行本申请实施例中的公开的各处理相关的方法、步骤及逻辑框图。The method described in the above embodiment of the present application can be applied to the processor 801 or implemented by the processor 801. The processor 801 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 801 . The above-mentioned processor 801 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array. (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components, the processor 801 can implement or execute the various processing-related methods, steps and disclosures disclosed in the embodiments of this application. Logic block diagram.
结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。其中,软件模块可以位于随机存储器、只读存储器、可编程只读存储器或带电可擦写可编程存储器(electricallyerasable programmable read only memory,EEPROM)等本领域成熟的存储介质中。该存储介质位于存储器804,处理器801读取存储器804中的信息,结合其硬件完成上述方法的步骤。The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a storage medium mature in this field such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 804. The processor 801 reads the information in the memory 804 and completes the steps of the above method in combination with its hardware.
处理器801、存储器804以及通信接口803之间可以通过通信线路802进行通信。The processor 801, the memory 804 and the communication interface 803 can communicate with each other through the communication line 802.
在上述实施例中,存储器存储的供处理器执行的指令可以以计算机程序产品的形式实现。其中,计算机程序产品可以是事先写入在存储器中,也可以是以软件形式下载并安装在存储器中。In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product. The computer program product may be written in the memory in advance, or may be downloaded and installed in the memory in the form of software.
本申请实施例还提供一种计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包括一个或多个可用介质集成的服务器、数据中心等数据存储设备。例如,可用介质可以包括磁性介质(例如,软盘、硬盘或磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。An embodiment of the present application also provides a computer program product including one or more computer instructions. When computer program instructions are loaded and executed on a computer, processes or functions according to embodiments of the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., computer instructions may be transmitted from a website, computer, server or data center via a wired link (e.g. Coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.) means to transmit to another website, computer, server or data center. The computer-readable storage medium can be Any available media that a computer can store or is a data storage device such as a server, data center, or other integrated server that includes one or more available media. For example, available media may include magnetic media (eg, floppy disks, hard disks, or tapes), optical media (eg, Digital versatile disc (digital versatile disc, DVD)), or semiconductor media (for example, solid state disk (solid state disk, SSD)), etc.
本申请实施例还提供一种计算机可读存储介质。上述实施例中描述的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。计算机可读介质可以包括计算机存储介质和通信介质,还可以包括任何可以将计算机程序从一个地方传送到另一个地方的介质。存储介质可以是可由计算机访问的任何目标介质。An embodiment of the present application also provides a computer-readable storage medium. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media and may include any medium that can transfer a computer program from one place to another. The storage media can be any target media that can be accessed by the computer.
作为一种可能的设计,计算机可读介质可以包括紧凑型光盘只读储存器(compactdisc read-only memory,CD-ROM)、RAM、ROM、EEPROM或其它光盘存储器;计算机可读介质可以包括磁盘存储器或其它磁盘存储设备。而且,任何连接线也可以被适当地称为计算机可读介质。例如,如果使用同轴电缆,光纤电缆,双绞线,DSL或无线技术(如红外,无线电和微波)从网站,服务器或其它远程源传输软件,则同轴电缆,光纤电缆,双绞线,DSL或诸如红外,无线电和微波之类的无线技术包括在介质的定义中。如本文所使用的磁盘和光盘包括光盘(CD),激光盘,光盘,数字通用光盘(digital versatile disc,DVD),软盘和蓝光盘,其中磁盘通常以磁性方式再现数据,而光盘利用激光光学地再现数据。As a possible design, the computer-readable medium may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer-readable medium may include magnetic disk storage or other disk storage device. Furthermore, any connection line is also properly termed a computer-readable medium. For example, if coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies (such as infrared, radio and microwave) are used to transmit the Software from a website, server or other remote source, then coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and optical disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while discs reproduce data optically using lasers. Reproduce data.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理单元以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine, such that the instructions executed by the processing unit of the computer or other programmable data processing device produce a A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310891320.XA CN117707661A (en) | 2023-07-19 | 2023-07-19 | Interface display method and related devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310891320.XA CN117707661A (en) | 2023-07-19 | 2023-07-19 | Interface display method and related devices |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117707661A true CN117707661A (en) | 2024-03-15 |
Family
ID=90148617
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310891320.XA Pending CN117707661A (en) | 2023-07-19 | 2023-07-19 | Interface display method and related devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117707661A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110244996A (en) * | 2019-05-14 | 2019-09-17 | 苏宁智能终端有限公司 | A kind of method, apparatus and terminal of transverse screen display terminal adaptation vertical screen application program |
CN113867661A (en) * | 2016-01-15 | 2021-12-31 | 华为技术有限公司 | Display method and terminal |
CN113994317A (en) * | 2019-06-19 | 2022-01-28 | 华为技术有限公司 | User interface layout method and electronic equipment |
CN114816602A (en) * | 2021-01-27 | 2022-07-29 | 华为技术有限公司 | Application display method, device, chip system, medium and program product |
CN116266206A (en) * | 2021-12-16 | 2023-06-20 | 北京字节跳动网络技术有限公司 | Page display method and device and electronic equipment |
WO2023109404A1 (en) * | 2021-12-15 | 2023-06-22 | 比亚迪股份有限公司 | Terminal display method and terminal display apparatus |
-
2023
- 2023-07-19 CN CN202310891320.XA patent/CN117707661A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113867661A (en) * | 2016-01-15 | 2021-12-31 | 华为技术有限公司 | Display method and terminal |
CN110244996A (en) * | 2019-05-14 | 2019-09-17 | 苏宁智能终端有限公司 | A kind of method, apparatus and terminal of transverse screen display terminal adaptation vertical screen application program |
CN113994317A (en) * | 2019-06-19 | 2022-01-28 | 华为技术有限公司 | User interface layout method and electronic equipment |
CN114816602A (en) * | 2021-01-27 | 2022-07-29 | 华为技术有限公司 | Application display method, device, chip system, medium and program product |
WO2023109404A1 (en) * | 2021-12-15 | 2023-06-22 | 比亚迪股份有限公司 | Terminal display method and terminal display apparatus |
CN116266206A (en) * | 2021-12-16 | 2023-06-20 | 北京字节跳动网络技术有限公司 | Page display method and device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
张德发,刘加海: "电子产品设计概论", 30 June 2015, 北京:海洋出版社, pages: 115 - 121 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101713177B1 (en) | System and method for virtual displays | |
CN112825232B (en) | Compensation method and electronic equipment | |
US11954787B2 (en) | Image rendering method in panoramic application and terminal device | |
WO2022242487A1 (en) | Display method and related device | |
US11503207B2 (en) | Display control method, display control device and computer-readable storage medium | |
US20170097807A1 (en) | Electronic device and method for controlling the same | |
WO2023005751A1 (en) | Rendering method and electronic device | |
WO2023179501A1 (en) | Interface display method and electronic device | |
CN119356512A (en) | Display control method, electronic device and storage medium | |
CN117707661A (en) | Interface display method and related devices | |
CN117055779B (en) | Application interface display method, terminal device and storage medium | |
CN111767016B (en) | Display processing method and device | |
CN118445472B (en) | Method for screening recommended content, related device and related medium | |
CN112783392A (en) | Information screen display method and device | |
CN116095230B (en) | Application program recommendation method, terminal device and readable storage medium | |
CN117724574A (en) | Display method, electronic device and computer readable storage medium | |
CN115033199B (en) | Mobile terminal and image display method thereof | |
CN118672570A (en) | Self-adaptive application page display method and device | |
CN114639358A (en) | Ink screen refreshing method, terminal device, storage medium and program product | |
WO2024016103A1 (en) | Image display method and apparatus | |
CN112667410A (en) | Cross-process communication method, terminal and computer readable storage medium | |
EP4538959A1 (en) | Image processing method and electronic device | |
WO2024099207A1 (en) | Display method, electronic device, and medium | |
EP4502789A1 (en) | Display method and electronic device | |
US20250025782A1 (en) | Electronic apparatus and method for controlling thereof |
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 | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Applicant after: Honor Terminal Co.,Ltd. Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Applicant before: Honor Device Co.,Ltd. Country or region before: China |
|
CB02 | Change of applicant information |