Skip to content

Commit 7462ed6

Browse files
committed
update demo Activity with interpolators
1 parent 73eef33 commit 7462ed6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/src/main/java/at/blogc/android/activities/MainActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.os.Bundle;
55
import android.util.Log;
66
import android.view.View;
7+
import android.view.animation.OvershootInterpolator;
78
import android.widget.Button;
89

910
import at.blogc.android.views.ExpandableTextView;
@@ -40,6 +41,13 @@ protected void onCreate(Bundle savedInstanceState)
4041
// set animation duration via code, but preferable in your layout files by using the animation_duration attribute
4142
expandableTextView.setAnimationDuration(750L);
4243

44+
// set interpolators for both expanding and collapsing animations
45+
expandableTextView.setInterpolator(new OvershootInterpolator());
46+
47+
// or set them separately
48+
expandableTextView.setExpandInterpolator(new OvershootInterpolator());
49+
expandableTextView.setCollapseInterpolator(new OvershootInterpolator());
50+
4351
// toggle the ExpandableTextView
4452
buttonToggle.setOnClickListener(new View.OnClickListener()
4553
{

0 commit comments

Comments
 (0)