-
- All Implemented Interfaces:
-
kotlin.collections.Collection,kotlin.collections.Iterable,kotlin.collections.List
public final class ExpandableList<T extends Object> implements List<T>
A read-only, immutable list wrapper that supports expandable and collapsible behavior.
This class behaves like a standard List but adds metadata and logic to control visibility of its elements based on a specified minimumVisibleItems threshold and current isCollapsed state.
When isCollapsed is
trueand the total item count exceeds minimumVisibleItems, only the first minimumVisibleItems items are exposed through the list interface. The remaining items are considered collapsed.When isCollapsed is
false, all items are exposed.If the total number of items is less than or equal to minimumVisibleItems, all items are shown, and the list is not expandable.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleancanExpandprivate final IntegercollapsedCountprivate final BooleanisCollapsedprivate final Integersize
-
Constructor Summary
Constructors Constructor Description ExpandableList(List<T> items, Integer minimumVisibleItems, Boolean isCollapsed)
-
Method Summary
Modifier and Type Method Description final BooleangetCanExpand()Indicates whether the list can be expanded or collapsed, i.e. final IntegergetCollapsedCount()The number of items that are currently collapsed (not visible). final BooleangetIsCollapsed()IntegergetSize()-
Methods inherited from class io.getstream.chat.android.ui.common.utils.ExpandableList
addFirst, addLast, contains, containsAll, get, getFirst, getLast, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeFirst, removeLast, reversed, spliterator, subList -
Methods inherited from class kotlin.collections.Collection
forEach -
Methods inherited from class kotlin.collections.List
parallelStream, stream, toArray -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getCanExpand
final Boolean getCanExpand()
Indicates whether the list can be expanded or collapsed, i.e., when the number of items exceeds minimumVisibleItems.
-
getCollapsedCount
final Integer getCollapsedCount()
The number of items that are currently collapsed (not visible). Returns
0if the list is expanded or cannot be expanded.
-
getIsCollapsed
final Boolean getIsCollapsed()
-
-
-
-