Builder


class Builder
kotlin.Any
   ↳ android.app.wallpaper.WallpaperDescription.Builder

Builder for the immutable WallpaperDescription class

Summary

Public constructors

Creates a new, empty Builder.

Public methods
WallpaperDescription

Creates and returns the WallpaperDescription represented by this builder.

WallpaperDescription.Builder

Set the additional content required to render this wallpaper.

WallpaperDescription.Builder
setContextDescription(contextDescription: CharSequence?)

Set the link text for the action associated with this wallpaper.

WallpaperDescription.Builder
setContextUri(contextUri: Uri?)

Set the Uri for the action associated with this wallpaper, to be shown as a link with the wallpaper information.

WallpaperDescription.Builder

Set the description for this wallpaper.

WallpaperDescription.Builder
setId(id: String?)

Set the id for this wallpaper.

WallpaperDescription.Builder
setThumbnail(thumbnail: Uri?)

Set the thumbnail Uri for this wallpaper.

WallpaperDescription.Builder

Set the title for this wallpaper.

Public constructors

Builder

Builder()

Creates a new, empty Builder.

Public methods

build

fun build(): WallpaperDescription

Creates and returns the WallpaperDescription represented by this builder.

setContent

fun setContent(content: PersistableBundle): WallpaperDescription.Builder

Set the additional content required to render this wallpaper.

When setting additional content (asset id, etc.), best practice is to set an ID as well. This allows WallpaperManager and other code to distinguish between different wallpapers handled by this component.

Parameters
content PersistableBundle: additional content, or an empty bundle for none

setContextDescription

fun setContextDescription(contextDescription: CharSequence?): WallpaperDescription.Builder

Set the link text for the action associated with this wallpaper.

Parameters
contextDescription CharSequence?: the link text, or null for default text

setContextUri

fun setContextUri(contextUri: Uri?): WallpaperDescription.Builder

Set the Uri for the action associated with this wallpaper, to be shown as a link with the wallpaper information.

Parameters
contextUri Uri?: the action Uri, or null for no action

setDescription

fun setDescription(description: MutableList<CharSequence!>): WallpaperDescription.Builder

Set the description for this wallpaper. Each array element should be shown on a different line.

Parameters
description MutableList<CharSequence!>: the description, or an empty list for none

setId

fun setId(id: String?): WallpaperDescription.Builder

Set the id for this wallpaper.

IDs are used to distinguish among different instances of wallpapers rendered by the same component, and should be unique among all wallpapers for that component.

Parameters
id String?: the id, or null for none

setThumbnail

fun setThumbnail(thumbnail: Uri?): WallpaperDescription.Builder

Set the thumbnail Uri for this wallpaper.

Parameters
thumbnail Uri?: the thumbnail Uri, or null for none

setTitle

fun setTitle(title: CharSequence?): WallpaperDescription.Builder

Set the title for this wallpaper.

Parameters
title CharSequence?: the title, or null for none