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
ファイルを表示 Open project: PragmaticIT/xiconify

Public Methods

Method 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

Method 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 method

public ClearColorFilter ( ) : void
return void

Draw() public method

public Draw ( Android.Graphics.Canvas canvas ) : void
canvas Android.Graphics.Canvas
return void

IconDrawable() public method

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.
return System

IconDrawable() public method

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
return System

IconDrawable() public method

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.
return System

SetAlpha() public method

public SetAlpha ( int alpha ) : void
alpha int
return void

SetColorFilter() public method

public SetColorFilter ( Android.Graphics.ColorFilter cf ) : void
cf Android.Graphics.ColorFilter
return void

SetState() public method

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

WIthSizeDp() public method

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

WithActionBarSize() public method

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

WithAlpha() public method

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

WithColor() public method

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

WithColorRes() public method

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

WithSizePx() public method

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

WithSizeRes() public method

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