-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from superwall/develop
1.4.0
- Loading branch information
Showing
11 changed files
with
89 additions
and
3 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
15 changes: 15 additions & 0 deletions
15
android/src/main/java/com/superwallreactnative/models/InterfaceStyle.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,15 @@ | ||
package com.superwallreactnative.models | ||
|
||
import com.superwall.sdk.network.device.InterfaceStyle | ||
|
||
class InterfaceStyle { | ||
companion object { | ||
fun fromString(interfaceStyle: String): InterfaceStyle { | ||
return when (interfaceStyle) { | ||
"LIGHT" -> InterfaceStyle.LIGHT | ||
"DARK" -> InterfaceStyle.DARK | ||
else -> InterfaceStyle.LIGHT // Default case to handle unexpected values | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// InterfaceStyle+Json.swift | ||
// Superwall | ||
// | ||
// Created by Yusuf Tör on 21/02/2024. | ||
// | ||
|
||
import SuperwallKit | ||
|
||
extension InterfaceStyle { | ||
static func fromString(style: String) -> InterfaceStyle { | ||
switch style { | ||
case "LIGHT": | ||
return .light | ||
case "DARK": | ||
return .dark | ||
default: | ||
return .light | ||
} | ||
} | ||
} |
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
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 @@ | ||
export enum InterfaceStyle { | ||
LIGHT = 'LIGHT', | ||
DARK = 'DARK', | ||
} | ||
|
||
export namespace InterfaceStyle { | ||
export function fromString(value: string): InterfaceStyle { | ||
switch (value) { | ||
case 'LIGHT': | ||
return InterfaceStyle.LIGHT; | ||
case 'DARK': | ||
return InterfaceStyle.DARK; | ||
default: | ||
return InterfaceStyle.LIGHT; | ||
} | ||
} | ||
} |