AppWidgetProviderInfo
open class AppWidgetProviderInfo : Parcelable
| kotlin.Any | |
| ↳ | android.appwidget.AppWidgetProviderInfo |
Describes the meta data for an installed AppWidget provider. The fields in this class correspond to the fields in the <appwidget-provider> xml tag.
Summary
| Constants | |
|---|---|
| static Int |
Widget is resizable in both the horizontal and vertical axes. |
| static Int |
Widget is resizable in the horizontal axis only. |
| static Int |
Widget is not resizable. |
| static Int |
Widget is resizable in the vertical axis only. |
| static Int |
Indicates that the widget can be displayed on the home screen. |
| static Int |
Indicates that the widget can be displayed on the keyguard. |
| static Int |
Indicates that the widget should never be shown on the keyguard. |
| static Int |
Indicates that the widget can be displayed within a space reserved for the search box. |
| static Int |
The widget provides a default configuration. |
| static Int |
The widget is added directly by the app, and the host may hide this widget when providing the user with the list of available widgets to choose from. |
| static Int |
The widget can be reconfigured anytime after it is bound by starting the |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
AppWidgetProviderInfo(in: Parcel!)Unflatten the AppWidgetProviderInfo from a parcel. |
|
| Public methods | |
|---|---|
| open AppWidgetProviderInfo! |
clone()Creates and returns a copy of this object. |
| open Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open ActivityInfo |
Returns the broadcast receiver that is providing this widget. |
| UserHandle! |
Gets the user profile in which the provider resides. |
| CharSequence? |
loadDescription(context: Context)Loads localized description for the app widget. |
| Drawable! |
Loads the icon to display for this AppWidget in the AppWidget picker. |
| String! |
loadLabel(packageManager: PackageManager!)Loads the localized label to display to the user in the AppWidget picker. |
| Drawable! |
loadPreviewImage(context: Context, density: Int)Loads a preview of what the AppWidget will look like after it's configured. |
| open String |
toString()Returns a string representation of the object. |
| open Unit |
writeToParcel(out: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<AppWidgetProviderInfo!> |
Parcelable. |
| Int |
The view id of the AppWidget subview which should be auto-advanced by the widget's host. |
| ComponentName! |
The activity to launch that will configure the AppWidget. |
| Int |
Resource id for the description of the AppWidget. |
| Int |
Flags indicating the widget categories for which generated previews are available. |
| Int |
The icon to display for this AppWidget in the AppWidget picker. |
| Int |
The resource id of the initial layout for this AppWidget when it is displayed on keyguard. |
| Int |
The resource id of the initial layout for this AppWidget. |
| String! |
The label to display to the user in the AppWidget picker. |
| Int |
Maximum height (in px) which the widget can be resized to. |
| Int |
Maximum width (in px) which the widget can be resized to. |
| Int |
The default height of the widget when added to a host, in px. |
| Int |
Minimum height (in px) which the widget can be resized to. |
| Int |
Minimum width (in px) which the widget can be resized to. |
| Int |
The default width of the widget when added to a host, in px. |
| Int |
A preview of what the AppWidget will look like after it's configured. |
| Int |
The layout resource id of a preview of what the AppWidget will look like after it's configured. |
| ComponentName! |
Identity of this AppWidget component. |
| Int |
The rules by which a widget can be resized. |
| Int |
The default height of a widget when added to a host, in units of launcher grid cells. |
| Int |
The default width of a widget when added to a host, in units of launcher grid cells. |
| Int |
How often, in milliseconds, that this AppWidget wants to be updated. |
| Int |
Determines whether this widget can be displayed on the home screen, the keyguard, or both. |
| Int |
Flags indicating various features supported by the widget. |
Constants
RESIZE_BOTH
static val RESIZE_BOTH: Int
Widget is resizable in both the horizontal and vertical axes.
Value: 3RESIZE_HORIZONTAL
static val RESIZE_HORIZONTAL: Int
Widget is resizable in the horizontal axis only.
Value: 1RESIZE_VERTICAL
static val RESIZE_VERTICAL: Int
Widget is resizable in the vertical axis only.
Value: 2WIDGET_CATEGORY_HOME_SCREEN
static val WIDGET_CATEGORY_HOME_SCREEN: Int
Indicates that the widget can be displayed on the home screen. This is the default value.
Value: 1WIDGET_CATEGORY_KEYGUARD
static val WIDGET_CATEGORY_KEYGUARD: Int
Indicates that the widget can be displayed on the keyguard.
Value: 2WIDGET_CATEGORY_NOT_KEYGUARD
static val WIDGET_CATEGORY_NOT_KEYGUARD: Int
Indicates that the widget should never be shown on the keyguard.
Some keyguard style features may decide that WIDGET_CATEGORY_KEYGUARD isn't required to be added by an app to show on the feature when chosen by a user. This category allows for a stronger statement about placement of the widget that, even in the above case, this widget should not be offered on the keyguard.
Setting this category doesn't change the behavior of AppWidgetManager queries, it is the responsibility of the widget surface to respect this value.
Value: 8WIDGET_CATEGORY_SEARCHBOX
static val WIDGET_CATEGORY_SEARCHBOX: Int
Indicates that the widget can be displayed within a space reserved for the search box.
Value: 4WIDGET_FEATURE_CONFIGURATION_OPTIONAL
static val WIDGET_FEATURE_CONFIGURATION_OPTIONAL: Int
The widget provides a default configuration. The host may choose not to launch the provided configuration activity.
Value: 4See Also
WIDGET_FEATURE_HIDE_FROM_PICKER
static val WIDGET_FEATURE_HIDE_FROM_PICKER: Int
The widget is added directly by the app, and the host may hide this widget when providing the user with the list of available widgets to choose from.
Value: 2WIDGET_FEATURE_RECONFIGURABLE
static val WIDGET_FEATURE_RECONFIGURABLE: Int
The widget can be reconfigured anytime after it is bound by starting the configure activity.
Value: 1See Also
Public constructors
AppWidgetProviderInfo
AppWidgetProviderInfo(in: Parcel!)
Unflatten the AppWidgetProviderInfo from a parcel.
Public methods
clone
open fun clone(): AppWidgetProviderInfo!
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:
x.clone() != x
x.clone().getClass() == x.getClass()
true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().
By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.
| Return | |
|---|---|
AppWidgetProviderInfo! |
a clone of this instance. |
| Exceptions | |
|---|---|
java.lang.CloneNotSupportedException |
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. |
describeContents
open fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getActivityInfo
open fun getActivityInfo(): ActivityInfo
Returns the broadcast receiver that is providing this widget.
| Return | |
|---|---|
ActivityInfo |
This value cannot be null. |