Added in API level 19
Builder
class Builder
| kotlin.Any | |
| ↳ | android.print.PrintAttributes.Builder |
Builder for creating PrintAttributes.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| PrintAttributes |
build()Creates a new |
| PrintAttributes.Builder |
setColorMode(colorMode: Int)Sets the color mode. |
| PrintAttributes.Builder |
setDuplexMode(duplexMode: Int)Sets the duplex mode. |
| PrintAttributes.Builder |
setMediaSize(mediaSize: PrintAttributes.MediaSize)Sets the media size. |
| PrintAttributes.Builder |
setMinMargins(margins: PrintAttributes.Margins)Sets the minimal margins. |
| PrintAttributes.Builder |
setResolution(resolution: PrintAttributes.Resolution)Sets the resolution. |
Public constructors
Builder
Builder()
Public methods
build
Added in API level 19
fun build(): PrintAttributes
Creates a new PrintAttributes instance.
| Return | |
|---|---|
PrintAttributes |
The new instance. This value cannot be null. |
setColorMode
Added in API level 19
fun setColorMode(colorMode: Int): PrintAttributes.Builder
Sets the color mode.
| Parameters | |
|---|---|
colorMode |
Int: A valid color mode or zero. Value is either 0 or a combination of android.print.PrintAttributes#COLOR_MODE_MONOCHROME, and android.print.PrintAttributes#COLOR_MODE_COLOR |
| Return | |
|---|---|
PrintAttributes.Builder |
This builder. This value cannot be null. |
setDuplexMode
Added in API level 23
fun setDuplexMode(duplexMode: Int): PrintAttributes.Builder
Sets the duplex mode.
| Parameters | |
|---|---|
duplexMode |
Int: A valid duplex mode or zero. Value is either 0 or a combination of android.print.PrintAttributes#DUPLEX_MODE_NONE, android.print.PrintAttributes#DUPLEX_MODE_LONG_EDGE, and android.print.PrintAttributes#DUPLEX_MODE_SHORT_EDGE |
| Return | |
|---|---|
PrintAttributes.Builder |
This builder. This value cannot be null. |
setMediaSize
Added in API level 19
fun setMediaSize(mediaSize: PrintAttributes.MediaSize): PrintAttributes.Builder
Sets the media size.
| Parameters | |
|---|---|
mediaSize |
PrintAttributes.MediaSize: The media size. This value cannot be null. |
| Return | |
|---|---|
PrintAttributes.Builder |
This builder. This value cannot be null. |
setMinMargins
Added in API level 19
fun setMinMargins(margins: PrintAttributes.Margins): PrintAttributes.Builder
Sets the minimal margins. If the content does not fit these margins it will be clipped.
| Parameters | |
|---|---|
margins |
PrintAttributes.Margins: The margins. This value cannot be null. |
| Return | |
|---|---|
PrintAttributes.Builder |
This builder. This value cannot be null. |
setResolution
Added in API level 19
fun setResolution(resolution: PrintAttributes.Resolution): PrintAttributes.Builder
Sets the resolution.
| Parameters | |
|---|---|
resolution |
PrintAttributes.Resolution: The resolution. This value cannot be null. |
| Return | |
|---|---|
PrintAttributes.Builder |
This builder. This value cannot be null. |