Skip to content

Commit a29c0d6

Browse files
committed
update README and example activity
1 parent dabfbcf commit a29c0d6

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
7575
final 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
8181
expandableTextView.setInterpolator(new OvershootInterpolator());
@@ -85,15 +85,15 @@ expandableTextView.setExpandInterpolator(new OvershootInterpolator());
8585
expandableTextView.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
9999
buttonToggle.setOnClickListener(new View.OnClickListener()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ protected void onCreate(final Bundle savedInstanceState)
3737
super.onCreate(savedInstanceState);
3838
this.setContentView(R.layout.activity_main);
3939

40-
final ExpandableTextView expandableTextView = (ExpandableTextView) this.findViewById(R.id.expandableTextView);
41-
final Button buttonToggle = (Button) this.findViewById(R.id.button_toggle);
40+
final ExpandableTextView expandableTextView = this.findViewById(R.id.expandableTextView);
41+
final Button buttonToggle = this.findViewById(R.id.button_toggle);
4242

4343
// set animation duration via code, but preferable in your layout files by using the animation_duration attribute
4444
expandableTextView.setAnimationDuration(750L);

0 commit comments

Comments
 (0)