From 0b96a57c851af2f66e3bc738035478efb3c1957e Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Thu, 10 Feb 2011 15:56:16 -0800 Subject: Making AdapaterViewAnimator setDisplayedChild remotable Change-Id: Idee91f457e1d4316feb077aaa949baa54eca6ab1 --- api/current.xml | 17 ++++++++++++++++- core/java/android/widget/AdapterViewAnimator.java | 1 + core/java/android/widget/RemoteViews.java | 18 ++++++++++++++---- core/java/android/widget/ViewAnimator.java | 3 +++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/api/current.xml b/api/current.xml index 5f732e1eee20..968b8ed6f6a7 100644 --- a/api/current.xml +++ b/api/current.xml @@ -257571,6 +257571,21 @@ + + + + + + - + diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java index 190c0fc40907..072992efef2b 100644 --- a/core/java/android/widget/AdapterViewAnimator.java +++ b/core/java/android/widget/AdapterViewAnimator.java @@ -279,6 +279,7 @@ public abstract class AdapterViewAnimator extends AdapterView * * @param whichChild the index of the child view to display */ + @android.view.RemotableViewMethod public void setDisplayedChild(int whichChild) { setDisplayedChild(whichChild, true); } diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 482ce56f83ae..c854fac08626 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -1056,23 +1056,33 @@ public class RemoteViews implements Parcelable, Filter { } /** - * Equivalent to calling {@link AdapterViewFlipper#showNext()} + * Equivalent to calling {@link AdapterViewAnimator#showNext()} * - * @param viewId The id of the view on which to call {@link AdapterViewFlipper#showNext()} + * @param viewId The id of the view on which to call {@link AdapterViewAnimator#showNext()} */ public void showNext(int viewId) { addAction(new ReflectionActionWithoutParams(viewId, "showNext")); } /** - * Equivalent to calling {@link AdapterViewFlipper#showPrevious()} + * Equivalent to calling {@link AdapterViewAnimator#showPrevious()} * - * @param viewId The id of the view on which to call {@link AdapterViewFlipper#showPrevious()} + * @param viewId The id of the view on which to call {@link AdapterViewAnimator#showPrevious()} */ public void showPrevious(int viewId) { addAction(new ReflectionActionWithoutParams(viewId, "showPrevious")); } + /** + * Equivalent to calling {@link AdapterViewAnimator#setDisplayedChild(int)} + * + * @param viewId The id of the view on which to call + * {@link AdapterViewAnimator#setDisplayedChild(int)} + */ + public void setDisplayedChild(int viewId, int childIndex) { + setInt(viewId, "setDisplayedChild", childIndex); + } + /** * Equivalent to calling View.setVisibility * diff --git a/core/java/android/widget/ViewAnimator.java b/core/java/android/widget/ViewAnimator.java index 7b668932fc9a..3c683d6b5330 100644 --- a/core/java/android/widget/ViewAnimator.java +++ b/core/java/android/widget/ViewAnimator.java @@ -96,6 +96,7 @@ public class ViewAnimator extends FrameLayout { * * @param whichChild the index of the child view to display */ + @android.view.RemotableViewMethod public void setDisplayedChild(int whichChild) { mWhichChild = whichChild; if (whichChild >= getChildCount()) { @@ -122,6 +123,7 @@ public class ViewAnimator extends FrameLayout { /** * Manually shows the next child. */ + @android.view.RemotableViewMethod public void showNext() { setDisplayedChild(mWhichChild + 1); } @@ -129,6 +131,7 @@ public class ViewAnimator extends FrameLayout { /** * Manually shows the previous child. */ + @android.view.RemotableViewMethod public void showPrevious() { setDisplayedChild(mWhichChild - 1); } -- cgit v1.2.3-59-g8ed1b