# ConcatAdapter.Config

# ConcatAdapter.Config

Artifact: [androidx.recyclerview:recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview)  
[View Source](https://cs.android.com/search?q=file:androidx/recyclerview/widget/ConcatAdapter.java+class:androidx.recyclerview.widget.ConcatAdapter.Config)  
Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.2.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter.Config "View this page in Java")


```
class ConcatAdapter.Config
```

<br />

*** ** * ** ***

The configuration object for a [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter).

## Summary

|                                                                                                                                                                                                           ### Nested types                                                                                                                                                                                                            |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[ConcatAdapter.Config.Builder](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.Builder) The builder for [Config](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config) class.                                                                                                                                                    |
| `enum `[ConcatAdapter.Config.StableIdMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode) Defines how [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) handle stable ids ([hasStableIds](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#hasStableIds())). |

|                                                          ### Constants                                                           |
|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[ConcatAdapter.Config](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config) | [DEFAULT](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#DEFAULT()) Default configuration for [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) where [isolateViewTypes](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#isolateViewTypes()) is set to `true` and [stableIdMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#stableIdMode()) is set to [NO_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#NO_STABLE_IDS). |

|                                                               ### Public properties                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                | [isolateViewTypes](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#isolateViewTypes()) If `false`, [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) assumes all assigned adapters share a global view type pool such that they use the same view types to refer to the same [ViewHolder](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.ViewHolder)s. |
| [ConcatAdapter.Config.StableIdMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode) | [stableIdMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#stableIdMode()) Defines whether the [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) should support stable ids or not ([hasStableIds](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#hasStableIds()).                                                                          |

## Constants

### DEFAULT

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.2.0)  

```
const val DEFAULT: ConcatAdapter.Config
```

Default configuration for [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) where [isolateViewTypes](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#isolateViewTypes()) is set to `true` and [stableIdMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config#stableIdMode()) is set to [NO_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#NO_STABLE_IDS).  

## Public properties

### isolateViewTypes

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.2.0)  

```
val isolateViewTypes: Boolean
```

If `false`, [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) assumes all assigned adapters share a global view type pool such that they use the same view types to refer to the same [ViewHolder](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.ViewHolder)s.

Setting this to `false` will allow nested adapters to share [ViewHolder](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.ViewHolder)s but it also means these adapters should not have conflicting view types ([getItemViewType](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#getItemViewType(int))) such that two different adapters return the same view type for different [ViewHolder](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.ViewHolder)s. By default, it is set to `true` which means [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) will isolate view types across adapters, preventing them from using the same [ViewHolder](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.ViewHolder)s.  

### stableIdMode

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.2.0)  

```
val stableIdMode: ConcatAdapter.Config.StableIdMode
```

Defines whether the [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) should support stable ids or not ([hasStableIds](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#hasStableIds()).

There are 3 possible options: [NO_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#NO_STABLE_IDS): In this mode, [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) ignores the stable ids reported by sub adapters. This is the default mode. [ISOLATED_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#ISOLATED_STABLE_IDS): In this mode, [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) will return `true` from [hasStableIds](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#hasStableIds()) and will **require** all added [Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter)s to have stable ids. As two different adapters may return same stable ids because they are unaware of each-other, [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) will isolate each [Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter)'s id pool from each other such that it will overwrite the reported stable id before reporting back to the [RecyclerView](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView). In this mode, the value returned from [getItemId](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.ViewHolder#getItemId()) might differ from the value returned from [getItemId](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#getItemId(int)). [SHARED_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#SHARED_STABLE_IDS): In this mode, [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) will return `true` from [hasStableIds](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#hasStableIds()) and will **require** all added [Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter)s to have stable ids. Unlike [ISOLATED_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#ISOLATED_STABLE_IDS), [ConcatAdapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter) will not override the returned item ids. In this mode, child [Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter)s must be aware of each-other and never return the same id unless an item is moved between [Adapter](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter)s. Default value is [NO_STABLE_IDS](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ConcatAdapter.Config.StableIdMode#NO_STABLE_IDS).