SliceUtils.SerializeOptions
class SliceUtils.SerializeOptions
Holds options for how to handle SliceItems that cannot be serialized.
Summary
Constants |
|
|---|---|
const Int |
MODE_CONVERT = 2Constant indicating that the SliceItem should be serialized as much as possible. |
const Int |
MODE_REMOVE = 1Constant indicating that the SliceItem should be removed when this format is encountered. |
const Int |
MODE_THROW = 0Constant indicating that the an |
Public constructors |
|---|
Public functions |
|
|---|---|
SliceUtils.SerializeOptions! |
setActionMode(mode: Int)Sets how |
SliceUtils.SerializeOptions! |
setImageConversionFormat(format: Bitmap.CompressFormat!, quality: Int)Sets the options to use when converting icons to be serialized. |
SliceUtils.SerializeOptions! |
setImageMode(mode: Int)Sets how |
SliceUtils.SerializeOptions! |
setMaxImageHeight(height: Int)Set the maximum height of an image to use when serializing. |
SliceUtils.SerializeOptions! |
setMaxImageWidth(width: Int)Set the maximum width of an image to use when serializing. |
Constants
MODE_CONVERT
const val MODE_CONVERT = 2: Int
Constant indicating that the SliceItem should be serialized as much as possible.
For images this means they will be attempted to be serialized. For actions, the action will be removed but the content of the action will be serialized. The action may be triggered later on a de-serialized slice by binding the slice again and activating a pending-intent at the same location as the serialized action.
MODE_REMOVE
const val MODE_REMOVE = 1: Int
Constant indicating that the SliceItem should be removed when this format is encountered.
MODE_THROW
const val MODE_THROW = 0: Int
Constant indicating that the an IllegalArgumentException should be thrown when this format is encountered.
Public constructors
Public functions
setActionMode
fun setActionMode(mode: Int): SliceUtils.SerializeOptions!
Sets how FORMAT_ACTION items should be handled. The default mode is MODE_THROW.
| Parameters | |
|---|---|
mode: Int |
The desired mode. |
setImageConversionFormat
fun setImageConversionFormat(format: Bitmap.CompressFormat!, quality: Int): SliceUtils.SerializeOptions!
Sets the options to use when converting icons to be serialized. Only used if the image mode is set to MODE_CONVERT.
| Parameters | |
|---|---|
format: Bitmap.CompressFormat! |
The format to encode images with, default is |
quality: Int |
The quality to use when encoding images. |
setImageMode
fun setImageMode(mode: Int): SliceUtils.SerializeOptions!
Sets how FORMAT_IMAGE items should be handled. The default mode is MODE_THROW.
| Parameters | |
|---|---|
mode: Int |
The desired mode. |
setMaxImageHeight
fun setMaxImageHeight(height: Int): SliceUtils.SerializeOptions!
Set the maximum height of an image to use when serializing.
Will only be used if the setImageMode is set to MODE_CONVERT. Any images larger than the maximum size will be scaled down to fit within that size. The default value is 1000.
setMaxImageWidth
fun setMaxImageWidth(width: Int): SliceUtils.SerializeOptions!
Set the maximum width of an image to use when serializing.
Will only be used if the setImageMode is set to MODE_CONVERT. Any images larger than the maximum size will be scaled down to fit within that size. The default value is 1000.