Skip to content

Most visited

Recently visited

navigation

CircledImageView

public class CircledImageView
extends View

java.lang.Object
   ↳ android.view.View
     ↳ android.support.wearable.view.CircledImageView
Known Direct Subclasses


An image view surrounded by a circle.

Summary

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

CircledImageView(Context context)
CircledImageView(Context context, AttributeSet attrs)
CircledImageView(Context context, AttributeSet attrs, int defStyle)

Public methods

ColorStateList getCircleColorStateList()
float getCircleRadius()
float getCircleRadiusPercent()
float getCircleRadiusPressed()
float getCircleRadiusPressedPercent()
long getColorChangeAnimationDuration()
int getDefaultCircleColor()
Drawable getImageDrawable()
float getInitialCircleRadius()
void onSizeChanged(int newWidth, int newHeight, int oldWidth, int oldHeight)
void setCircleBorderCap(Paint.Cap circleBorderCap)

Set the stroke cap for the border around the circle.

void setCircleBorderColor(int circleBorderColor)
void setCircleBorderWidth(float circleBorderWidth)

Set the border around the circle.

void setCircleColor(int circleColor)
void setCircleColorStateList(ColorStateList circleColor)
void setCircleHidden(boolean circleHidden)
void setCircleRadius(float circleRadius)
void setCircleRadiusPercent(float circleRadiusPercent)

Sets the radius of the circle to be a percentage of the largest dimension of the view.

void setCircleRadiusPressed(float circleRadiusPressed)
void setCircleRadiusPressedPercent(float circleRadiusPressedPercent)

Sets the radius of the circle to be a percentage of the largest dimension of the view when pressed.

void setColorChangeAnimationDuration(long mColorChangeAnimationDurationMs)
void setImageCirclePercentage(float percentage)
void setImageDrawable(Drawable drawable)
void setImageHorizontalOffcenterPercentage(float percentage)
void setImageResource(int resId)
void setImageTint(int tint)
void setPadding(int left, int top, int right, int bottom)
void setPressed(boolean pressed)
void setProgress(float progress)
void setShadowVisibility(float shadowVisibility)

Set how much of the shadow should be shown.

void showIndeterminateProgress(boolean show)

Show the circle border as an indeterminate progress spinner.

Protected methods

void drawableStateChanged()
void onDraw(Canvas canvas)
void onLayout(boolean changed, int left, int top, int right, int bottom)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
boolean onSetAlpha(int alpha)
void onVisibilityChanged(View changedView, int visibility)
void onWindowVisibilityChanged(int visibility)

Inherited methods

From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

CircledImageView

CircledImageView (Context context)

Parameters
context Context

CircledImageView

CircledImageView (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

CircledImageView

CircledImageView (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context
attrs AttributeSet
defStyle int

Public methods

getCircleColorStateList

ColorStateList getCircleColorStateList ()

Returns
ColorStateList

getCircleRadius

float getCircleRadius ()

Returns
float

getCircleRadiusPercent

float getCircleRadiusPercent ()

Returns
float

getCircleRadiusPressed

float getCircleRadiusPressed ()

Returns
float

getCircleRadiusPressedPercent

float getCircleRadiusPressedPercent ()

Returns
float

getColorChangeAnimationDuration

long getColorChangeAnimationDuration ()

Returns
long the milliseconds duration of the transition animation when the color changes.

getDefaultCircleColor

int getDefaultCircleColor ()

Returns
int

getImageDrawable

Drawable getImageDrawable ()

Returns
Drawable

getInitialCircleRadius

float getInitialCircleRadius ()

Returns
float

onSizeChanged

void onSizeChanged (int newWidth, 
                int newHeight, 
                int oldWidth, 
                int oldHeight)

Parameters
newWidth int
newHeight int
oldWidth int
oldHeight int

setCircleBorderCap

void setCircleBorderCap (Paint.Cap circleBorderCap)

Set the stroke cap for the border around the circle.

Parameters
circleBorderCap Paint.Cap: Stroke cap for the border around the circle.

setCircleBorderColor

void setCircleBorderColor (int circleBorderColor)

Parameters
circleBorderColor int

setCircleBorderWidth

void setCircleBorderWidth (float circleBorderWidth)

Set the border around the circle.

Parameters
circleBorderWidth float: Width of the border around the circle.

setCircleColor

void setCircleColor (int circleColor)

Parameters
circleColor int

setCircleColorStateList

void setCircleColorStateList (ColorStateList circleColor)

Parameters
circleColor ColorStateList

setCircleHidden

void setCircleHidden (boolean circleHidden)

Parameters
circleHidden boolean

setCircleRadius

void setCircleRadius (float circleRadius)

Parameters
circleRadius float

setCircleRadiusPercent

void setCircleRadiusPercent (float circleRadiusPercent)

Sets the radius of the circle to be a percentage of the largest dimension of the view.

Parameters
circleRadiusPercent float: A float from 0 to 1 representing the radius percentage.

setCircleRadiusPressed

void setCircleRadiusPressed (float circleRadiusPressed)

Parameters
circleRadiusPressed float

setCircleRadiusPressedPercent

void setCircleRadiusPressedPercent (float circleRadiusPressedPercent)

Sets the radius of the circle to be a percentage of the largest dimension of the view when pressed.

Parameters
circleRadiusPressedPercent float: A float from 0 to 1 representing the radius percentage.

setColorChangeAnimationDuration

void setColorChangeAnimationDuration (long mColorChangeAnimationDurationMs)

Parameters
mColorChangeAnimationDurationMs long: the milliseconds duration of the color change animation. The color change animation will run if the color changes with setCircleColor(int) or as a result of the active state changing.

setImageCirclePercentage

void setImageCirclePercentage (float percentage)

Parameters
percentage float

setImageDrawable

void setImageDrawable (Drawable drawable)

Parameters
drawable Drawable

setImageHorizontalOffcenterPercentage

void setImageHorizontalOffcenterPercentage (float percentage)

Parameters
percentage float

setImageResource

void setImageResource (int resId)

Parameters
resId int

setImageTint

void setImageTint (int tint)

Parameters
tint int

setPadding

void setPadding (int left, 
                int top, 
                int right, 
                int bottom)

Parameters
left int
top int
right int
bottom int

setPressed

void setPressed (boolean pressed)

Parameters
pressed boolean

setProgress

void setProgress (float progress)

Parameters
progress float

setShadowVisibility

void setShadowVisibility (float shadowVisibility)

Set how much of the shadow should be shown.

Parameters
shadowVisibility float: Value between 0 and 1.

showIndeterminateProgress

void showIndeterminateProgress (boolean show)

Show the circle border as an indeterminate progress spinner. The views circle border width and color must be set for this to have an effect.

Parameters
show boolean: true if the progress spinner is shown, false to hide it.

Protected methods

drawableStateChanged

void drawableStateChanged ()

onDraw

void onDraw (Canvas canvas)

Parameters
canvas Canvas

onLayout

void onLayout (boolean changed, 
                int left, 
                int top, 
                int right, 
                int bottom)

Parameters
changed boolean
left int
top int
right int
bottom int

onMeasure

void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int
heightMeasureSpec int

onSetAlpha

boolean onSetAlpha (int alpha)

Parameters
alpha int
Returns
boolean

onVisibilityChanged

void onVisibilityChanged (View changedView, 
                int visibility)

Parameters
changedView View
visibility int

onWindowVisibilityChanged

void onWindowVisibilityChanged (int visibility)

Parameters
visibility int
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.