# SizeMode.Responsive

# SizeMode.Responsive

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance)  
[View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/SizeMode.kt+class:androidx.glance.appwidget.SizeMode.Responsive)  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)


```
class SizeMode.Responsive : SizeMode, PreviewSizeMode
```

<br />

*** ** * ** ***

The [GlanceAppWidget](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/GlanceAppWidget) provides a UI for a fixed set of sizes.

On Android 12 and later, the composable will be run concurrently for each size provided and the mapping from size to view will be sent to the system. The framework will then decide which view to display based on the current size of the App Widget (see [android.widget.RemoteViews](https://developer.android.com/reference/android/widget/RemoteViews.html) for details)

Before Android 12, the composable will be run concurrently for each size at which the app widget may be displayed (like for [Exact](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode.Exact)). For each size, the best view will be chosen, which is the largest one that fits in the available space, or the smallest one if none fit.

See the note in [SizeMode](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode) for more info about handling concurrent runs for multiple sizes.

## Summary

|                                                                                                                                                            ### Public constructors                                                                                                                                                            |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Responsive](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode.Responsive#Responsive(kotlin.collections.Set))`(sizes: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[DpSize](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize)`>)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode.Responsive#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode.Responsive#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode.Responsive#toString())`()`                                                                                            |

|                                                                                 ### Public properties                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[DpSize](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize)`>` | [sizes](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SizeMode.Responsive#sizes()) List of sizes to use, must not be empty. |

## Public constructors

### Responsive

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

```
Responsive(sizes: Set<DpSize>)
```  

|                                                                                           Parameters                                                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| `sizes: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[DpSize](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize)`>` | List of sizes to use, must not be empty. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### sizes

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

```
val sizes: Set<DpSize>
```

List of sizes to use, must not be empty.