-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mob 3604 devs want to implement business logic for the engagement launcher approach #1094
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did great work but could youplease separate your changes to smaller PRs. It is very hard to review such big PRs
/** | ||
* Use with {@link android.os.Bundle} to pass in a {@link UiTheme} as a navigation argument when | ||
* navigating to {@link com.glia.widgets.chat.ChatActivity} | ||
* | ||
* @deprecated While UiTheme can still be used for UI customization, | ||
* we strongly encourage adopting remote configurations {@link GliaWidgetsConfig.Builder#setUiJsonRemoteConfig(String)}. | ||
* The remote configurations approach is more versatile and better suited for future development. | ||
*/ | ||
@Deprecated | ||
public static final String UI_THEME = "ui_theme"; | ||
/** | ||
* Use with {@link android.os.Bundle} to pass in the name of your company as a navigation | ||
* argument when navigating to {@link com.glia.widgets.chat.ChatActivity} | ||
* | ||
* @deprecated Use {@link com.glia.widgets.GliaWidgetsConfig.Builder#companyName} | ||
* or customize the strings from GliaHub | ||
*/ | ||
@Deprecated | ||
public static final String COMPANY_NAME = "company_name"; | ||
|
||
/** | ||
* Use with {@link android.os.Bundle} to pass in the ID of the queue you wish to enroll in | ||
* as a navigation argument when navigating to {@link com.glia.widgets.chat.ChatActivity} | ||
* or {@link com.glia.widgets.call.CallActivity} | ||
* | ||
* @deprecated Use {QUEUE_IDS} instead. | ||
*/ | ||
@Deprecated | ||
public static final String QUEUE_ID = "queue_id"; | ||
|
||
/** | ||
* Use with {@link android.os.Bundle} to pass in an {@link java.util.ArrayList} of {@link String} of the queues IDs | ||
* you wish to enroll in as a navigation argument when navigating to {@link com.glia.widgets.chat.ChatActivity} | ||
* or {@link com.glia.widgets.call.CallActivity} | ||
*/ | ||
public static final String QUEUE_IDS = "queue_ids"; | ||
/** | ||
* Use with {@link android.os.Bundle} to pass in a context url as a navigation | ||
* argument when navigating to {@link com.glia.widgets.chat.ChatActivity} | ||
* | ||
* @deprecated Use {@link com.glia.widgets.GliaWidgets#CONTEXT_ASSET_ID} | ||
*/ | ||
@Deprecated | ||
public static final String CONTEXT_URL = "context_url"; | ||
/** | ||
* Use with {@link android.os.Bundle} to pass in a context asset ID as a navigation | ||
* argument when navigating to {@link com.glia.widgets.chat.ChatActivity} | ||
*/ | ||
public static final String CONTEXT_ASSET_ID = "context_asset_id"; | ||
/** | ||
* It's recommended to use {@link GliaWidgetsConfig.Builder#setUseOverlay(boolean)} ()} instead of this constant directly. | ||
* Use with {@link android.os.Bundle} to pass in a boolean which represents if you would like to use the chat head bubble | ||
* as an overlay outside your application for navigating to {@link com.glia.widgets.chat.ChatActivity}. | ||
* If set to true then the SDK will ask for overlay permissions and try to always show the navigation bubble outside | ||
* the application. However, it will be shown only if the user has accepted the permissions. | ||
* If false, then overlay permission is not requested and the navigation bubble is shown when the application is active. | ||
* Default value is true. | ||
* | ||
* @deprecated Use {@link com.glia.widgets.GliaWidgetsConfig#isEnableBubbleOutsideApp() and | ||
* {@link GliaWidgetsConfig#isEnableBubbleInsideApp()} | ||
*/ | ||
@Deprecated | ||
public static final String USE_OVERLAY = "use_overlay"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove of depricated properties should be a separate commit and even separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed all the properties that are useless
after these PR changes because they’re mainly used for intent extras that we closed from integrators, so there aren’t only the deprecated ones.
This is part of the breaking changes we will introduce in version 3.0.0. Do you think we need to somehow separate deprecated ones?
@@ -208,6 +115,7 @@ private static void setupQueueIds(@Nullable List<String> queueIds) { | |||
* | |||
* <p>This method is no-op for other non-Glia triggered results.</p> | |||
*/ | |||
//TODO check the possibilities to remove this method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be done in this PR or should we create a separate jira ticket for this?
/** | ||
* Text to be shown on the top of the app bar in the chat | ||
*/ | ||
val appBarTitle: String? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be a separate PR. Also, the release notes should be mentioned in the PR section as breaking changes. Same for the removed deprecated properties so that we could communicate this in the 3.0.0 release and migration guides
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property internally was not in use, so had no effect for a while, that is why I removed it.
Regarding release notes and migration guides, relying on the fact that we made activities internal and introduced EngagementLauncher
instead should fully cover the migration part.
@@ -40,9 +42,8 @@ import kotlin.properties.Delegates | |||
* startActivity(intent); | |||
</pre> * | |||
*/ | |||
class CallActivity : FadeTransitionActivity() { | |||
internal class CallActivity : FadeTransitionActivity() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Finally! I tried to do this twice only to find there are still public methods/classes that require this to be public. Very cool that it is internal at last!
val chatType = intent.getIntExtra(ExtraKeys.CHAT_TYPE, -1).takeIf { it != -1 } | ||
?.let { ChatType.values()[it] } ?: ChatType.LIVE_CHAT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you extract this code to some to some IntentExtentions
class with a method name fun Intent.getChatType
and also extract any calls to intent.putExtra(CHAT_TYPE, ChatType.SECURE_MESSAGING as Parcelable)
to the same class with a name intent.putChatType()
.
I know that technically your solution is completely safe even for any future changes to enums but I really would still prefer to have such logic in one place.
val mediaType = intent.getIntExtra(ExtraKeys.MEDIA_TYPE, -1) | ||
.takeIf { it != -1 }?.let { Engagement.MediaType.values()[it] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented similar logic below
@@ -226,6 +134,7 @@ public static void onRequestPermissionsResult(int requestCode, String[] permissi | |||
* | |||
* <p>This method is no-op for other non-Glia triggered results.</p> | |||
*/ | |||
//TODO check the possibilities to remove this method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as Alex asked for another TODO, is this going to be done in this PR or should we create a separate Jira ticket for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove TODOs, I think it makes sense to have separate tickets for these two functions.
Do you think it makes sense to include this in this project?
This should be unused since we introduced ActivityWatchers
for screen sharing and permissions, but unfortunately, we forgot to deprecate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a separate ticket is better. It doesn't seem to be essential for our current projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will mark these methods as deprecated since we're not using them anymore.
widgetssdk/src/main/java/com/glia/widgets/callvisualizer/EndScreenSharingView.kt
Show resolved
Hide resolved
widgetssdk/src/main/java/com/glia/widgets/chat/adapter/holder/OperatorStatusViewHolder.kt
Outdated
Show resolved
Hide resolved
widgetssdk/src/main/java/com/glia/widgets/view/head/ChatHeadLayout.kt
Outdated
Show resolved
Hide resolved
widgetssdk/src/main/java/com/glia/widgets/view/head/ChatHeadLayout.kt
Outdated
Show resolved
Hide resolved
Thank you guys for your review. |
Taking into account the work done already, it makes sense to proceed with this PR, isn't it? Otherwise we would have to review everything once again. Not sure how to do better. |
I'd also prefer to proceed with this PR, but I'm also ready to split it if you really want it. |
- Remove all the configurations in favor of ConfigurationManager - Get rid of configurations passed through Activity extras - Move extra keys to internal class - Make activities internal - Minor refactoring
445b8d7
to
2b1f447
Compare
4c3922c
into
feature/entry-widget-and-secure-conversations-v2
Jira issue:
https://glia.atlassian.net/browse/MOB-3604
What was solved?
Release notes:
Additional info:
Screenshots: