---
title: "UnobstructedArea"
canonical_url: https://developer.repebble.com/docs/c/User_Interface/UnobstructedArea/
last_updated: 2026-10-28
sdk_version: 4.33.1
---
# UnobstructedArea

Source: https://developer.repebble.com/docs/c/User_Interface/UnobstructedArea/

Events about when the app's unobstructed area changes for visually adapting

Unobstructed Area enables a watchface to adapt to overlays partially obstructing it. Timeline Peek is the only overlay, and it partially obstructs the bottom of watchfaces, displaying the immediately upcoming or newly began event. Unobstructed Area is for use only with watchfaces. There will be no Unobstructed Area events emitted for apps that are not watchfaces. Timeline Peek is also limited to rectangular platforms, thus using Unobstructed Area on Chalk will also result in no events.

Watchfaces are encouraged to respect Unobstructed Area in order to dynamically resize within the remaining screen area that isn't obstructed by an overlay. Unobstructed Area provides handlers for when the screen area will begin and end changing as well as progress for every frame of the animation, allowing one to animate the watchface to resize while the overlay animates into or out of the screen. Additionally, at any point, a watchface can query the Unobstructed Area using [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds) even if there was not event or if it didn't subscribe to them.

The simplest usage of Unobstructed Area is to change rendering of your watchface to render within the unobstructed bounds obtained by [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds). This is accomplished by modifying your layer update procedure that you setup a layer with using [layer\_set\_update\_proc](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_set_update_proc) to use [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds) instead of [layer\_get\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_bounds) or [layer\_get\_frame](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_frame) and adjusting all the rendering logic within it to handle resizing bounds. The app will redraw automatically whenever the Unobstructed Area changes, even if you did not subscribe to the events.

Subscribing to `will_change`, `change`, and `did_change` events with app\_unobstructed\_area\_service\_subscribe will allow you to obtain the final unobstructed area as soon as the animation begins and the current animation progress for each frame as they occur should you need that information to resize your watchface.

When designing your watchface resizing logic or animation, take into consideration the way Timeline Peek animates. Timeline Peek appears from the bottom with an animation that moves slightly at first and snaps across with a bounce back. Because there is a bounce back in the animation, there will be momentary frames where the unobstructed area is slightly smaller than when Timeline Peek is visible but not animating.

If you intend to hide or show layers on the screen depending on the unobstructed area, there are two ways to do this. For anything inside a layer update procedure the simple solution would be sufficient. That is, in your update procedure, you can to determine whether something is to be rendered or not based on the remaining height available to you determined from [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds).

The other method for deciding whether to show or hide layers is to subscribe to events using app\_unobstructed\_area\_service\_subscribe. Note that hiding or showing elements in your `will_change` can be too early due to the nature of the Timeline Peek animation where it moves slowly in the first few frames. After judging the animation visually, you may instead show or hide your layers based on both the final unobstructed area obtained from `will_change` in combination with the progress obtained from `change`, or check the current height available to you by calling [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds) in your `change` handler to update your state.

For more advance usages such as functionally defined animations whose animation frames are a function of animation progress, you will want to subscribe to `will_change`, `change`, and optionally `did_change` events if you need to clean up resources or layers created in your `will_change` handler. For example, in your `will_change` handler, you may use [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds) to get the current unobstructed area, and combine it with the final unobstructed area passed into `will_change` to set up a [PropertyAnimation](https://developer.repebble.com/docs/c/User_Interface/Animation/PropertyAnimation.md). A separate example would be to save the animation progress passed to your `change` handler for use in your own custom easing curve in your layer update procedure.

## Function Documentation

void unobstructed\_area\_service\_subscribe(UnobstructedAreaHandlers handlers, void \* context)

Subscribe to be notified when the app's unobstructed area changes. When an unobstructed area begins changing, the `will_change` handler will be called, and every `will_change` call is always paired with a `did_change` call that occurs when it is done changing given that the `will_change` and `did_change` handlers are set. When subscribing while the unobstructed area is changing, the `will_change` handler will be called after subscription in the next event loop.

#### Parameters
 handlers

The handlers that should be called when the unobstructed area changes.

 context

A user-provided context that will be passed to the callback handlers.

#### See Also
[layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds)

void unobstructed\_area\_service\_unsubscribe(void)

Unsubscribe from notifications about changes to the app's unobstructed area.

## Data Structure Documentation

struct UnobstructedAreaHandlers

#### Data Fields
[UnobstructedAreaWillChangeHandler](https://developer.repebble.com/docs/c/User_Interface/UnobstructedArea.md#UnobstructedAreaWillChangeHandler) will\_change

Handler that will be called just before the unobstructed area will begin changing.

[UnobstructedAreaChangeHandler](https://developer.repebble.com/docs/c/User_Interface/UnobstructedArea.md#UnobstructedAreaChangeHandler) change

Handler that will be called every time the unobstructed area changes.

[UnobstructedAreaDidChangeHandler](https://developer.repebble.com/docs/c/User_Interface/UnobstructedArea.md#UnobstructedAreaDidChangeHandler) did\_change

Handler that will be called after the unobstructed area has finished changing.

## Typedef Documentation

 typedef void(\* UnobstructedAreaWillChangeHandler)(GRect final\_unobstructed\_screen\_area, void \*context) 

Handler that will be called just before the unobstructed area will begin changing.

#### Parameters
 final\_unobstructed\_screen\_area

The final unobstructed screen area after the unobstructed area has finished changing.

 context

A user-provided context.

 typedef void(\* UnobstructedAreaChangeHandler)(AnimationProgress progress, void \*context) 

Handler that will be called every time the unobstructed area changes.

#### Parameters
 progress

The progress of the animation changing the unobstructed area.

 context

A user-provided context.

 typedef void(\* UnobstructedAreaDidChangeHandler)(void \*context) 

Handler that will be called after the unobstructed area has finished changing.

#### Parameters
 context

A user-provided context.
