@@ -55,7 +55,7 @@ Using the ExpandableTextView is very easy, it's just a regular TextView with som
5555 android : text =" @string/lorem_ipsum"
5656 android : maxLines =" 5"
5757 android : ellipsize =" end"
58- app : animation_duration =" 1000 " />
58+ app : animation_duration =" 750 " />
5959
6060 <!-- Optional parameter animation_duration: sets the duration of the expand animation -->
6161
@@ -75,7 +75,7 @@ final ExpandableTextView expandableTextView = (ExpandableTextView) this.findView
7575final Button buttonToggle = (Button ) this . findViewById(R . id. button_toggle);
7676
7777// set animation duration via code, but preferable in your layout files by using the animation_duration attribute
78- expandableTextView. setAnimationDuration(1000L );
78+ expandableTextView. setAnimationDuration(750L );
7979
8080 // set interpolators for both expanding and collapsing animations
8181expandableTextView. setInterpolator(new OvershootInterpolator ());
@@ -85,15 +85,15 @@ expandableTextView.setExpandInterpolator(new OvershootInterpolator());
8585expandableTextView. setCollapseInterpolator(new OvershootInterpolator ());
8686
8787// toggle the ExpandableTextView
88- buttonToggle. setOnClickListener(new View .OnClickListener ()
89- {
90- @Override
91- public void onClick(final View v)
88+ buttonToggle. setOnClickListener(new View .OnClickListener ()
9289 {
93- expandableTextView. toggle();
94- buttonToggle. setText(expandableTextView. isExpanded() ? R . string. collapse : R . string. expand);
95- }
96- });
90+ @Override
91+ public void onClick(final View v)
92+ {
93+ buttonToggle. setText(expandableTextView. isExpanded() ? R . string. expand : R . string. collapse);
94+ expandableTextView. toggle();
95+ }
96+ });
9797
9898// but, you can also do the checks yourself
9999buttonToggle. setOnClickListener(new View .OnClickListener ()
0 commit comments