1 /*
2  * Copyright 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.compose.foundation.lazy
18 
19 /**
20  * Contains useful information about an individual item in lazy lists like [LazyColumn] or
21  * [LazyRow].
22  *
23  * @see LazyListLayoutInfo
24  */
25 interface LazyListItemInfo {
26     /** The index of the item in the list. */
27     val index: Int
28 
29     /** The key of the item which was passed to the item() or items() function. */
30     val key: Any
31 
32     /**
33      * The main axis offset of the item in pixels. It is relative to the start of the lazy list
34      * container.
35      */
36     val offset: Int
37 
38     /**
39      * The main axis size of the item in pixels. Note that if you emit multiple layouts in the
40      * composable slot for the item then this size will be calculated as the sum of their sizes.
41      */
42     val size: Int
43 
44     /** The content type of the item which was passed to the item() or items() function. */
45     val contentType: Any?
46         get() = null
47 }
48