Disclosure of Invention
The embodiment of the application provides a window display method and an intelligent television, which are used for displaying display windows of a plurality of interfaces in the same screen.
The window display method provided by the embodiment of the application comprises the following steps:
receiving a request to launch a second interface on a first interface;
judging whether the request carries information for indicating that a small window is adopted to display the second interface or not;
and if so, starting the second interface according to the information, and displaying the second interface by adopting a small window.
By the method, a request for starting a second interface is received on a first interface; judging whether the request carries information for indicating that a small window is adopted to display the second interface or not; and if so, starting the second interface according to the information, and displaying the second interface by adopting a small window. Therefore, the second interface is displayed by adopting the small window, the second interface can be prevented from adopting a default full-screen display mode according to the Activity starting rule of the android system, and the display windows of the first interface and the second interface can be presented in the same screen at the same time.
Optionally, the first parameter included in the information is used to instruct the second interface to be displayed by a small window. Optionally, the information includes a second parameter and a third parameter, the second parameter is used to indicate a display size of the widget corresponding to the second interface, and the third parameter is used to indicate a display position of the widget corresponding to the second interface.
Optionally, before displaying the second interface with a small window, the method further includes:
determining a display boundary of a small window corresponding to the second interface according to the second parameter;
and determining the display position of the small window in the full screen according to the third parameter.
Optionally, before displaying the second interface with a small window, the method further includes:
and setting the theme corresponding to the second interface as transparent so as to keep the first interface visible.
Optionally, when the second interface is displayed by using a small window, the first interface is displayed by using a full-screen window or a small window. Optionally, receiving a request for displaying a second interface by using a full screen window;
and displaying the second interface displayed in the small window by adopting a full-screen window.
Correspondingly, the embodiment of the application provides a smart television, including:
the receiving unit is used for receiving a request for starting a second interface on the first interface;
the judging unit is used for judging whether the request carries information for indicating that the second interface is displayed by adopting a small window or not;
and if so, starting the second interface according to the information, and displaying the second interface by adopting a small window.
An embodiment of the present application further provides an intelligent television, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing any one of the methods provided by the embodiment of the application according to the obtained program.
Another embodiment of the present application provides a computer storage medium having stored thereon computer-executable instructions for causing a computer to perform any one of the methods described above.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
According to the embodiment of the application, the Android frame Activity startup attribute and the Window display are modified, so that the multi-Window display effect can be achieved, and the limitation of an Android version is not required.
In the related art, in an Android system supporting only an application stack, when ActivityB is started on ActivityA, a display area of ActivityB corresponds to a full screen by default, and thus only one full screen window displaying ActivityB is displayed. Therefore, in order to realize the multi-window display effect under one application stack, the display area of the ActivityB is limited in the area limited by the range of the specified boundary mBounds, and the display area of the activityA is unchanged, so that the activityA and the activityB respectively correspond to different display windows.
Further, in the related art, since ActivityB is overlaid on ActivityA, the lifecycle of ActivityA enters a Pause state; and when the theme of the ActivityB is opaque, the Android system changes the state of the ActivityA from visible to invisible, so that the ActivityA cannot be displayed. Therefore, the me of the activityB is set to be transparent in the application, so that the state of the activityA is still visible according to the current Android system rule, and both the activityA and the activityB are displayed.
Various embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the display sequence of the embodiment of the present application only represents the sequence of the embodiment, and does not represent the merits of the technical solutions provided by the embodiments.
Referring to fig. 1, an embodiment of the present application provides a window display method, including:
s101, receiving a request for starting a second interface on a first interface;
s102, judging whether the request carries information for indicating that a small window is adopted to display the second interface or not;
for example, the television system detects that the request carries the parameter FLAG _ ADJUST _ WIN _ ENABLED _ LEFT _ TOP _4, and determines to display the second interface using the widget.
And S103, if yes, starting the second interface according to the information, and displaying the second interface by adopting a small window.
Taking the example of starting activityB in activityA, the specific implementation method is as follows:
step one, ActivityA sends an Activity starting request to a framework, wherein the framework is a television system for example;
step two, the framework receives the request, checks the validity of the request and analyzes the information carried when ActivityB is started; the carried information comprises a group of predefined constants with special meanings, 20-30 common constants are used at present, and the carried information is used for indicating that the mode for starting activityB is a small window;
step three, the framework modifies the life cycle of the activityA into a Pause state, and then determines whether the activityA is modified into a visible state or not according to whether the theme of the activityB is transparent or not;
and step four, changing the activityB state into a visible state by the framework, and drawing an activityB interface UI according to mBounds set for activityB contained in the information.
More specifically, referring to fig. 2, a flowchart of a method for executing inside a frame for window display provided in an embodiment of the present application takes initiating an ActivityB in ActivityA as an example, and specifically includes:
firstly, a frame receives an activityB starting request sent by activityA, and detects whether the starting request contains a parameter FLAG _ ADJUST or not; the parameter is used for indicating that activityB adopts a small window display mode;
if the parameter FLAG _ ADJUST is not contained, enabling the activityB to be normally started in a full screen mode;
if the parameter FLAG _ ADJUST is included, the parameter Full Screen FLAG in the Activity Task corresponding to the Activity b is modified to be FLAG, that is, the frame forces the me of the Activity b to be transparent, so that the Activity a still keeps a visible state according to the current android system rule.
Then, detecting whether a start request carries a screen adjustment parameter WIN _ ENABLED _ LEFT _ TOP _4 or not; the parameter is used for indicating the boundary size and position of a display window corresponding to activityB;
if the screen adjustment parameters are not carried, the activityB is normally started in a full screen mode;
if the screen adjustment parameter is carried, calculating mBounds of the display window corresponding to the activityB according to the window adjustment coefficient in the parameter, and determining the position of the mBounds of the display window corresponding to the activityB in the screen according to the window position information in the parameter;
then, making a special mark on the ActivityB window starting attribute for indicating that the ActivityB window is displayed as a small window;
ActivityB then starts and is displayed with a small window. For example, as shown in fig. 3, a multi-window effect diagram for displaying ActivityB by using a small window provided by the embodiment of the present application is provided, in which the small window displaying ActivityB is located at the upper right of the screen, and the size of the boundary is one fourth of the size of the screen; the full screen window displaying ActivityA remains displayed full screen.
It should be noted that, in the interface shown in fig. 3, when the ActivityB is displayed by using a small window, the display area corresponding to the ActivityA may also be modified from a full-screen window to a small window to meet the user requirement, which is not limited in this embodiment.
It should be noted that, for example, the size of the border of the window corresponding to ActivityB may be one third, one fourth or one fifth of the screen, and the position of the window corresponding to ActivityB may be left upper, right upper, left lower or right lower. Combining the size and the position of the boundary, the display area of the window corresponding to the activityB can be 12, for example, the window corresponding to the activityB is positioned at the upper left of the screen, and the size of the boundary is one third of the screen; the window corresponding to the activityB is positioned at the upper left of the screen, and the size of the boundary is one fourth of the size of the screen; the window corresponding to the activityB is positioned at the upper left of the screen, and the size of the boundary is one fifth of that of the screen; the window corresponding to the activityB is positioned at the upper right of the screen, and the size of the boundary is one third of that of the screen; the window corresponding to the activityB is positioned at the upper right of the screen, and the size of the boundary is one fourth of the size of the screen; the window corresponding to the activityB is positioned at the upper right of the screen, and the size of the boundary is one fifth of that of the screen; the window corresponding to the activityB is positioned at the lower left of the screen, and the size of the boundary is one third of that of the screen; the window corresponding to the activityB is positioned at the lower left of the screen, and the size of the boundary is one fourth of the size of the screen; the window corresponding to the activityB is positioned at the lower left of the screen, and the size of the boundary is one fifth of that of the screen; the window corresponding to the activityB is positioned at the right lower part of the screen, and the size of the boundary is one third of that of the screen; the window corresponding to the activityB is positioned at the lower right of the screen, and the size of the boundary is one fourth of the size of the screen; the window corresponding to activityB is located at the lower right of the screen, and the size of the border is one fifth of the size of the screen.
Specifically, for example, when ActivityB is requested to be started, the following parameters are carried in the start request: after the frame receives the set of parameters, the frame firstly resolves to a parameter FLAG _ ADJUST, which indicates that ActivityB is displayed by a small window. Then setting the parameter Full Screen Flag in the Activity Task corresponding to ActivityB as Flag, which indicates that the me of ActivityB is transparent. Then, according to the convention, the window adjustment coefficient is 4 obtained from the _4 parameter, and the window obtained from the _ LEFT _ TOP parameter is positioned at the upper LEFT of the screen. Then, mBounds [0,1920/4,0,1080/4] corresponding to activityB is calculated according to the window adjustment coefficient, namely mBounds [0,480,0,270], that is, the width of activityB is one fourth of the width of the screen, namely the width is 480, and the height is one fourth of the height of the screen, namely the height is 270. Thus, the framework displays ActivityB at [0,480,0,270] m bones at the upper left of the screen while the display state of ActivityA remains unchanged.
When a user wants to display ActivityB in full screen, by clicking a key on a remote controller, the special mark of the original ActivityB displayed by using a small window is removed, for example, the marked parameters are: music-window-area, true, then ActivityB is displayed in a full screen window. As shown in fig. 4, an effect diagram of displaying ActivityB using a full-screen window is provided for the embodiment of the present application.
According to the embodiment of the application, the Android system Activity full-screen attribute is modified, the Android window display mechanism is modified, the interactive mode which can be flexibly applied to the whole intelligent television system is provided, the multi-window effect is achieved, and the method is applicable to various third-party applications (such as QQ music, love art, Youku and other various playing applications) without distinguishing Android versions.
Correspondingly, referring to fig. 5, an embodiment of the present application provides an intelligent television, including:
a receivingunit 11, configured to receive, on a first interface, a request for starting a second interface;
a determiningunit 12, configured to determine whether the request carries information indicating that the second interface is displayed by using a small window;
and theprocessing unit 13 is configured to start the second interface according to the information and display the second interface by using a small window if the second interface is the first interface.
Referring to fig. 6, an embodiment of the present application further provides a smart television, including: aprocessor 600, amemory 610, auser interface 620, and a bus interface.
Where in fig. 6, the bus architecture may include any number of interconnected buses and bridges, with various circuits being linked together, particularly one or more processors, represented byprocessor 600, and memory, represented bymemory 610. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface.
Alternatively, theuser interface 620 may be an interface capable of interfacing externally to a desired device, including but not limited to a keypad, display, speaker, microphone, joystick, etc.
Theprocessor 600 is responsible for managing the bus architecture and general processing, and thememory 610 may store data used by theprocessor 600 in performing operations.
Alternatively, theprocessor 600 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
Memory 610 may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides the processor with program instructions and data stored in the memory. In the embodiments of the present application, the memory may be used for storing a program of any one of the methods provided by the embodiments of the present application.
The processor is used for executing the method provided by the embodiment of the application and described in fig. 1 or fig. 2 according to the obtained program instruction by calling the program instruction stored in the memory, so as to realize that the display windows of multiple interfaces can be presented in the same screen, and avoid the problem that the previously displayed window is not visible due to full-screen display of a new window.
The embodiment of the present application provides a computer storage medium, configured to store computer program instructions for the smart television provided in the embodiment of the present application, where the computer program instructions include a program for executing the method described in fig. 1 or fig. 2 provided in the embodiment of the present application.
The computer storage media may be any available media or data storage device that can be accessed by a computer, including, but not limited to, magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs)), etc.
In summary, according to the window display method and the smart television provided by the embodiment of the application, the newly started second interface is displayed through the small window, so that the second interface can be prevented from adopting a default full-screen display mode according to the Activity starting rule of the android system, and display windows of multiple interfaces can be presented in the same screen.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.