InsightBranding


public final class InsightBranding
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.personalcontext.insight.InsightBranding


Branding assets for a ContextInsight.

When providing an insight, the understander can attach InsightBranding to indicate to the user which understander was responsible for generating the insight, and what data sources were used. Branding can be done by providing icons of different types (leading, trailing, background) and positions.

Summary

Nested classes

class InsightBranding.Builder

Builder for InsightBranding

Constants

int COLOR_TYPE_PRIMARY

Color type representing the primary color.

int COLOR_TYPE_SECONDARY

Color type representing the secondary color.

int ICON_TYPE_BACKGROUND

Icon type representing the background.

int ICON_TYPE_LEADING

Icon type representing leading icons.

int ICON_TYPE_TRAILING

Icon type representing trailing icons.

Inherited constants

Fields

public static final Creator<InsightBranding> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

int getColor(int type)

Gets the color for the specified color type, or 0 if not set.

SparseArray<Icon> getIcons(int type)

Gets a mapping of position to icon for the specified icon type, or an empty SparseArray if no icons of the specified type are set.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

COLOR_TYPE_PRIMARY

Added in version 37.2
public static final int COLOR_TYPE_PRIMARY

Color type representing the primary color.

Constant Value: 0 (0x00000000)

COLOR_TYPE_SECONDARY

Added in version 37.2
public static final int COLOR_TYPE_SECONDARY

Color type representing the secondary color.

Constant Value: 1 (0x00000001)

ICON_TYPE_BACKGROUND

Added in version 37.2
public static final int ICON_TYPE_BACKGROUND

Icon type representing the background.

Constant Value: 2 (0x00000002)

ICON_TYPE_LEADING

Added in version 37.2
public static final int ICON_TYPE_LEADING

Icon type representing leading icons.

Constant Value: 0 (0x00000000)

ICON_TYPE_TRAILING

Added in version 37.2
public static final int ICON_TYPE_TRAILING

Icon type representing trailing icons.

Constant Value: 1 (0x00000001)

Fields

CREATOR

Added in version 37.2
public static final Creator<InsightBranding> CREATOR

Public methods

describeContents

Added in version 37.2
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getColor

Added in version 37.2
public int getColor (int type)

Gets the color for the specified color type, or 0 if not set.

Parameters
type int: Value is one of the following:
Returns
int

getIcons

Added in version 37.2
public SparseArray<Icon> getIcons (int type)

Gets a mapping of position to icon for the specified icon type, or an empty SparseArray if no icons of the specified type are set.

Parameters
type int: Value is one of the following:
Returns
SparseArray<Icon> This value cannot be null.

writeToParcel

Added in version 37.2
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following: