|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.widget.RemoteViews
public class RemoteViews
A class that describes a view hierarchy that can be displayed in another process. The hierarchy is inflated from a layout resource file, and this class provides some basic operations for modifying the content of the inflated hierarchy.
| Nested Class Summary | |
|---|---|
static class |
RemoteViews.ActionException
Exception to send when something goes wrong executing an action |
static interface |
RemoteViews.RemoteView
This annotation indicates that a subclass of View is alllowed to be used with the RemoteViews mechanism. |
| Nested classes/interfaces inherited from interface android.os.Parcelable |
|---|
Parcelable.Creator<T> |
| Field Summary | |
|---|---|
static Parcelable.Creator<RemoteViews> |
CREATOR
Parcelable.Creator that instantiates RemoteViews objects |
| Fields inherited from interface android.os.Parcelable |
|---|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE |
| Constructor Summary | |
|---|---|
RemoteViews(Parcel parcel)
Reads a RemoteViews object from a parcel. |
|
RemoteViews(String packageName,
int layoutId)
Create a new RemoteViews object that will display the views contained in the specified layout file. |
|
| Method Summary | |
|---|---|
View |
apply(Context context,
ViewGroup parent)
Inflates the view hierarchy represented by this object and applies all of the actions. |
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation. |
int |
getLayoutId()
|
String |
getPackage()
|
boolean |
onLoadClass(Class clazz)
Hook to allow clients of the LayoutInflater to restrict the set of Views that are allowed to be inflated. |
void |
reapply(Context context,
View v)
Applies all of the actions to the provided view. |
void |
setChronometer(int viewId,
long base,
String format,
boolean running)
Equivalent to calling Chronometer.setBase,
Chronometer.setFormat,
and Chronometer.start() or
Chronometer.stop(). |
void |
setImageViewBitmap(int viewId,
Bitmap bitmap)
Equivalent to calling ImageView.setImageBitmap |
void |
setImageViewResource(int viewId,
int srcId)
Equivalent to calling ImageView.setImageResource |
void |
setImageViewUri(int viewId,
Uri uri)
Equivalent to calling ImageView.setImageURI |
void |
setProgressBar(int viewId,
int max,
int progress,
boolean indeterminate)
Equivalent to calling ProgressBar.setMax,
ProgressBar.setProgress, and
ProgressBar.setIndeterminate |
void |
setTextViewText(int viewId,
CharSequence text)
Equivalent to calling TextView.setText |
void |
setViewVisibility(int viewId,
int visibility)
Equivalent to calling View.setVisibility |
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Parcelable.Creator<RemoteViews> CREATOR
| Constructor Detail |
|---|
public RemoteViews(String packageName,
int layoutId)
packageName - Name of the package that contains the layout resourcelayoutId - The id of the layout resourcepublic RemoteViews(Parcel parcel)
parcel - | Method Detail |
|---|
public String getPackage()
public int getLayoutId()
public void setViewVisibility(int viewId,
int visibility)
viewId - The id of the view whose visibility should changevisibility - The new visibility for the view
public void setTextViewText(int viewId,
CharSequence text)
viewId - The id of the view whose text should changetext - The new text for the view
public void setImageViewResource(int viewId,
int srcId)
viewId - The id of the view whose drawable should changesrcId - The new resource id for the drawable
public void setImageViewUri(int viewId,
Uri uri)
viewId - The id of the view whose drawable should changeuri - The Uri for the image
public void setImageViewBitmap(int viewId,
Bitmap bitmap)
viewId - The id of the view whose drawable should changebitmap - The new Bitmap for the drawable
public void setChronometer(int viewId,
long base,
String format,
boolean running)
Chronometer.setBase,
Chronometer.setFormat,
and Chronometer.start() or
Chronometer.stop().
viewId - The id of the view whose text should changebase - The time at which the timer would have read 0:00. This
time should be based off of
SystemClock.elapsedRealtime().format - The Chronometer format string, or null to
simply display the timer value.running - True if you want the clock to be running, false if not.
public void setProgressBar(int viewId,
int max,
int progress,
boolean indeterminate)
ProgressBar.setMax,
ProgressBar.setProgress, and
ProgressBar.setIndeterminate
viewId - The id of the view whose text should changemax - The 100% value for the progress barprogress - The current value of the progress bar.indeterminate - True if the progress bar is indeterminate,
false if not.
public View apply(Context context,
ViewGroup parent)
Caller beware: this may throw
context - Default context to useparent - Parent that the resulting view hierarchy will be attached to. This method
does not attach the hierarchy. The caller should do so when appropriate.
public void reapply(Context context,
View v)
Caller beware: this may throw
v - The view to apply the actions to. This should be the result of
the apply(Context,ViewGroup) call.public boolean onLoadClass(Class clazz)
LayoutInflater.Filter
onLoadClass in interface LayoutInflater.Filterclazz - The class object for the View that is about to be inflated
public int describeContents()
Parcelable
describeContents in interface Parcelable
public void writeToParcel(Parcel dest,
int flags)
Parcelable
writeToParcel in interface Parcelabledest - The Parcel in which the object should be written.flags - Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||