Added in API level 5

QuickContactBadge


open class QuickContactBadge : ImageView, View.OnClickListener
kotlin.Any
   ↳ android.view.View
   ↳ android.widget.ImageView
   ↳ android.widget.QuickContactBadge

Widget used to show an image with the standard QuickContact badge and on-click behavior.

Summary

Inherited XML attributes
Inherited constants
Public constructors

QuickContactBadge(context: Context!, attrs: AttributeSet!)

QuickContactBadge(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

QuickContactBadge(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Unit
assignContactFromEmail(emailAddress: String!, lazyLookup: Boolean)

Assign a contact based on an email address.

open Unit
assignContactFromEmail(emailAddress: String!, lazyLookup: Boolean, extras: Bundle!)

Assign a contact based on an email address.

open Unit
assignContactFromPhone(phoneNumber: String!, lazyLookup: Boolean)

Assign a contact based on a phone number.

open Unit
assignContactFromPhone(phoneNumber: String!, lazyLookup: Boolean, extras: Bundle!)

Assign a contact based on a phone number.

open Unit
assignContactUri(contactUri: Uri!)

Assign the contact uri that this QuickContactBadge should be associated with.

open Unit

open CharSequence!

open Unit

open Unit
setExcludeMimes(excludeMimes: Array<String!>!)

Set a list of specific MIME-types to exclude and not display.

open Unit

Resets the contact photo to the default state.

open Unit
setMode(size: Int)

This call has no effect anymore, as there is only one QuickContact mode

open Unit
setOverlay(overlay: Drawable!)

Assigns the drawable that is to be drawn on top of the assigned contact photo.

open Unit
setPrioritizedMimeType(prioritizedMimeType: String!)

Set which mimetype should be prioritized in the QuickContacts UI.

Protected methods
open Unit

open Unit

open Unit
onDraw(canvas: Canvas)

Inherited functions
Properties
Array<String!>!

Inherited properties

Public constructors

QuickContactBadge

Added in API level 5
QuickContactBadge(context: Context!)

QuickContactBadge

Added in API level 5
QuickContactBadge(
    context: Context!,
    attrs: AttributeSet!)

QuickContactBadge

Added in API level 5
QuickContactBadge(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

QuickContactBadge

Added in API level 21
QuickContactBadge(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int,
    defStyleRes: Int)

Public methods

assignContactFromEmail

Added in API level 5
open fun assignContactFromEmail(
    emailAddress: String!,
    lazyLookup: Boolean
): Unit

Assign a contact based on an email address. This should only be used when the contact's URI is not available, as an extra query will have to be performed to lookup the URI based on the email.

Parameters
emailAddress String!: The email address of the contact.
lazyLookup Boolean: If this is true, the lookup query will not be performed until this view is clicked.

assignContactFromEmail

Added in API level 18
open fun assignContactFromEmail(
    emailAddress: String!,
    lazyLookup: Boolean,
    extras: Bundle!
): Unit

Assign a contact based on an email address. This should only be used when the contact's URI is not available, as an extra query will have to be performed to lookup the URI based on the email.

Parameters
emailAddress String!: The email address of the contact.
lazyLookup Boolean: If this is true, the lookup query will not be performed until this view is clicked.
extras Bundle!: A bundle of extras to populate the contact edit page with if the contact is not found and the user chooses to add the email address to an existing contact or create a new contact. Uses the same string constants as those found in android.provider.ContactsContract.Intents.Insert

assignContactFromPhone

Added in API level 5
open fun assignContactFromPhone(
    phoneNumber: String!,
    lazyLookup: Boolean
): Unit

Assign a contact based on a phone number. This should only be used when the contact's URI is not available, as an extra query will have to be performed to lookup the URI based on the phone number.

Parameters
phoneNumber String!: The phone number of the contact.
lazyLookup Boolean: If this is true, the lookup query will not be performed until this view is clicked.

assignContactFromPhone

Added in API level 18
open fun assignContactFromPhone(
    phoneNumber: String!,
    lazyLookup: Boolean,
    extras: Bundle!
): Unit

Assign a contact based on a phone number. This should only be used when the contact's URI is not available, as an extra query will have to be performed to lookup the URI based on the phone number.

Parameters
phoneNumber String!: The phone number of the contact.
lazyLookup Boolean: If this is true, the lookup query will not be performed until this view is clicked.
extras Bundle!: A bundle of extras to populate the contact edit page with if the contact is not found and the user chooses to add the phone number to an existing contact or create a new contact. Uses the same string constants as those found in android.provider.ContactsContract.Intents.Insert

assignContactUri

Added in API level 5
open fun assignContactUri(contactUri: Uri!): Unit

Assign the contact uri that this QuickContactBadge should be associated with. Note that this is only used for displaying the QuickContact window and won't bind the contact's photo for you. Call setImageDrawable(android.graphics.drawable.Drawable) to set the photo.

Parameters
contactUri Uri!: Either a Contacts#CONTENT_URI or Contacts#CONTENT_LOOKUP_URI style URI.

drawableHotspotChanged

Added in API level 21
open fun drawableHotspotChanged(
    x: Float,
    y: Float
): Unit
Parameters
x Float: hotspot x coordinate
y Float: hotspot y coordinate

getAccessibilityClassName

Added in API level 23
open fun getAccessibilityClassName(): CharSequence!

onClick

Added in API level 5
open fun onClick(v: View!): Unit
Parameters
v View!: The view that was clicked.

setExcludeMimes

Added in API level 5
open fun setExcludeMimes(excludeMimes: Array<String!>!): Unit

Set a list of specific MIME-types to exclude and not display. For example, this can be used to hide the Contacts#CONTENT_ITEM_TYPE profile icon.

setImageToDefault

Added in API level 11
open fun setImageToDefault(): Unit

Resets the contact photo to the default state.

setMode

Added in API level 5
open fun setMode(size: Int): Unit

This call has no effect anymore, as there is only one QuickContact mode

setOverlay

Added in API level 21
open fun setOverlay(overlay: Drawable!): Unit

Assigns the drawable that is to be drawn on top of the assigned contact photo.

Parameters
overlay Drawable!: Drawable to be drawn over the assigned contact photo. Must have a non-zero instrinsic width and height.

setPrioritizedMimeType

Added in API level 23
open fun setPrioritizedMimeType(prioritizedMimeType: String!): Unit

Set which mimetype should be prioritized in the QuickContacts UI. For example, passing the value Email#CONTENT_ITEM_TYPE can cause emails to be displayed more prominently in QuickContacts.

Protected methods

drawableStateChanged

Added in API level 5
protected open fun drawableStateChanged(): Unit

onAttachedToWindow

Added in API level 5
protected open fun onAttachedToWindow(): Unit

onDraw

Added in API level 5
protected open fun onDraw(canvas: Canvas): Unit
Parameters
canvas Canvas: the canvas on which the background will be drawn This value cannot be null.

Properties

mExcludeMimes

Added in API level 5
protected var mExcludeMimes: Array<String!>!