mirror of
https://github.com/imcarlost/Acronyms.git
synced 2026-04-10 02:46:53 -04:00
Add: Main app, main activity and navigation handling
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package dev.carlos.acronyms.viewmodel
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.IdRes
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import dev.carlos.core.navigation.NavigationEvent
|
||||
|
||||
class NavigationViewmodel : ViewModel() {
|
||||
|
||||
val navigate = MutableLiveData<Pair<@IdRes Int, Bundle>>()
|
||||
|
||||
fun onNavigationEvent(event: NavigationEvent) {
|
||||
when (event) {
|
||||
else -> throw NoWhenBranchMatchedException("Undefined navigation event parent")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user