diff options
| -rw-r--r-- | core/java/android/widget/GridView.java | 34 | ||||
| -rwxr-xr-x | core/res/res/values/attrs.xml | 11 |
2 files changed, 44 insertions, 1 deletions
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index a84df16d2d59..0383b5c8c0cd 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -37,14 +37,46 @@ import android.widget.RemoteViews.RemoteView; * * <p>See the <a href="{@docRoot}resources/tutorials/views/hello-gridview.html">Grid * View tutorial</a>.</p> + * + * @attr ref android.R.styleable#GridView_horizontalSpacing + * @attr ref android.R.styleable#GridView_verticalSpacing + * @attr ref android.R.styleable#GridView_stretchMode + * @attr ref android.R.styleable#GridView_columnWidth + * @attr ref android.R.styleable#GridView_numColumns + * @attr ref android.R.styleable#GridView_gravity */ @RemoteView public class GridView extends AbsListView { + /** + * Disables stretching. + * + * @see #setStretchMode(int) + */ public static final int NO_STRETCH = 0; + /** + * Stretches the spacing between columns. + * + * @see #setStretchMode(int) + */ public static final int STRETCH_SPACING = 1; + /** + * Stretches columns. + * + * @see #setStretchMode(int) + */ public static final int STRETCH_COLUMN_WIDTH = 2; + /** + * Stretches the spacing between columns. The spacing is uniform. + * + * @see #setStretchMode(int) + */ public static final int STRETCH_SPACING_UNIFORM = 3; - + + /** + * Creates as many columns as can fit on screen. + * + * @see #setNumColumns(int) + */ public static final int AUTO_FIT = -1; private int mNumColumns = AUTO_FIT; diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 6f37dc097010..d9eccd6f2729 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -2256,18 +2256,29 @@ <attr name="unselectedAlpha" format="float" /> </declare-styleable> <declare-styleable name="GridView"> + <!-- Defines the default horizontal spacing between columns. --> <attr name="horizontalSpacing" format="dimension" /> + <!-- Defines the default vertical spacing between rows. --> <attr name="verticalSpacing" format="dimension" /> + <!-- Defines how columns should stretch to fill the available empty space, if any. --> <attr name="stretchMode"> + <!-- Stretching is disabled. --> <enum name="none" value="0"/> + <!-- The spacing between each column is stretched. --> <enum name="spacingWidth" value="1" /> + <!-- Each column is stretched equally. --> <enum name="columnWidth" value="2" /> + <!-- The spacing between each column is uniformly stretched.. --> <enum name="spacingWidthUniform" value="3" /> </attr> + <!-- Specifies the fixed width for each column. --> <attr name="columnWidth" format="dimension" /> + <!-- Defines how many columns to show. --> <attr name="numColumns" format="integer" min="0"> + <!-- Display as many columns as possible to fill the available space. --> <enum name="auto_fit" value="-1" /> </attr> + <!-- Specifies the gravity within each cell. --> <attr name="gravity" /> </declare-styleable> <declare-styleable name="ImageSwitcher"> |