Sequenceablepublic static final class NotificationRequest.NotificationLongTextContent extends Object implements Sequenceable
This class is used with NotificationContent and NotificationRequest. Example code:
NotificationRequest request = new NotificationRequest(); NotificationLongTextContent longTextContent = new NotificationLongTextContent(); NotificationContent notificationContent = new NotificationContent(longTextContent); request.setContent(notificationContent);
NotificationRequest,
NotificationRequest.NotificationContentSystemCapability.Notification#ANSSequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
NotificationLongTextContent() |
Default constructor used to create an empty
NotificationLongTextContent instance. |
NotificationLongTextContent(String longText) |
A constructor used to create a
NotificationLongTextContent instance with the input
parameter longText passed. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getAdditionalText() |
Obtains the additional text of a long text notification specified by calling the
setAdditionalText(java.lang.String) method. |
String |
getBriefText() |
Obtains the brief text of a long text notification specified by calling the
setBriefText(java.lang.String) method. |
String |
getExpandedTitle() |
Obtains the title that will be displayed for this long text notification when it is expanded.
|
String |
getLongText() |
Obtains a notification's long text, which is set by calling the
setLongText(java.lang.String) method. |
String |
getText() |
Obtains the content of a long text notification specified by calling the
setText(java.lang.String) method. |
String |
getTitle() |
Obtains the title of a long text notification specified by calling the
setTitle(java.lang.String) method. |
boolean |
marshalling(Parcel out) |
Marshals a
NotificationLongTextContent object into a Parcel. |
NotificationRequest.NotificationLongTextContent |
setAdditionalText(String additionalText) |
Sets the additional text to be included in a long text notification.
|
NotificationRequest.NotificationLongTextContent |
setBriefText(String briefText) |
Sets the brief text to be included in a long text notification.
|
NotificationRequest.NotificationLongTextContent |
setExpandedTitle(String expandedTitle) |
Sets the title to be displayed when this long text notification is expanded.
|
NotificationRequest.NotificationLongTextContent |
setLongText(String longText) |
Sets the long text to be included in a long text notification.
|
NotificationRequest.NotificationLongTextContent |
setText(String text) |
Sets the content to be included in a long text notification.
|
NotificationRequest.NotificationLongTextContent |
setTitle(String title) |
Sets the title of a long text notification.
|
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals a
NotificationLongTextContent object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic NotificationLongTextContent()
NotificationLongTextContent instance.public NotificationLongTextContent(String longText)
NotificationLongTextContent instance with the input
parameter longText passed.longText - Indicates the long text to be included. The value contains a maximum of 1024 characters.public String getTitle()
setTitle(java.lang.String) method.public NotificationRequest.NotificationLongTextContent setTitle(String title)
title - Indicates the title of the long text notification.NotificationLongTextContent object with the specified title.public String getText()
setText(java.lang.String) method.public NotificationRequest.NotificationLongTextContent setText(String text)
text - Indicates the content to be included.NotificationLongTextContent object with the specified text.public String getLongText()
setLongText(java.lang.String) method.public NotificationRequest.NotificationLongTextContent setLongText(String longText)
longText - Indicates the long text to be included.NotificationLongTextContent object with the specified longText.public String getAdditionalText()
setAdditionalText(java.lang.String) method.public NotificationRequest.NotificationLongTextContent setAdditionalText(String additionalText)
The additional text is mainly a supplement to the notification text. Therefore, 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.NotificationLongTextContent object with the specified additionalText.public String getBriefText()
setBriefText(java.lang.String) method.public NotificationRequest.NotificationLongTextContent setBriefText(String briefText)
The brief text is a summary of a long text 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.
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.NotificationLongTextContent object with the specified briefText.public String getExpandedTitle()
public NotificationRequest.NotificationLongTextContent setExpandedTitle(String expandedTitle)
setTitle(java.lang.String) will be displayed only when this notification is in the
collapsed state.expandedTitle - Indicates the title to be displayed when this notification is expanded.NotificationLongTextContent object with the specified expandedTitle.public boolean marshalling(Parcel out)
NotificationLongTextContent object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal a
NotificationLongTextContent 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)
NotificationLongTextContent 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())