Skip to content

Commit

Permalink
Update samples/animate-images-with-image-overlay/src/main/java/com/es…
Browse files Browse the repository at this point in the history
…ri/arcgismaps/sample/animateimageswithimageoverlay/components/AnimateImagesWithImageOverlayViewModel.kt

Co-authored-by: Shubham Sharma <shubhamsharma@esri.com>
  • Loading branch information
TADraeseke and shubham7109 authored Dec 23, 2024
1 parent f292e8c commit 07b70af
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ class AnimateImagesWithImageOverlayViewModel(application: Application) : Android
* Create a new image frame from the image at the current index and add it to the image overlay.
*/
private fun addNextImageFrameToImageOverlay() {
// set image frame to image overlay
imageOverlay.imageFrame = imageFrames[imageIndex]
// increment the index to keep track of which image to load next
imageIndex++
imageFrameIndex++
// reset index once all files have been loaded
if (imageIndex == imageFrames.size)
imageIndex = 0
if (imageFrameIndex == imageFrames.size)
imageFrameIndex = 0
// set the next image frame to image overlay
imageOverlay.imageFrame = imageFrames[imageFrameIndex]
}

/**
Expand Down

0 comments on commit 07b70af

Please sign in to comment.