determine next display item using items list
closes sk22#815
This commit is contained in:
parent
77dee59b9c
commit
58f0c07357
|
@ -397,10 +397,11 @@ public abstract class StatusDisplayItem{
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<StatusDisplayItem> getDisplayItemOffset(int offset){
|
public Optional<StatusDisplayItem> getDisplayItemOffset(int offset){
|
||||||
int nextPos=getAbsoluteAdapterPosition() + offset;
|
|
||||||
List<StatusDisplayItem> displayItems=item.parentFragment.getDisplayItems();
|
List<StatusDisplayItem> displayItems=item.parentFragment.getDisplayItems();
|
||||||
return displayItems.size() > nextPos
|
int thisPos=displayItems.indexOf(item);
|
||||||
? Optional.of(displayItems.get(nextPos))
|
int offsetPos=thisPos + offset;
|
||||||
|
return displayItems.size() > offsetPos && thisPos >= 0 && offsetPos >= 0
|
||||||
|
? Optional.of(displayItems.get(offsetPos))
|
||||||
: Optional.empty();
|
: Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue