Skip to content

Commit 051f268

Browse files
authored
Merge pull request #2 from iaulakh/patch-16
Update android.md
2 parents 78b72de + c02a996 commit 051f268

File tree

4 files changed

+148
-92
lines changed

4 files changed

+148
-92
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,28 @@ The UI Library gives developers the ability to provide a more customized experie
1818

1919
#### Local Participant View Data
2020

21-
`ParticipantViewData` is a class that set the `renderedDisplayName`, `avatarBitmap` and `scaleType` for avatar control. This class is passed to the configuration in order to customize the local participants view information.
21+
`CallCompositeParticipantViewData` is a class that set the `displayName`, `avatarBitmap` and `scaleType` for avatar control. This class is passed to the `CallCompositeLocalOptions` in order to customize the local participants view information.
2222

23-
This class is held in the `LocalSettings` object that represents options used locally on the device making the call.
23+
This class is held in the `CallCompositeLocalOptions` object that represents options used locally on the device making the call.
2424

25-
`renderedDisplayName` differs from the `displayName` passed in via the `TeamsMeetingOptions` and `GroupCallOptions` in that it is only used locally as an override, where `displayName` is passed to the server and shared with other participants. When `renderedDisplayName` is not provided, `displayName` is used.
25+
`displayName` differs from the `displayName` passed in via the `CallCompositeRemoteOptions`. `CallCompositeParticipantViewData` `displayName` is only used locally as an override, where `CallCompositeRemoteOptions` `displayName` is passed to the server and shared with other participants. When `CallCompositeParticipantViewData` `displayName` is not provided, `CallCompositeRemoteOptions` `displayName` is used.
2626

2727
#### Usage
2828

29-
To use the `LocalSettings`, pass the instance of `CallCompositeParticipantViewData` and inject `LocalSettings` to `callComposite.launch`.
29+
To use the `CallCompositeLocalOptions`, pass the instance of `CallCompositeParticipantViewData` and inject `CallCompositeLocalOptions` to `callComposite.launch`.
3030

3131
#### [Kotlin](#tab/kotlin)
3232

3333
```kotlin
34-
val viewData = CallCompositeParticipantViewData("LocalUserDisplayName") // bitmap is optional
34+
val viewData = CallCompositeParticipantViewData().setDisplayName("displayName") // setAvatarBitmap for bitmap
3535
val localOptions = CallCompositeLocalOptions(viewData)
3636
callComposite.launch(this, remoteOptions, localOptions)
3737
```
3838

3939
#### [Java](#tab/java)
4040

4141
```java
42-
ParticipantViewData viewData = new CallCompositeParticipantViewData("LocalUserDisplayName", bitmap); // bitmap is optional
42+
CallCompositeParticipantViewData viewData = new CallCompositeParticipantViewData().setDisplayName("displayName"); // setAvatarBitmap for bitmap
4343
CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions(viewData);
4444
callComposite.launch(this, remoteOptions, localOptions);
4545
```
@@ -53,7 +53,7 @@ callComposite.launch(this, remoteOptions, localOptions);
5353

5454
In some instances, you may wish to provide local overrides for remote participants to allow custom avatars and titles.
5555

56-
The process is similar to the local participant process, however the data is set when participants join the call. As a developer you would need to add a listener to when remote participants join the call, and then call a method to set the ParticipantViewData for that remote user.
56+
The process is similar to the local participant process, however the data is set when participants join the call. As a developer you would need to add a listener to when remote participants join the call, and then call a method to set the `CallCompositeParticipantViewData` for that remote user.
5757

5858
#### Usage
5959

@@ -71,7 +71,7 @@ callComposite.setOnRemoteParticipantJoinedHandler { remoteParticipantJoinedEvent
7171
remoteParticipantJoinedEvent.identifiers.forEach { identifier ->
7272
// get displayName, bitmap for identifier
7373
callComposite.setRemoteParticipantViewData(identifier,
74-
ParticipantViewData("display_name"))
74+
CallCompositeParticipantViewData().setDisplayName("displayName")) // setAvatarBitmap for bitmap
7575
}
7676
}
7777
```
@@ -83,7 +83,7 @@ callComposite.setOnRemoteParticipantJoinedHandler { remoteParticipantJoinedEvent
8383
for (CommunicationIdentifier identifier: remoteParticipantJoinedEvent.getIdentifiers()) {
8484
// get displayName, bitmap for identifier
8585
callComposite.setRemoteParticipantViewData(identifier,
86-
new ParticipantViewData("display_name"));
86+
new CallCompositeParticipantViewData().setDisplayName("displayName")); // setAvatarBitmap for bitmap
8787
}
8888
});
8989
```

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

Lines changed: 68 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,93 @@ Azure Communication UI [open source library](https://github.com/Azure/communicat
1414

1515
### Available Languages
1616

17-
The following is table of `CommunicationUISupportedLocale` with out of the box translations. If you want to localize the composite, pass the `Locale` from `CommunicationUISupportedLocale` into `LocalizationConfiguration` as options into `CallComposite`.
17+
The following is table of `CallCompositeSupportedLocale` with out of the box translations. If you want to localize the composite, pass the `Locale` from `CallCompositeSupportedLocale` into `CallCompositeLocalizationOptions` as options into `CallComposite`.
1818

19-
|Language| CommunicationUISupportedLocale|
19+
|Language| CallCompositeSupportedLocale|
2020
|---------|---------|
21-
|German| CommunicationUISupportedLocale.DE|
22-
|Japanese| CommunicationUISupportedLocale.JA|
23-
|English| CommunicationUISupportedLocale.EN_US|
24-
|Chinese (Traditional)| CommunicationUISupportedLocale.ZH_TW|
25-
|Spanish |CommunicationUISupportedLocale.ES|
26-
|Chinese (Simplified) |CommunicationUISupportedLocale.ZH_CN|
27-
|Italian |CommunicationUISupportedLocale.IT|
28-
|English (United Kingdom) |CommunicationUISupportedLocale.EN_UK|
29-
|Korean |CommunicationUISupportedLocale.KO|
30-
|Turkish |CommunicationUISupportedLocale.TR|
31-
|Russian |CommunicationUISupportedLocale.RU|
32-
|French |CommunicationUISupportedLocale.FR|
33-
|Dutch |CommunicationUISupportedLocale.NL|
34-
|Portuguese |CommunicationUISupportedLocale.PT_BR|
21+
|German| CallCompositeSupportedLocale.DE|
22+
|Japanese| CallCompositeSupportedLocale.JA|
23+
|English| CallCompositeSupportedLocale.EN_US|
24+
|Chinese (Traditional)| CallCompositeSupportedLocale.ZH_TW|
25+
|Spanish |CallCompositeSupportedLocale.ES|
26+
|Chinese (Simplified) |CallCompositeSupportedLocale.ZH_CN|
27+
|Italian |CallCompositeSupportedLocale.IT|
28+
|English (United Kingdom) |CallCompositeSupportedLocale.EN_UK|
29+
|Korean |CallCompositeSupportedLocale.KO|
30+
|Turkish |CallCompositeSupportedLocale.TR|
31+
|Russian |CallCompositeSupportedLocale.RU|
32+
|French |CallCompositeSupportedLocale.FR|
33+
|Dutch |CallCompositeSupportedLocale.NL|
34+
|Portuguese |CallCompositeSupportedLocale.PT_BR|
3535

3636
### Localization Provider
3737

38-
`LocalizationConfiguration` is an options wrapper that sets all the strings for Mobile UI Library components using a `CommunicationUISupportedLocale`. By default, all text labels use English strings. If desired `LocalizationConfiguration` can be used to set a different language by passing a `Locale` object from `CommunicationUISupportedLocale`. Out of the box, the UI library includes a set of `Locale` usable with the UI components and composites.
38+
`CallCompositeLocalizationOptions` is an options wrapper that sets all the strings for Mobile UI Library components using a `CallCompositeSupportedLocale`. By default, all text labels use English strings. If desired `CallCompositeLocalizationOptions` can be used to set a different language by passing a `Locale` object from `CallCompositeSupportedLocale`. Out of the box, the UI library includes a set of `Locale` usable with the UI components and composites.
3939

40-
You can also obtain list of `Locale` by the static function `CommunicationUISupportedLocale.getSupportedLocales()`.
40+
You can also obtain list of `Locale` by the static function `CallCompositeSupportedLocale.getSupportedLocales()`.
4141

4242
:::image type="content" source="media/android-localization.png" alt-text="Android localization":::
4343

4444
#### Usage
4545

46-
To use the `LocalizationConfiguration`, specify a `CommunicationUISupportedLocale` and pass it to the `CallCompositeOptions`. For the example below, we'll localize the composite to French.
46+
To use the `CallCompositeLocalizationOptions`, specify a `CallCompositeSupportedLocale` and pass it to the `CallCompositeBuilder`. For the example below, we'll localize the composite to French.
4747

48-
```Kotlin
49-
val callComposite: CallComposite = CallCompositeBuilder().localization(LocalizationConfiguration(CommunicationUISupportedLocale.FR).build()
48+
#### [Kotlin](#tab/kotlin)
49+
50+
```kotlin
51+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions
52+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale
53+
54+
// CallCompositeSupportedLocale provides list of supported locale
55+
val callComposite: CallComposite =
56+
CallCompositeBuilder().localization(
57+
CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR)
58+
).build()
59+
```
60+
61+
#### [Java](#tab/java)
62+
63+
```java
64+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions;
65+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale;
66+
67+
// CallCompositeSupportedLocale provides list of supported locale
68+
CallComposite callComposite =
69+
new CallCompositeBuilder()
70+
.localization(new CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR))
71+
.build();
5072
```
5173

5274
### Layout Direction
5375

54-
Certain cultures (Arabic, Hebrew, etc.) may need for localization to have right-to-left layout. You can specify the `layoutDirection` as part of the `LocalizationConfiguration`. The layout of the composite will be mirrored but the text will remain in the direction of the string.
76+
Certain cultures (Arabic, Hebrew, etc.) may need for localization to have right-to-left layout. You can specify the `layoutDirection` as part of the `CallCompositeLocalizationOptions`. The layout of the composite will be mirrored but the text will remain in the direction of the string.
77+
78+
#### [Kotlin](#tab/kotlin)
79+
80+
```kotlin
81+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions
82+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale
5583

56-
```Koltin
57-
val callComposite: CallComposite = CallCompositeBuilder().localization(LocalizationConfiguration(CommunicationUISupportedLocale.FR,LaytoutDirection.RTL)).build()
84+
// CallCompositeSupportedLocale provides list of supported locale
85+
val callComposite: CallComposite =
86+
CallCompositeBuilder().localization(
87+
CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR, LayoutDirection.LTR)
88+
).build()
5889
```
5990

60-
|`LayoutDirection.RTL` | `LayoutDirection.LTR` |
61-
| -------------------------------------------------------- | --------------------------------------------------------------- |
62-
| :::image type="content" source="media/android-rtl.png" alt-text="Android RTL"::: | :::image type="content" source="media/android-ltr.png" alt-text="Android LTR"::: |
91+
#### [Java](#tab/java)
6392

64-
### Customizing Translations
93+
```java
94+
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions;
95+
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale;
6596

66-
To override a particular string, you can find the list of localization keys here for the key-value pair. You can specify the `languageCode` to be one of the supported languages, and when a key isn't provided, will fall back to our supported translation string. If you specified an unsupported language, you should provide translations for all the keys for that language, and will fall back to English strings when a key isn't provided.
97+
// CallCompositeSupportedLocale provides list of supported locale
98+
CallComposite callComposite =
99+
new CallCompositeBuilder()
100+
.localization(new CallCompositeLocalizationOptions(CallCompositeSupportedLocale.FR, LayoutDirection.LTR))
101+
.build();
102+
```
67103

68-
Create a `string.xml` file (or other filename) with the key-value pair for selected keys you want to override.
104+
|`LayoutDirection.RTL` | `LayoutDirection.LTR` |
105+
| -------------------------------------------------------- | --------------------------------------------------------------- |
106+
| :::image type="content" source="media/android-rtl.png" alt-text="Android RTL"::: | :::image type="content" source="media/android-ltr.png" alt-text="Android LTR"::: |

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,22 @@ Contoso developers can implement a **Theme** within their apps like this one to
5454

5555
The theme style will be applied to pass the Theme resource ID to the ThemeConfiguration/Theme in the `CallCompositeBuilder`.
5656

57-
```Kotlin
58-
CallCompositeBuilder().theme(ThemeConfiguration(R.style.Contoso_Theme_Calling))
57+
#### [Kotlin](#tab/kotlin)
58+
59+
```kotlin
60+
val callComposite: CallComposite =
61+
CallCompositeBuilder()
62+
.theme(R.style.MyCompany_CallComposite)
63+
.build()
64+
```
65+
66+
#### [Java](#tab/java)
67+
68+
```java
69+
CallComposite callComposite =
70+
new CallCompositeBuilder()
71+
.theme(R.style.MyCompany_CallComposite)
72+
.build();
5973
```
6074

6175
#### Light/Dark modes

0 commit comments

Comments
 (0)