WallpaperInfo
class WallpaperInfo : Parcelable
kotlin.Any | |
↳ | android.app.WallpaperInfo |
This class is used to specify meta information of a wallpaper service.
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
WallpaperInfo(context: Context!, service: ResolveInfo!) Constructor. |
Public methods | |
---|---|
Int | |
Unit | |
ComponentName! |
Return the component of the service that implements this wallpaper. |
String! |
Return the . |
ServiceInfo! |
Return the raw information about the Service implementing this wallpaper. |
String! |
Return the class name of the service component that implements this wallpaper. |
String! |
Return the class name of an activity that provides a settings UI for the wallpaper. |
Uri? |
Returns an URI that provides a settings |
Boolean |
Queries whether any metadata should be shown when previewing the wallpaper. |
CharSequence! |
loadAuthor(pm: PackageManager!) Return a string indicating the author(s) of this wallpaper. |
CharSequence! |
Retrieves a title of the URI that specifies a link for further context about this wallpaper. |
Uri! |
loadContextUri(pm: PackageManager!) Returns an URI that specifies a link for further context about this wallpaper. |
CharSequence! |
Return a brief summary of this wallpaper's behavior. |
Drawable! |
loadIcon(pm: PackageManager!) Load the user-displayed icon for this wallpaper. |
CharSequence! |
loadLabel(pm: PackageManager!) Load the user-displayed label for this wallpaper. |
Drawable! |
loadThumbnail(pm: PackageManager!) Load the thumbnail image for this wallpaper. |
Boolean |
Returns whether this wallpaper should receive default zooming updates when the device changes its state (e.g. when folding or unfolding a foldable device). |
Boolean |
Returns whether this wallpaper service can support multiple engines to render on each surface independently. |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) Used to package this object into a |
Properties | |
---|---|
static Parcelable.Creator<WallpaperInfo!> |
Used to make this class parcelable. |
Public constructors
WallpaperInfo
WallpaperInfo(
context: Context!,
service: ResolveInfo!)
Constructor.
Parameters | |
---|---|
context |
Context!: The Context in which we are parsing the wallpaper. |
service |
ResolveInfo!: The ResolveInfo returned from the package manager about this wallpaper's component. |
Public methods
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getComponent
fun getComponent(): ComponentName!
Return the component of the service that implements this wallpaper.
getPackageName
fun getPackageName(): String!
Return the .apk package that implements this wallpaper.
getServiceInfo
fun getServiceInfo(): ServiceInfo!
Return the raw information about the Service implementing this wallpaper. Do not modify the returned object.
getServiceName
fun getServiceName(): String!
Return the class name of the service component that implements this wallpaper.
getSettingsActivity
fun getSettingsActivity(): String!
Return the class name of an activity that provides a settings UI for the wallpaper. You can launch this activity be starting it with an android.content.Intent
whose action is MAIN and with an explicit android.content.ComponentName
composed of getPackageName
and the class name returned here.
null
will be returned if there is no settings activity associated with the wallpaper.
getSettingsSliceUri
fun getSettingsSliceUri(): Uri?
Returns an URI that provides a settings Slice
for this wallpaper. The wallpaper should implement a SliceProvider associated with this URI. The system will display the Slice in the customization section while previewing the live wallpaper. Because this URI is accessible to other apps, it is recommended to protect it with the android.permission.BIND_WALLPAPER permission.
null
will be returned if there is no settings Slice URI associated with the wallpaper.
Return | |
---|---|
Uri? |
The URI. |
getShowMetadataInPreview
fun getShowMetadataInPreview(): Boolean
Queries whether any metadata should be shown when previewing the wallpaper. If this value is set to true, any component that shows a preview of this live wallpaper should also show accompanying information like loadLabel
, loadDescription
, loadAuthor
and loadContextDescription(android.content.pm.PackageManager)
, so the user gets to know further information about this wallpaper.
Return | |
---|---|
Boolean |
Whether any metadata should be shown when previewing the wallpaper. |
loadAuthor
fun loadAuthor(pm: PackageManager!): CharSequence!
Return a string indicating the author(s) of this wallpaper.
loadContextDescription
fun loadContextDescription(pm: PackageManager!): CharSequence!
Retrieves a title of the URI that specifies a link for further context about this wallpaper.
Parameters | |
---|---|
pm |
PackageManager!: An instance of PackageManager to retrieve the title. |
Return | |
---|---|
CharSequence! |
The title. |
loadContextUri
fun loadContextUri(pm: PackageManager!): Uri!
Returns an URI that specifies a link for further context about this wallpaper.
Parameters | |
---|---|
pm |
PackageManager!: An instance of PackageManager to retrieve the URI. |
Return | |
---|---|
Uri! |
The URI. |
loadDescription
fun loadDescription(pm: PackageManager!): CharSequence!
Return a brief summary of this wallpaper's behavior.
loadIcon
fun loadIcon(pm: PackageManager!): Drawable!
Load the user-displayed icon for this wallpaper.
Parameters | |
---|---|
pm |
PackageManager!: Supply a PackageManager used to load the wallpaper's resources. |
loadLabel
fun loadLabel(pm: PackageManager!): CharSequence!
Load the user-displayed label for this wallpaper.
Parameters | |
---|---|
pm |
PackageManager!: Supply a PackageManager used to load the wallpaper's resources. |
loadThumbnail
fun loadThumbnail(pm: PackageManager!): Drawable!
Load the thumbnail image for this wallpaper.
Parameters | |
---|---|
pm |
PackageManager!: Supply a PackageManager used to load the wallpaper's resources. |
shouldUseDefaultUnfoldTransition
fun shouldUseDefaultUnfoldTransition(): Boolean
Returns whether this wallpaper should receive default zooming updates when the device changes its state (e.g. when folding or unfolding a foldable device). If set to false the wallpaper will not receive zoom events when changing the device state, so it can implement its own transition instead.
This corresponds to the value android.R.styleable#Wallpaper_shouldUseDefaultUnfoldTransition
in the XML description of the wallpaper.
The default value is true
.
Return | |
---|---|
Boolean |
true if wallpaper should receive default device state change transition updates |
supportsMultipleDisplays
fun supportsMultipleDisplays(): Boolean
Returns whether this wallpaper service can support multiple engines to render on each surface independently. An example use case is a multi-display set-up where the wallpaper service can render surfaces to each of the connected displays.
This corresponds to the value android.R.styleable#Wallpaper_supportsMultipleDisplays
in the XML description of the wallpaper.
The default value is false
.
Return | |
---|---|
Boolean |
true if multiple engines can render independently on each surface. |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Used to package this object into a Parcel
.
Parameters | |
---|---|
dest |
Parcel: The Parcel to be written. |
flags |
Int: The flags used for parceling. |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<WallpaperInfo!>
Used to make this class parcelable.