Class StampPickerItem.Builder
-
- All Implemented Interfaces:
public class StampPickerItem.Builder
Builder for creating custom stamps from PredefinedStampType or custom String stamp type.
-
-
Method Summary
Modifier and Type Method Description StampPickerItem.Builder
withAppearanceStreamGenerator(@NonNull() AppearanceStreamGenerator appearanceStreamGenerator)
Sets appearance stream generator that replaces default stamp appearance. StampPickerItem.Builder
withSize(float pdfWidth, float pdfHeight)
Sets default stamp width and height in pdf points. StampPickerItem.Builder
withSize(float pdfSize)
Sets default stamp size in pdf points. StampPickerItem.Builder
withTitle(@Nullable() String title)
Sets custom text that replaces the default stamp text. StampPickerItem.Builder
withSubtitle(@Nullable() String subtitle)
Sets text displayed in second line of the stamp. StampPickerItem.Builder
withDateTimeSubtitle(boolean addDate, boolean addTime)
Method for conveniently setting stamp subtitle to date, time or date-time string. StampPickerItem.Builder
withTextColor(@ColorInt() @Nullable() Integer textColor)
Sets text color of the stamp. StampPickerItem
build()
Build stamp item that can be used in setAvailableStampPickerItems. -
-
Method Detail
-
withAppearanceStreamGenerator
@NonNull() StampPickerItem.Builder withAppearanceStreamGenerator(@NonNull() AppearanceStreamGenerator appearanceStreamGenerator)
Sets appearance stream generator that replaces default stamp appearance.
- Parameters:
appearanceStreamGenerator
- Generator for appearance stream that should replace stamp's default appearance.
-
withSize
@NonNull() StampPickerItem.Builder withSize(float pdfWidth, float pdfHeight)
Sets default stamp width and height in pdf points.
- Parameters:
pdfWidth
- Required stamp width in pdf points.pdfHeight
- Required stamp height in pdf points.
-
withSize
@NonNull() StampPickerItem.Builder withSize(float pdfSize)
Sets default stamp size in pdf points. This is equivalent to calling withSize with the same width and height parameters.
- Parameters:
pdfSize
- Required stamp width and height in pdf points.
-
withTitle
@NonNull() StampPickerItem.Builder withTitle(@Nullable() String title)
Sets custom text that replaces the default stamp text.
- Parameters:
title
- Title ornull
to clear title to display default stamp text.
-
withSubtitle
@NonNull() StampPickerItem.Builder withSubtitle(@Nullable() String subtitle)
Sets text displayed in second line of the stamp.
- Parameters:
subtitle
- Text displayed in second line of the stamp ornull
if second line should not be displayed.
-
withDateTimeSubtitle
@NonNull() StampPickerItem.Builder withDateTimeSubtitle(boolean addDate, boolean addTime)
Method for conveniently setting stamp subtitle to date, time or date-time string.
This method uses localized date-time formats
DateFormat#getDateFormat(Context)
andDateFormat#getTimeFormat(Context)
. If bothaddDate
andaddTime
flags are enabled created date-time string uses above formats separated by ", ".If you want further control over stamp subtitle use withSubtitle to set any string as stamp subtitle.
- Parameters:
addDate
- Add date portion to date-time string.addTime
- Add time portion to date-time string.
-
withTextColor
@NonNull() StampPickerItem.Builder withTextColor(@ColorInt() @Nullable() Integer textColor)
Sets text color of the stamp. Stamp's background color is calculated from this color to ensure that stamp text is visible.
- Parameters:
textColor
- Text color used for stamps title and subtitle.
-
build
@NonNull() StampPickerItem build()
Build stamp item that can be used in setAvailableStampPickerItems.
-
-
-
-