Skip to content

Commit a5b1496

Browse files
Update custom buttons API
1 parent 84e9b45 commit a5b1496

File tree

2 files changed

+52
-9
lines changed
  • articles/communication-services/how-tos/ui-library-sdk/includes/button-injection

2 files changed

+52
-9
lines changed

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

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ ms.service: azure-communication-services
1010

1111
## Remove buttons
1212

13-
`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 visibility to `false` to hide, the default behavior is for `CallCompositeButtonOptions` object.
13+
`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

1515
#### [Kotlin](#tab/kotlin)
1616

1717
```kotlin
1818
val controlBarOptions = CallCompositeCallScreenControlBarOptions()
1919

20-
val cameraButton = CallCompositeButtonOptions()
20+
val cameraButton = CallCompositeButtonViewData()
2121
.setVisible(false)
2222

2323
controlBarOptions.setCameraButton(cameraButton)
@@ -33,12 +33,11 @@ val callComposite = CallCompositeBuilder()
3333

3434
callComposite.launch(context, locator, localOptions)
3535
```
36-
3736
#### [Java](#tab/java)
3837
```java
3938
CallCompositeCallScreenControlBarOptions controlBarOptions = new CallCompositeCallScreenControlBarOptions();
4039

41-
CallCompositeButtonOptions cameraButton = new CallCompositeButtonOptions()
40+
CallCompositeButtonOptions cameraButton = new CallCompositeButtonViewData()
4241
.setVisible(false);
4342

4443
controlBarOptions.setCameraButton(cameraButton);
@@ -55,6 +54,20 @@ CallComposite callComposite = new CallCompositeBuilder()
5554
callComposite.launch(context, locator, localOptions);
5655
```
5756

57+
58+
Button can be updated after launching call composite.
59+
60+
#### [Kotlin](#tab/kotlin)
61+
62+
```kotlin
63+
cameraButton.setVisible(true)
64+
```
65+
66+
#### [Java](#tab/java)
67+
```java
68+
cameraButton.setVisible(true);
69+
```
70+
5871
-----
5972

6073
## Add custom actions
@@ -68,7 +81,8 @@ val controlBarOptions = CallCompositeCallScreenControlBarOptions()
6881

6982
controlBarOptions.setCustomButtons(
7083
listOf(
71-
CallCompositeCustomButtonOptions(
84+
CallCompositeCustomButtonViewData(
85+
"customButtonId",
7286
R.drawable.my_button_image,
7387
"My button",
7488
fun(it: CallCompositeCustomButtonClickEvent) {
@@ -96,7 +110,8 @@ CallCompositeCallScreenControlBarOptions controlBarOptions = new CallCompositeCa
96110

97111
List<CallCompositeCustomButtonOptions> customButtons = new ArrayList<>();
98112
customButtons.add(
99-
new CallCompositeCustomButtonOptions(
113+
new CallCompositeCustomButtonViewData(
114+
"customButtonId",
100115
R.drawable.my_button_image,
101116
"My button",
102117
eventArgs -> {
@@ -120,3 +135,18 @@ callComposite.launch(context, locator, localOptions);
120135
```
121136

122137
-----
138+
139+
Similar to `Call composite` provided buttons, custom buttons are updatable after the launch.
140+
141+
142+
143+
#### [Kotlin](#tab/kotlin)
144+
145+
```kotlin
146+
customButton.setVisible(true)
147+
```
148+
149+
#### [Java](#tab/java)
150+
```java
151+
customButton.setVisible(true);
152+
```

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ ms.service: azure-communication-services
99
---
1010

1111

12-
## Remove buttons
12+
## Remove or disable buttons
1313

14-
`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 visibility to `false` to hide, the default behavior is for `ButtonOptions` object.
14+
`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

1616
```swift
17-
let cameraButton = ButtonOptions(visible: false)
17+
let cameraButton = ButtonViewData(visible: false)
1818

1919
let callScreenControlBarOptions = CallScreenControlBarOptions(
2020
cameraButton: cameraButton
@@ -27,6 +27,13 @@ let callComposite = CallComposite(credential: credential)
2727
callComposite.launch(locator: .roomCall(roomId: "..."), localOptions: localOptions)
2828
```
2929

30+
Button can be updated after launching call composite.
31+
32+
```swift
33+
cameraButton.visible = true
34+
```
35+
36+
3037
## Add custom actions
3138

3239
`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.
@@ -47,3 +54,9 @@ let localOptions = LocalOptions(callScreenOptions: callScreenOptions)
4754
let callComposite = CallComposite(credential: credential)
4855
callComposite.launch(locator: .roomCall(roomId: "..."), localOptions: localOptions)
4956
```
57+
58+
Similar to `Call composite` provided buttons, custom buttons are updatable after the launch.
59+
60+
```swift
61+
customButton.enabled = true
62+
```

0 commit comments

Comments
 (0)