TP-30263 | agent photo (#7093)
* TP-30263 | agent photo * TP-30263 | agent photo ui bugs * TP-30263 | added timeout from backend * TP-30263 | python cleanup * TP-30263 | python cleanup * TP-30263 | reverted changes * TP-30263 | changed mock * TP-30263 | removed mock --------- Co-authored-by: sharmapoojabalrambhai <sharma.balrambhai@navi.com> Co-authored-by: Shivam Goyal <shivam.goyal@navi.com>
This commit is contained in:
@@ -11,11 +11,17 @@ import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.common.model.RequestConfig
|
||||
import com.navi.naviwidgets.models.response.ImageFieldData
|
||||
import com.navi.naviwidgets.models.response.TextFieldData
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class VkycStatus(
|
||||
@SerializedName("status") val status: String,
|
||||
@SerializedName("agentName") val agentName: TextFieldData? = null,
|
||||
@SerializedName("agentImage") val agentImage: ImageFieldData? = null,
|
||||
@SerializedName("agentConnectedToast") val agentConnectedToast: TextFieldData? = null,
|
||||
@SerializedName("agentConnectedToastTimeout") val agentConnectedToastTimeout: Long? = null,
|
||||
@SerializedName("nextCta") val nextCtaData: CtaData,
|
||||
@SerializedName("requestConfig") val requestConfig: RequestConfig,
|
||||
) : Parcelable
|
||||
|
||||
@@ -387,6 +387,7 @@ class VKYCWaitingForExecutiveFragment : BaseFragment(), NaviHeaderView.Interacti
|
||||
)
|
||||
isNavigating = true
|
||||
stopVkycAgentPolling()
|
||||
arguments?.putParcelable(VKYC_AGENT_STATUS, it)
|
||||
(requireActivity() as VKYCActivity).navigateToScreen(
|
||||
VkycScreens.VKYC_MEETING_ROOM.name,
|
||||
arguments
|
||||
@@ -496,6 +497,7 @@ class VKYCWaitingForExecutiveFragment : BaseFragment(), NaviHeaderView.Interacti
|
||||
|
||||
companion object {
|
||||
const val TAG = "VKYCWaitingForExecutiveFragment"
|
||||
const val VKYC_AGENT_STATUS = "VKYC_AGENT_STATUS"
|
||||
private const val DEFAULT_SLIDE_PERIOD_TIME = 3500L
|
||||
private const val FOUR_SECONDS = 4L
|
||||
private const val ONE_SECOND = 1L
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
package com.navi.vkyc.presentation.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.view.isVisible
|
||||
@@ -22,14 +26,19 @@ import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.VKYC_SHOULD_SHOW_FLIP_CAMERA_BUTTON
|
||||
import com.navi.common.model.vkyc.VKYCBgConfig
|
||||
import com.navi.common.model.vkyc.VKYCScreenConfig
|
||||
import com.navi.common.model.vkyc.VkycStatus
|
||||
import com.navi.common.ui.activity.BaseActivity
|
||||
import com.navi.common.ui.fragment.BaseFragment
|
||||
import com.navi.design.utils.dpToPxInInt
|
||||
import com.navi.design.utils.getNaviDrawable
|
||||
import com.navi.design.utils.parseColorSafe
|
||||
import com.navi.design.utils.spannedText
|
||||
import com.navi.naviwidgets.extensions.setImageFieldData
|
||||
import com.navi.naviwidgets.extensions.setTextFieldData
|
||||
import com.navi.naviwidgets.extensions.setVisibilityState
|
||||
import com.navi.vkyc.databinding.VkycFullscreenMeetingRoomFragmentBinding
|
||||
import com.navi.vkyc.presentation.activity.VKYCActivity
|
||||
import com.navi.vkyc.presentation.fragments.VKYCWaitingForExecutiveFragment.Companion.VKYC_AGENT_STATUS
|
||||
import com.navi.vkyc.presentation.view.NaviHeaderView
|
||||
import com.navi.vkyc.presentation.viewmodel.VKYCViewModel
|
||||
import com.navi.vkyc.presentation.viewmodel.VKycFullScreenViewModel
|
||||
@@ -50,6 +59,7 @@ class VKycFullScreenMeetingRoomFragment : BaseFragment(), NaviHeaderView.Interac
|
||||
|
||||
private lateinit var vkycViewModel: VKYCViewModel
|
||||
private val vKycFullScreenViewModel by viewModels<VKycFullScreenViewModel>()
|
||||
private var vkycAgentStatus: VkycStatus? = null
|
||||
|
||||
|
||||
private lateinit var binding: VkycFullscreenMeetingRoomFragmentBinding
|
||||
@@ -72,6 +82,7 @@ class VKycFullScreenMeetingRoomFragment : BaseFragment(), NaviHeaderView.Interac
|
||||
)
|
||||
binding.vm = vKycFullScreenViewModel
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
this.vkycAgentStatus = arguments?.getParcelable(VKYC_AGENT_STATUS)
|
||||
initError(vkycViewModel, actionErrorV2Enabled = true)
|
||||
initUi()
|
||||
initObservers()
|
||||
@@ -80,6 +91,25 @@ class VKycFullScreenMeetingRoomFragment : BaseFragment(), NaviHeaderView.Interac
|
||||
private fun initUi() {
|
||||
binding.videoSurfaceView.keepScreenOn = true
|
||||
binding.ivSwitchCamera.isVisible = FirebaseRemoteConfigHelper.getBoolean(VKYC_SHOULD_SHOW_FLIP_CAMERA_BUTTON)
|
||||
setVkycAgentImageAndName()
|
||||
}
|
||||
|
||||
private fun setVkycAgentImageAndName() {
|
||||
this.vkycAgentStatus?.agentImage?.let {
|
||||
binding.customerExecutiveImage.setVisibilityState(GONE)
|
||||
binding.customerExecutiveView.setImageFieldData(it)
|
||||
}
|
||||
this.vkycAgentStatus?.agentConnectedToast?.let {
|
||||
binding.agentConnectedToast.setTextFieldData(it)
|
||||
binding.agentConnectedToast.setVisibilityState(VISIBLE)
|
||||
}
|
||||
Handler(Looper.getMainLooper()).postDelayed({
|
||||
binding.agentConnectedToast.setVisibilityState(GONE)
|
||||
}, this.vkycAgentStatus?.agentConnectedToastTimeout ?: 2500)
|
||||
this.vkycAgentStatus?.agentName?.let {
|
||||
binding.naviExecutiveText.setVisibilityState(GONE)
|
||||
binding.naviExecutiveName.setTextFieldData(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initObservers() {
|
||||
|
||||
@@ -42,16 +42,25 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_view" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/customerExecutiveView"
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/customerExecutiveViewCard"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
app:cardCornerRadius="@dimen/layout_dp_8"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:background="@drawable/vkyc_bg_white_radius_8"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal"
|
||||
android:elevation="0dp"
|
||||
app:layout_constraintStart_toStartOf="@id/videoSurfaceView"
|
||||
app:layout_constraintTop_toTopOf="@id/videoSurfaceView" />
|
||||
app:layout_constraintTop_toTopOf="@id/videoSurfaceView">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/customerExecutiveView"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
android:background="@drawable/vkyc_bg_white_radius_8"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/customerExecutiveImage"
|
||||
@@ -59,10 +68,11 @@
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:focusable="true"
|
||||
app:circularflow_radiusInDP="@dimen/dp_8"
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
app:layout_constraintBottom_toTopOf="@id/navi_executive_text"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveView"
|
||||
app:layout_constraintStart_toStartOf="@id/customerExecutiveView"
|
||||
app:layout_constraintTop_toTopOf="@id/customerExecutiveView"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintStart_toStartOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintTop_toTopOf="@id/customerExecutiveViewCard"
|
||||
app:srcCompat="@drawable/navi_executive" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
@@ -72,12 +82,30 @@
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
android:gravity="center"
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
android:text="@string/navi_executive"
|
||||
android:textColor="@color/textSecondaryColor"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@id/customerExecutiveView"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveView"
|
||||
app:layout_constraintStart_toStartOf="@id/customerExecutiveView" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintStart_toStartOf="@id/customerExecutiveViewCard" />
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/navi_executive_name"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:layout_marginHorizontal="@dimen/layout_dp_2"
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
android:gravity="center"
|
||||
android:text="@string/navi_executive"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/textSecondaryColor"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintStart_toStartOf="@id/customerExecutiveViewCard" />
|
||||
|
||||
<org.webrtc.SurfaceViewRenderer
|
||||
android:id="@+id/videoSurfaceViewExecutive"
|
||||
@@ -115,9 +143,10 @@
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
android:visibility="@{vm.customerExecutiveSpeaking?View.VISIBLE:View.GONE, default=gone}"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveView"
|
||||
app:layout_constraintTop_toTopOf="@id/customerExecutiveView"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintTop_toTopOf="@id/customerExecutiveViewCard"
|
||||
app:lottie_autoPlay="true"
|
||||
app:lottie_loop="true"
|
||||
app:lottie_rawRes="@raw/audio" />
|
||||
@@ -129,10 +158,13 @@
|
||||
android:background="@drawable/transparent_green_border_with_radius"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{vm.customerExecutiveSpeaking?View.VISIBLE:View.GONE, default=visible}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/customerExecutiveView"
|
||||
app:layout_constraintLeft_toLeftOf="@id/customerExecutiveView"
|
||||
app:layout_constraintRight_toRightOf="@id/customerExecutiveView"
|
||||
app:layout_constraintTop_toTopOf="@id/customerExecutiveView" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
app:layout_constraintLeft_toLeftOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintRight_toRightOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintTop_toTopOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/local_peer_audio_bg"
|
||||
@@ -192,7 +224,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="customerExecutiveView,face_guide_top" />
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
app:constraint_referenced_ids="customerExecutiveViewCard,face_guide_top" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="@dimen/dp_40"
|
||||
@@ -271,6 +304,26 @@
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/agentConnectedToast"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_20"
|
||||
android:paddingVertical="@dimen/dp_16"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="@dimen/layout_dp_24"
|
||||
android:background="@color/black"
|
||||
android:layout_marginBottom="@dimen/dp_32"
|
||||
android:fontFamily="@font/tt_semi_bold"
|
||||
android:textColor="@color/white"
|
||||
android:drawablePadding="@dimen/layout_dp_12"
|
||||
android:visibility="gone"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:elevation="@dimen/layout_dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/customerExecutiveViewCard"
|
||||
app:layout_constraintStart_toStartOf="@id/customerExecutiveViewCard" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
||||
@@ -663,6 +663,7 @@ object NaviWidgetIconUtils {
|
||||
private const val RIGHT_ARROW_WITH_YELLOW_CIRCLE_BG = "RIGHT_ARROW_WITH_YELLOW_CIRCLE_BG"
|
||||
private const val OUTLINED_INFO_ICON_BLACK_LARGE = "OUTLINED_INFO_ICON_BLACK_LARGE"
|
||||
private const val DOWNTIME_ICON_IMAGE = "DOWNTIME_ICON_IMAGE"
|
||||
private const val GREEN_CHECK_MARK_24 = "GREEN_CHECK_MARK_24"
|
||||
|
||||
fun updateIcon(
|
||||
imageDetail: ImageDetail,
|
||||
@@ -1359,6 +1360,7 @@ object NaviWidgetIconUtils {
|
||||
LOW_NETWORK_ICON -> R.drawable.ic_low_internet
|
||||
RIGHT_ARROW_WITH_YELLOW_CIRCLE_BG -> R.drawable.right_arrow_with_yellow_circle_bg
|
||||
DOWNTIME_ICON_IMAGE -> R.drawable.down_time_icon
|
||||
GREEN_CHECK_MARK_24 -> R.drawable.ic_check_mark_24
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
||||
47
navi-widgets/src/main/res/drawable/ic_check_mark_24.xml
Normal file
47
navi-widgets/src/main/res/drawable/ic_check_mark_24.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h20v20h-20z"/>
|
||||
<path
|
||||
android:pathData="M6.713,18.443C7.802,19.334 9.117,19.958 10.557,20.209L10.676,18.533C9.645,18.326 8.699,17.882 7.898,17.258L6.713,18.443Z"
|
||||
android:strokeAlpha="0.56"
|
||||
android:fillColor="#4B4968"
|
||||
android:fillAlpha="0.56"/>
|
||||
<path
|
||||
android:pathData="M5.369,12.833H3.688C3.855,14.507 4.525,16.031 5.535,17.265L6.718,16.082C6.003,15.16 5.522,14.047 5.369,12.833Z"
|
||||
android:strokeAlpha="0.8"
|
||||
android:fillColor="#4B4968"
|
||||
android:fillAlpha="0.8"/>
|
||||
<path
|
||||
android:pathData="M16.024,17.283L16.868,18.728C17.545,18.236 18.144,17.641 18.646,16.972L17.204,16.108C16.86,16.545 16.466,16.944 16.024,17.283Z"
|
||||
android:strokeAlpha="0.16"
|
||||
android:fillColor="#4B4968"
|
||||
android:fillAlpha="0.16"/>
|
||||
<path
|
||||
android:pathData="M12.338,18.65L12.22,20.322C13.363,20.289 14.446,20.017 15.429,19.568L14.588,18.126C13.891,18.423 13.132,18.607 12.338,18.65Z"
|
||||
android:strokeAlpha="0.32"
|
||||
android:fillColor="#4B4968"
|
||||
android:fillAlpha="0.32"/>
|
||||
<path
|
||||
android:pathData="M18.588,11.167H20.27C19.85,6.962 16.292,3.667 11.979,3.667C7.665,3.667 4.107,6.962 3.688,11.167H5.369C5.782,7.883 8.585,5.333 11.979,5.333C15.372,5.333 18.176,7.883 18.588,11.167Z"
|
||||
android:fillColor="#4B4968"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h20v20h-20z"/>
|
||||
<path
|
||||
android:pathData="M22,12C22,17.522 17.522,22 12,22C6.477,22 2,17.522 2,12C2,6.477 6.477,2 12,2C17.522,2 22,6.477 22,12Z"
|
||||
android:fillColor="#22A940"/>
|
||||
<path
|
||||
android:pathData="M8,12.556L10.556,15.111L15.667,10"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="1.53333"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
Reference in New Issue
Block a user