RemoteViews
open class RemoteViews : Parcelable, LayoutInflater.Filter
| kotlin.Any | |
| ↳ | android.widget.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.
RemoteViews is limited to support for the following layouts:
android.widget.AdapterViewFlipperandroid.widget.FrameLayoutandroid.widget.GridLayoutandroid.widget.GridViewandroid.widget.LinearLayoutandroid.widget.ListViewandroid.widget.RelativeLayoutandroid.widget.StackViewandroid.widget.ViewFlipper
And the following widgets:
android.widget.AnalogClockandroid.widget.Buttonandroid.widget.Chronometerandroid.widget.ImageButtonandroid.widget.ImageViewandroid.widget.ProgressBarandroid.widget.TextClockandroid.widget.TextView
Descendants of these classes are not supported.
Summary
Nested classes |
|
|---|---|
| open |
Exception to send when something goes wrong executing an action |
| open |
Class representing a response to an action performed on any element of a RemoteViews. |
|
This annotation indicates that a subclass of View is allowed to be used with the |
|
Constants |
|
|---|---|
| static String |
The intent extra that contains the bounds for all shared elements. |
Inherited constants |
|
|---|---|
Public constructors |
|
|---|---|
|
Create a new RemoteViews object that will display the views contained in the specified layout file. |
|
<init>(landscape: RemoteViews!, portrait: RemoteViews!)Create a new RemoteViews object that will inflate as the specified landspace or portrait RemoteViews, depending on the current configuration. |
|
<init>(src: RemoteViews!)Creates a copy of another RemoteViews. |
|
|
Reads a RemoteViews object from a parcel. |
|
Public methods |
|
|---|---|
| open Unit |
addView(viewId: Int, nestedView: RemoteViews!)Equivalent to calling |
| open View! |
Inflates the view hierarchy represented by this object and applies all of the actions. |
| open RemoteViews! |
clone()Returns a deep copy of the RemoteViews object. |
| open Int | |
| open Int |
Returns the layout id of the root layout associated with this RemoteViews. |
| open String! | |
| open Boolean |
onLoadClass(clazz: Class<Any!>!)Used to restrict the views which can be inflated |
| open Unit |
Applies all of the actions to the provided view. |
| open Unit |
removeAllViews(viewId: Int)Equivalent to calling |
| open Unit |
setAccessibilityTraversalAfter(viewId: Int, nextId: Int)Equivalent to calling |
| open Unit |
setAccessibilityTraversalBefore(viewId: Int, nextId: Int)Equivalent to calling |
| open Unit |
Call a method taking one Bitmap on a view in the layout for this RemoteViews. |
| open Unit |
setBoolean(viewId: Int, methodName: String!, value: Boolean)Call a method taking one boolean on a view in the layout for this RemoteViews. |
| open Unit |
Call a method taking one Bundle on a view in the layout for this RemoteViews. |
| open Unit |
Call a method taking one byte on a view in the layout for this RemoteViews. |
| open Unit |
Call a method taking one char on a view in the layout for this RemoteViews. |
| open Unit |
setCharSequence(viewId: Int, methodName: String!, value: CharSequence!)Call a method taking one CharSequence on a view in the layout for this RemoteViews. |
| open Unit |
setChronometer(viewId: Int, base: Long, format: String!, started: Boolean)Equivalent to calling |
| open Unit |
setChronometerCountDown(viewId: Int, isCountDown: Boolean)Equivalent to calling |
| open Unit |
setContentDescription(viewId: Int, contentDescription: CharSequence!)Equivalent to calling View. |
| open Unit |
setDisplayedChild(viewId: Int, childIndex: Int)Equivalent to calling |
| open Unit |
Call a method taking one double on a view in the layout for this RemoteViews. |
| open Unit |
setEmptyView(viewId: Int, emptyViewId: Int)Equivalent to calling |
| open Unit |
Call a method taking one float on a view in the layout for this RemoteViews. |
| open Unit |
Call a method taking one Icon on a view in the layout for this RemoteViews. |
| open Unit |
setImageViewBitmap(viewId: Int, bitmap: Bitmap!)Equivalent to calling |
| open Unit |
setImageViewIcon(viewId: Int, icon: Icon!)Equivalent to calling |
| open Unit |
setImageViewResource(viewId: Int, srcId: Int)Equivalent to calling |
| open Unit |
setImageViewUri(viewId: Int, uri: Uri!)Equivalent to calling |
| open Unit |
Call a method taking one int on a view in the layout for this RemoteViews. |
| open Unit |
Call a method taking one Intent on a view in the layout for this RemoteViews. |
| open Unit |
setLabelFor(viewId: Int, labeledId: Int)Equivalent to calling |
| open Unit |
setLightBackgroundLayoutId(layoutId: Int)Provides an alternate layout ID, which can be used to inflate this view. |
| open Unit |
Call a method taking one long on a view in the layout for this RemoteViews. |
| open Unit |
setOnClickFillInIntent(viewId: Int, fillInIntent: Intent!)When using collections (eg. |
| open Unit |
setOnClickPendingIntent(viewId: Int, pendingIntent: PendingIntent!)Equivalent to calling |
| open Unit |
setOnClickResponse(viewId: Int, response: RemoteViews.RemoteResponse)Equivalent of calling |
| open Unit |
setPendingIntentTemplate(viewId: Int, pendingIntentTemplate: PendingIntent!)When using collections (eg. |
| open Unit |
setProgressBar(viewId: Int, max: Int, progress: Int, indeterminate: Boolean)Equivalent to calling |
| open Unit |
setRelativeScrollPosition(viewId: Int, offset: Int)Equivalent to calling |
| open Unit |
setRemoteAdapter(appWidgetId: Int, viewId: Int, intent: Intent!)Equivalent to calling |
| open Unit |
setRemoteAdapter(viewId: Int, intent: Intent!)Equivalent to calling |
| open Unit |
setScrollPosition(viewId: Int, position: Int)Equivalent to calling |
| open Unit |
Call a method taking one short on a view in the layout for this RemoteViews. |
| open Unit |
Call a method taking one String on a view in the layout for this RemoteViews. |
| open Unit |
setTextColor(viewId: Int, color: Int)Equivalent to calling |
| open Unit |
Equivalent to calling |
| open Unit |
Equivalent to calling |
| open Unit |
setTextViewText(viewId: Int, text: CharSequence!)Equivalent to calling |
| open Unit |
setTextViewTextSize(viewId: Int, units: Int, size: Float)Equivalent to calling |
| open Unit |
Call a method taking one Uri on a view in the layout for this RemoteViews. |
| open Unit |
Equivalent to calling |
| open Unit |
setViewVisibility(viewId: Int, visibility: Int)Equivalent to calling |
| open Unit |
Equivalent to calling |
| open Unit |
showPrevious(viewId: Int)Equivalent to calling |
| open Unit |
writeToParcel(dest: Parcel!, flags: Int) |
Properties |
|
|---|---|
| static Parcelable.Creator<RemoteViews!> |
Parcelable. |
Constants
EXTRA_SHARED_ELEMENT_BOUNDS
static val EXTRA_SHARED_ELEMENT_BOUNDS: String
The intent extra that contains the bounds for all shared elements.
Value: "android.widget.extra.SHARED_ELEMENT_BOUNDS"
Public constructors
<init>
RemoteViews(
packageName: String!,
layoutId: Int)
Create a new RemoteViews object that will display the views contained in the specified layout file.
| Parameters | |
|---|---|
packageName |
String!: Name of the package that contains the layout resource |
layoutId |
Int: The id of the layout resource |
<init>
RemoteViews(
landscape: RemoteViews!,
portrait: RemoteViews!)
Create a new RemoteViews object that will inflate as the specified landspace or portrait RemoteViews, depending on the current configuration.
| Parameters | |
|---|---|
landscape |
RemoteViews!: The RemoteViews to inflate in landscape configuration |
portrait |
RemoteViews!: The RemoteViews to inflate in portrait configuration |
<init>
RemoteViews(parcel: Parcel!)
Reads a RemoteViews object from a parcel.
| Parameters | |
|---|---|
parcel |
Parcel!: |
Public methods
addView
open fun addView(
viewId: Int,
nestedView: RemoteViews!
): Unit
Equivalent to calling ViewGroup#addView(View) after inflating the given RemoteViews. This allows users to build "nested" RemoteViews. In cases where consumers of RemoteViews may recycle layouts, use removeAllViews(int) to clear any existing children.
| Parameters | |
|---|---|
viewId |
Int: The id of the parent ViewGroup to add child into. |
nestedView |
RemoteViews!: RemoteViews that describes the child. |
apply
open fun apply(
context: Context!,
parent: ViewGroup!
): View!
Inflates the view hierarchy represented by this object and applies all of the actions.
Caller beware: this may throw
| 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. |
| Return | |
|---|---|
View! |
The inflated view hierarchy |
clone
open funclone(): RemoteViews!
Deprecated: use RemoteViews(android.widget.RemoteViews) instead.
Returns a deep copy of the RemoteViews object. The RemoteView may not be attached to another RemoteView -- it must be the root of a hierarchy.
| Return | |
|---|---|
RemoteViews! |
a clone of this instance. |
| Exceptions | |
|---|---|
java.lang.CloneNotSupportedException |
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. |
java.lang.IllegalStateException |
if this is not the root of a RemoteView hierarchy |
describeContents
open fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getLayoutId
open fun getLayoutId(): Int
Returns the layout id of the root layout associated with this RemoteViews. In the case that the RemoteViews has both a landscape and portrait root, this will return the layout id associated with the portrait layout.
| Return | |
|---|---|
Int |
the layout id. |
onLoadClass
open funonLoadClass(clazz: Class<Any!>!): Boolean
Deprecated: Used by system to enforce safe inflation of RemoteViews. Apps should not override this method. Changing of this method will NOT affect the process where RemoteViews is rendered.
Used to restrict the views which can be inflated
| Parameters | |
|---|---|
clazz |
Class<Any!>!: The class object for the View that is about to be inflated |
| Return | |
|---|---|
Boolean |
True if this class is allowed to be inflated, or false otherwise |
reapply
open fun reapply(
context: Context!,
v: View!
): Unit
Applies all of the actions to the provided view.
Caller beware: this may throw
| Parameters | |
|---|---|
v |
View!: The view to apply the actions to. This should be the result of the apply(android.content.Context,android.view.ViewGroup) call. |
removeAllViews
open fun removeAllViews(viewId: Int): Unit
Equivalent to calling ViewGroup#removeAllViews().
| Parameters | |
|---|---|
viewId |
Int: The id of the parent ViewGroup to remove all children from. |
setAccessibilityTraversalAfter
open fun setAccessibilityTraversalAfter(
viewId: Int,
nextId: Int
): Unit
Equivalent to calling android.view.View#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. * @apiSince 22 |
setAccessibilityTraversalBefore
open fun setAccessibilityTraversalBefore(
viewId: Int,
nextId: Int
): Unit
Equivalent to calling android.view.View#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. * @apiSince 22 |
setBitmap
open fun setBitmap(
viewId: Int,
methodName: String!,
value: Bitmap!
): Unit
Call a method taking one Bitmap on a view in the layout for this 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. |
setBoolean
open fun setBoolean(
viewId: Int,
methodName: String!,
value: Boolean
): Unit
Call a method taking one boolean on a view in the layout for this 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. |
setBundle
open fun setBundle(
viewId: Int,
methodName: String!,
value: Bundle!
): Unit
Call a method taking one Bundle on a view in the layout for this 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 |
Bundle!: The value to pass to the method. |
setByte
open fun setByte(
viewId: Int,
methodName: String!,
value: Byte
): Unit
Call a method taking one byte on a view in the layout for this 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. |
setChar
open fun setChar(
viewId: Int,
methodName: String!,
value: Char
): Unit
Call a method taking one char on a view in the layout for this 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. |
setCharSequence
open fun setCharSequence(
viewId: Int,
methodName: String!,
value: CharSequence!
): Unit
Call a method taking one CharSequence on a view in the layout for this 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 |
CharSequence!: The value to pass to the method. |
setChronometer
open fun setChronometer(
viewId: Int,
base: Long,
format: String!,
started: Boolean
): Unit
Equivalent to calling Chronometer#setBase, Chronometer#setFormat, and Chronometer#start or 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. |
setChronometerCountDown
open fun setChronometerCountDown(
viewId: Int,
isCountDown: Boolean
): Unit
Equivalent to calling Chronometer#setCountDown(boolean) on the chronometer with the given viewId.
| 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. |
setContentDescription
open fun setContentDescription(
viewId: Int,
contentDescription: CharSequence!
): Unit
Equivalent to calling 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. |
setDisplayedChild
open fun setDisplayedChild(
viewId: Int,
childIndex: Int
): Unit
Equivalent to calling AdapterViewAnimator#setDisplayedChild(int)
| Parameters | |
|---|---|
viewId |
Int: The id of the view on which to call AdapterViewAnimator#setDisplayedChild(int) |
setDouble
open fun setDouble(
viewId: Int,
methodName: String!,
value: Double
): Unit
Call a method taking one double on a view in the layout for this 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. |
setEmptyView
open fun setEmptyView(
viewId: Int,
emptyViewId: Int
): Unit
Equivalent to calling AdapterView#setEmptyView(View)
| Parameters | |
|---|---|
viewId |
Int: The id of the view on which to set the empty view |
emptyViewId |
Int: The view id of the empty view |
setFloat
open fun setFloat(
viewId: Int,
methodName: String!,
value: Float
): Unit
Call a method taking one float on a view in the layout for this 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. |
setIcon
open fun setIcon(
viewId: Int,
methodName: String!,
value: Icon!
): Unit
Call a method taking one Icon on a view in the layout for this 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 android.graphics.drawable.Icon to pass the method. |
setImageViewBitmap
open fun setImageViewBitmap(
viewId: Int,
bitmap: Bitmap!
): Unit
Equivalent to calling ImageView#setImageBitmap(Bitmap)
| Parameters | |
|---|---|
viewId |
Int: The id of the view whose bitmap should change |
bitmap |
Bitmap!: The new Bitmap for the drawable |
setImageViewIcon
open fun setImageViewIcon(
viewId: Int,
icon: Icon!
): Unit
Equivalent to calling ImageView#setImageIcon(Icon)
| Parameters | |
|---|---|
viewId |
Int: The id of the view whose bitmap should change |
icon |
Icon!: The new Icon for the ImageView |
setImageViewResource
open fun setImageViewResource(
viewId: Int,
srcId: Int
): Unit
Equivalent to calling ImageView#setImageResource(int)
| Parameters | |
|---|---|
viewId |
Int: The id of the view whose drawable should change |
srcId |
Int: The new resource id for the drawable |
setImageViewUri
open fun setImageViewUri(
viewId: Int,
uri: Uri!
): Unit
Equivalent to calling ImageView#setImageURI(Uri)
| Parameters | |
|---|---|
viewId |
Int: The id of the view whose drawable should change |
uri |
Uri!: The Uri for the image |
setInt
open fun setInt(
viewId: Int,
methodName: String!,
value: Int
): Unit
Call a method taking one int on a view in the layout for this 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 |
Int: The value to pass to the method. |
setIntent
open fun setIntent(
viewId: Int,
methodName: String!,
value: Intent!
): Unit
Call a method taking one Intent on a view in the layout for this 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 |
Intent!: The android.content.Intent to pass the method. |
setLabelFor
open fun setLabelFor(
viewId: Int,
labeledId: Int
): Unit
Equivalent to calling 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. |
setLightBackgroundLayoutId
open fun setLightBackgroundLayoutId(layoutId: Int): Unit
Provides an alternate layout ID, which can be used to inflate this view. This layout will be used by the host when the widgets displayed on a light-background where foreground elements and text can safely draw using a dark color without any additional background protection.
setLong
open fun setLong(
viewId: Int,
methodName: String!,
value: Long
): Unit
Call a method taking one long on a view in the layout for this 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 |
Long: The value to pass to the method. |
setOnClickFillInIntent
open fun setOnClickFillInIntent(
viewId: Int,
fillInIntent: Intent!
): Unit
When using collections (eg. ListView, StackView etc.) in widgets, it is very costly to set PendingIntents on the individual items, and is hence not recommended. Instead a single PendingIntent template can be set on the collection, see RemoteViews#setPendingIntentTemplate(int, PendingIntent), and the individual on-click action of a given item can be distinguished by setting a fillInIntent on that item. The fillInIntent is then combined with the PendingIntent template in order to determine the final intent which will be executed when the item is clicked. This works as follows: any fields which are left blank in the PendingIntent template, but are provided by the fillInIntent will be overwritten, and the resulting PendingIntent will be used. The rest of the PendingIntent template will then be filled in with the associated fields that are set in fillInIntent. See Intent#fillIn(Intent, int) for more details.
| 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 |
setOnClickPendingIntent
open fun setOnClickPendingIntent(
viewId: Int,
pendingIntent: PendingIntent!
): Unit
Equivalent to calling android.view.View#setOnClickListener(android.view.View.OnClickListener) to launch the provided PendingIntent. The source bounds (Intent#getSourceBounds()) of the intent will be set to the bounds of the clicked view in screen space. Note that any activity options associated with the mPendingIntent may get overridden before starting the intent. When setting the on-click action of items within collections (eg. ListView, StackView etc.), this method will not work. Instead, use RemoteViews#setPendingIntentTemplate(int, PendingIntent) in conjunction with 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 |
setOnClickResponse
open fun setOnClickResponse(
viewId: Int,
response: RemoteViews.RemoteResponse
): Unit
Equivalent of calling android.view.View#setOnClickListener(android.view.View.OnClickListener) to launch the provided RemoteResponse.
| Parameters | |
|---|---|
viewId |
Int: The id of the view that will trigger the RemoteResponse when clicked |
response |
RemoteViews.RemoteResponse: The RemoteResponse to send when user clicks This value cannot be null. |
setPendingIntentTemplate
open fun setPendingIntentTemplate(
viewId: Int,
pendingIntentTemplate: PendingIntent!
): Unit
When using collections (eg. ListView, StackView etc.) in widgets, it is very costly to set PendingIntents on the individual items, and is hence not recommended. Instead this method should be used to set a single PendingIntent template on the collection, and individual items can differentiate their on-click behavior using RemoteViews#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 |
setProgressBar
open fun setProgressBar(
viewId: Int,
max: Int,
progress: Int,
indeterminate: Boolean
): Unit
Equivalent to calling ProgressBar#setMax, ProgressBar#setProgress, and ProgressBar#setIndeterminate If indeterminate is true, then the values for max and progress are ignored.
| 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. |
setRelativeScrollPosition
open fun setRelativeScrollPosition(
viewId: Int,
offset: Int
): Unit
Equivalent to calling ListView#smoothScrollByOffset(int).
| Parameters | |
|---|---|
viewId |
Int: The id of the view to change |
offset |
Int: Scroll by this adapter position offset |
setRemoteAdapter
open funsetRemoteAdapter(
appWidgetId: Int,
viewId: Int,
intent: Intent!
): Unit
Deprecated: This method has been deprecated. See android.widget.RemoteViews#setRemoteAdapter(int, Intent)
Equivalent to calling android.widget.AbsListView#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 |
setRemoteAdapter
open fun setRemoteAdapter(
viewId: Int,
intent: Intent!
): Unit
Equivalent to calling android.widget.AbsListView#setRemoteViewsAdapter(Intent). Can only be used for 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 |
setScrollPosition
open fun setScrollPosition(
viewId: Int,
position: Int
): Unit
Equivalent to calling ListView#smoothScrollToPosition(int).
| Parameters | |
|---|---|
viewId |
Int: The id of the view to change |
position |
Int: Scroll to this adapter position |
setShort
open fun setShort(
viewId: Int,
methodName: String!,
value: Short
): Unit
Call a method taking one short on a view in the layout for this 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. |
setString
open fun setString(
viewId: Int,
methodName: String!,
value: String!
): Unit
Call a method taking one String on a view in the layout for this 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. |
setTextColor
open fun setTextColor(
viewId: Int,
color: Int
): Unit
Equivalent to calling android.widget.TextView#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. |
setTextViewCompoundDrawables
open fun setTextViewCompoundDrawables(
viewId: Int,
left: Int,
top: Int,
right: Int,
bottom: Int
): Unit
Equivalent to calling TextView#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 |
setTextViewCompoundDrawablesRelative
open fun setTextViewCompoundDrawablesRelative(
viewId: Int,
start: Int,
top: Int,
end: Int,
bottom: Int
): Unit
Equivalent to calling TextView#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 |
setTextViewText
open fun setTextViewText(
viewId: Int,
text: CharSequence!
): Unit
Equivalent to calling TextView#setText(CharSequence)
| Parameters | |
|---|---|
viewId |
Int: The id of the view whose text should change |
text |
CharSequence!: The new text for the view |
setTextViewTextSize
open fun setTextViewTextSize(
viewId: Int,
units: Int,
size: Float
): Unit
Equivalent to calling TextView#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 |
setUri
open fun setUri(
viewId: Int,
methodName: String!,
value: Uri!
): Unit
Call a method taking one Uri on a view in the layout for this 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 |
Uri!: The value to pass to the method. |
setViewPadding
open fun setViewPadding(
viewId: Int,
left: Int,
top: Int,
right: Int,
bottom: Int
): Unit
Equivalent to calling android.view.View#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 |
setViewVisibility
open fun setViewVisibility(
viewId: Int,
visibility: Int
): Unit
Equivalent to calling View#setVisibility(int)
| Parameters | |
|---|---|
viewId |
Int: The id of the view whose visibility should change |
visibility |
Int: The new visibility for the view |
showNext
open fun showNext(viewId: Int): Unit
Equivalent to calling AdapterViewAnimator#showNext()
| Parameters | |
|---|---|
viewId |
Int: The id of the view on which to call AdapterViewAnimator#showNext() |
showPrevious
open fun showPrevious(viewId: Int): Unit
Equivalent to calling AdapterViewAnimator#showPrevious()
| Parameters | |
|---|---|
viewId |
Int: The id of the view on which to call AdapterViewAnimator#showPrevious() |
writeToParcel
open fun writeToParcel(
dest: Parcel!,
flags: Int
): Unit
| 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. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<RemoteViews!>
Parcelable.Creator that instantiates RemoteViews objects