From 6b112830c33701a118155aa25f685796d7127e2c Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sat, 28 Nov 2026 19:48:56 +0100 Subject: [PATCH] Show the printing snackbar once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The print job's poll showed the "Printing…" snackbar again every second, so a new bar slid in each second until the job ended. It is now shown once when printing starts and dismissed when the job completes, fails or is cancelled. Fixes #484 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FW6WZZfQGJ4fuTzVR4DhYg --- .../droid/background/PrintingManager.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/app/opendocument/droid/background/PrintingManager.kt b/app/src/main/java/app/opendocument/droid/background/PrintingManager.kt index 1f5d5c928103..04a6331412bd 100644 --- a/app/src/main/java/app/opendocument/droid/background/PrintingManager.kt +++ b/app/src/main/java/app/opendocument/droid/background/PrintingManager.kt @@ -86,23 +86,24 @@ class PrintingManager { // cancelled and failed are ends too - waiting only for isCompleted polls // forever on the job the user dismissed if (printJob.isCompleted || printJob.isCancelled || printJob.isFailed) { + SnackbarHelper.dismiss(activity) finish() return } - SnackbarHelper.show( - activity, - R.string.crouton_printing, - null, - isIndefinite = false, - isError = false, - ) - backgroundHandler.postDelayed(this, 1000) } } + // once: showing it on every poll animated a new bar in each second (#484) + SnackbarHelper.show( + activity, + R.string.crouton_printing, + null, + isIndefinite = true, + isError = false, + ) checkPrintJob.run() }