Skip to content

Comments

Add QR code generation from text input#4

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-qr-code-generation-feature
Draft

Add QR code generation from text input#4
Copilot wants to merge 3 commits intomainfrom
copilot/add-qr-code-generation-feature

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

Adds a new screen for generating QR codes from arbitrary text input, complementing the existing scan functionality.

Changes

  • New dependency: ZXing core 3.5.3 for QR code encoding
  • GenerateQRViewModel: Encodes text to QR code bitmap via QRCodeWriter, uses bulk setPixels() for efficient bitmap creation
  • GenerateQRScreenLayout: Text input field, generate button, and rendered QR code display — styled consistently with existing screens (TopNavBar, shadow utilities, Material3 theming)
  • Navigation: GENERATE route added to AppScreen enum and NavHost
  • Main screen: Generate QR button added center-bottom in FooterTools (between gallery picker and history)

Usage flow

User taps the QR generate icon on the main screen → enters text → taps "Generate" (or keyboard done action) → QR code bitmap renders below.

// Core generation logic
val bitMatrix = QRCodeWriter().encode(text, BarcodeFormat.QR_CODE, size, size, hints)
val pixels = IntArray(size * size)
for (y in 0 until size) {
    for (x in 0 until size) {
        pixels[y * size + x] = if (bitMatrix[x, y]) Color.BLACK else Color.WHITE
    }
}
val bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888)
bitmap.setPixels(pixels, 0, size, 0, 0, size, size)

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.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=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.atomic=ALL-UNNAMED -Xmx4096m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.4-bin/1w5dpkrfk8irigvoxmyhowfim/gradle-8.4/lib/gradle-launcher-8.4.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.4-bin/1w5dpkrfk8irigvoxmyhowfim/gradle-8.4/lib/agents/gradle-instrumentation-agent-8.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.4 (dns block)

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

Original prompt

Add feature to generate qr code from input


✨ 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 2 commits February 14, 2026 22:56
- Add ZXing core library dependency for QR code generation
- Create GenerateQRViewModel with QR code bitmap generation logic
- Create GenerateQRScreenLayout with text input and QR code display
- Add Generate QR button to main screen footer tools
- Add navigation route for generate QR screen
- Add required string resources and drawable icon

Co-authored-by: dantech0xff <67886170+dantech0xff@users.noreply.github.com>
Use IntArray with bitmap.setPixels() instead of individual setPixel() calls
for better performance when generating QR code bitmaps.

Co-authored-by: dantech0xff <67886170+dantech0xff@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature to generate QR code from input Add QR code generation from text input Feb 14, 2026
Copilot AI requested a review from dantech0xff February 14, 2026 22:58
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