NTP-2431 | Crm call widget (#12401)
This commit is contained in:
@@ -41,31 +41,37 @@ data class NaviChatCallStatusWidget(
|
||||
) : NaviChatWidget, NaviChatCallStatusWidgetInfo, Serializable {
|
||||
|
||||
companion object {
|
||||
const val WIDGET_NAME = "CHAT_CALL_STATUS_WIDGET"
|
||||
const val WIDGET_NAME = "CALL_STATUS_WIDGET"
|
||||
}
|
||||
|
||||
override fun messageId(): String? = messageId
|
||||
|
||||
override fun title(): TextWithStyle? = widgetData?.title
|
||||
override fun title(): TextWithStyle? = widgetData?.callStatusCustomerData?.title
|
||||
|
||||
override fun subtitle(): TextWithStyle? = widgetData?.subtitle
|
||||
override fun subtitle(): TextWithStyle? = widgetData?.callStatusCustomerData?.subtitle
|
||||
|
||||
override fun metaData(): NaviChatMetaData? = widgetData?.metaData
|
||||
override fun metaData(): NaviChatMetaData? = widgetData?.callStatusCustomerData?.metaData
|
||||
|
||||
override fun senderName(): String? = widgetData?.senderName
|
||||
override fun senderName(): String? = widgetData?.callStatusCustomerData?.senderName
|
||||
|
||||
override fun timeStamp(): Timestamp? = rt_created_at
|
||||
|
||||
override fun displayIconUrl(): String? = widgetData?.displayIconUrl
|
||||
override fun displayIconUrl(): String? = widgetData?.callStatusCustomerData?.displayIconUrl
|
||||
|
||||
override fun imgUrl(): String? = widgetData?.imgUrl
|
||||
override fun imgUrl(): String? = widgetData?.callStatusCustomerData?.imgUrl
|
||||
|
||||
override fun bgColor(): String? = widgetData?.bgColor
|
||||
override fun bgColor(): String? = widgetData?.callStatusCustomerData?.bgColor
|
||||
|
||||
override fun borderColor(): String? = widgetData?.borderColor
|
||||
override fun borderColor(): String? = widgetData?.callStatusCustomerData?.borderColor
|
||||
}
|
||||
|
||||
data class NaviChatCallStatusData(
|
||||
@get:PropertyName(NAVI_CHAT_CALL_STATUS_CUSTOMER_DATA)
|
||||
@SerializedName(NAVI_CHAT_CALL_STATUS_CUSTOMER_DATA)
|
||||
val callStatusCustomerData: NaviChatCallStatusCustomerData? = null
|
||||
) : Serializable
|
||||
|
||||
data class NaviChatCallStatusCustomerData(
|
||||
@get:PropertyName(NAVI_CHAT_TITLE)
|
||||
@SerializedName(NAVI_CHAT_TITLE)
|
||||
val title: TextWithStyle? = null,
|
||||
|
||||
@@ -41,6 +41,7 @@ const val NAVI_CHAT_PREVIOUS_NODE_UUID = "previous_node_uuid"
|
||||
const val NAVI_CHAT_NEXT_NODE_UUID = "next_node_uuid"
|
||||
const val NAVI_CHAT_WIDGET_NAME = "widget_name"
|
||||
const val NAVI_CHAT_WIDGET_DATA = "widget_data"
|
||||
const val NAVI_CHAT_CALL_STATUS_CUSTOMER_DATA = "call_status_customer_data"
|
||||
const val NAVI_CHAT_META_DATA = "meta_data"
|
||||
const val IS_GROOT_DEEPLINK = "is_groot_deeplink"
|
||||
const val NEEDS_RESULT = "needs_result"
|
||||
|
||||
@@ -858,6 +858,9 @@ object NaviWidgetIconUtils {
|
||||
private const val GALLERY_ICON = "GALLERY_ICON"
|
||||
private const val DOCUMENT_ICON = "DOCUMENT_ICON"
|
||||
private const val AUDIO_ICON = "AUDIO_ICON"
|
||||
private const val NAVI_CHAT_CALL_CONNECTED_ICON = "NAVI_CHAT_CALL_CONNECTED_ICON"
|
||||
private const val NAVI_CHAT_CALL_ENDED_ICON = "NAVI_CHAT_CALL_ENDED_ICON"
|
||||
private const val NAVI_CHAT_MISSED_CALL_ICON = "NAVI_CHAT_MISSED_CALL_ICON"
|
||||
private const val ScratchCardImage = "SCRATCH_CARD_IMAGE"
|
||||
|
||||
fun updateIcon(
|
||||
@@ -1748,6 +1751,9 @@ object NaviWidgetIconUtils {
|
||||
GALLERY_ICON -> R.drawable.ic_gallery_icon_new
|
||||
DOCUMENT_ICON -> R.drawable.ic_file_manager_icon_new
|
||||
AUDIO_ICON -> R.drawable.ic_audio_preview_purple
|
||||
NAVI_CHAT_CALL_CONNECTED_ICON -> R.drawable.ic_chat_call_connected_purple
|
||||
NAVI_CHAT_CALL_ENDED_ICON -> R.drawable.ic_chat_call_ended_purple
|
||||
NAVI_CHAT_MISSED_CALL_ICON -> R.drawable.ic_chat_missed_call_purple
|
||||
ScratchCardImage -> R.drawable.scratch_card_overlay
|
||||
else -> -1
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M4,0L40,0A4,4 0,0 1,44 4L44,40A4,4 0,0 1,40 44L4,44A4,4 0,0 1,0 40L0,4A4,4 0,0 1,4 0z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M26.43,27.853L28.5,26.324C29.42,25.614 30.69,25.684 31.47,26.534L35.78,31.482C36.56,32.402 36.49,33.742 35.57,34.521L32.39,37.28C31.82,37.77 31.05,38.06 30.34,37.99C27.51,37.92 20.52,36.651 12.96,27.393C12.96,27.393 4.83,17.716 7.02,10.579C7.16,10.009 7.51,9.519 8.01,9.099L11.26,6.48C12.18,5.77 13.45,5.84 14.23,6.76L18.33,11.418C19.11,12.268 19.04,13.608 18.19,14.388L15.93,16.577C15.44,16.997 15.29,17.707 15.58,18.276C16.36,20.256 18.69,24.844 24.41,28.163C24.98,28.513 25.75,28.443 26.25,28.023L26.44,27.853H26.43Z"
|
||||
android:fillColor="#1F002A"/>
|
||||
<path
|
||||
android:pathData="M23.4,8.639C23.48,7.87 24.17,7.32 24.93,7.4C28.09,7.73 31.04,9.139 33.3,11.369C35.56,13.608 36.98,16.547 37.34,19.706C37.43,20.476 36.88,21.166 36.11,21.246C35.34,21.335 34.65,20.786 34.57,20.016C34.28,17.487 33.15,15.137 31.34,13.348C29.54,11.559 27.17,10.439 24.64,10.169C23.87,10.089 23.32,9.399 23.4,8.639Z"
|
||||
android:fillColor="#1F002A"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M23.42,14.098C23.57,13.338 24.3,12.849 25.06,12.998C26.71,13.318 28.22,14.138 29.4,15.328C30.58,16.517 31.37,18.047 31.68,19.696C31.82,20.456 31.32,21.186 30.56,21.326C29.8,21.466 29.07,20.966 28.93,20.206C28.73,19.107 28.2,18.087 27.41,17.297C26.62,16.497 25.62,15.958 24.52,15.748C23.76,15.598 23.27,14.868 23.42,14.108V14.098Z"
|
||||
android:fillColor="#1F002A"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M4,0L40,0A4,4 0,0 1,44 4L44,40A4,4 0,0 1,40 44L4,44A4,4 0,0 1,0 40L0,4A4,4 0,0 1,4 0z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M15.287,24.19C15.217,25.25 14.477,26.09 13.478,26.11H7.849C6.81,26.11 6,25.27 6,24.17V20.33C6,19.63 6.25,18.94 6.7,18.51C8.329,16.59 13.098,12.54 23.355,12.85C23.355,12.85 34.201,13.04 37.59,18.8C37.88,19.23 38,19.78 38,20.36L37.86,24.15C37.79,25.21 37.05,26.05 36.011,26.02L30.682,26.07C29.693,26.09 28.873,25.25 28.833,24.2L28.673,21.34C28.673,20.74 28.293,20.24 27.773,20.09C26.054,19.44 21.765,18.31 16.387,20.26C15.847,20.43 15.347,20.84 15.347,21.41L15.297,24.19H15.287Z"
|
||||
android:fillColor="#1F002A"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M4,0L40,0A4,4 0,0 1,44 4L44,40A4,4 0,0 1,40 44L4,44A4,4 0,0 1,0 40L0,4A4,4 0,0 1,4 0z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M26.949,27.853L29.02,26.324C29.94,25.614 31.209,25.684 31.99,26.534L36.299,31.482C37.079,32.402 37.009,33.742 36.09,34.521L32.91,37.28C32.34,37.77 31.569,38.06 30.86,37.99C28.029,37.92 21.039,36.651 13.479,27.393C13.479,27.393 5.35,17.716 7.54,10.579C7.68,10.009 8.03,9.519 8.53,9.099L11.78,6.48C12.7,5.77 13.969,5.84 14.75,6.76L18.85,11.418C19.629,12.268 19.559,13.608 18.709,14.388L16.449,16.577C15.96,16.997 15.809,17.707 16.1,18.276C16.879,20.256 19.209,24.844 24.93,28.163C25.5,28.513 26.27,28.443 26.77,28.023L26.959,27.853H26.949Z"
|
||||
android:fillColor="#1F002A"/>
|
||||
<path
|
||||
android:pathData="M28.85,22.365C32.39,22.365 35.25,19.496 35.25,15.967C35.25,12.438 32.38,9.569 28.85,9.569C25.32,9.569 22.45,12.438 22.45,15.967C22.45,19.496 25.32,22.365 28.85,22.365Z"
|
||||
android:fillColor="#EF0000"/>
|
||||
<path
|
||||
android:pathData="M26.587,12.909L25.803,13.694L31.119,19.01L31.904,18.226L26.587,12.909Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M25.801,18.228L26.586,19.013L31.903,13.697L31.118,12.913L25.801,18.228Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,12m-11.625,0a11.625,11.625 0,1 1,23.25 0a11.625,11.625 0,1 1,-23.25 0"
|
||||
android:strokeWidth="0.75"
|
||||
android:fillColor="#ffffff"
|
||||
android:strokeColor="#EBEBEB"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M3,3h18v18h-18z"/>
|
||||
<path
|
||||
android:pathData="M11.25,18.75V17.25H17.25V11.925C17.25,11.2 17.112,10.519 16.837,9.881C16.563,9.244 16.188,8.688 15.712,8.212C15.238,7.738 14.681,7.363 14.044,7.088C13.406,6.813 12.725,6.675 12,6.675C11.275,6.675 10.594,6.813 9.956,7.088C9.319,7.363 8.762,7.738 8.288,8.212C7.813,8.688 7.438,9.244 7.162,9.881C6.887,10.519 6.75,11.2 6.75,11.925V16.5H6C5.588,16.5 5.234,16.353 4.941,16.06C4.647,15.766 4.5,15.413 4.5,15V13.5C4.5,13.212 4.569,12.959 4.706,12.74C4.844,12.522 5.025,12.344 5.25,12.206L5.306,11.212C5.419,10.3 5.678,9.475 6.085,8.738C6.491,8 6.997,7.375 7.603,6.863C8.21,6.35 8.891,5.953 9.647,5.672C10.403,5.391 11.188,5.25 12,5.25C12.825,5.25 13.616,5.391 14.372,5.672C15.128,5.953 15.806,6.353 16.406,6.872C17.006,7.391 17.51,8.016 17.916,8.747C18.322,9.478 18.581,10.294 18.694,11.194L18.75,12.169C18.975,12.281 19.156,12.447 19.294,12.665C19.431,12.884 19.5,13.125 19.5,13.387V15.113C19.5,15.387 19.431,15.631 19.294,15.844C19.156,16.056 18.975,16.219 18.75,16.331V17.25C18.75,17.663 18.603,18.016 18.31,18.31C18.016,18.603 17.663,18.75 17.25,18.75H11.25ZM9.75,13.5C9.538,13.5 9.359,13.428 9.216,13.284C9.072,13.141 9,12.962 9,12.75C9,12.538 9.072,12.359 9.216,12.215C9.359,12.072 9.538,12 9.75,12C9.962,12 10.141,12.072 10.285,12.215C10.428,12.359 10.5,12.538 10.5,12.75C10.5,12.962 10.428,13.141 10.285,13.284C10.141,13.428 9.962,13.5 9.75,13.5ZM14.25,13.5C14.038,13.5 13.859,13.428 13.716,13.284C13.572,13.141 13.5,12.962 13.5,12.75C13.5,12.538 13.572,12.359 13.716,12.215C13.859,12.072 14.038,12 14.25,12C14.462,12 14.641,12.072 14.785,12.215C14.928,12.359 15,12.538 15,12.75C15,12.962 14.928,13.141 14.785,13.284C14.641,13.428 14.462,13.5 14.25,13.5ZM7.519,12.337C7.469,11.6 7.572,10.931 7.828,10.331C8.085,9.731 8.428,9.222 8.859,8.803C9.29,8.384 9.788,8.063 10.35,7.838C10.913,7.613 11.475,7.5 12.038,7.5C13.175,7.5 14.16,7.859 14.991,8.578C15.822,9.297 16.325,10.194 16.5,11.269C15.325,11.256 14.262,10.941 13.313,10.321C12.363,9.703 11.644,8.9 11.156,7.912C10.956,8.925 10.535,9.822 9.891,10.603C9.247,11.384 8.456,11.962 7.519,12.337Z"
|
||||
android:fillColor="#3C0050"/>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~
|
||||
~ * Copyright © 2024 by Navi Technologies Limited
|
||||
~ * All rights reserved. Strictly confidential
|
||||
~
|
||||
-->
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:visibility="gone"
|
||||
android:id="@+id/cvReceivedMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
app:cardCornerRadius="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:layout_marginEnd="@dimen/dp_1"
|
||||
app:cardElevation="@dimen/dp_2"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivReceivedMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_navi_chat_call_agent_logo" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/logo"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<include
|
||||
android:id="@+id/logoLayout"
|
||||
layout="@layout/layout_navi_chat_logo"
|
||||
layout="@layout/layout_navi_chat_call_agent_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user