Skip to content

Comments

Add dismissible ButtonSheet component with share and delete actions#15

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-10
Draft

Add dismissible ButtonSheet component with share and delete actions#15
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-10

Conversation

Copy link
Contributor

Copilot AI commented Sep 19, 2025

This PR implements a new ButtonSheet component that displays share and delete options in a Material3 bottom sheet that can be dismissed by tapping outside.

Changes Made

New ButtonSheet Component

  • Created ButtonSheet.kt in features/scan_result/presentation/components/
  • Uses ModalBottomSheet from Material3 for native bottom sheet behavior
  • Contains two action buttons: Share (with share icon) and Delete (with delete icon)
  • Delete button uses error color scheme to indicate destructive action
  • Automatically dismisses after button actions or when tapping outside

Resources Added

  • Added delete.svg icon to composeResources/files/ matching existing icon patterns
  • Icons loaded via AsyncImage using Res.getUri() pattern for consistency

Integration

  • Modified ScanResultScreen.kt to replace inline Share/Copy buttons
  • Added single "Actions" button that opens the ButtonSheet
  • Integrated with existing shareManager for share functionality
  • Added state management for sheet visibility with remember { mutableStateOf(false) }

Key Features

  • Two icons and texts: Share button (📤 + "Share") and Delete button (🗑️ + "Delete")
  • Outside dismissal: Tapping outside the sheet area dismisses it automatically
  • Material3 styling: Consistent with existing app design patterns
  • Reusable component: Can be easily extended with additional actions

Usage Example

ButtonSheet(
    isVisible = isButtonSheetVisible,
    onDismiss = { isButtonSheetVisible = false },
    onShareClicked = { shareManager.shareText(text = qrContent) },
    onDeleteClicked = { /* Handle delete action */ }
)

The implementation follows existing codebase patterns and provides a cleaner, more extensible UI for QR code actions.

Fixes #10.

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 --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.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx4096M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/agents/gradle-instrumentation-agent-8.13.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.13 (dns block)

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


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: steve1rm <14260802+steve1rm@users.noreply.github.com>
Copilot AI changed the title [WIP] make a button sheet Add dismissible ButtonSheet component with share and delete actions Sep 19, 2025
Copilot AI requested a review from steve1rm September 19, 2025 16:29
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.

make a button sheet

2 participants