NTP-37380 | PROD-CUGS-BUGS-ONBOARDING (#14995)
Co-authored-by: Sayed Owais Ali <sayed.owais@navi.com> Co-authored-by: sharmapoojabalrambhai <sharma.balrambhai@navi.com> Co-authored-by: saksham <saksham>
This commit is contained in:
@@ -121,17 +121,7 @@ abstract class SdkHandlingActivity :
|
||||
ResponseState.Idle,
|
||||
ResponseState.Loading -> Unit
|
||||
|
||||
is ResponseState.Success -> {
|
||||
documentCollectionSdkListenerStrategy
|
||||
?.getDocumentCollectionSdkListenerStrategy()
|
||||
?.onDocumentCollectionSdkSuccess(
|
||||
DocumentCollectorSdkExitData(
|
||||
status = state.value.status,
|
||||
code = state.value.code,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
is ResponseState.Success,
|
||||
is ResponseState.Exit -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
package com.navi.ap.common.vertical.investment.renderer
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Rect
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
@@ -212,22 +215,26 @@ class SignaturePadWidget {
|
||||
if (isManualMode) {
|
||||
signaturePad.signatureBitmap
|
||||
} else {
|
||||
Bitmap.createBitmap(
|
||||
signaturePad.width,
|
||||
signaturePad.height,
|
||||
Bitmap.Config.ARGB_8888,
|
||||
)
|
||||
.apply {
|
||||
val canvas = android.graphics.Canvas(this)
|
||||
val paint =
|
||||
android.graphics.Paint().apply {
|
||||
color = Color.Black.toArgb()
|
||||
textSize = 40f
|
||||
}
|
||||
canvas.drawText(defaultText, 0f, 40f, paint)
|
||||
val paint =
|
||||
Paint().apply {
|
||||
color = Color.Black.toArgb()
|
||||
textSize = 40f
|
||||
textAlign = Paint.Align.LEFT
|
||||
}
|
||||
val textBounds = Rect()
|
||||
paint.getTextBounds(defaultText, 0, defaultText.length, textBounds)
|
||||
val padding = 20
|
||||
val width = textBounds.width() + 2 * padding
|
||||
val height = textBounds.height() + 2 * padding
|
||||
|
||||
Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).apply {
|
||||
val canvas = Canvas(this)
|
||||
canvas.drawColor(Color.White.toArgb())
|
||||
canvas.drawText(defaultText, padding.toFloat(), (height / 2).toFloat(), paint)
|
||||
}
|
||||
}
|
||||
bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, outputStream)
|
||||
|
||||
bitmapImage.compress(Bitmap.CompressFormat.PNG, 70, outputStream)
|
||||
return outputStream.toByteArray()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user