Sequenceablepublic static final class NotificationRequest.NotificationMultiLineContent extends Object implements Sequenceable
This multi-line notification is different from a long-text notification constructed by
NotificationLongTextContent. The long-text notification displays
notification content only with a single line in the notification bar and hides the text exceeding
the allowed display length. By contrast, the multi-line notification can display up to seven independent
lines of text in the notification bar.
SystemCapability.Notification#ANSSequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
NotificationMultiLineContent() |
Default constructor used to create a
NotificationMultiLineContent instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
NotificationRequest.NotificationMultiLineContent |
addSingleLine(String line) |
Adds a single line of text to this notification.
|
String |
getAdditionalText() |
Obtains the additional text that has been set by calling
setAdditionalText(java.lang.String) for this
multi-line notification. |
List<String> |
getAllLines() |
Obtains the list of lines included in this multi-line notification.
|
String |
getBriefText() |
Obtains the brief text that has been set by calling
setBriefText(java.lang.String) for this
multi-line notification. |
String |
getExpandedTitle() |
Obtains the title that will be displayed for this multi-line notification when it is expanded.
|
String |
getText() |
Obtains the notification content that has been set by calling
setText(java.lang.String) for this
multi-line notification. |
String |
getTitle() |
Obtains the title that has been set by calling
setTitle(java.lang.String) for this multi-line notification. |
boolean |
marshalling(Parcel out) |
Marshals this
NotificationMultiLineContent object into a Parcel. |
NotificationRequest.NotificationMultiLineContent |
setAdditionalText(String additionalText) |
Sets the additional text to be included in this multi-line notification.
|
NotificationRequest.NotificationMultiLineContent |
setBriefText(String briefText) |
Sets the brief text to be included in this multi-line notification.
|
NotificationRequest.NotificationMultiLineContent |
setExpandedTitle(String longTitle) |
Sets the title to be displayed when this multi-line notification is expanded.
|
NotificationRequest.NotificationMultiLineContent |
setText(String text) |
Sets the text to be included in this multi-line notification.
|
NotificationRequest.NotificationMultiLineContent |
setTitle(String title) |
Sets the title for this multi-line notification.
|
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals this
NotificationMultiLineContent object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic NotificationMultiLineContent()
NotificationMultiLineContent instance.public String getTitle()
setTitle(java.lang.String) for this multi-line notification.public NotificationRequest.NotificationMultiLineContent setTitle(String title)
setExpandedTitle(java.lang.String)
are called for this notification, the title set in this method will be displayed only when
this notification is collapsed, and the one set in setExpandedTitle(java.lang.String) will be displayed
when this notification is expanded.title - Indicates the title of this multi-line notification.NotificationMultiLineContent object.public String getText()
setText(java.lang.String) for this
multi-line notification.public NotificationRequest.NotificationMultiLineContent setText(String text)
text - Indicates the text to be included.NotificationMultiLineContent object.public String getAdditionalText()
setAdditionalText(java.lang.String) for this
multi-line notification.public NotificationRequest.NotificationMultiLineContent setAdditionalText(String additionalText)
The additional text is mainly a supplement to the notification text set by
calling setText(java.lang.String). The font of the additional text is smaller than the notification text
and is displayed in a separate line.
additionalText - Indicates the additional text to be included.NotificationMultiLineContent object.public String getBriefText()
setBriefText(java.lang.String) for this
multi-line notification.public NotificationRequest.NotificationMultiLineContent setBriefText(String briefText)
The brief text is a summary of this multi-line notification and is displayed in the first line of
the notification. Similar to setAdditionalText(java.lang.String), the font of the brief text is also
smaller than the notification text set by calling setText(java.lang.String).
The positions where the brief text and additional text will display may conflict. If both texts are set, only the additional text will be displayed.
briefText - Indicates the brief text to be included.NotificationMultiLineContent object.public String getExpandedTitle()
public NotificationRequest.NotificationMultiLineContent setExpandedTitle(String longTitle)
setTitle(java.lang.String) will be displayed only when this notification is in the
collapsed state.longTitle - Indicates the title to be displayed when this notification is expanded.NotificationMultiLineContent object.public List<String> getAllLines()
public NotificationRequest.NotificationMultiLineContent addSingleLine(String line)
line - Indicates the single line of text to be included.NotificationMultiLineContent object.public boolean marshalling(Parcel out)
NotificationMultiLineContent object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal this
NotificationMultiLineContent object from a Parcel to implement
inter-process communication (IPC).
marshalling 在接口中 Sequenceableout - Indicates the Parcel object for marshalling.true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
NotificationMultiLineContent object from a Parcel.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object for unmarshalling.true if the unmarshalling is successful; returns false otherwise.public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())