Stay organized with collections Save and categorize content based on your preferences.

MotionPlaceholder

public class MotionPlaceholder
extends View

java.lang.Object
   ↳ android.view.View
     ↳ androidx.constraintlayout.helper.widget.MotionPlaceholder


Summary

Inherited constants

Fields

protected HashMap<Integer, String> mMap

Inherited fields

Public constructors

MotionPlaceholder(Context context)
MotionPlaceholder(Context context, AttributeSet attrs)
MotionPlaceholder(Context context, AttributeSet attrs, int defStyleAttr)
MotionPlaceholder(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

void addView(View view)

Add a view to the helper.

boolean containsId(int id)
int[] getReferencedIds()

Helpers typically reference a collection of ids

int indexFromId(int id)
void loadParameters(ConstraintSet.Constraint constraint, HelperWidget child, ConstraintLayout.LayoutParams layoutParams, SparseArray<ConstraintWidget> mapIdToWidget)
void onMeasure(VirtualLayout layout, int widthMeasureSpec, int heightMeasureSpec)
int removeView(View view)

Remove a given view from the helper.

void resolveRtl(ConstraintWidget widget, boolean isRtl)
void setReferencedIds(int[] ids)

Helpers typically reference a collection of ids

void setTag(int key, Object tag)
void updatePostConstraints(ConstraintLayout container)
void updatePreDraw(ConstraintLayout container)
void updatePreLayout(ConstraintWidgetContainer container, Helper helper, SparseArray<ConstraintWidget> map)

Protected methods

View[] getViews(ConstraintLayout layout)
void init(AttributeSet attrs)
void onAttachedToWindow()
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Inherited methods

Fields

mMap

protected HashMap<Integer, String> mMap

Public constructors

MotionPlaceholder

public MotionPlaceholder (Context context)

Parameters
context Context

MotionPlaceholder

public MotionPlaceholder (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

MotionPlaceholder

public MotionPlaceholder (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

MotionPlaceholder

public MotionPlaceholder (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

Public methods

addView

public void addView (View view)

Add a view to the helper. The referenced view need to be a child of the helper's parent. The view also need to have its id set in order to be added.

containsId

public boolean containsId (int id)

Parameters
id int

Returns
boolean

getReferencedIds

public int[] getReferencedIds ()

Helpers typically reference a collection of ids

Returns
int[] ids referenced

indexFromId

public int indexFromId (int id)

Parameters
id int

Returns
int

loadParameters

public void loadParameters (ConstraintSet.Constraint constraint, 
                HelperWidget child, 
                ConstraintLayout.LayoutParams layoutParams, 
                SparseArray<ConstraintWidget> mapIdToWidget)

Parameters
constraint ConstraintSet.Constraint

child HelperWidget

layoutParams ConstraintLayout.LayoutParams

mapIdToWidget SparseArray

onMeasure

public void onMeasure (VirtualLayout layout, 
                int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
layout VirtualLayout

widthMeasureSpec int

heightMeasureSpec int

removeView

public int removeView (View view)

Remove a given view from the helper.

Returns
int index of view removed

resolveRtl

public void resolveRtl (ConstraintWidget widget, 
                boolean isRtl)

Parameters
widget ConstraintWidget

isRtl boolean

setReferencedIds

public void setReferencedIds (int[] ids)

Helpers typically reference a collection of ids

Parameters
ids int

setTag

public void setTag (int key, 
                Object tag)

Parameters
key int

tag Object

updatePostConstraints

public void updatePostConstraints (ConstraintLayout container)

Parameters
container ConstraintLayout

updatePreDraw

public void updatePreDraw (ConstraintLayout container)

Parameters
container ConstraintLayout

updatePreLayout

public void updatePreLayout (ConstraintWidgetContainer container, 
                Helper helper, 
                SparseArray<ConstraintWidget> map)

Parameters
container ConstraintWidgetContainer

helper Helper

map SparseArray

Protected methods

getViews

protected View[] getViews (ConstraintLayout layout)

Parameters
layout ConstraintLayout

Returns
View[]

init

protected void init (AttributeSet attrs)

Parameters
attrs AttributeSet

onAttachedToWindow

protected void onAttachedToWindow ()

onMeasure

protected void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int