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
Afficher le fichier Open project: PragmaticIT/xiconify

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat android.graphics

IconDrawable() public méthode

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.
Résultat android.graphics

actionBarSize() public méthode

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

alpha() public méthode

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

clearColorFilter() public méthode

public clearColorFilter ( ) : void
Résultat void

color() public méthode

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

colorRes() public méthode

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

draw() public méthode

public draw ( Canvas canvas ) : void
canvas android.graphics.Canvas
Résultat void

setState() public méthode

public setState ( int stateSet ) : bool
stateSet int
Résultat bool

sizeDp() public méthode

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

sizePx() public méthode

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

sizeRes() public méthode

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