From 2b15c001fa1f80ac7be7e2ddec40253d0ce7b4fb Mon Sep 17 00:00:00 2001
From: Roman Nurik Widgets are a feature introduced in Android 1.5. A widget displays an
-application's most important or timely information at a glance, on a user's Home
-screen. The standard Android system image includes several examples of widgets,
-including widgets for Analog Clock, Music, and other applications. App widgets (sometimes just "widgets") are a feature introduced in Android 1.5 and vastly
+improved in Android 3.0 and 3.1. A widget can display an application's most timely or otherwise
+relevant information at a glance, on a user's Home screen. The standard Android system image
+includes several widgets, including a widget for the Analog Clock, Music, and other
+applications. Users pick the widgets they want to display on their Home screens by touching
-& holding an empty area of the Home screen, selecting Widgets from the menu,
-and then selecting the widget they want. This document describes how to design a widget so it fits graphically with
-other widgets and with the other elements of the Android Home screen. It also
-describes some standards for widget artwork and some widget graphics tips and
-tricks from the Android team.
+ Figure 1. Example app widgets in Android 4.0. This document describes how to design a widget so that it fits graphically with other widgets and
+with the other elements of the Android Home screen such as launcher icons and shortcuts. It also
+describes some standards for widget artwork and some widget graphics tips and tricks.
For information about developing widgets, see the AppWidgets section of
-the Developer's Guide and the AppWidgets blog post.Quickview
-
In this document
-
+
+Downloads
+
+
See also
-
-
Typical Android widgets have three main components: A bounding box, a frame, -and the widget's graphical controls and other elements. Well-designed widgets -leave some padding between the edges of the bounding box and the frame, and -between the inner edges of the frame and the widget's controls. Widgets designed -to fit visually with other widgets on the Home screen take cues from the other -elements on the Home screen for alignment; they also use standard shading -effects. All of these details are described in this document. - -
Standard Widget Sizes in Portrait Orientation
-
- -
Standard Widget Sizes in Landscape Orientation
-
The most effective widgets display your application's most useful or timely -data in the smallest widget size. Users will weigh the usefulness or your widget -against the portion of the Home screen it covers, so the smaller the better.
- -All widgets must fit within the bounding box of one of the six supported -widget sizes, or better yet, within a pair of portrait and landscape orientation -sizes, so your widget looks good when the user switches screen -orientations.
- -Standard widget sizes illustrates the bounding -dimensions of the six widget sizes (three in portrait and three in landscape -orientation).
+Typical Android app widgets have three main components: A bounding box, a frame, and the widget's +graphical controls and other elements. App widgets can contain a subset of the View widgets in +Android; supported controls include text labels, buttons, and images. For a full list of available +Views, see the Creating the +App Widget Layout section in the Developer's Guide. Well-designed widgets leave some +margins between the edges of the bounding box and the frame, and padding between the inner edges of +the frame and the widget's controls.
-
-Standard widget frames illustrates the standard frames -for the six widget sizes, with links so you can download copies for your own -use. You don't have to use these frames for your widget, but if you do, your -widgets are more likely to fit visually with other widgets.
- -Again, you don't have to use this effect, but Standard -widget shadows shows the Photoshop settings used for standard widgets.
- -You can download a -Photoshop file that contains the three states of the Play button, taken from -the Music widget, to analyze the Photoshop settings used for the three standard -button effects.
- - - -Widget alignment tips and tricks describes some -techniques for aligning your widget's graphics inside the standard frames, along -with a few other widget graphics tricks.
- -Windows graphics file format describes the correct -settings for your widget graphics files.
- -Figure 2. Widgets generally have margins between the +bounding box and frame, and padding between the frame and widget controls.
-Note: As of Android 4.0, app widgets are automatically given +margins between the widget frame and the app widget's bounding box to provide better alignment with +other widgets and icons on the user's home screen. To take advantage of this strongly recommended +behavior, set your application's targetSdkVersion to 14 or +greater.
-There are six standard widget sizes, based on a Home screen grid of 4 x 4 -(portrait) or 4 x 4 (landscape) cells. These dimensions are the bounding boxes -for the six standard widget sizes. The contents of typical widgets don't draw to -the edge of these dimensions, but fit inside a frame withing the bounding box, -as described in Designing a widget.
+Widgets designed to fit visually with other widgets on the Home screen take cues from the other +elements on the Home screen for alignment; they also use standard shading effects. All of these +details are described in this document.
-In portrait orientation, each cell is 80 pixels wide by 100 pixels tall (the -diagram shows a cell in portrait orientation). The three supported widget sizes -in portrait orientation are:
-