Skip to content

Instantly share code, notes, and snippets.

View VitalyPeryatin's full-sized avatar
🎯
Focusing

Vitaly Peryatin VitalyPeryatin

🎯
Focusing
View GitHub Profile
class AppActivity : BaseActivity() {
private val viewModel: AppViewModel by viewModel()
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
tryOpenScreenChain(intent)
}
private fun tryOpenScreenChain(intent: Intent?) {
class AppViewModel(
...
): BaseViewModel() {
private val _pendingNavigationRoutes = Channel<List<String>>(
capacity = 1,
onBufferOverflow = BufferOverflow.DROP_LATEST
)
fun tryOpenScreenChain(routes: List<String>) {
abstract class Destination(
...
) {
private var parcelableArguments: HashMap<String, Parcelable> = hashMapOf()
protected fun saveParcelableArgument(key: String, argument: Parcelable) {
parcelableArguments[key] = argument
}
@Suppress("UNCHECKED_CAST")