public class

CurtainFoldLayout

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.droidux.ui.widgets.layout.CurtainFoldLayout

Class Overview

A layout that can be "folded" (like a curtain).

Summary

Nested Classes
interface CurtainFoldLayout.OnFoldChangedListener A listener that will be notified on start and end of the folding. 
enum CurtainFoldLayout.Orientation Determines the orientation of the folding. 
XML Attributes
Attribute Name Related Method Description
duxlyt_anchorFactor setAnchorFactor(float) The anchor factor determines the fixed point where the "curtain" will be anchored to. 
duxlyt_antialiasing If true, this layout will be drawn using an anti-alias paint, which will give better quality, but use more resources. 
duxlyt_handleGesture setHandleGesture(boolean) Whether the built-in gesture handler should handle the gesture event on the layout. 
duxlyt_numberOfSegments setNumberOfSegments(int) Determines the number of segments that made up the "curtain".. 
android:orientation setOrientation(CurtainFoldLayout.Orientation)  
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
CurtainFoldLayout(Context context)
CurtainFoldLayout(Context context, AttributeSet attrs)
CurtainFoldLayout(Context context, AttributeSet attrs, int defStyle)
Public Methods
float getAnchorFactor()
Gets the value used for determining the anchor/fixed point.
float getFoldFactor()
Gets the current fold factor.
boolean getHandleGesture()
Whether the gesture should be handled by the built-in handler.
int getNumberOfSegments()
Gets the number of segments made up this layout.
CurtainFoldLayout.Orientation getOrientation()
Gets the current orientation of the layout.
void setAnchorFactor(float anchorFactor)
The anchor factor determines the fixed point around which the view will be folded.
void setFoldFactor(float foldFactor)
The fold factor determines the amount of folding should be applied to the layout.
void setFoldListener(CurtainFoldLayout.OnFoldChangedListener foldListener)
void setHandleGesture(boolean handle)
The view has a built-in gesture handling.
void setNumberOfSegments(int numberOfSegments)
Determines the number of segments that made up the "curtain".
void setOrientation(CurtainFoldLayout.Orientation orientation)
Sets the folding orientation.
[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

duxlyt_anchorFactor

Since: API Level

The anchor factor determines the fixed point where the "curtain" will be anchored to. The value should be between 0.0-1.0. A value of 0.0 means the anchor will be at the left/top edge of the view, whereas 1.0 means that the anchor will be at the right/bottom edge of the view.

Must be a floating point value, such as "1.2".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

duxlyt_antialiasing

Since: API Level

If true, this layout will be drawn using an anti-alias paint, which will give better quality, but use more resources. Default is false.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

duxlyt_handleGesture

Since: API Level

Whether the built-in gesture handler should handle the gesture event on the layout. Default is false.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

duxlyt_numberOfSegments

Since: API Level

Determines the number of segments that made up the "curtain"..

Must be an integer value, such as "100".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

Related Methods

android:orientation

Since: API Level

Public Constructors

public CurtainFoldLayout (Context context)

Since: API Level 3.0

public CurtainFoldLayout (Context context, AttributeSet attrs)

Since: API Level 3.0

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

Since: API Level 3.0

Public Methods

public float getAnchorFactor ()

Since: API Level 3.0

Gets the value used for determining the anchor/fixed point.

Related XML Attributes
Returns
  • The value to calculate the anchor point.

public float getFoldFactor ()

Since: API Level 3.0

Gets the current fold factor.

Returns
  • The fold factor.

public boolean getHandleGesture ()

Since: API Level 3.0

Whether the gesture should be handled by the built-in handler.

Related XML Attributes
Returns
  • true if built-in handler is handling the gesture.

public int getNumberOfSegments ()

Since: API Level 3.0

Gets the number of segments made up this layout.

Related XML Attributes
Returns
  • The number of segments/folds.

public CurtainFoldLayout.Orientation getOrientation ()

Since: API Level 3.0

Gets the current orientation of the layout.

Related XML Attributes
Returns
  • The current orientation.

public void setAnchorFactor (float anchorFactor)

Since: API Level 3.0

The anchor factor determines the fixed point around which the view will be folded. The value should be between 0.0-1.0. A value of 0.0 means the folding will be anchored at the left/top edge of the view, whereas 1.0 means that the anchor will be at the right/bottom edge of the view.

Related XML Attributes
Parameters
anchorFactor The factor to calculate the location of the anchor/fixed point.

public void setFoldFactor (float foldFactor)

Since: API Level 3.0

The fold factor determines the amount of folding should be applied to the layout. The value should be between 0.0-1.0. A fold factor of 0.0 means that the view is completely unfolded, whereas a fold factor of 1.0 means that it's completely folded, and don't need to be drawn.

public void setFoldListener (CurtainFoldLayout.OnFoldChangedListener foldListener)

Since: API Level 3.0

public void setHandleGesture (boolean handle)

Since: API Level 3.0

The view has a built-in gesture handling. Currently it handles only scrolling gesture to open and close the "curtain". By default it's not enabled.

Related XML Attributes
Parameters
handle Set to true to enable the gesture handling. Default is false.

public void setNumberOfSegments (int numberOfSegments)

Since: API Level 3.0

Determines the number of segments that made up the "curtain".

Related XML Attributes
Parameters
numberOfSegments The number of segments of the "curtain".

public void setOrientation (CurtainFoldLayout.Orientation orientation)

Since: API Level 3.0

Sets the folding orientation.

Related XML Attributes
Parameters
orientation The new folding orientation.