C# Class com.joanzapata.iconify.IconDrawable

Embed an icon into a Drawable that can be used as TextView icons, or ActionBar icons.
 new IconDrawable(context, IconValue.icon_star) .colorRes(R.color.white) .actionBarSize(); 
If you don't set the size of the drawable, it will use the size that is given to him. Note that in an ActionBar, if you don't set the size explicitly it uses 0, so please use actionBarSize().
Inheritance: android.graphics.drawable.Drawable
Mostrar archivo Open project: PragmaticIT/xiconify

Public Methods

Method Description
IconDrawable ( android.content.Context context, Icon icon ) : android.graphics

Create an IconDrawable.

IconDrawable ( android.content.Context context, string iconKey ) : android.graphics

Create an IconDrawable.

actionBarSize ( ) : IconDrawable

Set the size of this icon to the standard Android ActionBar.

alpha ( int alpha ) : IconDrawable

Set the alpha of this drawable.

clearColorFilter ( ) : void
color ( int color ) : IconDrawable

Set the color of the drawable.

colorRes ( int colorRes ) : IconDrawable

Set the color of the drawable.

draw ( Canvas canvas ) : void
setState ( int stateSet ) : bool
sizeDp ( int size ) : IconDrawable

Set the size of the drawable.

sizePx ( int size ) : IconDrawable

Set the size of the drawable.

sizeRes ( int dimenRes ) : IconDrawable

Set the size of the drawable.

Private Methods

Method Description
convertDpToPx ( android.content.Context context, float dp ) : int
init ( android.content.Context context, Icon icon ) : void
isEnabled ( int stateSet ) : bool

Method Details

IconDrawable() public method

Create an IconDrawable.
public IconDrawable ( android.content.Context context, Icon icon ) : android.graphics
context android.content.Context Your activity or application context.
icon Icon The icon you want this drawable to display.
return android.graphics

IconDrawable() public method

Create an IconDrawable.
if the key doesn't match any icon.
public IconDrawable ( android.content.Context context, string iconKey ) : android.graphics
context android.content.Context Your activity or application context.
iconKey string The icon key you want this drawable to display.
return android.graphics

actionBarSize() public method

Set the size of this icon to the standard Android ActionBar.
public actionBarSize ( ) : IconDrawable
return IconDrawable

alpha() public method

Set the alpha of this drawable.
public alpha ( int alpha ) : IconDrawable
alpha int The alpha, between 0 (transparent) and 255 (opaque).
return IconDrawable

clearColorFilter() public method

public clearColorFilter ( ) : void
return void

color() public method

Set the color of the drawable.
public color ( int color ) : IconDrawable
color int The color, usually from android.graphics.Color or 0xFF012345.
return IconDrawable

colorRes() public method

Set the color of the drawable.
public colorRes ( int colorRes ) : IconDrawable
colorRes int The color resource, from your R file.
return IconDrawable

draw() public method

public draw ( Canvas canvas ) : void
canvas android.graphics.Canvas
return void

setState() public method

public setState ( int stateSet ) : bool
stateSet int
return bool

sizeDp() public method

Set the size of the drawable.
public sizeDp ( int size ) : IconDrawable
size int The size in density-independent pixels (dp).
return IconDrawable

sizePx() public method

Set the size of the drawable.
public sizePx ( int size ) : IconDrawable
size int The size in pixels (px).
return IconDrawable

sizeRes() public method

Set the size of the drawable.
public sizeRes ( int dimenRes ) : IconDrawable
dimenRes int The dimension resource.
return IconDrawable