-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reinforce example for navigation & args
- Loading branch information
1 parent
fef2f39
commit d18a974
Showing
6 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
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
9 changes: 0 additions & 9 deletions
9
examples/androidx-samples/src/main/java/org/koin/sample/sandbox/navigation/MainViewModel.kt
This file was deleted.
Oops, something went wrong.
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
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
17 changes: 17 additions & 0 deletions
17
examples/androidx-samples/src/main/java/org/koin/sample/sandbox/navigation/NavViewModel.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.koin.sample.sandbox.navigation | ||
|
||
import androidx.lifecycle.SavedStateHandle | ||
import androidx.lifecycle.ViewModel | ||
import java.util.* | ||
|
||
class NavViewModel(private val savedStateHandle: SavedStateHandle) : ViewModel(){ | ||
|
||
init { | ||
println("* NavViewModel *") | ||
} | ||
|
||
val id : String = UUID.randomUUID().toString() | ||
override fun toString(): String = "NavViewModel[id:$id]" | ||
|
||
val argument: String? = savedStateHandle.get<String>("argKey") | ||
} |
17 changes: 17 additions & 0 deletions
17
examples/androidx-samples/src/main/java/org/koin/sample/sandbox/navigation/NavViewModel2.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.koin.sample.sandbox.navigation | ||
|
||
import androidx.lifecycle.SavedStateHandle | ||
import androidx.lifecycle.ViewModel | ||
import java.util.* | ||
|
||
class NavViewModel2(private val savedStateHandle: SavedStateHandle) : ViewModel(){ | ||
|
||
init { | ||
println("* NavViewModel2 *") | ||
} | ||
|
||
val id : String = UUID.randomUUID().toString() | ||
override fun toString(): String = "NavViewModel2[id:$id]" | ||
|
||
val argument: String? = savedStateHandle.get<String>("argKey") | ||
} |