Skip to content

Conversation

@davidjiagoogle
Copy link
Collaborator

@davidjiagoogle davidjiagoogle commented Feb 4, 2026

As titled
SnackBarUiState is moved from ui/uistate/capture to ui/uistate. SnackBarUiStateAdapter is moved to ui/uistateadapter. This is so that postcapture doesn't have to depend on capture

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @davidjiagoogle, 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 focuses on improving the documentation of the UI state definitions within the ui/uistate/capture module. By adding extensive KDoc comments, the intent, structure, and usage of various UI state classes are now clearly articulated, which will aid in future development and onboarding for this part of the codebase.

Highlights

  • KDoc Documentation Added: Comprehensive KDoc comments have been added to all classes, interfaces, data objects, and enums within the ui/uistate/capture package. This includes detailed descriptions for each UI state, its nested components, and their respective properties or parameters.
  • Improved Code Readability: The addition of KDocs significantly enhances the readability and maintainability of the UI state definitions, making it easier for developers to understand the purpose and usage of each UI state component.
  • Removed TODO Comments: An outdated // todo comment related to audio permission handling in AudioUiState.kt has been removed, replaced by a proper KDoc explanation.

🧠 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/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/AspectRatioUiState.kt
    • Added KDoc for AspectRatioUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/AudioUiState.kt
    • Added KDoc for AudioUiState sealed interface.
    • Added KDoc for amplitude property.
    • Added KDoc for Enabled sealed interface.
    • Added KDoc for On data class.
    • Added KDoc for Mute data object.
    • Added KDoc for Disabled data object.
    • Removed // todo comment.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/CaptureButtonUiState.kt
    • Added KDoc for CaptureButtonUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Enabled sealed interface.
    • Added KDoc for Idle data class and its parameter.
    • Added KDoc for Recording sealed interface.
    • Added KDoc for PressedRecording data object.
    • Added KDoc for LockedRecording data object.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/CaptureModeToggleUiState.kt
    • Added KDoc for CaptureModeToggleUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
    • Added KDoc for isCaptureModeSelectable extension function.
    • Added KDoc for findSelectableStateFor extension function.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/CaptureModeUiState.kt
    • Added KDoc for CaptureModeUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
    • Added KDoc for isCaptureModeSelectable extension function.
    • Added KDoc for findSelectableStateFor extension function.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ConcurrentCameraUiState.kt
    • Added KDoc for ConcurrentCameraUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/DebugUiState.kt
    • Added KDoc for DebugUiState sealed interface.
    • Added KDoc for Disabled data object.
    • Added KDoc for Enabled sealed interface and its properties.
    • Added KDoc for Closed data class.
    • Added KDoc for Open data class and its properties.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ElapsedTimeUiState.kt
    • Added KDoc for ElapsedTimeUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Enabled data class and its parameter.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/FlashModeUiState.kt
    • Added KDoc for FlashModeUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/FlipLensUiState.kt
    • Added KDoc for FlipLensUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/FocusMeteringUiState.kt
    • Added KDoc for FocusMeteringUiState sealed interface.
    • Added KDoc for Unspecified data object.
    • Added KDoc for Specified data class and its parameters.
    • Added KDoc for Status enum and its entries.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/HdrUiState.kt
    • Added KDoc for HdrUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ImageWellUiState.kt
    • Added KDoc for ImageWellUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for LastCapture data class and its parameter.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ScreenFlashUiState.kt
    • Added KDoc for ScreenFlashUiState data class and its parameters.
    • Removed an internal comment.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/SnackBarUiState.kt
    • Added KDoc for SnackBarUiState data class and its parameter.
    • Added KDoc for SnackbarData data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/StabilizationUiState.kt
    • Added KDoc for StabilizationUiState sealed interface.
    • Added KDoc for Disabled data object.
    • Added KDoc for Enabled sealed interface and its properties.
    • Added KDoc for Specific data class and its parameters.
    • Added KDoc for Auto data class and its parameter.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/StreamConfigUiState.kt
    • Added KDoc for StreamConfigUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ZoomControlUiState.kt
    • Added KDoc for ZoomControlUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Disabled data object.
    • Added KDoc for Enabled data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/ZoomUiState.kt
    • Added KDoc for ZoomUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Enabled data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/compound/CaptureUiState.kt
    • Added KDoc for CaptureUiState sealed interface.
    • Added KDoc for NotReady data object.
    • Added KDoc for Ready data class and its properties.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/compound/PreviewDisplayUiState.kt
    • Added KDoc for PreviewDisplayUiState data class and its parameters.
  • ui/uistate/capture/src/main/java/com/google/jetpackcamera/ui/uistate/capture/compound/QuickSettingsUiState.kt
    • Added KDoc for QuickSettingsUiState sealed interface.
    • Added KDoc for Unavailable data object.
    • Added KDoc for Available data class and its parameters.
    • Added KDoc for FocusedQuickSetting enum.
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 adds comprehensive KDoc documentation to numerous UI state classes, which is a great improvement for code clarity and maintainability. The added comments are clear and accurate. I've suggested a couple of minor enhancements to improve the robustness of the data classes by adding validation logic that aligns with the expectations set in the new documentation.

@temcguir
Copy link
Collaborator

temcguir commented Feb 5, 2026

/gemini review

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 primarily focuses on improving code documentation by adding KDocs to numerous UI state classes in the ui/uistate/capture module. Additionally, it refactors SnackBarUiState and its adapter out of the capture-specific modules into more general ui/uistate and ui/uistateadapter modules. This is a good architectural change that decouples the postcapture feature from the capture feature. The new KDocs are clear and will significantly improve maintainability. I've found one issue with the package name of the moved adapter file, which should be corrected for consistency.

@davidjiagoogle davidjiagoogle enabled auto-merge (squash) February 7, 2026 01:33
* @property flipLensUiState The UI state for the flip lens (front/back camera) button.
* @property snackBarUiState The UI state for the snack bar, used for showing messages to the user.
* @property previewDisplayUiState The UI state for the preview display.
* @property lastBlinkTimeStamp The timestamp of the last preview blink animation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @property lastBlinkTimeStamp The timestamp of the last preview blink animation.
* @property lastBlinkTimeStamp The timestamp of the last image capture blink animation.

* @property snackBarUiState The UI state for the snack bar, used for showing messages to the user.
* @property previewDisplayUiState The UI state for the preview display.
* @property lastBlinkTimeStamp The timestamp of the last preview blink animation.
* @property externalCaptureMode The external capture mode, if any, that launched the camera.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @property externalCaptureMode The external capture mode, if any, that launched the camera.
* @property externalCaptureMode The external capture mode used by the intent that launched the camera. Default is [ExternalCaptureMode.Standard].

* @property videoQuality The currently selected video quality.
* @property audioUiState The UI state for audio recording.
* @property elapsedTimeUiState The UI state for the elapsed time display during video recording.
* @property captureButtonUiState The UI state for the main capture button.
Copy link
Collaborator

Choose a reason for hiding this comment

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

main implies there is a secondary capture button, lets omit that word.

Suggested change
* @property captureButtonUiState The UI state for the main capture button.
* @property captureButtonUiState The UI state for the capture button.

* @property audioUiState The UI state for audio recording.
* @property elapsedTimeUiState The UI state for the elapsed time display during video recording.
* @property captureButtonUiState The UI state for the main capture button.
* @property imageWellUiState The UI state for the image well, which shows the last captured media.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @property imageWellUiState The UI state for the image well, which shows the last captured media.
* @property imageWellUiState The UI state for the image well, which displays a thumbnail of a captured media.

Comment on lines +23 to +24
* @param lastBlinkTimeStamp The timestamp of the last time the preview blinked. This is used to
* trigger the blink animation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @param lastBlinkTimeStamp The timestamp of the last time the preview blinked. This is used to
* trigger the blink animation.
* @param lastBlinkTimeStamp The timestamp of the most recent capture blink animation.

Comment on lines +29 to +30
* This sealed interface represents all possible states for the quick settings UI, which provides
* easy access to common camera settings like flash, aspect ratio, and more.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can just be deleted.

Suggested change
* This sealed interface represents all possible states for the quick settings UI, which provides
* easy access to common camera settings like flash, aspect ratio, and more.

Comment on lines +23 to +24
* This sealed interface represents the different states of the focus and metering UI, which
* includes tap-to-focus indicators and the general focus status.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* This sealed interface represents the different states of the focus and metering UI, which
* includes tap-to-focus indicators and the general focus status.
* This sealed interface represents the different states of the focus and metering UI

) : FocusMeteringUiState

/**
* Represents the status of a user-initiated focus and metering action.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is a good area to point directly as to what these Status enums correspond to and where those values come from, since it is a bit nonobvious

Comment on lines +21 to +24
* Defines the UI state for the image well, which displays the most recently captured media.
*
* This sealed interface represents the possible states of the image well, such as being
* unavailable or displaying information about the last capture.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Like i mentioned before, the ImageWellUiState and its corresponding component aren't aware of any of the context to the media.

Suggested change
* Defines the UI state for the image well, which displays the most recently captured media.
*
* This sealed interface represents the possible states of the image well, such as being
* unavailable or displaying information about the last capture.
* Defines the UI state for the image well, a component used to display the thumbnail of a captured media.

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.

3 participants