# Settings

# Settings

Artifact:[androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback)  
[View Source](https://cs.android.com/search?q=file:androidx/leanback/system/Settings.java+class:androidx.leanback.system.Settings)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/leanback/system/Settings "View this page in Java")

<br />

```
class Settings
```

<br />

*** ** * ** ***

Provides various preferences affecting Leanback runtime behavior.

Note this class is not thread safe and its methods should only be invoked from the UI thread

## Summary

|                                        ### Constants                                         |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [OUTLINE_CLIPPING_DISABLED](https://developer.android.com/reference/kotlin/androidx/leanback/system/Settings#OUTLINE_CLIPPING_DISABLED())` = "OUTLINE_CLIPPING_DISABLED"` |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [PREFER_STATIC_SHADOWS](https://developer.android.com/reference/kotlin/androidx/leanback/system/Settings#PREFER_STATIC_SHADOWS())` = "PREFER_STATIC_SHADOWS"`             |

|                                             ### Public functions                                              |
|---------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                           | [getBoolean](https://developer.android.com/reference/kotlin/androidx/leanback/system/Settings#getBoolean(java.lang.String))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Returns the boolean preference for the given key.                                                                                                    |
| `java-static `[Settings](https://developer.android.com/reference/kotlin/androidx/leanback/system/Settings)`!` | [getInstance](https://developer.android.com/reference/kotlin/androidx/leanback/system/Settings#getInstance(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!)` Returns the singleton Settings instance.                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                 | [setBoolean](https://developer.android.com/reference/kotlin/androidx/leanback/system/Settings#setBoolean(java.lang.String,boolean))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets the boolean preference for the given key. |

## Constants

### OUTLINE_CLIPPING_DISABLED

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

```
const val OUTLINE_CLIPPING_DISABLED = "OUTLINE_CLIPPING_DISABLED": String!
```  

### PREFER_STATIC_SHADOWS

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

```
const val PREFER_STATIC_SHADOWS = "PREFER_STATIC_SHADOWS": String!
```  

## Public functions

### getBoolean

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

```
fun getBoolean(key: String!): Boolean
```

Returns the boolean preference for the given key.  

### getInstance

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

```
java-static fun getInstance(context: Context!): Settings!
```

Returns the singleton Settings instance.  

### setBoolean

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

```
fun setBoolean(key: String!, value: Boolean): Unit
```

Sets the boolean preference for the given key. If an app uses this api to override a default preference, it must do so on every activity create.