public class RemoteViews
extends Object implements Parcelable, LayoutInflater.Filter
| java.lang.Object | |
| android.widget.RemoteViews | |
描述可以在另一个进程中显示的视图层次结构的类。 层次结构从布局资源文件中膨胀,此类提供了一些用于修改充气层次结构内容的基本操作。
Nested classes |
|
|---|---|
class |
RemoteViews.ActionException 执行某个操作时发生错误时发送的例外情况 |
@interface |
RemoteViews.RemoteView 这个注释表明View的一个子类被用于 |
Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<RemoteViews> |
CREATOR Parcelable.Creator实例化RemoteViews对象 |
Public constructors |
|
|---|---|
RemoteViews(String packageName, int layoutId) 创建一个新的RemoteViews对象,该对象将显示包含在指定布局文件中的视图。 |
|
RemoteViews(RemoteViews landscape, RemoteViews portrait) 根据当前配置创建一个新的RemoteViews对象,该对象将充气为指定的逻辑空间或纵向RemoteViews。 |
|
RemoteViews(Parcel parcel) 从宗地中读取RemoteViews对象。 |
|
公共方法(Public methods) |
|
|---|---|
void |
addView(int viewId, RemoteViews nestedView) 相当于调用 |
View |
apply(Context context, ViewGroup parent) 膨胀由此对象表示的视图层次并应用所有操作。 |
RemoteViews |
clone() 创建并返回此对象的副本。 |
int |
describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 |
int |
getLayoutId() 返回与此RemoteView关联的根布局的布局ID。 |
String |
getPackage() |
boolean |
onLoadClass(Class clazz) 挂钩以允许LayoutInflater的客户端限制允许被夸大的视图集合。 |
void |
reapply(Context context, View v) 将所有操作应用于提供的视图。 |
void |
removeAllViews(int viewId) 相当于拨打 |
void |
setAccessibilityTraversalAfter(int viewId, int nextId) |
void |
setAccessibilityTraversalBefore(int viewId, int nextId) |
void |
setBitmap(int viewId, String methodName, Bitmap value) 在此RemoteViews的布局视图中调用一个采用一个位图的方法。 |
void |
setBoolean(int viewId, String methodName, boolean value) 在这个RemoteViews的布局的视图中调用一个采用一个布尔值的方法。 |
void |
setBundle(int viewId, String methodName, Bundle value) 在此RemoteViews的布局的视图中调用一个采用一个Bundle的方法。 |
void |
setByte(int viewId, String methodName, byte value) 在此RemoteViews的布局中,调用视图中占用一个字节的方法。 |
void |
setChar(int viewId, String methodName, char value) 在这个RemoteViews的布局中调用一个视图上的一个字符的方法。 |
void |
setCharSequence(int viewId, String methodName, CharSequence value) 调用此RemoteViews的布局中的视图上的一个CharSequence。 |
void |
setChronometer(int viewId, long base, String format, boolean started) 相当于调用 |
void |
setChronometerCountDown(int viewId, boolean isCountDown) 相当于在具有给定viewId的计时器上调用 |
void |
setContentDescription(int viewId, CharSequence contentDescription) 相当于调用View.setContentDescription(CharSequence)。 |
void |
setDisplayedChild(int viewId, int childIndex) 相当于拨打 |
void |
setDouble(int viewId, String methodName, double value) 在这个RemoteViews的布局中调用一个在视图中占用一倍的方法。 |
void |
setEmptyView(int viewId, int emptyViewId) 相当于调用AdapterView.setEmptyView |
void |
setFloat(int viewId, String methodName, float value) 调用此RemoteViews的布局中的视图上的浮动视图。 |
void |
setIcon(int viewId, String methodName, Icon value) 调用此RemoteViews的布局中的视图上的一个图标。 |
void |
setImageViewBitmap(int viewId, Bitmap bitmap) 相当于调用ImageView.setImageBitmap |
void |
setImageViewIcon(int viewId, Icon icon) 相当于调用ImageView.setImageIcon |
void |
setImageViewResource(int viewId, int srcId) 相当于调用ImageView.setImageResource |
void |
setImageViewUri(int viewId, Uri uri) 等同于调用ImageView.setImageURI |
void |
setInt(int viewId, String methodName, int value) 调用此RemoteViews的布局视图中的一个int值的方法。 |
void |
setIntent(int viewId, String methodName, Intent value) 在此RemoteViews的布局的视图中调用一个采用一个Intent的方法。 |
void |
setLabelFor(int viewId, int labeledId) 相当于调用View.setLabelFor(int)。 |
void |
setLong(int viewId, String methodName, long value) 在这个RemoteViews的布局的视图中调用一个占用一个long的方法。 |
void |
setOnClickFillInIntent(int viewId, Intent fillInIntent) 当使用集合(例如。 |
void |
setOnClickPendingIntent(int viewId, PendingIntent pendingIntent) 相当于拨打 |
void |
setPendingIntentTemplate(int viewId, PendingIntent pendingIntentTemplate) 当使用集合(例如。 |
void |
setProgressBar(int viewId, int max, int progress, boolean indeterminate) 相当于调用 |
void |
setRelativeScrollPosition(int viewId, int offset) 相当于拨打 |
void |
setRemoteAdapter(int appWidgetId, int viewId, Intent intent) 此方法在API级别14中已被弃用。此方法已被弃用。 见 |
void |
setRemoteAdapter(int viewId, Intent intent) 相当于拨打 |
void |
setScrollPosition(int viewId, int position) 相当于拨打 |
void |
setShort(int viewId, String methodName, short value) 在这个RemoteViews的布局的视图中调用一个简短的方法。 |
void |
setString(int viewId, String methodName, String value) 在此RemoteViews的布局的视图中调用一个采用一个字符串的方法。 |
void |
setTextColor(int viewId, int color) 相当于拨打 |
void |
setTextViewCompoundDrawables(int viewId, int left, int top, int right, int bottom) 相当于拨打 |
void |
setTextViewCompoundDrawablesRelative(int viewId, int start, int top, int end, int bottom) 相当于拨打 |
void |
setTextViewText(int viewId, CharSequence text) 相当于调用TextView.setText |
void |
setTextViewTextSize(int viewId, int units, float size) 相当于拨打 |
void |
setUri(int viewId, String methodName, Uri value) 在这个RemoteViews的布局的视图中调用一个采用一个Uri的方法。 |
void |
setViewPadding(int viewId, int left, int top, int right, int bottom) 相当于拨打 |
void |
setViewVisibility(int viewId, int visibility) 等同于调用View.setVisibility |
void |
showNext(int viewId) 相当于拨打 |
void |
showPrevious(int viewId) 相当于拨打 |
void |
writeToParcel(Parcel dest, int flags) 将此对象平铺到一个包裹中。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
android.view.LayoutInflater.Filter
|
|
RemoteViews (String packageName, int layoutId)
创建一个新的RemoteViews对象,该对象将显示包含在指定布局文件中的视图。
| 参数(Parameters) | |
|---|---|
packageName |
String: Name of the package that contains the layout resource |
layoutId |
int: The id of the layout resource |
RemoteViews (RemoteViews landscape, RemoteViews portrait)
根据当前配置创建一个新的RemoteViews对象,该对象将充气为指定的逻辑空间或纵向RemoteViews。
| 参数(Parameters) | |
|---|---|
landscape |
RemoteViews: The RemoteViews to inflate in landscape configuration |
portrait |
RemoteViews: The RemoteViews to inflate in portrait configuration |
void addView (int viewId,
RemoteViews nestedView)
相当于调用addView(View)充气后给予RemoteViews 。 这允许用户构建“嵌套” RemoteViews 。 如果RemoteViews消费者可能回收布局,请使用removeAllViews(int)清除任何现有的孩子。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the parent ViewGroup to add child into. |
nestedView |
RemoteViews: RemoteViews that describes the child. |
View apply (Context context, ViewGroup parent)
膨胀由此对象表示的视图层次并应用所有操作。
来电者小心:这可能会抛出
| 参数(Parameters) | |
|---|---|
context |
Context: Default context to use |
parent |
ViewGroup: Parent that the resulting view hierarchy will be attached to. This method does not attach the hierarchy. The caller should do so when appropriate. |
| 返回(Returns) | |
|---|---|
View |
The inflated view hierarchy |
RemoteViews clone ()
创建并返回此对象的副本。 “复制”的确切含义可能取决于对象的类别。 一般意图是,对于任何对象x ,表达式:
will be true, and that the expression:x.clone() != x
will bex.clone().getClass() == x.getClass()
true, but these are not absolute requirements. While it is typically the case that:
will bex.clone().equals(x)
true, this is not an absolute requirement.
按照惯例,返回的对象应该通过调用super.clone来获得。 如果一个类和它的所有超类( Object除外)都遵守这个约定,那将是这样的情况,即x.clone().getClass() == x.getClass() 。
按照惯例,这个方法返回的对象应该独立于这个对象(被克隆)。 为了实现这种独立性,可能需要在返回super.clone之前修改对象的一个或多个字段。 通常,这意味着复制包含被克隆对象的内部“深层结构”的任何可变对象,并将这些对象的引用替换为对这些副本的引用。 如果一个类仅包含原始字段或对不可变对象的引用,那么通常情况下不需要修改super.clone返回的对象中的字段。
类Object的方法clone执行特定的克隆操作。 首先,如果该对象的类没有实现接口Cloneable ,则引发CloneNotSupportedException 。 请注意,所有数组都被视为实现接口Cloneable并且数组类型T[]的clone方法的返回类型为T[] ,其中T是任何引用或基本类型。 否则,此方法创建该对象的类的新实例,并使用该对象的相应字段的内容来初始化其所有字段,就像通过赋值一样; 这些字段的内容本身并不克隆。 因此,此方法执行此对象的“浅拷贝”,而不是“深拷贝”操作。
类 Object本身并未实现接口 Cloneable ,因此在类 Object的对象上调用 clone方法将导致在运行时抛出异常。
| 返回(Returns) | |
|---|---|
RemoteViews |
a clone of this instance. |
int describeContents ()
描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。
| 返回(Returns) | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
int getLayoutId ()
返回与此RemoteView关联的根布局的布局ID。 在RemoteViews同时具有横向和纵向根的情况下,这将返回与纵向布局关联的布局ID。
| 返回(Returns) | |
|---|---|
int |
the layout id. |
boolean onLoadClass (Class clazz)
挂钩以允许LayoutInflater的客户端限制允许被夸大的视图集合。
| 参数(Parameters) | |
|---|---|
clazz |
Class: The class object for the View that is about to be inflated |
| 返回(Returns) | |
|---|---|
boolean |
True if this class is allowed to be inflated, or false otherwise |
void reapply (Context context, View v)
将所有操作应用于提供的视图。
来电者小心:这可能会抛出
| 参数(Parameters) | |
|---|---|
context |
Context
|
v |
View: The view to apply the actions to. This should be the result of the apply(Context, ViewGroup) call. |
void removeAllViews (int viewId)
相当于拨打 removeAllViews() 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the parent ViewGroup to remove all children from. |
void setAccessibilityTraversalAfter (int viewId,
int nextId)
相当于拨打 setAccessibilityTraversalAfter(int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose after view in accessibility traversal to set. |
nextId |
int: The id of the next in the accessibility traversal. |
void setAccessibilityTraversalBefore (int viewId,
int nextId)
相当于拨打 setAccessibilityTraversalBefore(int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose before view in accessibility traversal to set. |
nextId |
int: The id of the next in the accessibility traversal. |
void setBitmap (int viewId,
String methodName,
Bitmap value)
在此RemoteViews的布局视图中调用一个采用一个位图的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
Bitmap: The value to pass to the method. |
void setBoolean (int viewId,
String methodName,
boolean value)
在这个RemoteViews的布局的视图中调用一个采用一个布尔值的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
boolean: The value to pass to the method. |
void setBundle (int viewId,
String methodName,
Bundle value)
在此RemoteViews的布局的视图中调用一个采用一个Bundle的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
Bundle: The value to pass to the method. |
void setByte (int viewId,
String methodName,
byte value)
在此RemoteViews的布局中,调用视图中占用一个字节的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
byte: The value to pass to the method. |
void setChar (int viewId,
String methodName,
char value)
在这个RemoteViews的布局中调用一个视图上的一个字符的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
char: The value to pass to the method. |
void setCharSequence (int viewId,
String methodName,
CharSequence value)
调用此RemoteViews的布局中的视图上的一个CharSequence。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
CharSequence: The value to pass to the method. |
void setChronometer (int viewId,
long base,
String format,
boolean started)
相当于调用 Chronometer.setBase , Chronometer.setFormat ,并 Chronometer.start()或者 Chronometer.stop() 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the Chronometer to change |
base |
long: The time at which the timer would have read 0:00. This time should be based off of SystemClock.elapsedRealtime(). |
format |
String: The Chronometer format string, or null to simply display the timer value. |
started |
boolean: True if you want the clock to be started, false if not. |
void setChronometerCountDown (int viewId,
boolean isCountDown)
相当于在具有给定viewId的计时器上调用 Chronometer.setCountDown 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the Chronometer to change |
isCountDown |
boolean: True if you want the chronometer to count down to base instead of counting up. |
void setContentDescription (int viewId,
CharSequence contentDescription)
相当于调用View.setContentDescription(CharSequence)。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose content description should change. |
contentDescription |
CharSequence: The new content description for the view. |
void setDisplayedChild (int viewId,
int childIndex)
相当于拨打 setDisplayedChild(int)
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call setDisplayedChild(int) |
childIndex |
int
|
void setDouble (int viewId,
String methodName,
double value)
在这个RemoteViews的布局中调用一个在视图中占用一倍的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
double: The value to pass to the method. |
void setEmptyView (int viewId,
int emptyViewId)
相当于调用AdapterView.setEmptyView
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to set the empty view |
emptyViewId |
int: The view id of the empty view |
void setFloat (int viewId,
String methodName,
float value)
调用此RemoteViews的布局中的视图上的浮动视图。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
float: The value to pass to the method. |
void setIcon (int viewId,
String methodName,
Icon value)
调用此RemoteViews的布局中的视图上的一个图标。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
Icon: The Icon to pass the method. |
void setImageViewBitmap (int viewId,
Bitmap bitmap)
相当于调用ImageView.setImageBitmap
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose bitmap should change |
bitmap |
Bitmap: The new Bitmap for the drawable |
void setImageViewIcon (int viewId,
Icon icon)
相当于调用ImageView.setImageIcon
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose bitmap should change |
icon |
Icon: The new Icon for the ImageView |
void setImageViewResource (int viewId,
int srcId)
相当于调用ImageView.setImageResource
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose drawable should change |
srcId |
int: The new resource id for the drawable |
void setImageViewUri (int viewId,
Uri uri)
等同于调用ImageView.setImageURI
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose drawable should change |
uri |
Uri: The Uri for the image |
void setInt (int viewId,
String methodName,
int value)
调用此RemoteViews的布局视图中的一个int值的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
int: The value to pass to the method. |
void setIntent (int viewId,
String methodName,
Intent value)
在此RemoteViews的布局的视图中调用一个采用一个Intent的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
Intent: The Intent to pass the method. |
void setLabelFor (int viewId,
int labeledId)
相当于调用View.setLabelFor(int)。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose property to set. |
labeledId |
int: The id of a view for which this view serves as a label. |
void setLong (int viewId,
String methodName,
long value)
在这个RemoteViews的布局的视图中调用一个占用一个long的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
long: The value to pass to the method. |
void setOnClickFillInIntent (int viewId,
Intent fillInIntent)
当使用集合(例如ListView , StackView等)在窗口小部件,它是非常昂贵的对单个项目设置PendingIntents,并且因此不允许的。 相反,可以在集合上设置单个PendingIntent模板,请参阅setPendingIntentTemplate(int, PendingIntent) ,并且可以通过在该项目上设置fillInIntent来区分给定项目的单个单击操作。 然后将fillInIntent与PendingIntent模板组合,以确定单击该项目时将执行的最终意图。 它的工作原理如下:任何在PendingIntent模板中留白但由fillInIntent提供的字段将被覆盖,并且将使用生成的PendingIntent。 PendingIntent模板的相关字段将填充fillInIntent中设置的相关字段。 有关更多详细信息,请参阅fillIn(Intent, int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to set the fillInIntent |
fillInIntent |
Intent: The intent which will be combined with the parent's PendingIntent in order to determine the on-click behavior of the view specified by viewId |
void setOnClickPendingIntent (int viewId,
PendingIntent pendingIntent)
相当于拨打setOnClickListener(android.view.View.OnClickListener)启动提供的PendingIntent 。 设置项目的集合内的点击动作(如ListView , StackView等),这种方法是行不通的。 相反,使用{@link RemoteViews#setPendingIntentTemplate(int,PendingIntent)与RemoteViews#setOnClickFillInIntent(int,Intent)结合使用。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view that will trigger the PendingIntent when clicked |
pendingIntent |
PendingIntent: The PendingIntent to send when user clicks |
void setPendingIntentTemplate (int viewId,
PendingIntent pendingIntentTemplate)
当使用集合(例如ListView , StackView等)在窗口小部件,它是非常昂贵的对单个项目设置PendingIntents,并且因此不允许的。 相反,应该使用此方法在集合上设置单个PendingIntent模板,并且使用setOnClickFillInIntent(int, Intent)可以区分单个项目的点击行为。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the collection who's children will use this PendingIntent template when clicked |
pendingIntentTemplate |
PendingIntent: The PendingIntent to be combined with extras specified by a child of viewId and executed when that child is clicked |
void setProgressBar (int viewId,
int max,
int progress,
boolean indeterminate)
相当于调用 ProgressBar.setMax , ProgressBar.setProgress ,并 ProgressBar.setIndeterminate如果不确定是真实的,那么对于max和进步的价值被忽略。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the ProgressBar to change |
max |
int: The 100% value for the progress bar |
progress |
int: The current value of the progress bar. |
indeterminate |
boolean: True if the progress bar is indeterminate, false if not. |
void setRelativeScrollPosition (int viewId,
int offset)
相当于拨打 smoothScrollToPosition(int, int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view to change |
offset |
int: Scroll by this adapter position offset |
void setRemoteAdapter (int appWidgetId,
int viewId,
Intent intent)
此方法在API级别14中已弃用。
此方法已被弃用。 见setRemoteAdapter(int, Intent)
相当于拨打 setRemoteViewsAdapter(Intent) 。
| 参数(Parameters) | |
|---|---|
appWidgetId |
int: The id of the app widget which contains the specified view. (This parameter is ignored in this deprecated method) |
viewId |
int: The id of the AdapterView |
intent |
Intent: The intent of the service which will be providing data to the RemoteViewsAdapter |
void setRemoteAdapter (int viewId,
Intent intent)
相当于拨打setRemoteViewsAdapter(Intent) 。 只能用于App Widgets。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the AdapterView |
intent |
Intent: The intent of the service which will be providing data to the RemoteViewsAdapter |
void setScrollPosition (int viewId,
int position)
相当于拨打 smoothScrollToPosition(int, int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view to change |
position |
int: Scroll to this adapter position |
void setShort (int viewId,
String methodName,
short value)
在这个RemoteViews的布局的视图中调用一个简短的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
short: The value to pass to the method. |
void setString (int viewId,
String methodName,
String value)
在此RemoteViews的布局的视图中调用一个采用一个字符串的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
String: The value to pass to the method. |
void setTextColor (int viewId,
int color)
相当于拨打 setTextColor(int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose text color should change |
color |
int: Sets the text color for all the states (normal, selected, focused) to be this color. |
void setTextViewCompoundDrawables (int viewId,
int left,
int top,
int right,
int bottom)
相当于拨打 setCompoundDrawablesWithIntrinsicBounds(int, int, int, int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose text should change |
left |
int: The id of a drawable to place to the left of the text, or 0 |
top |
int: The id of a drawable to place above the text, or 0 |
right |
int: The id of a drawable to place to the right of the text, or 0 |
bottom |
int: The id of a drawable to place below the text, or 0 |
void setTextViewCompoundDrawablesRelative (int viewId,
int start,
int top,
int end,
int bottom)
相当于拨打 setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose text should change |
start |
int: The id of a drawable to place before the text (relative to the layout direction), or 0 |
top |
int: The id of a drawable to place above the text, or 0 |
end |
int: The id of a drawable to place after the text, or 0 |
bottom |
int: The id of a drawable to place below the text, or 0 |
void setTextViewText (int viewId,
CharSequence text)
相当于调用TextView.setText
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose text should change |
text |
CharSequence: The new text for the view |
void setTextViewTextSize (int viewId,
int units,
float size)
相当于拨打 setTextSize(int, float)
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose text size should change |
units |
int: The units of size (e.g. COMPLEX_UNIT_SP) |
size |
float: The size of the text |
void setUri (int viewId,
String methodName,
Uri value)
在这个RemoteViews的布局的视图中调用一个采用一个Uri的方法。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call the method. |
methodName |
String: The name of the method to call. |
value |
Uri: The value to pass to the method. |
void setViewPadding (int viewId,
int left,
int top,
int right,
int bottom)
相当于拨打 setPadding(int, int, int, int) 。
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view to change |
left |
int: the left padding in pixels |
top |
int: the top padding in pixels |
right |
int: the right padding in pixels |
bottom |
int: the bottom padding in pixels |
void setViewVisibility (int viewId,
int visibility)
等同于调用View.setVisibility
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view whose visibility should change |
visibility |
int: The new visibility for the view |
void showNext (int viewId)
相当于拨打 showNext()
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call showNext() |
void showPrevious (int viewId)
相当于拨打 showPrevious()
| 参数(Parameters) | |
|---|---|
viewId |
int: The id of the view on which to call showPrevious() |
void writeToParcel (Parcel dest, int flags)
将此对象平铺到一个包裹中。
| 参数(Parameters) | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. |
flags |
int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. |