Page direction control method and electronic device
By overwriting the page direction of the second page in the electronic device as the direction when the first page is displayed, the problem of inconsistent directions during page switching is solved, the user experience is improved, and the continuity of the page direction is achieved.
Patent Information
- Application Number
- CN202410911099.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-07-09
AI Technical Summary
In electronic devices, the user experience is poor due to inconsistent page directions when switching pages, and the prior art is difficult to effectively avoid jumping in page directions.
By setting the page direction of the second page to the page direction when the first page is displayed, overwrite the initial page direction of the second page to ensure the consistency of the page direction and realize that the page does not occur when switching from the first page to the second page. The jump in direction.
It effectively avoids page direction jumps, improves user experience, and ensures continuity and consistency of page direction.
Smart Images

Figure CN118466808B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a page direction control method and an electronic device. Background Art
[0002] With the rapid development of network technology, the development of electronic product screen technology has also reached a new level in recent years, and users have higher and higher requirements for screen technology.
[0003] In order to facilitate users to operate and view electronic devices with display screens, currently electronic devices can provide an in-application split-screen display technology, which can realize dual-screen display of application content. In the current related technologies, when the page displayed on the screen switches from a first page displayed on dual screens based on the in-application split-screen display technology to a scenario where a single second page is displayed on the screen, the display direction of the page may jump, thereby affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a page direction control method and an electronic device, which are applied to the field of terminal technology to prevent the display direction of a page from jumping before and after page switching.
[0005] In a first aspect, an embodiment of the present application provides a method for controlling page direction. The method includes:
[0006] A first page is displayed, the first page includes a first subpage and a second subpage, both of which are pages of a first application. Then, in response to a first operation for triggering a page switch, a second page to be displayed is determined, the second page being a page of a second application.
[0007] And, the page orientation of the second page is set to the first orientation type, wherein the first orientation type is the page orientation of the first page when the first page is displayed, wherein the first orientation type can be any orientation type, which can be selected according to actual needs, and this embodiment does not limit this. Exemplarily, the first orientation type can be, for example, SCREEN_ORIENTATION_ SENSOR.
[0008] Then based on the first direction type, a second page is displayed.
[0009] In this way, when it is determined that the first application is configured with in-application split-screen display technology and the second application is not configured with in-application split-screen display technology, the page direction of the second page can be overwritten, so that the page direction used for the final display of the first page is the same as the page direction used for the final display of the second page, thereby achieving the problem of page direction jumping when switching from the first page to the second page.
[0010] In a possible implementation, setting the page direction of the second page to the first direction type includes:
[0011] Get the initial page direction of the second page;
[0012] In the case where the initial page orientation of the second page is of the second orientation type, overwriting the page orientation of the second page to be of the first orientation type;
[0013] The second direction type is used to indicate that the page continues to use the page direction of the previous page before switching.
[0014] In this implementation, when the initial page direction of the second page is SCREEN_ORIENTATION_BEHIND, the page direction of the second page is overwritten, thereby effectively increasing the necessity of overwriting the page direction of the second page.
[0015] In a possible implementation, the initial page orientation of the first page is a third orientation type, wherein the third orientation type may be any orientation type, which depends on the actual page configuration of the first page and may be selected according to actual needs, and this embodiment does not limit this, wherein the third orientation type may be different from the first orientation type, for example. Exemplarily, the first orientation type may be, for example, SCREEN_ORIENTATION_PORTRAIT.
[0016] Before displaying the first page, the method further includes:
[0017] The page orientation of the first page is overwritten to be a first orientation type.
[0018] In this implementation, it can be ensured that the page direction used when displaying the first page is the first direction type, thereby ensuring the correctness of the subsequent overwriting of the page direction of the second page to the first direction type. Accordingly, when switching from the first page to display the second page, the page direction will not jump.
[0019] In a possible implementation, overwriting the page direction of the second page to the first direction type includes:
[0020] When the first page and / or the second page meets the first condition, the page direction of the second page is overwritten to be the first direction type.
[0021] In this implementation, by configuring the first condition, the page direction is overwritten only when it is determined that the page meets the first condition, thereby effectively improving the processing flexibility of the page direction overwrite.
[0022] In a possible implementation, the first condition includes: the page direction of the second page is a second direction type;
[0023] The first condition also includes: the activity corresponding to the second page is not empty, and / or the first page has not applied for visibility.
[0024] In this implementation, by setting the first condition to include that the page direction of the second page is the second direction type, the necessity of overriding the page direction of the second page can be improved. And by setting the first condition to include that the activity corresponding to the second page is not empty, and / or that the visibility of the first page is not applied, the effectiveness and necessity of overriding the direction of the second page can be improved.
[0025] In a possible implementation, the first condition also includes: the first field is a first value, and the first value is used to indicate that the page is in the process of playing an animation switching from the first page to the second page.
[0026] In this implementation, the page direction of the second page can be overwritten during the motion effect playback process, so that during and after the motion effect playback, the page direction of the second page can be effectively overwritten to the preset direction type, avoiding the page direction jump caused by the display direction of the second page being different from that of the first page during the motion effect playback.
[0027] In a possible implementation, the electronic device includes a direction setting unit and an activity recording unit, and the activity recording unit is used to record activity information of an activity corresponding to at least one page;
[0028] Set the page orientation of the second page to the first orientation type, including:
[0029] The direction setting unit calls a first function to determine whether the first page and / or the second page meets a first condition, wherein the first function may be, for example, a checkMagicOrientation() function.
[0030] When it is determined that the first condition is met, the direction setting unit may overwrite the page direction of the second page to the first direction type, and then the direction setting unit returns a determination result to the activity recording unit, where the determination result is used to indicate that the page direction of the second page is overwritten to the first direction type.
[0031] In this way, through the interaction of the software units of the framework layer, the page direction of the second page can be effectively overwritten.
[0032] In a possible implementation, the method further includes:
[0033] The activity recording unit obtains the initial page direction of the second page;
[0034] The activity recording unit sends the initial page direction of the second page to the direction setting unit, so that the direction setting unit can effectively determine whether the relevant information of the second page meets the first condition.
[0035] In a possible implementation, the method further includes:
[0036] In the case where the activity corresponding to the second page is recorded in the activity recording unit, the activity recording unit sends first indication information to the direction setting unit, where the first indication information is used to indicate that the activity corresponding to the second page is not empty; and / or,
[0037] In the case that the visibility of the first page is not applied for, the activity recording unit sends second indication information to the direction setting unit, where the second indication information is used to indicate that the visibility of the first page is not applied for.
[0038] The activity recording unit sends the first indication information and / or the second indication information to the direction setting unit, so that the direction setting unit can effectively determine whether the relevant information of the first page and / or the second page meets the first condition.
[0039] In a possible implementation, the electronic device further includes a content display unit;
[0040] Based on the first direction type, a second page is displayed, including:
[0041] The display content unit receives the page direction of the second page sent by the activity recording unit;
[0042] The display content unit displays a second page based on the first direction type.
[0043] In this way, the second page can be effectively displayed based on the first direction type.
[0044] In a second aspect, an embodiment of the present application provides a page direction control device, which may be an electronic device, or a chip or chip system in an electronic device. The page direction control device may include a display unit and a processing unit.
[0045] When the page direction control device is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements a page direction control method described in the first aspect or any possible implementation of the first aspect.
[0046] When the page direction control device is an electronic device, the processing unit may be a processor. The page direction control device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit to enable the electronic device to implement a page direction control method described in the first aspect or any possible implementation of the first aspect.
[0047] When the page direction control device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes instructions stored in the storage unit so that the electronic device implements a page direction control method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit in the chip (e.g., a register, a cache, etc.), or a storage unit in the electronic device located outside the chip (e.g., a read-only memory, a random access memory, etc.).
[0048] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0049] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0050] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0051] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0052] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (such as a read-only memory, a random access memory, etc.).
[0053] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a split-screen display interface provided in an embodiment of the present application;
[0055] Figure 2 Schematic diagram of page switching provided in the embodiment of the present application Figure 1 ;
[0056] Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application;
[0058] Figure 5 Signaling interaction of the page direction control method provided in the embodiment of the present application Figure 1 ;
[0059] Figure 6 Signaling interaction of the page direction control method provided in the embodiment of the present application Figure 2 ;
[0060] Figure 7 Schematic diagram of page switching provided in the embodiment of the present application Figure 2 ;
[0061] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0063] 1. Activity
[0064] Activity is the basic component of an application in the Android system. Usually, an Activity represents a separate page of an application. An application can contain multiple Activities, and each Activity usually contains a user interface that can interact with the user.
[0065] 2. Page
[0066] A page usually refers to the specific interface or screen that a user sees in an application. It can be understood as a part of an Activity or a representation of an Activity.
[0067] 3. The relationship between Activity and Page
[0068] Among them, the relationship between the page and the Activity is that the page is attached to the Activity, and the Activity manages the life cycle and behavior of the page.
[0069] For example, it can be understood that Activity is a container for a page, where Activity is used to manage the creation, display, and destruction of the page. When the user navigates to a new Activity, the current Activity will be paused or destroyed, and the new Activity will be created and displayed.
[0070] As well, you can understand that a page is part of an Activity, and all views on the page (such as buttons, text boxes) are managed by the Activity. The layout and interface logic of the page are usually defined in the Activity's layout file (XML) and code.
[0071] 3. Page orientation
[0072] For each Activity, you can set its direction attribute to set the page direction. That is, when the page is displayed later, the page direction will be determined according to the direction attribute of the activity corresponding to the page, and the page will be displayed according to the corresponding page direction.
[0073] The direction attribute may include the following options:
[0074] SCREEN_ORIENTATION_UNSPECIFIED: The default value, the system determines the screen orientation based on the device's sensors and the user's settings.
[0075] SCREEN_ORIENTATION_LANDSCAPE: Force landscape mode.
[0076] SCREEN_ORIENTATION_PORTRAIT: Forces the screen to be in portrait mode.
[0077] SCREEN_ORIENTATION_SENSOR: Automatically switch screen orientation based on the device's sensors.
[0078] SCREEN_ORIENTATION_BEHIND: Inherits the screen orientation of the previous Activity. For example, if the screen orientation of the previous Activity is landscape mode, the current Activity will automatically be set to landscape mode. For another example, if the screen orientation of the previous Activity is portrait mode, the current Activity will automatically be set to portrait mode.
[0079] SCREEN_ORIENTATION_REVERSE_LANDSCAPE: Force reverse landscape mode.
[0080] SCREEN_ORIENTATION_REVERSE_PORTRAIT: Force reverse portrait mode.
[0081] SCREEN_ORIENTATION_SENSOR_LANDSCAPE: Automatically switch to landscape or reverse landscape based on the sensor.
[0082] SCREEN_ORIENTATION_SENSOR_PORTRAIT: Automatically switch to portrait or reverse portrait based on the sensor.
[0083] SCREEN_ORIENTATION_USER: The user's current preferred orientation.
[0084] SCREEN_ORIENTATION_LOCKED: Lock to the current screen orientation.
[0085] The screen orientation and page orientation described above can be understood as the same concept, or can be understood as related concepts. In one implementation, when the screen orientation is in landscape mode, the corresponding page orientation is landscape, that is, the page will be displayed in landscape mode. When the screen orientation is in portrait mode, the corresponding page orientation is portrait, that is, the page will be displayed in portrait mode.
[0086] It can be understood that in landscape mode, the width of the screen is greater than the height. And in portrait mode, the height of the screen is greater than the width. Accordingly, the page orientation of landscape can be understood as that in landscape mode, the content of the page is displayed in the normal direction (that is, the content directly seen by the user is normal, without tilt). And the page orientation of portrait can be understood as that in portrait mode, the content of the page is displayed in the normal direction.
[0087] The above lists several possible options of the direction attribute. In the actual implementation process, the options of the direction attribute may include more content, which will not be listed here one by one.
[0088] 4. Other terms
[0089] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0090] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0091] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0092] 5. Electronic equipment
[0093] The electronic device of the embodiment of the present application may include a handheld device with a display function, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (public landmobile networks). The embodiments of the present application do not limit this.
[0094] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0095] In addition, in the embodiments of the present application, the electronic device may also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0096] The electronic device in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0097] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0098] Based on the above introduction, the relevant technologies involved in this application are further introduced in detail below.
[0099] With the rapid development of network technology, smart terminal devices such as smartphones and tablet computers are becoming more and more popular, bringing great convenience to people's life, study and work. In recent years, the development of electronic product screen technology has also reached a new level, and users have higher and higher requirements for screen technology.
[0100] In order to facilitate users to operate and view electronic devices with display screens, currently electronic devices can provide a technology for split-screen display within an application, which can realize dual-screen display of application content. For example, the technology for split-screen display within an application can support the simultaneous display of two pages of the same application on the screen, such as displaying the application homepage and content page at the same time, or displaying two different content pages at the same time, so that users can use one screen for two purposes, thereby improving the user experience.
[0101] Let's take a tablet computer as an example. First, Figure 1 This article explains the technology of split-screen display within the application. Figure 1 A schematic diagram of a split-screen display interface provided in an embodiment of the present application.
[0102] like Figure 1 As shown in (a) in the figure, multiple application icons can be displayed on the desktop of the electronic device. For example, the icons of application A, application B, application C, and application D are shown in the figure, and the names of the applications are also displayed below these icons. This embodiment does not limit the application icons, names, and specific display methods on the desktop, which can be set according to actual needs.
[0103] Afterwards, if the screen of the electronic device detects a touch operation on an icon of an application, the electronic device can display the page of the application on the screen. The following takes application A as an example. In one implementation, if the in-application split-screen display technology is configured for application A, then after opening application A, for example, the following page can be displayed. Figure 1 The interface shown in (b).
[0104] Reference Figure 1 It can be determined from (b) that two pages are displayed simultaneously in the interface, namely page 101 and page 102, where both page 101 and page 102 are pages of application A. For example, page 101 can be understood as the homepage of application A, and page 102 can be understood as a content page of application A. This embodiment does not limit the specific page content.
[0105] Among them, page 101 and page 102 can be understood as two independent pages. For example, the user can perform corresponding interactive operations on page 101, and page 101 can display corresponding content in response to the user operation, and page 102 is not affected. Alternatively, the user can also perform corresponding interactive operations on page 102, and page 102 can display corresponding content in response to the user operation, and page 101 is not affected.
[0106] In this way, by simultaneously displaying multiple pages of the same application in one interface, screen utilization can be improved, thereby improving user experience.
[0107] And referring to the above introduction, it can be determined that when the in-application split-screen display technology is configured for an application, after the application is opened, two pages of the application can be displayed simultaneously in the interface. Conversely, if the in-application split-screen display technology is not configured for the application, then after the application is opened, one page of the application is displayed in a traditional manner.
[0108] In one implementation, for example, whether to configure the in-application split-screen display technology for an application can be set in the "System Settings" application. Alternatively, whether to configure the in-application split-screen display technology for an application can be set in other ways, for example, by setting an application list, in which a plurality of applications configured with the in-application split display technology are recorded. This embodiment does not limit the specific implementation of whether an application configures the in-application split-screen display technology, and it can be selected according to actual needs.
[0109] Based on the above introduction, the following will explain the implementation of the page direction of the application configured with the in-application split-screen display technology. And here we need to emphasize a concept that the page direction is determined according to the direction attribute of the Activity corresponding to the page, which can be the forced horizontal screen, forced vertical screen, or determined by the sensor, etc. However, there are only two directions for displaying the page (or the display direction of the page), horizontal screen display or vertical screen display.
[0110] In one implementation, since the screens of most current electronic devices have the following characteristics: in landscape mode, the width of the screen is greater than the height; in portrait mode, the height of the screen is greater than the width. It can be understood that for the scenario of simultaneously displaying multiple pages of the same application in one interface, the performance effect of displaying two pages in landscape mode is better.
[0111] For example, for an application configured with the in-application split-screen display technology, the display direction of the page contained in the application can be set to landscape display. For example, the orientation attribute of the Activity contained in the application can be set to SCREEN_ORIENTATION_LANDSCAPE, thereby setting the display direction of the page to landscape display.
[0112] In another implementation, when the display direction of a page of an electronic device can be adaptively changed along with the rotation of the electronic device, the flexibility and adaptability of the display direction of the page can be effectively improved, and the user experience can be improved accordingly.
[0113] Therefore, for example, for an application configured with in-application split-screen display technology, the display direction of the page contained in the application can be set to automatically switch according to the sensor. For example, the direction attribute of the Activity contained in the application can be set to SCREEN_ORIENTATION_SENSOR, so that the display direction of the page can be set to automatically switch according to the sensor.
[0114] In the actual implementation process, how to set the page direction of the application configured with the in-app split-screen display technology can be selected according to actual needs. However, using a fixed configuration direction attribute to indicate the page direction of the application configured with the in-app split-screen display technology has the following two defects or obstacles.
[0115] First, for an application, the user can set whether to configure the in-application split-screen display technology for the application according to actual needs. If a fixed configuration direction attribute is used to indicate the page direction of the application, when the in-application split-screen display technology is configured for the application, it is assumed that the page display requirements of the split-screen display scenario described above can be effectively met.
[0116] However, if you later cancel the in-app split-screen display technology for an application, a single page of the application will be displayed in the interface. At the same time, because a fixed configuration direction attribute is used to indicate the page direction of the application, a single page of the application can only be displayed in the page direction indicated by the direction attribute (for example, forced landscape). For some applications, the effect of displaying a single page in the page direction indicated by certain direction attributes may not be good.
[0117] Secondly, for applications developed by electronic device manufacturers, the electronic device manufacturers can set the page direction of the application according to actual needs. However, for third-party applications, the page direction of the application is configured by the third-party manufacturer, and the electronic device cannot use a fixed configuration direction attribute to indicate the page direction of the application.
[0118] Based on the two reasons described above, for an application configured with the in-application split-screen display technology, it is not feasible to set the page direction of the pages contained in the application to a certain preset page direction. The preset page direction here can be a forced horizontal screen, or can be automatically switched according to a sensor, or can be any other page direction. This embodiment does not limit this, and it can be set according to the page display expectations of the application configured with the in-application split-screen display technology.
[0119] Then, in order to ensure that the page direction can be effectively set to the preset page direction for an application configured with the in-application split-screen display technology, the following technical solution is proposed: an additional step is added to the page direction processing flow of the electronic device, and the step is used to detect whether the application corresponding to the page to be displayed is configured with the in-application split-screen display technology. If the technology is configured, the page direction of the page to be displayed can be overridden (or modified). Exemplarily, for example, the page direction of the page to be displayed can be overridden from the initial page direction (which may be any page direction) to the preset page direction, so that the page of the application configured with the in-application split-screen display technology can be displayed according to the preset page direction, thereby obtaining a page display effect that meets expectations.
[0120] However, after introducing the above technical solution, the applicant found that the display direction of the page would jump in a certain scenario, resulting in a poor user experience. Figure 1 and Figure 2 This scenario is introduced. Figure 2 Schematic diagram of page switching provided in the embodiment of the present application Figure 1 .
[0121] Reference Figure 1 As shown in (b), page 102 can be understood as a content page of application A, for example, in which a collection control (star shape), a like control (heart shape) and a share control (bent arrow shape) can be set.
[0122] For example, assuming that the electronic device detects a touch operation on the sharing control through the screen, for example, in response to the touch operation, the following information may be displayed on page 102: Figure 2 The sharing window 201 shown in (c) in FIG. Figure 2 It can be determined that the sharing window 201 includes controls of multiple applications.
[0123] Afterwards, assuming that the electronic device detects a touch operation on the control of the application B in the sharing window 201, in response to the touch operation, the electronic device can switch to display the following Figure 2 The sharing page 202 shown in (d) in FIG. 2 is a page of application B, such as Figure 2 As shown in (d) in the figure, in the sharing page 202, the user can choose to share the content page corresponding to the page 201 with himself, or with colleagues or groups. Here, "self" and "colleagues or groups" refer to the user's account in application B, list friends and joined groups.
[0124] Also refer to Figure 2It can be understood that when the page of application A is displayed in the interface, page 101 and page 102 are displayed in horizontal screen. When the page of application B is switched to be displayed, the shared page 201 is changed to be displayed in vertical screen, which results in the page switching from horizontal screen display to vertical screen display when switching from the page of application A to the page of application B.
[0125] And, suppose that the electronic device then switches from the page of application B to the page of application A in response to the user operation. The method for determining the page direction of application A is the same as described above, so when switching from the page of application B to the page of application A, the page will switch from vertical screen display to horizontal screen display.
[0126] The change in the display direction of the page may be caused by the following reasons:
[0127] The initial page mode of application A is SCREEN_ORIENTATION_PORTRAIT, and the page orientation of application A is overwritten with a preset page orientation, for example, the preset page orientation is SCREEN_ORIENTATION_SENSOR. Assuming that the current sensor detects that the user holds the electronic device in a manner that the width of the screen is greater than the height, the page of application A can be displayed in landscape mode.
[0128] At the same time, the page orientation of application B is SCREEN_ORIENTATION_BEHIND, so it can be understood that the page orientation of shared page 202 is actually inherited from the page orientation of page 102 and page 102. And, although the page orientation of page 102 and page 102 is overwritten to SCREEN_ORIENTATION_SENSOR, the initial page orientation recorded in the orientation attribute of page 102 and the activity corresponding to page 102 does not change, and is still SCREEN_ORIENTATION_PORTRAIT.
[0129] When inheriting the page orientation, the inheritance is performed based on the initial page orientation recorded in the orientation attribute of the Activity corresponding to the page. Therefore, the shared page 202 will inherit the orientation page as SCREEN_ORIENTATION_PORTRAIT, and then the display orientation of the page is set according to the orientation attribute of SCREEN_ORIENTATION_PORTRAIT, resulting in the shared page 202 being displayed in portrait mode. Correspondingly, the page switches from landscape mode to portrait mode.
[0130] Afterwards, when the electronic device switches back from the page of application B to the page of application A, the page of application A will be overwritten to the preset page orientation based on the overwrite processing method introduced above, so that the page of application A is displayed in landscape mode. Correspondingly, the page switches from portrait mode to landscape mode.
[0131] In the scenario described above, when the page of application A switches to the page of application B, the page switches from landscape to portrait. Afterwards, if the user ends the operation on the page of application B and switches back to the page of application A, the page switches from portrait to landscape again. It is understandable that the change in the display direction of the page will lead to a poor user experience.
[0132] Furthermore, there is another possible scenario: when the page of application A switches to the page of application B, the page switches from portrait to landscape. Afterwards, assuming that the user ends the operation on the page of application B and switches back to the page of application A, the page switches from landscape to portrait again. The following is an analysis of the reasons that may cause this situation:
[0133] The initial page mode of application A is SCREEN_ORIENTATION_LANDSCAPE, and the page orientation of application A is overwritten with a preset page orientation, for example, the preset page orientation is SCREEN_ORIENTATION_ SENSOR. Assuming that the current sensor detects that the user holds the electronic device in a way that the height of the screen is greater than the width, the page of application A can be displayed in portrait mode.
[0134] At the same time, the page orientation of application B is SCREEN_ORIENTATION_BEHIND, so it can be understood that the page orientation of shared page 202 is actually inherited from the page orientation of page 102 and page 102. And, although the page orientation of page 102 and page 102 is overwritten to SCREEN_ORIENTATION_SENSOR, the initial page orientation recorded in the orientation attribute of page 102 and the activity corresponding to page 102 does not change, and is still SCREEN_ORIENTATION_LANDSCAPE.
[0135] When inheriting the page direction, the inheritance is performed based on the initial page direction recorded in the direction attribute of the Activity corresponding to the page. Therefore, the shared page 202 will inherit the direction page as SCREEN_ORIENTATION_LANDSCAPE, and then the display direction of the page is set according to the direction attribute of SCREEN_ORIENTATION_LANDSCAPE, resulting in the shared page 202 becoming a vertical screen display, and accordingly the page switches from vertical screen display to horizontal screen display.
[0136] Afterwards, when the electronic device switches back from the page of application B to the page of application A, the page of application A will be overwritten to the preset page orientation based on the overwrite processing method introduced above, so that the page of application A is displayed in portrait mode. Correspondingly, the page switches from landscape display to portrait display.
[0137] In the scenario described above, when the page of application A switches to the page of application B, the page switches from portrait to landscape. Afterwards, if the user ends the operation on the page of application B and switches back to the page of application A, the page switches from landscape to portrait again. It is understandable that the change in the display direction of the page will lead to a poor user experience.
[0138] For the two scenarios introduced above, it can be understood that there may be other settings of the direction attributes that may cause the above situation to occur. The other possible setting combinations of the direction attributes are not listed here, and they can be arbitrarily expanded according to actual needs. In short, when the setting of the direction attribute corresponding to the first application before the page switch and the setting of the direction attribute corresponding to the second application after the page switch are inappropriate, the display direction of the page displayed by the electronic device will change when the page is switched from the page of the first application to the page of the second application. When the display direction of the page changes frequently, it will lead to a poor user experience.
[0139] In addition, for the case where the orientation attribute corresponding to the page displayed after switching is SCREEN_ORIENTATION_BEHIND, the original intention of setting the orientation attribute to SCREEN_ORIENTATION_BEHIND is to keep the display orientation of the page consistent with the previous page before switching, and not to change the display orientation of the page. However, in the above scenario, the display orientation of the page still changes, resulting in the display orientation of the page after switching deviating from expectations.
[0140] An analysis of the above problem shows that the reason for the above problem is that the page before the switch belongs to an application that is equipped with in-app split-screen display technology. For the page direction of such applications, the electronic device has added an additional page direction overwrite step, which results in the display direction of the page of such applications not being consistent with the initial page direction set in the direction attribute corresponding to the page. The page direction of the page after the switch is set to SCREEN_ORIENTATION_BEHIND, which will inherit the initial page direction of the page before the switch. Accordingly, the display direction of the page after the switch will be different from that of the page before the switch, resulting in a jump in the display direction of the page.
[0141] Based on this, the present application proposes the following technical concept: as long as the page direction after switching is the same as the page direction before switching, the display direction of the two pages before and after switching can be consistent, thereby avoiding the problem of page display direction jump. The above problem occurs because the page direction before switching has been overwritten, resulting in the page direction inherited by the page after switching being different from the actual page direction of the page before switching. Therefore, as long as the page direction after switching is also overwritten in the same way, the page direction after switching can be the same as the page direction before switching, thereby avoiding the problem of page display direction jump.
[0142] Based on the above introduction, the page direction control method proposed in this application is described in detail in combination with specific embodiments. The technical solution provided in this application can be applied to terminal devices, and the terminal devices are first briefly introduced below.
[0143] For example, Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application.
[0144] 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, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0145] The processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors. A memory may also be provided in the processor 110 for storing instructions and data. In one implementation, the CPU may be used to undertake the logic judgment and data processing in the page direction control method introduced in this application.
[0146] The terminal device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. In one implementation, in the page direction control method provided in the embodiment of the present application, the GPU may be responsible for rendering the page content to be displayed.
[0147] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1. The display screen may be used to display page content of each application. The CPU may also detect user operations based on the display screen, and then perform corresponding data processing in response to the user operations.
[0148] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0149] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes a layered architecture system as an example to exemplify the software structure of the terminal device.
[0150] For example, Figure 4 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application.
[0151] like Figure 4 As shown, the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through interfaces. In some embodiments, the system may include an application layer, an application framework layer, a system library, a hardware abstraction layer (HAL), and a kernel layer.
[0152] It should be noted that the embodiments of the present application are illustrated using the Android system as an example. In other operating systems (such as Hongmeng system, IOS system, etc.), the solutions of the present application can also be implemented as long as the functions implemented by each functional module are similar to those of the embodiments of the present application.
[0153] Among them, the application layer may include a series of application packages, and the icons corresponding to the application packages will be displayed on the screen. This application does not impose any special restrictions on the applications included in the application layer.
[0154] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. Figure 4 As shown, the application framework layer includes some predefined functions, such as an activity startup unit, a window management service unit, a policy management unit, a window container unit, a display content unit, an activity recording unit, and a direction setting unit.
[0155] The page direction control method provided in the present application can be processed by these units through data interaction, for example. The specific functions of these units will be introduced in conjunction with specific embodiments below and will not be introduced here for the time being.
[0156] Furthermore, the system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0157] In addition, the hardware abstraction layer is used to abstract the hardware, implement the encapsulation of the Linux kernel driver, provide an interface upward, and shield the implementation details of the low-level hardware.
[0158] And, the kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, charging driver, etc.
[0159] Based on the above introduction, the following first combines Figure 5 The following describes the process of handling the page direction of the switched page without overwriting. Figure 5 Signaling interaction of the page direction control method provided in the embodiment of the present application Figure 1 .
[0160] like Figure 5 As shown, the processing flow includes:
[0161] 1. The activity initiation unit receives the execution instruction.
[0162] In one implementation, when an electronic device needs to switch from displaying a page of a first application to displaying a page of a second application, the second application can, for example, send an execution instruction to an activity startup unit, where the execution instruction is used to instruct the activity startup unit to create a corresponding Activity to prepare for subsequent page display.
[0163] Based on the above introduction, it can be determined that each unit set in the application framework layer can be a predefined function. Then illustratively, the activity starter unit introduced here can be understood as a function class, and the activity starter unit can be expressed as Activity starter (which can be understood as a class name).
[0164] And, the second application can, for example, send an execution instruction to the activity starter unit by calling the execute() function under the Activity starter class. The function is used to trigger the creation of the corresponding Activity, and then perform page management with the currently created Activity as the object in the subsequent process. The specific class name and function name can also be arbitrarily set according to actual needs, and this embodiment does not limit this.
[0165] 2. The activity startup unit sends a window adding instruction to the window management service unit.
[0166] After the activity startup unit creates the corresponding Activity, in order to realize the page display on the screen, it is usually necessary to perform the operation of adding a window, where the window can be understood as a component for displaying the page. Therefore, the activity startup unit can, for example, send a window adding instruction to the window management service unit. The window adding instruction is used to instruct the window management service unit to create a corresponding window for subsequent display of the page.
[0167] Similar to the above introduction, the window management service unit introduced here can be understood as a function class, and the window management service unit can be expressed as Window Manager Service (which can be understood as a class name).
[0168] And, the activity initiation unit can, for example, send a window adding instruction to the window management service unit by calling the addWindow() function under the Window Manager Service class. The function is used to trigger the creation of the corresponding window, and then realize the page display based on the currently created window in the subsequent process. The specific class name and function name can also be arbitrarily set according to actual needs, and this embodiment does not limit this.
[0169] 3. The window management service unit sends a direction setting instruction to the window container unit.
[0170] Furthermore, after creating the corresponding window, it is usually necessary to set the direction of the window so that the content in the window is displayed in the corresponding direction. Therefore, the window management service unit can, for example, send a direction setting instruction to the window container unit. The direction setting instruction is used to instruct the window container unit to set the window direction.
[0171] Similar to the above introduction, the window container unit introduced here can be understood as a function class, and the window container unit can be expressed as Window Container (which can be understood as a class name).
[0172] And, the activity start unit can, for example, send an orientation setting instruction to the window container unit by calling the SetOrientation() function under the Window Container class. The function is used to trigger the setting of the window orientation, and then realize the page display based on the currently set window orientation in the subsequent process. The specific class name and function name can also be set arbitrarily according to actual needs, and this embodiment does not limit this.
[0173] 4. The window container unit sends a direction update instruction to the display content unit.
[0174] Furthermore, after the window direction of the created window is set based on the window container unit, the direction of the content displayed in the window needs to be set, wherein the content displayed in the window can be understood as a page, for example. In one implementation, the window direction and the direction of the content displayed in the window (which can be understood as a page direction, for example) can be independent of each other, that is, the window direction and the page direction can be set separately.
[0175] The following is an introduction taking the case where the content displayed in the window is a page. In order to set the page direction of the page displayed in the window, the window container unit can, for example, send a direction update instruction to the real content unit, wherein the direction update instruction is used to indicate an update to the page direction so that the page is displayed accordingly according to the updated page direction.
[0176] Similar to the above introduction, the display content unit introduced here can be understood as a function class, for example, and the display content unit can be expressed as Display Content (which can be understood as a class name).
[0177] And, the window container unit can, for example, send an orientation update instruction to the display content unit by calling the updateOrientation() function under the Display Content class. The function is used to trigger the update of the page orientation of the page displayed in the window, and then realize the page display based on the updated page orientation in the subsequent process. The specific class name and function name can also be arbitrarily set according to actual needs, and this embodiment does not limit this.
[0178] 5. Display content unit to obtain page direction.
[0179] After the display content unit receives the direction update instruction, the display content unit can, for example, respond to the direction update instruction to obtain the page direction to be set for the page to be displayed. The subsequent steps 5 to 12 can be understood as steps performed to obtain the page direction to be set.
[0180] In one implementation, the display content unit can obtain the page orientation to be set by, for example, calling the getOrientation() function under the Display Content class. However, it is understandable that calling this function at this time will not temporarily obtain the page orientation to be set, and it needs to be processed in subsequent steps to obtain the result of the page orientation to be set. The specific function name for triggering the acquisition of the page orientation can also be arbitrarily set according to actual needs, and this embodiment does not limit this.
[0181] 6. The display content unit sends a direction acquisition instruction to the window container unit.
[0182] In order to obtain the page direction to be set, the display content unit may further send a direction obtaining instruction to the window container unit. The meaning of the direction obtaining instruction is similar to that described in the above step 5 and will not be repeated here.
[0183] In one implementation, the display content unit can send a direction acquisition instruction to the window container unit by calling the getOrientation() function under the Window Container class. It is also understandable that calling this function at this time still does not temporarily obtain the page direction to be set, and it still needs to be processed in subsequent steps to obtain the result of the page direction to be set. The specific function name used to trigger the sending of the direction acquisition instruction can also be arbitrarily set according to actual needs, and this embodiment does not limit this.
[0184] 7. The window container unit activity record unit sends a direction acquisition instruction.
[0185] In order to obtain the page direction to be set, the window container unit can further send a direction acquisition instruction to the activity recording unit in response to the direction acquisition instruction. The meaning of the direction acquisition instruction is similar to that described in the above step 5 and will not be repeated here.
[0186] And the activity recording unit can record the activity information of multiple activities, where the activity information can include, for example, the direction attribute of the activity, and can also include the visibility of the activity, etc. This embodiment does not limit the specific implementation of the activity information. In one implementation, all information related to the activity can be used as the activity information in this embodiment. And, all activities that have been created and not yet destroyed can record their activity information in the activity recording unit.
[0187] Similar to the above introduction, the activity record unit introduced here can be understood as a function class, and the activity record unit can be expressed as Activity Record (which can be understood as a class name).
[0188] And, the window container unit can, for example, send a direction acquisition instruction to the activity record unit by calling the getOrientation() function under the Activity Record class. It is also understandable that calling this function at this time still does not temporarily obtain the page direction to be set, and it still needs to be processed in subsequent steps to obtain the result of the page direction to be set. The specific class name and function name can also be set arbitrarily according to actual needs, and this embodiment does not limit this.
[0189] 8. The activity recording unit sends an add policy instruction to the policy management unit.
[0190] Based on the above introduction, it can be determined that the activity recording unit records the activity information of each Activity, wherein the activity information may include the direction information of the Activity. Then in one implementation, the activity recording unit may, for example, query the direction information of the Activity corresponding to the page to be displayed, thereby obtaining the page direction to be set. In a traditional implementation, the activity recording unit responds to the direction acquisition instruction sent by the display content unit, and can return the page direction to be set to the display content unit, that is, the acquisition result of the page direction.
[0191] However, referring to the introduction of the above embodiments, it can be further determined that in the present application, an additional step can be added to the page direction processing flow, and this step is used to detect whether the application corresponding to the page to be displayed is configured with in-application split-screen display technology. If this technology is configured, the page direction of the page to be displayed can be overridden (override, or modified).
[0192] In one implementation, Figure 5 The policy management unit and direction setting unit introduced in are the units for implementing the overwrite judgment and overwrite processing herein. Therefore, in response to the direction acquisition instruction, the activity recording unit can further interact with the policy management unit and the direction setting unit to determine the acquisition result of the page direction.
[0193] Reference Figure 5 The activity recording unit may send an add policy instruction to the policy management unit, wherein the add policy instruction is used to indicate whether a judgment on whether an overwrite is required for adding to the current page direction acquisition process.
[0194] Similar to the above introduction, the policy management unit introduced here can be understood as a function class, for example, and the policy management unit can be expressed as WinAmsPolicy (which can be understood as a class name), where win represents window, and Ams represents activity management service (Activity Manager Service).
[0195] And, the activity recording unit can send a policy add instruction to the policy management unit by calling the addPpolicy(policy_update_orientation) function under the WinAmsPolicy class, for example. The function is used to trigger the judgment process of whether the current page orientation acquisition process needs to be overwritten, which can be understood as the total entry for subsequent overwrite judgment and overwrite processing. And the specific class name and function name can also be set arbitrarily according to actual needs, and this embodiment does not limit this.
[0196] 9. The policy management unit sends a determination instruction to the direction setting unit.
[0197] After receiving the add policy instruction, the policy management unit can determine that it is currently necessary to add an overwrite judgment process for the page direction acquisition process. Therefore, the policy management unit can further send a judgment instruction to the direction setting unit, where the judgment instruction is used to instruct the direction setting unit to judge whether to overwrite the page direction of the page to be displayed.
[0198] Similar to the above introduction, the direction setting unit introduced here can be understood as a function class direction setting unit, for example, which can be expressed as Orientation Policy (which can be understood as a class name).
[0199] And, the policy management unit can, for example, send a determination instruction to the orientation setting unit by calling the checkMagicOrientation() function under the Orientation Policy class. The function is used to trigger the determination of whether the page orientation of the page to be displayed needs to be overwritten. And the specific class name and function name can also be set arbitrarily according to actual needs, and this embodiment does not limit this. For example, the function used to trigger the determination instruction can also be checkOrientation().
[0200] 10. The direction setting unit determines whether to overwrite the page direction in response to the determination instruction.
[0201] The direction setting unit can then respond to the determination instruction to determine whether it is necessary to overwrite the page direction of the page to be displayed. Referring to the introduction of the above embodiment, one possible determination logic is that if the application to which the page to be displayed belongs is configured with an in-application split-screen display technology, then it is necessary to overwrite the page direction of the page to be displayed. If the application to which the page to be displayed belongs is not configured with an in-application split-screen display technology, then it is not necessary to overwrite the page direction of the page to be displayed.
[0202] 11. The direction setting unit sends the determination result to the activity recording unit.
[0203] After making a determination, the direction setting unit may obtain a determination result, wherein the determination result is used to indicate whether to overwrite the page direction of the page to be displayed, or to indicate not to overwrite the page direction of the page to be displayed.
[0204] Corresponding to the scenario currently introduced, the electronic device needs to switch from a page of the first application to a page of the second application. Assuming that the second application is not configured with in-application split-screen display technology, the judgment result of the current direction setting unit is that there is no need to overwrite the page direction of the page to be displayed.
[0205] After obtaining the determination result, the direction setting unit may send the determination result to the activity recording unit. In one implementation, the direction setting unit may call Result.putint(D, SCREEN_ORIENTATION_ERROR) under the Activity Record class to send the determination result to the activity recording unit.
[0206] The putint(key, value) function is used to write a key-value pair with a key of string type and a value of int type. Correspondingly, the Result.putint(D, SCREEN_ORIENTATION_ERROR) function is used to set the value of field D to SCREEN_ORIENTATION_ERROR, where field D is used to indicate the judgment result.
[0207] Then the activity recording unit can obtain the determination result sent by the direction setting unit through the value of field D. When the value of field D is set to SCREEN_ORIENTATION_ERROR, it is used to indicate that the determination result is not to overwrite the page direction of the page to be displayed.
[0208] 12. The activity recording unit sends the page direction to the display content unit according to the determination result.
[0209] After obtaining the determination result, the activity recording unit can determine the page direction of the page to be displayed according to the determination result.
[0210] When the determination result indicates that the page direction of the page to be displayed is to be overwritten, the activity recording unit may determine that the page direction to be set is the page direction after the overwriting.
[0211] And, when the determination result indicates that the page direction of the page to be displayed is not to be overwritten, the activity recording unit can determine that the page direction to be set is the page direction indicated by the direction attribute in the activity information of the Activity (corresponding to the page) recorded in the activity recording unit.
[0212] In this way, corresponding to the action of obtaining the direction performed by the display content unit in the above step 5, the current step 12 corresponds to sending the acquisition result corresponding to the action of obtaining the direction to the display content unit. After the display content unit obtains the page direction to be set, the page direction of the page of the second application to be displayed can be set according to the result of the obtained page direction, so that the page of the second application after switching is displayed according to the corresponding page direction indication.
[0213] In the example currently introduced, when the determination result of the page direction of the page to be displayed is not to overwrite, based on the scenario introduced in the above embodiment, assuming that the direction attribute recorded in the Activity corresponding to the page to be displayed is SCREEN_ORIENTATION_BEHIND, then the page to be displayed will inherit the initial page direction of the first application before switching.
[0214] Assuming that the first application is configured with an in-application split-screen display technology, the page direction of the page corresponding to the first application displayed before the switch is overwritten. Based on the introduction of the above embodiment, this may cause the display direction of the page of the second application displayed after the switch to be different from the display direction of the page of the first application displayed before the switch, resulting in a jump in the display direction of the page.
[0215] In the above Figure 5 Based on the introduction of the process, the following Figure 6 The processing flow of overwriting the page direction of the switched page in the technical solution provided by this application is introduced. Figure 6 Signaling interaction of the page direction control method provided in the embodiment of the present application Figure 2 .
[0216] like Figure 6 As shown, the processing flow includes:
[0217] 1. The activity initiation unit receives the execution instruction.
[0218] 2. The activity startup unit sends a window adding instruction to the window management service unit.
[0219] 3. The window management service unit sends a direction setting instruction to the window container unit.
[0220] 4. The window container unit sends a direction update instruction to the display content unit.
[0221] 5. Display content unit to obtain page direction.
[0222] 6. The display content unit sends a direction acquisition instruction to the window container unit.
[0223] 7. The window container unit activity record unit sends a direction acquisition instruction.
[0224] 8. The activity recording unit sends an add policy instruction to the policy management unit.
[0225] 9. The policy management unit sends a determination instruction to the direction setting unit.
[0226] Among them, the implementation of steps 1 to 9 is the same as above Figure 5 The description in the embodiment is similar and will not be repeated here.
[0227] 10. The direction setting unit determines whether to overwrite the page direction in response to the determination instruction.
[0228] In this embodiment, when determining whether to overwrite the page direction, the direction setting unit may make the determination based on the first condition.
[0229] Assume that the current scenario is that the page displayed by the first operation triggers switching from the first page of the first application to the second page of the second application. In one implementation, the first condition may be that the initial page direction indicated by the direction attribute of the activity corresponding to the second page is SCREEN_ORIENTATION_BEHIND, and the first application to which the first page displayed before the switch belongs is configured with the in-application split-screen display technology, and the second application to which the second page displayed after the switch belongs is not configured with the in-application split-screen display technology.
[0230] When the first condition described above is met, it can be determined that the page direction of the first page is overwritten to a preset direction type. At the same time, when determining the page direction of the second page, if it is determined according to the direction attribute of the activity corresponding to the second page, then the page direction corresponding to the second page may be determined as the initial page direction of the first page, which will lead to the above-mentioned problem. In order to avoid the above-mentioned problem, when it is determined that the first condition is met, the direction setting unit determines that the page direction needs to be overwritten for the second page, so that the page direction determined for the second page is also the overwritten preset direction type, so that the page direction of the first page is consistent with the page direction of the second page.
[0231] The above describes an implementation method of the first condition. Based on the above described first condition, the first condition may further include: the activity corresponding to the second page is not empty, and / or the visibility of the first page is not applied.
[0232] Among them, the activity corresponding to the second page is not empty, which means that the activity corresponding to the second page has been created in the activity startup unit. When the activity corresponding to the second page is not empty, it can be shown that the second page is ready to be displayed. Then, by adding the judgment condition that the activity corresponding to the second page is not empty, when it is determined that the activity corresponding to the second page has been created, the judgment result of the page direction that needs to overwrite the second page can be output, thereby improving the effectiveness and necessity of the output judgment result.
[0233] Furthermore, if the visibility of the first page is not applied, it means that the page displayed in the interface is indeed going to be switched from the first page, that is, it can be determined that the first page will not be displayed on the screen. Then, by adding the judgment condition that the visibility of the first page is not applied, when it is determined that the second page is to be switched from the first page, the judgment result of the page direction that needs to overwrite the second page can be output, thereby improving the effectiveness and necessity of the output judgment result.
[0234] Furthermore, the first condition may also include, for example: the first field is a first value, wherein the first field is used to indicate whether the page is in the process of playing an animation, and when the first field is a first value, the first value is used to indicate that the page is in the process of playing an animation switching from the first page to the second page.
[0235] By adding this judgment condition, the page direction of the second page can be overwritten during the motion effect playback process, so that during and after the motion effect playback, the page direction of the second page can be effectively overwritten to the preset direction type, avoiding the page direction jump caused by the display direction of the second page being different from that of the first page during the motion effect playback.
[0236] 11. The direction setting unit sends the determination result to the activity recording unit.
[0237] In this embodiment, the direction setting unit can obtain a determination result after determination. Corresponding to the scenario currently introduced, the electronic device needs to switch from the first page of the first application to display the second page of the second application, and when the first page and the second page meet the first condition, the determination result is used to indicate that the page direction of the second page to be displayed is overwritten.
[0238] After obtaining the determination result, the direction setting unit may, for example, send the determination result to the activity recording unit. Assume that the preset direction type after overwriting is SCREEN_ORIENTATION_SENSOR. In one implementation, the direction setting unit may, for example, call Result.putint(D, SCREEN_ORIENTATION_SENSOR) under the Activity Record class to send the determination result to the activity recording unit.
[0239] Among them, the putint(key, value) function is used to write a key-value pair with a key of string type and a value of int type. Correspondingly, the Result.putint(D, SCREEN_ORIENTATION_SENSOR) function is used to set the value of field D to SCREEN_ORIENTATION_ SENSOR, where field D is used to indicate the judgment result.
[0240] Then the activity recording unit can obtain the determination result sent by the orientation setting unit through the value of field D. When the value of field D is set to SCREEN_ORIENTATION_SENSOR, it indicates that the determination result is to overwrite the page orientation of the second page to be displayed, and the page orientation after overwriting is SCREEN_ORIENTATION_SENSOR.
[0241] 12. The activity recording unit sends the page direction to the display content unit according to the determination result.
[0242] After obtaining the determination result, the activity recording unit can determine the page direction of the second page to be displayed according to the determination result.
[0243] In the scenario described in this embodiment, when the determination result indicates that the page direction of the page to be displayed is to be overwritten, the activity recording unit can determine that the page direction to be set is the page direction after the overwriting.
[0244] In this way, corresponding to the action of obtaining the direction performed by the display content unit in the above step 5, the current step 12 corresponds to sending the acquisition result corresponding to the action of obtaining the direction to the display content unit. After the display content unit obtains the page direction to be set, the page direction of the page of the second application to be displayed can be set according to the result of the obtained page direction, so that the page of the second application after switching is displayed according to the corresponding page direction indication.
[0245] In the example currently introduced, when the determination result of the page direction of the second page to be displayed is to overwrite, the final page direction of the second page to be displayed can be made consistent with the final page direction of the first page displayed before switching, so as to avoid the situation where the display direction of the page jumps.
[0246] Based on the above introduction, the following further introduces the process of the page direction control method provided by the present application in combination with specific steps. The method includes:
[0247] S701. Display a first page, where the first page includes a first sub-page and a second sub-page, and both the first sub-page and the second sub-page are pages of a first application.
[0248] In this embodiment, the first page is the page displayed before the page is switched, and the first page includes a first sub-page and a second sub-page, and the first sub-page and the second sub-page are both pages of the first application, so it can be understood that the first application is an application configured with the in-application split-screen display technology. And the first page corresponds to the in-application split-screen display page, the first sub-page corresponds to one of the split-screen displayed sub-pages, and the second sub-page corresponds to another split-screen displayed sub-page.
[0249] For example, in the above Figure 1In the interface shown in (b), page 101 can be understood as the first sub-page, page 102 can be understood as the second sub-page, and the entire page composed of page 101 and page 102 can be understood as the first page in this embodiment.
[0250] S702: In response to a first operation for triggering page switching, determine a second page to be displayed, where the second page is a page of a second application.
[0251] Afterwards, assuming that a first operation for triggering page switching is detected, the electronic device can determine the second page to be displayed in response to the first operation. The first operation can be, for example, a touch operation acting on a first control, wherein the first control is used to trigger the displayed page to switch from the first page to the second page. This embodiment does not limit the specific implementation of the first operation or the first control, which can be determined according to actual needs, as long as the first operation can trigger the switching of the display of the second page from the first page.
[0252] In this embodiment, the second page is a page of the second application, and the second page in this embodiment is an application that is not configured with in-application split-screen display technology, so the second page is a separate page of the second application and there is no split-screen situation.
[0253] S703: Set the page direction of the second page to a first direction type, where the first direction type is the page direction of the first page when the first page is displayed.
[0254] Afterwards, the electronic device can set the page direction of the second page to the first direction type, where the first direction type is the page direction corresponding to the first page when the first page is displayed. Based on the above introduction, it can be understood that because the first application is an application configured with an in-application split-screen display technology, the electronic device will overwrite the page direction of the first page when determining the page direction of the first page.
[0255] Among them, the page direction corresponding to the first page when the first page is displayed is the page direction after the overwriting process. In this embodiment, there is no restriction on which direction type is selected as the first direction type after the overwriting, and it can be set according to actual needs. It is sufficient to ensure that the page direction finally adopted when the first page is displayed is the first direction type, and the page direction finally adopted when the second page is displayed is also the first direction type.
[0256] In this embodiment, for example, the page direction of the second page can be overwritten to set the page direction of the second page to the first direction type, and then the second page is displayed according to the first direction type, so that the direction type used to display the second page and the direction type used to display the first page are the same, thereby avoiding the situation where the page direction jumps.
[0257] In one implementation, when setting the page direction of the second page, for example, the initial page direction of the second page can be first obtained, where the initial page direction of the second page is the page direction indicated by the direction attribute of the Activity corresponding to the second page.
[0258] In the case where the initial page orientation of the second page is of the second orientation type, for example, the second orientation type is used to indicate that the page continues to use the page orientation of the previous page before switching, that is, the second orientation type may be SCREEN_ORIENTATION_BEHIND. In this case, it can be determined that the first application is configured with the in-application split-screen display technology, and the second application is not configured with the in-application split-screen display technology, and the initial page orientation of the second page is of the second orientation type, then it can be determined that the relevant information satisfies the first condition, and then the electronic device can overwrite the page orientation of the second page with the first orientation type.
[0259] Based on the introduction of the above embodiments, it can be determined that the specific implementation of the first condition can be further expanded according to actual needs, which will not be repeated here.
[0260] S704: Based on the first direction type, display the second page.
[0261] Then, the second page is displayed based on the overwritten first direction type, which ensures that the display directions of the first page and the second page are consistent, thus avoiding the problem of page direction jump.
[0262] For example, you can refer to Figure 7 Understand the effect of the above technical solution, Figure 7 Schematic diagram of page switching provided in the embodiment of the present application Figure 2 .in Figure 7 (c) in the above Figure 2 The difference is that, assuming that the electronic device detects a touch operation on the control of application B in the sharing window 201, in response to the touch operation, the electronic device can switch to display as follows: Figure 7 The sharing page 701 shown in (d) in FIG.
[0263] Among them, the sharing page 701 is the page of application B. Because it is processed by the above technical solution, Figure 7 The sharing page 701 shown in (d) is displayed in a horizontal screen, which is consistent with the display direction of the pages 101 and 102 before switching.
[0264] To sum up, the technical solution of the present application can, when it is determined that the first application is configured with in-application split-screen display technology and the second application is not configured with in-application split-screen display technology, and the initial page direction of the second page is SCREEN_ORIENTATION_BEHIND, choose to overwrite the page direction of the second page so that the page direction used for finally displaying the first page is the same as the page direction used for finally displaying the second page, thereby achieving the problem of page direction jumping when switching from the first page to display the second page.
[0265] Moreover, compared with configuring a fixed page direction for pages of certain applications to avoid page direction jumps, the technical solution introduced above can overwrite the page direction according to the actual page direction setting and application function configuration, thereby effectively improving the flexibility of page direction setting.
[0266] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.
[0267] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0268] The page direction control method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above page direction control method.
[0269] The page direction control method provided in the embodiment of the present application can be applied to electronic devices with image display function and data processing function. The electronic device includes a terminal device, and the specific device form of the terminal device can refer to the above related description, which will not be repeated here.
[0270] In one implementation, an embodiment of the present application provides an electronic device, Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0271] like Figure 8As shown, the electronic device 80 includes: a processor 801 and a memory 802; the memory 802 stores computer-executable instructions; the processor 801 executes the computer-executable instructions stored in the memory 802, so that the electronic device 80 executes the above method.
[0272] When the memory 802 is independently provided, the electronic device further includes a bus 803 for connecting the memory 802 and the processor 801 .
[0273] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0274] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0275] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0276] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0277] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0278] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A page direction control method, characterized in that: include: Display a first page, wherein the first page includes a first sub-page and a second sub-page, and both the first sub-page and the second sub-page are pages of a first application; In response to a first operation for triggering a page switch, determining a second page to be displayed, where the second page is a page of a second application; Setting the page direction of the second page to a first direction type, wherein the first direction type is the page direction of the first page when the first page is displayed; Based on the first direction type, displaying the second page; The step of setting the page direction of the second page to a first direction type includes: Obtaining an initial page direction of the second page; In the case where the initial page orientation of the second page is of the second orientation type, overwriting the page orientation of the second page to be of the first orientation type; The second direction type is used to indicate that the page continues to use the initial page direction of the previous page before switching.
2. The method according to claim 1, characterized in that The initial page direction of the first page is a third direction type; Before displaying the first page, the method further includes: The page direction of the first page is overwritten to the first direction type.
3. The method according to claim 2, characterized in that The page direction of overwriting the second page is the first direction type, including: When the first page and / or the second page meets the first condition, the page direction of the second page is overwritten to be the first direction type.
4. The method according to claim 3, characterized in that The first condition includes: the page orientation of the second page is the second orientation type; The first condition also includes: the activity corresponding to the second page is not empty, and / or the first page has not applied for visibility.
5. The method according to claim 4, characterized in that The first condition also includes: the first field is a first value, and the first value is used to indicate that the page is in the process of playing the animation effect of switching from the first page to the second page.
6. The method according to any one of claims 3 to 5, characterized in that: The method is applied to an electronic device, the electronic device comprising a direction setting unit and an activity recording unit, the activity recording unit being used to record activity information of an activity corresponding to at least one page; The step of setting the page direction of the second page to a first direction type includes: The direction setting unit calls a first function to determine whether the first page and / or the second page meets the first condition; In the case where it is determined that the first condition is satisfied, the direction setting unit returns a determination result to the activity recording unit, where the determination result is used to indicate that the page direction of the second page is overwritten to the first direction type.
7. The method according to claim 6, characterized in that The method further comprises: The activity recording unit obtains an initial page direction of the second page; The activity recording unit sends the initial page direction of the second page to the direction setting unit.
8. The method according to claim 7, characterized in that The method further comprises: In a case where the activity corresponding to the second page is recorded in the activity recording unit, the activity recording unit sends first indication information to the direction setting unit, where the first indication information is used to indicate that the activity corresponding to the second page is not empty; and / or, In a case where visibility is not applied for the first page, the activity recording unit sends second indication information to the direction setting unit, where the second indication information is used to indicate that visibility is not applied for the first page.
9. The method according to claim 6, characterized in that Before the direction setting unit returns the determination result to the activity recording unit, the method further includes: The direction setting unit overwrites the page direction of the second page to the first direction type.
10. The method according to claim 9, characterized in that The electronic device further comprises a display content unit; The displaying the second page based on the first direction type includes: The display content unit receives the page direction of the second page sent by the activity recording unit; The display content unit displays the second page based on the first direction type.
11. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method according to any one of claims 1 to 10.
12. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 10.
