AppWidgetHostView.GetDefaultPaddingForWidget Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
As of ICE_CREAM_SANDWICH we are automatically adding padding to widgets targeting ICE_CREAM_SANDWICH and higher.
[Android.Runtime.Register("getDefaultPaddingForWidget", "(Landroid/content/Context;Landroid/content/ComponentName;Landroid/graphics/Rect;)Landroid/graphics/Rect;", "")]
public static Android.Graphics.Rect? GetDefaultPaddingForWidget (Android.Content.Context? context, Android.Content.ComponentName? component, Android.Graphics.Rect? padding);
[<Android.Runtime.Register("getDefaultPaddingForWidget", "(Landroid/content/Context;Landroid/content/ComponentName;Landroid/graphics/Rect;)Landroid/graphics/Rect;", "")>]
static member GetDefaultPaddingForWidget : Android.Content.Context * Android.Content.ComponentName * Android.Graphics.Rect -> Android.Graphics.Rect
Parameters
- context
- Context
the current context
- component
- ComponentName
the component name of the widget
- padding
- Rect
Rect in which to place the output, if null, a new Rect will be allocated and returned
Returns
default padding for this widget, in pixels
- Attributes
Remarks
As of ICE_CREAM_SANDWICH we are automatically adding padding to widgets targeting ICE_CREAM_SANDWICH and higher. The new widget design guidelines strongly recommend that widget developers do not add extra padding to their widgets. This will help achieve consistency among widgets.
Note: this method is only needed by developers of AppWidgetHosts. The method is provided in order for the AppWidgetHost to account for the automatic padding when computing the number of cells to allocate to a particular widget.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.