[Feature] Rename demo-app, add call-with-chat, remove build flavours from calling (#410)
This commit is contained in:
Родитель
d7abbfd738
Коммит
bae3b491a5
|
@ -92,7 +92,7 @@ allprojects {
|
|||
|
||||
subprojects {
|
||||
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||
apply from: "../azure-communication-ui-demo-app/checkstyle.gradle"
|
||||
apply from: "../demo-app/checkstyle.gradle"
|
||||
afterEvaluate {
|
||||
preBuild.dependsOn 'checkstyle'
|
||||
check.dependsOn 'checkstyle'
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 31
|
||||
|
||||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 31
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
// implementation "androidx.core:core-ktx:$androidx_core_ktx_version"
|
||||
// implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
|
||||
|
||||
api project(path: ':calling')
|
||||
api(project(path: ':chat')) {
|
||||
exclude group: 'com.microsoft', module: 'trouter-client-android'
|
||||
}
|
||||
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
|
@ -0,0 +1,22 @@
|
|||
package com.azure.android.communication.ui.callwithchat
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.azure.android.communicatin.ui.callwithchat.test", appContext.packageName)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.azure.android.communication.ui.callwithchat">
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,124 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.azure.android.communication.common.CommunicationIdentifier;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeErrorCode;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeErrorEvent;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeLocalOptions;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeParticipantViewData;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeRemoteOptions;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeEventHandler;
|
||||
import com.azure.android.communication.ui.calling.CallComposite;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeRemoteParticipantJoinedEvent;
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeSetParticipantViewDataResult;
|
||||
import com.azure.android.communication.ui.chat.ChatComposite;
|
||||
|
||||
public final class CallWithChatComposite {
|
||||
|
||||
private CallWithChatManager callWithChatManager;
|
||||
|
||||
CallWithChatComposite(final CallComposite callComposite,
|
||||
final ChatComposite chatComposite) {
|
||||
|
||||
callWithChatManager = new CallWithChatManager(callComposite, chatComposite);
|
||||
}
|
||||
|
||||
public void launch(final Context context,
|
||||
final CallWithChatCompositeRemoteOptions remoteOptions) {
|
||||
launch(context, remoteOptions, null);
|
||||
}
|
||||
|
||||
public void launch(final Context context,
|
||||
final CallWithChatCompositeRemoteOptions remoteOptions,
|
||||
final CallWithChatCompositeLocalOptions localOptions) {
|
||||
|
||||
callWithChatManager.launch(context, remoteOptions, localOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add {@link CallWithChatCompositeEventHandler}.
|
||||
*
|
||||
* <p> A callback for Call Composite Error Events.
|
||||
* See {@link CallWithChatCompositeErrorCode} for values.</p>
|
||||
* <pre>
|
||||
*
|
||||
* // add error handler
|
||||
* callWithChatComposite.addOnErrorEventHandler(event -> {
|
||||
* // Process error event
|
||||
* System.out.println(event.getCause());
|
||||
* System.out.println(event.getErrorCode());
|
||||
* });
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param errorHandler The {@link CallWithChatCompositeEventHandler}.
|
||||
*/
|
||||
public void addOnErrorEventHandler(
|
||||
final CallWithChatCompositeEventHandler<CallWithChatCompositeErrorEvent> errorHandler) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove {@link CallWithChatCompositeEventHandler}.
|
||||
*
|
||||
* <p> A callback for Call Composite Error Events.
|
||||
* See {@link CallWithChatCompositeErrorEvent} for values.</p>
|
||||
*
|
||||
* @param errorHandler The {@link CallWithChatCompositeEventHandler}.
|
||||
*/
|
||||
public void removeOnErrorEventHandler(
|
||||
final CallWithChatCompositeEventHandler<CallWithChatCompositeErrorEvent> errorHandler) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add {@link CallWithChatCompositeEventHandler}.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* // add remote participant joined handler
|
||||
* callWithChatComposite.addOnRemoteParticipantJoinedEventHandler(event -> {
|
||||
* // Use call composite to set configurations for remote participant
|
||||
* });
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param eventHandler The {@link CallWithChatCompositeEventHandler}.
|
||||
*/
|
||||
public void addOnRemoteParticipantJoinedEventHandler(
|
||||
final CallWithChatCompositeEventHandler<CallWithChatCompositeRemoteParticipantJoinedEvent> eventHandler) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove {@link CallWithChatCompositeEventHandler}.
|
||||
*
|
||||
* @param eventHandler The {@link CallWithChatCompositeEventHandler}.
|
||||
*/
|
||||
public void removeOnRemoteParticipantJoinedEventHandler(
|
||||
final CallWithChatCompositeEventHandler<CallWithChatCompositeRemoteParticipantJoinedEvent> eventHandler) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set {@link CallWithChatCompositeParticipantViewData}.
|
||||
*
|
||||
* <p>
|
||||
* Used to set Participant View Data (E.g. Avatar and displayName) to be used on this device only.
|
||||
* </p>
|
||||
* <p>
|
||||
* This should be called from {@link #addOnRemoteParticipantJoinedEventHandler(
|
||||
* CallWithChatCompositeEventHandler)} to assign Participant View Data when a Participant
|
||||
* joins the meeting if you'd like to modify the Participants view data.
|
||||
* </p>
|
||||
*
|
||||
* @param identifier The {@link CommunicationIdentifier}.
|
||||
* @param participantViewData The {@link CallWithChatCompositeParticipantViewData}.
|
||||
* @return {@link CallWithChatCompositeSetParticipantViewDataResult}.
|
||||
*/
|
||||
public CallWithChatCompositeSetParticipantViewDataResult setRemoteParticipantViewData(
|
||||
final CommunicationIdentifier identifier,
|
||||
final CallWithChatCompositeParticipantViewData participantViewData) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat;
|
||||
|
||||
public class CallWithChatCompositeBuilder {
|
||||
/**
|
||||
* Builds the {@link CallWithChatComposite}.
|
||||
*
|
||||
* @return {@link CallWithChatComposite}
|
||||
*/
|
||||
public CallWithChatComposite build() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat
|
||||
|
||||
import android.content.Context
|
||||
import com.azure.android.communication.ui.calling.CallComposite
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeLocalOptions
|
||||
import com.azure.android.communication.ui.callwithchat.models.CallWithChatCompositeRemoteOptions
|
||||
import com.azure.android.communication.ui.chat.ChatComposite
|
||||
|
||||
internal class CallWithChatManager(
|
||||
private val callComposite: CallComposite,
|
||||
private val chatComposite: ChatComposite,
|
||||
) {
|
||||
fun launch(
|
||||
context: Context,
|
||||
remoteOptions: CallWithChatCompositeRemoteOptions,
|
||||
localOptions: CallWithChatCompositeLocalOptions?
|
||||
) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat
|
||||
|
||||
internal class TeamsUrlParser {
|
||||
companion object {
|
||||
fun getThreadId(teamsMeetingLink: String): String {
|
||||
var threadId = teamsMeetingLink.replace("https://teams.microsoft.com/l/meetup-join/", "")
|
||||
|
||||
// TODO:
|
||||
// threadId = decodeURIComponent(threadId);
|
||||
|
||||
val splitted = threadId.split("/")
|
||||
|
||||
if (splitted.count() < 1) {
|
||||
throw Error("Could not get chat thread from teams link")
|
||||
}
|
||||
|
||||
threadId = splitted[0]
|
||||
|
||||
return threadId
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import com.azure.android.communication.ui.callwithchat.CallWithChatComposite;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Group Call locator to start group call with chat experience using {@link CallWithChatComposite}.
|
||||
*/
|
||||
public final class CallWithChatCompositeCallAndChatLocator extends CallWithChatCompositeJoinLocator {
|
||||
|
||||
private final UUID groupId;
|
||||
private final String chatThreadId;
|
||||
|
||||
/**
|
||||
* Creates {@link CallWithChatCompositeCallAndChatLocator}.
|
||||
* @param groupId Group call identifier.
|
||||
* @param chatThreadId Chat thread ID
|
||||
* @param endpoint ACS resource endpoint
|
||||
*/
|
||||
public CallWithChatCompositeCallAndChatLocator(final UUID groupId,
|
||||
final String chatThreadId,
|
||||
final String endpoint) {
|
||||
super(endpoint);
|
||||
this.groupId = groupId;
|
||||
this.chatThreadId = chatThreadId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get group call id.
|
||||
*
|
||||
* @return {@link UUID}
|
||||
*/
|
||||
public UUID getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public String getChatThreadId() {
|
||||
return chatThreadId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
|
||||
import com.azure.android.core.util.ExpandableStringEnum;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Defines values for CallWithChatCompositeErrorCode.
|
||||
*/
|
||||
public final class CallWithChatCompositeErrorCode extends ExpandableStringEnum<CallWithChatCompositeErrorCode> {
|
||||
|
||||
/**
|
||||
* Dispatched when there is a failure to join a call
|
||||
*/
|
||||
public static final CallWithChatCompositeErrorCode CALL_JOIN_FAILED = fromString("callJoinFailed");
|
||||
|
||||
/**
|
||||
* Dispatched when there is a failure to end a call
|
||||
*/
|
||||
public static final CallWithChatCompositeErrorCode CALL_END_FAILED = fromString("callEndFailed");
|
||||
|
||||
/**
|
||||
* Dispatched when the ACS Token supplied is no longer valid (expired)
|
||||
*/
|
||||
public static final CallWithChatCompositeErrorCode TOKEN_EXPIRED = fromString("tokenExpired");
|
||||
|
||||
//TODO: add chat related error codes
|
||||
|
||||
/**
|
||||
* Creates or finds a {@link CallWithChatCompositeErrorCode} from its string representation.
|
||||
*
|
||||
* @param name a name to look for.
|
||||
* @return the corresponding {@link CallWithChatCompositeErrorCode}.
|
||||
*/
|
||||
private static CallWithChatCompositeErrorCode fromString(final String name) {
|
||||
return fromString(name, CallWithChatCompositeErrorCode.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return known {@link CallWithChatCompositeErrorCode} values.
|
||||
*/
|
||||
public static Collection<CallWithChatCompositeErrorCode> values() {
|
||||
return values(CallWithChatCompositeErrorCode.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
public final class CallWithChatCompositeErrorEvent {
|
||||
private final Throwable cause;
|
||||
private final CallWithChatCompositeErrorCode code;
|
||||
|
||||
/**
|
||||
* Create {@link CallWithChatCompositeErrorEvent} with error code and caused throwable.
|
||||
*
|
||||
* @param code Error code {@link CallWithChatCompositeErrorCode}.
|
||||
* @param cause Throwable that caused an exception.
|
||||
*/
|
||||
public CallWithChatCompositeErrorEvent(final CallWithChatCompositeErrorCode code, final Throwable cause) {
|
||||
this.cause = cause;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cause of this throwable or {@code null} if the
|
||||
* cause is nonexistent or unknown. (The cause is the throwable that
|
||||
* caused this throwable to get thrown).
|
||||
*
|
||||
* @return the cause of this throwable or {@code null} if the
|
||||
* cause is nonexistent or unknown.
|
||||
*/
|
||||
public Throwable getCause() {
|
||||
return cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the event source.
|
||||
*
|
||||
* @return the call error code {@link CallWithChatCompositeErrorCode} instance.
|
||||
*/
|
||||
public CallWithChatCompositeErrorCode getErrorCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import com.azure.android.communication.ui.callwithchat.CallWithChatComposite;
|
||||
|
||||
/**
|
||||
* {@link CallWithChatCompositeEventHandler}<T>
|
||||
*
|
||||
* <p>A generic handler for call composite events.</p>
|
||||
* <p> - {@link CallWithChatComposite#addOnErrorEventHandler(CallWithChatCompositeEventHandler)} for Error Handling</p>
|
||||
* <p> - {@link CallWithChatComposite#removeOnErrorEventHandler(CallWithChatCompositeEventHandler)}
|
||||
* for Remote Participant Join Notifications</p>
|
||||
*
|
||||
* @param <T> The callback event Type.
|
||||
*/
|
||||
public interface CallWithChatCompositeEventHandler<T> {
|
||||
/**
|
||||
* A callback method to process error event of type T
|
||||
*
|
||||
* @param eventArgs {@link T}
|
||||
*/
|
||||
void handle(T eventArgs);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
/**
|
||||
* Call With Chat locator
|
||||
*/
|
||||
public abstract class CallWithChatCompositeJoinLocator {
|
||||
|
||||
protected final String endpoint;
|
||||
|
||||
protected CallWithChatCompositeJoinLocator(final String endpoint) {
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public String getEndpoint() {
|
||||
return endpoint;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
public final class CallWithChatCompositeLocalOptions {
|
||||
private final CallWithChatCompositeParticipantViewData participantViewData;
|
||||
|
||||
/**
|
||||
* Create Local Options.
|
||||
*
|
||||
* @param participantViewData The {@link CallWithChatCompositeParticipantViewData};
|
||||
*/
|
||||
public CallWithChatCompositeLocalOptions(final CallWithChatCompositeParticipantViewData participantViewData) {
|
||||
this.participantViewData = participantViewData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link CallWithChatCompositeParticipantViewData}.
|
||||
*
|
||||
* @return The {@link CallWithChatCompositeParticipantViewData};
|
||||
*/
|
||||
public CallWithChatCompositeParticipantViewData getParticipantViewData() {
|
||||
return participantViewData;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.azure.android.communication.ui.callwithchat.CallWithChatComposite;
|
||||
|
||||
public final class CallWithChatCompositeParticipantViewData {
|
||||
private Bitmap avatarBitmap;
|
||||
private String displayName;
|
||||
private ImageView.ScaleType scaleType = ImageView.ScaleType.FIT_XY;
|
||||
|
||||
/**
|
||||
* Set scaleType.
|
||||
*
|
||||
* Will not take affect if called after
|
||||
* {@link CallWithChatCompositeParticipantViewData} passed to {@link CallWithChatComposite}
|
||||
*
|
||||
* @return The {@link CallWithChatCompositeParticipantViewData};
|
||||
*/
|
||||
public CallWithChatCompositeParticipantViewData setScaleType(final ImageView.ScaleType scaleType) {
|
||||
this.scaleType = scaleType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get scaleType.
|
||||
*
|
||||
* Will not take affect if called after
|
||||
* {@link CallWithChatCompositeParticipantViewData} passed to {@link CallWithChatComposite}
|
||||
*
|
||||
* @return The {@link ImageView.ScaleType};
|
||||
*/
|
||||
public ImageView.ScaleType getScaleType() {
|
||||
return scaleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set display name.
|
||||
*
|
||||
* @return The {@link CallWithChatCompositeParticipantViewData};
|
||||
*/
|
||||
public CallWithChatCompositeParticipantViewData setDisplayName(final String displayName) {
|
||||
this.displayName = displayName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get display name.
|
||||
*
|
||||
* @return The {@link String};
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get avatar Bitmap.
|
||||
*
|
||||
* @return The {@link Bitmap};
|
||||
*/
|
||||
public Bitmap getAvatarBitmap() {
|
||||
return avatarBitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set avatar Bitmap.
|
||||
*
|
||||
* Will not take affect if called after
|
||||
* {@link CallWithChatCompositeParticipantViewData} passed to {@link CallWithChatComposite}
|
||||
*
|
||||
* @return The {@link CallWithChatCompositeParticipantViewData};
|
||||
*/
|
||||
public CallWithChatCompositeParticipantViewData setAvatarBitmap(final Bitmap avatarBitmap) {
|
||||
this.avatarBitmap = avatarBitmap;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import com.azure.android.communication.common.CommunicationIdentifier;
|
||||
import com.azure.android.communication.common.CommunicationTokenCredential;
|
||||
|
||||
public final class CallWithChatCompositeRemoteOptions {
|
||||
private final CommunicationIdentifier communicationIdentifier;
|
||||
// Mandatory
|
||||
private final CommunicationTokenCredential credential;
|
||||
private final CallWithChatCompositeJoinLocator locator;
|
||||
|
||||
// Optional
|
||||
private final String displayName;
|
||||
|
||||
/**
|
||||
* Create {@link CallWithChatCompositeRemoteOptions}.
|
||||
*
|
||||
* @param locator {@link CallWithChatCompositeJoinLocator}
|
||||
* @param credential {@link CommunicationTokenCredential}.
|
||||
*/
|
||||
public CallWithChatCompositeRemoteOptions(
|
||||
final CallWithChatCompositeJoinLocator locator,
|
||||
final CommunicationIdentifier communicationIdentifier,
|
||||
final CommunicationTokenCredential credential) {
|
||||
this(locator, communicationIdentifier, credential, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create {@link CallWithChatCompositeRemoteOptions}.
|
||||
*
|
||||
* @param locator {@link CallWithChatCompositeJoinLocator}
|
||||
* @param credential {@link CommunicationTokenCredential}
|
||||
* @param displayName User display name other call participants will see.
|
||||
*/
|
||||
public CallWithChatCompositeRemoteOptions(
|
||||
final CallWithChatCompositeJoinLocator locator,
|
||||
final CommunicationIdentifier communicationIdentifier,
|
||||
final CommunicationTokenCredential credential,
|
||||
final String displayName) {
|
||||
this.communicationIdentifier = communicationIdentifier;
|
||||
this.credential = credential;
|
||||
this.displayName = displayName;
|
||||
this.locator = locator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link CommunicationTokenCredential}.
|
||||
*
|
||||
* @return {@link String}.
|
||||
*/
|
||||
public CommunicationTokenCredential getCredential() {
|
||||
return credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user display name.
|
||||
*
|
||||
* @return {@link String}.
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get call locator.
|
||||
*
|
||||
* @return {@link CallWithChatCompositeJoinLocator}.
|
||||
*/
|
||||
public CallWithChatCompositeJoinLocator getLocator() {
|
||||
return locator;
|
||||
}
|
||||
|
||||
public CommunicationIdentifier getCommunicationIdentifier() {
|
||||
return communicationIdentifier;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import com.azure.android.communication.common.CommunicationIdentifier;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Remote participants joined event with communication identifiers.
|
||||
*/
|
||||
public final class CallWithChatCompositeRemoteParticipantJoinedEvent {
|
||||
private final Collection<CommunicationIdentifier> identifiers;
|
||||
|
||||
/**
|
||||
* Create {@link CallWithChatCompositeRemoteParticipantJoinedEvent} with user identifiers.
|
||||
*
|
||||
* @param identifiers {@link CommunicationIdentifier};
|
||||
*/
|
||||
public CallWithChatCompositeRemoteParticipantJoinedEvent(final Collection<CommunicationIdentifier> identifiers) {
|
||||
this.identifiers = identifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the communication identifiers.
|
||||
*
|
||||
* @return The collection of {@link CommunicationIdentifier};
|
||||
*/
|
||||
public Collection<CommunicationIdentifier> getIdentifiers() {
|
||||
return Collections.unmodifiableCollection(identifiers);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import com.azure.android.communication.common.CommunicationIdentifier;
|
||||
import com.azure.android.communication.ui.callwithchat.CallWithChatComposite;
|
||||
import com.azure.android.core.util.ExpandableStringEnum;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Result values for
|
||||
* {@link CallWithChatComposite#setRemoteParticipantViewData(
|
||||
* CommunicationIdentifier, CallWithChatCompositeParticipantViewData)}.
|
||||
*/
|
||||
public final class CallWithChatCompositeSetParticipantViewDataResult
|
||||
extends ExpandableStringEnum<CallWithChatCompositeSetParticipantViewDataResult> {
|
||||
|
||||
/**
|
||||
* The Remote Participant View Data was Successfully set.
|
||||
*/
|
||||
public static final CallWithChatCompositeSetParticipantViewDataResult SUCCESS = fromString("success");
|
||||
|
||||
/**
|
||||
* The Remote Participant was not in the call.
|
||||
*/
|
||||
public static final CallWithChatCompositeSetParticipantViewDataResult PARTICIPANT_NOT_IN_CALL
|
||||
= fromString("participantNotInCall");
|
||||
|
||||
/**
|
||||
* Creates or finds a {@link CallWithChatCompositeSetParticipantViewDataResult} from it's string representation.
|
||||
*
|
||||
* @param name a name to look for.
|
||||
* @return the corresponding {@link CallWithChatCompositeSetParticipantViewDataResult}.
|
||||
*/
|
||||
private static CallWithChatCompositeSetParticipantViewDataResult fromString(final String name) {
|
||||
return fromString(name, CallWithChatCompositeSetParticipantViewDataResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return known {@link CallWithChatCompositeSetParticipantViewDataResult} values.
|
||||
*/
|
||||
public static Collection<CallWithChatCompositeSetParticipantViewDataResult> values() {
|
||||
return values(CallWithChatCompositeSetParticipantViewDataResult.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.callwithchat.models;
|
||||
|
||||
import com.azure.android.communication.ui.callwithchat.CallWithChatComposite;
|
||||
|
||||
/**
|
||||
* Teams meeting locator to start group call with chat experience using {@link CallWithChatComposite}.
|
||||
*/
|
||||
public final class CallWithChatCompositeTeamsMeetingLinkLocator extends CallWithChatCompositeJoinLocator {
|
||||
private final String meetingLink;
|
||||
|
||||
/**
|
||||
* Creates {@link CallWithChatCompositeTeamsMeetingLinkLocator}
|
||||
*
|
||||
* @param meetingLink Teams meeting link, for more information please check Quickstart Doc.
|
||||
* @param endpoint ACS resource endpoint
|
||||
*/
|
||||
public CallWithChatCompositeTeamsMeetingLinkLocator(final String endpoint,
|
||||
final String meetingLink) {
|
||||
super(endpoint);
|
||||
this.meetingLink = meetingLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Teams meeting link.
|
||||
*
|
||||
* @return {@link String}
|
||||
*/
|
||||
public String getMeetingLink() {
|
||||
return meetingLink;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<!--
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
>
|
||||
<path
|
||||
android:fillColor="@color/azure_communication_ui_callwithchat_color_white"
|
||||
android:pathData="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10c-1.618 0-3.182-0.385-4.587-1.112l-3.826 1.067c-0.665 0.186-1.354-0.202-1.54-0.867-0.062-0.22-0.062-0.453 0-0.673l1.068-3.823C2.386 15.186 2 13.62 2 12 2 6.477 6.477 2 12 2zm0 1.5c-4.694 0-8.5 3.806-8.5 8.5 0 1.47 0.373 2.883 1.073 4.137l0.15 0.27-1.112 3.984 3.986-1.112 0.27 0.15C9.12 20.13 10.532 20.5 12 20.5c4.694 0 8.5-3.806 8.5-8.5S16.694 3.5 12 3.5zM8.75 13h4.498c0.415 0 0.75 0.336 0.75 0.75 0 0.38-0.282 0.694-0.648 0.743L13.248 14.5H8.75C8.336 14.5 8 14.164 8 13.75c0-0.38 0.282-0.694 0.648-0.743L8.75 13h4.498H8.75zm0-3.5h6.505c0.414 0 0.75 0.336 0.75 0.75 0 0.38-0.283 0.694-0.649 0.743L15.255 11H8.75C8.336 11 8 10.664 8 10.25c0-0.38 0.282-0.694 0.648-0.743L8.75 9.5h6.505H8.75z"
|
||||
/>
|
||||
</vector>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="azure_communication_ui_callwithchat_color_white">#FFFFFF</color>
|
||||
</resources>
|
|
@ -0,0 +1,16 @@
|
|||
package com.azure.android.communication.ui.callwithchat
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
|
@ -75,46 +75,11 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
calling {
|
||||
java.srcDirs = ['src/main/java','src/calling/java']
|
||||
res.srcDirs = ['src/main/res','src/calling/res']
|
||||
}
|
||||
chat {
|
||||
java.srcDirs = ['src/main/java','src/chat/java']
|
||||
res.srcDirs = ['src/main/res','src/chat/res']
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions 'product'
|
||||
productFlavors {
|
||||
chat {
|
||||
dimension 'product'
|
||||
println versionName
|
||||
}
|
||||
calling {
|
||||
dimension 'product'
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
multipleVariants('releaseCalling') {
|
||||
multipleVariants('release') {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
includeBuildTypeValues('release')
|
||||
includeFlavorDimensionAndValues(
|
||||
/*dimension =*/ 'product',
|
||||
/*values =*/ 'calling'
|
||||
)
|
||||
}
|
||||
multipleVariants('releaseChat') {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
includeBuildTypeValues('release')
|
||||
includeFlavorDimensionAndValues(
|
||||
/*dimension =*/ 'product',
|
||||
/*values =*/ 'chat'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,12 +92,12 @@ dependencies {
|
|||
implementation "androidx.constraintlayout:constraintlayout:$androidx_constraint_layout_version"
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:$androidx_navigation_fragment_ktx_version"
|
||||
|
||||
callingApi ("com.azure.android:azure-communication-calling:$azure_calling_sdk_version")
|
||||
callingImplementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidx_lifecycle_viewmodel_ktx_version"
|
||||
callingImplementation "com.microsoft.fluentui:fluentui_others:$microsoft_fluent_ui_version"
|
||||
callingImplementation "com.microsoft.fluentui:fluentui_drawer:$microsoft_fluent_ui_version"
|
||||
callingImplementation "com.microsoft.fluentui:fluentui_persona:$microsoft_fluent_ui_version"
|
||||
callingImplementation "com.microsoft.fluentui:fluentui_transients:$microsoft_fluent_ui_version"
|
||||
api ("com.azure.android:azure-communication-calling:$azure_calling_sdk_version")
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidx_lifecycle_viewmodel_ktx_version"
|
||||
implementation "com.microsoft.fluentui:fluentui_others:$microsoft_fluent_ui_version"
|
||||
implementation "com.microsoft.fluentui:fluentui_drawer:$microsoft_fluent_ui_version"
|
||||
implementation "com.microsoft.fluentui:fluentui_persona:$microsoft_fluent_ui_version"
|
||||
implementation "com.microsoft.fluentui:fluentui_transients:$microsoft_fluent_ui_version"
|
||||
|
||||
testImplementation "androidx.arch.core:core-testing:$androidx_core_testing_version"
|
||||
testImplementation "junit:junit:$junit_version"
|
||||
|
|
|
@ -4,7 +4,7 @@ jacoco {
|
|||
toolVersion = "$jacoco_version"
|
||||
}
|
||||
|
||||
task jacocoTestReport(type: JacocoReport, dependsOn: ['testCallingDebugUnitTest']) {
|
||||
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
|
||||
def coverageSourceDirs = [
|
||||
"src/main/java",
|
||||
"src/calling/java"
|
||||
|
@ -28,7 +28,7 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testCallingDebugUnitTest'
|
|||
classDirectories.setFrom(files([javaClasses], [kotlinClasses]))
|
||||
sourceDirectories.setFrom(files(coverageSourceDirs))
|
||||
executionData(fileTree(dir: "$buildDir", includes: [
|
||||
"jacoco/testCallingDebugUnitTest.exec"
|
||||
"jacoco/testDebugUnitTest.exec"
|
||||
]))
|
||||
reports {
|
||||
xml.required = true
|
||||
|
|
|
@ -30,7 +30,7 @@ publishing {
|
|||
}
|
||||
|
||||
publications {
|
||||
releaseCalling(MavenPublication) {
|
||||
release(MavenPublication) {
|
||||
pom {
|
||||
name = "${LIB_GROUP_ID}:${CALLING_LIB_ARTIFACT_ID}"
|
||||
description = CALLING_LIB_DESCRIPTION
|
||||
|
@ -59,39 +59,7 @@ publishing {
|
|||
version CALLING_LIB_VERSION
|
||||
|
||||
afterEvaluate {
|
||||
from components.releaseCalling
|
||||
}
|
||||
}
|
||||
releaseChat(MavenPublication) {
|
||||
pom {
|
||||
name = "${LIB_GROUP_ID}:${CHAT_LIB_ARTIFACT_ID}"
|
||||
description = CHAT_LIB_DESCRIPTION
|
||||
url = "https://github.com/Azure/communication-ui-library-android"
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name = 'MIT License'
|
||||
url = 'https://github.com/Azure/communication-ui-library-android/blob/main/LICENSE.md'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = 'Microsoft'
|
||||
name = 'Microsoft'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection = 'scm:git:git://github.com/Azure/communication-ui-library-android.git'
|
||||
developerConnection = 'scm:git:ssh:github.com:Azure/communication-ui-library-android.git'
|
||||
url = 'https://github.com/Azure/communication-ui-library-android'
|
||||
}
|
||||
}
|
||||
groupId LIB_GROUP_ID
|
||||
artifactId CHAT_LIB_ARTIFACT_ID
|
||||
version CHAT_LIB_VERSION
|
||||
|
||||
afterEvaluate {
|
||||
from components.releaseChat
|
||||
from components.release
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the MIT License.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.azure.android.communication.ui"
|
||||
>
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<application android:hardwareAccelerated="true">
|
||||
<uses-library
|
||||
android:name="org.apache.http.legacy"
|
||||
android:required="false"
|
||||
/>
|
||||
<activity
|
||||
android:name="com.azure.android.communication.ui.calling.presentation.CallCompositeActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AzureCommunicationUICalling.Theme"
|
||||
android:exported="false"
|
||||
/>
|
||||
<service
|
||||
android:name="com.azure.android.communication.ui.calling.service.InCallService"
|
||||
android:foregroundServiceType="microphone"
|
||||
android:stopWithTask="true"
|
||||
android:exported="false"
|
||||
/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -9,6 +9,14 @@
|
|||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<application android:hardwareAccelerated="true">
|
||||
<uses-library
|
||||
|
@ -16,6 +24,19 @@
|
|||
android:required="false"
|
||||
/>
|
||||
|
||||
<activity
|
||||
android:name="com.azure.android.communication.ui.calling.presentation.CallCompositeActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AzureCommunicationUICalling.Theme"
|
||||
android:exported="false"
|
||||
/>
|
||||
<service
|
||||
android:name="com.azure.android.communication.ui.calling.service.InCallService"
|
||||
android:foregroundServiceType="microphone"
|
||||
android:stopWithTask="true"
|
||||
android:exported="false"
|
||||
/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче