Skip to content

Commit

Permalink
Rename bubble use cases to align the terminology
Browse files Browse the repository at this point in the history
MOB-3281
  • Loading branch information
andrews-moc committed Sep 3, 2024
1 parent 32f9075 commit 167d8de
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import com.glia.widgets.engagement.domain.IsCurrentEngagementCallVisualizerUseCa
import com.glia.widgets.engagement.domain.IsQueueingOrEngagementUseCase
import com.glia.widgets.engagement.domain.ScreenSharingUseCase

internal class IsDisplayApplicationChatHeadUseCase(
internal class IsDisplayBubbleInsideAppUseCase(
isQueueingOrEngagementUseCase: IsQueueingOrEngagementUseCase,
isCurrentEngagementCallVisualizerUseCase: IsCurrentEngagementCallVisualizerUseCase,
screenSharingUseCase: ScreenSharingUseCase,
permissionManager: PermissionManager,
configurationManager: GliaSdkConfigurationManager,
engagementTypeUseCase: EngagementTypeUseCase
) : IsDisplayChatHeadUseCase(
) : IsDisplayBubbleUseCase(
isQueueingOrEngagementUseCase,
isCurrentEngagementCallVisualizerUseCase,
screenSharingUseCase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import com.glia.widgets.helper.TAG
* 1) determines whether the chat head (bubble) should be displayed
* 2) starts or stops the chat head service (bubble outside the app)
*/
internal class ToggleChatHeadServiceUseCase(
internal class IsDisplayBubbleOutsideAppUseCase(
isQueueingOrEngagementUseCase: IsQueueingOrEngagementUseCase,
isCurrentEngagementCallVisualizerUseCase: IsCurrentEngagementCallVisualizerUseCase,
screenSharingUseCase: ScreenSharingUseCase,
private val chatHeadManager: ChatHeadManager,
permissionManager: PermissionManager,
configurationManager: GliaSdkConfigurationManager,
engagementTypeUseCase: EngagementTypeUseCase
) : IsDisplayChatHeadUseCase(
) : IsDisplayBubbleUseCase(
isQueueingOrEngagementUseCase,
isCurrentEngagementCallVisualizerUseCase,
screenSharingUseCase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.glia.widgets.filepreview.ui.FilePreviewView
import com.glia.widgets.helper.DialogHolderView
import com.glia.widgets.messagecenter.MessageCenterView

internal abstract class IsDisplayChatHeadUseCase(
internal abstract class IsDisplayBubbleUseCase(
private val isQueueingOrEngagementUseCase: IsQueueingOrEngagementUseCase,
private val isCurrentEngagementCallVisualizerUseCase: IsCurrentEngagementCallVisualizerUseCase,
private val screenSharingUseCase: ScreenSharingUseCase,
Expand Down
24 changes: 12 additions & 12 deletions widgetssdk/src/main/java/com/glia/widgets/di/UseCaseFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
import com.glia.widgets.core.callvisualizer.domain.IsCallVisualizerScreenSharingUseCase;
import com.glia.widgets.core.callvisualizer.domain.VisitorCodeViewBuilderUseCase;
import com.glia.widgets.core.chathead.ChatHeadManager;
import com.glia.widgets.core.chathead.domain.IsDisplayApplicationChatHeadUseCase;
import com.glia.widgets.core.chathead.domain.IsDisplayBubbleInsideAppUseCase;
import com.glia.widgets.core.chathead.domain.ResolveChatHeadNavigationUseCase;
import com.glia.widgets.core.chathead.domain.ToggleChatHeadServiceUseCase;
import com.glia.widgets.core.chathead.domain.IsDisplayBubbleOutsideAppUseCase;
import com.glia.widgets.core.configuration.GliaSdkConfigurationManager;
import com.glia.widgets.core.dialog.DialogContract;
import com.glia.widgets.core.dialog.PermissionDialogManager;
Expand Down Expand Up @@ -201,8 +201,8 @@ public class UseCaseFactory {
private static CallNotificationUseCase callNotificationUseCase;
private static ShowScreenSharingNotificationUseCase showScreenSharingNotificationUseCase;
private static RemoveScreenSharingNotificationUseCase removeScreenSharingNotificationUseCase;
private static ToggleChatHeadServiceUseCase toggleChatHeadServiceUseCase;
private static IsDisplayApplicationChatHeadUseCase isDisplayApplicationChatHeadUseCase;
private static IsDisplayBubbleOutsideAppUseCase isDisplayBubbleOutsideAppUseCase;
private static IsDisplayBubbleInsideAppUseCase isDisplayBubbleInsideAppUseCase;
private static ResolveChatHeadNavigationUseCase resolveChatHeadNavigationUseCase;
private static VisitorCodeViewBuilderUseCase visitorCodeViewBuilderUseCase;
private final RepositoryFactory repositoryFactory;
Expand Down Expand Up @@ -270,9 +270,9 @@ public MapOperatorPlainTextUseCase createMapOperatorPlainTextUseCase() {
}

@NonNull
public ToggleChatHeadServiceUseCase getToggleChatHeadServiceUseCase() {
if (toggleChatHeadServiceUseCase == null) {
toggleChatHeadServiceUseCase = new ToggleChatHeadServiceUseCase(
public IsDisplayBubbleOutsideAppUseCase getToggleChatHeadServiceUseCase() {
if (isDisplayBubbleOutsideAppUseCase == null) {
isDisplayBubbleOutsideAppUseCase = new IsDisplayBubbleOutsideAppUseCase(
getIsQueueingOrEngagementUseCase(),
getIsCurrentEngagementCallVisualizer(),
getScreenSharingUseCase(),
Expand All @@ -282,13 +282,13 @@ public ToggleChatHeadServiceUseCase getToggleChatHeadServiceUseCase() {
getEngagementTypeUseCase()
);
}
return toggleChatHeadServiceUseCase;
return isDisplayBubbleOutsideAppUseCase;
}

@NonNull
public IsDisplayApplicationChatHeadUseCase getIsDisplayApplicationChatHeadUseCase() {
if (isDisplayApplicationChatHeadUseCase == null) {
isDisplayApplicationChatHeadUseCase = new IsDisplayApplicationChatHeadUseCase(
public IsDisplayBubbleInsideAppUseCase getIsDisplayApplicationChatHeadUseCase() {
if (isDisplayBubbleInsideAppUseCase == null) {
isDisplayBubbleInsideAppUseCase = new IsDisplayBubbleInsideAppUseCase(
getIsQueueingOrEngagementUseCase(),
getIsCurrentEngagementCallVisualizer(),
getScreenSharingUseCase(),
Expand All @@ -297,7 +297,7 @@ public IsDisplayApplicationChatHeadUseCase getIsDisplayApplicationChatHeadUseCas
getEngagementTypeUseCase()
);
}
return isDisplayApplicationChatHeadUseCase;
return isDisplayBubbleInsideAppUseCase;
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.os.Bundle
import android.view.View
import com.glia.widgets.R
import com.glia.widgets.base.FadeTransitionActivity
import com.glia.widgets.core.chathead.domain.IsDisplayChatHeadUseCase
import com.glia.widgets.view.head.ActivityWatcherForChatHead

/**
Expand Down Expand Up @@ -39,7 +38,6 @@ internal class DialogHolderActivity : FadeTransitionActivity() {
*
* This is a view used to make the [DialogHolderActivity] recognizable by the services that draw the chat bubble.
* @see [ActivityWatcherForChatHead.fetchGliaOrRootView]
* @see [IsDisplayChatHeadUseCase.isNotInListOfGliaViewsExceptChat]
*/
internal class DialogHolderView(context: Context) : View(context) {
init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.glia.widgets.view.head.controller

import com.glia.androidsdk.Operator
import com.glia.widgets.core.callvisualizer.domain.IsCallVisualizerScreenSharingUseCase
import com.glia.widgets.core.chathead.domain.IsDisplayApplicationChatHeadUseCase
import com.glia.widgets.core.chathead.domain.IsDisplayBubbleInsideAppUseCase
import com.glia.widgets.core.chathead.domain.ResolveChatHeadNavigationUseCase
import com.glia.widgets.core.chathead.domain.ResolveChatHeadNavigationUseCase.Destinations
import com.glia.widgets.engagement.ScreenSharingState
Expand All @@ -17,7 +17,7 @@ import com.glia.widgets.view.head.ChatHeadLayoutContract
import com.glia.widgets.engagement.State as EngagementState

internal class ApplicationChatHeadLayoutController(
private val isDisplayApplicationChatHeadUseCase: IsDisplayApplicationChatHeadUseCase,
private val isDisplayBubbleInsideAppUseCase: IsDisplayBubbleInsideAppUseCase,
private val navigationDestinationUseCase: ResolveChatHeadNavigationUseCase,
private val messagesNotSeenHandler: MessagesNotSeenHandler,
private val isCallVisualizerScreenSharingUseCase: IsCallVisualizerScreenSharingUseCase,
Expand Down Expand Up @@ -110,7 +110,7 @@ internal class ApplicationChatHeadLayoutController(
}

override fun shouldShow(gliaOrRootViewName: String?): Boolean {
return isDisplayApplicationChatHeadUseCase(gliaOrRootViewName)
return isDisplayBubbleInsideAppUseCase(gliaOrRootViewName)
}

override fun onResume(viewName: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.glia.widgets.UiTheme
import com.glia.widgets.core.callvisualizer.domain.IsCallVisualizerScreenSharingUseCase
import com.glia.widgets.core.chathead.domain.ResolveChatHeadNavigationUseCase
import com.glia.widgets.core.chathead.domain.ResolveChatHeadNavigationUseCase.Destinations
import com.glia.widgets.core.chathead.domain.ToggleChatHeadServiceUseCase
import com.glia.widgets.core.chathead.domain.IsDisplayBubbleOutsideAppUseCase
import com.glia.widgets.core.configuration.EngagementConfiguration
import com.glia.widgets.di.Dependencies
import com.glia.widgets.engagement.domain.CurrentOperatorUseCase
Expand All @@ -23,7 +23,7 @@ import com.glia.widgets.view.head.ChatHeadPosition
import com.glia.widgets.engagement.State as EngagementState

internal class ServiceChatHeadController(
private val toggleChatHeadServiceUseCase: ToggleChatHeadServiceUseCase,
private val isDisplayBubbleOutsideAppUseCase: IsDisplayBubbleOutsideAppUseCase,
private val resolveChatHeadNavigationUseCase: ResolveChatHeadNavigationUseCase,
messagesNotSeenHandler: MessagesNotSeenHandler,
private var _chatHeadPosition: ChatHeadPosition,
Expand Down Expand Up @@ -67,7 +67,7 @@ internal class ServiceChatHeadController(

// see the comment on the resumedViewName field declaration above
if (!isResumedView(view)) return
toggleChatHeadServiceUseCase(view?.javaClass?.simpleName)
isDisplayBubbleOutsideAppUseCase(view?.javaClass?.simpleName)
}

override fun onPause(gliaOrRootView: View?) {
Expand All @@ -80,7 +80,7 @@ internal class ServiceChatHeadController(

override fun onApplicationStop() {
d(TAG, "onApplicationStop()")
toggleChatHeadServiceUseCase(null)
isDisplayBubbleOutsideAppUseCase(null)
}

override fun onChatHeadPositionChanged(x: Int, y: Int) {
Expand Down Expand Up @@ -134,7 +134,7 @@ internal class ServiceChatHeadController(
}

private fun toggleChatHead() {
toggleChatHeadServiceUseCase(resumedViewName)
isDisplayBubbleOutsideAppUseCase(resumedViewName)
}

override fun updateChatHeadView() {
Expand All @@ -151,7 +151,7 @@ internal class ServiceChatHeadController(
}

private fun engagementEnded() {
toggleChatHeadServiceUseCase.onDestroy()
isDisplayBubbleOutsideAppUseCase.onDestroy()
isOnHold = false
state = State.ENDED
operatorProfileImgUrl = null
Expand All @@ -163,7 +163,7 @@ internal class ServiceChatHeadController(
private fun newEngagementLoaded() {
isOnHold = false
state = State.ENGAGEMENT
toggleChatHeadServiceUseCase(resumedViewName)
isDisplayBubbleOutsideAppUseCase(resumedViewName)
if (engagementConfiguration == null) setEngagementConfiguration(
Dependencies.sdkConfigurationManager.buildEngagementConfiguration()
)
Expand All @@ -172,7 +172,7 @@ internal class ServiceChatHeadController(

private fun queueingStarted() {
state = State.QUEUEING
toggleChatHeadServiceUseCase(resumedViewName)
isDisplayBubbleOutsideAppUseCase(resumedViewName)
if (engagementConfiguration == null) setEngagementConfiguration(
Dependencies.sdkConfigurationManager.buildEngagementConfiguration()
)
Expand Down

0 comments on commit 167d8de

Please sign in to comment.