-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathScreen.kt
More file actions
34 lines (28 loc) · 911 Bytes
/
Screen.kt
File metadata and controls
34 lines (28 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* SPDX-FileCopyrightText: 2026 NewPipe e.V. <https://newpipe-ev.de>
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package net.newpipe.app.navigation
import androidx.navigation3.runtime.NavKey
import androidx.savedstate.serialization.SavedStateConfiguration
import kotlinx.serialization.Serializable
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.polymorphic
/**
* Destinations for navigation in compose
*/
@Serializable
sealed class Screen : NavKey {
@Serializable
data object About: Screen()
companion object {
val config = SavedStateConfiguration {
serializersModule = SerializersModule {
polymorphic(NavKey::class) {
// TODO: Add all subclasses using a for-each loop
subclass(About::class, About.serializer())
}
}
}
}
}