Mobile SDK - Theming
The Cardlytics Mobile SDK makes it easy to customize the default theme of the SDK to match your custom branding. This document helps outline how the provided values map to the current experience and how to override them.
Fonts and Colors
The SDK uses four different font weights (light, regular, medium, and bold) and three main color variations (header, primary, and interactive). The following code samples demonstrate how to override those values.
To support this in your iOS app, create a concrete implementation of the PoweredByCDLXTheme
protocol. The protocol requires that the main colors be defined, but provides default values for the fonts, gray colors, and interactive elements so that they can be optionally overridden. The following example provides the main colors and custom fonts, but chooses to use the default values for everything else:
1 2 3 4 5 6 7 8 9 |
|
To support this in your Android app, you can also override the color and font values that are in the PoweredByCDLXTheme
, this class is the entry point for all the colors, sizes and styles in the SDK. The SDK provides a DefaultTheme
with default implementations for all the theme's definitions. The following example illustrates how use the default theme but still be able to select the fonts and palette colors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Navigation Bar
The SDK also supports theming the navigation bar used throughout the SDK experience. If the SDK theming is not provided, then the navigation bar defaults to the primary theme color as the background with white UI elements.
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 9 10 11 |
|
Program Name
When you first launch the SDK, depending on the modules you're using, you may notice the navigation bar title defaults to Offers
. This title is configurable to match the nomenclature of your specific program. For example, If your program refers to offers as Rewards
, you could set that as the program name and it would update the feed title to Rewards
. To update the program name, please refer to the following examples.
1 |
|
1 |
|
Section Titles
The section titles in the offers feed can be customized. These fields are configured server-side, so please work with your Partner Manager if you prefer a value other than the default.
Logo and Header Styles
Another optional theming feature is the ability to customize logo image treatments. Logos can either have a circular or rounded rectangle treatment. An example choosing circular logos is shown below:
1 2 3 4 |
|
1 2 |
|
``` kotlin val uiOptions = PoweredByUiOptions("Rewards", CDLXLogoStyle.CIRCLE, CDLXBrandDetailsHeaderStyle.RECTANGLE) PoweredByCDLX.instance?.showRewards(activity, uiOptions)