Skip to content

Commit

Permalink
Rename to screenshot holder
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarta committed Jan 9, 2025
1 parent 403b8b6 commit 7cd31a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -280,8 +280,8 @@ internal class HotwireWebFragmentDelegate(
initializePullToRefresh(this)
initializeErrorPullToRefresh(this)

screenshot.showScreenshotIfAvailable(this, currentlyZoomed)
screenshot.reset()
screenshotHolder.showScreenshotIfAvailable(this, currentlyZoomed)
screenshotHolder.reset()
}
}

Expand Down Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cd31a4

Please sign in to comment.