Skip to content

Conversation

XDdevv
Copy link
Collaborator

@XDdevv XDdevv commented Sep 25, 2025

No description provided.

XDdevv and others added 12 commits September 17, 2025 16:04
…ment (#13)

* Develop into master (#9)

* Adds package for scanning

* Splash screen implemented for android

* Basic navigation implemented without screens but only sample texts about that screen

* Adds camera preview and permission handling

This commit introduces camera preview functionality using CameraX and handles camera permission requests.

Key changes:
- Added `CameraPreviewContent` composable to display the camera feed.
- Created `CameraPreviewViewModel` to manage camera state and bind to the lifecycle.
- Implemented `ScanningScreen` to request camera permission and display the preview.
- Updated `MainActivity` to use `ScanningScreen`.
- Added necessary CameraX and Accompanist permissions dependencies.
- Included camera permission and feature declarations in `AndroidManifest.xml`.
- Removed placeholder content from `App.kt`.

* Adds ViewModel for handling camera permissions

This commit introduces `PermissionsViewModel` to manage camera permission requests using the moko-permissions library.

Key changes:
- Created `PermissionsViewModel` to check and request camera permissions.
- Updated `composeApp/build.gradle.kts` to include `moko-permissions` and `moko-permissions-compose` dependencies.
- Added moko version to `gradle/libs.versions.toml`.

* Added dependencies for koin

* Integrates moko-permissions for camera permission handling

This commit introduces `moko-permissions` to manage camera permissions within the `ScanningScreen`.

* Adds permission dialog and integrates permission handling

* Refactors permission handling and camera preview

This commit refactors the permission handling logic and integrates the camera preview using `CameraXViewfinder`.

Key changes:
- Updated `MainActivity` to conditionally display `ScanningScreen` or `PermissionDialog` based on `permissionsViewModel.permissionState`.
- Modified `ScanningScreen` to use `CameraXViewfinder` to display the camera preview and bind to the camera lifecycle.
- Renamed parameters in `PermissionDialog` from `onCancel` to `onCloseApp` and `onDeleteClick` to `onGrantAccess` for clarity.

* Uses back camera for preview

This commit changes the camera preview to use the back camera instead of the front camera.

* Overlays UI elements on camera preview

This commit updates `ScanningScreen` to display a scanning window and instructional text over the camera preview.

* Adds the rounded camera feed

* Refactors `ScanningScreen` to common code and integrates cameraK library

This commit moves `ScanningScreen` to the commonMain source set, allowing for shared code between platforms. It also integrates the `cameraK` and `qr_scanner_plugin` libraries for camera and QR scanning functionalities.

* Removes unused front camera import

This commit removes an unused import for `DEFAULT_FRONT_CAMERA` from `CameraPreviewViewModel.kt`.

* Refactors permission handling and UI in `ScanningScreen`

* Integrates camera preview and permission handling in `ScanningScreen`

* Implemented detecting device screen detecting code and its working fine) (checked in tablet, mobile phone)

* Refactors permission handling in `ScanningScreen`

* Handles the snackbar to show only once when the permission has been granted

* Adds the QR reader

* Can scan qr codes

* Adds the custom snackbar with icon and green background. WIP

* Update ScanningScreen.kt

Add back the addPlugin(qrScannerPlugin)

* Introduces `CustomSnackbar` for displaying stylized messages

This commit adds a new `CustomSnackbar` composable and its associated `CustomSnackBarVisuals` data class. This allows for displaying snackbars with custom container and content colors, and an optional leading icon.

* Adds scanning ViewModel and actions

This commit introduces `ScanningViewModel` and `OnScanningActions` to handle QR code scanning logic and events. It also removes an extra newline from `ScanningScreen.kt`.

* Complete implementation for ScanResultScreen
New Font, drawables, typography ...

* Adds corner lines to scanning surface

* Adds the background color and font

* Updates snackbar styling

* Added clickable links with browser opening
Fix for TopAppBar displaying

* Fixes issue of the dialog box showing each time the user starts the app

* Fixes full screen issue

* Minor refactor

* Adds ViewModel for handling camera permissions

This commit introduces `PermissionsViewModel` to manage camera permission requests using the moko-permissions library.

Key changes:
- Created `PermissionsViewModel` to check and request camera permissions.
- Updated `composeApp/build.gradle.kts` to include `moko-permissions` and `moko-permissions-compose` dependencies.
- Added moko version to `gradle/libs.versions.toml`.

* Adds the PermissionsViewModel

* Integrates moko-permissions for camera permission handling

This commit introduces `moko-permissions` to manage camera permissions within the `ScanningScreen`.

* CenteredTopAppBar title

* Changed to use moko permissions

* Integrate DataStore for Snackbar display preference

This commit introduces `DataStore` to manage whether a snackbar indicating camera permission status has been shown.

- Added DataStore dependencies.
- Created a `PrefDataStore` typealias and a common `dataStoreFileName`.
- Implemented an Android-specific `createDataStore` extension for `Context`.
- Passed `PrefDataStore` instance down through `App`, `AppNavigation`, and `qrCraftNavigation` to `ScanningScreen`.
- In `ScanningScreen`, checked a boolean preference from `DataStore` before showing the "Camera permission granted" snackbar, and updated the preference after showing it.

* Splash screen icon was a bit crop by splash screen api, fixed that

* Milestone2 into develop (#8)

* Splash screen icon was a bit crop by splash screen api, fixed that

* CustomBottomBar with CreateQRChooseTypeScreen
New resources

* Registered qrModule and registered Application in manifest (because of crash :) )

* Updated Theme/typography according design requirements

* Implemented ObserveAsEvents utility function for receive one-time events from Channel/Flow

* Implemented Create QR Screen & left some comment to Steve and Denis )

* Add preview screen

* Adds more content to the layout

* Refactor QRContentLayout UI

This commit refactors the `QRContentLayout` composable.

- Wraps the content in a `Box` to allow for overlapping elements.
- Adds an `Image` at the top of the layout, positioned to overlap with the content below.
- Adjusts padding and spacing to accommodate the new image.
- Ensures the image has a background matching the theme and rounded corners.
- Updates content description for the copy button icon.

* Fix QRContentLayout copy button click handler

The `onShareClicked` handler was incorrectly assigned to the copy button. This commit corrects the `onClick` handler to use `onCopyClicked` for the copy button in `QRContentLayout`.

* feat: Enhance QRPreviewScreen with navigation and styling

This commit introduces several improvements to the `QRPreviewScreen`:

- Added a new `arrow_left.xml` drawable for the navigation icon.
- Implemented a `TopAppBar` in `QRPreviewScreen` with a centered "Preview" title and a back navigation icon using the new `arrow_left` drawable.
- Styled the `TopAppBar` with a white title and icon, and set its container color to `MaterialTheme.colorScheme.onSurface`.
- Set the `Scaffold` container color in `QRPreviewScreen` to `MaterialTheme.colorScheme.onSurface`.
- Added top padding to the content area of `QRPreviewScreen` to accommodate the `TopAppBar`.
- Updated the `QRContentLayout` in `QRPreviewScreen` to display sample title and details text.

* Refactor: Updated QRContentLayout and MainActivity

This commit refactors the `QRContentLayout` and `MainActivity`.

- In `QRContentLayout`:
    - Replaced `Image` with `QRCodeImage` for displaying the QR code.
    - Updated button colors and icon tints to use `MaterialTheme.colorScheme.background` and `MaterialTheme.colorScheme.onSurface` respectively.
    - Changed the background color of the main content box and the QR code image background.
- In `MainActivity`:
    - Removed the direct call to `QRPreviewScreen()`.
    - Re-enabled the `App` composable call, passing the `prefDataStore`.

* Refactor QRPreviewScreen to accept dynamic content

This commit updates `QRPreviewScreen` and its usage in `QRContentLayout` to accept `title`, `details`, and `qrContent` as parameters instead of using hardcoded values.

- Modified `QRPreviewScreen` to take `title`, `details`, and `qrContent` as arguments.
- Updated `QRContentLayout` to accept `qrContent` as a parameter.
- Adjusted the `QRPreviewScreenPreview` to pass sample data to the refactored `QRPreviewScreen`.

* Added bgGradient to Color scheme

* Replaced appTypography to MaterialTheme.typography

* Removed some comments and adds the url qr content

* Adds navigation for preview screen

* Refactor: Update QRPreviewScreen and QRContentLayout

This commit refactors the `QRPreviewScreen` and `QRContentLayout`.

- In `QRPreviewScreen`:
    - Replaced `TopAppBar` with `CenterAlignedTopAppBar` for a centered title.
    - Removed manual text alignment and `fillMaxWidth` modifier for the title as `CenterAlignedTopAppBar` handles this.
    - Removed redundant top padding from the content `Box` as `Scaffold` now handles this correctly with `CenterAlignedTopAppBar`.
- In `QRContentLayout`:
    - Removed an unnecessary `offset` modifier from the `QRCodeImage`.

* feat: Implement back navigation in QRPreviewScreen

This commit introduces back navigation functionality to the `QRPreviewScreen`.

* Refactor: Update QrPreview screen back navigation

This commit updates the back navigation behavior in the QrPreview screen.

* Refactor: Update QRPreviewScreen with dynamic content based on QR code type

* feat: Implement share functionality in QRPreviewScreen

- Imported `rememberShareManager` for handling share actions.
- Initialized `shareManager` within the `QRPreviewScreen` composable.
- Implemented the `onShareClicked` lambda in `QRContentLayout` to call `shareManager.shareText()` with the `title` when the share button is clicked.

* feat: Implement copy functionality in QRPreviewScreen

This commit introduces copy functionality to the `QRPreviewScreen`.

- Added `LocalClipboardManager` and `rememberCoroutineScope` to manage clipboard operations.
- Implemented the `onCopyClicked` lambda in `QRContentLayout` to copy the `details` text to the clipboard using `buildAnnotatedString`.

* Fix: Corrected share text in QRPreviewScreen

* feat: Add link handling to QR Preview and Content Layout

* Style title and details text in QRContentLayout

* feat: Introduce ExpandableText composable

This commit introduces a new composable function, `ExpandableText`.

- `ExpandableText` displays text that can be collapsed to a specified number of lines (`collapsedMaxLine`, defaults to 3).
- If the text overflows, a "Show more" indicator is displayed, which can be clicked to expand the text.
- The "Show more" text is styled with the primary color and bold font weight.
- The composable uses `animateContentSize` to smoothly transition between collapsed and expanded states.
- A preview `EchoExpandableTextPreview` is included to demonstrate the functionality.

* Refactor: Update ExpandableText and integrate with QRContentLayout

This commit introduces enhancements to the `ExpandableText` composable and integrates it into `QRContentLayout` for displaying non-link details.

* Refactor: Adapt QRPreviewScreen layout for tablet devices

This commit updates the `QRPreviewScreen` to adjust its layout based on the device type.

* Refactor: Replaced Scaffold with Column in QRPreviewScreen

* Refactor: Enhance QR content handling for text type

This commit introduces the handling of text-based QR content in the preview and content layout screens.

* The background for QRPreviewScreen.kt was not covering full screen, fixed that

* Applied full-screen preview for Scanning and removed bottom navigation background for Scanning screen

* Clean up some code

---------

Co-authored-by: XDdevv <[email protected]>
Co-authored-by: denisdavidek <[email protected]>

---------

Co-authored-by: XDdevv <[email protected]>
Co-authored-by: denisdavidek <[email protected]>

* Initial plan

* Initial repository exploration and setup

Co-authored-by: steve1rm <[email protected]>

* Create comprehensive .github/copilot-instructions.md with validated information

Co-authored-by: steve1rm <[email protected]>

---------

Co-authored-by: Steve <[email protected]>
Co-authored-by: XDdevv <[email protected]>
Co-authored-by: denisdavidek <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: steve1rm <[email protected]>
Redesigned buttons according to the new specification
New SnackBarWithIcon with onShowSnackBar lambda displaying
@XDdevv XDdevv requested a review from steve1rm September 25, 2025 17:01
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.

4 participants