Skip to content

feat: Adding Qr-code Functionality in Cr-container for copying cr_user_id! - #284

Merged
amitsinghsutara merged 1 commit into
developfrom
AJ-735
Aug 6, 2026
Merged

feat: Adding Qr-code Functionality in Cr-container for copying cr_user_id!#284
amitsinghsutara merged 1 commit into
developfrom
AJ-735

Conversation

@amitsinghsutara

@amitsinghsutara amitsinghsutara commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Adding Qr-code Functionality in Cr-container for copying cr_user_id!

How to test

  • In order to test the changes user can open curious reader app and click on coches_icon and then see the qr code along with tap to copy functionality!

Ref: AJ-735

Summary by CodeRabbit

  • New Features

    • Added QR-code access for the app’s cached ID.
    • Tap the QR button to view the ID and its QR code in an overlay.
    • Tap the QR code or ID text to copy the formatted ID.
  • Bug Fixes

    • Added handling for empty IDs to prevent QR-code generation errors.

@amitsinghsutara
amitsinghsutara requested a review from dz4va August 6, 2026 07:28
@amitsinghsutara amitsinghsutara self-assigned this Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The app adds a QR-code button and overlay for the cached pseudo ID. Users can view the generated QR code and copy the formatted ID. ZXing is added, and the Gradle wrapper is upgraded.

Changes

QR ID display

Layer / File(s) Summary
QR generation setup
app/build.gradle, app/src/main/java/org/curiouslearning/container/MainActivity.java
ZXing 3.4.1 supports 512×512 QR bitmap generation. Empty IDs and writer failures are handled.
QR overlay flow
app/src/main/java/org/curiouslearning/container/MainActivity.java, app/src/main/res/layout*/activity_main.xml
MainActivity initializes the QR views, controls the overlay, and copies the formatted ID. All activity layouts provide the button and overlay UI.

Build tooling

Layer / File(s) Summary
Gradle configuration updates
app/build.gradle, gradle/wrapper/gradle-wrapper.properties
The Google Services declaration is reformatted, and the Gradle wrapper changes from 8.13 to 9.2.1.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: dz4va

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MainActivity
  participant QRCodeWriter
  participant qr_overlay
  participant ClipboardManager
  User->>MainActivity: Tap show_id_button
  MainActivity->>QRCodeWriter: Encode pseudo ID as QR bitmap
  MainActivity->>qr_overlay: Show QR image and formatted ID
  User->>MainActivity: Tap qr_image or qr_id_text
  MainActivity->>ClipboardManager: Copy formatted ID
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Tests & Lint & Coverage ⚠️ Warning The diff adds no test files or QR tests; no lint result is present; Jacoco only generates reports and defines no 70% threshold, and no coverage report exists. Add automated tests for QR display and clipboard behavior, run the project lint task, and enforce/report at least 70% Jacoco coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the QR-code functionality and copying of cr_user_id, and it uses the feat: prefix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch AJ-735

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/res/layout/activity_main.xml (1)

114-205: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Move QR UI text to string resources.

The new labels and instructions are hard-coded in all layout qualifiers. They cannot use resource-qualified translations and can diverge between layouts.

  • app/src/main/res/layout/activity_main.xml#L114-L205: Reference shared strings for the button description, QR description, and copy instruction.
  • app/src/main/res/layout-sw600dp/activity_main.xml#L121-L191: Reference the same shared strings.
  • app/src/main/res/layout-sw720dp/activity_main.xml#L122-L192: Reference the same shared strings.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/res/layout/activity_main.xml` around lines 114 - 205, Move the
hard-coded QR-related labels to shared string resources, then reference those
resources for the show-ID button content description, QR image content
description, and copy instruction in app/src/main/res/layout/activity_main.xml
lines 114-205, app/src/main/res/layout-sw600dp/activity_main.xml lines 121-191,
and app/src/main/res/layout-sw720dp/activity_main.xml lines 122-192. Use the
same resource keys across all three layouts so translations remain consistent.
🧹 Nitpick comments (1)
gradle/wrapper/gradle-wrapper.properties (1)

2-2: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Remove the stale AGP classpath declaration.

app/build.gradle applies id 'com.android.application' without a version, so Gradle resolves the 8.13.1 classpath from buildscript, not the 7.3.1 plugins declaration. 7.3.1 is still a redundant conflict; remove it to avoid accidental downgrade if this project is refactored.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gradle/wrapper/gradle-wrapper.properties` at line 2, Remove the stale Android
Gradle Plugin 7.3.1 declaration from the buildscript plugins configuration,
leaving the existing 8.13.1 classpath used by the com.android.application plugin
unchanged.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@app/src/main/res/layout/activity_main.xml`:
- Around line 114-205: Move the hard-coded QR-related labels to shared string
resources, then reference those resources for the show-ID button content
description, QR image content description, and copy instruction in
app/src/main/res/layout/activity_main.xml lines 114-205,
app/src/main/res/layout-sw600dp/activity_main.xml lines 121-191, and
app/src/main/res/layout-sw720dp/activity_main.xml lines 122-192. Use the same
resource keys across all three layouts so translations remain consistent.

---

Nitpick comments:
In `@gradle/wrapper/gradle-wrapper.properties`:
- Line 2: Remove the stale Android Gradle Plugin 7.3.1 declaration from the
buildscript plugins configuration, leaving the existing 8.13.1 classpath used by
the com.android.application plugin unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b5c6ceea-de40-4add-a3cb-b2efca4fc02b

📥 Commits

Reviewing files that changed from the base of the PR and between af7a783 and f8f3b58.

⛔ Files ignored due to path filters (1)
  • app/src/main/res/drawable/coaches_icon_cr.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • app/build.gradle
  • app/src/main/java/org/curiouslearning/container/MainActivity.java
  • app/src/main/res/layout-sw600dp/activity_main.xml
  • app/src/main/res/layout-sw720dp/activity_main.xml
  • app/src/main/res/layout/activity_main.xml
  • gradle/wrapper/gradle-wrapper.properties

@amitsinghsutara
amitsinghsutara merged commit 2b0f2dc into develop Aug 6, 2026
1 check passed
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