Loading core/java/android/widget/GridView.java +33 −1 Original line number Diff line number Diff line Loading @@ -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; Loading core/res/res/values/attrs.xml +11 −0 Original line number Diff line number Diff line Loading @@ -2253,18 +2253,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"> Loading Loading
core/java/android/widget/GridView.java +33 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
core/res/res/values/attrs.xml +11 −0 Original line number Diff line number Diff line Loading @@ -2253,18 +2253,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"> Loading