Skip to content

Commit 1869901

Browse files
author
Shrikanth Ravi
authored
Merge pull request #9 from tomdaniel-it/master
Fix bug: setState didn't modify the expanded variable.
2 parents 21a07a7 + 3bb1820 commit 1869901

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

collapsiblecalendarview2/src/main/java/com/shrikanthravi/collapsiblecalendarview/widget/CollapsibleCalendar.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ public void onClick(View view) {
111111
else{
112112
expand(400);
113113
}
114-
expanded = !expanded;
115-
116114
}
117115
});
118116

@@ -543,6 +541,17 @@ protected void applyTransformation(float interpolatedTime, Transformation t) {
543541
expandIconView.setState(ExpandIconView.LESS,true);
544542
}
545543

544+
@Override
545+
public void setState(int state) {
546+
super.setState(state);
547+
if(state == STATE_COLLAPSED) {
548+
expanded = false;
549+
}
550+
if(state == STATE_EXPANDED) {
551+
expanded = true;
552+
}
553+
}
554+
546555
public void select(Day day) {
547556
setSelectedItem(new Day(day.getYear(), day.getMonth(), day.getDay()));
548557

0 commit comments

Comments
 (0)