Skip to content

Expandableconstraintlayout


title: Expandable ConstraintLayout Examples tags: - ConstraintLayout chapter: ExpandableLayout post_status: publish date: 2022-10-19 summary: Learn Expandable ConstraintLayout using these step by step examples. custom_fields: chapter: Expandable ConstraintLayout chapter_description: Learn Expandable ConstraintLayout using this example.


Step by step examples to teach you Expandable ConstraintLayout.

ExpandableConstraintLayout

An expandable/collapsible implementation of a ConstraintLayout.

Expandable ConstraintLayout Tutorial

Expandable ConstraintLayout Tutorial

Expandable ConstraintLayout Tutorial

Expandable ConstraintLayout Tutorial

allprojects {
  repositories {
  ...
  maven { url 'https://jitpack.io' }
  }
}
dependencies {
  implementation 'com.github.rjsvieira:expandableConstraintLayout:1.0.0'
}

Initialize your ExpandaConstraintLayout just like any other ConstraintLayout

ExpandableConstraintLayout ecl = (ExpandableConstraintLayout) findViewById(R.id.ecl);
void setInterpolator(TimeInterpolator interpolator)
void setAnimationDuration(int animationDuration)
void toggle()
void expand()
void collapse()

The ExpandableConstraintLayout allows the implementation of a listener :

setAnimationListener(@NonNull ExpandableConstraintLayoutListener listener)

This listener will track the following events :

/**
* Notifies the start of the animation.
* Sync from android.animation.Animator.AnimatorListener.onAnimationStart(Animator animation)
*/
void onAnimationStart(ExpandableConstraintLayoutStatus status);

/**
* Notifies the end of the animation.
* Sync from android.animation.Animator.AnimatorListener.onAnimationEnd(Animator animation)
*/
void onAnimationEnd(ExpandableConstraintLayoutStatus status);

/**
* Notifies the layout is going to open.
*/
void onPreOpen();

/**
* Notifies the layout is going to equal close size.
*/
void onPreClose();

/**
* Notifies the layout opened.
*/
void onOpened();

/**
* Notifies the layout size equal closed size.
*/
void onClosed();

Reference

No. Link
1. Read more here.
2. Follow code author here.