CircledImageView

public class CircledImageView
extends View

java.lang.Object
   ↳ android.view.View
     ↳ android.support.wearable.view.CircledImageView


This class is deprecated.
use androidx.wear.widget.RoundedDrawable and the androidx.wear.widget.CircularProgressLayout from the Jetpack Wear library instead.

An image view surrounded by a circle.

Summary

Inherited constants

Inherited fields

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

Public constructors

CircledImageView

public CircledImageView (Context context)

Parameters
context Context

CircledImageView

public CircledImageView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

CircledImageView

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

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

getCircleColorStateList

public ColorStateList getCircleColorStateList ()

Returns
ColorStateList

getCircleRadius

public float getCircleRadius ()

Returns
float

getCircleRadiusPercent

public float getCircleRadiusPercent ()

Returns
float

getCircleRadiusPressed

public float getCircleRadiusPressed ()

Returns
float

getCircleRadiusPressedPercent

public float getCircleRadiusPressedPercent ()

Returns
float

getColorChangeAnimationDuration

public long getColorChangeAnimationDuration ()

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

getDefaultCircleColor

public int getDefaultCircleColor ()

Returns
int

getImageDrawable

public Drawable getImageDrawable ()

Returns
Drawable

getInitialCircleRadius

public float getInitialCircleRadius ()

Returns
float

onSizeChanged

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

Parameters
newWidth int

newHeight int

oldWidth int

oldHeight int

setCircleBorderCap

public 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

public void setCircleBorderColor (int circleBorderColor)

Parameters
circleBorderColor int

setCircleBorderWidth

public void setCircleBorderWidth (float circleBorderWidth)

Set the border around the circle.

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

setCircleColor

public void setCircleColor (int circleColor)

Parameters
circleColor int

setCircleColorStateList

public void setCircleColorStateList (ColorStateList circleColor)

Parameters
circleColor ColorStateList

setCircleHidden

public void setCircleHidden (boolean circleHidden)

Parameters
circleHidden boolean

setCircleRadius

public void setCircleRadius (float circleRadius)

Parameters
circleRadius float

setCircleRadiusPercent

public 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

public void setCircleRadiusPressed (float circleRadiusPressed)

Parameters
circleRadiusPressed float

setCircleRadiusPressedPercent

public 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

public 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

public void setImageCirclePercentage (float percentage)

Parameters
percentage float

setImageDrawable

public void setImageDrawable (Drawable drawable)

Parameters
drawable Drawable

setImageHorizontalOffcenterPercentage

public void setImageHorizontalOffcenterPercentage (float percentage)

Parameters
percentage float

setImageResource

public void setImageResource (int resId)

Parameters
resId int

setImageTint

public void setImageTint (int tint)

Parameters
tint int

setPadding

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

Parameters
left int

top int

right int

bottom int

setPressed

public void setPressed (boolean pressed)

Parameters
pressed boolean

setProgress

public void setProgress (float progress)

Parameters
progress float

setShadowVisibility

public void setShadowVisibility (float shadowVisibility)

Set how much of the shadow should be shown.

Parameters
shadowVisibility float: Value between 0 and 1.

showIndeterminateProgress

public 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

protected void drawableStateChanged ()

onDraw

protected void onDraw (Canvas canvas)

Parameters
canvas Canvas

onLayout

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

Parameters
changed boolean

left int

top int

right int

bottom int

onMeasure

protected void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int

onSetAlpha

protected boolean onSetAlpha (int alpha)

Parameters
alpha int

Returns
boolean

onVisibilityChanged

protected void onVisibilityChanged (View changedView, 
                int visibility)

Parameters
changedView View

visibility int

onWindowVisibilityChanged

protected void onWindowVisibilityChanged (int visibility)

Parameters
visibility int