Skip to content

Commit 07251ca

Browse files
authored
Merge pull request #286585 from pavelprystinka/pavelprystinka/custom_buttons_updatable
Update custom buttons API
2 parents 9a4cc11 + 4bee00a commit 07251ca

File tree

2 files changed

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

2 files changed

+50
-10
lines changed

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

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ 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)
16-
1716
```kotlin
1817
val controlBarOptions = CallCompositeCallScreenControlBarOptions()
1918

20-
val cameraButton = CallCompositeButtonOptions()
19+
val cameraButton = CallCompositeButtonViewData()
2120
.setVisible(false)
2221

2322
controlBarOptions.setCameraButton(cameraButton)
@@ -38,7 +37,7 @@ callComposite.launch(context, locator, localOptions)
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);
@@ -54,6 +53,18 @@ CallComposite callComposite = new CallCompositeBuilder()
5453

5554
callComposite.launch(context, locator, localOptions);
5655
```
56+
-----
57+
Button can be updated after launching call composite.
58+
59+
#### [Kotlin](#tab/kotlin)
60+
```kotlin
61+
cameraButton.setVisible(true)
62+
```
63+
64+
#### [Java](#tab/java)
65+
```java
66+
cameraButton.setVisible(true);
67+
```
5768

5869
-----
5970

@@ -62,13 +73,13 @@ callComposite.launch(context, locator, localOptions);
6273
`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.
6374

6475
#### [Kotlin](#tab/kotlin)
65-
6676
```kotlin
6777
val controlBarOptions = CallCompositeCallScreenControlBarOptions()
6878

6979
controlBarOptions.setCustomButtons(
7080
listOf(
71-
CallCompositeCustomButtonOptions(
81+
CallCompositeCustomButtonViewData(
82+
"customButtonId",
7283
R.drawable.my_button_image,
7384
"My button",
7485
fun(it: CallCompositeCustomButtonClickEvent) {
@@ -96,7 +107,8 @@ CallCompositeCallScreenControlBarOptions controlBarOptions = new CallCompositeCa
96107

97108
List<CallCompositeCustomButtonOptions> customButtons = new ArrayList<>();
98109
customButtons.add(
99-
new CallCompositeCustomButtonOptions(
110+
new CallCompositeCustomButtonViewData(
111+
"customButtonId",
100112
R.drawable.my_button_image,
101113
"My button",
102114
eventArgs -> {
@@ -120,3 +132,18 @@ callComposite.launch(context, locator, localOptions);
120132
```
121133

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

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)