From 7cd31a4e99f4e1d0c105cdd1fc074a9916fb3578 Mon Sep 17 00:00:00 2001 From: Milan Barta Date: Thu, 9 Jan 2025 11:26:38 +0100 Subject: [PATCH] Rename to screenshot holder --- .../fragments/HotwireWebFragmentDelegate.kt | 12 ++++++------ ...wScreenshot.kt => HotwireViewScreenshotHolder.kt} | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) rename navigation-fragments/src/main/java/dev/hotwire/navigation/util/{HotwireViewScreenshot.kt => HotwireViewScreenshotHolder.kt} (98%) diff --git a/navigation-fragments/src/main/java/dev/hotwire/navigation/fragments/HotwireWebFragmentDelegate.kt b/navigation-fragments/src/main/java/dev/hotwire/navigation/fragments/HotwireWebFragmentDelegate.kt index 023b9ee..c07b4dd 100644 --- a/navigation-fragments/src/main/java/dev/hotwire/navigation/fragments/HotwireWebFragmentDelegate.kt +++ b/navigation-fragments/src/main/java/dev/hotwire/navigation/fragments/HotwireWebFragmentDelegate.kt @@ -20,7 +20,7 @@ import dev.hotwire.core.turbo.visit.VisitOptions import dev.hotwire.core.turbo.webview.HotwireWebView import dev.hotwire.navigation.destinations.HotwireDestination import dev.hotwire.navigation.session.SessionModalResult -import dev.hotwire.navigation.util.HotwireViewScreenshot +import dev.hotwire.navigation.util.HotwireViewScreenshotHolder import dev.hotwire.navigation.util.dispatcherProvider import dev.hotwire.navigation.views.HotwireView import kotlinx.coroutines.launch @@ -42,7 +42,7 @@ internal class HotwireWebFragmentDelegate( private val identifier = generateIdentifier() private var isInitialVisit = true private var isWebViewAttachedToNewDestination = false - private val screenshot = HotwireViewScreenshot() + private val screenshotHolder = HotwireViewScreenshotHolder() private var currentlyZoomed = false private val navigator get() = navDestination.navigator private val session get() = navigator.session @@ -280,8 +280,8 @@ internal class HotwireWebFragmentDelegate( initializePullToRefresh(this) initializeErrorPullToRefresh(this) - screenshot.showScreenshotIfAvailable(this, currentlyZoomed) - screenshot.reset() + screenshotHolder.showScreenshotIfAvailable(this, currentlyZoomed) + screenshotHolder.reset() } } @@ -408,8 +408,8 @@ internal class HotwireWebFragmentDelegate( private suspend fun screenshotView() { turboView?.let { - screenshot.captureScreenshot(it, navDestination.fragment, currentlyZoomed) - screenshot.showScreenshotIfAvailable(it, currentlyZoomed) + screenshotHolder.captureScreenshot(it, navDestination.fragment, currentlyZoomed) + screenshotHolder.showScreenshotIfAvailable(it, currentlyZoomed) } } diff --git a/navigation-fragments/src/main/java/dev/hotwire/navigation/util/HotwireViewScreenshot.kt b/navigation-fragments/src/main/java/dev/hotwire/navigation/util/HotwireViewScreenshotHolder.kt similarity index 98% rename from navigation-fragments/src/main/java/dev/hotwire/navigation/util/HotwireViewScreenshot.kt rename to navigation-fragments/src/main/java/dev/hotwire/navigation/util/HotwireViewScreenshotHolder.kt index 06d4a55..77d9fb0 100644 --- a/navigation-fragments/src/main/java/dev/hotwire/navigation/util/HotwireViewScreenshot.kt +++ b/navigation-fragments/src/main/java/dev/hotwire/navigation/util/HotwireViewScreenshotHolder.kt @@ -11,7 +11,7 @@ import dev.hotwire.navigation.views.HotwireView import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.suspendCancellableCoroutine -internal class HotwireViewScreenshot { +internal class HotwireViewScreenshotHolder { var bitmap: Bitmap? = null var screenshotOrientation = 0 var screenshotZoomed = false