-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Migrate to type-safe navigation framework (#162)
* Migrated from navigating with parameters to type-safe navigation * Completely migrated to type safe navigation Handled multiple times screen navigation on tap of Home from drawer * Removed Any from NavGraph and implemented type safety and static type checking at compile time. * Removed Gradle migration to type-safe navigation comment line. *Added back Header Comment in NormalScreens file. --------- Signed-off-by: imrannextgeni021 <[email protected]>
- Loading branch information
1 parent
7e2fab5
commit 7f662bc
Showing
16 changed files
with
149 additions
and
173 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
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
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
61 changes: 61 additions & 0 deletions
61
app/src/main/java/com/starry/greenstash/ui/navigation/NormalScreens.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,61 @@ | ||
/** | ||
* MIT License | ||
* | ||
* Copyright (c) [2022 - Present] Stɑrry Shivɑm | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
|
||
|
||
package com.starry.greenstash.ui.navigation | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
sealed class NormalScreens : Screen() { | ||
|
||
@Serializable | ||
data class DWScreen(val goalId: String, val transactionType: String) | ||
|
||
@Serializable | ||
data class InputScreen(val goalId: String? = null) | ||
|
||
@Serializable | ||
data class GoalInfoScreen(val goalId: String) | ||
|
||
@Serializable | ||
data object AboutScreen | ||
|
||
@Serializable | ||
data object OSLScreen | ||
|
||
@Serializable | ||
data object GoalCardStyleScreen | ||
|
||
|
||
// Goal Achieved Screen | ||
@Serializable | ||
data object CongratsScreen | ||
|
||
// Welcome / Onboarding Screen | ||
@Serializable | ||
data object WelcomeScreen : NormalScreens() | ||
} | ||
|
||
|
4 changes: 4 additions & 0 deletions
4
app/src/main/java/com/starry/greenstash/ui/navigation/Screen.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,4 @@ | ||
package com.starry.greenstash.ui.navigation | ||
|
||
|
||
open class Screen |
Oops, something went wrong.