Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lastActiveItemIndex public, so selection on hover can be implemented #201

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions foundation/api/foundation.api
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,15 @@ public final class org/jetbrains/jewel/foundation/lazy/SelectableLazyListState :
public final fun getFirstVisibleItemIndex ()I
public final fun getFirstVisibleItemScrollOffset ()I
public final fun getInteractionSource ()Landroidx/compose/foundation/interaction/InteractionSource;
public final fun getLastActiveItemIndex ()Ljava/lang/Integer;
public final fun getLayoutInfo ()Landroidx/compose/foundation/lazy/LazyListLayoutInfo;
public final fun getLazyListState ()Landroidx/compose/foundation/lazy/LazyListState;
public fun getSelectedKeys ()Ljava/util/List;
public fun isScrollInProgress ()Z
public fun scroll (Landroidx/compose/foundation/MutatePriority;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun scrollToItem (IZILkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun scrollToItem$default (Lorg/jetbrains/jewel/foundation/lazy/SelectableLazyListState;IZILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public final fun setLastActiveItemIndex (Ljava/lang/Integer;)V
public fun setSelectedKeys (Ljava/util/List;)V
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SelectableLazyListState(
internal var lastKeyEventUsedMouse: Boolean = false

override var selectedKeys by mutableStateOf(emptyList<Any>())
internal var lastActiveItemIndex: Int? = null
var lastActiveItemIndex: Int? = null

/**
*
Expand Down