summaryrefslogtreecommitdiff
path: root/core/java/android/widget/GridView.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-30 15:59:53 -0700
committerTor Norbye <tnorbye@google.com>2013-09-11 14:55:38 -0700
commitd9273d6f289d9b55da3fd0db2f659fdfb48106a8 (patch)
treedd8bf34b123a4327a7fc55c944adf62e25aaa50d /core/java/android/widget/GridView.java
parent78d00050272d796cc77557b9b715604d1c566c01 (diff)
Add typedefs and nullness annotations.
This changeset adds in typedef annotations (custom annotations marked with @IntDef) for various int parameters and return values in the API. It also adds nullness annotations for cases where the documentation explicitly mentioned null policy, or where it was blindingly obvious from the context. Also fixed some typos in the documentation. Change-Id: Ica27c01368895818e26237544edd8483007155bb
Diffstat (limited to 'core/java/android/widget/GridView.java')
-rw-r--r--core/java/android/widget/GridView.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index cf81476fdf8c..696c3c4481f0 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -16,6 +16,7 @@
package android.widget;
+import android.annotation.IntDef;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
@@ -36,6 +37,9 @@ import android.view.animation.GridLayoutAnimationController;
import android.widget.AbsListView.LayoutParams;
import android.widget.RemoteViews.RemoteView;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* A view that shows items in two-dimensional scrolling grid. The items in the
@@ -53,6 +57,11 @@ import android.widget.RemoteViews.RemoteView;
*/
@RemoteView
public class GridView extends AbsListView {
+ /** @hide */
+ @IntDef({NO_STRETCH, STRETCH_SPACING, STRETCH_COLUMN_WIDTH, STRETCH_SPACING_UNIFORM})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface StretchMode {}
+
/**
* Disables stretching.
*
@@ -2060,13 +2069,14 @@ public class GridView extends AbsListView {
*
* @attr ref android.R.styleable#GridView_stretchMode
*/
- public void setStretchMode(int stretchMode) {
+ public void setStretchMode(@StretchMode int stretchMode) {
if (stretchMode != mStretchMode) {
mStretchMode = stretchMode;
requestLayoutIfNecessary();
}
}
+ @StretchMode
public int getStretchMode() {
return mStretchMode;
}