Skip to content

Add "Take a photo" option to the "+" FAB menu - #220

Merged
wernrab merged 1 commit into
opencloud-eu:mainfrom
Lightz2002:feat_take_a_photo
Aug 31, 2026
Merged

Add "Take a photo" option to the "+" FAB menu#220
wernrab merged 1 commit into
opencloud-eu:mainfrom
Lightz2002:feat_take_a_photo

Conversation

@Lightz2002

Copy link
Copy Markdown

Adds a dedicated "Take a photo" mini FAB to the "+" button menu, so users can
launch the camera and upload the capture directly — without going through
Upload → Picture from camera.

The existing camera option in the Upload bottom sheet remains unchanged.

Changes

  • main_file_list_fragment.xml: new fab_take_photo mini FAB with label,
    content description, and a new camera icon (ic_action_take_photo)
  • MainFileListFragment.kt:
    • registerFabTakePhotoListener() reuses the existing
      uploadActions?.uploadFromCamera() flow (FilesUploadHelper)
    • Wired into FAB expand/collapse focus handling and collapseFab()
    • Hidden together with Upload/New document when the current folder has no
      add-file permission; shown/hidden with the rest of the FAB group

Behavior

  • Tap "+" → "Take a photo" → system camera opens → captured photo is uploaded
    to the current folder (same path as Upload → Picture from camera)
  • No new permissions; still delegates to the system camera app via
    ACTION_IMAGE_CAPTURE

Copilot AI 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.

🟢 Approval recommended

The change is small, self-contained, and correctly reuses the existing camera-upload action while integrating cleanly with the existing FAB visibility/focus logic.

Pull request overview

Adds a new “Take a photo” mini-FAB entry to the existing “+” FloatingActionsMenu in the file list, enabling a one-tap path to the existing uploadFromCamera() flow from the FAB menu.

Changes:

  • Adds a new fab_take_photo string resource.
  • Introduces a new fab_take_photo mini FAB in main_file_list_fragment.xml with a dedicated camera vector icon.
  • Wires the new mini FAB into MainFileListFragment visibility, focus, expand/collapse, and click handling (delegating to uploadActions?.uploadFromCamera()).
File summaries
File Description
opencloudApp/src/main/res/values/strings.xml Adds label/content-description text for the new “Take a photo” mini FAB.
opencloudApp/src/main/res/layout/main_file_list_fragment.xml Adds the new fab_take_photo mini FAB entry to the “+” menu.
opencloudApp/src/main/res/drawable/ic_action_take_photo.xml Adds a new vector drawable icon used by the mini FAB.
opencloudApp/src/main/java/eu/opencloud/android/presentation/files/filelist/MainFileListFragment.kt Registers the new FAB click listener and integrates it into FAB visibility and focus handling.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wernrab
wernrab self-requested a review August 31, 2026 13:58
@wernrab

wernrab commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

It looks like this:

Screenshot_20260831_160257

Instead of using "Upload" and selecting "Picture from camera", the new button starts the camera immediately.

@wernrab wernrab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and reviewed, works as described.
@guruz: Your opinion from the UX perspective?

@guruz

guruz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

in iOS we have the same feature and the string is called "Take photo or video", does it make sense to align this @Lightz2002 ? Otherwise I agree with @wernrab feel free to merge or wait if @Lightz2002 wants to change the string.

@Lightz2002

Copy link
Copy Markdown
Author

@guruz currently this pr commit only can take photo when opening the camera (no video). Is it ok to stay with "Take a photo" ?

@wernrab
wernrab self-requested a review August 31, 2026 16:30
@wernrab
wernrab merged commit bd564ea into opencloud-eu:main Aug 31, 2026
3 of 4 checks passed
@guruz

guruz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution @Lightz2002

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