-
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.
[Paywalls V2] Parses UiConfig (#2068)
- Loading branch information
1 parent
12569a6
commit 208bcd8
Showing
27 changed files
with
945 additions
and
61 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
81 changes: 81 additions & 0 deletions
81
purchases/src/main/kotlin/com/revenuecat/purchases/UiConfig.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,81 @@ | ||
package com.revenuecat.purchases | ||
|
||
import com.revenuecat.purchases.paywalls.components.common.LocaleId | ||
import com.revenuecat.purchases.paywalls.components.common.LocalizedVariableLocalizationKeyMapSerializer | ||
import com.revenuecat.purchases.paywalls.components.common.VariableLocalizationKey | ||
import com.revenuecat.purchases.paywalls.components.properties.ColorScheme | ||
import dev.drewhamilton.poko.Poko | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@InternalRevenueCatAPI | ||
@Serializable | ||
@JvmInline | ||
value class ColorAlias(@get:JvmSynthetic val value: String) | ||
|
||
@InternalRevenueCatAPI | ||
@Serializable | ||
@JvmInline | ||
value class FontAlias(@get:JvmSynthetic val value: String) | ||
|
||
@InternalRevenueCatAPI | ||
@Poko | ||
@Serializable | ||
class UiConfig( | ||
@get:JvmSynthetic | ||
val app: AppConfig = AppConfig(), | ||
@Serializable(with = LocalizedVariableLocalizationKeyMapSerializer::class) | ||
@get:JvmSynthetic | ||
val localizations: Map<LocaleId, Map<VariableLocalizationKey, String>> = emptyMap(), | ||
@SerialName("variable_config") | ||
@get:JvmSynthetic | ||
val variableConfig: VariableConfig = VariableConfig(), | ||
) { | ||
|
||
@InternalRevenueCatAPI | ||
@Poko | ||
@Serializable | ||
class AppConfig( | ||
@get:JvmSynthetic | ||
val colors: Map<ColorAlias, ColorScheme> = emptyMap(), | ||
@get:JvmSynthetic | ||
val fonts: Map<FontAlias, FontsConfig> = emptyMap(), | ||
) { | ||
@InternalRevenueCatAPI | ||
@Poko | ||
@Serializable | ||
class FontsConfig( | ||
@get:JvmSynthetic | ||
val android: FontInfo, | ||
) { | ||
|
||
@InternalRevenueCatAPI | ||
@Serializable | ||
sealed interface FontInfo { | ||
@InternalRevenueCatAPI | ||
@Poko | ||
@Serializable | ||
@SerialName("name") | ||
class Name(@get:JvmSynthetic val value: String) : FontInfo | ||
|
||
@InternalRevenueCatAPI | ||
@Poko | ||
@Serializable | ||
@SerialName("google_fonts") | ||
class GoogleFonts(@get:JvmSynthetic val value: String) : FontInfo | ||
} | ||
} | ||
} | ||
|
||
@InternalRevenueCatAPI | ||
@Poko | ||
@Serializable | ||
class VariableConfig( | ||
@SerialName("variable_compatibility_map") | ||
@get:JvmSynthetic | ||
val variableCompatibilityMap: Map<String, String> = emptyMap(), | ||
@SerialName("function_compatibility_map") | ||
@get:JvmSynthetic | ||
val functionCompatibilityMap: Map<String, String> = emptyMap(), | ||
) | ||
} |
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
Oops, something went wrong.