C# Класс 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().
Наследование: android.graphics.drawable.Drawable
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
convertDpToPx ( android.content.Context context, float dp ) : int
init ( android.content.Context context, Icon icon ) : void
isEnabled ( int stateSet ) : bool

Описание методов

IconDrawable() публичный Метод

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.
Результат android.graphics

IconDrawable() публичный Метод

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.
Результат android.graphics

actionBarSize() публичный Метод

Set the size of this icon to the standard Android ActionBar.
public actionBarSize ( ) : IconDrawable
Результат IconDrawable

alpha() публичный Метод

Set the alpha of this drawable.
public alpha ( int alpha ) : IconDrawable
alpha int The alpha, between 0 (transparent) and 255 (opaque).
Результат IconDrawable

clearColorFilter() публичный Метод

public clearColorFilter ( ) : void
Результат void

color() публичный Метод

Set the color of the drawable.
public color ( int color ) : IconDrawable
color int The color, usually from android.graphics.Color or 0xFF012345.
Результат IconDrawable

colorRes() публичный Метод

Set the color of the drawable.
public colorRes ( int colorRes ) : IconDrawable
colorRes int The color resource, from your R file.
Результат IconDrawable

draw() публичный Метод

public draw ( Canvas canvas ) : void
canvas android.graphics.Canvas
Результат void

setState() публичный Метод

public setState ( int stateSet ) : bool
stateSet int
Результат bool

sizeDp() публичный Метод

Set the size of the drawable.
public sizeDp ( int size ) : IconDrawable
size int The size in density-independent pixels (dp).
Результат IconDrawable

sizePx() публичный Метод

Set the size of the drawable.
public sizePx ( int size ) : IconDrawable
size int The size in pixels (px).
Результат IconDrawable

sizeRes() публичный Метод

Set the size of the drawable.
public sizeRes ( int dimenRes ) : IconDrawable
dimenRes int The dimension resource.
Результат IconDrawable