CollapsingToolbarLayout.LayoutParams

public class CollapsingToolbarLayout.LayoutParams


Summary

Constants

static final int

The view will act as normal with no collapsing behavior.

static final int

The view will scroll in a parallax fashion.

static final int

The view will pin in place until it reaches the bottom of the .

Public fields

int

Public constructors

LayoutParams(LayoutParams p)
LayoutParams(LayoutParams source)
LayoutParams(MarginLayoutParams source)
LayoutParams(Context c, AttributeSet attrs)
LayoutParams(int width, int height)
LayoutParams(int width, int height, int gravity)

Public methods

int

Returns the requested collapse mode.

float

Returns the parallax scroll multiplier used in conjunction with COLLAPSE_MODE_PARALLAX.

void
setCollapseMode(int collapseMode)

Set the collapse mode.

void
setParallaxMultiplier(float multiplier)

Set the parallax scroll multiplier used in conjunction with COLLAPSE_MODE_PARALLAX.

Constants

COLLAPSE_MODE_OFF

public static final int COLLAPSE_MODE_OFF = 0

The view will act as normal with no collapsing behavior.

COLLAPSE_MODE_PARALLAX

public static final int COLLAPSE_MODE_PARALLAX = 2

The view will scroll in a parallax fashion. See setParallaxMultiplier to change the multiplier used.

COLLAPSE_MODE_PIN

public static final int COLLAPSE_MODE_PIN = 1

The view will pin in place until it reaches the bottom of the .

Public fields

collapseMode

public int collapseMode

Public constructors

LayoutParams

public LayoutParams(LayoutParams p)

LayoutParams

public LayoutParams(CollapsingToolbarLayout.LayoutParams source)

LayoutParams

public LayoutParams(LayoutParams source)

LayoutParams

public LayoutParams(MarginLayoutParams source)

LayoutParams

public LayoutParams(Context c, AttributeSet attrs)

LayoutParams

public LayoutParams(int width, int height)

LayoutParams

public LayoutParams(int width, int height, int gravity)

Public methods

getCollapseMode

public int getCollapseMode()

Returns the requested collapse mode.

Returns
int

the current mode. One of COLLAPSE_MODE_OFF, COLLAPSE_MODE_PIN or COLLAPSE_MODE_PARALLAX.

getParallaxMultiplier

public float getParallaxMultiplier()

Returns the parallax scroll multiplier used in conjunction with COLLAPSE_MODE_PARALLAX.

setCollapseMode

public void setCollapseMode(int collapseMode)

Set the collapse mode.

Parameters
int collapseMode

one of COLLAPSE_MODE_OFF, COLLAPSE_MODE_PIN or COLLAPSE_MODE_PARALLAX.

setParallaxMultiplier

public void setParallaxMultiplier(float multiplier)

Set the parallax scroll multiplier used in conjunction with COLLAPSE_MODE_PARALLAX. A value of 0.0 indicates no movement at all, 1.0f indicates normal scroll movement.

Parameters
float multiplier

the multiplier.