Interface display control method and device, electronic equipment, vehicle, medium and product
By intercepting interface control operations of non-main processes in the Android ecosystem and using the target main process to create a display container, the problem of confusing application interface display on large-screen devices is solved, and the normal display of multi-application interfaces is achieved.
Patent Information
- Application Number
- CN202411402963.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-04-08
AI Technical Summary
In the Android software ecosystem, most applications are not adapted and are difficult to display normally on large-screen devices, resulting in confusion in the interface display.
By responding to the trigger operation of the first application interface, obtaining its process, and intercepting its operation of creating a container when the first process is not the target main process, the target main process creates a display container to control the display of the second application interface.
It effectively solves the problem of confusing display of multi-process interfaces and realizes normal display of interfaces in multi-application interface scenarios.
Smart Images

Figure CN119781705A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic device control technology, and in particular to an interface display control method, device, electronic device, vehicle, computer-readable storage medium, and computer program product. Background Art
[0002] Currently in the Android software ecosystem, most applications are developed for small-screen display devices such as mobile phones. If these applications are not specially adapted, it is difficult for them to be displayed normally on large-screen devices (such as Pads).
[0003] For example, Figure 1-1 As shown in , when only one interface is opened in the application, the interface is displayed in the center, but when a new interface is started based on the interface, Figure 1-2 As shown, multiple interfaces may appear confusing. Summary of the invention
[0004] Embodiments of the present application provide an interface display control method, device, electronic device, vehicle, computer-readable storage medium, and computer program product to achieve normal display of multiple interfaces.
[0005] In order to achieve the above object, according to a first aspect of the present application, a method for controlling an interface display is provided, the method comprising:
[0006] In response to a trigger operation on a first application interface for launching a second application interface, obtaining a first process of the first application interface; wherein the process of the first application interface and the process of the second application interface are different processes;
[0007] When the first process is not the target main process, intercepting an operation of the first process to create a container for controlling display of a second application interface;
[0008] A display container is created through the target main process to control the display of the second application interface.
[0009] Optionally, the method further includes:
[0010] When the first process is the target main process, a display container of the second application interface is created through the first process to control the display of the second application interface.
[0011] Optionally, the display container includes at least a system layer container;
[0012] The creating a display container through the target main process to control the display of the second application interface includes:
[0013] Creating a system layer container of the second application interface through the target main process;
[0014] The interface control attribute parameters of the second application interface are added to the child node of the system layer container to control the display of the second application interface.
[0015] Optionally, the display container further includes an application layer container, and the controlling the display of the second application interface includes:
[0016] The target instruction associated with the interface control attribute parameter in the control instruction is passed to the application layer container corresponding to the second application interface, so as to control the second application interface to adjust the display parameters according to the target instruction.
[0017] Optionally, before creating a display container through the target main process, the method further includes:
[0018] Creating a second process corresponding to the second application interface;
[0019] In a case where the second process is not the target main process, the step of creating a display container through the target main process is performed.
[0020] Optionally, in response to the triggering operation for launching the second application interface on the first application interface, before acquiring the first process of the first application interface, the method further includes:
[0021] In response to a trigger operation acting on a system interaction interface, obtaining at least one application interface to be started;
[0022] The process corresponding to the first application interface started in the application interfaces is set as the target main process.
[0023] Optionally, after creating a display container through the target main process to control the display of the second application interface, the method further includes:
[0024] Obtaining an operation event for the displayed second application interface;
[0025] According to the operation event, the display state of the second application interface is controlled through the target main process.
[0026] Optionally, controlling the display state of the second application interface through the target main process according to the operation event includes:
[0027] Parsing the operation event to obtain an event type and an initial display password corresponding to the operation event;
[0028] Generate a target display password according to the event type and the initial display password;
[0029] According to the target display password, the display state of the second application interface is controlled through the target main process.
[0030] Optionally, generating a target display password according to the event flag and the initial display password includes:
[0031] According to the initial display password, obtaining interface control attribute parameters corresponding to the second application interface;
[0032] Acquire a target display container in the target main process where the interface control attribute parameter is located, and acquire a display password associated with the target display container;
[0033] A target display password is determined according to the display password associated with the target display container and the event type.
[0034] Optionally, determining the target display password according to the display password associated with the target display container and the event type includes:
[0035] If the event type is exiting full-screen display, obtaining the backed-up historical boundary parameters of the second application interface according to the interface control attribute parameters, wherein the historical boundary parameters are the boundary parameters of the second application interface when it was last displayed in non-full-screen mode;
[0036] According to the historical boundary parameter, updating the initial display password to obtain a new display password;
[0037] The display password associated with the target display container is replaced with the new display password to obtain a target display password.
[0038] Optionally, determining the target display password according to the display password associated with the target display container and the event type includes:
[0039] If the event type is full-screen display, the display password associated with the target display container is replaced with the initial display password to obtain a target display password.
[0040] Optionally, controlling the display state of the second application interface through the target main process according to the target display password includes:
[0041] Parsing the target display password to obtain target display parameters of the target display container;
[0042] According to the target display parameter, the display state of the second application interface is controlled.
[0043] According to a second aspect of the present application, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-mentioned interface display control method.
[0044] According to a third aspect of the present application, a vehicle is provided, comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-mentioned interface display control method.
[0045] According to a fourth aspect of the present application, a computer-readable storage medium is provided, comprising a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the above-mentioned interface display control method.
[0046] According to the fifth aspect of the present application, a computer-readable storage medium is provided, comprising a computer program, wherein the computer program is stored in the computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of the above-mentioned interface display control method.
[0047] According to the sixth aspect of the present application, a computer program product is provided, comprising a computer program, wherein the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of the above-mentioned interface display control method.
[0048] In the interface display control method, device, electronic device, vehicle, computer-readable storage medium and computer program product of the embodiments of the present application, a trigger operation for pulling up the second application interface acting on the first application interface is responded to, and the first process to which the first application interface belongs is obtained. When the first process is not the target main process, the operation of creating a container by the first process can be directly intercepted, so that the first process, as a non-main process, cannot control the display of the second application interface, and the display container is created by using the target main process, and the display of the second application interface is controlled by the display container. Therefore, compared with the problem of chaotic display of multiple interfaces caused by process isolation in the prior art, the present application can intercept the interface control operation of the non-main process, and the main process can uniformly manage the display of multiple application interfaces through the display container, which effectively solves the problem of chaotic display of multiple process interfaces and realizes the normal display of interfaces in multiple application interface scenarios.
[0049] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0051] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same figure numbers represent the same parts in the following description.
[0052] Figure 1-1 is a first schematic diagram of an interface display provided in an exemplary embodiment of the present application;
[0053] Figure 1-2 is a second schematic diagram of an interface display provided in an exemplary embodiment of the present application;
[0054] Figure 2 is a third schematic diagram of an interface display provided in an exemplary embodiment of the present application;
[0055] Figure 3 This is a schematic diagram of the existing interface display architecture provided by the present application as an example;
[0056] Figure 4 is a schematic diagram of an interface display architecture provided in an exemplary embodiment of the present application;
[0057] Figure 5 It is a schematic diagram of a first process of an interface display provided in an exemplary embodiment of the present application;
[0058] Figure 6 It is a schematic diagram of a second process of displaying an interface provided in an exemplary embodiment of the present application;
[0059] Figure 7 It is a schematic diagram of a third process of an interface display provided in an exemplary embodiment of the present application;
[0060] Figure 8 It is a structural diagram of an interface display control device provided in one embodiment of the present application.
[0061] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application. In addition, it should be understood that the specific implementation methods described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In the present application, unless otherwise stated, the directional words such as "upper" and "lower" used generally refer to the upper and lower parts of the device in actual use or working state, specifically the drawing direction in the accompanying drawings; while "inside" and "outside" refer to the outline of the device.
[0063] Currently, in the Android software ecosystem, most applications are developed for small-screen display devices such as mobile phones. If these applications are not specially adapted, it is difficult for them to have a good display effect on large-screen devices (such as Pads). In order to provide users with a complete software ecosystem experience, large-screen device manufacturers often take two approaches to make applications that originally only support mobile phones compatible: cooperate with software developers to develop versions adapted to large screens; develop and customize the system to adapt to applications. For cost considerations, the latter approach is often more popular.
[0064] At present, a mainstream development and customization strategy is to display the application interface (Activity) in a tiled manner, which is the so-called parallel view. Figure 1-1 When the application only opens one Activity1, Activity1 is displayed in the center. When the application starts a new interface (Secondary Activity) from the main interface (Primary Activity), the two interfaces of the application are displayed on both sides of the screen.
[0065] For example, Google has provided a set of AE (Activity Embedding) framework since Android 12. Application developers can implement the display rules of Activity by formulating the display rules of Activity, and the AE framework parsing rules can be implemented. Figure 2 display effect.
[0066] However, implementing horizontal and vertical display based on AE will face the problem of interface confusion under multiple processes, such as Figure 1-1 and Figure 1-2As shown in the figure, the primary Activity on the left is in process1, and the secondary Activity started from the left belongs to process2. In this case, the activity on the left is still on the left, but the activity on the right is centered, causing a confusing interface. The reason for the confusing interface is that the primary activity has launched an activity of a new process. According to the above description, when a process has only one activity, the activity will be required to be displayed in the center. The centering is triggered during the activity life cycle callback. After the primary activity moves to the left, it waits for the secondary activity it has launched. However, since the secondary activity completes the life cycle callback in another process, the primary activity and the secondary activity cannot see each other due to process isolation, which causes the secondary activity to be displayed in the center while the primary activity is displayed on the left side of the screen. It can be seen that the parallel window solution based on AE will encounter the problem of confusing interface under multiple processes.
[0067] In general, the root cause of the above interface confusion problem is that each process of the application has a controller to parse display rules and regulate interface display. The controller of the process where the primary Actvity is located requires the secondary Activity to be displayed on the right side of the screen, thus moving itself to the left side of the screen, while the process where the secondary Activity is located requires the controller to be displayed in the center. The controllers of different application processes are isolated from each other, resulting in interface confusion.
[0068] For example, Figure 3The existing AE shown handles the scenario where a single application has multiple process interfaces: when the user cold-starts the application, the system creates the main process of the application and creates a controller instance Controller1. When the controller instance finds that there is only one interface in the main process, it creates a container taskFragmentContainer1 in the application process and requests the system to create taskFragment1 with a centered border and load ActivityRecord1 to achieve horizontal and vertical display. Then the user interacts with the main process interface and pulls up Activity2 of another process. In the main process, Controller1 moves taskFragmentContainer1 to the left side of the screen and prepares an empty container for Activity2. After the system creates the process of Activity2, it creates Controller2. Controller2 finds that there is only Activity2 in the process, creates taskFragmentContainer2 and requests the system to create taskFragment2 with a centered border and load ActivityRecord2. The above operations cause the Activities of each process to be managed by the controllers of each process, with Activity1 displayed on the left and Activity2 displayed in the center.
[0069] Therefore, in order to solve the problem of confusing display of multiple interfaces, the present application proposes an interface display control method, device, electronic device and computer-readable storage medium, which can solve the problem of confusing multi-process interfaces when supporting horizontal and vertical display based on the AE framework. According to the user's scenario requirements, the present application can at least support the following scenarios:
[0070] (1) When the user starts the first interface (in the main process), the interface is displayed in horizontal and vertical orientation. When the user interacts with the first interface to pull up the second interface, even if the second interface is in another process, it can be displayed in a parallel window.
[0071] (2) Based on the above scenario, this application can cope with complex business requirements such as the second interface pulling up the main process interface or other process interfaces again without causing interface confusion;
[0072] (3) In Figure 2 In the parallel window scenario, this application can handle the business needs of the interface being in a non-main process and requesting full screen;
[0073] (4) Based on the above scenario (3), it is possible to handle the business demand of requesting to exit the full screen after the non-main process interface is full screen. At this time, the interface is restored to the position and size before the full screen.
[0074] Specifically, the interface display control method in the present application can be applied to Figure 4The interface display control architecture shown in the figure can effectively handle the scenario where a single application has multiple process interfaces. Figure 4 The existing method shown is to create taskFragmentContainer1 and taskFragment1 for Activity1. The user interacts with Activity1 to launch Activity2 of another process. The system side loads ActivityRecord2 by taskFragment2 of the main process. The size and position of Activity2's interface are managed by the controller Controller1 of the main process. Only when Activity2 requests full screen / exit full screen, the event is passed to the system through Controller2. Finally, it is still necessary to obtain the password of Controller1 to modify the size and position of taskfragment2 corresponding to Controller1. Activity2 will change its size and position with taskfragment2 to complete the request to enter / exit full screen. Through the above scheme, this application can host the activities of other processes to the main process, and the controller Controller1 of the main process will uniformly manage the interface display.
[0075] On this basis, the interface display control method in the embodiment of the present application can be applied to Figure 4 The interface display control system (hereinafter referred to as the system) shown in FIG. Figure 5 As shown, the following steps may be specifically included:
[0076] S10, in response to a triggering operation on a first application interface for launching a second application interface, obtaining a first process of the first application interface; wherein the process of the first application interface and the process of the second application interface are different processes;
[0077] It should be noted that, in this embodiment, the first application interface may be the application interface of the main process or the application interface of the sub-process. In order to avoid interface isolation caused by process isolation, in this embodiment, the display of each interface is controlled by the main process.
[0078] In this embodiment, the system can respond to a trigger operation on the first application interface for launching the second application interface, and obtain the first process to which the first application interface belongs. The process of the first application interface and the process of the second application interface are different processes.
[0079] Specifically, for example, the first application interface Activity1 can start the second application interface Activity2 by means of intent (message passing object).
[0080] S20, when the first process is not the target main process, intercepting an operation of the first process to create a container for controlling display of a second application interface;
[0081] In this embodiment, after acquiring the first process of the first application interface, the system can further determine whether the first process is a main process (ie, a target main process in this embodiment).
[0082] If it is determined that the first process is not the target main process, the operation of creating a container by the first process can be directly intercepted, so that the first process, as a non-main process, does not have the authority to control the display of the second application interface.
[0083] Specifically, for example, Figure 6 As shown, the system can obtain the process name pA of the first process where the first application interface Activity1 is located and the process name pB of the second process where the second application interface Activity2 is located. Here, pA already exists and is obtained through ActivityThread (the main thread of the Android application, responsible for processing the application life cycle and message loop, etc.). pB has not been created yet and is obtained by parsing the configuration file through the package management. Then, the first process can be judged whether it is the target main process by the process name pA, and the second process can be judged whether it is the target main process by the process name pB.
[0084] S30: Create a display container through the target main process to control the display of the second application interface.
[0085] It should be noted that, in this embodiment, the display container may include a system layer container taskFragment and an application layer container taskFragmentContainer.
[0086] In this embodiment, when the first process is not the target main process, the system can use the target main process to create a system layer container, and control the display of the second application interface through the system layer container.
[0087] like Figure 4As shown, the system can create a corresponding system-layer container taskFragment2 for the second application interface in the target main process. In addition, the system also creates an application container taskFragmentContainer1 and a system-layer container taskFragment1 for the first application interface, and creates an application container taskFragmentContainer2 for the second application interface. The above taskFragmentContainer1, taskFragment1, taskFragmentContainer2 and taskFragment2 are all in the main process and managed by the main process, so that the interfaces of non-main processes are hosted in the main process for management, so that when the application starts multiple interfaces, multiple interfaces can be displayed tiled, and there will be no overlapping, occlusion or other display confusion among the multiple interfaces.
[0088] Specifically, for example, find the topmost taskFragment from the application's Task stack. Since the first interface is the interface of the main process, and taskFragments of other processes cannot be created in this embodiment, the taskFragment at the top of the Task stack must be that of the main process. This taskFragment can be used as a system-level container created by the target main process.
[0089] In one embodiment, the interface display control method in this embodiment may further include:
[0090] When the first process is the target main process, a display container of the second application interface is created through the first process to control the display of the second application interface.
[0091] In this embodiment, if the first process is determined to be the target main process based on the process name, then the display container of the second application interface can be directly created through the first process to control the display of the second application interface. That is, in this embodiment, only the main process has the display container creation operation and the application interface display control operation.
[0092] It can be seen that in an embodiment of the present application, the system can respond to a trigger operation acting on the first application interface for pulling up the second application interface, and obtain the first process to which the first application interface belongs. When the first process is not the target main process, the operation of creating a container by the first process can be directly intercepted, so that the first process, as a non-main process, cannot control the display of the second application interface, and the target main process is used to create a system layer container, and the display of the second application interface is controlled by the system layer container. Therefore, compared with the problem of chaotic display of multiple interfaces caused by process isolation in the prior art, the present application can intercept the interface control operation of the non-main process, and the display of multiple application interfaces is uniformly managed by the main process, which effectively solves the problem of chaotic display of multiple process interfaces and realizes the normal display of interfaces in multiple application interface scenarios.
[0093] In one embodiment, the display container includes at least a system layer container. On this basis, in the above S30, "creating a display container through the target main process to control the display of the second application interface" may include:
[0094] S301, creating a system layer container of the second application interface through the target main process;
[0095] S302: Add the interface control attribute parameters of the second application interface to the child node of the system layer container to control the display of the second application interface.
[0096] In this embodiment, the system can control the target main process, create a system layer container taskFragment2 corresponding to the second application interface, and then can control the interface attribute parameter ActivityRecord2 of the second application interface, and use the interface control attribute parameter ActivityRecord2 as the child node Children of the system layer container taskFragment2, so that the target main process can control the display of the second application interface through the system layer container taskFragment2.
[0097] It should be noted that in this embodiment, in the Android operating system, WMS (Window Manager Service) is a system service responsible for managing all windows. It controls the creation, display, position and size of windows, etc. It works closely with Activity Manager Service (AMS) to manage the life cycle and state of applications. WMS is a tree structure, and the Children of a node (such as the system layer container TaskFragment in this embodiment) is generally called a subnode.
[0098] It is worth noting that in this embodiment, the second application interface Activity2 can intercept the operation of its process controller to create a container when its process executes a lifecycle callback. In this way, the control of the non-main process controller over Activity2 can be blocked, so that all interfaces are controlled by the main process.
[0099] Furthermore, the display container further includes an application layer container. On this basis, in the above S30, “controlling the display of the second application interface” may include:
[0100] S303: passing a target instruction in the control instruction associated with the interface control attribute parameter to an application layer container corresponding to the second application interface, so as to control the second application interface to adjust display parameters according to the target instruction.
[0101] It should be noted that, in this embodiment, after the system uses the interface control attribute parameter ActivityRecord2 of the second application interface as a child node of the system layer container, it can respond to the control instruction for the system layer container taskFragment2, wherein the control instruction can be triggered by the main process according to the display position and display size of the first application interface, thereby ensuring that the first application interface and the second application interface can be displayed tiled, avoiding confusion in the display of multiple interfaces.
[0102] Furthermore, the system can pass the target instruction associated with the interface control attribute parameter in the control instruction to the second process corresponding to the second application interface, and control the second application interface to adjust the display parameters according to the target instruction. In this way, the target main process can intervene in the size and position of the non-main process Activity2 by modifying the boundary of the system layer container taskFragment2, so that the first application interface and the second application interface can be displayed in a tiled manner, for example, Figure 2 As shown, the first application interface and the second application interface are displayed on the left and right sides respectively, realizing the horizontal screen and vertical display multi-interface function.
[0103] Furthermore, before the above S30, “creating a display container by the target main process”, the following may also be included:
[0104] S40, creating a second process corresponding to the second application interface;
[0105] S50: When the second process is not the target main process, execute the step of creating a display container through the target main process.
[0106] In this embodiment, before creating a system layer container through the target main process, the system also needs to create a second process corresponding to the second application interface Activity2, and then can determine whether the second process is the target main process according to the process name of the second process.
[0107] If it is determined that the second process is not the target main process, the above step of creating a system layer container through the target main process can be executed.
[0108] If it is determined that the second process is the target main process, the other native startup processes of the system can be completed and the task is terminated.
[0109] Furthermore, before the above S10, “responding to a trigger operation on the first application interface for launching the second application interface, obtaining the first process of the first application interface”, the following may also be included:
[0110] S60, in response to a triggering operation on the system interaction interface, obtaining at least one application interface to be started;
[0111] S70: Set the process corresponding to the first application interface started among the application interfaces as the target main process.
[0112] It should be noted that, in the present embodiment, the system interaction interface may be an interface displayed on a display screen, and the user may operate the system interaction interface, operate the target application displayed on the system interaction interface, and generate corresponding trigger operations.
[0113] The system can respond to the trigger operation acting on the system interaction interface, obtain at least one currently started application interface, and then set the process corresponding to the first started application interface in the application interface as the target main process.
[0114] In a specific embodiment, Figure 6 As shown, the control process of the second application interface being pulled up by the first application interface may include:
[0115] (1) The first application interface Activity1 launches the first application interface Activity2. The launching method here is that Activity1 launches Activity1 through intent;
[0116] (2) Get the process name pA where Activity1 is located and the process name pB where Activity2 is located. pA can be obtained through ActivityThread, and the process name pB can be obtained by parsing the configuration file through package management;
[0117] (3) Check whether pA is the main process name. If so, go to (5); otherwise, go to (4);
[0118] (4) pA is a non-main process, and the operations of pA parsing control rules and creating containers are intercepted;
[0119] (5) Check whether pB is the main process name. If so, go to (9); otherwise, go to (6);
[0120] (6) Find the topmost taskFragment from the application's Task stack as the taskFragment of the main process;
[0121] (7) Add pB's ActivityRecord2 to taskFragment2's Children, so that the boundary changes of taskFragment2 can be passed to ActivityRecord2 of Activity2. The main process can intervene in the size and position of the non-main process's Activity2 by modifying the boundary of taskFragment2;
[0122] (8) Activity2 intercepts the operation of the controller of the pB process to create a container when its own process executes the lifecycle callback. This step blocks the controller of the non-main process from controlling the Activity.
[0123] (9) Complete other native startup processes of the system and end.
[0124] Therefore, in this embodiment, the Activity that is not in the main process is hosted by the TaskFragment of the main process on the system side, and its size and position are controlled by the main process of the application. When the Activity that is not in the main process executes the life cycle callback, the control operation requested by the controller of the process in which it is located is intercepted, and it will not be controlled by controllers other than the main process on the application side. When the user performs interface operations, the activities of other processes are controlled by the controller of the main process, and the size and position of the interface are switched, and there will be no interface confusion under the control of a single controller.
[0125] In one embodiment, after the above S30, “creating a system layer container through the target main process to control the display of the second application interface”, the following steps are included:
[0126] S80, obtaining an operation event for the displayed second application interface;
[0127] S90: According to the operation event, control the display state of the second application interface through the target main process.
[0128] It should be noted that, in this embodiment, according to the above description, when an Activity that is not in the main process executes a lifecycle callback, the controller control operation of the requesting process is intercepted, and the application side will not be controlled by a controller other than the main process, resulting in the following problems:
[0129] If Activity2 is not in the main process, but requests full screen or exit full screen, because full screen and exit full screen involve changes in Activity size and boundaries, the controller needs to perform operations. However, according to the above description, all operations of the controller of the non-main process are intercepted, so the request for full screen or exit full screen of Activity2 in the non-main process will fail.
[0130] In order to solve the problem that the full-screen or full-screen exit request of the non-main process cannot be responded to, this embodiment can obtain an operation event for the displayed second application interface.
[0131] Among them, the process where the second application interface Activity2 is located is a non-main process (such as the second process), Activity2 is in a display state, and the interface control attribute parameters on the system side are hosted by taskFragment2 of the main process. At this time, the user can interact with Activity2 to request full-screen operation, such as requesting full-screen display of the second application interface or exiting full-screen display.
[0132] At this time, the system can encapsulate the operation event of Activity2 requesting full screen, where the operation event contains the event flag and the password of Activity, where the event flag is used to represent different event types (full screen display or exit full screen display). The password of the Activity actually refers to the Binder object in the event, which is associated with the application container TaskFragmentContainer and the system layer container TaskFragmnet. When the application process generates an operation event, based on the operation of the application side container (TaskFragmentContainer), a Binder object will be placed in the operation event. When the system side parses the event, it uses the Binder object to find the system layer container TaskFragment that the event acts on.
[0133] On this basis, the system can control the display state of the second application interface through the main process according to the above operation event, so that the second application interface is displayed in full screen or non-full screen, etc.
[0134] Furthermore, in the above S90, “controlling the display state of the second application interface through the target main process according to the operation event” may include:
[0135] S901, parsing the operation event to obtain an event type and an initial display password corresponding to the operation event;
[0136] S902, generating a target display password according to the event type and the initial display password;
[0137] S903: Control the display status of the second application interface through the target main process according to the target display password.
[0138] It should be noted that, in this embodiment, Activity2 can pass the event to controller Controller2 of the process where Activity2 is located, and Controller2 forwards the event to the system.
[0139] The system can parse the above operation event to obtain the event type and the initial display password in the operation event.
[0140] Among them, the initial display password can be understood as the password sent to Controller2 in the non-main process. However, since all operations of the controller of the non-main process will be intercepted, the system generates a target display password to control Controller1 in the main process according to the event type and the initial display password, so that the main process can control the display status of the second application interface in the non-main process. At this time, Activity2 can assume the role of information transmission in the controller of the process. In fact, the main process modifies the display position and size of the second application interface by adjusting the size and position of the system layer container taskFragment2, that is, the display status of the second application interface in the non-main process is controlled by the controller Controller1 of the main process.
[0141] On this basis, the system can generate a target display password acting on Controller1 in the main process according to the above event type and the initial display password, and control the display state of the second application interface through the main process according to the target display password.
[0142] Furthermore, in the above S902, "generating a target display password according to the event type and the initial display password" may include:
[0143] S9021, acquiring interface control attribute parameters corresponding to the second application interface according to the initial display password;
[0144] S9022, obtaining a target display container in the target main process where the interface control attribute parameter is located, and obtaining a display password associated with the target display container;
[0145] S9023: Determine a target display password according to the display password associated with the target display container and the event type.
[0146] In this embodiment, the system can find the corresponding ActivityRecord2 according to the initial display password, and then find the target system layer container taskFragment2 in the main process where ActivityRecord2 is located through ActivityRecord2.
[0147] It is worth noting that according to the above description, the display password actually refers to the Binder object in the event. This Binder object is associated with the application container TaskFragmentContainer and the system layer container TaskFragmnet. Therefore, after determining the target system layer container taskFragment2, you can obtain the display password associated with the target system layer container taskFragment2, and determine the target display password based on the display password and the above event type.
[0148] Furthermore, in the above S9023, "determining a target display password according to the display password associated with the target display container and the event type" may include:
[0149] Step a: if the event type is exiting full-screen display, obtaining the historical boundary parameters of the second application interface according to the interface control attribute parameters, wherein the historical boundary parameters are the boundary parameters of the second application interface when it was last displayed in non-full-screen mode;
[0150] Step b, updating the initial display password to obtain a new display password according to the historical boundary parameter;
[0151] Step c: replacing the display password associated with the target display container with the new display password to obtain a target display password.
[0152] In this embodiment, if the event type is exiting full-screen display, after finding the corresponding ActivityRecord2, the boundary lastBound of ActivityRecord2 before the last full-screen display (that is, the historical boundary parameter in this embodiment) can be obtained, and then the initial display password can be updated according to the historical boundary parameter to obtain a new display password, so that the new display password can include the display parameters of the interface when the second application interface exits full-screen display (including display position and display size, etc.). Among them, when the system modifies the boundary of ActivityRecord2 to full screen, the boundary lastBound of ActivityRecord2 can be backed up in advance, so that the second application interface can be controlled to exit full screen and restore the size and position before entering full screen.
[0153] Furthermore, the display password associated with the target system layer container taskFragment2 is replaced with the new display password to obtain the target display password.
[0154] Furthermore, in the above S9023, "determining a target display password according to the display password associated with the target display container and the event type" may include:
[0155] Step d: If the event type is full screen display, the display password associated with the target display container is replaced with the initial display password to obtain a target display password.
[0156] In this embodiment, if the event type of the operation event is to exit full-screen display, after finding the corresponding ActivityRecord2 and finding the target system layer container taskFragment2 in the main process where ActivityRecord2 is located through ActivityRecord2, the display password associated with the target system layer container taskFragment2 can be directly replaced with the above-mentioned initial display password to obtain the target display password.
[0157] Furthermore, in the above S903, “controlling the display state of the second application interface through the target main process according to the target display password” may include:
[0158] S9031, parsing the target display password to obtain target display parameters of the target display container;
[0159] S9032: Control the display status of the second application interface according to the target display parameter.
[0160] In this embodiment, after generating the target display password, the system can parse the target display password to obtain the target display parameters of the target system layer container taskFragment2, such as display position and display size, etc. Then, the taskFragment2 boundary can be modified.
[0161] For example, if the event type is to exit full-screen display, the bounds of taskFragment2 can be modified to lastBound, and Activity2 follows taskFragment2 to modify the bounds to lastBound, restoring the size and position before entering full screen; if the event type is full-screen display, the bounds of taskFragment2 can be modified to the screen size, and Activity2 follows taskFragment2 to display in full screen.
[0162] In a specific embodiment, Figure 7 As shown, the process of requesting full-screen operation in a non-main process interface may include:
[0163] (1) The process where Activity2 is located is not the main process. Activity2 is in the display state. On the system side, ActivityRecord2 is hosted by taskFragment2 of the main process. The user interacts with Activity2 and requests full-screen operation.
[0164] (2) Identify the full-screen operation type. If it is to enter full-screen, go to (3); otherwise, go to (8);
[0165] (3) When the system changes the boundary of ActivityRecord2 to full screen, back up the boundary lastBound of ActivityRecord2;
[0166] (4) Encapsulate the operation event of Activity2 requesting full screen, including the event flag and the activity password;
[0167] (5) The event is passed to Controller2 of the process where Activity2 is located, and Controller2 forwards the event to the system;
[0168] (6) The system parses the passed event, identifies the event flag as a full-screen request, and starts executing the cross-process full-screen request operation, including finding ActivityRecord2 through the password of Activity2, finding taskFragment2 through ActivityRecord2, finding the password of Controller1 through taskFragment2, replacing the password of Controller2 with Controller1, and generating an event to modify the boundary of taskFrgament2 to full-screen;
[0169] (7) The system uses the Controller1 command to modify the boundary of taskFragment2 to full screen. Activity2 follows taskFragment2 and displays in full screen, completing Activity2's full screen request.
[0170] (8) Encapsulate the operation event of Activity2 requesting full screen, including the event flag and the activity password;
[0171] (9) The event is passed to Controller2 of the process where Activity2 is located, and Controller2 forwards the event to the system;
[0172] (10) The system parses the event passed in, identifies the event flag as exiting full screen, and starts executing the cross-process request to exit full screen, including finding ActivityRecord2 through the password of Activity2, obtaining the lastBound of ActivityRecord2 before the last full screen, finding taskFragment2 through ActivityRecord2, finding the password of Controller1 through taskFragment2, replacing the password of Controller2 with Controller1, and generating an event to modify the boundary of taskFrgament2 to lastBound;
[0173] (11) The system uses the command of Controller1 to modify the boundary of taskFragment to lastBound. Activity2 follows taskFragment2 to modify the boundary to lastBound, restores the size and position before entering full screen, and completes Activity2's request to exit full screen.
[0174] (12) Complete the full-screen operation request of Activity2 of the non-main process.
[0175] Through the above supplement, when Activity2 of non-main process requests full screen or exits full screen, it actually requires the controller of the process where Activity2 is located to assume the role of information transmission. What is actually modified is the size and position of taskFragment2 of the main process, and the controller Controller1 of the main process is also the one that actually controls the interface.
[0176] In general, this embodiment can handle the business needs of the interface being in a non-main process and requesting full screen, and can also handle the business needs of requesting to exit full screen after the non-main process interface is full screen, so that the interface is restored to the position and size before full screen.
[0177] Accordingly, the embodiment of the present application also provides an interface display control device, such as Figure 8 As shown, the interface display control device includes:
[0178] An acquisition module 1001 is used to respond to a trigger operation on a first application interface for launching a second application interface, and acquire a first process of the first application interface; wherein the process of the first application interface and the process of the second application interface are different processes;
[0179] An interception module 1002 is used to intercept an operation of the first process creating a container for controlling display of a second application interface when the first process is not a target main process;
[0180] The creation module 1003 is used to create a display container through the target main process to control the display of the second application interface.
[0181] Optionally, the creation module 1003 further includes:
[0182] When the first process is the target main process, a display container of the second application interface is created through the first process to control the display of the second application interface.
[0183] Optionally, the display container includes at least a system layer container;
[0184] The creation module 1003 is also used for:
[0185] Creating a system layer container of the second application interface through the target main process;
[0186] The interface control attribute parameters of the second application interface are added to the child node of the system layer container to control the display of the second application interface.
[0187] Optionally, the display container further includes an application layer container, and the creation module 1003 is further used to:
[0188] The target instruction associated with the interface control attribute parameter in the control instruction is passed to the application layer container corresponding to the second application interface, so as to control the second application interface to adjust the display parameters according to the target instruction.
[0189] Optionally, the interface display control device in this embodiment further includes:
[0190] A process creation module is used to create a second process corresponding to the second application interface; when the second process is not a target main process, the step of creating a display container through the target main process is executed.
[0191] Optionally, the interface display control device in this embodiment further includes:
[0192] An interface acquisition module, used to respond to a trigger operation acting on the system interaction interface and acquire at least one application interface to be started;
[0193] The process determination module is used to set the process corresponding to the first application interface started in the application interface as the target main process.
[0194] Optionally, the interface display control device in this embodiment further includes:
[0195] An event acquisition module, used to acquire an operation event for the displayed second application interface;
[0196] A display control module is used to control the display state of the second application interface through the target main process according to the operation event.
[0197] Optionally, the display control module is further used to:
[0198] Parsing the operation event to obtain an event type and an initial display password corresponding to the operation event;
[0199] Generate a target display password according to the event type and the initial display password;
[0200] According to the target display password, the display state of the second application interface is controlled through the target main process.
[0201] Optionally, the display control module is further used for:
[0202] According to the initial display password, obtaining interface control attribute parameters corresponding to the second application interface;
[0203] Acquire a target display container in the target main process where the interface control attribute parameter is located, and acquire a display password associated with the target display container;
[0204] A target display password is determined according to the display password associated with the target display container and the event type.
[0205] Optionally, the display control module is further used for:
[0206] If the event type is exiting full-screen display, obtaining the backed-up historical boundary parameters of the second application interface according to the interface control attribute parameters, wherein the historical boundary parameters are the boundary parameters of the second application interface when it was last displayed in non-full-screen mode;
[0207] According to the historical boundary parameter, updating the initial display password to obtain a new display password;
[0208] The display password associated with the target display container is replaced with the new display password to obtain a target display password.
[0209] Optionally, the display control module is further used for:
[0210] If the event type is full-screen display, the display password associated with the target display container is replaced with the initial display password to obtain a target display password.
[0211] Optionally, the display control module is further used for:
[0212] Parsing the target display password to obtain target display parameters of the target display container;
[0213] According to the target display parameter, the display state of the second application interface is controlled.
[0214] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0215] Accordingly, the present application also provides an electronic device, such as Fig. 9 As shown, Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1100 includes a processor 1101 having one or more processing cores, a memory 1102 having one or more computer-readable storage media, and a computer program stored in the memory 1102 and executable on the processor. The processor 1101 is electrically connected to the memory 1102. It will be understood by those skilled in the art that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0216] The processor 1101 is the control center of the electronic device 1100, and uses various interfaces and lines to connect various parts of the entire electronic device 1100. By running or loading software programs and / or units stored in the memory 1102, and calling data stored in the memory 1102, the processor 1101 executes various functions of the electronic device 1100 and processes data, thereby monitoring the electronic device 1100 as a whole. The processor 1101 can be a processor (Central Processing Unit, CPU), a graphics processing unit (graphics processing unit, GPU), a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0217] In the embodiment of the present application, the processor 1101 in the electronic device 1100 will load instructions corresponding to the processes of one or more application programs into the memory 1102 according to the following steps, and the processor 1101 will run the application programs stored in the memory 1102 to implement various functions, such as:
[0218] In response to a trigger operation on a first application interface for launching a second application interface, obtaining a first process of the first application interface; wherein the process of the first application interface and the process of the second application interface are different processes;
[0219] When the first process is not the target main process, intercepting an operation of the first process to create a container for controlling display of a second application interface;
[0220] A display container is created through the target main process to control the display of the second application interface.
[0221] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0222] Optional, such as Fig. 9 As shown, the electronic device 1100 further includes: a touch screen 1103, a radio frequency circuit 1104, an audio circuit 1105, an input unit 1106, and a power supply 1107. The processor 1101 is electrically connected to the touch screen 1103, the radio frequency circuit 1104, the audio circuit 1105, the input unit 1106, and the power supply 1107, respectively. Those skilled in the art can understand that Fig. 9 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0223] The touch display screen 1103 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1103 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-EmittingDiode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch electronic device and a touch controller. Among them, the touch electronic device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch electronic device, converts it into the touch point coordinates, and then sends it to the processor 1101, and can receive the command sent by the processor 1101 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1101 to determine the type of touch event, and then the processor 1101 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 1103 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 1103 can also be used as a part of the input unit 1106 to realize the input function.
[0224] The radio frequency circuit 1104 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals between the network device or other electronic devices.
[0225] The audio circuit 1105 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 1105 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1105 and converted into audio data, and then the audio data is output to the processor 1101 for processing, and then sent to another electronic device through the radio frequency circuit 1104, or the audio data is output to the memory 1102 for further processing. The audio circuit 1105 may also include an earplug jack to provide communication between an external headset and an electronic device.
[0226] The input unit 1106 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0227] The power supply 1107 is used to supply power to various components of the electronic device 1100. Optionally, the power supply 1107 can be logically connected to the processor 1101 through a power management device, so that the power management device can manage charging, discharging, power consumption and other functions. The power supply 1107 can also include one or more DC or AC power supplies, recharging power supply fault detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0228] although Fig. 9 Not shown, the electronic device 1100 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0229] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0230] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0231] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored. The computer program can be loaded by a processor to execute any one of the interface display control methods provided in the embodiments of the present application. The computer program can execute the following steps of the interface display control method:
[0232] In response to a trigger operation on a first application interface for launching a second application interface, obtaining a first process of the first application interface; wherein the process of the first application interface and the process of the second application interface are different processes;
[0233] When the first process is not the target main process, intercepting an operation of the first process to create a container for controlling display of a second application interface;
[0234] A display container is created through the target main process to control the display of the second application interface.
[0235] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0236] Since the computer program stored in the computer-readable storage medium can execute any one of the interface display control methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the interface display control methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0237] In the above-mentioned devices, electronic devices, vehicles, computer-readable storage media, and computer program products, the descriptions of various embodiments have different focuses. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes and beneficial effects of the above-mentioned devices, computer-readable storage media, electronic devices, vehicles, computer program products, and their corresponding units can refer to the description of the interface display control method in the above embodiment, and will not be repeated here.
[0238] The above are only preferred embodiments of the present application and do not constitute any form of limitation to the present application. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.
Claims
1. An interface display control method, characterized in that: The interface display control method comprises: In response to a trigger operation on a first application interface for launching a second application interface, obtaining a first process of the first application interface; wherein the process of the first application interface and the process of the second application interface are different processes; When the first process is not the target main process, intercepting an operation of the first process to create a container for controlling display of a second application interface; A display container is created through the target main process to control the display of the second application interface.
2. The method according to claim 1, characterized in that The method further comprises: When the first process is the target main process, a display container of the second application interface is created through the first process to control the display of the second application interface.
3. The method according to claim 1, characterized in that The display container at least includes a system layer container; The creating a display container through the target main process to control the display of the second application interface includes: Creating a system layer container of the second application interface through the target main process; The interface control attribute parameters of the second application interface are added to the child node of the system layer container to control the display of the second application interface.
4. The method according to claim 3, characterized in that The display container further includes an application layer container, and the controlling the display of the second application interface includes: The target instruction associated with the interface control attribute parameter in the control instruction is passed to the application layer container corresponding to the second application interface, so as to control the second application interface to adjust the display parameters according to the target instruction.
5. The method according to claim 1, characterized in that: Before creating a display container by the target main process, the method further includes: Creating a second process corresponding to the second application interface; In a case where the second process is not the target main process, the step of creating a display container through the target main process is performed.
6. The method according to claim 1, characterized in that In response to the triggering operation for launching the second application interface on the first application interface, before acquiring the first process of the first application interface, the method further includes: In response to a trigger operation acting on a system interaction interface, obtaining at least one application interface to be started; The process corresponding to the first application interface started in the application interfaces is set as the target main process.
7. The method according to any one of claims 1 to 6, characterized in that: After creating a display container through the target main process to control the display of the second application interface, the method further includes: Obtaining an operation event for the displayed second application interface; According to the operation event, the display state of the second application interface is controlled through the target main process.
8. The method according to claim 7, characterized in that The controlling the display state of the second application interface through the target main process according to the operation event includes: Parsing the operation event to obtain an event type and an initial display password corresponding to the operation event; Generate a target display password according to the event type and the initial display password; According to the target display password, the display state of the second application interface is controlled through the target main process.
9. The method according to claim 8, characterized in that The step of generating a target display password according to the event flag and the initial display password comprises: According to the initial display password, obtaining interface control attribute parameters corresponding to the second application interface; Acquire a target display container in the target main process where the interface control attribute parameter is located, and acquire a display password associated with the target display container; A target display password is determined according to the display password associated with the target display container and the event type.
10. The method according to claim 9, characterized in that The step of determining the target display password according to the display password associated with the target display container and the event type includes: If the event type is exiting full-screen display, obtaining the backed-up historical boundary parameters of the second application interface according to the interface control attribute parameters, wherein the historical boundary parameters are the boundary parameters of the second application interface when it was last displayed in non-full-screen mode; According to the historical boundary parameter, updating the initial display password to obtain a new display password; The display password associated with the target display container is replaced with the new display password to obtain a target display password.
11. The method according to claim 10, characterized in that The step of determining the target display password according to the display password associated with the target display container and the event type includes: If the event type is full-screen display, the display password associated with the target display container is replaced with the initial display password to obtain a target display password.
12. The method according to claim 9, characterized in that The controlling the display state of the second application interface through the target main process according to the target display password includes: Parsing the target display password to obtain target display parameters of the target display container; According to the target display parameter, the display state of the second application interface is controlled.
13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 12.
14. A vehicle, characterized in that: The vehicle is provided with the electronic device according to claim 12.
15. A computer-readable storage medium, characterized in that: It comprises a computer program, and when the computer program is run on an electronic device, the computer program is used to make the electronic device execute the steps of any one of the methods of claims 1 to 12.
16. A computer program product, characterized in that It includes a computer program, which is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any method described in claims 1 to 12.
Citation Information
Cited By
Interface display control method, and electronic device, vehicle, mediums and product
WO2026066339A1