Customize theme

Staytuned provide a default theme on every components. This section explain how you can customize them

Android
iOS
Cordova
Android
<!-- Set your parent Theme to STTheme -->
<style name="AppTheme" parent="STTheme">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
iOS
AppDelegate.swift
import UIKit
import StayTuned
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Let you change the main color of the SDK
let uiOptions: STUIOptions = .init(
brandColor: .black,
interfaceStyle: .app
)
// Let you add a caching options for STContent, it won't call the WS twice for a same content if set to true
let contentCacheOptions: STContentCachingOptions = .init(
enabledContentCaching: true,
maxCachedContent: 10
)
let options: STOptions = .init(
uiOptions: uiOptions,
contentCachingOptions: contentCacheOptions
)
StayTuned(
appId: <your-app-id>,
authToken: <your-auth-token>,
options: options
)
// do any other necessary launch configuration
// ....
// ....
return true
}
}
Cordova
/* For cordova, you have to overide those css variables */
:root {
--st-primary-color: #2888ff;
--st-text-muted: #696665;
--st-text-light: #a3a3a3;
}