Skip to content

Commit

Permalink
fixup! Implement the POC for Entry Widget
Browse files Browse the repository at this point in the history
- resolve merge conflicts
  • Loading branch information
andrews-moc authored and DavDo committed Sep 15, 2024
1 parent d38a6d9 commit 9b93d0d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 229 deletions.
6 changes: 2 additions & 4 deletions app/src/main/java/com/glia/exampleapp/MainFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ class MainFragment : Fragment() {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
context?.let {
GliaWidgets.getNavigator(
ArrayList(getQueueIdsFromPrefs(sharedPreferences)),
getContextAssetIdFromPrefs(sharedPreferences)
ArrayList(getQueueIdsFromPrefs(sharedPreferences))
).startAudioCall(it)
}
// val intent = Intent(context, CallActivity::class.java)
Expand Down Expand Up @@ -602,8 +601,7 @@ class MainFragment : Fragment() {

context?.let {
val navigator = GliaWidgets.getNavigator(
ArrayList(getQueueIdsFromPrefs(sharedPreferences)),
getContextAssetIdFromPrefs(sharedPreferences)
ArrayList(getQueueIdsFromPrefs(sharedPreferences))
)
val entryWidget = EntryWidget(navigator)
entryWidget.show(getParentFragmentManager())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import com.glia.widgets.di.ControllerFactory
import com.glia.widgets.di.Dependencies
import com.glia.widgets.helper.ResourceProvider
import com.glia.widgets.locale.LocaleProvider
import com.glia.widgets.locale.StringKeyPair
import com.glia.widgets.view.head.ChatHeadContract
import io.mockk.CapturingSlot
import io.mockk.every
Expand Down
5 changes: 2 additions & 3 deletions widgetssdk/src/main/java/com/glia/widgets/GliaWidgets.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ public static CallVisualizer getCallVisualizer() {
return Dependencies.getCallVisualizerManager();
}

public static Navigator getNavigator(@Nullable ArrayList<String> queues,
@Nullable String contextAssetId) { // TODO: 01.08.2024 Wrap all params to some object? Ideally existing one, not new because there are to many config classes already.
return Dependencies.getNavigator(queues, contextAssetId);
public static Navigator getNavigator(@Nullable ArrayList<String> queues) { // TODO: 01.08.2024 Wrap all params to some object? Ideally existing one, not new because there are to many config classes already.
return Dependencies.getNavigator(queues);
}

/**
Expand Down
5 changes: 2 additions & 3 deletions widgetssdk/src/main/java/com/glia/widgets/Navigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.glia.widgets.di.Dependencies
*/
class Navigator(private val queueIds: ArrayList<String>?, private val contextAssetId: String?) {

private val gliaWidgetsConfig = Dependencies.getSdkConfigurationManager().createWidgetsConfiguration()
private val gliaWidgetsConfig = Dependencies.sdkConfigurationManager.buildEngagementConfiguration()

fun startChat(context: Context) {
// Navigate to chat
Expand All @@ -22,8 +22,7 @@ class Navigator(private val queueIds: ArrayList<String>?, private val contextAss
val intent = Intent(context, CallActivity::class.java)
.putExtra(GliaWidgets.QUEUE_IDS, queueIds)
.putExtra(GliaWidgets.CONTEXT_ASSET_ID, contextAssetId)
.putExtra(GliaWidgets.UI_THEME, Dependencies.getSdkConfigurationManager().uiTheme)
.putExtra(GliaWidgets.USE_OVERLAY, gliaWidgetsConfig?.useOverlay)
.putExtra(GliaWidgets.UI_THEME, Dependencies.sdkConfigurationManager.uiTheme)
.putExtra(GliaWidgets.SCREEN_SHARING_MODE, gliaWidgetsConfig?.screenSharingMode)
.putExtra(GliaWidgets.MEDIA_TYPE, Engagement.MediaType.AUDIO)
context.startActivity(intent)
Expand Down
217 changes: 0 additions & 217 deletions widgetssdk/src/main/java/com/glia/widgets/call/CallActivity.kt

This file was deleted.

6 changes: 6 additions & 0 deletions widgetssdk/src/main/java/com/glia/widgets/di/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.lifecycle.LifecycleOwner
import com.glia.androidsdk.Glia
import com.glia.androidsdk.GliaConfig
import com.glia.widgets.GliaWidgetsConfig
import com.glia.widgets.Navigator
import com.glia.widgets.StringProvider
import com.glia.widgets.callvisualizer.CallVisualizerActivityWatcher
import com.glia.widgets.core.audio.AudioControlManager
Expand Down Expand Up @@ -198,6 +199,11 @@ internal object Dependencies {
authenticationManagerProvider.authenticationManager = authenticationManager
}

@JvmStatic
fun getNavigator(queues: ArrayList<String>?): Navigator {
return Navigator(queues, null)
}

private fun initApplicationLifecycleObserver(
lifecycleManager: ApplicationLifecycleManager,
chatBubbleController: ChatHeadContract.Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import android.provider.Settings
import androidx.core.net.toUri
import com.glia.androidsdk.Engagement.MediaType
import com.glia.widgets.call.CallActivityIntentHelper
import com.glia.widgets.call.CallConfiguration
import com.glia.widgets.di.Dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.core.util.Pair
import androidx.core.view.contains
import com.glia.widgets.R
import com.glia.widgets.base.BaseActivityStackWatcher
import com.glia.widgets.call.CallActivity
import com.glia.widgets.call.CallActivityIntentHelper.createIntent
import com.glia.widgets.call.CallConfiguration
import com.glia.widgets.callvisualizer.EndScreenSharingActivity
Expand Down

0 comments on commit 9b93d0d

Please sign in to comment.