Skip to content

Instantly share code, notes, and snippets.

View wrozwad's full-sized avatar

Wojciech Rozwadowski wrozwad

View GitHub Profile
@svenjacobs
svenjacobs / ContentLoadingLayout.kt
Created January 6, 2022 10:08
A composable inspired by ContentLoadingProgressBar
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import kotlinx.coroutines.delay
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
/**
* Inspired by View-based [ContentLoadingProgressBar](https://developer.android.com/reference/androidx/core/widget/ContentLoadingProgressBar).
*
* Waits `minDelayDuration` until contents of `loading` composable is shown when `isLoading` is