replace do while loop in getHeaderPositionForItem with while loop

Signed-off-by: alex <[email protected]>
Signed-off-by: Andy Scherzinger <[email protected]>
This commit is contained in:
alex authored and Andy Scherzinger committed 2019-08-20 16:48:31 +02:00
1 parent 1dd2a5a71c
commit 5a3db5ef2b
1 file changed
+4 -5
@@ -429,17 +429,16 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
@Override
public int getHeaderPositionForItem(int itemPosition) {
int headerPosition = 0;
do {
while (itemPosition >= 0) {
if (this.isHeader(itemPosition)) {
headerPosition = itemPosition;
break;
}
itemPosition -= 1;
} while (itemPosition >= 0);
return headerPosition;
}
return itemPosition;
}
@Override
public int getHeaderLayout(int headerPosition) {
return R.layout.activity_list_item_header;