Skip to content

Add download and share for GIF files#1201

Draft
Copilot wants to merge 10 commits intomasterfrom
copilot/add-download-image-feature
Draft

Add download and share for GIF files#1201
Copilot wants to merge 10 commits intomasterfrom
copilot/add-download-image-feature

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Adds ability to download GIFs to Downloads folder and share them with other apps. Previously only URL copying was supported.

Implementation

UI Changes

  • Added "Download Image" and "Share Image" buttons in GIF overlay dialog alongside existing "Copy URL"
  • All three buttons arranged horizontally with even spacing

Download to Downloads folder

  • Uses MediaStore API for scoped storage (Android 10+)
  • No additional permissions required
  • Files named gif_<timestamp>.gif

Share via system share sheet

  • Downloads GIF, copies to app cache (shared_gifs/)
  • Uses FileProvider for secure URI sharing
  • Auto-cleanup of cached files older than 1 hour

Threading model

private suspend fun downloadGifFile(context: Context, gifUrl: String): File = 
  withContext(Dispatchers.IO) {
    suspendCancellableCoroutine { continuation ->
      val futureTarget = Glide.with(context).asFile().load(gifUrl).submit()
      continuation.invokeOnCancellation { futureTarget.cancel(true) }
      try {
        continuation.resume(futureTarget.get())
      } catch (e: Exception) {
        continuation.resumeWithException(e)
      }
    }
  }
  • File I/O on Dispatchers.IO
  • UI operations (startActivity, showSnackbar) on Dispatchers.Main
  • Proper cancellation support via suspendCancellableCoroutine

Configuration

  • FileProvider added to manifest
  • file_paths.xml configured for cache directory access
  • 5 new string resources for button labels and user feedback

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • scans-in.gradle.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Would be neat to be able to download (to Downloads folder/gallery) and share the GIF file itself with other apps instead of just the URL. 👀👌

#1100

Can we add this feature button next to "Copy URL"? We can make a "Download Image" ?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 9 commits February 1, 2026 23:55
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Co-authored-by: jaredsburrows <1739848+jaredsburrows@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability to download GIF files for sharing Add download and share for GIF files Feb 2, 2026
Copilot AI requested a review from jaredsburrows February 2, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments