ContentCardsWindowInsetsApplier

internal class ContentCardsWindowInsetsApplier(val contentCardsRecyclerView: RecyclerView, val contentCardsSwipeLayout: SwipeRefreshLayout?)

Offsets the Content Cards feed by the safe area of the window so that cards and the refresh indicator stay clear of the system bars and the display cutout.

The original padding of the RecyclerView and the original offsets of the SwipeRefreshLayout indicator are captured once, then the insets are added on top of them. Repeat calls with different inset values, for example after a rotation, are therefore idempotent.

Constructors

Link copied to clipboard
constructor(contentCardsRecyclerView: RecyclerView, contentCardsSwipeLayout: SwipeRefreshLayout?)

Properties

Link copied to clipboard
private val basePadding: @NonNull Insets
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Applies the safe area of windowInsets to the feed.

Link copied to clipboard
private fun offsetProgressView(topInset: Int)

Moves the refresh indicator down by topInset.

Link copied to clipboard
fun reset()

Restores the padding and the refresh indicator offsets that the feed had before any insets were applied.