# 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)

*** ** * ** ***


```
public 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 |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/leanback/system/Settings#OUTLINE_CLIPPING_DISABLED() = "OUTLINE_CLIPPING_DISABLED"` |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/leanback/system/Settings#PREFER_STATIC_SHADOWS() = "PREFER_STATIC_SHADOWS"` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/leanback/system/Settings#getBoolean(java.lang.String)(https://developer.android.com/reference/java/lang/String.html key)` Returns the boolean preference for the given key. |
| `static https://developer.android.com/reference/androidx/leanback/system/Settings` | `https://developer.android.com/reference/androidx/leanback/system/Settings#getInstance(android.content.Context)(https://developer.android.com/reference/android/content/Context.html context)` Returns the singleton Settings instance. |
| `void` | `https://developer.android.com/reference/androidx/leanback/system/Settings#setBoolean(java.lang.String,boolean)(https://developer.android.com/reference/java/lang/String.html key, boolean value)` 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)

```
public static final String OUTLINE_CLIPPING_DISABLED = "OUTLINE_CLIPPING_DISABLED"
```

### PREFER_STATIC_SHADOWS

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

```
public static final String PREFER_STATIC_SHADOWS = "PREFER_STATIC_SHADOWS"
```

## Public methods

### getBoolean

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

```
public boolean getBoolean(String key)
```

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)

```
public static Settings getInstance(Context context)
```

Returns the singleton Settings instance.

### setBoolean

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

```
public void setBoolean(String key, boolean value)
```

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.