Skip to content

Comments

add documentation to :ui:components:capture#470

Open
Kimblebee wants to merge 9 commits intomainfrom
kim/docs/ui-capture
Open

add documentation to :ui:components:capture#470
Kimblebee wants to merge 9 commits intomainfrom
kim/docs/ui-capture

Conversation

@Kimblebee
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Kimblebee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the documentation and internal consistency of the ui:capture module. It introduces extensive KDoc for various UI components and utility functions, making the codebase easier to understand and use. Additionally, it refines the visibility of several internal elements and renames a key event handling utility for improved clarity and maintainability, without altering any functional behavior.

Highlights

  • Extensive KDoc Additions: Comprehensive KDoc has been added to numerous composable functions and classes across the ui:capture module, significantly improving code readability and maintainability for future developers.
  • Visibility Adjustments: Several internal composables and utility functions, such as CaptureButtonRing, DetectWindowColorModeChanges, and various quick setting components, have had their visibility restricted to private or internal. This promotes better encapsulation and a clearer public API surface.
  • Event Debouncer Renaming and Refinement: The MultipleEventsCutter class has been renamed to EventDebouncer and its associated file updated. This change, along with refined KDoc, more accurately reflects its purpose of preventing rapid-fire event executions and improves semantic clarity.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureButtonComponents.kt
    • Added KDoc for CaptureButton and changed its visibility to internal.
    • Changed CaptureButtonRing visibility to private.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureLayout.kt
    • Added KDoc for PreviewLayout.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureScreenComponents.kt
    • Added KDoc for ElapsedTimeText, PauseResumeToggleButton, AmplitudeToggleButton, CaptureModeToggleButton, TestableSnackbar, CaptureButton (wrapper), StabilizationIcon, VideoQualityIcon, and FlipCameraButton.
    • Changed visibility of DetectWindowColorModeChanges and FocusMeteringIndicator to private.
    • Renamed multipleEventsCutter to eventDebouncer and updated its usage.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/DebouncedOrientationFlow.kt
    • Added KDoc for debouncedOrientationFlow.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/DisabledReason.kt
    • Added KDoc for DisabledReason enum.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/EventDebouncer.kt
    • Renamed file from MultipleEventsCutter.kt to EventDebouncer.kt.
    • Renamed class from MultipleEventsCutter to EventDebouncer.
    • Updated KDoc for EventDebouncer class and processEvent function.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/ImageWell.kt
    • Added KDoc for ImageWell.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/ScreenFlashComponents.kt
    • Added KDoc for ScreenFlashScreen and ScreenFlashOverlay.
    • Changed visibility of ScreenFlashOverlay, BrightnessMaximization, BrightnessRestoration, getScreenBrightness, and setBrightness to private.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/ZoomBarComponents.kt
    • Added KDoc for ZoomButtonRow.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/ZoomState.kt
    • Updated KDoc for scaleZoom, incrementZoom, and animatedZoom to clarify parameters.
    • Added KDoc for onChangeLens.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/quicksettings/ui/QuickSettingsComponents.kt
    • Changed visibility of QuickSettingToggleButton (both instances), ExpandedQuickSetting, and TopBarQuickSettingIcon to private.
    • Added KDoc for QuickSettingsBottomSheet and updated KDoc for QuickSettingToggleButton.
  • ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/theme/Theme.kt
    • Added KDoc for PreviewPreviewTheme.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a great step towards improving the documentation and code quality of the :ui:capture module. The newly added KDoc comments significantly enhance the readability and maintainability of the components. The refactoring of MultipleEventsCutter to EventDebouncer and making several components private or internal are also excellent changes that improve code clarity and encapsulation. I have a couple of minor suggestions to make the documentation for callback parameters even more descriptive.

@Kimblebee Kimblebee changed the title add documentation to :ui:capture add documentation to :ui:components:capture Feb 6, 2026
@Kimblebee Kimblebee changed the base branch from main to kim/cleanup/ui-capture/api-visibility February 9, 2026 15:46
Base automatically changed from kim/cleanup/ui-capture/api-visibility to main February 11, 2026 17:29
/**
* A composable that provides a Material Design theme for previews within the Jetpack Camera App.
*
* This theme adapts to system dark mode settings and supports dynamic colors on Android 12+.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: This is technically true, but I don't think we'll need to support the light theme in the future. No need to change anything now, except for maybe adding a TODO to remove the ability to change the theme.

* @param onStartRecording the callback for a start recording event
* @param onStopRecording the callback for a stop recording event
* @param onLockVideoRecording The callback for a lock video recording event. The boolean parameter indicates if the recording should be locked.
* @param onIncrementZoom The callback for a zoom increment event, providing the zoom increment value.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: explain why there is a zoom option here. It seems out of place without explanation.

* A helper class that debounces events, preventing multiple rapid-fire executions.
*/
internal class MultipleEventsCutter {
internal class EventDebouncer {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I don't think this class is used currently. It can probably be deleted.

import com.google.jetpackcamera.model.LensToZoom
import com.google.jetpackcamera.model.ZoomStrategy

class ZoomState(
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this class is missing documentation.

}

/**
* A capture button that can be used for both image and video capture.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This description seems a little sparse. What are the different modes it can be in? What about the lock behavior?

}

/**
* A composable that displays the flip camera button.
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are a few composables that are documented like this. I think you should add a little more about the behavior of each composable. This description is already basically captured by virtue of the signature:

@Composable
fun FlipCameraButton(

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