# UI settings

> **Note (legacy): A newer version of the Maps SDK is available**
> 
> This page uses v9.7.1 of the Mapbox Maps SDK. A newer version of the SDK is available. Learn about the latest version, v11.29.0, in the [Maps SDK documentation](https://docs.mapbox.com/android/maps/guides/).

The Mapbox Maps SDK for Android gives developers the ability to adjust certain elements of the map's user interface (UI). Once a `MapboxMap` has been correctly set up, get its `UiSettings` object.

**Java**

```java

mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
	@Override
	public void onStyleLoaded(@NonNull Style style) {

		UiSettings uiSettings = mapboxMap.getUiSettings();


	}
});
```

**Kotlin**

```kt

mapboxMap.setStyle(Style.MAPBOX_STREETS) {

	val uiSettings = mapboxMap.uiSettings

}
```

Make changes to gesture recognition, the compass, the Mapbox logo, and attribution after you have the `UiSettings` object. Changes made to `UiSettings` are immediately reflected on the map.

You can also configure the UI settings with [the Maps SDK's XML attributes](https://docs.mapbox.com/android/legacy/maps/guides/#mapview-xml-attributes) instead of the `UiSettings` class' methods.

All the UI settings also have "get" methods that allow you to see the current settings (for example, if the compass is enabled, what the logo's margins are, or what the custom compass image is).

**Java**

```java

mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
	@Override
	public void onStyleLoaded(@NonNull Style style) {

		UiSettings uiSettings = mapboxMap.getUiSettings();

		uiSettings.areAllGesturesEnabled();

	}
});
```

**Kotlin**

```kt

mapboxMap.setStyle(Style.MAPBOX_STREETS) {

	val uiSettings = mapboxMap.uiSettings

	uiSettings.areAllGesturesEnabled()

}
```

## Gestures

The Mapbox Maps SDK for Android uses [the Mapbox Gestures for Android library](https://docs.mapbox.com/android/legacy/maps/guides/gestures/) to detect gestures.

Adjust or completely disable zoom, tilt, scroll, rotate, quick zoom, and double tap gesture recognition. Disabling map gestures doesn't affect whether you can change the camera position programmatically.

For example, here's how you would disable the ability to increase the zoom level by double tapping on the map:

**Java**

```java

mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
	@Override
	public void onStyleLoaded(@NonNull Style style) {

		UiSettings uiSettings = mapboxMap.getUiSettings();

		uiSettings.setDoubleTapGesturesEnabled(false);

	}
});
```

**Kotlin**

```kt

mapboxMap.setStyle(Style.MAPBOX_STREETS) {

	val uiSettings = mapboxMap.uiSettings

	uiSettings.isDoubleTapGesturesEnabled = false

}
```

See the [map camera position documentation](https://docs.mapbox.com/android/legacy/maps/guides/camera/#camera-position) for more information about how gestures can affect camera position.

## Compass

The Maps SDK contains a compass image, which appears on the map when the map is rotated in any direction. The compass *doesn't* represent the physical device's relation to the magnetic north pole. The compass image rotates based on the on-screen map rotation.

When the user clicks on the compass image, the camera animates back to the default north orientation (bearing of 0) and the compass image fades away shortly afterwards.

By default, the compass appears in the upper right hand corner of the `MapView`, but its margins can be adjusted. A custom drawable image can be passed to the Maps SDK to replace the default image.

Another option is to completely disable the compass:

**Java**

```java

mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
	@Override
	public void onStyleLoaded(@NonNull Style style) {

		UiSettings uiSettings = mapboxMap.getUiSettings();

		uiSettings.setCompassEnabled(false);

	}
});
```

**Kotlin**

```kt

mapboxMap.setStyle(Style.MAPBOX_STREETS) {

	val uiSettings = mapboxMap.uiSettings

	uiSettings.isCompassEnabled = false

}
```

## Logo and attribution

Read [Mapbox's attribution policy](https://docs.mapbox.com/android/legacy/maps/guides/#attribution) for information on displaying the Mapbox wordmark logo and attribution.

The logo's properties such as margins and gravity can be adjusted with XML or the `UiSettings` object. The attribution `i` icon's properties such as tint, margins, and gravity can also be adjusted with XML or the `UiSettings` object.

> **Related content (example): [Attribution icon color](https://docs.mapbox.com/android/legacy/maps/examples/change-attribution-color/)**
> 
> See how to customize the attribution `i` icon's color to match a map style or stand out from the style color.