Skip to content

Conversation

@praneethatchana
Copy link

Made the changes to Remove the PiP implementation

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @praneethatchana, 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 systematically removes the Picture-in-Picture (PiP) functionality from the picture-in-picture sample application. The changes involve disabling PiP support at the manifest level and commenting out all associated code, including lifecycle callbacks, parameter updates, and entry points for PiP mode, across both PiPSampleActivity and PiPMovieActivity. The primary goal is to completely eliminate the PiP implementation from this sample.

Highlights

  • Manifest Configuration: Disabled Picture-in-Picture (PiP) support for both PiPSampleActivity and PiPMovieActivity by setting android:supportsPictureInPicture to false in the AndroidManifest.xml.
  • PiPMovieActivity Logic Removal: Commented out all PiP-related code within PiPMovieActivity.kt, including the updatePictureInPictureParams call, onPictureInPictureModeChanged, onPictureInPictureUiStateChanged overrides, and the minimize method's enterPictureInPictureMode call.
  • PiPSampleActivity Logic Removal: Commented out all PiP-related code within PiPSampleActivity.kt, such as the enterPictureInPictureMode call, updatePictureInPictureParams calls, trackPipAnimationHintView lifecycle observer, ActivityCompat.registerReceiver for PiP controls, and onPictureInPictureModeChanged and onPictureInPictureUiStateChanged overrides.

🧠 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.

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

The pull request disables Picture-in-Picture (PiP) functionality for PiPSampleActivity and PiPMovieActivity by setting android:supportsPictureInPicture="false" in the AndroidManifest.xml. Correspondingly, a substantial amount of PiP-related code, including method overrides (onPictureInPictureModeChanged, onPictureInPictureUiStateChanged), helper functions (updatePictureInPictureParams), and calls to enterPictureInPictureMode, trackPipAnimationHintView, and ActivityCompat.registerReceiver, has been commented out across PiPMovieActivity.kt and PiPSampleActivity.kt. The review comments consistently request that all this commented-out code be removed completely to enhance code clarity, readability, and maintainability, noting that version control systems are the appropriate place for historical code.

if (started) R.drawable.ic_pause_24dp else R.drawable.ic_play_arrow_24dp,
)
updatePictureInPictureParams(started)
// updatePictureInPictureParams(started)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This commented-out line should be removed. Keeping commented-out code can be confusing for other developers and reduces code quality.

Comment on lines +105 to +109
/* lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
trackPipAnimationHintView(binding.stopwatchBackground)
}
}
}*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This lifecycleScope.launch block is commented out. It's better to remove dead code entirely rather than commenting it out, to improve readability and maintainability.

Comment on lines +112 to +117
/*ActivityCompat.registerReceiver(
this,
broadcastReceiver,
IntentFilter(ACTION_STOPWATCH_CONTROL),
ContextCompat.RECEIVER_NOT_EXPORTED
)
)*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This ActivityCompat.registerReceiver call is commented out. Please remove it to avoid code clutter.

Comment on lines +121 to +129
/*override fun onPictureInPictureModeChanged(
isInPictureInPictureMode: Boolean,
newConfig: Configuration,
) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
// Toggle visibility of in-app buttons. They cannot be interacted in the picture-in-picture
// mode, and their features are provided as the action icons.
toggleControls(if (isInPictureInPictureMode) View.GONE else View.VISIBLE)
}
}*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The onPictureInPictureModeChanged method is commented out. It should be removed completely to keep the code clean.

Comment on lines +136 to +142
/* @RequiresApi(35)
override fun onPictureInPictureUiStateChanged(pipState: PictureInPictureUiState) {
super.onPictureInPictureUiStateChanged(pipState)
if (pipState.isTransitioningToPip) {
toggleControls(View.GONE)
}
}
}*/
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The onPictureInPictureUiStateChanged method is commented out. Please remove it instead of commenting it out.

@alabiaga
Copy link
Member

alabiaga commented Jan 7, 2026

@praneethatchana can we create this change for merging into a new branch, rather than into main. e.g. no_pip

Also, please remove the code entirely vs commenting it out. Thanks!

@praneethatchana praneethatchana deleted the Plarform_samples_PiP_Praneeth branch January 7, 2026 13:50
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