Modern Apps git

← Modern-Apps.git

pdf: fix detekt findings

Commit
413e13289b9607b0aa24c3d50c467c2edb5555ba
Author
Vayun Mathur <[email protected]>
When
2026-11-17 15:16 UTC (18 days ago)
Parents
3dd3b24
Fixes every error-severity detekt finding in pdf (inventory clusters C3/C4): named constants for magic numbers, extracted functions/composables for long/complex methods, wrapped long lines, removed unused parameters, and narrowed/logged exception handling. No detekt config, baseline or suppression changes; behaviour preserved.

Verified: ./check pdf and :pdf:testDevUnitTest green.

Diff

pdf/src/main/java/com/vayunmathur/pdf/Navigation.kt
diff --git a/pdf/src/main/java/com/vayunmathur/pdf/Navigation.kt b/pdf/src/main/java/com/vayunmathur/pdf/Navigation.ktindex c8f8996308..8c46f1cc21 100644--- a/pdf/src/main/java/com/vayunmathur/pdf/Navigation.kt+++ b/pdf/src/main/java/com/vayunmathur/pdf/Navigation.kt@@ -80,6 +80,20 @@ fun Navigation(                 },             )         }+        captureEntries(viewModel, backStack, leaveCapture = { leaveCapture() })+        entry<Route.CutGlue>(metadata = DetailPage()) {+            CutGlueScreen(onBack = { backStack.pop() })+        }+    }+}+++/** Capture, captured-page and crop destinations. */+private fun com.vayunmathur.library.util.EntryProviderScope<Route>.captureEntries(+    viewModel: PdfViewModel,+    backStack: com.vayunmathur.library.util.NavBackStack<Route>,+    leaveCapture: () -> Unit,+) {         entry<Route.Capture>(metadata = DetailPage()) {             CapturePdfScreen(                 viewModel = viewModel,@@ -131,8 +145,4 @@ fun Navigation(                 LaunchedEffect(route.index) { backStack.pop() }             }         }-        entry<Route.CutGlue>(metadata = DetailPage()) {-            CutGlueScreen(onBack = { backStack.pop() })-        }-    } }
pdf/src/main/java/com/vayunmathur/pdf/util/PdfNative.kt
diff --git a/pdf/src/main/java/com/vayunmathur/pdf/util/PdfNative.kt b/pdf/src/main/java/com/vayunmathur/pdf/util/PdfNative.ktindex 9090405801..287cc59520 100644--- a/pdf/src/main/java/com/vayunmathur/pdf/util/PdfNative.kt+++ b/pdf/src/main/java/com/vayunmathur/pdf/util/PdfNative.kt@@ -1,4 +1,5 @@-// PACKAGE STRUCTURE EXCEPTION (JNI): FQN frozen for native symbol mangling (Java_com_vayunmathur_pdf_util_PdfNative_* in Rust jni_bindings)+// PACKAGE STRUCTURE EXCEPTION (JNI): FQN frozen for native symbol mangling+// (Java_com_vayunmathur_pdf_util_PdfNative_* in Rust jni_bindings) package com.vayunmathur.pdf.util import com.vayunmathur.library.log.Log