Sequenceablepublic static final class NotificationRequest.NotificationPictureContent extends Object implements Sequenceable
This class is used with NotificationContent and NotificationRequest. Example code:
NotificationRequest request = new NotificationRequest(); NotificationPictureContent pictureContent = new NotificationPictureContent(); NotificationContent notificationContent = new NotificationContent(pictureContent); request.setContent(notificationContent);
NotificationRequest,
NotificationRequest.NotificationContentSystemCapability.Notification#ANSSequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
NotificationPictureContent() |
Default constructor used to create an empty
NotificationPictureContent instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getAdditionalText() |
Obtains the additional text of a picture-attached notification specified by calling the
setAdditionalText(java.lang.String) method. |
PixelMap |
getBigPicture() |
Obtains the
PixelMap of the picture specified by calling the setBigPicture(ohos.media.image.PixelMap) method. |
String |
getBriefText() |
Obtains the brief text of a picture-attached notification specified by calling the
setBriefText(java.lang.String) method. |
String |
getExpandedTitle() |
Obtains the title that will be displayed for this picture-attached notification when it is expanded.
|
String |
getText() |
Obtains the text of a picture-attached notification specified by calling the
setText(java.lang.String) method. |
String |
getTitle() |
Obtains the title of a picture-attached notification specified by calling the
setTitle(java.lang.String) method. |
boolean |
marshalling(Parcel out) |
Marshals a
NotificationPictureContent object into a Parcel. |
NotificationRequest.NotificationPictureContent |
setAdditionalText(String additionalText) |
Sets the additional text to be included in a picture-attached notification.
|
NotificationRequest.NotificationPictureContent |
setBigPicture(PixelMap bigPicture) |
Sets the picture to be included in a notification.
|
NotificationRequest.NotificationPictureContent |
setBriefText(String briefText) |
Sets the brief text to be included in a picture-attached notification.
|
NotificationRequest.NotificationPictureContent |
setExpandedTitle(String expandedTitle) |
Sets the title to be displayed when this picture-attached notification is expanded.
|
NotificationRequest.NotificationPictureContent |
setText(String text) |
Sets the text to be included in a picture-attached notification.
|
NotificationRequest.NotificationPictureContent |
setTitle(String title) |
Sets the title of a picture-attached notification.
|
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals a
NotificationPictureContent object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic NotificationPictureContent()
NotificationPictureContent instance.public String getTitle()
setTitle(java.lang.String) method.public NotificationRequest.NotificationPictureContent setTitle(String title)
title - Indicates the title of the notification.NotificationPictureContent object with the specified title.public String getText()
setText(java.lang.String) method.public NotificationRequest.NotificationPictureContent setText(String text)
text - Indicates the text to be included.NotificationPictureContent object with the specified text.public String getAdditionalText()
setAdditionalText(java.lang.String) method.public NotificationRequest.NotificationPictureContent 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.NotificationPictureContent object with the specified additionalText.public String getBriefText()
setBriefText(java.lang.String) method.public NotificationRequest.NotificationPictureContent setBriefText(String briefText)
The brief text is a summary of a picture-attached 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.NotificationPictureContent object with the specified briefText.public String getExpandedTitle()
public NotificationRequest.NotificationPictureContent 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.NotificationPictureContent object with the specified expandedTitle.public NotificationRequest.NotificationPictureContent setBigPicture(PixelMap bigPicture)
bigPicture - Indicates the PixelMap of the picture to be included.NotificationPictureContent object with the specified bigPicture.public PixelMap getBigPicture()
PixelMap of the picture specified by calling the setBigPicture(ohos.media.image.PixelMap) method.PixelMap of the picture included in the notification.public boolean marshalling(Parcel out)
NotificationPictureContent object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal a
NotificationPictureContent 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)
NotificationPictureContent 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())