44import android .os .Bundle ;
55import android .util .Log ;
66import android .view .View ;
7+ import android .view .animation .OvershootInterpolator ;
78import android .widget .Button ;
89
910import at .blogc .android .views .ExpandableTextView ;
@@ -28,8 +29,9 @@ public class MainActivity extends AppCompatActivity
2829{
2930 private static final String TAG = "ExpandableTextView" ;
3031
32+ @ SuppressWarnings ("ConstantConditions" )
3133 @ Override
32- protected void onCreate (Bundle savedInstanceState )
34+ protected void onCreate (final Bundle savedInstanceState )
3335 {
3436 super .onCreate (savedInstanceState );
3537 this .setContentView (R .layout .activity_main );
@@ -40,9 +42,17 @@ protected void onCreate(Bundle savedInstanceState)
4042 // set animation duration via code, but preferable in your layout files by using the animation_duration attribute
4143 expandableTextView .setAnimationDuration (750L );
4244
45+ // set interpolators for both expanding and collapsing animations
46+ expandableTextView .setInterpolator (new OvershootInterpolator ());
47+
48+ // or set them separately
49+ expandableTextView .setExpandInterpolator (new OvershootInterpolator ());
50+ expandableTextView .setCollapseInterpolator (new OvershootInterpolator ());
51+
4352 // toggle the ExpandableTextView
4453 buttonToggle .setOnClickListener (new View .OnClickListener ()
4554 {
55+ @ SuppressWarnings ("ConstantConditions" )
4656 @ Override
4757 public void onClick (final View v )
4858 {
0 commit comments