Added preview for TanImage

This commit is contained in:
dankito 2024-08-27 12:32:43 +02:00
parent 2c7c06bac6
commit 6e6eb91e74
1 changed files with 16 additions and 8 deletions

View File

@ -8,17 +8,25 @@ import net.codinux.banking.ui.model.TanChallengeReceived
@Preview
@Composable
fun EnterTanDialogPreview() {
// val tanMethod = TanMethod("photoTan", TanMethodType.photoTan, "910", 6, AllowedTanFormat.Numeric)
// val tanImage = TanImage("image/png", "")
//
// val customer = CustomerAccountViewInfo("10010010", "Ihr krasser Login Name", "Phantasie Bank")
//
// val tanChallenge = TanChallenge(TanChallengeType.Image, ActionRequiringTan.GetAccountInfo, "Geben Sie die TAN ein", tanMethod.identifier, listOf(tanMethod), null, emptyList(), tanImage, null, customer)
fun EnterTanDialogPreview_EnterTan() {
val tanMethods = listOf(TanMethod("Zeig mich an", TanMethodType.AppTan, "902"))
val customer = CustomerAccountViewInfo("12345678", "SupiDupiNutzer", "Abzockbank")
val tanChallenge = TanChallenge(TanChallengeType.EnterTan, ActionRequiringTan.GetAccountInfo, "Geben Sie die TAN ein", tanMethods.first().identifier, tanMethods, customer = customer)
EnterTanDialog(TanChallengeReceived(tanChallenge) { }) { }
}
@Preview
@Composable
fun EnterTanDialogPreview_TanImage() {
val tanImageBytes = "iVBORw0KGgoAAAANSUhEUgAAANYAAADWCAYAAACt43wuAAAOUUlEQVR42u2doW4cyRqFDQwN/AAGAYb7CAYBYQnPK0QKtRQYaikkIDzU0FIewTRSgGFAoKFBQGCve1fWjXI9V/fY35lqT3/HKmm3M1NTXTNHGX/5/zp7k1IK155boJTGUkpjKaWxlFIaSymNpZTGUkppLKU0llIaSymlsZTSWEppLKXUAGPd3NxMZ2dn08nJyfTs2bNpb2/P4XgyY/7MvnjxYvr06dP069evZRjr4uJiOjw89A1y7MQ4OjqaLi8vxxrr/PzcN8Oxc2N/f//R5nqwsa6vr6eDgwPfCMfO/s31mK+FDzbW6empb4Bjp8f8O9fWjXV8fOzmO3Z6zEBj68Zy4x1roIUay+EoDI3lc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dBNhnmvq9/2/62dHZ2tn1jff/+/UH/4OZwPIVxeHj4zz8sb91Ysz5+/Oib4NjJcTF3UD6m2Pex5SKzufyby7ErYy69Oz8/f3wVPVGLNX8tnH/nEmg4nuo4Pj6eTk9Pp+vra6Y9xRJNpXhpLKU0llIaSymNpZTSWEppLKU0llJKYymlsZTSWEopjaWUxlJKYymlQv0Now2p4n2VPN0AAAAASUVORK5CYII="
val tanMethod = TanMethod("photoTAN-Verfahren", TanMethodType.photoTan, "902", 6, AllowedTanFormat.Numeric)
val tanImage = TanImage("image/png", tanImageBytes)
val customer = CustomerAccountViewInfo("10010010", "Ihr krasser Login Name", "Phantasie Bank")
val tanChallenge = TanChallenge(TanChallengeType.Image, ActionRequiringTan.GetAccountInfo, "Geben Sie die TAN ein", tanMethod.identifier, listOf(tanMethod), null, emptyList(), tanImage, null, customer)
EnterTanDialog(TanChallengeReceived(tanChallenge) { }) { }
}