Skip to content

Commit

Permalink
Resolved #357 - Allow usage of Parcelable for IHeaders and IFlexible
Browse files Browse the repository at this point in the history
If you pass the Items or Headers to an Intent as a Parcelable the headers
are recreated as different instances and are shown above each item and not
the whole group. The reason for this of the usage of reference equality
check. We need to use the equal() to fix this issue.
  • Loading branch information
long1eu authored and davideas committed May 7, 2017
1 parent 21f94e1 commit 61a58e0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ private void showAllHeadersWithReset(boolean init) {
T item = getItem(position);
// Reset hidden status! Necessary after the filter and the update
IHeader header = getHeaderOf(item);
if (header != sameHeader && header != null && !isExpandable((T) header)) {
if (!header.equals(sameHeader) && header != null && !isExpandable((T) header)) {
sameHeader = header;
header.setHidden(true);
}
Expand Down Expand Up @@ -4220,7 +4220,7 @@ private void resetFilterFlags(List<T> items) {
// Restore headers visibility
if (headersShown) {
IHeader header = getHeaderOf(item);
if (header != sameHeader && header != null && !isExpandable((T) header)) {
if (!header.equals(sameHeader) && header != null && !isExpandable((T) header)) {
header.setHidden(false);
sameHeader = header;
items.add(i, (T) header);
Expand Down Expand Up @@ -5503,7 +5503,7 @@ private void prepareItemsForUpdate(List<T> newItems) {
headersShown = true;
}
IHeader header = getHeaderOf(item);
if (header != sameHeader && header != null && !isExpandable((T) header)) {
if (header.equals(sameHeader) && header != null && !isExpandable((T) header)) {
header.setHidden(false);
sameHeader = header;
newItems.add(position, (T) header);
Expand Down

0 comments on commit 61a58e0

Please sign in to comment.