getSafeArea

fun getSafeArea(    referenceView: View,     safeAreaView: View,     padding: Int = 0,     animateSafeAreaUpdates: Boolean = false): LiveData<SafeArea?>

Returns a LiveData that contains the SafeArea to apply to referenceView. The SafeArea is calculated based on the size and location of referenceView and safeAreaView within a common parent.

Parameters

referenceView

The view for which SafeArea is calculated.

safeAreaView

The view that represents the safe area.

padding

The padding for the safe area.

animateSafeAreaUpdates

When true transitions from one safe area to another will be animated.

Throws

if views have different parents.