IT. Expert System.

Android Reference

RemoteViews


android.widget

Class RemoteViews

  • All Implemented Interfaces:
    Parcelable, LayoutInflater.Filter


    public class RemoteViews
    extends Object
    implements Parcelable, LayoutInflater.Filter
    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.
    • Constructor Detail

      • RemoteViews

        public RemoteViews(String packageName,
                   int layoutId)
        Create a new RemoteViews object that will display the views contained in the specified layout file.
        Parameters:
        packageName - Name of the package that contains the layout resource
        layoutId - The id of the layout resource
      • RemoteViews

        public RemoteViews(RemoteViews landscape,
                   RemoteViews portrait)
        Create a new RemoteViews object that will inflate as the specified landspace or portrait RemoteViews, depending on the current configuration.
        Parameters:
        landscape - The RemoteViews to inflate in landscape configuration
        portrait - The RemoteViews to inflate in portrait configuration
      • RemoteViews

        public RemoteViews(Parcel parcel)
        Reads a RemoteViews object from a parcel.
        Parameters:
        parcel -
    • Method Detail

      • mergeRemoteViews

        public void mergeRemoteViews(RemoteViews newRv)
        Merges the passed RemoteViews actions with this RemoteViews actions according to action-specific merge rules.
        Parameters:
        newRv -
      • clone

        public RemoteViews clone()
        Description copied from class: Object
        Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
      • getPackage

        public String getPackage()
      • getLayoutId

        public int getLayoutId()
        Reutrns 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.
        Returns:
        the layout id.
      • estimateMemoryUsage

        public int estimateMemoryUsage()
      • removeAllViews

        public void removeAllViews(int viewId)
        Equivalent to calling ViewGroup.removeAllViews().
        Parameters:
        viewId - The id of the parent ViewGroup to remove all children from.
      • setViewVisibility

        public void setViewVisibility(int viewId,
                             int visibility)
        Equivalent to calling View.setVisibility
        Parameters:
        viewId - The id of the view whose visibility should change
        visibility - The new visibility for the view
      • setTextViewText

        public void setTextViewText(int viewId,
                           CharSequence text)
        Equivalent to calling TextView.setText
        Parameters:
        viewId - The id of the view whose text should change
        text - The new text for the view
      • setTextViewTextSize

        public void setTextViewTextSize(int viewId,
                               int units,
                               float size)
        Equivalent to calling TextView.setTextSize(int, float)
        Parameters:
        viewId - The id of the view whose text size should change
        units - The units of size (e.g. COMPLEX_UNIT_SP)
        size - The size of the text
      • setTextViewCompoundDrawables

        public void setTextViewCompoundDrawables(int viewId,
                                        int left,
                                        int top,
                                        int right,
                                        int bottom)
        Parameters:
        viewId - The id of the view whose text should change
        left - The id of a drawable to place to the left of the text, or 0
        top - The id of a drawable to place above the text, or 0
        right - The id of a drawable to place to the right of the text, or 0
        bottom - The id of a drawable to place below the text, or 0
      • setTextViewCompoundDrawablesRelative

        public void setTextViewCompoundDrawablesRelative(int viewId,
                                                int start,
                                                int top,
                                                int end,
                                                int bottom)
        Parameters:
        viewId - The id of the view whose text should change
        start - The id of a drawable to place before the text (relative to the layout direction), or 0
        top - The id of a drawable to place above the text, or 0
        end - The id of a drawable to place after the text, or 0
        bottom - The id of a drawable to place below the text, or 0
      • setImageViewResource

        public void setImageViewResource(int viewId,
                                int srcId)
        Equivalent to calling ImageView.setImageResource
        Parameters:
        viewId - The id of the view whose drawable should change
        srcId - The new resource id for the drawable
      • setImageViewUri

        public void setImageViewUri(int viewId,
                           Uri uri)
        Equivalent to calling ImageView.setImageURI
        Parameters:
        viewId - The id of the view whose drawable should change
        uri - The Uri for the image
      • setImageViewBitmap

        public void setImageViewBitmap(int viewId,
                              Bitmap bitmap)
        Equivalent to calling ImageView.setImageBitmap
        Parameters:
        viewId - The id of the view whose bitmap should change
        bitmap - The new Bitmap for the drawable
      • setEmptyView

        public void setEmptyView(int viewId,
                        int emptyViewId)
        Equivalent to calling AdapterView.setEmptyView
        Parameters:
        viewId - The id of the view on which to set the empty view
        emptyViewId - The view id of the empty view
      • setProgressBar

        public void setProgressBar(int viewId,
                          int max,
                          int progress,
                          boolean indeterminate)
        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 - The id of the ProgressBar to change
        max - The 100% value for the progress bar
        progress - The current value of the progress bar.
        indeterminate - True if the progress bar is indeterminate, false if not.
      • setPendingIntentTemplate

        public void setPendingIntentTemplate(int viewId,
                                    PendingIntent pendingIntentTemplate)
        When using collections (eg. ListView, StackView etc.) in widgets, it is very costly to set PendingIntents on the individual items, and is hence not permitted. 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 setOnClickFillInIntent(int, Intent).
        Parameters:
        viewId - The id of the collection who's children will use this PendingIntent template when clicked
        pendingIntentTemplate - The PendingIntent to be combined with extras specified by a child of viewId and executed when that child is clicked
      • setOnClickFillInIntent

        public void setOnClickFillInIntent(int viewId,
                                  Intent fillInIntent)
        When using collections (eg. ListView, StackView etc.) in widgets, it is very costly to set PendingIntents on the individual items, and is hence not permitted. Instead a single PendingIntent template can be set on the collection, see 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. 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 - The id of the view on which to set the fillInIntent
        fillInIntent - 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
      • setDrawableParameters

        public void setDrawableParameters(int viewId,
                                 boolean targetBackground,
                                 int alpha,
                                 int colorFilter,
                                 PorterDuff.Mode mode,
                                 int level)
        Parameters:
        viewId - The id of the view that contains the target Drawable
        targetBackground - If true, apply these parameters to the Drawable returned by View.getBackground(). Otherwise, assume the target view is an ImageView and apply them to ImageView.getDrawable().
        alpha - Specify an alpha value for the drawable, or -1 to leave unchanged.
        colorFilter - Specify a color for a ColorFilter for this drawable, or -1 to leave unchanged.
        mode - Specify a PorterDuff mode for this drawable, or null to leave unchanged.
        level - Specify the level for the drawable, or -1 to leave unchanged.
      • setTextColor

        public void setTextColor(int viewId,
                        int color)
        Equivalent to calling TextView.setTextColor(int).
        Parameters:
        viewId - The id of the view whose text color should change
        color - Sets the text color for all the states (normal, selected, focused) to be this color.
      • setRemoteAdapter

        @Deprecated
        public void setRemoteAdapter(int appWidgetId,
                                       int viewId,
                                       Intent intent)
        Deprecated. This method has been deprecated. See setRemoteAdapter(int, Intent)
        Parameters:
        appWidgetId - The id of the app widget which contains the specified view. (This parameter is ignored in this deprecated method)
        viewId - The id of the AbsListView
        intent - The intent of the service which will be providing data to the RemoteViewsAdapter
      • setRemoteAdapter

        public void setRemoteAdapter(int viewId,
                            Intent intent)
        Equivalent to calling AbsListView.setRemoteViewsAdapter(Intent). Can only be used for App Widgets.
        Parameters:
        viewId - The id of the AbsListView
        intent - The intent of the service which will be providing data to the RemoteViewsAdapter
      • setScrollPosition

        public void setScrollPosition(int viewId,
                             int position)
        Parameters:
        viewId - The id of the view to change
        position - Scroll to this adapter position
      • setRelativeScrollPosition

        public void setRelativeScrollPosition(int viewId,
                                     int offset)
        Parameters:
        viewId - The id of the view to change
        offset - Scroll by this adapter position offset
      • setViewPadding

        public void setViewPadding(int viewId,
                          int left,
                          int top,
                          int right,
                          int bottom)
        Parameters:
        viewId - The id of the view to change
        left - the left padding in pixels
        top - the top padding in pixels
        right - the right padding in pixels
        bottom - the bottom padding in pixels
      • setBoolean

        public void setBoolean(int viewId,
                      String methodName,
                      boolean value)
        Call a method taking one boolean on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setByte

        public void setByte(int viewId,
                   String methodName,
                   byte value)
        Call a method taking one byte on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setShort

        public void setShort(int viewId,
                    String methodName,
                    short value)
        Call a method taking one short on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setInt

        public void setInt(int viewId,
                  String methodName,
                  int value)
        Call a method taking one int on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setLong

        public void setLong(int viewId,
                   String methodName,
                   long value)
        Call a method taking one long on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setFloat

        public void setFloat(int viewId,
                    String methodName,
                    float value)
        Call a method taking one float on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setDouble

        public void setDouble(int viewId,
                     String methodName,
                     double value)
        Call a method taking one double on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setChar

        public void setChar(int viewId,
                   String methodName,
                   char value)
        Call a method taking one char on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setString

        public void setString(int viewId,
                     String methodName,
                     String value)
        Call a method taking one String on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setCharSequence

        public void setCharSequence(int viewId,
                           String methodName,
                           CharSequence value)
        Call a method taking one CharSequence on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setUri

        public void setUri(int viewId,
                  String methodName,
                  Uri value)
        Call a method taking one Uri on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setBitmap

        public void setBitmap(int viewId,
                     String methodName,
                     Bitmap value)
        Call a method taking one Bitmap on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setBundle

        public void setBundle(int viewId,
                     String methodName,
                     Bundle value)
        Call a method taking one Bundle on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The value to pass to the method.
      • setIntent

        public void setIntent(int viewId,
                     String methodName,
                     Intent value)
        Call a method taking one Intent on a view in the layout for this RemoteViews.
        Parameters:
        viewId - The id of the view on which to call the method.
        methodName - The name of the method to call.
        value - The Intent to pass the method.
      • setContentDescription

        public void setContentDescription(int viewId,
                                 CharSequence contentDescription)
        Equivalent to calling View.setContentDescription(CharSequence).
        Parameters:
        viewId - The id of the view whose content description should change.
        contentDescription - The new content description for the view.
      • setLabelFor

        public void setLabelFor(int viewId,
                       int labeledId)
        Equivalent to calling View.setLabelFor(int).
        Parameters:
        viewId - The id of the view whose property to set.
        labeledId - The id of a view for which this view serves as a label.
      • apply

        public View apply(Context context,
                 ViewGroup parent)
        Inflates the view hierarchy represented by this object and applies all of the actions.

        Caller beware: this may throw

        Parameters:
        context - Default context to use
        parent - 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:
        The inflated view hierarchy
      • reapply

        public void reapply(Context context,
                   View v)
        Applies all of the actions to the provided view.

        Caller beware: this may throw

        Parameters:
        v - The view to apply the actions to. This should be the result of the apply(Context,ViewGroup) call.
      • onLoadClass

        public boolean onLoadClass(Class clazz)
        Description copied from interface: LayoutInflater.Filter
        Hook to allow clients of the LayoutInflater to restrict the set of Views that are allowed to be inflated.
        Specified by:
        onLoadClass in interface LayoutInflater.Filter
        Parameters:
        clazz - The class object for the View that is about to be inflated
        Returns:
        True if this class is allowed to be inflated, or false otherwise
      • describeContents

        public int describeContents()
        Description copied from interface: Parcelable
        Describe the kinds of special objects contained in this Parcelable's marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 976 / . Delta: 0.03769 с