public class

ColorBox

extends View
java.lang.Object
   ↳ android.view.View
     ↳ com.droidux.pack.commons.widget.color.ColorBox

Class Overview

Custom view that show a box with certain color.

Summary

XML Attributes
Attribute Name Related Method Description
dux_border_color setBorderColor(int) Color of the border of the panels. 
dux_border_width setBorderWidth(float) Specifies the width of the border. 
dux_color setColor(int) Specifies a color. 
[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ColorBox(Context context)
ColorBox(Context context, AttributeSet attrs)
ColorBox(Context context, AttributeSet attrs, int defStyle)
Public Methods
int getBorderColor()
Gets the color of the border.
float getBorderWidth()
Gets the width of the border.
int getColor()
Gets the color of the box.
void setBorderColor(int color)
Sets the color of the border.
void setBorderWidth(float width)
Sets the width of the border.
void setColor(int color)
Sets the color of the box.
[Expand]
Inherited Methods
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

XML Attributes

dux_border_color

Since: API Level

Color of the border of the panels. If the border width is greater than 0, a border with the specified color will be drawn around every panels.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

dux_border_width

Since: API Level

Specifies the width of the border. Its value should be a dimension type (such as "2dip"). If the width is greater than 0, a border will be drawn around the panel.

Related Methods

dux_color

Since: API Level

Specifies a color.

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Related Methods

Public Constructors

public ColorBox (Context context)

Since: API Level 2.5

public ColorBox (Context context, AttributeSet attrs)

Since: API Level 2.5

public ColorBox (Context context, AttributeSet attrs, int defStyle)

Since: API Level 2.5

Public Methods

public int getBorderColor ()

Since: API Level 2.5

Gets the color of the border.

Returns
  • The border color.

public float getBorderWidth ()

Since: API Level 2.5

Gets the width of the border.

Returns
  • The width of the border.

public int getColor ()

Since: API Level 2.5

Gets the color of the box.

Returns
  • The box color.

public void setBorderColor (int color)

Since: API Level 2.5

Sets the color of the border. If the getBorderWidth() greater than 0, a border will be drawn using the specified color.

Related XML Attributes
Parameters
color The border color.

public void setBorderWidth (float width)

Since: API Level 2.5

Sets the width of the border. If the width is greater than 0, a border will be drawn using the getBorderColor() color.

Related XML Attributes
Parameters
width The width of the border.

public void setColor (int color)

Since: API Level 2.5

Sets the color of the box.

Related XML Attributes
Parameters
color The box color.