This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle | |
import androidx.lifecycle.AbstractSavedStateViewModelFactory | |
import androidx.lifecycle.SavedStateHandle | |
import androidx.lifecycle.ViewModel | |
import androidx.savedstate.SavedStateRegistryOwner | |
// The actual ViewModelFactory. | |
class DaggerViewModelFactory( | |
private val assistedViewModelFactory: AssistedViewModelFactory<ViewModel>, | |
owner: SavedStateRegistryOwner, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kotlin.collections | |
inline fun <T> Array<out T>.takeWhileInclusive( | |
predicate: (T) -> Boolean | |
): List<T> { | |
var shouldContinue = true | |
return takeWhile { | |
val result = shouldContinue | |
shouldContinue = predicate(it) | |
result |