public class

RoundedCornerLayout

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.droidux.pack.layouts.widget.RoundedCornerLayout

Class Overview

Layout with a rounded corner viewport.

Summary

XML Attributes
Attribute Name Related Method Description
dux_cornerRadius setCornerRadius(float) Specifies the corner radius. 
dux_maskMode The mask's mode determine whether to mask the whole view (including the background) or only the content. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
RoundedCornerLayout(Context context)
RoundedCornerLayout(Context context, AttributeSet attrs)
RoundedCornerLayout(Context context, AttributeSet attrs, int defStyle)
Public Methods
final boolean getCornerRadius(RectF radii)
Retrieve the corner radii, returning true if they are non-empty.
final RectF getCornerRadius()
Retrieve the corner radii.
Drawable getMaskDrawable()
void setCornerRadius(float tlRad, float trRad, float brRad, float blRad)
Sets the corner radii of this view.
void setCornerRadius(float radius)
Sets the corner radius of this view.
Protected Methods
void onLayout(boolean changed, int left, int top, int right, int bottom)
Called from layout when this view should assign a size and position to each of its children.
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
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.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

XML Attributes

dux_cornerRadius

Since: API Level

Specifies the corner radius. Its value should be a dimension (such as "5dip").

Must be a dimension value, which is a floating point number appended with a unit such as "2.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).

Related Methods

dux_maskMode

Since: API Level

The mask's mode determine whether to mask the whole view (including the background) or only the content. Default is all.

Must be one of the following constant values.

ConstantValueDescription
all0 Mask the whole view, including background.
content1 Only mask the content, excluding the background.

Related Methods

Public Constructors

public RoundedCornerLayout (Context context)

Since: API Level 2.5

public RoundedCornerLayout (Context context, AttributeSet attrs)

Since: API Level 2.5

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

Since: API Level 2.5

Public Methods

public final boolean getCornerRadius (RectF radii)

Since: API Level 2.5

Retrieve the corner radii, returning true if they are non-empty.

Parameters
radii Returns the radii here. If it is null, ignore it but still return true if the current clip is non-empty.
Returns
  • true if the radii is non-empty

public final RectF getCornerRadius ()

Since: API Level 2.5

Retrieve the corner radii.

Returns
  • The corner radii.

public Drawable getMaskDrawable ()

Since: API Level 2.5

public void setCornerRadius (float tlRad, float trRad, float brRad, float blRad)

Since: API Level 2.5

Sets the corner radii of this view.

Parameters
tlRad top-left radius
trRad top-right radius
brRad bottom-right radius
blRad bottom-left radius

public void setCornerRadius (float radius)

Since: API Level 2.5

Sets the corner radius of this view.

Related XML Attributes
Parameters
radius The corner radius.

Protected Methods

protected void onLayout (boolean changed, int left, int top, int right, int bottom)

Since: API Level

Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.

Parameters
changed This is a new size or position for this view
left Left position, relative to parent
top Top position, relative to parent
right Right position, relative to parent
bottom Bottom position, relative to parent