---
title: "LazyLayoutIntervalContent"
description: "Common parts backing the interval-based content of lazy layout defined through `item` DSL.

Note: this class is a part of [LazyLayout] harness that allows for building custom lazy layouts.
LazyLayout and all corresponding APIs are still under development and are subject to change."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
abstract class LazyLayoutIntervalContent<Interval : LazyLayoutIntervalContent.Interval>
```


Common parts backing the interval-based content of lazy layout defined through `item` DSL.

Note: this class is a part of `LazyLayout` harness that allows for building custom lazy layouts.
LazyLayout and all corresponding APIs are still under development and are subject to change.


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
abstract val intervals: IntervalList<Interval>
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
val itemCount: Int
```


The total amount of items in all the intervals.



## Functions

```kotlin
fun getKey(index: Int): Any
```


Returns item key based on a global index.


```kotlin
fun getContentType(index: Int): Any?
```


Returns content type based on a global index.


```kotlin
inline fun <T> withInterval(
        globalIndex: Int,
        block: (localIntervalIndex: Int, content: Interval) -> T,
    ): T
```


Runs a `block` on the content of the interval associated with the provided `globalIndex` with
providing a local index in the given interval.



