From 4884152faab35c1c359d665d092a6136f07f8c54 Mon Sep 17 00:00:00 2001 From: moon <56061215+MgKyawLay@users.noreply.github.com> Date: Mon, 20 Jul 2026 21:24:08 +0630 Subject: [PATCH] receipt print animate re-scale --- app/changelog.md | 3 ++- .../utsmyanmar/ui/print_receipt/PrintReceiptScreen.kt | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/changelog.md b/app/changelog.md index 240a07e..9da2a5f 100644 --- a/app/changelog.md +++ b/app/changelog.md @@ -6,4 +6,5 @@ * "Enter Password" color to LegacyRed * Amount and Card Number show in signature pad * fixed recent transaction only working for top 3 -* routed to dashboard after printing receipt \ No newline at end of file +* routed to dashboard after printing receipt +* receipt printing animation re-scale \ No newline at end of file diff --git a/app/src/main/java/com/mob/utsmyanmar/ui/print_receipt/PrintReceiptScreen.kt b/app/src/main/java/com/mob/utsmyanmar/ui/print_receipt/PrintReceiptScreen.kt index d79f5ec..b4e9bd6 100644 --- a/app/src/main/java/com/mob/utsmyanmar/ui/print_receipt/PrintReceiptScreen.kt +++ b/app/src/main/java/com/mob/utsmyanmar/ui/print_receipt/PrintReceiptScreen.kt @@ -44,9 +44,7 @@ import com.mob.utsmyanmar.ui.transaction_result.TransactionResultViewModel import com.mob.utsmyanmar.viewmodel.SharedViewModel import com.utsmyanmar.paylibs.utils.POSUtil import com.utsmyanmar.paylibs.utils.PrintStatus -import kotlinx.coroutines.delay import kotlinx.coroutines.launch -import kotlin.time.Duration.Companion.milliseconds private enum class ReceiptCopy(val label: String) { MERCHANT("MERCHANT COPY"), @@ -72,10 +70,10 @@ fun PrintReceiptScreen( suspend fun animatePrint() { receiptOffsetY.animateTo( - targetValue = -1500f, - animationSpec = tween(durationMillis = 5000, easing = FastOutSlowInEasing) + targetValue = -1400f, + animationSpec = tween(durationMillis = 4000, easing = FastOutSlowInEasing) ) - delay(1000.milliseconds) +// delay(1000.milliseconds) receiptOffsetY.animateTo( targetValue = 0f, animationSpec = tween(durationMillis = 0, easing = FastOutSlowInEasing) @@ -102,7 +100,7 @@ fun PrintReceiptScreen( isPrinting = false val upcomingCopy = if (reprint) ReceiptCopy.CUSTOMER else if (actualCopy == ReceiptCopy.MERCHANT) ReceiptCopy.CUSTOMER - else ReceiptCopy.MERCHANT + else ReceiptCopy.CUSTOMER currentCopy = upcomingCopy nextCopy = upcomingCopy