Skip to content

Commit 1940e68

Browse files
authored
Merge pull request #287799 from garchiro7/uilibrary-font-color
Add first version of font color in the UI Library
2 parents be7d0fe + 697b31d commit 1940e68

File tree

11 files changed

+67
-3
lines changed

11 files changed

+67
-3
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/button-injection/android.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ ms.service: azure-communication-services
1212

1313
`CallCompositeCallScreenControlBarOptions`, allow the flexibility to customize the button bar by removing specific buttons such as camera, microphone, and audio controls. This API allows you to tailor the user interface according to their specific application requirements and user experience design. Just set the `visible` or `enabled` to `false` for the `CallCompositeButtonViewData` to hide or disable button.
1414

15+
:::image type="content" source="../../media/remove-button-experience.png" alt-text="Screenshot that shows the experience removing buttons in the UI Library.":::
16+
1517
#### [Kotlin](#tab/kotlin)
1618
```kotlin
1719
val controlBarOptions = CallCompositeCallScreenControlBarOptions()
@@ -72,6 +74,8 @@ cameraButton.setVisible(true);
7274

7375
`Call composite` is using Fluent UI icons. You can download the icons directly from [the Fluent UI GitHub repository](https://github.com/microsoft/fluentui-system-icons/) and incorporate them into your project as needed. This approach guarantees visual consistency across all user interface elements, enhancing the overall user experience.
7476

77+
:::image type="content" source="../../media/add-button-experience.png" alt-text="Screenshot that shows the experienc when you add a new button the UI Library.":::
78+
7579
#### [Kotlin](#tab/kotlin)
7680
```kotlin
7781
val controlBarOptions = CallCompositeCallScreenControlBarOptions()

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ms.service: azure-communication-services
1313

1414
`CallScreenControlBarOptions`, allow the flexibility to customize the button bar by removing specific buttons such as camera, microphone, and audio controls. This API allows you to tailor the user interface according to their specific application requirements and user experience design. Just set the `visible` or `enabled` to `false` for the `ButtonViewData` to hide or disable button.
1515

16+
:::image type="content" source="../../media/remove-button-experience.png" alt-text="Screenshot that shows the experience removing buttons in the UI Library.":::
17+
1618
```swift
1719
let cameraButton = ButtonViewData(visible: false)
1820

@@ -33,11 +35,12 @@ Button can be updated after launching call composite.
3335
cameraButton.visible = true
3436
```
3537

36-
3738
## Add custom actions
3839

3940
`Call composite` is using Fluent UI icons. You can download the icons directly from [the Fluent UI GitHub repository](https://github.com/microsoft/fluentui-system-icons/) and incorporate them into your project as needed. This approach guarantees visual consistency across all user interface elements, enhancing the overall user experience.
4041

42+
:::image type="content" source="../../media/add-button-experience.png" alt-text="Screenshot that shows the experienc when you add a new button the UI Library.":::
43+
4144
```swift
4245
let customButton = CustomButtonOptions(image: UIImage(named: "...")!,
4346
title: "My button") {_ in

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ ms.topic: include
88
ms.service: azure-communication-services
99
---
1010

11+
[!INCLUDE [Public Preview Notice](../../../../includes/public-preview-include.md)]
12+
1113
For more information, see the [open-source Android UI Library](https://github.com/Azure/communication-ui-library-android) and the [sample application code](https://github.com/Azure-Samples/communication-services-android-quickstarts/tree/main/ui-calling).
1214

1315
### Defining a theme
@@ -21,6 +23,7 @@ Theming on Android is handled via XML resource files. We expose the following re
2123
<public name="azure_communication_ui_calling_primary_color_tint10" type="attr" />
2224
<public name="azure_communication_ui_calling_primary_color_tint20" type="attr" />
2325
<public name="azure_communication_ui_calling_primary_color_tint30" type="attr" />
26+
<public name="azure_communication_ui_calling_foreground_on_primary_color" type="attr" />
2427
</resources>
2528
```
2629

@@ -32,6 +35,7 @@ You can implement a theme like the following one in your apps to supply the prim
3235
<item name="azure_communication_ui_calling_primary_color_tint10">#882BD8</item>
3336
<item name="azure_communication_ui_calling_primary_color_tint20">#E0C7F4</item>
3437
<item name="azure_communication_ui_calling_primary_color_tint30">#ECDEF9</item>
38+
<item name="azure_communication_ui_calling_foreground_on_primary_color">#00FF00</item>
3539
</style>
3640
```
3741

@@ -79,3 +83,7 @@ The Android resource system handles the night theme. Night mode on Android is a
7983
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:
8084

8185
`AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)`
86+
87+
### Font color
88+
89+
The `azure_communication_ui_calling_foreground_on_primary_color` allows you to configure the font color that appears on elements using the primary color. You can use this setting when you want to match a specific theme or brand guidelines. By changing `azure_communication_ui_calling_foreground_on_primary_color`, you should ensure that the text remains legible and visually appealing by selecting an appropriate contrasting font color for the primary-colored components.

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ ms.topic: include
88
ms.service: azure-communication-services
99
---
1010

11+
[!INCLUDE [Public Preview Notice](../../../../includes/public-preview-include.md)]
12+
1113
For more information, see the [open-source iOS UI Library](https://github.com/Azure/communication-ui-library-ios) and the [sample application code](https://github.com/Azure-Samples/communication-services-ios-quickstarts/tree/main/ui-calling).
1214

1315
### Defining a theme
@@ -58,6 +60,49 @@ class CustomThemeOptions: ThemeOptions {
5860
let callCompositeOptions = CallCompositeOptions(theme: CustomThemeOptions())
5961
```
6062

63+
### Font color
64+
65+
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.
66+
67+
```swift
68+
struct CustomColorTheming: ThemeOptions {
69+
70+
private var envConfigSubject: EnvConfigSubject
71+
72+
init(envConfigSubject: EnvConfigSubject) {
73+
self.envConfigSubject = envConfigSubject
74+
}
75+
76+
var primaryColor: UIColor {
77+
return UIColor(envConfigSubject.primaryColor)
78+
}
79+
80+
var primaryColorTint10: UIColor {
81+
return UIColor(envConfigSubject.tint10)
82+
}
83+
84+
var primaryColorTint20: UIColor {
85+
return UIColor(envConfigSubject.tint20)
86+
}
87+
88+
var primaryColorTint30: UIColor {
89+
return UIColor(envConfigSubject.tint30)
90+
}
91+
92+
var foregroundOnPrimaryColor: UIColor {
93+
return UIColor(envConfigSubject.foregroundOnPrimaryColor)
94+
}
95+
96+
var colorSchemeOverride: UIUserInterfaceStyle {
97+
return envConfigSubject.colorSchemeOverride
98+
}
99+
}
100+
101+
102+
let callCompositeOptions = CallCompositeOptions(theme: CustomColorTheming())
103+
104+
```
105+
61106
### Defining color assets
62107

63108
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.
62.1 KB
Loading
44.4 KB
Loading
62.4 KB
Loading
76.6 KB
Loading

articles/communication-services/how-tos/ui-library-sdk/setup-title-subtitle.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Developers now have the capability to customize the title and subtitle of a call
2121

2222
For instance, in a customer support scenario, the title could display the issue being addressed, while the subtitle could show the customer's name or ticket number.
2323

24+
:::image type="content" source="./media/title-subtitle.png" alt-text="Screenshot that shows the experience of title and subtitle in the UI Library.":::
25+
2426
Additionally, if tracking time spent in various segments of the call is crucial, the subtitle could dynamically update to display the elapsed call duration, helping to manage the meeting or session effectively.
2527

2628
## Prerequisites

0 commit comments

Comments
 (0)