public abstract class CalendarElement extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM
The position of the text will be on the bottom side of the element.
|
static int |
CENTER
The position of the text will be centered alongside both axes.
|
static int |
CENTER_HORIZONTAL
The position of the text will be centered alongside the x axis.
|
static int |
CENTER_VERTICAL
The position of the text will be centered alongside the y axis.
|
static int |
LEFT
The position of the text will be on the left side of the element.
|
static int |
RIGHT
The position of the text will be on the right side of the element.
|
static int |
TOP
The position of the text will be on the top side of the element.
|
Constructor and Description |
---|
CalendarElement(RadCalendarView owner)
Creates a new instance of the
CalendarElement class. |
Modifier and Type | Method and Description |
---|---|
void |
arrange(int left,
int top,
int right,
int bottom)
Used to arrange the current element instance according to the given dimensions.
|
Rect |
calcBorderRect()
Calculates the border rect for this cell.
|
int |
getAlpha()
Gets the alpha value of the element.
|
int |
getBackgroundColorDisabled()
Gets the color that will be used as background when the element is disabled.
|
int |
getBackgroundColorEnabled()
Gets the color that will be used as background when the element is idle.
|
Bitmap |
getBitmap()
Gets the current bitmap for the element.
|
int |
getBitmapPosition()
Gets the position of the bitmap.
|
int |
getBottom()
Gets the current bottom position.
|
int |
getHeight()
Gets the getHeight of the element.
|
int |
getLeft()
Gets the current left position.
|
int |
getPaddingBottom()
Gets the bottom padding of the element.
|
int |
getPaddingLeft()
Gets the left padding of the element.
|
int |
getPaddingRight()
Gets the right padding of the element.
|
int |
getPaddingTop()
Gets the top padding of the element.
|
CalendarElement |
getParent()
Gets the current parent element, that holds this element.
|
int |
getRight()
The current right position.
|
int |
getTop()
Gets the current top position.
|
int |
getVirtualOffsetX()
Gets the virtual offset of the element along the x axis.
|
int |
getVirtualOffsetY()
Gets the virtual offset of the element along the y axis.
|
ElementVisibility |
getVisibility() |
int |
getWidth()
Gets the getWidth of the element.
|
boolean |
isEnabled()
Gets a value determining whether the current element is enabled.
|
boolean |
pointIsInsideElement(int x,
int y)
Used to determine if a point is inside the current element's dimensions.
|
void |
postRender(Canvas canvas)
This method is called after calling the
render(android.graphics.Canvas) method. |
void |
render(Canvas canvas)
This method is called at onDraw() call from the main calendar view instance and is used for drawing all custom elements building the calendar structure.
|
void |
setAlpha(int alpha)
Sets the alpha value of the element.
|
void |
setBackgroundColor(int colorEnabled,
int colorDisabled)
Sets the background color for both the enabled and the disabled state of the element.
|
void |
setBackgroundColorDisabled(int color)
Sets the color that will be used as background when the element is disabled.
|
void |
setBackgroundColorEnabled(int color)
Sets the color that will be used as background when the element is idle.
|
void |
setBitmap(Bitmap bitmap)
Sets the current bitmap for the element.
|
void |
setBitmapPosition(int bitmapPosition)
Sets the position of the bitmap.
|
void |
setEnabled(boolean enabled)
Sets a value determining whether the current element is enabled.
|
void |
setPadding(int left,
int top,
int right,
int bottom)
Sets the padding for the current element.
|
void |
setPaddingHorizontal(int padding)
Sets padding to both left and right side of the element.
|
void |
setPaddingVertical(int padding)
Sets padding to both top and bottom side of the element.
|
void |
setParent(CalendarElement parent)
Sets the current parent element, that holds this element.
|
void |
setVirtualOffsets(int offsetX,
int offsetY)
Sets the virtual offsets of the element along the x and y axes.
|
void |
setVirtualOffsetX(int offset)
Sets the virtual offset of the element along the x axis.
|
void |
setVirtualOffsetY(int offset)
Sets the virtual offset of the element along the y axis.
|
void |
setVisibility(ElementVisibility visibility) |
void |
translate(int offsetX,
int offsetY)
Used to translate the element using the given offset which is being applied to the current position of the element.
|
int |
virtualBottom()
The virtual bottom coordinate of the element according to the current bottom and the current virtual
offset along the y axis.
|
int |
virtualLeft()
The virtual left coordinate of the element according to the current left and the current virtual
offset along the x axis.
|
int |
virtualRight()
The virtual right coordinate of the element according to the current right and the current virtual
offset along the x axis.
|
int |
virtualTop()
The virtual top coordinate of the element according to the current top and the current virtual
offset along the y axis.
|
void |
virtualTranslate(int offsetX,
int offsetY) |
public static final int TOP
public static final int LEFT
public static final int RIGHT
public static final int BOTTOM
public static final int CENTER_HORIZONTAL
public static final int CENTER_VERTICAL
public static final int CENTER
public CalendarElement(RadCalendarView owner)
CalendarElement
class.owner
- the calendar instance owning the element.public int virtualLeft()
public int virtualTop()
public int virtualRight()
public int virtualBottom()
public int getVirtualOffsetX()
public void setVirtualOffsetX(int offset)
offset
- the new virtual offset along the x axis.public int getVirtualOffsetY()
public void setVirtualOffsetY(int offset)
offset
- the new virtual offset along the y axis.public void setVirtualOffsets(int offsetX, int offsetY)
offsetX
- the new virtual offset along the x axis.offsetY
- the new virtual offset along the y axis.public int getBitmapPosition()
LEFT
, TOP
,
RIGHT
, BOTTOM
, CENTER_VERTICAL
, CENTER_HORIZONTAL
and
CENTER
public void setBitmapPosition(int bitmapPosition)
LEFT
, TOP
,
RIGHT
, BOTTOM
, CENTER_VERTICAL
, CENTER_HORIZONTAL
and
CENTER
bitmapPosition
- the new bitmap position.public Bitmap getBitmap()
public void setBitmap(Bitmap bitmap)
bitmap
- the new bitmap.public int getAlpha()
public void setAlpha(int alpha)
alpha
- the new alpha value.public int getLeft()
public int getTop()
public int getRight()
public int getBottom()
public int getWidth()
public int getHeight()
public ElementVisibility getVisibility()
public void setVisibility(ElementVisibility visibility)
public boolean isEnabled()
true
if the element is enabled, false
otherwise.public void setEnabled(boolean enabled)
enabled
- the new enabled state.public CalendarElement getParent()
public void setParent(CalendarElement parent)
parent
- the new parent element.public int getPaddingLeft()
public int getPaddingTop()
public int getPaddingRight()
public int getPaddingBottom()
public void setPadding(int left, int top, int right, int bottom)
left
- the new left padding.top
- the new top padding.right
- the new right padding.bottom
- the new bottom padding.public void setPaddingHorizontal(int padding)
padding
- the padding to be set.public void setPaddingVertical(int padding)
padding
- the padding to be set.public int getBackgroundColorEnabled()
public void setBackgroundColorEnabled(int color)
color
- the new idle color.public int getBackgroundColorDisabled()
public void setBackgroundColorDisabled(int color)
color
- the new disabled color.public void setBackgroundColor(int colorEnabled, int colorDisabled)
colorEnabled
- the color for the enabled state.colorDisabled
- the color for the disabled state.public void render(Canvas canvas)
canvas
- the canvas of the main calendar view instance.public void postRender(Canvas canvas)
render(android.graphics.Canvas)
method.canvas
- the canvas of the main calendar view instance.public Rect calcBorderRect()
public void arrange(int left, int top, int right, int bottom)
left
- the left border.top
- the top border.right
- the right border.bottom
- the bottom border.public void translate(int offsetX, int offsetY)
offsetX
- offset along the x axis.offsetY
- offset along the y axis.public void virtualTranslate(int offsetX, int offsetY)
public final boolean pointIsInsideElement(int x, int y)
x
- the x coordinate of the point.y
- the y coordinate of the point.true
of the point is inside the current element's dimensions, false
if it is outside the dimensions.