C# Class JoanZapata.XamarinIconify.IconDrawable

Embed an icon into a Drawable that can be used as TextView icons, or ActionBar icons.
 new IconDrawable(context, IconValue.icon_star) .WithColorRes(R.WithColor.white) .WithActionBarSize(); 
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 WithActionBarSize().
Inheritance: Android.Graphics.Drawables.Drawable
Afficher le fichier Open project: PragmaticIT/xiconify

Méthodes publiques

Méthode Description
ClearColorFilter ( ) : void
Draw ( Android.Graphics.Canvas canvas ) : void
IconDrawable ( Android.Content.Context context, Icon icon ) : System

Create an IconDrawable.

IconDrawable ( Android.Content.Context context, object iconKey ) : System

Create an IconDrawable.

IconDrawable ( Android.Content.Context context, string iconKey ) : System

Create an IconDrawable.

SetAlpha ( int alpha ) : void
SetColorFilter ( Android.Graphics.ColorFilter cf ) : void
SetState ( int stateSet ) : bool
WIthSizeDp ( int size ) : IconDrawable

Set the size of the drawable.

WithActionBarSize ( ) : IconDrawable

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

WithAlpha ( int alpha ) : IconDrawable

Set the WithAlpha of this drawable.

WithColor ( Color color ) : IconDrawable

Set the Color of the drawable.

WithColorRes ( int colorRes ) : IconDrawable

Set the Color of the drawable.

WithSizePx ( int size ) : IconDrawable

Set the size of the drawable.

WithSizeRes ( 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

ClearColorFilter() public méthode

public ClearColorFilter ( ) : void
Résultat void

Draw() public méthode

public Draw ( Android.Graphics.Canvas canvas ) : void
canvas Android.Graphics.Canvas
Résultat void

IconDrawable() public méthode

Create an IconDrawable.
public IconDrawable ( Android.Content.Context context, Icon icon ) : System
context Android.Content.Context Your activity or application context.
icon Icon The icon you want this drawable to display.
Résultat System

IconDrawable() public méthode

Create an IconDrawable.
if the key doesn't match any icon.
public IconDrawable ( Android.Content.Context context, object iconKey ) : System
context Android.Content.Context Your activity or application context.
iconKey object The icon key you want this drawable to display. Calls iconKey.ToString() method internally to get icon name
Résultat System

IconDrawable() public méthode

Create an IconDrawable.
if the key doesn't match any icon.
public IconDrawable ( Android.Content.Context context, string iconKey ) : System
context Android.Content.Context Your activity or application context.
iconKey string The icon key you want this drawable to display.
Résultat System

SetAlpha() public méthode

public SetAlpha ( int alpha ) : void
alpha int
Résultat void

SetColorFilter() public méthode

public SetColorFilter ( Android.Graphics.ColorFilter cf ) : void
cf Android.Graphics.ColorFilter
Résultat void

SetState() public méthode

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

WIthSizeDp() public méthode

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

WithActionBarSize() public méthode

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

WithAlpha() public méthode

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

WithColor() public méthode

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

WithColorRes() public méthode

Set the Color of the drawable.
public WithColorRes ( int colorRes ) : IconDrawable
colorRes int The WithColor resource id, from your Resource class.
Résultat IconDrawable

WithSizePx() public méthode

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

WithSizeRes() public méthode

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