|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xtremelabs.robolectric.shadows.ShadowAppWidgetManager
@Implements(value=android.appwidget.AppWidgetManager.class) public class ShadowAppWidgetManager
Constructor Summary | |
---|---|
ShadowAppWidgetManager()
|
Method Summary | |
---|---|
int |
createWidget(java.lang.Class<? extends android.appwidget.AppWidgetProvider> appWidgetProviderClass,
int widgetLayoutId)
Creates a widget by inflating its layout. |
int[] |
createWidgets(java.lang.Class<? extends android.appwidget.AppWidgetProvider> appWidgetProviderClass,
int widgetLayoutId,
int howManyToCreate)
Creates a bunch of widgets by inflating the same layout multiple times. |
boolean |
getAlwaysRecreateViewsDuringUpdate()
Non-Android accessor. |
android.appwidget.AppWidgetProvider |
getAppWidgetProviderFor(int widgetId)
Non-Android accessor. |
static android.appwidget.AppWidgetManager |
getInstance(android.content.Context context)
Finds or creates an AppWidgetManager for the given context |
android.view.View |
getViewFor(int widgetId)
Non-Android accessor. |
void |
reconstructWidgetViewAsIfPhoneWasRotated(int appWidgetId)
Triggers a reapplication of the most recent set of actions against the widget, which is what happens when the phone is rotated. |
void |
setAlwaysRecreateViewsDuringUpdate(boolean alwaysRecreate)
Non-Android mechanism that enables testing of widget behavior when all of the views are recreated on every update. |
void |
updateAppWidget(int[] appWidgetIds,
android.widget.RemoteViews views)
|
void |
updateAppWidget(int appWidgetId,
android.widget.RemoteViews views)
Simulates updating an AppWidget with a new set of views |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShadowAppWidgetManager()
Method Detail |
---|
@Implementation public static android.appwidget.AppWidgetManager getInstance(android.content.Context context)
AppWidgetManager
for the given context
context
- the context
for which to produce an assoicated AppWidgetManager
AppWidgetManager
associated with the given context
@Implementation public void updateAppWidget(int[] appWidgetIds, android.widget.RemoteViews views)
@Implementation public void updateAppWidget(int appWidgetId, android.widget.RemoteViews views)
AppWidget
with a new set of views
appWidgetId
- id of widgetviews
- views to updatepublic void reconstructWidgetViewAsIfPhoneWasRotated(int appWidgetId)
appWidgetId
- the ID of the widget to be affectedpublic int createWidget(java.lang.Class<? extends android.appwidget.AppWidgetProvider> appWidgetProviderClass, int widgetLayoutId)
appWidgetProviderClass
- the app widget provider classwidgetLayoutId
- id of the layout to inflate
public int[] createWidgets(java.lang.Class<? extends android.appwidget.AppWidgetProvider> appWidgetProviderClass, int widgetLayoutId, int howManyToCreate)
appWidgetProviderClass
- the app widget provider classwidgetLayoutId
- id of the layout to inflatehowManyToCreate
- number of new widgets to create
public android.view.View getViewFor(int widgetId)
widgetId
- id of the desired widget
widgetId
public android.appwidget.AppWidgetProvider getAppWidgetProviderFor(int widgetId)
widgetId
- id of the widget whose provider is to be returned
AppWidgetProvider
associated with widgetId
public void setAlwaysRecreateViewsDuringUpdate(boolean alwaysRecreate)
alwaysRecreate
- whether or not to always recreate the viewspublic boolean getAlwaysRecreateViewsDuringUpdate()
alwaysRecreateViewsDuringUpdate
flag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |