Skip to content

Commit a0ffd7f

Browse files
authored
[Calling][Release] update API's for 1.4.0 (#25)
1 parent 514fbe6 commit a0ffd7f

File tree

20 files changed

+542
-122
lines changed

20 files changed

+542
-122
lines changed

CHANGELOG.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

CommunicationCallingXamarinSampleApp/CommunicationCallingXamarinSampleApp.Android/CommunicationCallingXamarinSampleApp.Android.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,28 +188,28 @@
188188
</ProjectReference>
189189
</ItemGroup>
190190
<ItemGroup>
191-
<AndroidAarLibrary Include="aar\azure-core-logging-1.0.0-beta.9.aar">
191+
<AndroidAarLibrary Include="aar\azure-core-logging-1.0.0-beta.12.aar">
192192
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
193193
</AndroidAarLibrary>
194-
<AndroidAarLibrary Include="aar\fluentui_drawer-0.0.20.aar">
194+
<AndroidAarLibrary Include="aar\fluentui_drawer-0.0.21.aar">
195195
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
196196
</AndroidAarLibrary>
197-
<AndroidAarLibrary Include="aar\fluentui_listitem-0.0.20.aar">
197+
<AndroidAarLibrary Include="aar\fluentui_listitem-0.0.21.aar">
198198
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
199199
</AndroidAarLibrary>
200-
<AndroidAarLibrary Include="aar\fluentui_core-0.0.20.aar">
200+
<AndroidAarLibrary Include="aar\fluentui_core-0.0.21.aar">
201201
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
202202
</AndroidAarLibrary>
203-
<AndroidAarLibrary Include="aar\fluentui_others-0.0.20.aar">
203+
<AndroidAarLibrary Include="aar\fluentui_others-0.0.21.aar">
204204
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
205205
</AndroidAarLibrary>
206-
<AndroidAarLibrary Include="aar\fluentui_transients-0.0.20.aar">
206+
<AndroidAarLibrary Include="aar\fluentui_transients-0.0.21.aar">
207207
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
208208
</AndroidAarLibrary>
209-
<AndroidAarLibrary Include="aar\fluentui_persona-0.0.20.aar">
209+
<AndroidAarLibrary Include="aar\fluentui_persona-0.0.21.aar">
210210
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
211211
</AndroidAarLibrary>
212-
<AndroidAarLibrary Include="aar\azure-communication-calling-2.2.0.aar">
212+
<AndroidAarLibrary Include="aar\azure-communication-calling-2.6.0.beta-1.aar">
213213
<AndroidSkipResourceProcessing></AndroidSkipResourceProcessing>
214214
</AndroidAarLibrary>
215215
<AndroidAarLibrary Include="aar\dualscreen-layout-1.0.0-alpha01.aar">

CommunicationCallingXamarinSampleApp/CommunicationCallingXamarinSampleApp.Android/Composite.cs

Lines changed: 162 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ namespace CommunicationCallingXamarinSampleApp.Droid
1414
{
1515
public class Composite : IComposite
1616
{
17-
public void joinCall(string name, string acsToken, string callID, bool isTeamsCall, LocalizationProps? localization, DataModelInjectionProps? dataModelInjection) {
17+
public void joinCall(string name, string acsToken, string callID, bool isTeamsCall, LocalizationProps? localization, DataModelInjectionProps? dataModelInjection, OrientationProps orientationProps, CallControlProps callControlProps)
18+
{
1819
CommunicationTokenCredential credentials = new CommunicationTokenCredential(acsToken);
1920

2021

@@ -23,16 +24,25 @@ public void joinCall(string name, string acsToken, string callID, bool isTeamsCa
2324
CallComposite callComposite =
2425
new CallCompositeBuilder()
2526
.Theme(Resource.Style.MyCompany_CallComposite)
26-
.Localization(new CallCompositeLocalizationOptions(Locale.ForLanguageTag(localization.Value.locale), layoutDirection)).Build();
27+
.Localization(new CallCompositeLocalizationOptions(Locale.ForLanguageTag(localization.Value.locale), layoutDirection))
28+
.SetupScreenOrientation(GetOrientation(orientationProps.setupScreenOrientation))
29+
.CallScreenOrientation(GetOrientation(orientationProps.callScreenOrientation))
30+
.Build();
2731

2832

2933
callComposite.AddOnErrorEventHandler(new EventHandler());
3034
callComposite.AddOnRemoteParticipantJoinedEventHandler(new RemoteParticipantJoinedHandler(callComposite, dataModelInjection));
35+
callComposite.AddOnCallStateChangedEventHandler(new CallStateChangedEventHandler());
36+
callComposite.AddOnDismissedEventHandler(new CallCompositeDismissedEventHandler());
37+
38+
CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions()
39+
.SetSkipSetupScreen(callControlProps.isSkipSetupON)
40+
.SetCameraOn(callControlProps.isCameraON)
41+
.SetMicrophoneOn(callControlProps.isMicrophoneON);
3142

32-
3343
CallCompositeParticipantViewData personaData = null;
3444

35-
if(dataModelInjection != null)
45+
if (dataModelInjection != null)
3646
{
3747
var context = MainActivity.Instance.ApplicationContext;
3848
int resID = context.Resources.GetIdentifier(dataModelInjection.Value.localAvatar, "drawable", context.PackageName);
@@ -54,14 +64,10 @@ public void joinCall(string name, string acsToken, string callID, bool isTeamsCa
5464

5565
if (personaData != null)
5666
{
57-
callComposite.Launch(MainActivity.Instance, remoteOptions, new CallCompositeLocalOptions(personaData));
58-
67+
localOptions.SetParticipantViewData(personaData);
5968
}
60-
else
61-
{
62-
callComposite.Launch(MainActivity.Instance, remoteOptions);
6369

64-
}
70+
callComposite.Launch(MainActivity.Instance, remoteOptions, localOptions);
6571
}
6672
else
6773
{
@@ -72,16 +78,14 @@ public void joinCall(string name, string acsToken, string callID, bool isTeamsCa
7278

7379
if (personaData != null)
7480
{
75-
callComposite.Launch(MainActivity.Instance, remoteOptions, new CallCompositeLocalOptions(personaData));
76-
77-
}
78-
else
79-
{
80-
callComposite.Launch(MainActivity.Instance, remoteOptions);
81-
81+
localOptions.SetParticipantViewData(personaData);
8282
}
8383

84+
callComposite.Launch(MainActivity.Instance, remoteOptions, localOptions);
8485
}
86+
87+
// to dismiss composite
88+
// callComposite.Dismiss();
8589
}
8690

8791
public List<string> languages()
@@ -96,6 +100,48 @@ public List<string> languages()
96100
return localeStrings;
97101
}
98102

103+
public List<string> orientations()
104+
{
105+
List<String> orientationStrings = new List<String>();
106+
107+
foreach (CallCompositeSupportedScreenOrientation orientation in CallCompositeSupportedScreenOrientation.Values())
108+
{
109+
orientationStrings.Add(orientation.ToString());
110+
}
111+
112+
return orientationStrings;
113+
}
114+
115+
private CallCompositeSupportedScreenOrientation GetOrientation (string orientation)
116+
{
117+
CallCompositeSupportedScreenOrientation _orientation = CallCompositeSupportedScreenOrientation.User;
118+
switch (orientation)
119+
{
120+
case "PORTRAIT":
121+
_orientation = CallCompositeSupportedScreenOrientation.Portrait;
122+
break;
123+
case "LANDSCAPE":
124+
_orientation = CallCompositeSupportedScreenOrientation.Landscape;
125+
break;
126+
case "REVERSE_LANDSCAPE":
127+
_orientation = CallCompositeSupportedScreenOrientation.ReverseLandscape;
128+
break;
129+
case "USER_LANDSCAPE":
130+
_orientation = CallCompositeSupportedScreenOrientation.UserLandscape;
131+
break;
132+
case "FULL_SENSOR":
133+
_orientation = CallCompositeSupportedScreenOrientation.FullSensor;
134+
break;
135+
case "USER":
136+
_orientation = CallCompositeSupportedScreenOrientation.User;
137+
break;
138+
default:
139+
_orientation = CallCompositeSupportedScreenOrientation.User;
140+
break;
141+
}
142+
return _orientation;
143+
}
144+
99145
public class EventHandler : Java.Lang.Object, ICallCompositeEventHandler
100146
{
101147
public void Disposed()
@@ -145,7 +191,105 @@ public void Dispose()
145191

146192
}
147193
}
148-
}
149194

195+
private class CallStateChangedEventHandler : Java.Lang.Object, ICallCompositeEventHandler
196+
{
197+
public void Disposed()
198+
{
199+
}
200+
201+
public void DisposeUnlessReferenced()
202+
{
203+
}
204+
205+
public void Finalized()
206+
{
207+
}
208+
209+
public void Handle(Java.Lang.Object eventArgs)
210+
{
211+
if (eventArgs is CallCompositeCallStateChangedEvent)
212+
{
213+
var callState = eventArgs as CallCompositeCallStateChangedEvent;
214+
Console.WriteLine(callState.Code.ToString());
215+
}
216+
}
217+
218+
public void SetJniIdentityHashCode(int value)
219+
{
220+
}
221+
222+
public void SetJniManagedPeerState(JniManagedPeerStates value)
223+
{
224+
}
225+
226+
public void SetPeerReference(JniObjectReference reference)
227+
{
228+
}
229+
230+
public void UnregisterFromRuntime()
231+
{
232+
}
233+
234+
protected virtual void Dispose(bool disposing)
235+
{
236+
237+
}
238+
239+
public void Dispose()
240+
{
150241

242+
}
243+
}
244+
245+
private class CallCompositeDismissedEventHandler : Java.Lang.Object, ICallCompositeEventHandler
246+
{
247+
public void Disposed()
248+
{
249+
}
250+
251+
public void DisposeUnlessReferenced()
252+
{
253+
}
254+
255+
public void Finalized()
256+
{
257+
}
258+
259+
public void Handle(Java.Lang.Object eventArgs)
260+
{
261+
if (eventArgs is CallCompositeDismissedEvent)
262+
{
263+
var dismissedEvent = eventArgs as CallCompositeDismissedEvent;
264+
Console.WriteLine("CallCompositeDismissedEvent");
265+
}
266+
}
267+
268+
public void SetJniIdentityHashCode(int value)
269+
{
270+
}
271+
272+
public void SetJniManagedPeerState(JniManagedPeerStates value)
273+
{
274+
}
275+
276+
public void SetPeerReference(JniObjectReference reference)
277+
{
278+
}
279+
280+
public void UnregisterFromRuntime()
281+
{
282+
}
283+
284+
protected virtual void Dispose(bool disposing)
285+
{
286+
287+
}
288+
289+
public void Dispose()
290+
{
291+
292+
}
293+
}
294+
}
151295
}

CommunicationCallingXamarinSampleApp/CommunicationCallingXamarinSampleApp.iOS/CommunicationCallingXamarinSampleApp.iOS.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@
147147
<Reference Include="Xamarin.iOS" />
148148
<Reference Include="System.Numerics" />
149149
<Reference Include="System.Numerics.Vectors" />
150-
<Reference Include="NativeLibrary">
151-
<HintPath>..\..\XamariniOSBindings\CommunicationUIProxy.Binding\CommunicationUIProxy.Binding\bin\Debug\NativeLibrary.dll</HintPath>
152-
</Reference>
153150
</ItemGroup>
154151
<ItemGroup>
155152
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
@@ -161,6 +158,9 @@
161158
<Project>{0BA4715C-974F-459C-8366-81A726E4A57E}</Project>
162159
<Name>CommunicationCallingXamarinSampleApp</Name>
163160
</ProjectReference>
161+
<ProjectReference Include="..\..\XamariniOSBindings\CommunicationUIProxy.Binding\CommunicationUIProxy.Binding\CommunicationUIProxy.Binding.csproj">
162+
<Name>CommunicationUIProxy.Binding</Name>
163+
</ProjectReference>
164164
</ItemGroup>
165165
<ItemGroup>
166166
<Folder Include="Assets.xcassets\cat.imageset\" />

0 commit comments

Comments
 (0)