public class IconicsDrawable
extends android.graphics.drawable.Drawable
Drawable which can display icons from icon fonts.| Modifier and Type | Field and Description |
|---|---|
static int |
ANDROID_ACTIONBAR_ICON_SIZE_DP |
static int |
ANDROID_ACTIONBAR_ICON_SIZE_PADDING_DP |
| Modifier | Constructor and Description |
|---|---|
|
IconicsDrawable(android.content.Context context) |
|
IconicsDrawable(android.content.Context context,
java.lang.Character icon) |
|
IconicsDrawable(android.content.Context context,
IIcon icon) |
protected |
IconicsDrawable(android.content.Context context,
ITypeface typeface,
IIcon icon) |
|
IconicsDrawable(android.content.Context context,
java.lang.String icon) |
| Modifier and Type | Method and Description |
|---|---|
IconicsDrawable |
actionBar()
Sets the size and the Padding to the correct values to be used for the actionBar / toolBar
|
IconicsDrawable |
actionBarSize()
Deprecated.
use actionBar() instead
|
IconicsDrawable |
alpha(int alpha)
Sets the opacity
|
IconicsDrawable |
backgroundColor(int backgroundColor)
set background color
|
IconicsDrawable |
backgroundColorRes(int backgroundColorRes)
set background color from res
|
void |
clearColorFilter() |
IconicsDrawable |
clone()
clones the icon
|
IconicsDrawable |
color(int color)
Set the color of the drawable.
|
IconicsDrawable |
colorFilter(android.graphics.ColorFilter cf)
Set the colorFilter
|
IconicsDrawable |
colorRes(int colorRes)
Set the color of the drawable.
|
IconicsDrawable |
contourColor(int contourColor)
Set contour color for the.
|
IconicsDrawable |
contourColorRes(int contourColorRes)
Set contour color from color res.
|
IconicsDrawable |
contourWidthDp(int contourWidthDp)
Set contour width from dp for the icon
|
IconicsDrawable |
contourWidthPx(int contourWidth)
Set contour width for the icon.
|
IconicsDrawable |
contourWidthRes(int contourWidthRes)
Set contour width from an dimen res for the icon
|
void |
draw(android.graphics.Canvas canvas) |
IconicsDrawable |
drawContour(boolean drawContour)
Enable/disable contour drawing.
|
int |
getAlpha() |
int |
getBackgroundColor()
Returns the icon background color
|
int |
getColor()
Returns the icon color
|
int |
getCompatAlpha()
just a helper method to get the alpha value
|
int |
getContourColor()
Returns the icon contour color
|
IIcon |
getIcon() |
int |
getIntrinsicHeight() |
int |
getIntrinsicWidth() |
int |
getOpacity() |
java.lang.String |
getPlainIcon() |
IconicsDrawable |
icon(java.lang.Character icon)
Loads and draws given.
|
IconicsDrawable |
icon(IIcon icon)
Loads and draws given.
|
protected IconicsDrawable |
icon(ITypeface typeface,
IIcon icon)
Loads and draws given.
|
IconicsDrawable |
icon(java.lang.String icon)
Loads and draws given text
|
IconicsDrawable |
iconOffsetXDp(int iconOffsetXDp)
set the icon offset for X as dp
|
IconicsDrawable |
iconOffsetXPx(int iconOffsetX)
set the icon offset for X
|
IconicsDrawable |
iconOffsetXRes(int iconOffsetXRes)
set the icon offset for X from resource
|
IconicsDrawable |
iconOffsetYDp(int iconOffsetYDp)
set the icon offset for Y as dp
|
IconicsDrawable |
iconOffsetYPx(int iconOffsetY)
set the icon offset for Y
|
IconicsDrawable |
iconOffsetYRes(int iconOffsetYRes)
set the icon offset for Y from resource
|
IconicsDrawable |
iconText(java.lang.String icon)
Loads and draws given text
|
boolean |
isStateful() |
protected void |
onBoundsChange(android.graphics.Rect bounds) |
protected boolean |
onStateChange(int[] stateSet) |
IconicsDrawable |
paddingDp(int iconPadding)
Set the padding in dp for the drawable
|
IconicsDrawable |
paddingPx(int iconPadding)
Set a padding for the.
|
IconicsDrawable |
paddingRes(int dimenRes)
Set the padding of the drawable from res
|
IconicsDrawable |
respectFontBounds(boolean respectBounds)
Set if it should respect the original bounds of the icon.
|
IconicsDrawable |
roundedCornersDp(int roundedCornerDp)
set rounded corner from dp
|
IconicsDrawable |
roundedCornersPx(int roundedCornerPx)
set rounded corner from px
|
IconicsDrawable |
roundedCornersRes(int roundedCornerRes)
set rounded corner from res
|
IconicsDrawable |
roundedCornersRxDp(int roundedCornerRxDp)
set rounded corner from dp
|
IconicsDrawable |
roundedCornersRxPx(int roundedCornerRxPx)
set rounded corner from px
|
IconicsDrawable |
roundedCornersRxRes(int roundedCornerRxRes)
set rounded corner from res
|
IconicsDrawable |
roundedCornersRyDp(int roundedCornerRyDp)
set rounded corner from dp
|
IconicsDrawable |
roundedCornersRyPx(int roundedCornerRyPx)
set rounded corner from px
|
IconicsDrawable |
roundedCornersRyRes(int roundedCornerRyRes)
set rounded corner from res
|
void |
setAlpha(int alpha) |
void |
setColorFilter(android.graphics.ColorFilter cf) |
boolean |
setState(int[] stateSet) |
void |
setTint(int tintColor) |
void |
setTintList(android.content.res.ColorStateList tint) |
void |
setTintMode(android.graphics.PorterDuff.Mode tintMode) |
IconicsDrawable |
sizeDp(int size)
Set the size of the drawable.
|
IconicsDrawable |
sizeDpX(int sizeX)
Set the size of the drawable.
|
IconicsDrawable |
sizeDpY(int sizeY)
Set the size of the drawable.
|
IconicsDrawable |
sizePx(int size)
Set the size of the drawable.
|
IconicsDrawable |
sizePxX(int sizeX)
Set the size of the drawable.
|
IconicsDrawable |
sizePxY(int sizeY)
Set the size of the drawable.
|
IconicsDrawable |
sizeRes(int dimenRes)
Set the size of the drawable.
|
IconicsDrawable |
sizeResX(int dimenResX)
Set the size of the drawable.
|
IconicsDrawable |
sizeResY(int dimenResY)
Set the size of the drawable.
|
IconicsDrawable |
style(android.graphics.Paint.Style style)
Sets the style
|
android.graphics.Bitmap |
toBitmap()
Creates a BitMap to use in Widgets or anywhere else
|
IconicsDrawable |
typeface(android.graphics.Typeface typeface)
sets the typeface of the drawable
NOTE THIS WILL OVERWRITE THE ICONFONT!
|
applyTheme, canApplyTheme, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isVisible, jumpToCurrentState, mutate, onLayoutDirectionChanged, onLevelChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setVisible, unscheduleSelfpublic static final int ANDROID_ACTIONBAR_ICON_SIZE_DP
public static final int ANDROID_ACTIONBAR_ICON_SIZE_PADDING_DP
public IconicsDrawable(android.content.Context context)
public IconicsDrawable(android.content.Context context,
java.lang.Character icon)
public IconicsDrawable(android.content.Context context,
java.lang.String icon)
public IconicsDrawable(android.content.Context context,
IIcon icon)
public IconicsDrawable icon(java.lang.String icon)
icon - public IconicsDrawable icon(java.lang.Character icon)
icon - public IconicsDrawable iconText(java.lang.String icon)
icon - public IconicsDrawable icon(IIcon icon)
icon - protected IconicsDrawable icon(ITypeface typeface, IIcon icon)
typeface - icon - public IconicsDrawable respectFontBounds(boolean respectBounds)
respectBounds - set to true if it should respect the original boundspublic IconicsDrawable color(int color)
color - The color, usually from android.graphics.Color or 0xFF012345.public IconicsDrawable colorRes(@ColorRes int colorRes)
colorRes - The color resource, from your R file.public int getColor()
public int getContourColor()
public int getBackgroundColor()
public IconicsDrawable iconOffsetXRes(@DimenRes int iconOffsetXRes)
iconOffsetXRes - public IconicsDrawable iconOffsetXDp(@Dimension(unit=0) int iconOffsetXDp)
iconOffsetXDp - public IconicsDrawable iconOffsetXPx(@Dimension(unit=1) int iconOffsetX)
iconOffsetX - public IconicsDrawable iconOffsetYRes(@DimenRes int iconOffsetYRes)
iconOffsetYRes - public IconicsDrawable iconOffsetYDp(@Dimension(unit=0) int iconOffsetYDp)
iconOffsetYDp - public IconicsDrawable iconOffsetYPx(@Dimension(unit=1) int iconOffsetY)
iconOffsetY - public IconicsDrawable paddingRes(@DimenRes int dimenRes)
dimenRes - public IconicsDrawable paddingDp(@Dimension(unit=0) int iconPadding)
iconPadding - public IconicsDrawable paddingPx(@Dimension(unit=1) int iconPadding)
iconPadding - @Deprecated public IconicsDrawable actionBarSize()
public IconicsDrawable actionBar()
public IconicsDrawable sizeRes(@DimenRes int dimenRes)
dimenRes - The dimension resource.public IconicsDrawable sizeDp(@Dimension(unit=0) int size)
size - The size in density-independent pixels (dp).public IconicsDrawable sizePx(@Dimension(unit=1) int size)
size - The size in pixels (px).public IconicsDrawable sizeResX(@DimenRes int dimenResX)
dimenResX - The dimension resource.public IconicsDrawable sizeDpX(@Dimension(unit=0) int sizeX)
sizeX - The size in density-independent pixels (dp).public IconicsDrawable sizePxX(@Dimension(unit=1) int sizeX)
sizeX - The size in pixels (px).public IconicsDrawable sizeResY(@DimenRes int dimenResY)
dimenResY - The dimension resource.public IconicsDrawable sizeDpY(@Dimension(unit=0) int sizeY)
sizeY - The size in density-independent pixels (dp).public IconicsDrawable sizePxY(@Dimension(unit=1) int sizeY)
sizeY - The size in pixels (px).public IconicsDrawable contourColor(int contourColor)
contourColor - public IconicsDrawable contourColorRes(@ColorRes int contourColorRes)
contourColorRes - public IconicsDrawable backgroundColor(int backgroundColor)
backgroundColor - public IconicsDrawable backgroundColorRes(@ColorRes int backgroundColorRes)
backgroundColorRes - public IconicsDrawable roundedCornersRxRes(@DimenRes int roundedCornerRxRes)
roundedCornerRxRes - public IconicsDrawable roundedCornersRxDp(@Dimension(unit=0) int roundedCornerRxDp)
roundedCornerRxDp - public IconicsDrawable roundedCornersRxPx(@Dimension(unit=1) int roundedCornerRxPx)
roundedCornerRxPx - public IconicsDrawable roundedCornersRyRes(@DimenRes int roundedCornerRyRes)
roundedCornerRyRes - public IconicsDrawable roundedCornersRyDp(@Dimension(unit=0) int roundedCornerRyDp)
roundedCornerRyDp - public IconicsDrawable roundedCornersRyPx(@Dimension(unit=1) int roundedCornerRyPx)
roundedCornerRyPx - public IconicsDrawable roundedCornersRes(@DimenRes int roundedCornerRes)
roundedCornerRes - public IconicsDrawable roundedCornersDp(@Dimension(unit=0) int roundedCornerDp)
roundedCornerDp - public IconicsDrawable roundedCornersPx(@Dimension(unit=1) int roundedCornerPx)
roundedCornerPx - public IconicsDrawable contourWidthRes(@DimenRes int contourWidthRes)
contourWidthRes - public IconicsDrawable contourWidthDp(@Dimension(unit=0) int contourWidthDp)
contourWidthDp - public IconicsDrawable contourWidthPx(@Dimension(unit=1) int contourWidth)
contourWidth - public IconicsDrawable drawContour(boolean drawContour)
drawContour - public IconicsDrawable colorFilter(android.graphics.ColorFilter cf)
cf - public IconicsDrawable alpha(int alpha)
alpha - public IconicsDrawable style(android.graphics.Paint.Style style)
style - public IconicsDrawable typeface(android.graphics.Typeface typeface)
typeface - public void draw(android.graphics.Canvas canvas)
draw in class android.graphics.drawable.Drawablepublic void setTint(int tintColor)
setTint in class android.graphics.drawable.Drawablepublic void setTintList(android.content.res.ColorStateList tint)
setTintList in class android.graphics.drawable.Drawablepublic void setTintMode(@NonNull
android.graphics.PorterDuff.Mode tintMode)
setTintMode in class android.graphics.drawable.Drawableprotected void onBoundsChange(android.graphics.Rect bounds)
onBoundsChange in class android.graphics.drawable.Drawablepublic boolean isStateful()
isStateful in class android.graphics.drawable.Drawablepublic boolean setState(int[] stateSet)
setState in class android.graphics.drawable.Drawableprotected boolean onStateChange(int[] stateSet)
onStateChange in class android.graphics.drawable.Drawablepublic int getIntrinsicWidth()
getIntrinsicWidth in class android.graphics.drawable.Drawablepublic int getIntrinsicHeight()
getIntrinsicHeight in class android.graphics.drawable.Drawablepublic int getOpacity()
getOpacity in class android.graphics.drawable.Drawablepublic void setAlpha(int alpha)
setAlpha in class android.graphics.drawable.Drawablepublic int getAlpha()
getAlpha in class android.graphics.drawable.Drawablepublic IIcon getIcon()
public java.lang.String getPlainIcon()
public int getCompatAlpha()
public void setColorFilter(android.graphics.ColorFilter cf)
setColorFilter in class android.graphics.drawable.Drawablepublic void clearColorFilter()
clearColorFilter in class android.graphics.drawable.Drawablepublic android.graphics.Bitmap toBitmap()
public IconicsDrawable clone()
clone in class java.lang.Object