Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In order to make the solution shown in the embodiments of the present application easy to understand, several terms appearing in the embodiments of the present application will be described below.
The target application comprises the following steps: the application capable of being displayed on the full screen of the terminal can be a system application or a third-party application. In a possible application scenario, the target application may be at least one of a gaming application, an input method application, a browser application, a wallpaper application, a system tool application, a life-facilitating application, a video-audio playing application, a call communication application, a social networking application, a theme plug-in application, a shoot-beautifying application, a news information application, a book reading application, a learning and office application, an online shopping payment application, a financial management application, an original publishing application, a map navigation application, a take-away application, a network taxi-calling application, a shared bicycle application, a sports fitness application, a ticketing application, a live broadcast application, a convenience-of-supermarket application, an application store application, and a smart device application.
Notification element: in one possible scenario, the notification element is used to display message content of the notification message, for example, when the notification element is notification content, the notification content may include at least one of text, picture, audio, and video.
In another possible scenario, the notification element is for receiving a control instruction, e.g., when the notification element is at least one of a button, a check box, and a slider, the notification element may receive at least one of a click, a selection, and a drag. And the control instruction is used for instructing the terminal to execute the operation corresponding to the notification element. For example, when the notification element closes the button, the control instruction is used to instruct the terminal to close the display of the notification message. Or, when the notification element is an answer button, the control instruction is used for instructing the terminal to connect the current incoming call.
In yet another possible scenario, the notification element may be used for both displaying the message content and receiving a control instruction, for example, when the notification element has notification content with a transparent control layer, and a screen area displaying the notification content is clicked, the transparent control layer can be triggered, so that the screen jumps to display a user interface corresponding to the notification content.
Optionally, the notification element includes at least one of a notification title, a notification content, a notification button, and a notification dialog. The notification button can receive a click command, and the command is generated when the user clicks the notification button when the command is clicked. The notification title is text indicating the subject of one notification. The notification content is a part of main information for indicating a piece of notification, and may be implemented as at least one of text, picture, audio, and video. The notification dialog is a box that receives user input text.
Displaying the template: the template may be preset in the system, different templates correspond to a corresponding notification display frame, and the layout of each display element may be specified in one notification display frame. That is, one template specifies the type, number, and display area of display elements displayed in the corresponding notification display box.
A notification display frame: is a notification frame generated by a system service or system application according to a display template and a display element, and the background of the notification frame is transparent or semi-transparent. In one possible implementation, the transparency of the background may be a constant value that is preset to be determined. In another possible implementation, the transparency of the background may also be determined according to the type of application, for example, when the target application is a video application, the transparency is 75%; when the target application is a gaming application, the transparency is 50%. It should be noted that the transparent background may be a background with a transparency of 100%, and the translucent background may be a background with a transparency in an interval from greater than zero to less than 1.
Optionally, in one possible application scenario, the terminal will display the notification dialog in the top region of the user interface of the target application, which is the region against the upper edge of the user interface. In another possible application scenario, the terminal will display the notification dialog in a side region of the user interface of the target application, the side region referring to the display region abutting the left edge and/or the display region within the right edge of the user interface. The notification dialog box is displayed in the edge area of the user interface of the target application, so that the shielding of the user interface of the target application can be reduced to the maximum extent, and meanwhile, the effect of displaying the notification message to the user for viewing can be achieved.
The terminal to which the present disclosure is applied is a terminal having a display screen. The display screen can be an LED display screen or a projection display screen. Alternatively, the terminal to which the present application is applied may be a device capable of directly projecting an image to the fundus of the user. In one possible application scenario, the terminal may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal computer, a server, a workstation, a television, a set-top box, smart glasses, a smart watch, a digital camera, an MP4 player terminal, an MP5 player terminal, a learning machine, a point-and-read machine, an electronic book, an electronic dictionary, a vehicle-mounted terminal, a Virtual Reality (VR) player terminal, an Augmented Reality (AR) player terminal, or the like.
Please refer to fig. 1, which is a flowchart illustrating a method for displaying a notification message according to an exemplary embodiment of the present application. The method for displaying the notification message can be applied to the terminal. In fig. 1, a method of displaying a notification message includes:
step 110, when the terminal displays the user interface of the target application in a full screen mode and receives an instruction for displaying the notification message, acquiring a notification element corresponding to the notification message; the notification element is used for displaying the message content of the notification message, and/or the notification element is used for receiving a control instruction, and the control instruction is used for instructing the terminal to execute the operation corresponding to the notification element.
In the embodiment of the present application, the terminal may invoke a system service or system application to performstep 110. The system application or system service can monitor whether the user interface of the target application is displayed in a full screen mode in a screen of the terminal. In addition, the system application or system service may also monitor that the terminal receives an instruction to display a notification message. When the system application or the system service displays the user interface of the target application in a full screen mode on the terminal and receives an instruction for displaying the notification message, the notification element corresponding to the notification message is obtained. The notification is originally used for displaying the display content of the notification message, and/or the notification element is used for receiving a control instruction, and the control instruction is used for instructing the terminal to execute the operation corresponding to the notification element.
It should be noted that, in the embodiment of the present application, the terminal can provide a switch for optimizing the display of the banner and the dialog box in the setting interface, and the switch may be named as "banner and dialog box optimized display". When the user turns on the switch, the terminal enables the optimization function of the scroll and the dialog box, and then the terminal can implement the scheme. In another possible implementation manner, the terminal starts the optimization function of the banner and the dialog box by default, and the user does not need to set the optimization function in the setting interface.
And step 120, acquiring a display template corresponding to the notification element.
In the embodiment of the application, the terminal can obtain the display template corresponding to the notification element.
Optionally, the system service or the system application in the terminal can obtain the display template corresponding to the notification element according to the number, the display area, and/or the type of the notification element.
In a possible manner, the terminal may search for a completely matched display template according to all the acquired notification elements. For example, all notification elements acquired by the terminal include one notification title, one notification content, and two notification buttons. The terminal determines only a display template capable of simultaneously displaying one notification title, one notification content, and two notification buttons as a display template that exactly matches the notification element.
In another possible manner, the terminal may find a matching display template according to some of the acquired notification elements, for example, all the notification elements acquired by the terminal include a notification title "colleague a", a notification content "personnel group leader" and two notification buttons, where the two notification buttons are an "answer button" and a "reject button", respectively. The terminal may determine a display template capable of displaying the notification title and the two notification buttons as the display template corresponding to the notification element, only according to the notification title and the two notification buttons matching the display template in the notification element. Therefore, in the matching mode, the terminal matches the display template corresponding to the display element according to the number and the type of the notification elements.
In a possible implementation manner, the terminal may further select a corresponding display template according to the display area of the notification element. For example, the width and display font size of the display template are determined, the text of the notification content may be determined by the number of lines. When the text of the notification content is not greater than the line number threshold, the terminal will select the display template without the notification content expansion button. When the text of the notification content is larger than the line number threshold, the terminal selects a display template with a notification content expansion button.
For example, please refer to fig. 2, which is a schematic diagram of a notification display box corresponding to a display template provided based on the embodiment shown in fig. 1. In fig. 2, anotification title 211, anotification content 212, and anotification button 213 are included in thenotification display frame 21. Thenotification display frame 22 includes anotification title 221,notification contents 222, anotification button 223, and a notificationcontent expansion button 224. When the line number of the display content in the display element does not exceed 2 lines, the terminal determines that thenotification display frame 21 is a display template corresponding to the display element. When the number of lines of the display content of the display element exceeds 2 lines, the terminal determines that thenotification display frame 22 is a display template corresponding to the display element. When the notificationcontent expansion button 224 is triggered by the user clicking, the terminal expands the frame of thenotification content 222 and displays the complete content of the notification content.
It should be noted that the screen of the terminal shown in fig. 2 is displaying the user interface of the target application in full screen.
In another possible implementation manner, the terminal may still notify thedisplay frame 21 to determine as the display template corresponding to the display element when the number of lines of the display content of the display element exceeds 2 lines. However, an ellipsis "…" is displayed at the end of thenotification content 222, indicating that some of thenotification content 222 is not displayed.
It should be noted that before the system service or the system application obtains the display template corresponding to the notification element according to the number, the display area, and/or the type of the notification element, the corresponding target template library can be determined according to the application identifier of the target application. For example, please refer to table one.
Watch 1
| Application identification | Game a | Game b | Video application c | Live application d |
| Object template library | Template library A | Template library A | Template library B | Template library C |
In the present application, the application identifier may be an installation package name of the application. Such as "game a", "game b", "video app c", or "live app c" in table one. In one possible implementation, the installation package name may be implemented in the form of "com. Different application identifications may correspond to the same target template library, for example, game a and game b both correspond to target template library "template library a".
After the target template library is determined, the terminal can acquire the display template corresponding to the notification element from the target template library according to the number, the display area and/or the type of the notification element.
And step 130, generating a notification display frame containing the notification elements according to the display template, wherein the notification display frame is a display frame with a transparent or semitransparent background.
In the embodiment of the application, a system service or a system application in the terminal generates a notification display frame containing notification elements according to a display template, wherein the notification display frame is a display frame with a transparent or semi-transparent background. The terminal system service or the system application typesets the display elements to preset positions in the display template, and can adjust texts in the display elements according to preset parameters such as fonts, word sizes, whether the fonts are bold and underline and the like set in the display template. Meanwhile, the system service or system application can adjust the picture in the display element according to parameters such as preset resolution and picture size. In addition, the system service or system application can generate a new notification button according to a preset button size and a button shape. The system service lays out the notification elements that need to be added to the notification display box to the place indicated by the display template.
For example, the notification elements include a notification title T1, a notification content T2, a notification button T3, and a notification button T4. The display template corresponding to the notification element determined by the system service or the system application is provided with positions for displaying the notification title T1, the notification button T3, and the notification button T4. In this scenario, the system service or system application will adjust the notification title T1 according to the text parameters and picture parameters, etc. preset by the display template, and simultaneously generate new notification buttons corresponding to the notification button T3 and the notification button T4, respectively, according to the preset button size and button shape.
Atstep 140, a notification display box is displayed in the user interface of the target application.
In an embodiment of the application, a system service or system application displays a notification display box in a user interface of a target application.
In a possible implementation manner, please refer to fig. 3, which is a schematic diagram of a display notification display box provided based on the embodiment shown in fig. 1. In fig. 3, thenotification display frame 31 is a display frame whose background is translucent. Also, thenotification display frame 31 is displayed on the top area 33 of theuser interface 32, the top area 33 being adjacent to the edge of theuser interface 32. Therefore, thenotification display frame 31 can display the notification elements that need to be displayed therein with as little obstruction as possible of theuser interface 32. In thenotification display frame 31, anotification title 311, anotification content 312, and anotification button 313 are displayed.
Optionally, in another possible implementation manner, please refer to fig. 4, which is a schematic diagram of another display notification display frame provided based on the embodiment shown in fig. 1. In thenotification display frame 41, anotification content 411, anotification button 412, and anotification button 413 are displayed.
In summary, in an implementation of the method for displaying a notification message provided in this embodiment, the terminal can be enabled to display a user interface of the target application in a full screen, and when an instruction to display the notification message is received, each notification element in the notification message is displayed by displaying a notification display frame with a transparent or semi-transparent background, where the notification element is a message content for displaying the notification message, or the notification message may also be a message content for receiving a control instruction. Therefore, on the premise of ensuring timely display of the notification message, the embodiment of the application can reduce the shielding of the user interface of the target application and improve the effect of simultaneously displaying the notification message and the user interface of the target application.
In connection with the above embodiment, the terminal can also control the display manner of the notification display frame according to the type of the notification message, and in detail, the following embodiments may be referred to.
Please refer to fig. 5, which is a flowchart illustrating a method for displaying a notification message according to another exemplary embodiment of the present application. The method for displaying the notification message can be applied to the terminal. In fig. 5, the method of displaying a notification message includes:
step 501, when the terminal receives an instruction for displaying a notification message, detecting whether the notification message contains a target mark.
In the embodiment of the application, the target mark is used for indicating that a notification display frame corresponding to the notification message is displayed in a user interface of the target application.
Step 502, when the notification message includes the target mark and the terminal displays the user interface of the target application in a full screen mode, acquiring a notification element in the notification message.
In the embodiment of the application, if the system service or the system application detects that the system message contains the target mark and the terminal displays the user interface of the target application in a full screen mode, the notification element in the notification message is acquired. Wherein the target mark may be a specific identifier.
Optionally, in another possible implementation manner of the embodiment of the present application, the system service or the system application may further detect a target identification bit to determine whether to acquire the notification element in the notification message, where the target identification bit is a binary digit, and a value of the target identification bit is a first value or a second value. And when the target identification position in the notification message is a first numerical value and the terminal displays the user interface of the target application in a full screen mode, acquiring a notification element in the notification message. Alternatively, when the first value is 1, the second value may be 0. When the first value is 0, the second value may be 1.
Step 503, acquiring a display template corresponding to the notification element.
In this embodiment, the execution process ofstep 503 is the same as the execution process ofstep 120, and is not described again.
Step 504, generating a notification display frame containing the notification element according to the display template, wherein the notification display frame is a display frame with a transparent or semitransparent background.
In this embodiment, the execution process ofstep 504 is the same as the execution process ofstep 130, and is not described again.
Step 505, a notification display box is displayed in a user interface of the target application.
In this embodiment, the execution process ofstep 505 is the same as the execution process ofstep 140, and is not described again.
Step 506, detecting the type of the notification message, wherein the type of the notification message comprises a notification bar notification message and a popup notification message.
In an embodiment of the application, a system service or a system application can detect the type of a notification message, wherein the type of the notification message comprises a notification bar notification message and a popup notification message.
In one aspect, the notification bar message is a message belonging to a system application or a third party application that disappears after being displayed at the top of the user interface for a predetermined length of time and resides in the notification bar. For example, notification messages such as news information of third party applications, new message reminders sent by contacts, and system spam alerts can be used as notification bar notification messages.
Alternatively, the pop-up notification message may be a notification issued by an application having a higher system authority. Since the pop-up notification message is displayed in the center of the screen, in the present application, the operating system of the terminal generally does not grant the authority to issue the pop-up notification message to the third-party application. In one possible implementation, the system application or system service grants the authority to issue the pop-up notification message to the critical system service, and performs the important system notification. For example, in one possible implementation, the critical system service may display important system notification messages such as insufficient power, full memory, and bluetooth pairing notifications via pop-up system messages.
After performing thecompletion step 506, the terminal determines to perform thesteps 507 and 508 or perform thesteps 509 and 510 according to the execution result.
And step 507, when the notification message is a notification message of the notification bar, setting a timer with a timing duration being a preset duration.
And step 508, hiding the notification display frame when the timer is overtime.
In the embodiment of the application, when the notification bar notifies the message, the system service or the system application sets the timer with the set timing duration as the preset duration. When the timer times out, the system service or system application will hide the notification display box. Avoiding the notification display frame from residing for a long time and blocking the user interface of the target application.
Instep 509, when the notification message is a pop-up notification message, it is detected whether a control command is received.
It should be noted that the system service or the system application will detect whether the terminal receives the control instruction when the notification message is a pop-up notification message.
And step 510, hiding the notification display frame when the control instruction is received.
In the embodiment of the present application, the information carried in the pop-up notification message is usually important. Thus, when no control instruction is received, the system service or system application will continue to display the notification display frame until the control instruction is received, the system service or system application will hide the notification display frame. For example, in the user interface shown in fig. 4, when the terminal receives a control instruction acting on thenotification button 413, the system service or the system application will hide the notification display frame. That is, when thenotification button 413 "knows" is clicked, the terminal will directly hide thenotification display frame 41.
In summary, in the method for displaying a notification message provided in this embodiment, when the terminal receives an instruction to display the notification message, it is detected whether the notification message includes a target mark, when the notification message includes the target mark and the terminal displays a user interface of a target application in a full screen manner, a notification element in the notification message is acquired, a display template corresponding to the notification element is acquired, a notification display frame including the notification element is generated according to the display template, the notification display frame is a display frame whose background is transparent or translucent, the notification display frame is displayed in the user interface of the target application, and a type of the notification message is detected, where the type of the notification message includes a notification bar notification message and a pop-up window notification message.
On one hand, when the notification message is a notification bar notification message, a timer with a timing duration being a preset duration is set, and when the timer is overtime, the notification display frame is hidden. Therefore, the terminal can display and display the transparent or semitransparent notification display frame within the preset time length when the notification message contains the target mark and the user interface of the target application is displayed in a full screen mode. Therefore, the embodiment of the application reduces the shielding of the current user interface on the premise of ensuring the timely display of the notification message.
On the other hand, when the notification message is a pop-up notification message, the system service or the system application detects whether a control instruction is received, and when the control instruction is received, hides the notification display frame. Therefore, the popup notification message can be continuously displayed when the terminal does not receive the control instruction and is hidden after the terminal receives the control instruction, so that the shielding of the user interface of the target application is reduced on the premise of ensuring the display of the important message, and the effect of simultaneously displaying the notification message and the user interface of the target application is improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Please refer to fig. 6, which is a block diagram illustrating an apparatus for displaying a notification message according to an exemplary embodiment of the present application. The means for displaying the notification message may be implemented as all or part of the terminal in software, hardware, or a combination of both. The device includes:
theelement obtaining module 610 is configured to obtain a notification element corresponding to a notification message when the terminal displays a user interface of a target application in a full screen manner and receives an instruction for displaying the notification message; the notification element is configured to display a message content of the notification message, and/or the notification element is configured to receive a control instruction, where the control instruction is used to instruct the terminal to execute an operation corresponding to the notification element.
Atemplate obtaining module 620, configured to obtain a display template corresponding to the notification element.
A displayframe generating module 630, configured to generate a notification display frame including the notification element according to the display template, where the notification display frame is a display frame with a transparent or semi-transparent background.
A displayframe display module 640, configured to display the notification display frame in the user interface of the target application.
In an optional embodiment, thetemplate obtaining module 620 is configured to obtain a display template corresponding to the notification element according to the number, the display area, and/or the type of the notification element.
In an optional embodiment, the apparatus further includes an execution module, where the execution module is configured to determine a corresponding target template library according to the application identifier of the target application. Thetemplate obtaining module 620 is configured to obtain, according to the number, the display area, and/or the type of the notification elements, a display template corresponding to the notification elements from the target template library.
In an alternative embodiment, the notification element comprises: at least one of a notification title, notification content, a notification button, and a notification dialog.
In an optional embodiment, theelement obtaining module 610 is configured to, when the terminal receives an instruction to display a notification message, detect whether the notification message includes a target mark, where the target mark is used to indicate that the notification display frame corresponding to the notification message is displayed in a user interface of the target application; and when the notification message contains the target mark and the terminal displays the user interface displaying the target application in a full screen mode, acquiring the notification element in the notification message.
In an optional embodiment, the execution module is configured to set a timer with a preset time duration when the notification message is a notification message of the notification bar; and when the timer is overtime, hiding the notification display frame.
In an optional embodiment, the execution module is configured to detect whether the control instruction is received when the notification message is a pop-up notification message; and hiding the notification display frame when the control instruction is received.
In an alternative embodiment, the displaybox display module 640 is configured to display the notification dialog in a top area of the user interface, where the top area is an area abutting an upper edge of the user interface.
Referring to fig. 7, which is a block diagram illustrating a terminal according to an exemplary embodiment of the present application, as shown in fig. 7, the terminal includes aprocessor 710, amemory 720 and adisplay screen assembly 730, where thememory 720 stores at least one instruction, and the instruction is loaded and executed by theprocessor 710 to implement the method for displaying a notification message according to the above embodiments.
The embodiment of the present application further provides a computer-readable medium, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for displaying a notification message according to the above embodiments.
The present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for displaying a notification message according to the above embodiments.
It should be noted that: in the method for displaying notification messages, the screen recording device provided in the above embodiment is only illustrated by dividing the functional modules, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for displaying a notification message and the method for displaying a notification message provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.