From 9ec984ef33641c4b07581db888321d88486032ec Mon Sep 17 00:00:00 2001 From: Davit Dolmazyan Date: Fri, 19 Jan 2024 17:39:45 +0200 Subject: [PATCH] Improve transitions btw Screens and minor UI fixes MOB 3002 --- .../res/raw/global_colors_unified_config.json | 4 +- .../widgets/base/FadeTransitionActivity.kt | 34 +++++ .../com/glia/widgets/call/CallActivity.java | 4 +- .../java/com/glia/widgets/call/CallView.kt | 6 +- .../EndScreenSharingActivity.kt | 4 +- .../com/glia/widgets/chat/ChatActivity.java | 4 +- .../EngagementCompletionActivityWatcher.kt | 4 +- .../messagecenter/MessageCenterActivity.kt | 6 +- .../glia/widgets/survey/SurveyActivity.java | 3 +- .../dialog/holder/DialogHolderActivity.kt | 5 +- .../theme/defaulttheme/Attachments.kt | 39 ++++-- .../view/unifiedui/theme/defaulttheme/Chat.kt | 130 ++++++++++-------- .../widgets/webbrowser/WebBrowserActivity.kt | 4 +- widgetssdk/src/main/res/anim/slide_down.xml | 5 + widgetssdk/src/main/res/anim/slide_up.xml | 5 + .../res/color/call_fab_bg_color_states.xml | 4 +- .../color/call_fab_ripple_color_states.xml | 2 +- .../src/main/res/layout-land/call_view.xml | 4 +- widgetssdk/src/main/res/layout/call_view.xml | 2 +- .../res/layout/chat_attachment_file_item.xml | 2 +- .../layout/chat_attachment_uploaded_item.xml | 2 +- .../src/main/res/layout/survey_view.xml | 1 + widgetssdk/src/main/res/values-v29/themes.xml | 8 +- widgetssdk/src/main/res/values/colors.xml | 7 +- widgetssdk/src/main/res/values/themes.xml | 6 +- ...ViewAudioSnapshotTest_audioCallStarted.png | 4 +- ...tTest_audioCallStartedWithGlobalColors.png | 4 +- ...apshotTest_audioCallStartedWithUiTheme.png | 4 +- ...tTest_audioCallStartedWithUnifiedTheme.png | 4 +- ...CallStartedWithUnifiedThemeWithoutCall.png | 4 +- ...all_CallViewAudioSnapshotTest_initCall.png | 4 +- ...oSnapshotTest_initCallWithGlobalColors.png | 4 +- ...wAudioSnapshotTest_initCallWithUiTheme.png | 4 +- ...oSnapshotTest_initCallWithUnifiedTheme.png | 4 +- ...st_initCallWithUnifiedThemeWithoutCall.png | 4 +- ....call_CallViewAudioSnapshotTest_onHold.png | 4 +- ...dioSnapshotTest_onHoldWithGlobalColors.png | 4 +- ...iewAudioSnapshotTest_onHoldWithUiTheme.png | 4 +- ...dioSnapshotTest_onHoldWithUnifiedTheme.png | 4 +- ...Test_onHoldWithUnifiedThemeWithoutCall.png | 4 +- ...iewAudioSnapshotTest_operatorConnected.png | 4 +- ...Test_operatorConnectedWithGlobalColors.png | 4 +- ...pshotTest_operatorConnectedWithUiTheme.png | 4 +- ...orConnectedWithUnifiedThemeWithoutCall.png | 4 +- ...all_CallViewVideoSnapshotTest_initCall.png | 4 +- ...oSnapshotTest_initCallWithGlobalColors.png | 4 +- ...wVideoSnapshotTest_initCallWithUiTheme.png | 4 +- ...oSnapshotTest_initCallWithUnifiedTheme.png | 4 +- ...st_initCallWithUnifiedThemeWithoutCall.png | 4 +- ....call_CallViewVideoSnapshotTest_onHold.png | 4 +- ...deoSnapshotTest_onHoldWithGlobalColors.png | 4 +- ...iewVideoSnapshotTest_onHoldWithUiTheme.png | 4 +- ...deoSnapshotTest_onHoldWithUnifiedTheme.png | 4 +- ...Test_onHoldWithUnifiedThemeWithoutCall.png | 4 +- ...iewVideoSnapshotTest_operatorConnected.png | 4 +- ...Test_operatorConnectedWithGlobalColors.png | 4 +- ...pshotTest_operatorConnectedWithUiTheme.png | 4 +- ...orConnectedWithUnifiedThemeWithoutCall.png | 4 +- ...VideoSnapshotTest_video1WayCallStarted.png | 4 +- ...t_video1WayCallStartedWithGlobalColors.png | 4 +- ...otTest_video1WayCallStartedWithUiTheme.png | 4 +- ...CallStartedWithUnifiedThemeWithoutCall.png | 4 +- ...VideoSnapshotTest_video2WayCallStarted.png | 4 +- ...t_video2WayCallStartedWithGlobalColors.png | 4 +- ...otTest_video2WayCallStartedWithUiTheme.png | 4 +- ...CallStartedWithUnifiedThemeWithoutCall.png | 4 +- ...eryItemViewHolderSnapshotTest_allViews.png | 4 +- ...rSnapshotTest_allViewsWithGlobalColors.png | 4 +- ...HolderSnapshotTest_allViewsWithUiTheme.png | 4 +- ...rSnapshotTest_allViewsWithUnifiedTheme.png | 4 +- ...est_allViewsWithUnifiedThemeWithoutGva.png | 4 +- ...ewHolderSnapshotTest_itemsWithChatHead.png | 4 +- ...Test_itemsWithChatHeadWithGlobalColors.png | 4 +- ...pshotTest_itemsWithChatHeadWithUiTheme.png | 4 +- ...Test_itemsWithChatHeadWithUnifiedTheme.png | 4 +- ...WithChatHeadWithUnifiedThemeWithoutGva.png | 4 +- ...olderSnapshotTest_itemsWithoutChatHead.png | 4 +- ...t_itemsWithoutChatHeadWithGlobalColors.png | 2 +- ...otTest_itemsWithoutChatHeadWithUiTheme.png | 4 +- ...t_itemsWithoutChatHeadWithUnifiedTheme.png | 4 +- ...houtChatHeadWithUnifiedThemeWithoutGva.png | 4 +- ...onsViewHolderSnapshotTest_withChatHead.png | 4 +- ...est_withChatHeadUnifiedThemeWithoutGva.png | 4 +- ...pshotTest_withChatHeadWithGlobalColors.png | 4 +- ...erSnapshotTest_withChatHeadWithUiTheme.png | 4 +- ...pshotTest_withChatHeadWithUnifiedTheme.png | 4 +- ...ViewHolderSnapshotTest_withoutChatHead.png | 4 +- ..._withoutChatHeadUnifiedThemeWithoutGva.png | 4 +- ...otTest_withoutChatHeadWithGlobalColors.png | 4 +- ...napshotTest_withoutChatHeadWithUiTheme.png | 4 +- ...otTest_withoutChatHeadWithUnifiedTheme.png | 4 +- ...extViewHolderSnapshotTest_withChatHead.png | 4 +- ...pshotTest_withChatHeadWithGlobalColors.png | 2 +- ...erSnapshotTest_withChatHeadWithUiTheme.png | 4 +- ...pshotTest_withChatHeadWithUnifiedTheme.png | 4 +- ...ViewHolderSnapshotTest_withoutChatHead.png | 4 +- ...otTest_withoutChatHeadWithGlobalColors.png | 4 +- ...napshotTest_withoutChatHeadWithUiTheme.png | 4 +- ...otTest_withoutChatHeadWithUnifiedTheme.png | 4 +- ...tViewHolderSnapshotTest_deliveredLabel.png | 4 +- ...hotTest_deliveredLabelWithGlobalColors.png | 4 +- ...SnapshotTest_deliveredLabelWithUiTheme.png | 4 +- ...hotTest_deliveredLabelWithUnifiedTheme.png | 4 +- ...lWithUnifiedThemeWithoutVisitorMessage.png | 4 +- ...hmentViewHolderSnapshotTest_errorLabel.png | 4 +- ...napshotTest_errorLabelWithGlobalColors.png | 4 +- ...lderSnapshotTest_errorLabelWithUiTheme.png | 4 +- ...napshotTest_errorLabelWithUnifiedTheme.png | 4 +- ...lWithUnifiedThemeWithoutVisitorMessage.png | 4 +- ...ntViewHolderSnapshotTest_withoutLabels.png | 4 +- ...shotTest_withoutLabelsWithGlobalColors.png | 4 +- ...rSnapshotTest_withoutLabelsWithUiTheme.png | 4 +- ...shotTest_withoutLabelsWithUnifiedTheme.png | 4 +- ...sWithUnifiedThemeWithoutVisitorMessage.png | 4 +- ...mentChatItemsSnapshotTest_defaultTheme.png | 4 +- ...ntChatItemsSnapshotTest_deliveredLabel.png | 4 +- ...hotTest_deliveredLabelWithGlobalColors.png | 4 +- ...SnapshotTest_deliveredLabelWithUiTheme.png | 4 +- ...hotTest_deliveredLabelWithUnifiedTheme.png | 4 +- ...lWithUnifiedThemeWithoutVisitorMessage.png | 4 +- ...chmentChatItemsSnapshotTest_errorLabel.png | 4 +- ...napshotTest_errorLabelWithGlobalColors.png | 4 +- ...temsSnapshotTest_errorLabelWithUiTheme.png | 4 +- ...napshotTest_errorLabelWithUnifiedTheme.png | 4 +- ...lWithUnifiedThemeWithoutVisitorMessage.png | 4 +- ...shotTest_withoutLabelsWithGlobalColors.png | 4 +- ...sSnapshotTest_withoutLabelsWithUiTheme.png | 4 +- ...shotTest_withoutLabelsWithUnifiedTheme.png | 4 +- ...sWithUnifiedThemeWithoutVisitorMessage.png | 4 +- ...orCodeDialogTest_errorWithUnifiedTheme.png | 2 +- 130 files changed, 393 insertions(+), 316 deletions(-) create mode 100644 widgetssdk/src/main/java/com/glia/widgets/base/FadeTransitionActivity.kt create mode 100644 widgetssdk/src/main/res/anim/slide_down.xml create mode 100644 widgetssdk/src/main/res/anim/slide_up.xml diff --git a/app/src/main/res/raw/global_colors_unified_config.json b/app/src/main/res/raw/global_colors_unified_config.json index f655a03c8..46036cd8b 100644 --- a/app/src/main/res/raw/global_colors_unified_config.json +++ b/app/src/main/res/raw/global_colors_unified_config.json @@ -2,11 +2,11 @@ "globalColors": { "primary": "#6c5ce7", "secondary": "#a29bfe", - "baseNormal": "#dfe6e9", + "baseNormal": "#a8afb2", "baseLight": "#dfe6e9", "baseDark": "#ffffff", "baseShade": "#fdcb6e", "baseNeutral": "#938cb3", "systemNegative": "#d63031" } -} \ No newline at end of file +} diff --git a/widgetssdk/src/main/java/com/glia/widgets/base/FadeTransitionActivity.kt b/widgetssdk/src/main/java/com/glia/widgets/base/FadeTransitionActivity.kt new file mode 100644 index 000000000..f33668a0a --- /dev/null +++ b/widgetssdk/src/main/java/com/glia/widgets/base/FadeTransitionActivity.kt @@ -0,0 +1,34 @@ +package com.glia.widgets.base + +import android.content.Intent +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity + +open class FadeTransitionActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out) + } + + override fun finish() { + super.finish() + overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out) + } + + override fun finishAndRemoveTask() { + super.finishAndRemoveTask() + overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out) + } + + override fun startActivity(intent: Intent?) { + super.startActivity(intent) + overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out) + } + + override fun startActivity(intent: Intent?, options: Bundle?) { + super.startActivity(intent, options) + overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out) + } + +} diff --git a/widgetssdk/src/main/java/com/glia/widgets/call/CallActivity.java b/widgetssdk/src/main/java/com/glia/widgets/call/CallActivity.java index 78eaeff45..a850c2595 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/call/CallActivity.java +++ b/widgetssdk/src/main/java/com/glia/widgets/call/CallActivity.java @@ -7,10 +7,10 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; -import androidx.appcompat.app.AppCompatActivity; import com.glia.widgets.GliaWidgets; import com.glia.widgets.R; +import com.glia.widgets.base.FadeTransitionActivity; import com.glia.widgets.chat.ChatActivity; import com.glia.widgets.core.configuration.GliaSdkConfiguration; import com.glia.widgets.helper.Logger; @@ -19,7 +19,7 @@ import java.util.Objects; -public class CallActivity extends AppCompatActivity { +public class CallActivity extends FadeTransitionActivity { private static final String TAG = CallActivity.class.getSimpleName(); private Configuration configuration; diff --git a/widgetssdk/src/main/java/com/glia/widgets/call/CallView.kt b/widgetssdk/src/main/java/com/glia/widgets/call/CallView.kt index 5dc634919..b56fdb31c 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/call/CallView.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/call/CallView.kt @@ -556,7 +556,7 @@ internal class CallView( private fun initConfigurations() { visibility = INVISIBLE - setBackgroundColor(getColorCompat(R.color.glia_transparent_black_bg)) + setBackgroundColor(getColorCompat(R.color.glia_call_view_background_color)) // needed to overlap existing app bar in existing view with this view's app bar. elevation = Constants.WIDGETS_SDK_LAYER_ELEVATION } @@ -620,7 +620,7 @@ internal class CallView( val activity = context.requireActivity() if (defaultStatusBarColor == null) { defaultStatusBarColor = activity.window.statusBarColor - changeStatusBarColor(getColorCompat(R.color.glia_transparent_black_bg)) + changeStatusBarColor(getColorCompat(R.color.glia_call_view_background_color)) } } @@ -875,7 +875,7 @@ internal class CallView( callState.isVideoCall ) { appBar.backgroundTintList = - getColorStateListCompat(R.color.glia_transparent_black_bg) + getColorStateListCompat(R.color.glia_call_view_background_color) } else { appBar.backgroundTintList = getColorStateListCompat(android.R.color.transparent) } diff --git a/widgetssdk/src/main/java/com/glia/widgets/callvisualizer/EndScreenSharingActivity.kt b/widgetssdk/src/main/java/com/glia/widgets/callvisualizer/EndScreenSharingActivity.kt index 22eb867ff..e0cced181 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/callvisualizer/EndScreenSharingActivity.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/callvisualizer/EndScreenSharingActivity.kt @@ -1,13 +1,13 @@ package com.glia.widgets.callvisualizer import android.os.Bundle -import androidx.appcompat.app.AppCompatActivity +import com.glia.widgets.base.FadeTransitionActivity import com.glia.widgets.databinding.EndScreenSharingActivityBinding import com.glia.widgets.di.Dependencies import com.glia.widgets.helper.Logger import com.glia.widgets.helper.TAG -class EndScreenSharingActivity : AppCompatActivity(), EndScreenSharingView.OnFinishListener { +class EndScreenSharingActivity : FadeTransitionActivity(), EndScreenSharingView.OnFinishListener { private lateinit var binding: EndScreenSharingActivityBinding diff --git a/widgetssdk/src/main/java/com/glia/widgets/chat/ChatActivity.java b/widgetssdk/src/main/java/com/glia/widgets/chat/ChatActivity.java index 538a496e7..c1c01bc9c 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/chat/ChatActivity.java +++ b/widgetssdk/src/main/java/com/glia/widgets/chat/ChatActivity.java @@ -7,11 +7,11 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import com.glia.widgets.GliaWidgets; import com.glia.widgets.R; import com.glia.widgets.UiTheme; +import com.glia.widgets.base.FadeTransitionActivity; import com.glia.widgets.call.CallActivity; import com.glia.widgets.call.Configuration; import com.glia.widgets.core.configuration.GliaSdkConfiguration; @@ -20,7 +20,7 @@ import java.util.Objects; -public class ChatActivity extends AppCompatActivity { +public class ChatActivity extends FadeTransitionActivity { private static final String TAG = ChatActivity.class.getSimpleName(); private ChatView chatView; diff --git a/widgetssdk/src/main/java/com/glia/widgets/engagement/completion/EngagementCompletionActivityWatcher.kt b/widgetssdk/src/main/java/com/glia/widgets/engagement/completion/EngagementCompletionActivityWatcher.kt index ddd1d0a38..f9fc2f2b7 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/engagement/completion/EngagementCompletionActivityWatcher.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/engagement/completion/EngagementCompletionActivityWatcher.kt @@ -9,6 +9,7 @@ import androidx.appcompat.app.AlertDialog import androidx.collection.ArrayMap import com.glia.androidsdk.engagement.Survey import com.glia.widgets.GliaWidgets +import com.glia.widgets.R import com.glia.widgets.UiTheme import com.glia.widgets.base.SimpleActivityLifecycleCallbacks import com.glia.widgets.engagement.completion.EngagementCompletionContract.State @@ -51,7 +52,8 @@ internal class EngagementCompletionActivityWatcher @JvmOverloads constructor( val newIntent: Intent = Intent(this, SurveyActivity::class.java) .putExtra(GliaWidgets.UI_THEME, theme) .putExtra(GliaWidgets.SURVEY, survey as Parcelable) - .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION) + + overridePendingTransition(R.anim.slide_up, 0) startActivity(newIntent) } } diff --git a/widgetssdk/src/main/java/com/glia/widgets/messagecenter/MessageCenterActivity.kt b/widgetssdk/src/main/java/com/glia/widgets/messagecenter/MessageCenterActivity.kt index bf5e96993..884194f9a 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/messagecenter/MessageCenterActivity.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/messagecenter/MessageCenterActivity.kt @@ -10,10 +10,10 @@ import androidx.activity.OnBackPressedCallback import androidx.activity.result.contract.ActivityResultContracts.GetContent import androidx.activity.result.contract.ActivityResultContracts.RequestPermission import androidx.activity.result.contract.ActivityResultContracts.TakePicture -import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.content.FileProvider import com.glia.widgets.GliaWidgets.CHAT_TYPE +import com.glia.widgets.base.FadeTransitionActivity import com.glia.widgets.chat.ChatActivity import com.glia.widgets.chat.ChatType import com.glia.widgets.core.configuration.GliaSdkConfiguration @@ -28,7 +28,7 @@ import com.glia.widgets.helper.mapUriToFileAttachment import java.io.IOException class MessageCenterActivity : - AppCompatActivity(), + FadeTransitionActivity(), MessageCenterView.OnFinishListener, MessageCenterView.OnNavigateToMessagingListener, MessageCenterView.OnAttachFileListener { @@ -144,7 +144,7 @@ class MessageCenterActivity : finish() } - private fun createConfiguration(intent: Intent): GliaSdkConfiguration? { + private fun createConfiguration(intent: Intent): GliaSdkConfiguration { return GliaSdkConfiguration.Builder() .intent(intent) .build() diff --git a/widgetssdk/src/main/java/com/glia/widgets/survey/SurveyActivity.java b/widgetssdk/src/main/java/com/glia/widgets/survey/SurveyActivity.java index f1367dd6e..eadfcc16f 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/survey/SurveyActivity.java +++ b/widgetssdk/src/main/java/com/glia/widgets/survey/SurveyActivity.java @@ -56,9 +56,8 @@ public void onFinish() { @Override public void finishAndRemoveTask() { + overridePendingTransition(0, R.anim.slide_down); super.finishAndRemoveTask(); - - overridePendingTransition(0, 0); } private void hideSoftKeyboard() { diff --git a/widgetssdk/src/main/java/com/glia/widgets/view/dialog/holder/DialogHolderActivity.kt b/widgetssdk/src/main/java/com/glia/widgets/view/dialog/holder/DialogHolderActivity.kt index 47f30a006..717093b69 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/view/dialog/holder/DialogHolderActivity.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/view/dialog/holder/DialogHolderActivity.kt @@ -7,13 +7,14 @@ import androidx.appcompat.app.AppCompatActivity internal class DialogHolderActivity : AppCompatActivity() { override fun finish() { - super.finish() overridePendingTransition(0, 0) + super.finish() } companion object { fun start(activity: Activity) { - activity.startActivity(Intent(activity, DialogHolderActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)) + activity.startActivity(Intent(activity, DialogHolderActivity::class.java)) + activity.overridePendingTransition(0, android.R.anim.fade_out) } } diff --git a/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Attachments.kt b/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Attachments.kt index 7c32d0380..78a6be72d 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Attachments.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Attachments.kt @@ -6,23 +6,32 @@ import com.glia.widgets.view.unifiedui.composeIfAtLeastOneNotNull import com.glia.widgets.view.unifiedui.theme.ColorPallet import com.glia.widgets.view.unifiedui.theme.chat.AttachmentItemTheme import com.glia.widgets.view.unifiedui.theme.chat.AttachmentsPopupTheme +import com.glia.widgets.view.unifiedui.theme.chat.UploadFileTheme /** * Default theme for Attachments popup */ -internal fun DefaultAttachmentsPopupTheme(pallet: ColorPallet): AttachmentsPopupTheme? = - pallet.run { - composeIfAtLeastOneNotNull(baseDarkColorTheme, baseShadeColorTheme, baseNeutralColorTheme) { - val attachmentItem = AttachmentItemTheme( - text = BaseDarkColorTextTheme(this), - iconColor = baseDarkColorTheme - ) - AttachmentsPopupTheme( - photoLibrary = attachmentItem, - takePhoto = attachmentItem, - browse = attachmentItem, - dividerColor = baseShadeColorTheme, - background = baseNeutralColorTheme - ) - } +internal fun DefaultAttachmentsPopupTheme(pallet: ColorPallet): AttachmentsPopupTheme? = pallet.run { + composeIfAtLeastOneNotNull(baseDarkColorTheme, baseShadeColorTheme, baseNeutralColorTheme) { + val attachmentItem = AttachmentItemTheme( + text = BaseDarkColorTextTheme(this), + iconColor = baseDarkColorTheme + ) + AttachmentsPopupTheme( + photoLibrary = attachmentItem, + takePhoto = attachmentItem, + browse = attachmentItem, + dividerColor = baseShadeColorTheme, + background = baseNeutralColorTheme + ) } +} + +/** + * Default theme for File upload bar item + */ +internal fun DefaultUploadFileTheme(pallet: ColorPallet): UploadFileTheme? = pallet.run { + composeIfAtLeastOneNotNull(baseNormalColorTheme, baseDarkColorTheme) { + UploadFileTheme(text = BaseNormalColorTextTheme(pallet), info = BaseDarkColorTextTheme(pallet)) + } +} diff --git a/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Chat.kt b/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Chat.kt index 1279b4919..13523fb3f 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Chat.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/view/unifiedui/theme/defaulttheme/Chat.kt @@ -8,35 +8,37 @@ import com.glia.widgets.view.unifiedui.theme.base.ButtonTheme import com.glia.widgets.view.unifiedui.theme.base.LayerTheme import com.glia.widgets.view.unifiedui.theme.base.TextTheme import com.glia.widgets.view.unifiedui.theme.chat.ChatTheme +import com.glia.widgets.view.unifiedui.theme.chat.FilePreviewTheme +import com.glia.widgets.view.unifiedui.theme.chat.FileUploadBarTheme import com.glia.widgets.view.unifiedui.theme.chat.InputTheme import com.glia.widgets.view.unifiedui.theme.chat.MediaUpgradeTheme import com.glia.widgets.view.unifiedui.theme.chat.MessageBalloonTheme import com.glia.widgets.view.unifiedui.theme.chat.ResponseCardOptionTheme import com.glia.widgets.view.unifiedui.theme.chat.ResponseCardTheme import com.glia.widgets.view.unifiedui.theme.chat.UnreadIndicatorTheme +import com.glia.widgets.view.unifiedui.theme.chat.UploadFileTheme /** * Default theme for Chat screen */ -internal fun ChatTheme(pallet: ColorPallet): ChatTheme = - ChatTheme( - background = LayerTheme(fill = pallet.baseLightColorTheme), - header = PrimaryColorHeaderTheme(pallet), - operatorMessage = ChatOperatorMessageTheme(pallet), - visitorMessage = ChatVisitorMessageTheme(pallet), - connect = ChatEngagementStatesTheme(pallet), - input = ChatInputTheme(pallet), - responseCard = ChatResponseCardTheme(pallet), - audioUpgrade = MediaUpgradeTheme(pallet), - videoUpgrade = MediaUpgradeTheme(pallet), - bubble = BubbleTheme(pallet), - attachmentsPopup = DefaultAttachmentsPopupTheme(pallet), - unreadIndicator = ChatUnreadIndicatorTheme(pallet), - typingIndicator = pallet.primaryColorTheme, - newMessagesDividerColorTheme = pallet.primaryColorTheme, - newMessagesDividerTextTheme = TextTheme(textColor = pallet.primaryColorTheme), - gva = GvaTheme(pallet) - ) +internal fun ChatTheme(pallet: ColorPallet): ChatTheme = ChatTheme( + background = LayerTheme(fill = pallet.baseLightColorTheme), + header = PrimaryColorHeaderTheme(pallet), + operatorMessage = ChatOperatorMessageTheme(pallet), + visitorMessage = ChatVisitorMessageTheme(pallet), + connect = ChatEngagementStatesTheme(pallet), + input = ChatInputTheme(pallet), + responseCard = ChatResponseCardTheme(pallet), + audioUpgrade = MediaUpgradeTheme(pallet), + videoUpgrade = MediaUpgradeTheme(pallet), + bubble = BubbleTheme(pallet), + attachmentsPopup = DefaultAttachmentsPopupTheme(pallet), + unreadIndicator = ChatUnreadIndicatorTheme(pallet), + typingIndicator = pallet.primaryColorTheme, + newMessagesDividerColorTheme = pallet.primaryColorTheme, + newMessagesDividerTextTheme = TextTheme(textColor = pallet.primaryColorTheme), + gva = GvaTheme(pallet) +) /** * Default theme for Audio and Video upgrade card @@ -64,9 +66,7 @@ private fun MediaUpgradeTheme(pallet: ColorPallet) = pallet.run { /** * Default theme for Operator Message */ -private fun ChatOperatorMessageTheme( - pallet: ColorPallet -): MessageBalloonTheme? = pallet.run { +private fun ChatOperatorMessageTheme(pallet: ColorPallet): MessageBalloonTheme? = pallet.run { val userImage = UserImageTheme(this) composeIfAtLeastOneNotNull(userImage, baseDarkColorTheme, baseNeutralColorTheme) { MessageBalloonTheme( @@ -82,9 +82,7 @@ private fun ChatOperatorMessageTheme( /** * Default theme for Visitor Message */ -private fun ChatVisitorMessageTheme( - pallet: ColorPallet -): MessageBalloonTheme? = pallet.run { +private fun ChatVisitorMessageTheme(pallet: ColorPallet): MessageBalloonTheme? = pallet.run { composeIfAtLeastOneNotNull(primaryColorTheme, baseLightColorTheme, baseNormalColorTheme) { MessageBalloonTheme( background = LayerTheme(fill = primaryColorTheme), @@ -98,53 +96,63 @@ private fun ChatVisitorMessageTheme( /** * Default theme for Response Card */ -private fun ChatResponseCardTheme(pallet: ColorPallet): ResponseCardTheme? { - return pallet.run { - composeIfAtLeastOneNotNull(primaryColorTheme, baseNeutralColorTheme, baseDarkColorTheme) { - ResponseCardTheme( - option = ResponseCardOptionTheme(normal = NeutralDefaultButtonTheme(this)), - background = LayerTheme( - fill = baseNeutralColorTheme, - stroke = primaryColorTheme?.primaryColor - ), - text = BaseDarkColorTextTheme(this) - ) - } +private fun ChatResponseCardTheme(pallet: ColorPallet): ResponseCardTheme? = pallet.run { + composeIfAtLeastOneNotNull(primaryColorTheme, baseNeutralColorTheme, baseDarkColorTheme) { + ResponseCardTheme( + option = ResponseCardOptionTheme(normal = NeutralDefaultButtonTheme(this)), + background = LayerTheme( + fill = baseNeutralColorTheme, + stroke = primaryColorTheme?.primaryColor + ), + text = BaseDarkColorTextTheme(this) + ) } } /** * Default theme for Input */ -private fun ChatInputTheme(pallet: ColorPallet): InputTheme? { - return pallet.run { - composeIfAtLeastOneNotNull( - baseDarkColorTheme, - baseNormalColorTheme, - primaryColorTheme, - baseShadeColorTheme - ) { - InputTheme( - text = BaseDarkColorTextTheme(this), - placeholder = BaseNormalColorTextTheme(pallet), - divider = baseShadeColorTheme, - sendButton = ButtonTheme(iconColor = primaryColorTheme), - mediaButton = ButtonTheme(iconColor = baseNormalColorTheme) +private fun ChatInputTheme(pallet: ColorPallet): InputTheme? = pallet.run { + composeIfAtLeastOneNotNull( + baseDarkColorTheme, + baseNormalColorTheme, + primaryColorTheme, + baseShadeColorTheme, + systemNegativeColorTheme + ) { + InputTheme( + text = BaseDarkColorTextTheme(this), + placeholder = BaseNormalColorTextTheme(this), + divider = baseShadeColorTheme, + sendButton = ButtonTheme(iconColor = primaryColorTheme), + mediaButton = ButtonTheme(iconColor = baseNormalColorTheme), + fileUploadBar = FileUploadBarTheme( + filePreview = FilePreviewTheme( + text = BaseLightColorTextTheme(this), + errorIcon = systemNegativeColorTheme, + background = LayerTheme(baseNeutralColorTheme), + errorBackground = LayerTheme(systemNegativeColorTheme) + ), + uploading = DefaultUploadFileTheme(this), + uploaded = DefaultUploadFileTheme(this), + error = UploadFileTheme(text = BaseNegativeColorTextTheme(this), info = BaseDarkColorTextTheme(this)), + progress = primaryColorTheme, + errorProgress = systemNegativeColorTheme, + removeButton = baseNormalColorTheme ) - } + ) } } /** * Default theme for Unread messages indicator */ -private fun ChatUnreadIndicatorTheme(pallet: ColorPallet): UnreadIndicatorTheme? = - pallet.run { - val bubble = BubbleTheme(this) - composeIfAtLeastOneNotNull(bubble, baseLightColorTheme) { - UnreadIndicatorTheme( - background = baseLightColorTheme, - bubble = bubble - ) - } +private fun ChatUnreadIndicatorTheme(pallet: ColorPallet): UnreadIndicatorTheme? = pallet.run { + val bubble = BubbleTheme(this) + composeIfAtLeastOneNotNull(bubble, baseLightColorTheme) { + UnreadIndicatorTheme( + background = baseLightColorTheme, + bubble = bubble + ) } +} diff --git a/widgetssdk/src/main/java/com/glia/widgets/webbrowser/WebBrowserActivity.kt b/widgetssdk/src/main/java/com/glia/widgets/webbrowser/WebBrowserActivity.kt index d581bc5f7..235718684 100644 --- a/widgetssdk/src/main/java/com/glia/widgets/webbrowser/WebBrowserActivity.kt +++ b/widgetssdk/src/main/java/com/glia/widgets/webbrowser/WebBrowserActivity.kt @@ -4,12 +4,12 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Bundle -import androidx.appcompat.app.AppCompatActivity +import com.glia.widgets.base.FadeTransitionActivity import com.glia.widgets.databinding.WebBrowserAvtivityBinding internal class WebBrowserActivity : - AppCompatActivity(), + FadeTransitionActivity(), WebBrowserView.OnFinishListener, WebBrowserView.OnLinkClickListener { diff --git a/widgetssdk/src/main/res/anim/slide_down.xml b/widgetssdk/src/main/res/anim/slide_down.xml new file mode 100644 index 000000000..513e54ddb --- /dev/null +++ b/widgetssdk/src/main/res/anim/slide_down.xml @@ -0,0 +1,5 @@ + + diff --git a/widgetssdk/src/main/res/anim/slide_up.xml b/widgetssdk/src/main/res/anim/slide_up.xml new file mode 100644 index 000000000..4557e6d78 --- /dev/null +++ b/widgetssdk/src/main/res/anim/slide_up.xml @@ -0,0 +1,5 @@ + + diff --git a/widgetssdk/src/main/res/color/call_fab_bg_color_states.xml b/widgetssdk/src/main/res/color/call_fab_bg_color_states.xml index d9f7c4e18..e0b39be3a 100644 --- a/widgetssdk/src/main/res/color/call_fab_bg_color_states.xml +++ b/widgetssdk/src/main/res/color/call_fab_bg_color_states.xml @@ -1,6 +1,6 @@ - + - + diff --git a/widgetssdk/src/main/res/color/call_fab_ripple_color_states.xml b/widgetssdk/src/main/res/color/call_fab_ripple_color_states.xml index c57381d63..51c96480b 100644 --- a/widgetssdk/src/main/res/color/call_fab_ripple_color_states.xml +++ b/widgetssdk/src/main/res/color/call_fab_ripple_color_states.xml @@ -1,5 +1,5 @@ - + diff --git a/widgetssdk/src/main/res/layout-land/call_view.xml b/widgetssdk/src/main/res/layout-land/call_view.xml index d225339aa..648b3d7ec 100644 --- a/widgetssdk/src/main/res/layout-land/call_view.xml +++ b/widgetssdk/src/main/res/layout-land/call_view.xml @@ -134,7 +134,7 @@ android:id="@+id/top_app_bar" android:layout_width="0dp" android:layout_height="wrap_content" - android:backgroundTint="@color/glia_transparent_black_bg" + android:backgroundTint="@color/glia_call_view_background_color" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -157,7 +157,7 @@ android:id="@+id/buttons_layout_bg" android:layout_width="0dp" android:layout_height="wrap_content" - android:background="@color/glia_transparent_black_bg" + android:background="@color/glia_call_view_background_color" app:layout_constrainedHeight="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/widgetssdk/src/main/res/layout/call_view.xml b/widgetssdk/src/main/res/layout/call_view.xml index 62d293ce0..47a53308a 100644 --- a/widgetssdk/src/main/res/layout/call_view.xml +++ b/widgetssdk/src/main/res/layout/call_view.xml @@ -8,7 +8,7 @@ android:id="@+id/top_app_bar" android:layout_width="0dp" android:layout_height="wrap_content" - android:backgroundTint="@color/glia_transparent_black_bg" + android:backgroundTint="@color/glia_call_view_background_color" app:elevation="0dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/widgetssdk/src/main/res/layout/chat_attachment_file_item.xml b/widgetssdk/src/main/res/layout/chat_attachment_file_item.xml index 8140e1fdc..c14a544cc 100644 --- a/widgetssdk/src/main/res/layout/chat_attachment_file_item.xml +++ b/widgetssdk/src/main/res/layout/chat_attachment_file_item.xml @@ -63,7 +63,7 @@ android:layout_marginTop="4dp" android:layout_marginEnd="12dp" tools:text="@string/glia_chat_attachment_download_button_label" - android:textColor="@color/glia_transparent_black_bg" + android:textColor="@color/glia_base_dark_color" android:textSize="14sp" android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" diff --git a/widgetssdk/src/main/res/layout/chat_attachment_uploaded_item.xml b/widgetssdk/src/main/res/layout/chat_attachment_uploaded_item.xml index 70e8f7970..0fbe02302 100644 --- a/widgetssdk/src/main/res/layout/chat_attachment_uploaded_item.xml +++ b/widgetssdk/src/main/res/layout/chat_attachment_uploaded_item.xml @@ -77,7 +77,7 @@ android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginTop="4dp" - android:textColor="@color/glia_transparent_black_bg" + android:textColor="@color/glia_base_dark_color" android:textSize="14sp" android:textStyle="bold" app:layout_constraintEnd_toStartOf="@id/remove_item_button" diff --git a/widgetssdk/src/main/res/layout/survey_view.xml b/widgetssdk/src/main/res/layout/survey_view.xml index 3461ac27c..38901c25b 100644 --- a/widgetssdk/src/main/res/layout/survey_view.xml +++ b/widgetssdk/src/main/res/layout/survey_view.xml @@ -8,6 +8,7 @@ android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="match_parent" + app:cardElevation="8dp" android:layout_marginTop="32dp"> diff --git a/widgetssdk/src/main/res/values/colors.xml b/widgetssdk/src/main/res/values/colors.xml index b31322ed1..6b0dffe3b 100644 --- a/widgetssdk/src/main/res/values/colors.xml +++ b/widgetssdk/src/main/res/values/colors.xml @@ -12,8 +12,13 @@ #D11149 #F3F3F3 - #B3000000 + + #232323 + @color/glia_transparent_black_bg + + @color/glia_black_color + @color/glia_transparent_black_buttons_bg #F3F3F3 #4D6C7683 diff --git a/widgetssdk/src/main/res/values/themes.xml b/widgetssdk/src/main/res/values/themes.xml index f0df63db2..289b11ca7 100644 --- a/widgetssdk/src/main/res/values/themes.xml +++ b/widgetssdk/src/main/res/values/themes.xml @@ -96,8 +96,12 @@