Skip to content

Commit 088091d

Browse files
committed
Add first version of theme color
1 parent 4c232e5 commit 088091d

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

articles/communication-services/concepts/ui-library/includes/mobile-ui-use-cases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ For more information, see [How to customize the button bar](../../../how-tos/ui-
190190

191191
UI Library provides the capability to join a call skipping the setup screen of the call join experience. By default, user goes through a setup screen to join a call. Here, user sets the call configuration such as camera turn on or off, microphone turn on or off and audio device selection before joining a call. This screen requires user interaction to join a call, which might be unnecessary for some users. So we provide the capability to join a call by skipping the setup screen and providing the call configuration APIs. For more information, see [How to use Skip Setup Screen Feature.](../../../how-tos/ui-library-sdk/skip-setup-screen.md)
192192

193-
### Theming
193+
### Theming & colors
194194

195-
You can use the UI Library call composite for iOS and Android to create a custom theme of a caller's experience. To create the platform experience, pass a set of theming colors as shown in the following table. For more information, see [How to create your theme](../../../how-tos/ui-library-sdk/theming.md).
195+
You can use the UI Library call composite for iOS and Android to create a custom theme of a caller's experience. You have the flexibility to customize the primary colors. This feature allows you to tailor the color scheme to match your specific branding needs. By adjusting primary colors, you can ensure the interface seamlessly integrates with your brand’s visual identity, enhancing user experience while maintaining consistency across your applications. For more information, see [How to create your theme](../../../how-tos/ui-library-sdk/theming.md).
196196

197197
| Android | iOS |
198198
| -------------------------------------------------------- | --------------------------------------------------------------- |

articles/communication-services/how-tos/ui-library-sdk/includes/theming/android.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,27 @@ The Android resource system handles the night theme. Night mode on Android is a
7979
To enable night mode programmatically, Android provides the following function. However, this configuration applies globally to the application. There's no reliable way to set night mode for a single activity. To enforce a dark theme, use the following setting in your applications:
8080

8181
`AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)`
82+
83+
### Font color
84+
85+
The `foregroundOnPrimaryColor` allows you to programmatically update the font color that appears on elements using the primary color. You can use this method when you want to match a specific theme or brand guidelines. By invoking `foregroundOnPrimaryColor`, you should ensure that the text remains legible and visually appealing by selecting an appropriate contrasting font color for the primary-colored components.
86+
87+
#### [Kotlin](#tab/kotlin)
88+
89+
```kotlin
90+
val callComposite: CallComposite =
91+
CallCompositeBuilder()
92+
.theme(R.style.MyCompany_CallComposite)
93+
.build()
94+
```
95+
96+
#### [Java](#tab/java)
97+
98+
```java
99+
CallComposite callComposite =
100+
new CallCompositeBuilder()
101+
.theme(R.style.MyCompany_CallComposite)
102+
.build();
103+
```
104+
105+
----

articles/communication-services/how-tos/ui-library-sdk/includes/theming/ios.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,49 @@ class CustomThemeOptions: ThemeOptions {
5858
let callCompositeOptions = CallCompositeOptions(theme: CustomThemeOptions())
5959
```
6060

61+
### Font color
62+
63+
The `foregroundOnPrimaryColor` allows you to programmatically update the font color that appears on elements using the primary color. You can use this method when you want to match a specific theme or brand guidelines. By invoking `foregroundOnPrimaryColor`, you should ensure that the text remains legible and visually appealing by selecting an appropriate contrasting font color for the primary-colored components.
64+
65+
```swift
66+
struct CustomColorTheming: ThemeOptions {
67+
68+
private var envConfigSubject: EnvConfigSubject
69+
70+
init(envConfigSubject: EnvConfigSubject) {
71+
self.envConfigSubject = envConfigSubject
72+
}
73+
74+
var primaryColor: UIColor {
75+
return UIColor(envConfigSubject.primaryColor)
76+
}
77+
78+
var primaryColorTint10: UIColor {
79+
return UIColor(envConfigSubject.tint10)
80+
}
81+
82+
var primaryColorTint20: UIColor {
83+
return UIColor(envConfigSubject.tint20)
84+
}
85+
86+
var primaryColorTint30: UIColor {
87+
return UIColor(envConfigSubject.tint30)
88+
}
89+
90+
var foregroundOnPrimaryColor: UIColor {
91+
return UIColor(envConfigSubject.foregroundOnPrimaryColor)
92+
}
93+
94+
var colorSchemeOverride: UIUserInterfaceStyle {
95+
return envConfigSubject.colorSchemeOverride
96+
}
97+
}
98+
99+
100+
let callCompositeOptions = CallCompositeOptions(theme: CustomColorTheming())
101+
102+
```
103+
61104
### Defining color assets
62105

63106
Define each color in the assets, with a shade for the light and dark modes. The following reference image shows how to configure the assets on an Xcode project.

0 commit comments

Comments
 (0)