summaryrefslogtreecommitdiff
path: root/core/java/android/widget/GridView.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-07-16 11:18:17 -0700
committerWinson Chung <winsonc@google.com>2010-07-19 14:48:31 -0700
commit499cb9f516062b654952d282f211bee44c31a3c2 (patch)
tree3c9bac8b31275e886bfbd07805c38839c185eab2 /core/java/android/widget/GridView.java
parentb5b37f3bcc3065959c27e588f065dfb33a061e1d (diff)
Initial changes to allow collections in widgets.
Change-Id: I3cfa899bae88cd252912cecebc12e93c27a3b7c9
Diffstat (limited to 'core/java/android/widget/GridView.java')
-rw-r--r--core/java/android/widget/GridView.java35
1 files changed, 34 insertions, 1 deletions
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index fe69a1324286..a5b3ed5bfc7c 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -17,22 +17,25 @@
package android.widget;
import android.content.Context;
+import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.KeyEvent;
+import android.view.SoundEffectConstants;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
-import android.view.SoundEffectConstants;
import android.view.animation.GridLayoutAnimationController;
+import android.widget.RemoteViews.RemoteView;
/**
* A view that shows items in two-dimensional scrolling grid. The items in the
* grid come from the {@link ListAdapter} associated with this view.
*/
+@RemoteView
public class GridView extends AbsListView {
public static final int NO_STRETCH = 0;
public static final int STRETCH_SPACING = 1;
@@ -107,6 +110,16 @@ public class GridView extends AbsListView {
}
/**
+ * Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService
+ * through the specified intent.
+ * @param intent the intent used to identify the RemoteViewsService for the adapter to connect to.
+ */
+ @android.view.RemotableViewMethod
+ public void setRemoteViewsAdapter(Intent intent) {
+ super.setRemoteViewsAdapter(intent);
+ }
+
+ /**
* Sets the data behind this GridView.
*
* @param adapter the adapter providing the grid's data
@@ -740,6 +753,26 @@ public class GridView extends AbsListView {
}
/**
+ * Smoothly scroll to the specified adapter position. The view will
+ * scroll such that the indicated position is displayed.
+ * @param position Scroll to this adapter position.
+ */
+ @android.view.RemotableViewMethod
+ public void smoothScrollToPosition(int position) {
+ super.smoothScrollToPosition(position);
+ }
+
+ /**
+ * Smoothly scroll to the specified adapter position offset. The view will
+ * scroll such that the indicated position is displayed.
+ * @param offset The amount to offset from the adapter position to scroll to.
+ */
+ @android.view.RemotableViewMethod
+ public void smoothScrollByOffset(int offset) {
+ super.smoothScrollByOffset(offset);
+ }
+
+ /**
* Fills the grid based on positioning the new selection relative to the old
* selection. The new selection will be placed at, above, or below the
* location of the new selection depending on how the selection is moving.